1 | (function(e, a) { for(var i in a) e[i] = a[i]; }(exports, (function(modules) {
|
2 |
|
3 | var installedModules = {};
|
4 |
|
5 |
|
6 | function __webpack_require__(moduleId) {
|
7 |
|
8 |
|
9 | if(installedModules[moduleId]) {
|
10 | return installedModules[moduleId].exports;
|
11 | }
|
12 |
|
13 | var module = installedModules[moduleId] = {
|
14 | i: moduleId,
|
15 | l: false,
|
16 | exports: {}
|
17 | };
|
18 |
|
19 |
|
20 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
21 |
|
22 |
|
23 | module.l = true;
|
24 |
|
25 |
|
26 | return module.exports;
|
27 | }
|
28 |
|
29 |
|
30 |
|
31 | __webpack_require__.m = modules;
|
32 |
|
33 |
|
34 | __webpack_require__.c = installedModules;
|
35 |
|
36 |
|
37 | __webpack_require__.d = function(exports, name, getter) {
|
38 | if(!__webpack_require__.o(exports, name)) {
|
39 | Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
40 | }
|
41 | };
|
42 |
|
43 |
|
44 | __webpack_require__.r = function(exports) {
|
45 | if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
46 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
47 | }
|
48 | Object.defineProperty(exports, '__esModule', { value: true });
|
49 | };
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 | __webpack_require__.t = function(value, mode) {
|
57 | if(mode & 1) value = __webpack_require__(value);
|
58 | if(mode & 8) return value;
|
59 | if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
60 | var ns = Object.create(null);
|
61 | __webpack_require__.r(ns);
|
62 | Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
63 | if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
64 | return ns;
|
65 | };
|
66 |
|
67 |
|
68 | __webpack_require__.n = function(module) {
|
69 | var getter = module && module.__esModule ?
|
70 | function getDefault() { return module['default']; } :
|
71 | function getModuleExports() { return module; };
|
72 | __webpack_require__.d(getter, 'a', getter);
|
73 | return getter;
|
74 | };
|
75 |
|
76 |
|
77 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
78 |
|
79 |
|
80 | __webpack_require__.p = "";
|
81 |
|
82 |
|
83 |
|
84 | return __webpack_require__(__webpack_require__.s = 370);
|
85 | })
|
86 |
|
87 | ([
|
88 | ,
|
89 | ,
|
90 |
|
91 | (function(module, exports, __webpack_require__) {
|
92 |
|
93 | "use strict";
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 | function __export(m) {
|
101 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
102 | }
|
103 | Object.defineProperty(exports, "__esModule", { value: true });
|
104 | const vscode_languageserver_protocol_1 = __webpack_require__(3);
|
105 | exports.Event = vscode_languageserver_protocol_1.Event;
|
106 | const configuration_1 = __webpack_require__(33);
|
107 | const workspaceFolders_1 = __webpack_require__(35);
|
108 | const progress_1 = __webpack_require__(36);
|
109 | const Is = __webpack_require__(34);
|
110 | const UUID = __webpack_require__(37);
|
111 |
|
112 | __export(__webpack_require__(3));
|
113 | const fm = __webpack_require__(38);
|
114 | var Files;
|
115 | (function (Files) {
|
116 | Files.uriToFilePath = fm.uriToFilePath;
|
117 | Files.resolveGlobalNodePath = fm.resolveGlobalNodePath;
|
118 | Files.resolveGlobalYarnPath = fm.resolveGlobalYarnPath;
|
119 | Files.resolve = fm.resolve;
|
120 | Files.resolveModulePath = fm.resolveModulePath;
|
121 | })(Files = exports.Files || (exports.Files = {}));
|
122 | let shutdownReceived = false;
|
123 | let exitTimer = undefined;
|
124 | function setupExitTimer() {
|
125 | const argName = '--clientProcessId';
|
126 | function runTimer(value) {
|
127 | try {
|
128 | let processId = parseInt(value);
|
129 | if (!isNaN(processId)) {
|
130 | exitTimer = setInterval(() => {
|
131 | try {
|
132 | process.kill(processId, 0);
|
133 | }
|
134 | catch (ex) {
|
135 |
|
136 | process.exit(shutdownReceived ? 0 : 1);
|
137 | }
|
138 | }, 3000);
|
139 | }
|
140 | }
|
141 | catch (e) {
|
142 |
|
143 | }
|
144 | }
|
145 | for (let i = 2; i < process.argv.length; i++) {
|
146 | let arg = process.argv[i];
|
147 | if (arg === argName && i + 1 < process.argv.length) {
|
148 | runTimer(process.argv[i + 1]);
|
149 | return;
|
150 | }
|
151 | else {
|
152 | let args = arg.split('=');
|
153 | if (args[0] === argName) {
|
154 | runTimer(args[1]);
|
155 | }
|
156 | }
|
157 | }
|
158 | }
|
159 | setupExitTimer();
|
160 | function null2Undefined(value) {
|
161 | if (value === null) {
|
162 | return void 0;
|
163 | }
|
164 | return value;
|
165 | }
|
166 |
|
167 |
|
168 |
|
169 | class TextDocuments {
|
170 | |
171 |
|
172 |
|
173 | constructor(configuration) {
|
174 | this._documents = Object.create(null);
|
175 | this._configuration = configuration;
|
176 | this._onDidChangeContent = new vscode_languageserver_protocol_1.Emitter();
|
177 | this._onDidOpen = new vscode_languageserver_protocol_1.Emitter();
|
178 | this._onDidClose = new vscode_languageserver_protocol_1.Emitter();
|
179 | this._onDidSave = new vscode_languageserver_protocol_1.Emitter();
|
180 | this._onWillSave = new vscode_languageserver_protocol_1.Emitter();
|
181 | }
|
182 | |
183 |
|
184 |
|
185 |
|
186 | get onDidChangeContent() {
|
187 | return this._onDidChangeContent.event;
|
188 | }
|
189 | |
190 |
|
191 |
|
192 |
|
193 | get onDidOpen() {
|
194 | return this._onDidOpen.event;
|
195 | }
|
196 | |
197 |
|
198 |
|
199 |
|
200 | get onWillSave() {
|
201 | return this._onWillSave.event;
|
202 | }
|
203 | |
204 |
|
205 |
|
206 |
|
207 | onWillSaveWaitUntil(handler) {
|
208 | this._willSaveWaitUntil = handler;
|
209 | }
|
210 | |
211 |
|
212 |
|
213 |
|
214 | get onDidSave() {
|
215 | return this._onDidSave.event;
|
216 | }
|
217 | |
218 |
|
219 |
|
220 |
|
221 | get onDidClose() {
|
222 | return this._onDidClose.event;
|
223 | }
|
224 | |
225 |
|
226 |
|
227 |
|
228 |
|
229 |
|
230 |
|
231 | get(uri) {
|
232 | return this._documents[uri];
|
233 | }
|
234 | |
235 |
|
236 |
|
237 |
|
238 |
|
239 | all() {
|
240 | return Object.keys(this._documents).map(key => this._documents[key]);
|
241 | }
|
242 | |
243 |
|
244 |
|
245 |
|
246 |
|
247 | keys() {
|
248 | return Object.keys(this._documents);
|
249 | }
|
250 | |
251 |
|
252 |
|
253 |
|
254 |
|
255 |
|
256 | listen(connection) {
|
257 | connection.__textDocumentSync = vscode_languageserver_protocol_1.TextDocumentSyncKind.Full;
|
258 | connection.onDidOpenTextDocument((event) => {
|
259 | let td = event.textDocument;
|
260 | let document = this._configuration.create(td.uri, td.languageId, td.version, td.text);
|
261 | this._documents[td.uri] = document;
|
262 | let toFire = Object.freeze({ document });
|
263 | this._onDidOpen.fire(toFire);
|
264 | this._onDidChangeContent.fire(toFire);
|
265 | });
|
266 | connection.onDidChangeTextDocument((event) => {
|
267 | let td = event.textDocument;
|
268 | let changes = event.contentChanges;
|
269 | if (changes.length === 0) {
|
270 | return;
|
271 | }
|
272 | let document = this._documents[td.uri];
|
273 | const { version } = td;
|
274 | if (version === null || version === void 0) {
|
275 | throw new Error(`Received document change event for ${td.uri} without valid version identifier`);
|
276 | }
|
277 | document = this._configuration.update(document, changes, version);
|
278 | this._documents[td.uri] = document;
|
279 | this._onDidChangeContent.fire(Object.freeze({ document }));
|
280 | });
|
281 | connection.onDidCloseTextDocument((event) => {
|
282 | let document = this._documents[event.textDocument.uri];
|
283 | if (document) {
|
284 | delete this._documents[event.textDocument.uri];
|
285 | this._onDidClose.fire(Object.freeze({ document }));
|
286 | }
|
287 | });
|
288 | connection.onWillSaveTextDocument((event) => {
|
289 | let document = this._documents[event.textDocument.uri];
|
290 | if (document) {
|
291 | this._onWillSave.fire(Object.freeze({ document, reason: event.reason }));
|
292 | }
|
293 | });
|
294 | connection.onWillSaveTextDocumentWaitUntil((event, token) => {
|
295 | let document = this._documents[event.textDocument.uri];
|
296 | if (document && this._willSaveWaitUntil) {
|
297 | return this._willSaveWaitUntil(Object.freeze({ document, reason: event.reason }), token);
|
298 | }
|
299 | else {
|
300 | return [];
|
301 | }
|
302 | });
|
303 | connection.onDidSaveTextDocument((event) => {
|
304 | let document = this._documents[event.textDocument.uri];
|
305 | if (document) {
|
306 | this._onDidSave.fire(Object.freeze({ document }));
|
307 | }
|
308 | });
|
309 | }
|
310 | }
|
311 | exports.TextDocuments = TextDocuments;
|
312 |
|
313 |
|
314 |
|
315 |
|
316 |
|
317 |
|
318 | class ErrorMessageTracker {
|
319 | constructor() {
|
320 | this._messages = Object.create(null);
|
321 | }
|
322 | |
323 |
|
324 |
|
325 |
|
326 |
|
327 | add(message) {
|
328 | let count = this._messages[message];
|
329 | if (!count) {
|
330 | count = 0;
|
331 | }
|
332 | count++;
|
333 | this._messages[message] = count;
|
334 | }
|
335 | |
336 |
|
337 |
|
338 |
|
339 |
|
340 | sendErrors(connection) {
|
341 | Object.keys(this._messages).forEach(message => {
|
342 | connection.window.showErrorMessage(message);
|
343 | });
|
344 | }
|
345 | }
|
346 | exports.ErrorMessageTracker = ErrorMessageTracker;
|
347 | class RemoteConsoleImpl {
|
348 | constructor() {
|
349 | }
|
350 | rawAttach(connection) {
|
351 | this._rawConnection = connection;
|
352 | }
|
353 | attach(connection) {
|
354 | this._connection = connection;
|
355 | }
|
356 | get connection() {
|
357 | if (!this._connection) {
|
358 | throw new Error('Remote is not attached to a connection yet.');
|
359 | }
|
360 | return this._connection;
|
361 | }
|
362 | fillServerCapabilities(_capabilities) {
|
363 | }
|
364 | initialize(_capabilities) {
|
365 | }
|
366 | error(message) {
|
367 | this.send(vscode_languageserver_protocol_1.MessageType.Error, message);
|
368 | }
|
369 | warn(message) {
|
370 | this.send(vscode_languageserver_protocol_1.MessageType.Warning, message);
|
371 | }
|
372 | info(message) {
|
373 | this.send(vscode_languageserver_protocol_1.MessageType.Info, message);
|
374 | }
|
375 | log(message) {
|
376 | this.send(vscode_languageserver_protocol_1.MessageType.Log, message);
|
377 | }
|
378 | send(type, message) {
|
379 | if (this._rawConnection) {
|
380 | this._rawConnection.sendNotification(vscode_languageserver_protocol_1.LogMessageNotification.type, { type, message });
|
381 | }
|
382 | }
|
383 | }
|
384 | class _RemoteWindowImpl {
|
385 | constructor() {
|
386 | }
|
387 | attach(connection) {
|
388 | this._connection = connection;
|
389 | }
|
390 | get connection() {
|
391 | if (!this._connection) {
|
392 | throw new Error('Remote is not attached to a connection yet.');
|
393 | }
|
394 | return this._connection;
|
395 | }
|
396 | initialize(_capabilities) {
|
397 | }
|
398 | fillServerCapabilities(_capabilities) {
|
399 | }
|
400 | showErrorMessage(message, ...actions) {
|
401 | let params = { type: vscode_languageserver_protocol_1.MessageType.Error, message, actions };
|
402 | return this._connection.sendRequest(vscode_languageserver_protocol_1.ShowMessageRequest.type, params).then(null2Undefined);
|
403 | }
|
404 | showWarningMessage(message, ...actions) {
|
405 | let params = { type: vscode_languageserver_protocol_1.MessageType.Warning, message, actions };
|
406 | return this._connection.sendRequest(vscode_languageserver_protocol_1.ShowMessageRequest.type, params).then(null2Undefined);
|
407 | }
|
408 | showInformationMessage(message, ...actions) {
|
409 | let params = { type: vscode_languageserver_protocol_1.MessageType.Info, message, actions };
|
410 | return this._connection.sendRequest(vscode_languageserver_protocol_1.ShowMessageRequest.type, params).then(null2Undefined);
|
411 | }
|
412 | }
|
413 | const RemoteWindowImpl = progress_1.ProgressFeature(_RemoteWindowImpl);
|
414 | var BulkRegistration;
|
415 | (function (BulkRegistration) {
|
416 | |
417 |
|
418 |
|
419 |
|
420 | function create() {
|
421 | return new BulkRegistrationImpl();
|
422 | }
|
423 | BulkRegistration.create = create;
|
424 | })(BulkRegistration = exports.BulkRegistration || (exports.BulkRegistration = {}));
|
425 | class BulkRegistrationImpl {
|
426 | constructor() {
|
427 | this._registrations = [];
|
428 | this._registered = new Set();
|
429 | }
|
430 | add(type, registerOptions) {
|
431 | const method = Is.string(type) ? type : type.method;
|
432 | if (this._registered.has(method)) {
|
433 | throw new Error(`${method} is already added to this registration`);
|
434 | }
|
435 | const id = UUID.generateUuid();
|
436 | this._registrations.push({
|
437 | id: id,
|
438 | method: method,
|
439 | registerOptions: registerOptions || {}
|
440 | });
|
441 | this._registered.add(method);
|
442 | }
|
443 | asRegistrationParams() {
|
444 | return {
|
445 | registrations: this._registrations
|
446 | };
|
447 | }
|
448 | }
|
449 | var BulkUnregistration;
|
450 | (function (BulkUnregistration) {
|
451 | function create() {
|
452 | return new BulkUnregistrationImpl(undefined, []);
|
453 | }
|
454 | BulkUnregistration.create = create;
|
455 | })(BulkUnregistration = exports.BulkUnregistration || (exports.BulkUnregistration = {}));
|
456 | class BulkUnregistrationImpl {
|
457 | constructor(_connection, unregistrations) {
|
458 | this._connection = _connection;
|
459 | this._unregistrations = new Map();
|
460 | unregistrations.forEach(unregistration => {
|
461 | this._unregistrations.set(unregistration.method, unregistration);
|
462 | });
|
463 | }
|
464 | get isAttached() {
|
465 | return !!this._connection;
|
466 | }
|
467 | attach(connection) {
|
468 | this._connection = connection;
|
469 | }
|
470 | add(unregistration) {
|
471 | this._unregistrations.set(unregistration.method, unregistration);
|
472 | }
|
473 | dispose() {
|
474 | let unregistrations = [];
|
475 | for (let unregistration of this._unregistrations.values()) {
|
476 | unregistrations.push(unregistration);
|
477 | }
|
478 | let params = {
|
479 | unregisterations: unregistrations
|
480 | };
|
481 | this._connection.sendRequest(vscode_languageserver_protocol_1.UnregistrationRequest.type, params).then(undefined, (_error) => {
|
482 | this._connection.console.info(`Bulk unregistration failed.`);
|
483 | });
|
484 | }
|
485 | disposeSingle(arg) {
|
486 | const method = Is.string(arg) ? arg : arg.method;
|
487 | const unregistration = this._unregistrations.get(method);
|
488 | if (!unregistration) {
|
489 | return false;
|
490 | }
|
491 | let params = {
|
492 | unregisterations: [unregistration]
|
493 | };
|
494 | this._connection.sendRequest(vscode_languageserver_protocol_1.UnregistrationRequest.type, params).then(() => {
|
495 | this._unregistrations.delete(method);
|
496 | }, (_error) => {
|
497 | this._connection.console.info(`Unregistering request handler for ${unregistration.id} failed.`);
|
498 | });
|
499 | return true;
|
500 | }
|
501 | }
|
502 | class RemoteClientImpl {
|
503 | attach(connection) {
|
504 | this._connection = connection;
|
505 | }
|
506 | get connection() {
|
507 | if (!this._connection) {
|
508 | throw new Error('Remote is not attached to a connection yet.');
|
509 | }
|
510 | return this._connection;
|
511 | }
|
512 | initialize(_capabilities) {
|
513 | }
|
514 | fillServerCapabilities(_capabilities) {
|
515 | }
|
516 | register(typeOrRegistrations, registerOptionsOrType, registerOptions) {
|
517 | if (typeOrRegistrations instanceof BulkRegistrationImpl) {
|
518 | return this.registerMany(typeOrRegistrations);
|
519 | }
|
520 | else if (typeOrRegistrations instanceof BulkUnregistrationImpl) {
|
521 | return this.registerSingle1(typeOrRegistrations, registerOptionsOrType, registerOptions);
|
522 | }
|
523 | else {
|
524 | return this.registerSingle2(typeOrRegistrations, registerOptionsOrType);
|
525 | }
|
526 | }
|
527 | registerSingle1(unregistration, type, registerOptions) {
|
528 | const method = Is.string(type) ? type : type.method;
|
529 | const id = UUID.generateUuid();
|
530 | let params = {
|
531 | registrations: [{ id, method, registerOptions: registerOptions || {} }]
|
532 | };
|
533 | if (!unregistration.isAttached) {
|
534 | unregistration.attach(this._connection);
|
535 | }
|
536 | return this._connection.sendRequest(vscode_languageserver_protocol_1.RegistrationRequest.type, params).then((_result) => {
|
537 | unregistration.add({ id: id, method: method });
|
538 | return unregistration;
|
539 | }, (_error) => {
|
540 | this.connection.console.info(`Registering request handler for ${method} failed.`);
|
541 | return Promise.reject(_error);
|
542 | });
|
543 | }
|
544 | registerSingle2(type, registerOptions) {
|
545 | const method = Is.string(type) ? type : type.method;
|
546 | const id = UUID.generateUuid();
|
547 | let params = {
|
548 | registrations: [{ id, method, registerOptions: registerOptions || {} }]
|
549 | };
|
550 | return this._connection.sendRequest(vscode_languageserver_protocol_1.RegistrationRequest.type, params).then((_result) => {
|
551 | return vscode_languageserver_protocol_1.Disposable.create(() => {
|
552 | this.unregisterSingle(id, method);
|
553 | });
|
554 | }, (_error) => {
|
555 | this.connection.console.info(`Registering request handler for ${method} failed.`);
|
556 | return Promise.reject(_error);
|
557 | });
|
558 | }
|
559 | unregisterSingle(id, method) {
|
560 | let params = {
|
561 | unregisterations: [{ id, method }]
|
562 | };
|
563 | return this._connection.sendRequest(vscode_languageserver_protocol_1.UnregistrationRequest.type, params).then(undefined, (_error) => {
|
564 | this.connection.console.info(`Unregistering request handler for ${id} failed.`);
|
565 | });
|
566 | }
|
567 | registerMany(registrations) {
|
568 | let params = registrations.asRegistrationParams();
|
569 | return this._connection.sendRequest(vscode_languageserver_protocol_1.RegistrationRequest.type, params).then(() => {
|
570 | return new BulkUnregistrationImpl(this._connection, params.registrations.map(registration => { return { id: registration.id, method: registration.method }; }));
|
571 | }, (_error) => {
|
572 | this.connection.console.info(`Bulk registration failed.`);
|
573 | return Promise.reject(_error);
|
574 | });
|
575 | }
|
576 | }
|
577 | class _RemoteWorkspaceImpl {
|
578 | constructor() {
|
579 | }
|
580 | attach(connection) {
|
581 | this._connection = connection;
|
582 | }
|
583 | get connection() {
|
584 | if (!this._connection) {
|
585 | throw new Error('Remote is not attached to a connection yet.');
|
586 | }
|
587 | return this._connection;
|
588 | }
|
589 | initialize(_capabilities) {
|
590 | }
|
591 | fillServerCapabilities(_capabilities) {
|
592 | }
|
593 | applyEdit(paramOrEdit) {
|
594 | function isApplyWorkspaceEditParams(value) {
|
595 | return value && !!value.edit;
|
596 | }
|
597 | let params = isApplyWorkspaceEditParams(paramOrEdit) ? paramOrEdit : { edit: paramOrEdit };
|
598 | return this._connection.sendRequest(vscode_languageserver_protocol_1.ApplyWorkspaceEditRequest.type, params);
|
599 | }
|
600 | }
|
601 | const RemoteWorkspaceImpl = workspaceFolders_1.WorkspaceFoldersFeature(configuration_1.ConfigurationFeature(_RemoteWorkspaceImpl));
|
602 | class TelemetryImpl {
|
603 | constructor() {
|
604 | }
|
605 | attach(connection) {
|
606 | this._connection = connection;
|
607 | }
|
608 | get connection() {
|
609 | if (!this._connection) {
|
610 | throw new Error('Remote is not attached to a connection yet.');
|
611 | }
|
612 | return this._connection;
|
613 | }
|
614 | initialize(_capabilities) {
|
615 | }
|
616 | fillServerCapabilities(_capabilities) {
|
617 | }
|
618 | logEvent(data) {
|
619 | this._connection.sendNotification(vscode_languageserver_protocol_1.TelemetryEventNotification.type, data);
|
620 | }
|
621 | }
|
622 | class TracerImpl {
|
623 | constructor() {
|
624 | this._trace = vscode_languageserver_protocol_1.Trace.Off;
|
625 | }
|
626 | attach(connection) {
|
627 | this._connection = connection;
|
628 | }
|
629 | get connection() {
|
630 | if (!this._connection) {
|
631 | throw new Error('Remote is not attached to a connection yet.');
|
632 | }
|
633 | return this._connection;
|
634 | }
|
635 | initialize(_capabilities) {
|
636 | }
|
637 | fillServerCapabilities(_capabilities) {
|
638 | }
|
639 | set trace(value) {
|
640 | this._trace = value;
|
641 | }
|
642 | log(message, verbose) {
|
643 | if (this._trace === vscode_languageserver_protocol_1.Trace.Off) {
|
644 | return;
|
645 | }
|
646 | this._connection.sendNotification(vscode_languageserver_protocol_1.LogTraceNotification.type, {
|
647 | message: message,
|
648 | verbose: this._trace === vscode_languageserver_protocol_1.Trace.Verbose ? verbose : undefined
|
649 | });
|
650 | }
|
651 | }
|
652 | class LanguagesImpl {
|
653 | constructor() {
|
654 | }
|
655 | attach(connection) {
|
656 | this._connection = connection;
|
657 | }
|
658 | get connection() {
|
659 | if (!this._connection) {
|
660 | throw new Error('Remote is not attached to a connection yet.');
|
661 | }
|
662 | return this._connection;
|
663 | }
|
664 | initialize(_capabilities) {
|
665 | }
|
666 | fillServerCapabilities(_capabilities) {
|
667 | }
|
668 | attachWorkDoneProgress(params) {
|
669 | return progress_1.attachWorkDone(this.connection, params);
|
670 | }
|
671 | attachPartialResultProgress(_type, params) {
|
672 | return progress_1.attachPartialResult(this.connection, params);
|
673 | }
|
674 | }
|
675 | exports.LanguagesImpl = LanguagesImpl;
|
676 | function combineConsoleFeatures(one, two) {
|
677 | return function (Base) {
|
678 | return two(one(Base));
|
679 | };
|
680 | }
|
681 | exports.combineConsoleFeatures = combineConsoleFeatures;
|
682 | function combineTelemetryFeatures(one, two) {
|
683 | return function (Base) {
|
684 | return two(one(Base));
|
685 | };
|
686 | }
|
687 | exports.combineTelemetryFeatures = combineTelemetryFeatures;
|
688 | function combineTracerFeatures(one, two) {
|
689 | return function (Base) {
|
690 | return two(one(Base));
|
691 | };
|
692 | }
|
693 | exports.combineTracerFeatures = combineTracerFeatures;
|
694 | function combineClientFeatures(one, two) {
|
695 | return function (Base) {
|
696 | return two(one(Base));
|
697 | };
|
698 | }
|
699 | exports.combineClientFeatures = combineClientFeatures;
|
700 | function combineWindowFeatures(one, two) {
|
701 | return function (Base) {
|
702 | return two(one(Base));
|
703 | };
|
704 | }
|
705 | exports.combineWindowFeatures = combineWindowFeatures;
|
706 | function combineWorkspaceFeatures(one, two) {
|
707 | return function (Base) {
|
708 | return two(one(Base));
|
709 | };
|
710 | }
|
711 | exports.combineWorkspaceFeatures = combineWorkspaceFeatures;
|
712 | function combineLanguagesFeatures(one, two) {
|
713 | return function (Base) {
|
714 | return two(one(Base));
|
715 | };
|
716 | }
|
717 | exports.combineLanguagesFeatures = combineLanguagesFeatures;
|
718 | function combineFeatures(one, two) {
|
719 | function combine(one, two, func) {
|
720 | if (one && two) {
|
721 | return func(one, two);
|
722 | }
|
723 | else if (one) {
|
724 | return one;
|
725 | }
|
726 | else {
|
727 | return two;
|
728 | }
|
729 | }
|
730 | let result = {
|
731 | __brand: 'features',
|
732 | console: combine(one.console, two.console, combineConsoleFeatures),
|
733 | tracer: combine(one.tracer, two.tracer, combineTracerFeatures),
|
734 | telemetry: combine(one.telemetry, two.telemetry, combineTelemetryFeatures),
|
735 | client: combine(one.client, two.client, combineClientFeatures),
|
736 | window: combine(one.window, two.window, combineWindowFeatures),
|
737 | workspace: combine(one.workspace, two.workspace, combineWorkspaceFeatures)
|
738 | };
|
739 | return result;
|
740 | }
|
741 | exports.combineFeatures = combineFeatures;
|
742 | function createConnection(arg1, arg2, arg3, arg4) {
|
743 | let factories;
|
744 | let input;
|
745 | let output;
|
746 | let strategy;
|
747 | if (arg1 !== void 0 && arg1.__brand === 'features') {
|
748 | factories = arg1;
|
749 | arg1 = arg2;
|
750 | arg2 = arg3;
|
751 | arg3 = arg4;
|
752 | }
|
753 | if (vscode_languageserver_protocol_1.ConnectionStrategy.is(arg1)) {
|
754 | strategy = arg1;
|
755 | }
|
756 | else {
|
757 | input = arg1;
|
758 | output = arg2;
|
759 | strategy = arg3;
|
760 | }
|
761 | return _createConnection(input, output, strategy, factories);
|
762 | }
|
763 | exports.createConnection = createConnection;
|
764 | function _createConnection(input, output, strategy, factories) {
|
765 | if (!input && !output && process.argv.length > 2) {
|
766 | let port = void 0;
|
767 | let pipeName = void 0;
|
768 | let argv = process.argv.slice(2);
|
769 | for (let i = 0; i < argv.length; i++) {
|
770 | let arg = argv[i];
|
771 | if (arg === '--node-ipc') {
|
772 | input = new vscode_languageserver_protocol_1.IPCMessageReader(process);
|
773 | output = new vscode_languageserver_protocol_1.IPCMessageWriter(process);
|
774 | break;
|
775 | }
|
776 | else if (arg === '--stdio') {
|
777 | input = process.stdin;
|
778 | output = process.stdout;
|
779 | break;
|
780 | }
|
781 | else if (arg === '--socket') {
|
782 | port = parseInt(argv[i + 1]);
|
783 | break;
|
784 | }
|
785 | else if (arg === '--pipe') {
|
786 | pipeName = argv[i + 1];
|
787 | break;
|
788 | }
|
789 | else {
|
790 | var args = arg.split('=');
|
791 | if (args[0] === '--socket') {
|
792 | port = parseInt(args[1]);
|
793 | break;
|
794 | }
|
795 | else if (args[0] === '--pipe') {
|
796 | pipeName = args[1];
|
797 | break;
|
798 | }
|
799 | }
|
800 | }
|
801 | if (port) {
|
802 | let transport = vscode_languageserver_protocol_1.createServerSocketTransport(port);
|
803 | input = transport[0];
|
804 | output = transport[1];
|
805 | }
|
806 | else if (pipeName) {
|
807 | let transport = vscode_languageserver_protocol_1.createServerPipeTransport(pipeName);
|
808 | input = transport[0];
|
809 | output = transport[1];
|
810 | }
|
811 | }
|
812 | var commandLineMessage = 'Use arguments of createConnection or set command line parameters: \'--node-ipc\', \'--stdio\' or \'--socket={number}\'';
|
813 | if (!input) {
|
814 | throw new Error('Connection input stream is not set. ' + commandLineMessage);
|
815 | }
|
816 | if (!output) {
|
817 | throw new Error('Connection output stream is not set. ' + commandLineMessage);
|
818 | }
|
819 |
|
820 | if (Is.func(input.read) && Is.func(input.on)) {
|
821 | let inputStream = input;
|
822 | inputStream.on('end', () => {
|
823 | process.exit(shutdownReceived ? 0 : 1);
|
824 | });
|
825 | inputStream.on('close', () => {
|
826 | process.exit(shutdownReceived ? 0 : 1);
|
827 | });
|
828 | }
|
829 | const logger = (factories && factories.console ? new (factories.console(RemoteConsoleImpl))() : new RemoteConsoleImpl());
|
830 | const connection = vscode_languageserver_protocol_1.createProtocolConnection(input, output, logger, strategy);
|
831 | logger.rawAttach(connection);
|
832 | const tracer = (factories && factories.tracer ? new (factories.tracer(TracerImpl))() : new TracerImpl());
|
833 | const telemetry = (factories && factories.telemetry ? new (factories.telemetry(TelemetryImpl))() : new TelemetryImpl());
|
834 | const client = (factories && factories.client ? new (factories.client(RemoteClientImpl))() : new RemoteClientImpl());
|
835 | const remoteWindow = (factories && factories.window ? new (factories.window(RemoteWindowImpl))() : new RemoteWindowImpl());
|
836 | const workspace = (factories && factories.workspace ? new (factories.workspace(RemoteWorkspaceImpl))() : new RemoteWorkspaceImpl());
|
837 | const languages = (factories && factories.languages ? new (factories.languages(LanguagesImpl))() : new LanguagesImpl());
|
838 | const allRemotes = [logger, tracer, telemetry, client, remoteWindow, workspace, languages];
|
839 | function asPromise(value) {
|
840 | if (value instanceof Promise) {
|
841 | return value;
|
842 | }
|
843 | else if (Is.thenable(value)) {
|
844 | return new Promise((resolve, reject) => {
|
845 | value.then((resolved) => resolve(resolved), (error) => reject(error));
|
846 | });
|
847 | }
|
848 | else {
|
849 | return Promise.resolve(value);
|
850 | }
|
851 | }
|
852 | let shutdownHandler = undefined;
|
853 | let initializeHandler = undefined;
|
854 | let exitHandler = undefined;
|
855 | let protocolConnection = {
|
856 | listen: () => connection.listen(),
|
857 | sendRequest: (type, ...params) => connection.sendRequest(Is.string(type) ? type : type.method, ...params),
|
858 | onRequest: (type, handler) => connection.onRequest(type, handler),
|
859 | sendNotification: (type, param) => {
|
860 | const method = Is.string(type) ? type : type.method;
|
861 | if (arguments.length === 1) {
|
862 | connection.sendNotification(method);
|
863 | }
|
864 | else {
|
865 | connection.sendNotification(method, param);
|
866 | }
|
867 | },
|
868 | onNotification: (type, handler) => connection.onNotification(type, handler),
|
869 | onProgress: connection.onProgress,
|
870 | sendProgress: connection.sendProgress,
|
871 | onInitialize: (handler) => initializeHandler = handler,
|
872 | onInitialized: (handler) => connection.onNotification(vscode_languageserver_protocol_1.InitializedNotification.type, handler),
|
873 | onShutdown: (handler) => shutdownHandler = handler,
|
874 | onExit: (handler) => exitHandler = handler,
|
875 | get console() { return logger; },
|
876 | get telemetry() { return telemetry; },
|
877 | get tracer() { return tracer; },
|
878 | get client() { return client; },
|
879 | get window() { return remoteWindow; },
|
880 | get workspace() { return workspace; },
|
881 | get languages() { return languages; },
|
882 | onDidChangeConfiguration: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidChangeConfigurationNotification.type, handler),
|
883 | onDidChangeWatchedFiles: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidChangeWatchedFilesNotification.type, handler),
|
884 | __textDocumentSync: undefined,
|
885 | onDidOpenTextDocument: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidOpenTextDocumentNotification.type, handler),
|
886 | onDidChangeTextDocument: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidChangeTextDocumentNotification.type, handler),
|
887 | onDidCloseTextDocument: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidCloseTextDocumentNotification.type, handler),
|
888 | onWillSaveTextDocument: (handler) => connection.onNotification(vscode_languageserver_protocol_1.WillSaveTextDocumentNotification.type, handler),
|
889 | onWillSaveTextDocumentWaitUntil: (handler) => connection.onRequest(vscode_languageserver_protocol_1.WillSaveTextDocumentWaitUntilRequest.type, handler),
|
890 | onDidSaveTextDocument: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidSaveTextDocumentNotification.type, handler),
|
891 | sendDiagnostics: (params) => connection.sendNotification(vscode_languageserver_protocol_1.PublishDiagnosticsNotification.type, params),
|
892 | onHover: (handler) => connection.onRequest(vscode_languageserver_protocol_1.HoverRequest.type, (params, cancel) => {
|
893 | return handler(params, cancel, progress_1.attachWorkDone(connection, params), undefined);
|
894 | }),
|
895 | onCompletion: (handler) => connection.onRequest(vscode_languageserver_protocol_1.CompletionRequest.type, (params, cancel) => {
|
896 | return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
|
897 | }),
|
898 | onCompletionResolve: (handler) => connection.onRequest(vscode_languageserver_protocol_1.CompletionResolveRequest.type, handler),
|
899 | onSignatureHelp: (handler) => connection.onRequest(vscode_languageserver_protocol_1.SignatureHelpRequest.type, (params, cancel) => {
|
900 | return handler(params, cancel, progress_1.attachWorkDone(connection, params), undefined);
|
901 | }),
|
902 | onDeclaration: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DeclarationRequest.type, (params, cancel) => {
|
903 | return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
|
904 | }),
|
905 | onDefinition: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DefinitionRequest.type, (params, cancel) => {
|
906 | return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
|
907 | }),
|
908 | onTypeDefinition: (handler) => connection.onRequest(vscode_languageserver_protocol_1.TypeDefinitionRequest.type, (params, cancel) => {
|
909 | return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
|
910 | }),
|
911 | onImplementation: (handler) => connection.onRequest(vscode_languageserver_protocol_1.ImplementationRequest.type, (params, cancel) => {
|
912 | return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
|
913 | }),
|
914 | onReferences: (handler) => connection.onRequest(vscode_languageserver_protocol_1.ReferencesRequest.type, (params, cancel) => {
|
915 | return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
|
916 | }),
|
917 | onDocumentHighlight: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentHighlightRequest.type, (params, cancel) => {
|
918 | return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
|
919 | }),
|
920 | onDocumentSymbol: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentSymbolRequest.type, (params, cancel) => {
|
921 | return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
|
922 | }),
|
923 | onWorkspaceSymbol: (handler) => connection.onRequest(vscode_languageserver_protocol_1.WorkspaceSymbolRequest.type, (params, cancel) => {
|
924 | return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
|
925 | }),
|
926 | onCodeAction: (handler) => connection.onRequest(vscode_languageserver_protocol_1.CodeActionRequest.type, (params, cancel) => {
|
927 | return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
|
928 | }),
|
929 | onCodeLens: (handler) => connection.onRequest(vscode_languageserver_protocol_1.CodeLensRequest.type, (params, cancel) => {
|
930 | return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
|
931 | }),
|
932 | onCodeLensResolve: (handler) => connection.onRequest(vscode_languageserver_protocol_1.CodeLensResolveRequest.type, (params, cancel) => {
|
933 | return handler(params, cancel);
|
934 | }),
|
935 | onDocumentFormatting: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentFormattingRequest.type, (params, cancel) => {
|
936 | return handler(params, cancel, progress_1.attachWorkDone(connection, params), undefined);
|
937 | }),
|
938 | onDocumentRangeFormatting: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentRangeFormattingRequest.type, (params, cancel) => {
|
939 | return handler(params, cancel, progress_1.attachWorkDone(connection, params), undefined);
|
940 | }),
|
941 | onDocumentOnTypeFormatting: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentOnTypeFormattingRequest.type, (params, cancel) => {
|
942 | return handler(params, cancel);
|
943 | }),
|
944 | onRenameRequest: (handler) => connection.onRequest(vscode_languageserver_protocol_1.RenameRequest.type, (params, cancel) => {
|
945 | return handler(params, cancel, progress_1.attachWorkDone(connection, params), undefined);
|
946 | }),
|
947 | onPrepareRename: (handler) => connection.onRequest(vscode_languageserver_protocol_1.PrepareRenameRequest.type, (params, cancel) => {
|
948 | return handler(params, cancel);
|
949 | }),
|
950 | onDocumentLinks: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentLinkRequest.type, (params, cancel) => {
|
951 | return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
|
952 | }),
|
953 | onDocumentLinkResolve: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentLinkResolveRequest.type, (params, cancel) => {
|
954 | return handler(params, cancel);
|
955 | }),
|
956 | onDocumentColor: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentColorRequest.type, (params, cancel) => {
|
957 | return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
|
958 | }),
|
959 | onColorPresentation: (handler) => connection.onRequest(vscode_languageserver_protocol_1.ColorPresentationRequest.type, (params, cancel) => {
|
960 | return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
|
961 | }),
|
962 | onFoldingRanges: (handler) => connection.onRequest(vscode_languageserver_protocol_1.FoldingRangeRequest.type, (params, cancel) => {
|
963 | return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
|
964 | }),
|
965 | onSelectionRanges: (handler) => connection.onRequest(vscode_languageserver_protocol_1.SelectionRangeRequest.type, (params, cancel) => {
|
966 | return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
|
967 | }),
|
968 | onExecuteCommand: (handler) => connection.onRequest(vscode_languageserver_protocol_1.ExecuteCommandRequest.type, (params, cancel) => {
|
969 | return handler(params, cancel, progress_1.attachWorkDone(connection, params), undefined);
|
970 | }),
|
971 | dispose: () => connection.dispose()
|
972 | };
|
973 | for (let remote of allRemotes) {
|
974 | remote.attach(protocolConnection);
|
975 | }
|
976 | connection.onRequest(vscode_languageserver_protocol_1.InitializeRequest.type, (params) => {
|
977 | const processId = params.processId;
|
978 | if (Is.number(processId) && exitTimer === void 0) {
|
979 |
|
980 |
|
981 | setInterval(() => {
|
982 | try {
|
983 | process.kill(processId, 0);
|
984 | }
|
985 | catch (ex) {
|
986 |
|
987 | process.exit(shutdownReceived ? 0 : 1);
|
988 | }
|
989 | }, 3000);
|
990 | }
|
991 | if (Is.string(params.trace)) {
|
992 | tracer.trace = vscode_languageserver_protocol_1.Trace.fromString(params.trace);
|
993 | }
|
994 | for (let remote of allRemotes) {
|
995 | remote.initialize(params.capabilities);
|
996 | }
|
997 | if (initializeHandler) {
|
998 | let result = initializeHandler(params, new vscode_languageserver_protocol_1.CancellationTokenSource().token, progress_1.attachWorkDone(connection, params), undefined);
|
999 | return asPromise(result).then((value) => {
|
1000 | if (value instanceof vscode_languageserver_protocol_1.ResponseError) {
|
1001 | return value;
|
1002 | }
|
1003 | let result = value;
|
1004 | if (!result) {
|
1005 | result = { capabilities: {} };
|
1006 | }
|
1007 | let capabilities = result.capabilities;
|
1008 | if (!capabilities) {
|
1009 | capabilities = {};
|
1010 | result.capabilities = capabilities;
|
1011 | }
|
1012 | if (capabilities.textDocumentSync === void 0 || capabilities.textDocumentSync === null) {
|
1013 | capabilities.textDocumentSync = Is.number(protocolConnection.__textDocumentSync) ? protocolConnection.__textDocumentSync : vscode_languageserver_protocol_1.TextDocumentSyncKind.None;
|
1014 | }
|
1015 | else if (!Is.number(capabilities.textDocumentSync) && !Is.number(capabilities.textDocumentSync.change)) {
|
1016 | capabilities.textDocumentSync.change = Is.number(protocolConnection.__textDocumentSync) ? protocolConnection.__textDocumentSync : vscode_languageserver_protocol_1.TextDocumentSyncKind.None;
|
1017 | }
|
1018 | for (let remote of allRemotes) {
|
1019 | remote.fillServerCapabilities(capabilities);
|
1020 | }
|
1021 | return result;
|
1022 | });
|
1023 | }
|
1024 | else {
|
1025 | let result = { capabilities: { textDocumentSync: vscode_languageserver_protocol_1.TextDocumentSyncKind.None } };
|
1026 | for (let remote of allRemotes) {
|
1027 | remote.fillServerCapabilities(result.capabilities);
|
1028 | }
|
1029 | return result;
|
1030 | }
|
1031 | });
|
1032 | connection.onRequest(vscode_languageserver_protocol_1.ShutdownRequest.type, () => {
|
1033 | shutdownReceived = true;
|
1034 | if (shutdownHandler) {
|
1035 | return shutdownHandler(new vscode_languageserver_protocol_1.CancellationTokenSource().token);
|
1036 | }
|
1037 | else {
|
1038 | return undefined;
|
1039 | }
|
1040 | });
|
1041 | connection.onNotification(vscode_languageserver_protocol_1.ExitNotification.type, () => {
|
1042 | try {
|
1043 | if (exitHandler) {
|
1044 | exitHandler();
|
1045 | }
|
1046 | }
|
1047 | finally {
|
1048 | if (shutdownReceived) {
|
1049 | process.exit(0);
|
1050 | }
|
1051 | else {
|
1052 | process.exit(1);
|
1053 | }
|
1054 | }
|
1055 | });
|
1056 | connection.onNotification(vscode_languageserver_protocol_1.SetTraceNotification.type, (params) => {
|
1057 | tracer.trace = vscode_languageserver_protocol_1.Trace.fromString(params.value);
|
1058 | });
|
1059 | return protocolConnection;
|
1060 | }
|
1061 |
|
1062 | const callHierarchy_proposed_1 = __webpack_require__(42);
|
1063 | const st = __webpack_require__(43);
|
1064 | var ProposedFeatures;
|
1065 | (function (ProposedFeatures) {
|
1066 | ProposedFeatures.all = {
|
1067 | __brand: 'features',
|
1068 | languages: combineLanguagesFeatures(callHierarchy_proposed_1.CallHierarchyFeature, st.SemanticTokensFeature)
|
1069 | };
|
1070 | ProposedFeatures.SemanticTokensBuilder = st.SemanticTokensBuilder;
|
1071 | })(ProposedFeatures = exports.ProposedFeatures || (exports.ProposedFeatures = {}));
|
1072 |
|
1073 |
|
1074 | }),
|
1075 |
|
1076 | (function(module, exports, __webpack_require__) {
|
1077 |
|
1078 | "use strict";
|
1079 |
|
1080 |
|
1081 |
|
1082 |
|
1083 |
|
1084 | function __export(m) {
|
1085 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
1086 | }
|
1087 | Object.defineProperty(exports, "__esModule", { value: true });
|
1088 | const vscode_jsonrpc_1 = __webpack_require__(4);
|
1089 | exports.ErrorCodes = vscode_jsonrpc_1.ErrorCodes;
|
1090 | exports.ResponseError = vscode_jsonrpc_1.ResponseError;
|
1091 | exports.CancellationToken = vscode_jsonrpc_1.CancellationToken;
|
1092 | exports.CancellationTokenSource = vscode_jsonrpc_1.CancellationTokenSource;
|
1093 | exports.Disposable = vscode_jsonrpc_1.Disposable;
|
1094 | exports.Event = vscode_jsonrpc_1.Event;
|
1095 | exports.Emitter = vscode_jsonrpc_1.Emitter;
|
1096 | exports.Trace = vscode_jsonrpc_1.Trace;
|
1097 | exports.TraceFormat = vscode_jsonrpc_1.TraceFormat;
|
1098 | exports.SetTraceNotification = vscode_jsonrpc_1.SetTraceNotification;
|
1099 | exports.LogTraceNotification = vscode_jsonrpc_1.LogTraceNotification;
|
1100 | exports.RequestType = vscode_jsonrpc_1.RequestType;
|
1101 | exports.RequestType0 = vscode_jsonrpc_1.RequestType0;
|
1102 | exports.NotificationType = vscode_jsonrpc_1.NotificationType;
|
1103 | exports.NotificationType0 = vscode_jsonrpc_1.NotificationType0;
|
1104 | exports.MessageReader = vscode_jsonrpc_1.MessageReader;
|
1105 | exports.MessageWriter = vscode_jsonrpc_1.MessageWriter;
|
1106 | exports.ConnectionStrategy = vscode_jsonrpc_1.ConnectionStrategy;
|
1107 | exports.StreamMessageReader = vscode_jsonrpc_1.StreamMessageReader;
|
1108 | exports.StreamMessageWriter = vscode_jsonrpc_1.StreamMessageWriter;
|
1109 | exports.IPCMessageReader = vscode_jsonrpc_1.IPCMessageReader;
|
1110 | exports.IPCMessageWriter = vscode_jsonrpc_1.IPCMessageWriter;
|
1111 | exports.createClientPipeTransport = vscode_jsonrpc_1.createClientPipeTransport;
|
1112 | exports.createServerPipeTransport = vscode_jsonrpc_1.createServerPipeTransport;
|
1113 | exports.generateRandomPipeName = vscode_jsonrpc_1.generateRandomPipeName;
|
1114 | exports.createClientSocketTransport = vscode_jsonrpc_1.createClientSocketTransport;
|
1115 | exports.createServerSocketTransport = vscode_jsonrpc_1.createServerSocketTransport;
|
1116 | exports.ProgressType = vscode_jsonrpc_1.ProgressType;
|
1117 | __export(__webpack_require__(18));
|
1118 | __export(__webpack_require__(19));
|
1119 | const callHierarchy = __webpack_require__(31);
|
1120 | const st = __webpack_require__(32);
|
1121 | var Proposed;
|
1122 | (function (Proposed) {
|
1123 | let CallHierarchyPrepareRequest;
|
1124 | (function (CallHierarchyPrepareRequest) {
|
1125 | CallHierarchyPrepareRequest.method = callHierarchy.CallHierarchyPrepareRequest.method;
|
1126 | CallHierarchyPrepareRequest.type = callHierarchy.CallHierarchyPrepareRequest.type;
|
1127 | })(CallHierarchyPrepareRequest = Proposed.CallHierarchyPrepareRequest || (Proposed.CallHierarchyPrepareRequest = {}));
|
1128 | let CallHierarchyIncomingCallsRequest;
|
1129 | (function (CallHierarchyIncomingCallsRequest) {
|
1130 | CallHierarchyIncomingCallsRequest.method = callHierarchy.CallHierarchyIncomingCallsRequest.method;
|
1131 | CallHierarchyIncomingCallsRequest.type = callHierarchy.CallHierarchyIncomingCallsRequest.type;
|
1132 | })(CallHierarchyIncomingCallsRequest = Proposed.CallHierarchyIncomingCallsRequest || (Proposed.CallHierarchyIncomingCallsRequest = {}));
|
1133 | let CallHierarchyOutgoingCallsRequest;
|
1134 | (function (CallHierarchyOutgoingCallsRequest) {
|
1135 | CallHierarchyOutgoingCallsRequest.method = callHierarchy.CallHierarchyOutgoingCallsRequest.method;
|
1136 | CallHierarchyOutgoingCallsRequest.type = callHierarchy.CallHierarchyOutgoingCallsRequest.type;
|
1137 | })(CallHierarchyOutgoingCallsRequest = Proposed.CallHierarchyOutgoingCallsRequest || (Proposed.CallHierarchyOutgoingCallsRequest = {}));
|
1138 | Proposed.SemanticTokenTypes = st.SemanticTokenTypes;
|
1139 | Proposed.SemanticTokenModifiers = st.SemanticTokenModifiers;
|
1140 | Proposed.SemanticTokens = st.SemanticTokens;
|
1141 | let SemanticTokensRequest;
|
1142 | (function (SemanticTokensRequest) {
|
1143 | SemanticTokensRequest.method = st.SemanticTokensRequest.method;
|
1144 | SemanticTokensRequest.type = st.SemanticTokensRequest.type;
|
1145 | })(SemanticTokensRequest = Proposed.SemanticTokensRequest || (Proposed.SemanticTokensRequest = {}));
|
1146 | let SemanticTokensEditsRequest;
|
1147 | (function (SemanticTokensEditsRequest) {
|
1148 | SemanticTokensEditsRequest.method = st.SemanticTokensEditsRequest.method;
|
1149 | SemanticTokensEditsRequest.type = st.SemanticTokensEditsRequest.type;
|
1150 | })(SemanticTokensEditsRequest = Proposed.SemanticTokensEditsRequest || (Proposed.SemanticTokensEditsRequest = {}));
|
1151 | let SemanticTokensRangeRequest;
|
1152 | (function (SemanticTokensRangeRequest) {
|
1153 | SemanticTokensRangeRequest.method = st.SemanticTokensRangeRequest.method;
|
1154 | SemanticTokensRangeRequest.type = st.SemanticTokensRangeRequest.type;
|
1155 | })(SemanticTokensRangeRequest = Proposed.SemanticTokensRangeRequest || (Proposed.SemanticTokensRangeRequest = {}));
|
1156 | })(Proposed = exports.Proposed || (exports.Proposed = {}));
|
1157 | function createProtocolConnection(reader, writer, logger, strategy) {
|
1158 | return vscode_jsonrpc_1.createMessageConnection(reader, writer, logger, strategy);
|
1159 | }
|
1160 | exports.createProtocolConnection = createProtocolConnection;
|
1161 |
|
1162 |
|
1163 | }),
|
1164 |
|
1165 | (function(module, exports, __webpack_require__) {
|
1166 |
|
1167 | "use strict";
|
1168 |
|
1169 |
|
1170 |
|
1171 |
|
1172 |
|
1173 |
|
1174 | function __export(m) {
|
1175 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
1176 | }
|
1177 | Object.defineProperty(exports, "__esModule", { value: true });
|
1178 | const Is = __webpack_require__(5);
|
1179 | const messages_1 = __webpack_require__(6);
|
1180 | exports.RequestType = messages_1.RequestType;
|
1181 | exports.RequestType0 = messages_1.RequestType0;
|
1182 | exports.RequestType1 = messages_1.RequestType1;
|
1183 | exports.RequestType2 = messages_1.RequestType2;
|
1184 | exports.RequestType3 = messages_1.RequestType3;
|
1185 | exports.RequestType4 = messages_1.RequestType4;
|
1186 | exports.RequestType5 = messages_1.RequestType5;
|
1187 | exports.RequestType6 = messages_1.RequestType6;
|
1188 | exports.RequestType7 = messages_1.RequestType7;
|
1189 | exports.RequestType8 = messages_1.RequestType8;
|
1190 | exports.RequestType9 = messages_1.RequestType9;
|
1191 | exports.ResponseError = messages_1.ResponseError;
|
1192 | exports.ErrorCodes = messages_1.ErrorCodes;
|
1193 | exports.NotificationType = messages_1.NotificationType;
|
1194 | exports.NotificationType0 = messages_1.NotificationType0;
|
1195 | exports.NotificationType1 = messages_1.NotificationType1;
|
1196 | exports.NotificationType2 = messages_1.NotificationType2;
|
1197 | exports.NotificationType3 = messages_1.NotificationType3;
|
1198 | exports.NotificationType4 = messages_1.NotificationType4;
|
1199 | exports.NotificationType5 = messages_1.NotificationType5;
|
1200 | exports.NotificationType6 = messages_1.NotificationType6;
|
1201 | exports.NotificationType7 = messages_1.NotificationType7;
|
1202 | exports.NotificationType8 = messages_1.NotificationType8;
|
1203 | exports.NotificationType9 = messages_1.NotificationType9;
|
1204 | const messageReader_1 = __webpack_require__(7);
|
1205 | exports.MessageReader = messageReader_1.MessageReader;
|
1206 | exports.StreamMessageReader = messageReader_1.StreamMessageReader;
|
1207 | exports.IPCMessageReader = messageReader_1.IPCMessageReader;
|
1208 | exports.SocketMessageReader = messageReader_1.SocketMessageReader;
|
1209 | const messageWriter_1 = __webpack_require__(9);
|
1210 | exports.MessageWriter = messageWriter_1.MessageWriter;
|
1211 | exports.StreamMessageWriter = messageWriter_1.StreamMessageWriter;
|
1212 | exports.IPCMessageWriter = messageWriter_1.IPCMessageWriter;
|
1213 | exports.SocketMessageWriter = messageWriter_1.SocketMessageWriter;
|
1214 | const events_1 = __webpack_require__(8);
|
1215 | exports.Disposable = events_1.Disposable;
|
1216 | exports.Event = events_1.Event;
|
1217 | exports.Emitter = events_1.Emitter;
|
1218 | const cancellation_1 = __webpack_require__(10);
|
1219 | exports.CancellationTokenSource = cancellation_1.CancellationTokenSource;
|
1220 | exports.CancellationToken = cancellation_1.CancellationToken;
|
1221 | const linkedMap_1 = __webpack_require__(11);
|
1222 | __export(__webpack_require__(12));
|
1223 | __export(__webpack_require__(17));
|
1224 | var CancelNotification;
|
1225 | (function (CancelNotification) {
|
1226 | CancelNotification.type = new messages_1.NotificationType('$/cancelRequest');
|
1227 | })(CancelNotification || (CancelNotification = {}));
|
1228 | var ProgressNotification;
|
1229 | (function (ProgressNotification) {
|
1230 | ProgressNotification.type = new messages_1.NotificationType('$/progress');
|
1231 | })(ProgressNotification || (ProgressNotification = {}));
|
1232 | class ProgressType {
|
1233 | constructor() {
|
1234 | }
|
1235 | }
|
1236 | exports.ProgressType = ProgressType;
|
1237 | exports.NullLogger = Object.freeze({
|
1238 | error: () => { },
|
1239 | warn: () => { },
|
1240 | info: () => { },
|
1241 | log: () => { }
|
1242 | });
|
1243 | var Trace;
|
1244 | (function (Trace) {
|
1245 | Trace[Trace["Off"] = 0] = "Off";
|
1246 | Trace[Trace["Messages"] = 1] = "Messages";
|
1247 | Trace[Trace["Verbose"] = 2] = "Verbose";
|
1248 | })(Trace = exports.Trace || (exports.Trace = {}));
|
1249 | (function (Trace) {
|
1250 | function fromString(value) {
|
1251 | if (!Is.string(value)) {
|
1252 | return Trace.Off;
|
1253 | }
|
1254 | value = value.toLowerCase();
|
1255 | switch (value) {
|
1256 | case 'off':
|
1257 | return Trace.Off;
|
1258 | case 'messages':
|
1259 | return Trace.Messages;
|
1260 | case 'verbose':
|
1261 | return Trace.Verbose;
|
1262 | default:
|
1263 | return Trace.Off;
|
1264 | }
|
1265 | }
|
1266 | Trace.fromString = fromString;
|
1267 | function toString(value) {
|
1268 | switch (value) {
|
1269 | case Trace.Off:
|
1270 | return 'off';
|
1271 | case Trace.Messages:
|
1272 | return 'messages';
|
1273 | case Trace.Verbose:
|
1274 | return 'verbose';
|
1275 | default:
|
1276 | return 'off';
|
1277 | }
|
1278 | }
|
1279 | Trace.toString = toString;
|
1280 | })(Trace = exports.Trace || (exports.Trace = {}));
|
1281 | var TraceFormat;
|
1282 | (function (TraceFormat) {
|
1283 | TraceFormat["Text"] = "text";
|
1284 | TraceFormat["JSON"] = "json";
|
1285 | })(TraceFormat = exports.TraceFormat || (exports.TraceFormat = {}));
|
1286 | (function (TraceFormat) {
|
1287 | function fromString(value) {
|
1288 | value = value.toLowerCase();
|
1289 | if (value === 'json') {
|
1290 | return TraceFormat.JSON;
|
1291 | }
|
1292 | else {
|
1293 | return TraceFormat.Text;
|
1294 | }
|
1295 | }
|
1296 | TraceFormat.fromString = fromString;
|
1297 | })(TraceFormat = exports.TraceFormat || (exports.TraceFormat = {}));
|
1298 | var SetTraceNotification;
|
1299 | (function (SetTraceNotification) {
|
1300 | SetTraceNotification.type = new messages_1.NotificationType('$/setTraceNotification');
|
1301 | })(SetTraceNotification = exports.SetTraceNotification || (exports.SetTraceNotification = {}));
|
1302 | var LogTraceNotification;
|
1303 | (function (LogTraceNotification) {
|
1304 | LogTraceNotification.type = new messages_1.NotificationType('$/logTraceNotification');
|
1305 | })(LogTraceNotification = exports.LogTraceNotification || (exports.LogTraceNotification = {}));
|
1306 | var ConnectionErrors;
|
1307 | (function (ConnectionErrors) {
|
1308 | |
1309 |
|
1310 |
|
1311 | ConnectionErrors[ConnectionErrors["Closed"] = 1] = "Closed";
|
1312 | |
1313 |
|
1314 |
|
1315 | ConnectionErrors[ConnectionErrors["Disposed"] = 2] = "Disposed";
|
1316 | |
1317 |
|
1318 |
|
1319 | ConnectionErrors[ConnectionErrors["AlreadyListening"] = 3] = "AlreadyListening";
|
1320 | })(ConnectionErrors = exports.ConnectionErrors || (exports.ConnectionErrors = {}));
|
1321 | class ConnectionError extends Error {
|
1322 | constructor(code, message) {
|
1323 | super(message);
|
1324 | this.code = code;
|
1325 | Object.setPrototypeOf(this, ConnectionError.prototype);
|
1326 | }
|
1327 | }
|
1328 | exports.ConnectionError = ConnectionError;
|
1329 | var ConnectionStrategy;
|
1330 | (function (ConnectionStrategy) {
|
1331 | function is(value) {
|
1332 | let candidate = value;
|
1333 | return candidate && Is.func(candidate.cancelUndispatched);
|
1334 | }
|
1335 | ConnectionStrategy.is = is;
|
1336 | })(ConnectionStrategy = exports.ConnectionStrategy || (exports.ConnectionStrategy = {}));
|
1337 | var ConnectionState;
|
1338 | (function (ConnectionState) {
|
1339 | ConnectionState[ConnectionState["New"] = 1] = "New";
|
1340 | ConnectionState[ConnectionState["Listening"] = 2] = "Listening";
|
1341 | ConnectionState[ConnectionState["Closed"] = 3] = "Closed";
|
1342 | ConnectionState[ConnectionState["Disposed"] = 4] = "Disposed";
|
1343 | })(ConnectionState || (ConnectionState = {}));
|
1344 | function _createMessageConnection(messageReader, messageWriter, logger, strategy) {
|
1345 | let sequenceNumber = 0;
|
1346 | let notificationSquenceNumber = 0;
|
1347 | let unknownResponseSquenceNumber = 0;
|
1348 | const version = '2.0';
|
1349 | let starRequestHandler = undefined;
|
1350 | let requestHandlers = Object.create(null);
|
1351 | let starNotificationHandler = undefined;
|
1352 | let notificationHandlers = Object.create(null);
|
1353 | let progressHandlers = new Map();
|
1354 | let timer;
|
1355 | let messageQueue = new linkedMap_1.LinkedMap();
|
1356 | let responsePromises = Object.create(null);
|
1357 | let requestTokens = Object.create(null);
|
1358 | let trace = Trace.Off;
|
1359 | let traceFormat = TraceFormat.Text;
|
1360 | let tracer;
|
1361 | let state = ConnectionState.New;
|
1362 | let errorEmitter = new events_1.Emitter();
|
1363 | let closeEmitter = new events_1.Emitter();
|
1364 | let unhandledNotificationEmitter = new events_1.Emitter();
|
1365 | let unhandledProgressEmitter = new events_1.Emitter();
|
1366 | let disposeEmitter = new events_1.Emitter();
|
1367 | function createRequestQueueKey(id) {
|
1368 | return 'req-' + id.toString();
|
1369 | }
|
1370 | function createResponseQueueKey(id) {
|
1371 | if (id === null) {
|
1372 | return 'res-unknown-' + (++unknownResponseSquenceNumber).toString();
|
1373 | }
|
1374 | else {
|
1375 | return 'res-' + id.toString();
|
1376 | }
|
1377 | }
|
1378 | function createNotificationQueueKey() {
|
1379 | return 'not-' + (++notificationSquenceNumber).toString();
|
1380 | }
|
1381 | function addMessageToQueue(queue, message) {
|
1382 | if (messages_1.isRequestMessage(message)) {
|
1383 | queue.set(createRequestQueueKey(message.id), message);
|
1384 | }
|
1385 | else if (messages_1.isResponseMessage(message)) {
|
1386 | queue.set(createResponseQueueKey(message.id), message);
|
1387 | }
|
1388 | else {
|
1389 | queue.set(createNotificationQueueKey(), message);
|
1390 | }
|
1391 | }
|
1392 | function cancelUndispatched(_message) {
|
1393 | return undefined;
|
1394 | }
|
1395 | function isListening() {
|
1396 | return state === ConnectionState.Listening;
|
1397 | }
|
1398 | function isClosed() {
|
1399 | return state === ConnectionState.Closed;
|
1400 | }
|
1401 | function isDisposed() {
|
1402 | return state === ConnectionState.Disposed;
|
1403 | }
|
1404 | function closeHandler() {
|
1405 | if (state === ConnectionState.New || state === ConnectionState.Listening) {
|
1406 | state = ConnectionState.Closed;
|
1407 | closeEmitter.fire(undefined);
|
1408 | }
|
1409 |
|
1410 | }
|
1411 | function readErrorHandler(error) {
|
1412 | errorEmitter.fire([error, undefined, undefined]);
|
1413 | }
|
1414 | function writeErrorHandler(data) {
|
1415 | errorEmitter.fire(data);
|
1416 | }
|
1417 | messageReader.onClose(closeHandler);
|
1418 | messageReader.onError(readErrorHandler);
|
1419 | messageWriter.onClose(closeHandler);
|
1420 | messageWriter.onError(writeErrorHandler);
|
1421 | function triggerMessageQueue() {
|
1422 | if (timer || messageQueue.size === 0) {
|
1423 | return;
|
1424 | }
|
1425 | timer = setImmediate(() => {
|
1426 | timer = undefined;
|
1427 | processMessageQueue();
|
1428 | });
|
1429 | }
|
1430 | function processMessageQueue() {
|
1431 | if (messageQueue.size === 0) {
|
1432 | return;
|
1433 | }
|
1434 | let message = messageQueue.shift();
|
1435 | try {
|
1436 | if (messages_1.isRequestMessage(message)) {
|
1437 | handleRequest(message);
|
1438 | }
|
1439 | else if (messages_1.isNotificationMessage(message)) {
|
1440 | handleNotification(message);
|
1441 | }
|
1442 | else if (messages_1.isResponseMessage(message)) {
|
1443 | handleResponse(message);
|
1444 | }
|
1445 | else {
|
1446 | handleInvalidMessage(message);
|
1447 | }
|
1448 | }
|
1449 | finally {
|
1450 | triggerMessageQueue();
|
1451 | }
|
1452 | }
|
1453 | let callback = (message) => {
|
1454 | try {
|
1455 |
|
1456 |
|
1457 | if (messages_1.isNotificationMessage(message) && message.method === CancelNotification.type.method) {
|
1458 | let key = createRequestQueueKey(message.params.id);
|
1459 | let toCancel = messageQueue.get(key);
|
1460 | if (messages_1.isRequestMessage(toCancel)) {
|
1461 | let response = strategy && strategy.cancelUndispatched ? strategy.cancelUndispatched(toCancel, cancelUndispatched) : cancelUndispatched(toCancel);
|
1462 | if (response && (response.error !== void 0 || response.result !== void 0)) {
|
1463 | messageQueue.delete(key);
|
1464 | response.id = toCancel.id;
|
1465 | traceSendingResponse(response, message.method, Date.now());
|
1466 | messageWriter.write(response);
|
1467 | return;
|
1468 | }
|
1469 | }
|
1470 | }
|
1471 | addMessageToQueue(messageQueue, message);
|
1472 | }
|
1473 | finally {
|
1474 | triggerMessageQueue();
|
1475 | }
|
1476 | };
|
1477 | function handleRequest(requestMessage) {
|
1478 | if (isDisposed()) {
|
1479 |
|
1480 |
|
1481 | return;
|
1482 | }
|
1483 | function reply(resultOrError, method, startTime) {
|
1484 | let message = {
|
1485 | jsonrpc: version,
|
1486 | id: requestMessage.id
|
1487 | };
|
1488 | if (resultOrError instanceof messages_1.ResponseError) {
|
1489 | message.error = resultOrError.toJson();
|
1490 | }
|
1491 | else {
|
1492 | message.result = resultOrError === void 0 ? null : resultOrError;
|
1493 | }
|
1494 | traceSendingResponse(message, method, startTime);
|
1495 | messageWriter.write(message);
|
1496 | }
|
1497 | function replyError(error, method, startTime) {
|
1498 | let message = {
|
1499 | jsonrpc: version,
|
1500 | id: requestMessage.id,
|
1501 | error: error.toJson()
|
1502 | };
|
1503 | traceSendingResponse(message, method, startTime);
|
1504 | messageWriter.write(message);
|
1505 | }
|
1506 | function replySuccess(result, method, startTime) {
|
1507 |
|
1508 |
|
1509 | if (result === void 0) {
|
1510 | result = null;
|
1511 | }
|
1512 | let message = {
|
1513 | jsonrpc: version,
|
1514 | id: requestMessage.id,
|
1515 | result: result
|
1516 | };
|
1517 | traceSendingResponse(message, method, startTime);
|
1518 | messageWriter.write(message);
|
1519 | }
|
1520 | traceReceivedRequest(requestMessage);
|
1521 | let element = requestHandlers[requestMessage.method];
|
1522 | let type;
|
1523 | let requestHandler;
|
1524 | if (element) {
|
1525 | type = element.type;
|
1526 | requestHandler = element.handler;
|
1527 | }
|
1528 | let startTime = Date.now();
|
1529 | if (requestHandler || starRequestHandler) {
|
1530 | let cancellationSource = new cancellation_1.CancellationTokenSource();
|
1531 | let tokenKey = String(requestMessage.id);
|
1532 | requestTokens[tokenKey] = cancellationSource;
|
1533 | try {
|
1534 | let handlerResult;
|
1535 | if (requestMessage.params === void 0 || (type !== void 0 && type.numberOfParams === 0)) {
|
1536 | handlerResult = requestHandler
|
1537 | ? requestHandler(cancellationSource.token)
|
1538 | : starRequestHandler(requestMessage.method, cancellationSource.token);
|
1539 | }
|
1540 | else if (Is.array(requestMessage.params) && (type === void 0 || type.numberOfParams > 1)) {
|
1541 | handlerResult = requestHandler
|
1542 | ? requestHandler(...requestMessage.params, cancellationSource.token)
|
1543 | : starRequestHandler(requestMessage.method, ...requestMessage.params, cancellationSource.token);
|
1544 | }
|
1545 | else {
|
1546 | handlerResult = requestHandler
|
1547 | ? requestHandler(requestMessage.params, cancellationSource.token)
|
1548 | : starRequestHandler(requestMessage.method, requestMessage.params, cancellationSource.token);
|
1549 | }
|
1550 | let promise = handlerResult;
|
1551 | if (!handlerResult) {
|
1552 | delete requestTokens[tokenKey];
|
1553 | replySuccess(handlerResult, requestMessage.method, startTime);
|
1554 | }
|
1555 | else if (promise.then) {
|
1556 | promise.then((resultOrError) => {
|
1557 | delete requestTokens[tokenKey];
|
1558 | reply(resultOrError, requestMessage.method, startTime);
|
1559 | }, error => {
|
1560 | delete requestTokens[tokenKey];
|
1561 | if (error instanceof messages_1.ResponseError) {
|
1562 | replyError(error, requestMessage.method, startTime);
|
1563 | }
|
1564 | else if (error && Is.string(error.message)) {
|
1565 | replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime);
|
1566 | }
|
1567 | else {
|
1568 | replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);
|
1569 | }
|
1570 | });
|
1571 | }
|
1572 | else {
|
1573 | delete requestTokens[tokenKey];
|
1574 | reply(handlerResult, requestMessage.method, startTime);
|
1575 | }
|
1576 | }
|
1577 | catch (error) {
|
1578 | delete requestTokens[tokenKey];
|
1579 | if (error instanceof messages_1.ResponseError) {
|
1580 | reply(error, requestMessage.method, startTime);
|
1581 | }
|
1582 | else if (error && Is.string(error.message)) {
|
1583 | replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime);
|
1584 | }
|
1585 | else {
|
1586 | replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);
|
1587 | }
|
1588 | }
|
1589 | }
|
1590 | else {
|
1591 | replyError(new messages_1.ResponseError(messages_1.ErrorCodes.MethodNotFound, `Unhandled method ${requestMessage.method}`), requestMessage.method, startTime);
|
1592 | }
|
1593 | }
|
1594 | function handleResponse(responseMessage) {
|
1595 | if (isDisposed()) {
|
1596 |
|
1597 | return;
|
1598 | }
|
1599 | if (responseMessage.id === null) {
|
1600 | if (responseMessage.error) {
|
1601 | logger.error(`Received response message without id: Error is: \n${JSON.stringify(responseMessage.error, undefined, 4)}`);
|
1602 | }
|
1603 | else {
|
1604 | logger.error(`Received response message without id. No further error information provided.`);
|
1605 | }
|
1606 | }
|
1607 | else {
|
1608 | let key = String(responseMessage.id);
|
1609 | let responsePromise = responsePromises[key];
|
1610 | traceReceivedResponse(responseMessage, responsePromise);
|
1611 | if (responsePromise) {
|
1612 | delete responsePromises[key];
|
1613 | try {
|
1614 | if (responseMessage.error) {
|
1615 | let error = responseMessage.error;
|
1616 | responsePromise.reject(new messages_1.ResponseError(error.code, error.message, error.data));
|
1617 | }
|
1618 | else if (responseMessage.result !== void 0) {
|
1619 | responsePromise.resolve(responseMessage.result);
|
1620 | }
|
1621 | else {
|
1622 | throw new Error('Should never happen.');
|
1623 | }
|
1624 | }
|
1625 | catch (error) {
|
1626 | if (error.message) {
|
1627 | logger.error(`Response handler '${responsePromise.method}' failed with message: ${error.message}`);
|
1628 | }
|
1629 | else {
|
1630 | logger.error(`Response handler '${responsePromise.method}' failed unexpectedly.`);
|
1631 | }
|
1632 | }
|
1633 | }
|
1634 | }
|
1635 | }
|
1636 | function handleNotification(message) {
|
1637 | if (isDisposed()) {
|
1638 |
|
1639 | return;
|
1640 | }
|
1641 | let type = undefined;
|
1642 | let notificationHandler;
|
1643 | if (message.method === CancelNotification.type.method) {
|
1644 | notificationHandler = (params) => {
|
1645 | let id = params.id;
|
1646 | let source = requestTokens[String(id)];
|
1647 | if (source) {
|
1648 | source.cancel();
|
1649 | }
|
1650 | };
|
1651 | }
|
1652 | else {
|
1653 | let element = notificationHandlers[message.method];
|
1654 | if (element) {
|
1655 | notificationHandler = element.handler;
|
1656 | type = element.type;
|
1657 | }
|
1658 | }
|
1659 | if (notificationHandler || starNotificationHandler) {
|
1660 | try {
|
1661 | traceReceivedNotification(message);
|
1662 | if (message.params === void 0 || (type !== void 0 && type.numberOfParams === 0)) {
|
1663 | notificationHandler ? notificationHandler() : starNotificationHandler(message.method);
|
1664 | }
|
1665 | else if (Is.array(message.params) && (type === void 0 || type.numberOfParams > 1)) {
|
1666 | notificationHandler ? notificationHandler(...message.params) : starNotificationHandler(message.method, ...message.params);
|
1667 | }
|
1668 | else {
|
1669 | notificationHandler ? notificationHandler(message.params) : starNotificationHandler(message.method, message.params);
|
1670 | }
|
1671 | }
|
1672 | catch (error) {
|
1673 | if (error.message) {
|
1674 | logger.error(`Notification handler '${message.method}' failed with message: ${error.message}`);
|
1675 | }
|
1676 | else {
|
1677 | logger.error(`Notification handler '${message.method}' failed unexpectedly.`);
|
1678 | }
|
1679 | }
|
1680 | }
|
1681 | else {
|
1682 | unhandledNotificationEmitter.fire(message);
|
1683 | }
|
1684 | }
|
1685 | function handleInvalidMessage(message) {
|
1686 | if (!message) {
|
1687 | logger.error('Received empty message.');
|
1688 | return;
|
1689 | }
|
1690 | logger.error(`Received message which is neither a response nor a notification message:\n${JSON.stringify(message, null, 4)}`);
|
1691 |
|
1692 | let responseMessage = message;
|
1693 | if (Is.string(responseMessage.id) || Is.number(responseMessage.id)) {
|
1694 | let key = String(responseMessage.id);
|
1695 | let responseHandler = responsePromises[key];
|
1696 | if (responseHandler) {
|
1697 | responseHandler.reject(new Error('The received response has neither a result nor an error property.'));
|
1698 | }
|
1699 | }
|
1700 | }
|
1701 | function traceSendingRequest(message) {
|
1702 | if (trace === Trace.Off || !tracer) {
|
1703 | return;
|
1704 | }
|
1705 | if (traceFormat === TraceFormat.Text) {
|
1706 | let data = undefined;
|
1707 | if (trace === Trace.Verbose && message.params) {
|
1708 | data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`;
|
1709 | }
|
1710 | tracer.log(`Sending request '${message.method} - (${message.id})'.`, data);
|
1711 | }
|
1712 | else {
|
1713 | logLSPMessage('send-request', message);
|
1714 | }
|
1715 | }
|
1716 | function traceSendingNotification(message) {
|
1717 | if (trace === Trace.Off || !tracer) {
|
1718 | return;
|
1719 | }
|
1720 | if (traceFormat === TraceFormat.Text) {
|
1721 | let data = undefined;
|
1722 | if (trace === Trace.Verbose) {
|
1723 | if (message.params) {
|
1724 | data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`;
|
1725 | }
|
1726 | else {
|
1727 | data = 'No parameters provided.\n\n';
|
1728 | }
|
1729 | }
|
1730 | tracer.log(`Sending notification '${message.method}'.`, data);
|
1731 | }
|
1732 | else {
|
1733 | logLSPMessage('send-notification', message);
|
1734 | }
|
1735 | }
|
1736 | function traceSendingResponse(message, method, startTime) {
|
1737 | if (trace === Trace.Off || !tracer) {
|
1738 | return;
|
1739 | }
|
1740 | if (traceFormat === TraceFormat.Text) {
|
1741 | let data = undefined;
|
1742 | if (trace === Trace.Verbose) {
|
1743 | if (message.error && message.error.data) {
|
1744 | data = `Error data: ${JSON.stringify(message.error.data, null, 4)}\n\n`;
|
1745 | }
|
1746 | else {
|
1747 | if (message.result) {
|
1748 | data = `Result: ${JSON.stringify(message.result, null, 4)}\n\n`;
|
1749 | }
|
1750 | else if (message.error === void 0) {
|
1751 | data = 'No result returned.\n\n';
|
1752 | }
|
1753 | }
|
1754 | }
|
1755 | tracer.log(`Sending response '${method} - (${message.id})'. Processing request took ${Date.now() - startTime}ms`, data);
|
1756 | }
|
1757 | else {
|
1758 | logLSPMessage('send-response', message);
|
1759 | }
|
1760 | }
|
1761 | function traceReceivedRequest(message) {
|
1762 | if (trace === Trace.Off || !tracer) {
|
1763 | return;
|
1764 | }
|
1765 | if (traceFormat === TraceFormat.Text) {
|
1766 | let data = undefined;
|
1767 | if (trace === Trace.Verbose && message.params) {
|
1768 | data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`;
|
1769 | }
|
1770 | tracer.log(`Received request '${message.method} - (${message.id})'.`, data);
|
1771 | }
|
1772 | else {
|
1773 | logLSPMessage('receive-request', message);
|
1774 | }
|
1775 | }
|
1776 | function traceReceivedNotification(message) {
|
1777 | if (trace === Trace.Off || !tracer || message.method === LogTraceNotification.type.method) {
|
1778 | return;
|
1779 | }
|
1780 | if (traceFormat === TraceFormat.Text) {
|
1781 | let data = undefined;
|
1782 | if (trace === Trace.Verbose) {
|
1783 | if (message.params) {
|
1784 | data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`;
|
1785 | }
|
1786 | else {
|
1787 | data = 'No parameters provided.\n\n';
|
1788 | }
|
1789 | }
|
1790 | tracer.log(`Received notification '${message.method}'.`, data);
|
1791 | }
|
1792 | else {
|
1793 | logLSPMessage('receive-notification', message);
|
1794 | }
|
1795 | }
|
1796 | function traceReceivedResponse(message, responsePromise) {
|
1797 | if (trace === Trace.Off || !tracer) {
|
1798 | return;
|
1799 | }
|
1800 | if (traceFormat === TraceFormat.Text) {
|
1801 | let data = undefined;
|
1802 | if (trace === Trace.Verbose) {
|
1803 | if (message.error && message.error.data) {
|
1804 | data = `Error data: ${JSON.stringify(message.error.data, null, 4)}\n\n`;
|
1805 | }
|
1806 | else {
|
1807 | if (message.result) {
|
1808 | data = `Result: ${JSON.stringify(message.result, null, 4)}\n\n`;
|
1809 | }
|
1810 | else if (message.error === void 0) {
|
1811 | data = 'No result returned.\n\n';
|
1812 | }
|
1813 | }
|
1814 | }
|
1815 | if (responsePromise) {
|
1816 | let error = message.error ? ` Request failed: ${message.error.message} (${message.error.code}).` : '';
|
1817 | tracer.log(`Received response '${responsePromise.method} - (${message.id})' in ${Date.now() - responsePromise.timerStart}ms.${error}`, data);
|
1818 | }
|
1819 | else {
|
1820 | tracer.log(`Received response ${message.id} without active response promise.`, data);
|
1821 | }
|
1822 | }
|
1823 | else {
|
1824 | logLSPMessage('receive-response', message);
|
1825 | }
|
1826 | }
|
1827 | function logLSPMessage(type, message) {
|
1828 | if (!tracer || trace === Trace.Off) {
|
1829 | return;
|
1830 | }
|
1831 | const lspMessage = {
|
1832 | isLSPMessage: true,
|
1833 | type,
|
1834 | message,
|
1835 | timestamp: Date.now()
|
1836 | };
|
1837 | tracer.log(lspMessage);
|
1838 | }
|
1839 | function throwIfClosedOrDisposed() {
|
1840 | if (isClosed()) {
|
1841 | throw new ConnectionError(ConnectionErrors.Closed, 'Connection is closed.');
|
1842 | }
|
1843 | if (isDisposed()) {
|
1844 | throw new ConnectionError(ConnectionErrors.Disposed, 'Connection is disposed.');
|
1845 | }
|
1846 | }
|
1847 | function throwIfListening() {
|
1848 | if (isListening()) {
|
1849 | throw new ConnectionError(ConnectionErrors.AlreadyListening, 'Connection is already listening');
|
1850 | }
|
1851 | }
|
1852 | function throwIfNotListening() {
|
1853 | if (!isListening()) {
|
1854 | throw new Error('Call listen() first.');
|
1855 | }
|
1856 | }
|
1857 | function undefinedToNull(param) {
|
1858 | if (param === void 0) {
|
1859 | return null;
|
1860 | }
|
1861 | else {
|
1862 | return param;
|
1863 | }
|
1864 | }
|
1865 | function computeMessageParams(type, params) {
|
1866 | let result;
|
1867 | let numberOfParams = type.numberOfParams;
|
1868 | switch (numberOfParams) {
|
1869 | case 0:
|
1870 | result = null;
|
1871 | break;
|
1872 | case 1:
|
1873 | result = undefinedToNull(params[0]);
|
1874 | break;
|
1875 | default:
|
1876 | result = [];
|
1877 | for (let i = 0; i < params.length && i < numberOfParams; i++) {
|
1878 | result.push(undefinedToNull(params[i]));
|
1879 | }
|
1880 | if (params.length < numberOfParams) {
|
1881 | for (let i = params.length; i < numberOfParams; i++) {
|
1882 | result.push(null);
|
1883 | }
|
1884 | }
|
1885 | break;
|
1886 | }
|
1887 | return result;
|
1888 | }
|
1889 | let connection = {
|
1890 | sendNotification: (type, ...params) => {
|
1891 | throwIfClosedOrDisposed();
|
1892 | let method;
|
1893 | let messageParams;
|
1894 | if (Is.string(type)) {
|
1895 | method = type;
|
1896 | switch (params.length) {
|
1897 | case 0:
|
1898 | messageParams = null;
|
1899 | break;
|
1900 | case 1:
|
1901 | messageParams = params[0];
|
1902 | break;
|
1903 | default:
|
1904 | messageParams = params;
|
1905 | break;
|
1906 | }
|
1907 | }
|
1908 | else {
|
1909 | method = type.method;
|
1910 | messageParams = computeMessageParams(type, params);
|
1911 | }
|
1912 | let notificationMessage = {
|
1913 | jsonrpc: version,
|
1914 | method: method,
|
1915 | params: messageParams
|
1916 | };
|
1917 | traceSendingNotification(notificationMessage);
|
1918 | messageWriter.write(notificationMessage);
|
1919 | },
|
1920 | onNotification: (type, handler) => {
|
1921 | throwIfClosedOrDisposed();
|
1922 | if (Is.func(type)) {
|
1923 | starNotificationHandler = type;
|
1924 | }
|
1925 | else if (handler) {
|
1926 | if (Is.string(type)) {
|
1927 | notificationHandlers[type] = { type: undefined, handler };
|
1928 | }
|
1929 | else {
|
1930 | notificationHandlers[type.method] = { type, handler };
|
1931 | }
|
1932 | }
|
1933 | },
|
1934 | onProgress: (_type, token, handler) => {
|
1935 | if (progressHandlers.has(token)) {
|
1936 | throw new Error(`Progress handler for token ${token} already registered`);
|
1937 | }
|
1938 | progressHandlers.set(token, handler);
|
1939 | return {
|
1940 | dispose: () => {
|
1941 | progressHandlers.delete(token);
|
1942 | }
|
1943 | };
|
1944 | },
|
1945 | sendProgress: (_type, token, value) => {
|
1946 | connection.sendNotification(ProgressNotification.type, { token, value });
|
1947 | },
|
1948 | onUnhandledProgress: unhandledProgressEmitter.event,
|
1949 | sendRequest: (type, ...params) => {
|
1950 | throwIfClosedOrDisposed();
|
1951 | throwIfNotListening();
|
1952 | let method;
|
1953 | let messageParams;
|
1954 | let token = undefined;
|
1955 | if (Is.string(type)) {
|
1956 | method = type;
|
1957 | switch (params.length) {
|
1958 | case 0:
|
1959 | messageParams = null;
|
1960 | break;
|
1961 | case 1:
|
1962 |
|
1963 | if (cancellation_1.CancellationToken.is(params[0])) {
|
1964 | messageParams = null;
|
1965 | token = params[0];
|
1966 | }
|
1967 | else {
|
1968 | messageParams = undefinedToNull(params[0]);
|
1969 | }
|
1970 | break;
|
1971 | default:
|
1972 | const last = params.length - 1;
|
1973 | if (cancellation_1.CancellationToken.is(params[last])) {
|
1974 | token = params[last];
|
1975 | if (params.length === 2) {
|
1976 | messageParams = undefinedToNull(params[0]);
|
1977 | }
|
1978 | else {
|
1979 | messageParams = params.slice(0, last).map(value => undefinedToNull(value));
|
1980 | }
|
1981 | }
|
1982 | else {
|
1983 | messageParams = params.map(value => undefinedToNull(value));
|
1984 | }
|
1985 | break;
|
1986 | }
|
1987 | }
|
1988 | else {
|
1989 | method = type.method;
|
1990 | messageParams = computeMessageParams(type, params);
|
1991 | let numberOfParams = type.numberOfParams;
|
1992 | token = cancellation_1.CancellationToken.is(params[numberOfParams]) ? params[numberOfParams] : undefined;
|
1993 | }
|
1994 | let id = sequenceNumber++;
|
1995 | let result = new Promise((resolve, reject) => {
|
1996 | let requestMessage = {
|
1997 | jsonrpc: version,
|
1998 | id: id,
|
1999 | method: method,
|
2000 | params: messageParams
|
2001 | };
|
2002 | let responsePromise = { method: method, timerStart: Date.now(), resolve, reject };
|
2003 | traceSendingRequest(requestMessage);
|
2004 | try {
|
2005 | messageWriter.write(requestMessage);
|
2006 | }
|
2007 | catch (e) {
|
2008 |
|
2009 | responsePromise.reject(new messages_1.ResponseError(messages_1.ErrorCodes.MessageWriteError, e.message ? e.message : 'Unknown reason'));
|
2010 | responsePromise = null;
|
2011 | }
|
2012 | if (responsePromise) {
|
2013 | responsePromises[String(id)] = responsePromise;
|
2014 | }
|
2015 | });
|
2016 | if (token) {
|
2017 | token.onCancellationRequested(() => {
|
2018 | connection.sendNotification(CancelNotification.type, { id });
|
2019 | });
|
2020 | }
|
2021 | return result;
|
2022 | },
|
2023 | onRequest: (type, handler) => {
|
2024 | throwIfClosedOrDisposed();
|
2025 | if (Is.func(type)) {
|
2026 | starRequestHandler = type;
|
2027 | }
|
2028 | else if (handler) {
|
2029 | if (Is.string(type)) {
|
2030 | requestHandlers[type] = { type: undefined, handler };
|
2031 | }
|
2032 | else {
|
2033 | requestHandlers[type.method] = { type, handler };
|
2034 | }
|
2035 | }
|
2036 | },
|
2037 | trace: (_value, _tracer, sendNotificationOrTraceOptions) => {
|
2038 | let _sendNotification = false;
|
2039 | let _traceFormat = TraceFormat.Text;
|
2040 | if (sendNotificationOrTraceOptions !== void 0) {
|
2041 | if (Is.boolean(sendNotificationOrTraceOptions)) {
|
2042 | _sendNotification = sendNotificationOrTraceOptions;
|
2043 | }
|
2044 | else {
|
2045 | _sendNotification = sendNotificationOrTraceOptions.sendNotification || false;
|
2046 | _traceFormat = sendNotificationOrTraceOptions.traceFormat || TraceFormat.Text;
|
2047 | }
|
2048 | }
|
2049 | trace = _value;
|
2050 | traceFormat = _traceFormat;
|
2051 | if (trace === Trace.Off) {
|
2052 | tracer = undefined;
|
2053 | }
|
2054 | else {
|
2055 | tracer = _tracer;
|
2056 | }
|
2057 | if (_sendNotification && !isClosed() && !isDisposed()) {
|
2058 | connection.sendNotification(SetTraceNotification.type, { value: Trace.toString(_value) });
|
2059 | }
|
2060 | },
|
2061 | onError: errorEmitter.event,
|
2062 | onClose: closeEmitter.event,
|
2063 | onUnhandledNotification: unhandledNotificationEmitter.event,
|
2064 | onDispose: disposeEmitter.event,
|
2065 | dispose: () => {
|
2066 | if (isDisposed()) {
|
2067 | return;
|
2068 | }
|
2069 | state = ConnectionState.Disposed;
|
2070 | disposeEmitter.fire(undefined);
|
2071 | let error = new Error('Connection got disposed.');
|
2072 | Object.keys(responsePromises).forEach((key) => {
|
2073 | responsePromises[key].reject(error);
|
2074 | });
|
2075 | responsePromises = Object.create(null);
|
2076 | requestTokens = Object.create(null);
|
2077 | messageQueue = new linkedMap_1.LinkedMap();
|
2078 |
|
2079 | if (Is.func(messageWriter.dispose)) {
|
2080 | messageWriter.dispose();
|
2081 | }
|
2082 | if (Is.func(messageReader.dispose)) {
|
2083 | messageReader.dispose();
|
2084 | }
|
2085 | },
|
2086 | listen: () => {
|
2087 | throwIfClosedOrDisposed();
|
2088 | throwIfListening();
|
2089 | state = ConnectionState.Listening;
|
2090 | messageReader.listen(callback);
|
2091 | },
|
2092 | inspect: () => {
|
2093 |
|
2094 | console.log('inspect');
|
2095 | }
|
2096 | };
|
2097 | connection.onNotification(LogTraceNotification.type, (params) => {
|
2098 | if (trace === Trace.Off || !tracer) {
|
2099 | return;
|
2100 | }
|
2101 | tracer.log(params.message, trace === Trace.Verbose ? params.verbose : undefined);
|
2102 | });
|
2103 | connection.onNotification(ProgressNotification.type, (params) => {
|
2104 | const handler = progressHandlers.get(params.token);
|
2105 | if (handler) {
|
2106 | handler(params.value);
|
2107 | }
|
2108 | else {
|
2109 | unhandledProgressEmitter.fire(params);
|
2110 | }
|
2111 | });
|
2112 | return connection;
|
2113 | }
|
2114 | function isMessageReader(value) {
|
2115 | return value.listen !== void 0 && value.read === void 0;
|
2116 | }
|
2117 | function isMessageWriter(value) {
|
2118 | return value.write !== void 0 && value.end === void 0;
|
2119 | }
|
2120 | function createMessageConnection(input, output, logger, strategy) {
|
2121 | if (!logger) {
|
2122 | logger = exports.NullLogger;
|
2123 | }
|
2124 | let reader = isMessageReader(input) ? input : new messageReader_1.StreamMessageReader(input);
|
2125 | let writer = isMessageWriter(output) ? output : new messageWriter_1.StreamMessageWriter(output);
|
2126 | return _createMessageConnection(reader, writer, logger, strategy);
|
2127 | }
|
2128 | exports.createMessageConnection = createMessageConnection;
|
2129 |
|
2130 |
|
2131 | }),
|
2132 |
|
2133 | (function(module, exports, __webpack_require__) {
|
2134 |
|
2135 | "use strict";
|
2136 |
|
2137 |
|
2138 |
|
2139 |
|
2140 |
|
2141 | Object.defineProperty(exports, "__esModule", { value: true });
|
2142 | function boolean(value) {
|
2143 | return value === true || value === false;
|
2144 | }
|
2145 | exports.boolean = boolean;
|
2146 | function string(value) {
|
2147 | return typeof value === 'string' || value instanceof String;
|
2148 | }
|
2149 | exports.string = string;
|
2150 | function number(value) {
|
2151 | return typeof value === 'number' || value instanceof Number;
|
2152 | }
|
2153 | exports.number = number;
|
2154 | function error(value) {
|
2155 | return value instanceof Error;
|
2156 | }
|
2157 | exports.error = error;
|
2158 | function func(value) {
|
2159 | return typeof value === 'function';
|
2160 | }
|
2161 | exports.func = func;
|
2162 | function array(value) {
|
2163 | return Array.isArray(value);
|
2164 | }
|
2165 | exports.array = array;
|
2166 | function stringArray(value) {
|
2167 | return array(value) && value.every(elem => string(elem));
|
2168 | }
|
2169 | exports.stringArray = stringArray;
|
2170 |
|
2171 |
|
2172 | }),
|
2173 |
|
2174 | (function(module, exports, __webpack_require__) {
|
2175 |
|
2176 | "use strict";
|
2177 |
|
2178 |
|
2179 |
|
2180 |
|
2181 |
|
2182 | Object.defineProperty(exports, "__esModule", { value: true });
|
2183 | const is = __webpack_require__(5);
|
2184 |
|
2185 |
|
2186 |
|
2187 | var ErrorCodes;
|
2188 | (function (ErrorCodes) {
|
2189 |
|
2190 | ErrorCodes.ParseError = -32700;
|
2191 | ErrorCodes.InvalidRequest = -32600;
|
2192 | ErrorCodes.MethodNotFound = -32601;
|
2193 | ErrorCodes.InvalidParams = -32602;
|
2194 | ErrorCodes.InternalError = -32603;
|
2195 | ErrorCodes.serverErrorStart = -32099;
|
2196 | ErrorCodes.serverErrorEnd = -32000;
|
2197 | ErrorCodes.ServerNotInitialized = -32002;
|
2198 | ErrorCodes.UnknownErrorCode = -32001;
|
2199 |
|
2200 | ErrorCodes.RequestCancelled = -32800;
|
2201 | ErrorCodes.ContentModified = -32801;
|
2202 |
|
2203 | ErrorCodes.MessageWriteError = 1;
|
2204 | ErrorCodes.MessageReadError = 2;
|
2205 | })(ErrorCodes = exports.ErrorCodes || (exports.ErrorCodes = {}));
|
2206 |
|
2207 |
|
2208 |
|
2209 |
|
2210 | class ResponseError extends Error {
|
2211 | constructor(code, message, data) {
|
2212 | super(message);
|
2213 | this.code = is.number(code) ? code : ErrorCodes.UnknownErrorCode;
|
2214 | this.data = data;
|
2215 | Object.setPrototypeOf(this, ResponseError.prototype);
|
2216 | }
|
2217 | toJson() {
|
2218 | return {
|
2219 | code: this.code,
|
2220 | message: this.message,
|
2221 | data: this.data,
|
2222 | };
|
2223 | }
|
2224 | }
|
2225 | exports.ResponseError = ResponseError;
|
2226 |
|
2227 |
|
2228 |
|
2229 | class AbstractMessageType {
|
2230 | constructor(_method, _numberOfParams) {
|
2231 | this._method = _method;
|
2232 | this._numberOfParams = _numberOfParams;
|
2233 | }
|
2234 | get method() {
|
2235 | return this._method;
|
2236 | }
|
2237 | get numberOfParams() {
|
2238 | return this._numberOfParams;
|
2239 | }
|
2240 | }
|
2241 | exports.AbstractMessageType = AbstractMessageType;
|
2242 |
|
2243 |
|
2244 |
|
2245 |
|
2246 |
|
2247 |
|
2248 |
|
2249 | class RequestType0 extends AbstractMessageType {
|
2250 | constructor(method) {
|
2251 | super(method, 0);
|
2252 | }
|
2253 | }
|
2254 | exports.RequestType0 = RequestType0;
|
2255 | class RequestType extends AbstractMessageType {
|
2256 | constructor(method) {
|
2257 | super(method, 1);
|
2258 | }
|
2259 | }
|
2260 | exports.RequestType = RequestType;
|
2261 | class RequestType1 extends AbstractMessageType {
|
2262 | constructor(method) {
|
2263 | super(method, 1);
|
2264 | }
|
2265 | }
|
2266 | exports.RequestType1 = RequestType1;
|
2267 | class RequestType2 extends AbstractMessageType {
|
2268 | constructor(method) {
|
2269 | super(method, 2);
|
2270 | }
|
2271 | }
|
2272 | exports.RequestType2 = RequestType2;
|
2273 | class RequestType3 extends AbstractMessageType {
|
2274 | constructor(method) {
|
2275 | super(method, 3);
|
2276 | }
|
2277 | }
|
2278 | exports.RequestType3 = RequestType3;
|
2279 | class RequestType4 extends AbstractMessageType {
|
2280 | constructor(method) {
|
2281 | super(method, 4);
|
2282 | }
|
2283 | }
|
2284 | exports.RequestType4 = RequestType4;
|
2285 | class RequestType5 extends AbstractMessageType {
|
2286 | constructor(method) {
|
2287 | super(method, 5);
|
2288 | }
|
2289 | }
|
2290 | exports.RequestType5 = RequestType5;
|
2291 | class RequestType6 extends AbstractMessageType {
|
2292 | constructor(method) {
|
2293 | super(method, 6);
|
2294 | }
|
2295 | }
|
2296 | exports.RequestType6 = RequestType6;
|
2297 | class RequestType7 extends AbstractMessageType {
|
2298 | constructor(method) {
|
2299 | super(method, 7);
|
2300 | }
|
2301 | }
|
2302 | exports.RequestType7 = RequestType7;
|
2303 | class RequestType8 extends AbstractMessageType {
|
2304 | constructor(method) {
|
2305 | super(method, 8);
|
2306 | }
|
2307 | }
|
2308 | exports.RequestType8 = RequestType8;
|
2309 | class RequestType9 extends AbstractMessageType {
|
2310 | constructor(method) {
|
2311 | super(method, 9);
|
2312 | }
|
2313 | }
|
2314 | exports.RequestType9 = RequestType9;
|
2315 |
|
2316 |
|
2317 |
|
2318 |
|
2319 |
|
2320 | class NotificationType extends AbstractMessageType {
|
2321 | constructor(method) {
|
2322 | super(method, 1);
|
2323 | this._ = undefined;
|
2324 | }
|
2325 | }
|
2326 | exports.NotificationType = NotificationType;
|
2327 | class NotificationType0 extends AbstractMessageType {
|
2328 | constructor(method) {
|
2329 | super(method, 0);
|
2330 | }
|
2331 | }
|
2332 | exports.NotificationType0 = NotificationType0;
|
2333 | class NotificationType1 extends AbstractMessageType {
|
2334 | constructor(method) {
|
2335 | super(method, 1);
|
2336 | }
|
2337 | }
|
2338 | exports.NotificationType1 = NotificationType1;
|
2339 | class NotificationType2 extends AbstractMessageType {
|
2340 | constructor(method) {
|
2341 | super(method, 2);
|
2342 | }
|
2343 | }
|
2344 | exports.NotificationType2 = NotificationType2;
|
2345 | class NotificationType3 extends AbstractMessageType {
|
2346 | constructor(method) {
|
2347 | super(method, 3);
|
2348 | }
|
2349 | }
|
2350 | exports.NotificationType3 = NotificationType3;
|
2351 | class NotificationType4 extends AbstractMessageType {
|
2352 | constructor(method) {
|
2353 | super(method, 4);
|
2354 | }
|
2355 | }
|
2356 | exports.NotificationType4 = NotificationType4;
|
2357 | class NotificationType5 extends AbstractMessageType {
|
2358 | constructor(method) {
|
2359 | super(method, 5);
|
2360 | }
|
2361 | }
|
2362 | exports.NotificationType5 = NotificationType5;
|
2363 | class NotificationType6 extends AbstractMessageType {
|
2364 | constructor(method) {
|
2365 | super(method, 6);
|
2366 | }
|
2367 | }
|
2368 | exports.NotificationType6 = NotificationType6;
|
2369 | class NotificationType7 extends AbstractMessageType {
|
2370 | constructor(method) {
|
2371 | super(method, 7);
|
2372 | }
|
2373 | }
|
2374 | exports.NotificationType7 = NotificationType7;
|
2375 | class NotificationType8 extends AbstractMessageType {
|
2376 | constructor(method) {
|
2377 | super(method, 8);
|
2378 | }
|
2379 | }
|
2380 | exports.NotificationType8 = NotificationType8;
|
2381 | class NotificationType9 extends AbstractMessageType {
|
2382 | constructor(method) {
|
2383 | super(method, 9);
|
2384 | }
|
2385 | }
|
2386 | exports.NotificationType9 = NotificationType9;
|
2387 |
|
2388 |
|
2389 |
|
2390 | function isRequestMessage(message) {
|
2391 | let candidate = message;
|
2392 | return candidate && is.string(candidate.method) && (is.string(candidate.id) || is.number(candidate.id));
|
2393 | }
|
2394 | exports.isRequestMessage = isRequestMessage;
|
2395 |
|
2396 |
|
2397 |
|
2398 | function isNotificationMessage(message) {
|
2399 | let candidate = message;
|
2400 | return candidate && is.string(candidate.method) && message.id === void 0;
|
2401 | }
|
2402 | exports.isNotificationMessage = isNotificationMessage;
|
2403 |
|
2404 |
|
2405 |
|
2406 | function isResponseMessage(message) {
|
2407 | let candidate = message;
|
2408 | return candidate && (candidate.result !== void 0 || !!candidate.error) && (is.string(candidate.id) || is.number(candidate.id) || candidate.id === null);
|
2409 | }
|
2410 | exports.isResponseMessage = isResponseMessage;
|
2411 |
|
2412 |
|
2413 | }),
|
2414 |
|
2415 | (function(module, exports, __webpack_require__) {
|
2416 |
|
2417 | "use strict";
|
2418 |
|
2419 |
|
2420 |
|
2421 |
|
2422 |
|
2423 | Object.defineProperty(exports, "__esModule", { value: true });
|
2424 | const events_1 = __webpack_require__(8);
|
2425 | const Is = __webpack_require__(5);
|
2426 | let DefaultSize = 8192;
|
2427 | let CR = Buffer.from('\r', 'ascii')[0];
|
2428 | let LF = Buffer.from('\n', 'ascii')[0];
|
2429 | let CRLF = '\r\n';
|
2430 | class MessageBuffer {
|
2431 | constructor(encoding = 'utf8') {
|
2432 | this.encoding = encoding;
|
2433 | this.index = 0;
|
2434 | this.buffer = Buffer.allocUnsafe(DefaultSize);
|
2435 | }
|
2436 | append(chunk) {
|
2437 | var toAppend = chunk;
|
2438 | if (typeof (chunk) === 'string') {
|
2439 | var str = chunk;
|
2440 | var bufferLen = Buffer.byteLength(str, this.encoding);
|
2441 | toAppend = Buffer.allocUnsafe(bufferLen);
|
2442 | toAppend.write(str, 0, bufferLen, this.encoding);
|
2443 | }
|
2444 | if (this.buffer.length - this.index >= toAppend.length) {
|
2445 | toAppend.copy(this.buffer, this.index, 0, toAppend.length);
|
2446 | }
|
2447 | else {
|
2448 | var newSize = (Math.ceil((this.index + toAppend.length) / DefaultSize) + 1) * DefaultSize;
|
2449 | if (this.index === 0) {
|
2450 | this.buffer = Buffer.allocUnsafe(newSize);
|
2451 | toAppend.copy(this.buffer, 0, 0, toAppend.length);
|
2452 | }
|
2453 | else {
|
2454 | this.buffer = Buffer.concat([this.buffer.slice(0, this.index), toAppend], newSize);
|
2455 | }
|
2456 | }
|
2457 | this.index += toAppend.length;
|
2458 | }
|
2459 | tryReadHeaders() {
|
2460 | let result = undefined;
|
2461 | let current = 0;
|
2462 | while (current + 3 < this.index && (this.buffer[current] !== CR || this.buffer[current + 1] !== LF || this.buffer[current + 2] !== CR || this.buffer[current + 3] !== LF)) {
|
2463 | current++;
|
2464 | }
|
2465 |
|
2466 | if (current + 3 >= this.index) {
|
2467 | return result;
|
2468 | }
|
2469 | result = Object.create(null);
|
2470 | let headers = this.buffer.toString('ascii', 0, current).split(CRLF);
|
2471 | headers.forEach((header) => {
|
2472 | let index = header.indexOf(':');
|
2473 | if (index === -1) {
|
2474 | throw new Error('Message header must separate key and value using :');
|
2475 | }
|
2476 | let key = header.substr(0, index);
|
2477 | let value = header.substr(index + 1).trim();
|
2478 | result[key] = value;
|
2479 | });
|
2480 | let nextStart = current + 4;
|
2481 | this.buffer = this.buffer.slice(nextStart);
|
2482 | this.index = this.index - nextStart;
|
2483 | return result;
|
2484 | }
|
2485 | tryReadContent(length) {
|
2486 | if (this.index < length) {
|
2487 | return null;
|
2488 | }
|
2489 | let result = this.buffer.toString(this.encoding, 0, length);
|
2490 | let nextStart = length;
|
2491 | this.buffer.copy(this.buffer, 0, nextStart);
|
2492 | this.index = this.index - nextStart;
|
2493 | return result;
|
2494 | }
|
2495 | get numberOfBytes() {
|
2496 | return this.index;
|
2497 | }
|
2498 | }
|
2499 | var MessageReader;
|
2500 | (function (MessageReader) {
|
2501 | function is(value) {
|
2502 | let candidate = value;
|
2503 | return candidate && Is.func(candidate.listen) && Is.func(candidate.dispose) &&
|
2504 | Is.func(candidate.onError) && Is.func(candidate.onClose) && Is.func(candidate.onPartialMessage);
|
2505 | }
|
2506 | MessageReader.is = is;
|
2507 | })(MessageReader = exports.MessageReader || (exports.MessageReader = {}));
|
2508 | class AbstractMessageReader {
|
2509 | constructor() {
|
2510 | this.errorEmitter = new events_1.Emitter();
|
2511 | this.closeEmitter = new events_1.Emitter();
|
2512 | this.partialMessageEmitter = new events_1.Emitter();
|
2513 | }
|
2514 | dispose() {
|
2515 | this.errorEmitter.dispose();
|
2516 | this.closeEmitter.dispose();
|
2517 | }
|
2518 | get onError() {
|
2519 | return this.errorEmitter.event;
|
2520 | }
|
2521 | fireError(error) {
|
2522 | this.errorEmitter.fire(this.asError(error));
|
2523 | }
|
2524 | get onClose() {
|
2525 | return this.closeEmitter.event;
|
2526 | }
|
2527 | fireClose() {
|
2528 | this.closeEmitter.fire(undefined);
|
2529 | }
|
2530 | get onPartialMessage() {
|
2531 | return this.partialMessageEmitter.event;
|
2532 | }
|
2533 | firePartialMessage(info) {
|
2534 | this.partialMessageEmitter.fire(info);
|
2535 | }
|
2536 | asError(error) {
|
2537 | if (error instanceof Error) {
|
2538 | return error;
|
2539 | }
|
2540 | else {
|
2541 | return new Error(`Reader received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`);
|
2542 | }
|
2543 | }
|
2544 | }
|
2545 | exports.AbstractMessageReader = AbstractMessageReader;
|
2546 | class StreamMessageReader extends AbstractMessageReader {
|
2547 | constructor(readable, encoding = 'utf8') {
|
2548 | super();
|
2549 | this.readable = readable;
|
2550 | this.buffer = new MessageBuffer(encoding);
|
2551 | this._partialMessageTimeout = 10000;
|
2552 | }
|
2553 | set partialMessageTimeout(timeout) {
|
2554 | this._partialMessageTimeout = timeout;
|
2555 | }
|
2556 | get partialMessageTimeout() {
|
2557 | return this._partialMessageTimeout;
|
2558 | }
|
2559 | listen(callback) {
|
2560 | this.nextMessageLength = -1;
|
2561 | this.messageToken = 0;
|
2562 | this.partialMessageTimer = undefined;
|
2563 | this.callback = callback;
|
2564 | this.readable.on('data', (data) => {
|
2565 | this.onData(data);
|
2566 | });
|
2567 | this.readable.on('error', (error) => this.fireError(error));
|
2568 | this.readable.on('close', () => this.fireClose());
|
2569 | }
|
2570 | onData(data) {
|
2571 | this.buffer.append(data);
|
2572 | while (true) {
|
2573 | if (this.nextMessageLength === -1) {
|
2574 | let headers = this.buffer.tryReadHeaders();
|
2575 | if (!headers) {
|
2576 | return;
|
2577 | }
|
2578 | let contentLength = headers['Content-Length'];
|
2579 | if (!contentLength) {
|
2580 | throw new Error('Header must provide a Content-Length property.');
|
2581 | }
|
2582 | let length = parseInt(contentLength);
|
2583 | if (isNaN(length)) {
|
2584 | throw new Error('Content-Length value must be a number.');
|
2585 | }
|
2586 | this.nextMessageLength = length;
|
2587 |
|
2588 |
|
2589 | }
|
2590 | var msg = this.buffer.tryReadContent(this.nextMessageLength);
|
2591 | if (msg === null) {
|
2592 |
|
2593 | this.setPartialMessageTimer();
|
2594 | return;
|
2595 | }
|
2596 | this.clearPartialMessageTimer();
|
2597 | this.nextMessageLength = -1;
|
2598 | this.messageToken++;
|
2599 | var json = JSON.parse(msg);
|
2600 | this.callback(json);
|
2601 | }
|
2602 | }
|
2603 | clearPartialMessageTimer() {
|
2604 | if (this.partialMessageTimer) {
|
2605 | clearTimeout(this.partialMessageTimer);
|
2606 | this.partialMessageTimer = undefined;
|
2607 | }
|
2608 | }
|
2609 | setPartialMessageTimer() {
|
2610 | this.clearPartialMessageTimer();
|
2611 | if (this._partialMessageTimeout <= 0) {
|
2612 | return;
|
2613 | }
|
2614 | this.partialMessageTimer = setTimeout((token, timeout) => {
|
2615 | this.partialMessageTimer = undefined;
|
2616 | if (token === this.messageToken) {
|
2617 | this.firePartialMessage({ messageToken: token, waitingTime: timeout });
|
2618 | this.setPartialMessageTimer();
|
2619 | }
|
2620 | }, this._partialMessageTimeout, this.messageToken, this._partialMessageTimeout);
|
2621 | }
|
2622 | }
|
2623 | exports.StreamMessageReader = StreamMessageReader;
|
2624 | class IPCMessageReader extends AbstractMessageReader {
|
2625 | constructor(process) {
|
2626 | super();
|
2627 | this.process = process;
|
2628 | let eventEmitter = this.process;
|
2629 | eventEmitter.on('error', (error) => this.fireError(error));
|
2630 | eventEmitter.on('close', () => this.fireClose());
|
2631 | }
|
2632 | listen(callback) {
|
2633 | this.process.on('message', callback);
|
2634 | }
|
2635 | }
|
2636 | exports.IPCMessageReader = IPCMessageReader;
|
2637 | class SocketMessageReader extends StreamMessageReader {
|
2638 | constructor(socket, encoding = 'utf-8') {
|
2639 | super(socket, encoding);
|
2640 | }
|
2641 | }
|
2642 | exports.SocketMessageReader = SocketMessageReader;
|
2643 |
|
2644 |
|
2645 | }),
|
2646 |
|
2647 | (function(module, exports, __webpack_require__) {
|
2648 |
|
2649 | "use strict";
|
2650 |
|
2651 |
|
2652 |
|
2653 |
|
2654 |
|
2655 | Object.defineProperty(exports, "__esModule", { value: true });
|
2656 | var Disposable;
|
2657 | (function (Disposable) {
|
2658 | function create(func) {
|
2659 | return {
|
2660 | dispose: func
|
2661 | };
|
2662 | }
|
2663 | Disposable.create = create;
|
2664 | })(Disposable = exports.Disposable || (exports.Disposable = {}));
|
2665 | var Event;
|
2666 | (function (Event) {
|
2667 | const _disposable = { dispose() { } };
|
2668 | Event.None = function () { return _disposable; };
|
2669 | })(Event = exports.Event || (exports.Event = {}));
|
2670 | class CallbackList {
|
2671 | add(callback, context = null, bucket) {
|
2672 | if (!this._callbacks) {
|
2673 | this._callbacks = [];
|
2674 | this._contexts = [];
|
2675 | }
|
2676 | this._callbacks.push(callback);
|
2677 | this._contexts.push(context);
|
2678 | if (Array.isArray(bucket)) {
|
2679 | bucket.push({ dispose: () => this.remove(callback, context) });
|
2680 | }
|
2681 | }
|
2682 | remove(callback, context = null) {
|
2683 | if (!this._callbacks) {
|
2684 | return;
|
2685 | }
|
2686 | var foundCallbackWithDifferentContext = false;
|
2687 | for (var i = 0, len = this._callbacks.length; i < len; i++) {
|
2688 | if (this._callbacks[i] === callback) {
|
2689 | if (this._contexts[i] === context) {
|
2690 |
|
2691 | this._callbacks.splice(i, 1);
|
2692 | this._contexts.splice(i, 1);
|
2693 | return;
|
2694 | }
|
2695 | else {
|
2696 | foundCallbackWithDifferentContext = true;
|
2697 | }
|
2698 | }
|
2699 | }
|
2700 | if (foundCallbackWithDifferentContext) {
|
2701 | throw new Error('When adding a listener with a context, you should remove it with the same context');
|
2702 | }
|
2703 | }
|
2704 | invoke(...args) {
|
2705 | if (!this._callbacks) {
|
2706 | return [];
|
2707 | }
|
2708 | var ret = [], callbacks = this._callbacks.slice(0), contexts = this._contexts.slice(0);
|
2709 | for (var i = 0, len = callbacks.length; i < len; i++) {
|
2710 | try {
|
2711 | ret.push(callbacks[i].apply(contexts[i], args));
|
2712 | }
|
2713 | catch (e) {
|
2714 |
|
2715 | console.error(e);
|
2716 | }
|
2717 | }
|
2718 | return ret;
|
2719 | }
|
2720 | isEmpty() {
|
2721 | return !this._callbacks || this._callbacks.length === 0;
|
2722 | }
|
2723 | dispose() {
|
2724 | this._callbacks = undefined;
|
2725 | this._contexts = undefined;
|
2726 | }
|
2727 | }
|
2728 | class Emitter {
|
2729 | constructor(_options) {
|
2730 | this._options = _options;
|
2731 | }
|
2732 | |
2733 |
|
2734 |
|
2735 |
|
2736 | get event() {
|
2737 | if (!this._event) {
|
2738 | this._event = (listener, thisArgs, disposables) => {
|
2739 | if (!this._callbacks) {
|
2740 | this._callbacks = new CallbackList();
|
2741 | }
|
2742 | if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {
|
2743 | this._options.onFirstListenerAdd(this);
|
2744 | }
|
2745 | this._callbacks.add(listener, thisArgs);
|
2746 | let result;
|
2747 | result = {
|
2748 | dispose: () => {
|
2749 | this._callbacks.remove(listener, thisArgs);
|
2750 | result.dispose = Emitter._noop;
|
2751 | if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {
|
2752 | this._options.onLastListenerRemove(this);
|
2753 | }
|
2754 | }
|
2755 | };
|
2756 | if (Array.isArray(disposables)) {
|
2757 | disposables.push(result);
|
2758 | }
|
2759 | return result;
|
2760 | };
|
2761 | }
|
2762 | return this._event;
|
2763 | }
|
2764 | |
2765 |
|
2766 |
|
2767 |
|
2768 | fire(event) {
|
2769 | if (this._callbacks) {
|
2770 | this._callbacks.invoke.call(this._callbacks, event);
|
2771 | }
|
2772 | }
|
2773 | dispose() {
|
2774 | if (this._callbacks) {
|
2775 | this._callbacks.dispose();
|
2776 | this._callbacks = undefined;
|
2777 | }
|
2778 | }
|
2779 | }
|
2780 | exports.Emitter = Emitter;
|
2781 | Emitter._noop = function () { };
|
2782 |
|
2783 |
|
2784 | }),
|
2785 |
|
2786 | (function(module, exports, __webpack_require__) {
|
2787 |
|
2788 | "use strict";
|
2789 |
|
2790 |
|
2791 |
|
2792 |
|
2793 |
|
2794 | Object.defineProperty(exports, "__esModule", { value: true });
|
2795 | const events_1 = __webpack_require__(8);
|
2796 | const Is = __webpack_require__(5);
|
2797 | let ContentLength = 'Content-Length: ';
|
2798 | let CRLF = '\r\n';
|
2799 | var MessageWriter;
|
2800 | (function (MessageWriter) {
|
2801 | function is(value) {
|
2802 | let candidate = value;
|
2803 | return candidate && Is.func(candidate.dispose) && Is.func(candidate.onClose) &&
|
2804 | Is.func(candidate.onError) && Is.func(candidate.write);
|
2805 | }
|
2806 | MessageWriter.is = is;
|
2807 | })(MessageWriter = exports.MessageWriter || (exports.MessageWriter = {}));
|
2808 | class AbstractMessageWriter {
|
2809 | constructor() {
|
2810 | this.errorEmitter = new events_1.Emitter();
|
2811 | this.closeEmitter = new events_1.Emitter();
|
2812 | }
|
2813 | dispose() {
|
2814 | this.errorEmitter.dispose();
|
2815 | this.closeEmitter.dispose();
|
2816 | }
|
2817 | get onError() {
|
2818 | return this.errorEmitter.event;
|
2819 | }
|
2820 | fireError(error, message, count) {
|
2821 | this.errorEmitter.fire([this.asError(error), message, count]);
|
2822 | }
|
2823 | get onClose() {
|
2824 | return this.closeEmitter.event;
|
2825 | }
|
2826 | fireClose() {
|
2827 | this.closeEmitter.fire(undefined);
|
2828 | }
|
2829 | asError(error) {
|
2830 | if (error instanceof Error) {
|
2831 | return error;
|
2832 | }
|
2833 | else {
|
2834 | return new Error(`Writer received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`);
|
2835 | }
|
2836 | }
|
2837 | }
|
2838 | exports.AbstractMessageWriter = AbstractMessageWriter;
|
2839 | class StreamMessageWriter extends AbstractMessageWriter {
|
2840 | constructor(writable, encoding = 'utf8') {
|
2841 | super();
|
2842 | this.writable = writable;
|
2843 | this.encoding = encoding;
|
2844 | this.errorCount = 0;
|
2845 | this.writable.on('error', (error) => this.fireError(error));
|
2846 | this.writable.on('close', () => this.fireClose());
|
2847 | }
|
2848 | write(msg) {
|
2849 | let json = JSON.stringify(msg);
|
2850 | let contentLength = Buffer.byteLength(json, this.encoding);
|
2851 | let headers = [
|
2852 | ContentLength, contentLength.toString(), CRLF,
|
2853 | CRLF
|
2854 | ];
|
2855 | try {
|
2856 |
|
2857 | this.writable.write(headers.join(''), 'ascii');
|
2858 |
|
2859 | this.writable.write(json, this.encoding);
|
2860 | this.errorCount = 0;
|
2861 | }
|
2862 | catch (error) {
|
2863 | this.errorCount++;
|
2864 | this.fireError(error, msg, this.errorCount);
|
2865 | }
|
2866 | }
|
2867 | }
|
2868 | exports.StreamMessageWriter = StreamMessageWriter;
|
2869 | class IPCMessageWriter extends AbstractMessageWriter {
|
2870 | constructor(process) {
|
2871 | super();
|
2872 | this.process = process;
|
2873 | this.errorCount = 0;
|
2874 | this.queue = [];
|
2875 | this.sending = false;
|
2876 | let eventEmitter = this.process;
|
2877 | eventEmitter.on('error', (error) => this.fireError(error));
|
2878 | eventEmitter.on('close', () => this.fireClose);
|
2879 | }
|
2880 | write(msg) {
|
2881 | if (!this.sending && this.queue.length === 0) {
|
2882 |
|
2883 | this.doWriteMessage(msg);
|
2884 | }
|
2885 | else {
|
2886 | this.queue.push(msg);
|
2887 | }
|
2888 | }
|
2889 | doWriteMessage(msg) {
|
2890 | try {
|
2891 | if (this.process.send) {
|
2892 | this.sending = true;
|
2893 | this.process.send(msg, undefined, undefined, (error) => {
|
2894 | this.sending = false;
|
2895 | if (error) {
|
2896 | this.errorCount++;
|
2897 | this.fireError(error, msg, this.errorCount);
|
2898 | }
|
2899 | else {
|
2900 | this.errorCount = 0;
|
2901 | }
|
2902 | if (this.queue.length > 0) {
|
2903 | this.doWriteMessage(this.queue.shift());
|
2904 | }
|
2905 | });
|
2906 | }
|
2907 | }
|
2908 | catch (error) {
|
2909 | this.errorCount++;
|
2910 | this.fireError(error, msg, this.errorCount);
|
2911 | }
|
2912 | }
|
2913 | }
|
2914 | exports.IPCMessageWriter = IPCMessageWriter;
|
2915 | class SocketMessageWriter extends AbstractMessageWriter {
|
2916 | constructor(socket, encoding = 'utf8') {
|
2917 | super();
|
2918 | this.socket = socket;
|
2919 | this.queue = [];
|
2920 | this.sending = false;
|
2921 | this.encoding = encoding;
|
2922 | this.errorCount = 0;
|
2923 | this.socket.on('error', (error) => this.fireError(error));
|
2924 | this.socket.on('close', () => this.fireClose());
|
2925 | }
|
2926 | dispose() {
|
2927 | super.dispose();
|
2928 | this.socket.destroy();
|
2929 | }
|
2930 | write(msg) {
|
2931 | if (!this.sending && this.queue.length === 0) {
|
2932 |
|
2933 | this.doWriteMessage(msg);
|
2934 | }
|
2935 | else {
|
2936 | this.queue.push(msg);
|
2937 | }
|
2938 | }
|
2939 | doWriteMessage(msg) {
|
2940 | let json = JSON.stringify(msg);
|
2941 | let contentLength = Buffer.byteLength(json, this.encoding);
|
2942 | let headers = [
|
2943 | ContentLength, contentLength.toString(), CRLF,
|
2944 | CRLF
|
2945 | ];
|
2946 | try {
|
2947 |
|
2948 | this.sending = true;
|
2949 | this.socket.write(headers.join(''), 'ascii', (error) => {
|
2950 | if (error) {
|
2951 | this.handleError(error, msg);
|
2952 | }
|
2953 | try {
|
2954 |
|
2955 | this.socket.write(json, this.encoding, (error) => {
|
2956 | this.sending = false;
|
2957 | if (error) {
|
2958 | this.handleError(error, msg);
|
2959 | }
|
2960 | else {
|
2961 | this.errorCount = 0;
|
2962 | }
|
2963 | if (this.queue.length > 0) {
|
2964 | this.doWriteMessage(this.queue.shift());
|
2965 | }
|
2966 | });
|
2967 | }
|
2968 | catch (error) {
|
2969 | this.handleError(error, msg);
|
2970 | }
|
2971 | });
|
2972 | }
|
2973 | catch (error) {
|
2974 | this.handleError(error, msg);
|
2975 | }
|
2976 | }
|
2977 | handleError(error, msg) {
|
2978 | this.errorCount++;
|
2979 | this.fireError(error, msg, this.errorCount);
|
2980 | }
|
2981 | }
|
2982 | exports.SocketMessageWriter = SocketMessageWriter;
|
2983 |
|
2984 |
|
2985 | }),
|
2986 |
|
2987 | (function(module, exports, __webpack_require__) {
|
2988 |
|
2989 | "use strict";
|
2990 |
|
2991 |
|
2992 |
|
2993 |
|
2994 |
|
2995 | Object.defineProperty(exports, "__esModule", { value: true });
|
2996 | const events_1 = __webpack_require__(8);
|
2997 | const Is = __webpack_require__(5);
|
2998 | var CancellationToken;
|
2999 | (function (CancellationToken) {
|
3000 | CancellationToken.None = Object.freeze({
|
3001 | isCancellationRequested: false,
|
3002 | onCancellationRequested: events_1.Event.None
|
3003 | });
|
3004 | CancellationToken.Cancelled = Object.freeze({
|
3005 | isCancellationRequested: true,
|
3006 | onCancellationRequested: events_1.Event.None
|
3007 | });
|
3008 | function is(value) {
|
3009 | let candidate = value;
|
3010 | return candidate && (candidate === CancellationToken.None
|
3011 | || candidate === CancellationToken.Cancelled
|
3012 | || (Is.boolean(candidate.isCancellationRequested) && !!candidate.onCancellationRequested));
|
3013 | }
|
3014 | CancellationToken.is = is;
|
3015 | })(CancellationToken = exports.CancellationToken || (exports.CancellationToken = {}));
|
3016 | const shortcutEvent = Object.freeze(function (callback, context) {
|
3017 | let handle = setTimeout(callback.bind(context), 0);
|
3018 | return { dispose() { clearTimeout(handle); } };
|
3019 | });
|
3020 | class MutableToken {
|
3021 | constructor() {
|
3022 | this._isCancelled = false;
|
3023 | }
|
3024 | cancel() {
|
3025 | if (!this._isCancelled) {
|
3026 | this._isCancelled = true;
|
3027 | if (this._emitter) {
|
3028 | this._emitter.fire(undefined);
|
3029 | this.dispose();
|
3030 | }
|
3031 | }
|
3032 | }
|
3033 | get isCancellationRequested() {
|
3034 | return this._isCancelled;
|
3035 | }
|
3036 | get onCancellationRequested() {
|
3037 | if (this._isCancelled) {
|
3038 | return shortcutEvent;
|
3039 | }
|
3040 | if (!this._emitter) {
|
3041 | this._emitter = new events_1.Emitter();
|
3042 | }
|
3043 | return this._emitter.event;
|
3044 | }
|
3045 | dispose() {
|
3046 | if (this._emitter) {
|
3047 | this._emitter.dispose();
|
3048 | this._emitter = undefined;
|
3049 | }
|
3050 | }
|
3051 | }
|
3052 | class CancellationTokenSource {
|
3053 | get token() {
|
3054 | if (!this._token) {
|
3055 |
|
3056 |
|
3057 | this._token = new MutableToken();
|
3058 | }
|
3059 | return this._token;
|
3060 | }
|
3061 | cancel() {
|
3062 | if (!this._token) {
|
3063 |
|
3064 |
|
3065 |
|
3066 | this._token = CancellationToken.Cancelled;
|
3067 | }
|
3068 | else {
|
3069 | this._token.cancel();
|
3070 | }
|
3071 | }
|
3072 | dispose() {
|
3073 | if (!this._token) {
|
3074 |
|
3075 | this._token = CancellationToken.None;
|
3076 | }
|
3077 | else if (this._token instanceof MutableToken) {
|
3078 |
|
3079 | this._token.dispose();
|
3080 | }
|
3081 | }
|
3082 | }
|
3083 | exports.CancellationTokenSource = CancellationTokenSource;
|
3084 |
|
3085 |
|
3086 | }),
|
3087 |
|
3088 | (function(module, exports, __webpack_require__) {
|
3089 |
|
3090 | "use strict";
|
3091 |
|
3092 |
|
3093 |
|
3094 |
|
3095 |
|
3096 | Object.defineProperty(exports, "__esModule", { value: true });
|
3097 | var Touch;
|
3098 | (function (Touch) {
|
3099 | Touch.None = 0;
|
3100 | Touch.First = 1;
|
3101 | Touch.Last = 2;
|
3102 | })(Touch = exports.Touch || (exports.Touch = {}));
|
3103 | class LinkedMap {
|
3104 | constructor() {
|
3105 | this._map = new Map();
|
3106 | this._head = undefined;
|
3107 | this._tail = undefined;
|
3108 | this._size = 0;
|
3109 | }
|
3110 | clear() {
|
3111 | this._map.clear();
|
3112 | this._head = undefined;
|
3113 | this._tail = undefined;
|
3114 | this._size = 0;
|
3115 | }
|
3116 | isEmpty() {
|
3117 | return !this._head && !this._tail;
|
3118 | }
|
3119 | get size() {
|
3120 | return this._size;
|
3121 | }
|
3122 | has(key) {
|
3123 | return this._map.has(key);
|
3124 | }
|
3125 | get(key) {
|
3126 | const item = this._map.get(key);
|
3127 | if (!item) {
|
3128 | return undefined;
|
3129 | }
|
3130 | return item.value;
|
3131 | }
|
3132 | set(key, value, touch = Touch.None) {
|
3133 | let item = this._map.get(key);
|
3134 | if (item) {
|
3135 | item.value = value;
|
3136 | if (touch !== Touch.None) {
|
3137 | this.touch(item, touch);
|
3138 | }
|
3139 | }
|
3140 | else {
|
3141 | item = { key, value, next: undefined, previous: undefined };
|
3142 | switch (touch) {
|
3143 | case Touch.None:
|
3144 | this.addItemLast(item);
|
3145 | break;
|
3146 | case Touch.First:
|
3147 | this.addItemFirst(item);
|
3148 | break;
|
3149 | case Touch.Last:
|
3150 | this.addItemLast(item);
|
3151 | break;
|
3152 | default:
|
3153 | this.addItemLast(item);
|
3154 | break;
|
3155 | }
|
3156 | this._map.set(key, item);
|
3157 | this._size++;
|
3158 | }
|
3159 | }
|
3160 | delete(key) {
|
3161 | const item = this._map.get(key);
|
3162 | if (!item) {
|
3163 | return false;
|
3164 | }
|
3165 | this._map.delete(key);
|
3166 | this.removeItem(item);
|
3167 | this._size--;
|
3168 | return true;
|
3169 | }
|
3170 | shift() {
|
3171 | if (!this._head && !this._tail) {
|
3172 | return undefined;
|
3173 | }
|
3174 | if (!this._head || !this._tail) {
|
3175 | throw new Error('Invalid list');
|
3176 | }
|
3177 | const item = this._head;
|
3178 | this._map.delete(item.key);
|
3179 | this.removeItem(item);
|
3180 | this._size--;
|
3181 | return item.value;
|
3182 | }
|
3183 | forEach(callbackfn, thisArg) {
|
3184 | let current = this._head;
|
3185 | while (current) {
|
3186 | if (thisArg) {
|
3187 | callbackfn.bind(thisArg)(current.value, current.key, this);
|
3188 | }
|
3189 | else {
|
3190 | callbackfn(current.value, current.key, this);
|
3191 | }
|
3192 | current = current.next;
|
3193 | }
|
3194 | }
|
3195 | forEachReverse(callbackfn, thisArg) {
|
3196 | let current = this._tail;
|
3197 | while (current) {
|
3198 | if (thisArg) {
|
3199 | callbackfn.bind(thisArg)(current.value, current.key, this);
|
3200 | }
|
3201 | else {
|
3202 | callbackfn(current.value, current.key, this);
|
3203 | }
|
3204 | current = current.previous;
|
3205 | }
|
3206 | }
|
3207 | values() {
|
3208 | let result = [];
|
3209 | let current = this._head;
|
3210 | while (current) {
|
3211 | result.push(current.value);
|
3212 | current = current.next;
|
3213 | }
|
3214 | return result;
|
3215 | }
|
3216 | keys() {
|
3217 | let result = [];
|
3218 | let current = this._head;
|
3219 | while (current) {
|
3220 | result.push(current.key);
|
3221 | current = current.next;
|
3222 | }
|
3223 | return result;
|
3224 | }
|
3225 | |
3226 |
|
3227 |
|
3228 |
|
3229 |
|
3230 |
|
3231 |
|
3232 |
|
3233 |
|
3234 |
|
3235 |
|
3236 |
|
3237 |
|
3238 |
|
3239 |
|
3240 |
|
3241 |
|
3242 |
|
3243 |
|
3244 |
|
3245 |
|
3246 |
|
3247 |
|
3248 |
|
3249 |
|
3250 |
|
3251 |
|
3252 |
|
3253 |
|
3254 |
|
3255 |
|
3256 |
|
3257 |
|
3258 |
|
3259 |
|
3260 |
|
3261 |
|
3262 |
|
3263 |
|
3264 | addItemFirst(item) {
|
3265 |
|
3266 | if (!this._head && !this._tail) {
|
3267 | this._tail = item;
|
3268 | }
|
3269 | else if (!this._head) {
|
3270 | throw new Error('Invalid list');
|
3271 | }
|
3272 | else {
|
3273 | item.next = this._head;
|
3274 | this._head.previous = item;
|
3275 | }
|
3276 | this._head = item;
|
3277 | }
|
3278 | addItemLast(item) {
|
3279 |
|
3280 | if (!this._head && !this._tail) {
|
3281 | this._head = item;
|
3282 | }
|
3283 | else if (!this._tail) {
|
3284 | throw new Error('Invalid list');
|
3285 | }
|
3286 | else {
|
3287 | item.previous = this._tail;
|
3288 | this._tail.next = item;
|
3289 | }
|
3290 | this._tail = item;
|
3291 | }
|
3292 | removeItem(item) {
|
3293 | if (item === this._head && item === this._tail) {
|
3294 | this._head = undefined;
|
3295 | this._tail = undefined;
|
3296 | }
|
3297 | else if (item === this._head) {
|
3298 | this._head = item.next;
|
3299 | }
|
3300 | else if (item === this._tail) {
|
3301 | this._tail = item.previous;
|
3302 | }
|
3303 | else {
|
3304 | const next = item.next;
|
3305 | const previous = item.previous;
|
3306 | if (!next || !previous) {
|
3307 | throw new Error('Invalid list');
|
3308 | }
|
3309 | next.previous = previous;
|
3310 | previous.next = next;
|
3311 | }
|
3312 | }
|
3313 | touch(item, touch) {
|
3314 | if (!this._head || !this._tail) {
|
3315 | throw new Error('Invalid list');
|
3316 | }
|
3317 | if ((touch !== Touch.First && touch !== Touch.Last)) {
|
3318 | return;
|
3319 | }
|
3320 | if (touch === Touch.First) {
|
3321 | if (item === this._head) {
|
3322 | return;
|
3323 | }
|
3324 | const next = item.next;
|
3325 | const previous = item.previous;
|
3326 |
|
3327 | if (item === this._tail) {
|
3328 |
|
3329 |
|
3330 | previous.next = undefined;
|
3331 | this._tail = previous;
|
3332 | }
|
3333 | else {
|
3334 |
|
3335 | next.previous = previous;
|
3336 | previous.next = next;
|
3337 | }
|
3338 |
|
3339 | item.previous = undefined;
|
3340 | item.next = this._head;
|
3341 | this._head.previous = item;
|
3342 | this._head = item;
|
3343 | }
|
3344 | else if (touch === Touch.Last) {
|
3345 | if (item === this._tail) {
|
3346 | return;
|
3347 | }
|
3348 | const next = item.next;
|
3349 | const previous = item.previous;
|
3350 |
|
3351 | if (item === this._head) {
|
3352 |
|
3353 |
|
3354 | next.previous = undefined;
|
3355 | this._head = next;
|
3356 | }
|
3357 | else {
|
3358 |
|
3359 | next.previous = previous;
|
3360 | previous.next = next;
|
3361 | }
|
3362 | item.next = undefined;
|
3363 | item.previous = this._tail;
|
3364 | this._tail.next = item;
|
3365 | this._tail = item;
|
3366 | }
|
3367 | }
|
3368 | }
|
3369 | exports.LinkedMap = LinkedMap;
|
3370 |
|
3371 |
|
3372 | }),
|
3373 |
|
3374 | (function(module, exports, __webpack_require__) {
|
3375 |
|
3376 | "use strict";
|
3377 |
|
3378 |
|
3379 |
|
3380 |
|
3381 |
|
3382 | Object.defineProperty(exports, "__esModule", { value: true });
|
3383 | const path_1 = __webpack_require__(13);
|
3384 | const os_1 = __webpack_require__(14);
|
3385 | const crypto_1 = __webpack_require__(15);
|
3386 | const net_1 = __webpack_require__(16);
|
3387 | const messageReader_1 = __webpack_require__(7);
|
3388 | const messageWriter_1 = __webpack_require__(9);
|
3389 | function generateRandomPipeName() {
|
3390 | const randomSuffix = crypto_1.randomBytes(21).toString('hex');
|
3391 | if (process.platform === 'win32') {
|
3392 | return `\\\\.\\pipe\\vscode-jsonrpc-${randomSuffix}-sock`;
|
3393 | }
|
3394 | else {
|
3395 |
|
3396 | return path_1.join(os_1.tmpdir(), `vscode-${randomSuffix}.sock`);
|
3397 | }
|
3398 | }
|
3399 | exports.generateRandomPipeName = generateRandomPipeName;
|
3400 | function createClientPipeTransport(pipeName, encoding = 'utf-8') {
|
3401 | let connectResolve;
|
3402 | let connected = new Promise((resolve, _reject) => {
|
3403 | connectResolve = resolve;
|
3404 | });
|
3405 | return new Promise((resolve, reject) => {
|
3406 | let server = net_1.createServer((socket) => {
|
3407 | server.close();
|
3408 | connectResolve([
|
3409 | new messageReader_1.SocketMessageReader(socket, encoding),
|
3410 | new messageWriter_1.SocketMessageWriter(socket, encoding)
|
3411 | ]);
|
3412 | });
|
3413 | server.on('error', reject);
|
3414 | server.listen(pipeName, () => {
|
3415 | server.removeListener('error', reject);
|
3416 | resolve({
|
3417 | onConnected: () => { return connected; }
|
3418 | });
|
3419 | });
|
3420 | });
|
3421 | }
|
3422 | exports.createClientPipeTransport = createClientPipeTransport;
|
3423 | function createServerPipeTransport(pipeName, encoding = 'utf-8') {
|
3424 | const socket = net_1.createConnection(pipeName);
|
3425 | return [
|
3426 | new messageReader_1.SocketMessageReader(socket, encoding),
|
3427 | new messageWriter_1.SocketMessageWriter(socket, encoding)
|
3428 | ];
|
3429 | }
|
3430 | exports.createServerPipeTransport = createServerPipeTransport;
|
3431 |
|
3432 |
|
3433 | }),
|
3434 |
|
3435 | (function(module, exports) {
|
3436 |
|
3437 | module.exports = require("path");
|
3438 |
|
3439 | }),
|
3440 |
|
3441 | (function(module, exports) {
|
3442 |
|
3443 | module.exports = require("os");
|
3444 |
|
3445 | }),
|
3446 |
|
3447 | (function(module, exports) {
|
3448 |
|
3449 | module.exports = require("crypto");
|
3450 |
|
3451 | }),
|
3452 |
|
3453 | (function(module, exports) {
|
3454 |
|
3455 | module.exports = require("net");
|
3456 |
|
3457 | }),
|
3458 |
|
3459 | (function(module, exports, __webpack_require__) {
|
3460 |
|
3461 | "use strict";
|
3462 |
|
3463 |
|
3464 |
|
3465 |
|
3466 |
|
3467 | Object.defineProperty(exports, "__esModule", { value: true });
|
3468 | const net_1 = __webpack_require__(16);
|
3469 | const messageReader_1 = __webpack_require__(7);
|
3470 | const messageWriter_1 = __webpack_require__(9);
|
3471 | function createClientSocketTransport(port, encoding = 'utf-8') {
|
3472 | let connectResolve;
|
3473 | let connected = new Promise((resolve, _reject) => {
|
3474 | connectResolve = resolve;
|
3475 | });
|
3476 | return new Promise((resolve, reject) => {
|
3477 | let server = net_1.createServer((socket) => {
|
3478 | server.close();
|
3479 | connectResolve([
|
3480 | new messageReader_1.SocketMessageReader(socket, encoding),
|
3481 | new messageWriter_1.SocketMessageWriter(socket, encoding)
|
3482 | ]);
|
3483 | });
|
3484 | server.on('error', reject);
|
3485 | server.listen(port, '127.0.0.1', () => {
|
3486 | server.removeListener('error', reject);
|
3487 | resolve({
|
3488 | onConnected: () => { return connected; }
|
3489 | });
|
3490 | });
|
3491 | });
|
3492 | }
|
3493 | exports.createClientSocketTransport = createClientSocketTransport;
|
3494 | function createServerSocketTransport(port, encoding = 'utf-8') {
|
3495 | const socket = net_1.createConnection(port, '127.0.0.1');
|
3496 | return [
|
3497 | new messageReader_1.SocketMessageReader(socket, encoding),
|
3498 | new messageWriter_1.SocketMessageWriter(socket, encoding)
|
3499 | ];
|
3500 | }
|
3501 | exports.createServerSocketTransport = createServerSocketTransport;
|
3502 |
|
3503 |
|
3504 | }),
|
3505 |
|
3506 | (function(module, __webpack_exports__, __webpack_require__) {
|
3507 |
|
3508 | "use strict";
|
3509 | __webpack_require__.r(__webpack_exports__);
|
3510 | __webpack_require__.d(__webpack_exports__, "Position", function() { return Position; });
|
3511 | __webpack_require__.d(__webpack_exports__, "Range", function() { return Range; });
|
3512 | __webpack_require__.d(__webpack_exports__, "Location", function() { return Location; });
|
3513 | __webpack_require__.d(__webpack_exports__, "LocationLink", function() { return LocationLink; });
|
3514 | __webpack_require__.d(__webpack_exports__, "Color", function() { return Color; });
|
3515 | __webpack_require__.d(__webpack_exports__, "ColorInformation", function() { return ColorInformation; });
|
3516 | __webpack_require__.d(__webpack_exports__, "ColorPresentation", function() { return ColorPresentation; });
|
3517 | __webpack_require__.d(__webpack_exports__, "FoldingRangeKind", function() { return FoldingRangeKind; });
|
3518 | __webpack_require__.d(__webpack_exports__, "FoldingRange", function() { return FoldingRange; });
|
3519 | __webpack_require__.d(__webpack_exports__, "DiagnosticRelatedInformation", function() { return DiagnosticRelatedInformation; });
|
3520 | __webpack_require__.d(__webpack_exports__, "DiagnosticSeverity", function() { return DiagnosticSeverity; });
|
3521 | __webpack_require__.d(__webpack_exports__, "DiagnosticTag", function() { return DiagnosticTag; });
|
3522 | __webpack_require__.d(__webpack_exports__, "Diagnostic", function() { return Diagnostic; });
|
3523 | __webpack_require__.d(__webpack_exports__, "Command", function() { return Command; });
|
3524 | __webpack_require__.d(__webpack_exports__, "TextEdit", function() { return TextEdit; });
|
3525 | __webpack_require__.d(__webpack_exports__, "TextDocumentEdit", function() { return TextDocumentEdit; });
|
3526 | __webpack_require__.d(__webpack_exports__, "CreateFile", function() { return CreateFile; });
|
3527 | __webpack_require__.d(__webpack_exports__, "RenameFile", function() { return RenameFile; });
|
3528 | __webpack_require__.d(__webpack_exports__, "DeleteFile", function() { return DeleteFile; });
|
3529 | __webpack_require__.d(__webpack_exports__, "WorkspaceEdit", function() { return WorkspaceEdit; });
|
3530 | __webpack_require__.d(__webpack_exports__, "WorkspaceChange", function() { return WorkspaceChange; });
|
3531 | __webpack_require__.d(__webpack_exports__, "TextDocumentIdentifier", function() { return TextDocumentIdentifier; });
|
3532 | __webpack_require__.d(__webpack_exports__, "VersionedTextDocumentIdentifier", function() { return VersionedTextDocumentIdentifier; });
|
3533 | __webpack_require__.d(__webpack_exports__, "TextDocumentItem", function() { return TextDocumentItem; });
|
3534 | __webpack_require__.d(__webpack_exports__, "MarkupKind", function() { return MarkupKind; });
|
3535 | __webpack_require__.d(__webpack_exports__, "MarkupContent", function() { return MarkupContent; });
|
3536 | __webpack_require__.d(__webpack_exports__, "CompletionItemKind", function() { return CompletionItemKind; });
|
3537 | __webpack_require__.d(__webpack_exports__, "InsertTextFormat", function() { return InsertTextFormat; });
|
3538 | __webpack_require__.d(__webpack_exports__, "CompletionItemTag", function() { return CompletionItemTag; });
|
3539 | __webpack_require__.d(__webpack_exports__, "CompletionItem", function() { return CompletionItem; });
|
3540 | __webpack_require__.d(__webpack_exports__, "CompletionList", function() { return CompletionList; });
|
3541 | __webpack_require__.d(__webpack_exports__, "MarkedString", function() { return MarkedString; });
|
3542 | __webpack_require__.d(__webpack_exports__, "Hover", function() { return Hover; });
|
3543 | __webpack_require__.d(__webpack_exports__, "ParameterInformation", function() { return ParameterInformation; });
|
3544 | __webpack_require__.d(__webpack_exports__, "SignatureInformation", function() { return SignatureInformation; });
|
3545 | __webpack_require__.d(__webpack_exports__, "DocumentHighlightKind", function() { return DocumentHighlightKind; });
|
3546 | __webpack_require__.d(__webpack_exports__, "DocumentHighlight", function() { return DocumentHighlight; });
|
3547 | __webpack_require__.d(__webpack_exports__, "SymbolKind", function() { return SymbolKind; });
|
3548 | __webpack_require__.d(__webpack_exports__, "SymbolTag", function() { return SymbolTag; });
|
3549 | __webpack_require__.d(__webpack_exports__, "SymbolInformation", function() { return SymbolInformation; });
|
3550 | __webpack_require__.d(__webpack_exports__, "DocumentSymbol", function() { return DocumentSymbol; });
|
3551 | __webpack_require__.d(__webpack_exports__, "CodeActionKind", function() { return CodeActionKind; });
|
3552 | __webpack_require__.d(__webpack_exports__, "CodeActionContext", function() { return CodeActionContext; });
|
3553 | __webpack_require__.d(__webpack_exports__, "CodeAction", function() { return CodeAction; });
|
3554 | __webpack_require__.d(__webpack_exports__, "CodeLens", function() { return CodeLens; });
|
3555 | __webpack_require__.d(__webpack_exports__, "FormattingOptions", function() { return FormattingOptions; });
|
3556 | __webpack_require__.d(__webpack_exports__, "DocumentLink", function() { return DocumentLink; });
|
3557 | __webpack_require__.d(__webpack_exports__, "SelectionRange", function() { return SelectionRange; });
|
3558 | __webpack_require__.d(__webpack_exports__, "EOL", function() { return EOL; });
|
3559 | __webpack_require__.d(__webpack_exports__, "TextDocument", function() { return TextDocument; });
|
3560 |
|
3561 |
|
3562 |
|
3563 |
|
3564 |
|
3565 |
|
3566 |
|
3567 |
|
3568 |
|
3569 | var Position;
|
3570 | (function (Position) {
|
3571 | |
3572 |
|
3573 |
|
3574 |
|
3575 |
|
3576 | function create(line, character) {
|
3577 | return { line: line, character: character };
|
3578 | }
|
3579 | Position.create = create;
|
3580 | |
3581 |
|
3582 |
|
3583 | function is(value) {
|
3584 | var candidate = value;
|
3585 | return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);
|
3586 | }
|
3587 | Position.is = is;
|
3588 | })(Position || (Position = {}));
|
3589 |
|
3590 |
|
3591 |
|
3592 |
|
3593 | var Range;
|
3594 | (function (Range) {
|
3595 | function create(one, two, three, four) {
|
3596 | if (Is.number(one) && Is.number(two) && Is.number(three) && Is.number(four)) {
|
3597 | return { start: Position.create(one, two), end: Position.create(three, four) };
|
3598 | }
|
3599 | else if (Position.is(one) && Position.is(two)) {
|
3600 | return { start: one, end: two };
|
3601 | }
|
3602 | else {
|
3603 | throw new Error("Range#create called with invalid arguments[" + one + ", " + two + ", " + three + ", " + four + "]");
|
3604 | }
|
3605 | }
|
3606 | Range.create = create;
|
3607 | |
3608 |
|
3609 |
|
3610 | function is(value) {
|
3611 | var candidate = value;
|
3612 | return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);
|
3613 | }
|
3614 | Range.is = is;
|
3615 | })(Range || (Range = {}));
|
3616 |
|
3617 |
|
3618 |
|
3619 |
|
3620 | var Location;
|
3621 | (function (Location) {
|
3622 | |
3623 |
|
3624 |
|
3625 |
|
3626 |
|
3627 | function create(uri, range) {
|
3628 | return { uri: uri, range: range };
|
3629 | }
|
3630 | Location.create = create;
|
3631 | |
3632 |
|
3633 |
|
3634 | function is(value) {
|
3635 | var candidate = value;
|
3636 | return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
|
3637 | }
|
3638 | Location.is = is;
|
3639 | })(Location || (Location = {}));
|
3640 |
|
3641 |
|
3642 |
|
3643 |
|
3644 | var LocationLink;
|
3645 | (function (LocationLink) {
|
3646 | |
3647 |
|
3648 |
|
3649 |
|
3650 |
|
3651 |
|
3652 |
|
3653 | function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
|
3654 | return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange };
|
3655 | }
|
3656 | LocationLink.create = create;
|
3657 | |
3658 |
|
3659 |
|
3660 | function is(value) {
|
3661 | var candidate = value;
|
3662 | return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri)
|
3663 | && (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange))
|
3664 | && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
|
3665 | }
|
3666 | LocationLink.is = is;
|
3667 | })(LocationLink || (LocationLink = {}));
|
3668 |
|
3669 |
|
3670 |
|
3671 |
|
3672 | var Color;
|
3673 | (function (Color) {
|
3674 | |
3675 |
|
3676 |
|
3677 | function create(red, green, blue, alpha) {
|
3678 | return {
|
3679 | red: red,
|
3680 | green: green,
|
3681 | blue: blue,
|
3682 | alpha: alpha,
|
3683 | };
|
3684 | }
|
3685 | Color.create = create;
|
3686 | |
3687 |
|
3688 |
|
3689 | function is(value) {
|
3690 | var candidate = value;
|
3691 | return Is.number(candidate.red)
|
3692 | && Is.number(candidate.green)
|
3693 | && Is.number(candidate.blue)
|
3694 | && Is.number(candidate.alpha);
|
3695 | }
|
3696 | Color.is = is;
|
3697 | })(Color || (Color = {}));
|
3698 |
|
3699 |
|
3700 |
|
3701 |
|
3702 | var ColorInformation;
|
3703 | (function (ColorInformation) {
|
3704 | |
3705 |
|
3706 |
|
3707 | function create(range, color) {
|
3708 | return {
|
3709 | range: range,
|
3710 | color: color,
|
3711 | };
|
3712 | }
|
3713 | ColorInformation.create = create;
|
3714 | |
3715 |
|
3716 |
|
3717 | function is(value) {
|
3718 | var candidate = value;
|
3719 | return Range.is(candidate.range) && Color.is(candidate.color);
|
3720 | }
|
3721 | ColorInformation.is = is;
|
3722 | })(ColorInformation || (ColorInformation = {}));
|
3723 |
|
3724 |
|
3725 |
|
3726 |
|
3727 | var ColorPresentation;
|
3728 | (function (ColorPresentation) {
|
3729 | |
3730 |
|
3731 |
|
3732 | function create(label, textEdit, additionalTextEdits) {
|
3733 | return {
|
3734 | label: label,
|
3735 | textEdit: textEdit,
|
3736 | additionalTextEdits: additionalTextEdits,
|
3737 | };
|
3738 | }
|
3739 | ColorPresentation.create = create;
|
3740 | |
3741 |
|
3742 |
|
3743 | function is(value) {
|
3744 | var candidate = value;
|
3745 | return Is.string(candidate.label)
|
3746 | && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate))
|
3747 | && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));
|
3748 | }
|
3749 | ColorPresentation.is = is;
|
3750 | })(ColorPresentation || (ColorPresentation = {}));
|
3751 |
|
3752 |
|
3753 |
|
3754 | var FoldingRangeKind;
|
3755 | (function (FoldingRangeKind) {
|
3756 | |
3757 |
|
3758 |
|
3759 | FoldingRangeKind["Comment"] = "comment";
|
3760 | |
3761 |
|
3762 |
|
3763 | FoldingRangeKind["Imports"] = "imports";
|
3764 | |
3765 |
|
3766 |
|
3767 | FoldingRangeKind["Region"] = "region";
|
3768 | })(FoldingRangeKind || (FoldingRangeKind = {}));
|
3769 |
|
3770 |
|
3771 |
|
3772 |
|
3773 | var FoldingRange;
|
3774 | (function (FoldingRange) {
|
3775 | |
3776 |
|
3777 |
|
3778 | function create(startLine, endLine, startCharacter, endCharacter, kind) {
|
3779 | var result = {
|
3780 | startLine: startLine,
|
3781 | endLine: endLine
|
3782 | };
|
3783 | if (Is.defined(startCharacter)) {
|
3784 | result.startCharacter = startCharacter;
|
3785 | }
|
3786 | if (Is.defined(endCharacter)) {
|
3787 | result.endCharacter = endCharacter;
|
3788 | }
|
3789 | if (Is.defined(kind)) {
|
3790 | result.kind = kind;
|
3791 | }
|
3792 | return result;
|
3793 | }
|
3794 | FoldingRange.create = create;
|
3795 | |
3796 |
|
3797 |
|
3798 | function is(value) {
|
3799 | var candidate = value;
|
3800 | return Is.number(candidate.startLine) && Is.number(candidate.startLine)
|
3801 | && (Is.undefined(candidate.startCharacter) || Is.number(candidate.startCharacter))
|
3802 | && (Is.undefined(candidate.endCharacter) || Is.number(candidate.endCharacter))
|
3803 | && (Is.undefined(candidate.kind) || Is.string(candidate.kind));
|
3804 | }
|
3805 | FoldingRange.is = is;
|
3806 | })(FoldingRange || (FoldingRange = {}));
|
3807 |
|
3808 |
|
3809 |
|
3810 |
|
3811 | var DiagnosticRelatedInformation;
|
3812 | (function (DiagnosticRelatedInformation) {
|
3813 | |
3814 |
|
3815 |
|
3816 | function create(location, message) {
|
3817 | return {
|
3818 | location: location,
|
3819 | message: message
|
3820 | };
|
3821 | }
|
3822 | DiagnosticRelatedInformation.create = create;
|
3823 | |
3824 |
|
3825 |
|
3826 | function is(value) {
|
3827 | var candidate = value;
|
3828 | return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);
|
3829 | }
|
3830 | DiagnosticRelatedInformation.is = is;
|
3831 | })(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {}));
|
3832 |
|
3833 |
|
3834 |
|
3835 | var DiagnosticSeverity;
|
3836 | (function (DiagnosticSeverity) {
|
3837 | |
3838 |
|
3839 |
|
3840 | DiagnosticSeverity.Error = 1;
|
3841 | |
3842 |
|
3843 |
|
3844 | DiagnosticSeverity.Warning = 2;
|
3845 | |
3846 |
|
3847 |
|
3848 | DiagnosticSeverity.Information = 3;
|
3849 | |
3850 |
|
3851 |
|
3852 | DiagnosticSeverity.Hint = 4;
|
3853 | })(DiagnosticSeverity || (DiagnosticSeverity = {}));
|
3854 |
|
3855 |
|
3856 |
|
3857 |
|
3858 |
|
3859 | var DiagnosticTag;
|
3860 | (function (DiagnosticTag) {
|
3861 | |
3862 |
|
3863 |
|
3864 |
|
3865 |
|
3866 |
|
3867 | DiagnosticTag.Unnecessary = 1;
|
3868 | |
3869 |
|
3870 |
|
3871 |
|
3872 |
|
3873 | DiagnosticTag.Deprecated = 2;
|
3874 | })(DiagnosticTag || (DiagnosticTag = {}));
|
3875 |
|
3876 |
|
3877 |
|
3878 |
|
3879 | var Diagnostic;
|
3880 | (function (Diagnostic) {
|
3881 | |
3882 |
|
3883 |
|
3884 | function create(range, message, severity, code, source, relatedInformation) {
|
3885 | var result = { range: range, message: message };
|
3886 | if (Is.defined(severity)) {
|
3887 | result.severity = severity;
|
3888 | }
|
3889 | if (Is.defined(code)) {
|
3890 | result.code = code;
|
3891 | }
|
3892 | if (Is.defined(source)) {
|
3893 | result.source = source;
|
3894 | }
|
3895 | if (Is.defined(relatedInformation)) {
|
3896 | result.relatedInformation = relatedInformation;
|
3897 | }
|
3898 | return result;
|
3899 | }
|
3900 | Diagnostic.create = create;
|
3901 | |
3902 |
|
3903 |
|
3904 | function is(value) {
|
3905 | var candidate = value;
|
3906 | return Is.defined(candidate)
|
3907 | && Range.is(candidate.range)
|
3908 | && Is.string(candidate.message)
|
3909 | && (Is.number(candidate.severity) || Is.undefined(candidate.severity))
|
3910 | && (Is.number(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code))
|
3911 | && (Is.string(candidate.source) || Is.undefined(candidate.source))
|
3912 | && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));
|
3913 | }
|
3914 | Diagnostic.is = is;
|
3915 | })(Diagnostic || (Diagnostic = {}));
|
3916 |
|
3917 |
|
3918 |
|
3919 |
|
3920 | var Command;
|
3921 | (function (Command) {
|
3922 | |
3923 |
|
3924 |
|
3925 | function create(title, command) {
|
3926 | var args = [];
|
3927 | for (var _i = 2; _i < arguments.length; _i++) {
|
3928 | args[_i - 2] = arguments[_i];
|
3929 | }
|
3930 | var result = { title: title, command: command };
|
3931 | if (Is.defined(args) && args.length > 0) {
|
3932 | result.arguments = args;
|
3933 | }
|
3934 | return result;
|
3935 | }
|
3936 | Command.create = create;
|
3937 | |
3938 |
|
3939 |
|
3940 | function is(value) {
|
3941 | var candidate = value;
|
3942 | return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);
|
3943 | }
|
3944 | Command.is = is;
|
3945 | })(Command || (Command = {}));
|
3946 |
|
3947 |
|
3948 |
|
3949 |
|
3950 | var TextEdit;
|
3951 | (function (TextEdit) {
|
3952 | |
3953 |
|
3954 |
|
3955 |
|
3956 |
|
3957 | function replace(range, newText) {
|
3958 | return { range: range, newText: newText };
|
3959 | }
|
3960 | TextEdit.replace = replace;
|
3961 | |
3962 |
|
3963 |
|
3964 |
|
3965 |
|
3966 | function insert(position, newText) {
|
3967 | return { range: { start: position, end: position }, newText: newText };
|
3968 | }
|
3969 | TextEdit.insert = insert;
|
3970 | |
3971 |
|
3972 |
|
3973 |
|
3974 | function del(range) {
|
3975 | return { range: range, newText: '' };
|
3976 | }
|
3977 | TextEdit.del = del;
|
3978 | function is(value) {
|
3979 | var candidate = value;
|
3980 | return Is.objectLiteral(candidate)
|
3981 | && Is.string(candidate.newText)
|
3982 | && Range.is(candidate.range);
|
3983 | }
|
3984 | TextEdit.is = is;
|
3985 | })(TextEdit || (TextEdit = {}));
|
3986 |
|
3987 |
|
3988 |
|
3989 |
|
3990 | var TextDocumentEdit;
|
3991 | (function (TextDocumentEdit) {
|
3992 | |
3993 |
|
3994 |
|
3995 | function create(textDocument, edits) {
|
3996 | return { textDocument: textDocument, edits: edits };
|
3997 | }
|
3998 | TextDocumentEdit.create = create;
|
3999 | function is(value) {
|
4000 | var candidate = value;
|
4001 | return Is.defined(candidate)
|
4002 | && VersionedTextDocumentIdentifier.is(candidate.textDocument)
|
4003 | && Array.isArray(candidate.edits);
|
4004 | }
|
4005 | TextDocumentEdit.is = is;
|
4006 | })(TextDocumentEdit || (TextDocumentEdit = {}));
|
4007 | var CreateFile;
|
4008 | (function (CreateFile) {
|
4009 | function create(uri, options) {
|
4010 | var result = {
|
4011 | kind: 'create',
|
4012 | uri: uri
|
4013 | };
|
4014 | if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
|
4015 | result.options = options;
|
4016 | }
|
4017 | return result;
|
4018 | }
|
4019 | CreateFile.create = create;
|
4020 | function is(value) {
|
4021 | var candidate = value;
|
4022 | return candidate && candidate.kind === 'create' && Is.string(candidate.uri) &&
|
4023 | (candidate.options === void 0 ||
|
4024 | ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))));
|
4025 | }
|
4026 | CreateFile.is = is;
|
4027 | })(CreateFile || (CreateFile = {}));
|
4028 | var RenameFile;
|
4029 | (function (RenameFile) {
|
4030 | function create(oldUri, newUri, options) {
|
4031 | var result = {
|
4032 | kind: 'rename',
|
4033 | oldUri: oldUri,
|
4034 | newUri: newUri
|
4035 | };
|
4036 | if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
|
4037 | result.options = options;
|
4038 | }
|
4039 | return result;
|
4040 | }
|
4041 | RenameFile.create = create;
|
4042 | function is(value) {
|
4043 | var candidate = value;
|
4044 | return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) &&
|
4045 | (candidate.options === void 0 ||
|
4046 | ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))));
|
4047 | }
|
4048 | RenameFile.is = is;
|
4049 | })(RenameFile || (RenameFile = {}));
|
4050 | var DeleteFile;
|
4051 | (function (DeleteFile) {
|
4052 | function create(uri, options) {
|
4053 | var result = {
|
4054 | kind: 'delete',
|
4055 | uri: uri
|
4056 | };
|
4057 | if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) {
|
4058 | result.options = options;
|
4059 | }
|
4060 | return result;
|
4061 | }
|
4062 | DeleteFile.create = create;
|
4063 | function is(value) {
|
4064 | var candidate = value;
|
4065 | return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) &&
|
4066 | (candidate.options === void 0 ||
|
4067 | ((candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists))));
|
4068 | }
|
4069 | DeleteFile.is = is;
|
4070 | })(DeleteFile || (DeleteFile = {}));
|
4071 | var WorkspaceEdit;
|
4072 | (function (WorkspaceEdit) {
|
4073 | function is(value) {
|
4074 | var candidate = value;
|
4075 | return candidate &&
|
4076 | (candidate.changes !== void 0 || candidate.documentChanges !== void 0) &&
|
4077 | (candidate.documentChanges === void 0 || candidate.documentChanges.every(function (change) {
|
4078 | if (Is.string(change.kind)) {
|
4079 | return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);
|
4080 | }
|
4081 | else {
|
4082 | return TextDocumentEdit.is(change);
|
4083 | }
|
4084 | }));
|
4085 | }
|
4086 | WorkspaceEdit.is = is;
|
4087 | })(WorkspaceEdit || (WorkspaceEdit = {}));
|
4088 | var TextEditChangeImpl = (function () {
|
4089 | function TextEditChangeImpl(edits) {
|
4090 | this.edits = edits;
|
4091 | }
|
4092 | TextEditChangeImpl.prototype.insert = function (position, newText) {
|
4093 | this.edits.push(TextEdit.insert(position, newText));
|
4094 | };
|
4095 | TextEditChangeImpl.prototype.replace = function (range, newText) {
|
4096 | this.edits.push(TextEdit.replace(range, newText));
|
4097 | };
|
4098 | TextEditChangeImpl.prototype.delete = function (range) {
|
4099 | this.edits.push(TextEdit.del(range));
|
4100 | };
|
4101 | TextEditChangeImpl.prototype.add = function (edit) {
|
4102 | this.edits.push(edit);
|
4103 | };
|
4104 | TextEditChangeImpl.prototype.all = function () {
|
4105 | return this.edits;
|
4106 | };
|
4107 | TextEditChangeImpl.prototype.clear = function () {
|
4108 | this.edits.splice(0, this.edits.length);
|
4109 | };
|
4110 | return TextEditChangeImpl;
|
4111 | }());
|
4112 |
|
4113 |
|
4114 |
|
4115 | var WorkspaceChange = (function () {
|
4116 | function WorkspaceChange(workspaceEdit) {
|
4117 | var _this = this;
|
4118 | this._textEditChanges = Object.create(null);
|
4119 | if (workspaceEdit) {
|
4120 | this._workspaceEdit = workspaceEdit;
|
4121 | if (workspaceEdit.documentChanges) {
|
4122 | workspaceEdit.documentChanges.forEach(function (change) {
|
4123 | if (TextDocumentEdit.is(change)) {
|
4124 | var textEditChange = new TextEditChangeImpl(change.edits);
|
4125 | _this._textEditChanges[change.textDocument.uri] = textEditChange;
|
4126 | }
|
4127 | });
|
4128 | }
|
4129 | else if (workspaceEdit.changes) {
|
4130 | Object.keys(workspaceEdit.changes).forEach(function (key) {
|
4131 | var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);
|
4132 | _this._textEditChanges[key] = textEditChange;
|
4133 | });
|
4134 | }
|
4135 | }
|
4136 | }
|
4137 | Object.defineProperty(WorkspaceChange.prototype, "edit", {
|
4138 | |
4139 |
|
4140 |
|
4141 |
|
4142 | get: function () {
|
4143 | return this._workspaceEdit;
|
4144 | },
|
4145 | enumerable: true,
|
4146 | configurable: true
|
4147 | });
|
4148 | WorkspaceChange.prototype.getTextEditChange = function (key) {
|
4149 | if (VersionedTextDocumentIdentifier.is(key)) {
|
4150 | if (!this._workspaceEdit) {
|
4151 | this._workspaceEdit = {
|
4152 | documentChanges: []
|
4153 | };
|
4154 | }
|
4155 | if (!this._workspaceEdit.documentChanges) {
|
4156 | throw new Error('Workspace edit is not configured for document changes.');
|
4157 | }
|
4158 | var textDocument = key;
|
4159 | var result = this._textEditChanges[textDocument.uri];
|
4160 | if (!result) {
|
4161 | var edits = [];
|
4162 | var textDocumentEdit = {
|
4163 | textDocument: textDocument,
|
4164 | edits: edits
|
4165 | };
|
4166 | this._workspaceEdit.documentChanges.push(textDocumentEdit);
|
4167 | result = new TextEditChangeImpl(edits);
|
4168 | this._textEditChanges[textDocument.uri] = result;
|
4169 | }
|
4170 | return result;
|
4171 | }
|
4172 | else {
|
4173 | if (!this._workspaceEdit) {
|
4174 | this._workspaceEdit = {
|
4175 | changes: Object.create(null)
|
4176 | };
|
4177 | }
|
4178 | if (!this._workspaceEdit.changes) {
|
4179 | throw new Error('Workspace edit is not configured for normal text edit changes.');
|
4180 | }
|
4181 | var result = this._textEditChanges[key];
|
4182 | if (!result) {
|
4183 | var edits = [];
|
4184 | this._workspaceEdit.changes[key] = edits;
|
4185 | result = new TextEditChangeImpl(edits);
|
4186 | this._textEditChanges[key] = result;
|
4187 | }
|
4188 | return result;
|
4189 | }
|
4190 | };
|
4191 | WorkspaceChange.prototype.createFile = function (uri, options) {
|
4192 | this.checkDocumentChanges();
|
4193 | this._workspaceEdit.documentChanges.push(CreateFile.create(uri, options));
|
4194 | };
|
4195 | WorkspaceChange.prototype.renameFile = function (oldUri, newUri, options) {
|
4196 | this.checkDocumentChanges();
|
4197 | this._workspaceEdit.documentChanges.push(RenameFile.create(oldUri, newUri, options));
|
4198 | };
|
4199 | WorkspaceChange.prototype.deleteFile = function (uri, options) {
|
4200 | this.checkDocumentChanges();
|
4201 | this._workspaceEdit.documentChanges.push(DeleteFile.create(uri, options));
|
4202 | };
|
4203 | WorkspaceChange.prototype.checkDocumentChanges = function () {
|
4204 | if (!this._workspaceEdit || !this._workspaceEdit.documentChanges) {
|
4205 | throw new Error('Workspace edit is not configured for document changes.');
|
4206 | }
|
4207 | };
|
4208 | return WorkspaceChange;
|
4209 | }());
|
4210 |
|
4211 |
|
4212 |
|
4213 |
|
4214 |
|
4215 | var TextDocumentIdentifier;
|
4216 | (function (TextDocumentIdentifier) {
|
4217 | |
4218 |
|
4219 |
|
4220 |
|
4221 | function create(uri) {
|
4222 | return { uri: uri };
|
4223 | }
|
4224 | TextDocumentIdentifier.create = create;
|
4225 | |
4226 |
|
4227 |
|
4228 | function is(value) {
|
4229 | var candidate = value;
|
4230 | return Is.defined(candidate) && Is.string(candidate.uri);
|
4231 | }
|
4232 | TextDocumentIdentifier.is = is;
|
4233 | })(TextDocumentIdentifier || (TextDocumentIdentifier = {}));
|
4234 |
|
4235 |
|
4236 |
|
4237 |
|
4238 | var VersionedTextDocumentIdentifier;
|
4239 | (function (VersionedTextDocumentIdentifier) {
|
4240 | |
4241 |
|
4242 |
|
4243 |
|
4244 |
|
4245 | function create(uri, version) {
|
4246 | return { uri: uri, version: version };
|
4247 | }
|
4248 | VersionedTextDocumentIdentifier.create = create;
|
4249 | |
4250 |
|
4251 |
|
4252 | function is(value) {
|
4253 | var candidate = value;
|
4254 | return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.number(candidate.version));
|
4255 | }
|
4256 | VersionedTextDocumentIdentifier.is = is;
|
4257 | })(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {}));
|
4258 |
|
4259 |
|
4260 |
|
4261 |
|
4262 | var TextDocumentItem;
|
4263 | (function (TextDocumentItem) {
|
4264 | |
4265 |
|
4266 |
|
4267 |
|
4268 |
|
4269 |
|
4270 |
|
4271 | function create(uri, languageId, version, text) {
|
4272 | return { uri: uri, languageId: languageId, version: version, text: text };
|
4273 | }
|
4274 | TextDocumentItem.create = create;
|
4275 | |
4276 |
|
4277 |
|
4278 | function is(value) {
|
4279 | var candidate = value;
|
4280 | return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.number(candidate.version) && Is.string(candidate.text);
|
4281 | }
|
4282 | TextDocumentItem.is = is;
|
4283 | })(TextDocumentItem || (TextDocumentItem = {}));
|
4284 |
|
4285 |
|
4286 |
|
4287 |
|
4288 |
|
4289 |
|
4290 |
|
4291 | var MarkupKind;
|
4292 | (function (MarkupKind) {
|
4293 | |
4294 |
|
4295 |
|
4296 | MarkupKind.PlainText = 'plaintext';
|
4297 | |
4298 |
|
4299 |
|
4300 | MarkupKind.Markdown = 'markdown';
|
4301 | })(MarkupKind || (MarkupKind = {}));
|
4302 | (function (MarkupKind) {
|
4303 | |
4304 |
|
4305 |
|
4306 | function is(value) {
|
4307 | var candidate = value;
|
4308 | return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown;
|
4309 | }
|
4310 | MarkupKind.is = is;
|
4311 | })(MarkupKind || (MarkupKind = {}));
|
4312 | var MarkupContent;
|
4313 | (function (MarkupContent) {
|
4314 | |
4315 |
|
4316 |
|
4317 | function is(value) {
|
4318 | var candidate = value;
|
4319 | return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);
|
4320 | }
|
4321 | MarkupContent.is = is;
|
4322 | })(MarkupContent || (MarkupContent = {}));
|
4323 |
|
4324 |
|
4325 |
|
4326 | var CompletionItemKind;
|
4327 | (function (CompletionItemKind) {
|
4328 | CompletionItemKind.Text = 1;
|
4329 | CompletionItemKind.Method = 2;
|
4330 | CompletionItemKind.Function = 3;
|
4331 | CompletionItemKind.Constructor = 4;
|
4332 | CompletionItemKind.Field = 5;
|
4333 | CompletionItemKind.Variable = 6;
|
4334 | CompletionItemKind.Class = 7;
|
4335 | CompletionItemKind.Interface = 8;
|
4336 | CompletionItemKind.Module = 9;
|
4337 | CompletionItemKind.Property = 10;
|
4338 | CompletionItemKind.Unit = 11;
|
4339 | CompletionItemKind.Value = 12;
|
4340 | CompletionItemKind.Enum = 13;
|
4341 | CompletionItemKind.Keyword = 14;
|
4342 | CompletionItemKind.Snippet = 15;
|
4343 | CompletionItemKind.Color = 16;
|
4344 | CompletionItemKind.File = 17;
|
4345 | CompletionItemKind.Reference = 18;
|
4346 | CompletionItemKind.Folder = 19;
|
4347 | CompletionItemKind.EnumMember = 20;
|
4348 | CompletionItemKind.Constant = 21;
|
4349 | CompletionItemKind.Struct = 22;
|
4350 | CompletionItemKind.Event = 23;
|
4351 | CompletionItemKind.Operator = 24;
|
4352 | CompletionItemKind.TypeParameter = 25;
|
4353 | })(CompletionItemKind || (CompletionItemKind = {}));
|
4354 |
|
4355 |
|
4356 |
|
4357 |
|
4358 | var InsertTextFormat;
|
4359 | (function (InsertTextFormat) {
|
4360 | |
4361 |
|
4362 |
|
4363 | InsertTextFormat.PlainText = 1;
|
4364 | |
4365 |
|
4366 |
|
4367 |
|
4368 |
|
4369 |
|
4370 |
|
4371 |
|
4372 |
|
4373 |
|
4374 | InsertTextFormat.Snippet = 2;
|
4375 | })(InsertTextFormat || (InsertTextFormat = {}));
|
4376 |
|
4377 |
|
4378 |
|
4379 |
|
4380 |
|
4381 |
|
4382 | var CompletionItemTag;
|
4383 | (function (CompletionItemTag) {
|
4384 | |
4385 |
|
4386 |
|
4387 | CompletionItemTag.Deprecated = 1;
|
4388 | })(CompletionItemTag || (CompletionItemTag = {}));
|
4389 |
|
4390 |
|
4391 |
|
4392 |
|
4393 | var CompletionItem;
|
4394 | (function (CompletionItem) {
|
4395 | |
4396 |
|
4397 |
|
4398 |
|
4399 | function create(label) {
|
4400 | return { label: label };
|
4401 | }
|
4402 | CompletionItem.create = create;
|
4403 | })(CompletionItem || (CompletionItem = {}));
|
4404 |
|
4405 |
|
4406 |
|
4407 |
|
4408 | var CompletionList;
|
4409 | (function (CompletionList) {
|
4410 | |
4411 |
|
4412 |
|
4413 |
|
4414 |
|
4415 |
|
4416 | function create(items, isIncomplete) {
|
4417 | return { items: items ? items : [], isIncomplete: !!isIncomplete };
|
4418 | }
|
4419 | CompletionList.create = create;
|
4420 | })(CompletionList || (CompletionList = {}));
|
4421 | var MarkedString;
|
4422 | (function (MarkedString) {
|
4423 | |
4424 |
|
4425 |
|
4426 |
|
4427 |
|
4428 | function fromPlainText(plainText) {
|
4429 | return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&');
|
4430 | }
|
4431 | MarkedString.fromPlainText = fromPlainText;
|
4432 | |
4433 |
|
4434 |
|
4435 | function is(value) {
|
4436 | var candidate = value;
|
4437 | return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));
|
4438 | }
|
4439 | MarkedString.is = is;
|
4440 | })(MarkedString || (MarkedString = {}));
|
4441 | var Hover;
|
4442 | (function (Hover) {
|
4443 | |
4444 |
|
4445 |
|
4446 | function is(value) {
|
4447 | var candidate = value;
|
4448 | return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) ||
|
4449 | MarkedString.is(candidate.contents) ||
|
4450 | Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range));
|
4451 | }
|
4452 | Hover.is = is;
|
4453 | })(Hover || (Hover = {}));
|
4454 |
|
4455 |
|
4456 |
|
4457 |
|
4458 | var ParameterInformation;
|
4459 | (function (ParameterInformation) {
|
4460 | |
4461 |
|
4462 |
|
4463 |
|
4464 |
|
4465 |
|
4466 | function create(label, documentation) {
|
4467 | return documentation ? { label: label, documentation: documentation } : { label: label };
|
4468 | }
|
4469 | ParameterInformation.create = create;
|
4470 | })(ParameterInformation || (ParameterInformation = {}));
|
4471 |
|
4472 |
|
4473 |
|
4474 |
|
4475 | var SignatureInformation;
|
4476 | (function (SignatureInformation) {
|
4477 | function create(label, documentation) {
|
4478 | var parameters = [];
|
4479 | for (var _i = 2; _i < arguments.length; _i++) {
|
4480 | parameters[_i - 2] = arguments[_i];
|
4481 | }
|
4482 | var result = { label: label };
|
4483 | if (Is.defined(documentation)) {
|
4484 | result.documentation = documentation;
|
4485 | }
|
4486 | if (Is.defined(parameters)) {
|
4487 | result.parameters = parameters;
|
4488 | }
|
4489 | else {
|
4490 | result.parameters = [];
|
4491 | }
|
4492 | return result;
|
4493 | }
|
4494 | SignatureInformation.create = create;
|
4495 | })(SignatureInformation || (SignatureInformation = {}));
|
4496 |
|
4497 |
|
4498 |
|
4499 | var DocumentHighlightKind;
|
4500 | (function (DocumentHighlightKind) {
|
4501 | |
4502 |
|
4503 |
|
4504 | DocumentHighlightKind.Text = 1;
|
4505 | |
4506 |
|
4507 |
|
4508 | DocumentHighlightKind.Read = 2;
|
4509 | |
4510 |
|
4511 |
|
4512 | DocumentHighlightKind.Write = 3;
|
4513 | })(DocumentHighlightKind || (DocumentHighlightKind = {}));
|
4514 |
|
4515 |
|
4516 |
|
4517 |
|
4518 | var DocumentHighlight;
|
4519 | (function (DocumentHighlight) {
|
4520 | |
4521 |
|
4522 |
|
4523 |
|
4524 | function create(range, kind) {
|
4525 | var result = { range: range };
|
4526 | if (Is.number(kind)) {
|
4527 | result.kind = kind;
|
4528 | }
|
4529 | return result;
|
4530 | }
|
4531 | DocumentHighlight.create = create;
|
4532 | })(DocumentHighlight || (DocumentHighlight = {}));
|
4533 |
|
4534 |
|
4535 |
|
4536 | var SymbolKind;
|
4537 | (function (SymbolKind) {
|
4538 | SymbolKind.File = 1;
|
4539 | SymbolKind.Module = 2;
|
4540 | SymbolKind.Namespace = 3;
|
4541 | SymbolKind.Package = 4;
|
4542 | SymbolKind.Class = 5;
|
4543 | SymbolKind.Method = 6;
|
4544 | SymbolKind.Property = 7;
|
4545 | SymbolKind.Field = 8;
|
4546 | SymbolKind.Constructor = 9;
|
4547 | SymbolKind.Enum = 10;
|
4548 | SymbolKind.Interface = 11;
|
4549 | SymbolKind.Function = 12;
|
4550 | SymbolKind.Variable = 13;
|
4551 | SymbolKind.Constant = 14;
|
4552 | SymbolKind.String = 15;
|
4553 | SymbolKind.Number = 16;
|
4554 | SymbolKind.Boolean = 17;
|
4555 | SymbolKind.Array = 18;
|
4556 | SymbolKind.Object = 19;
|
4557 | SymbolKind.Key = 20;
|
4558 | SymbolKind.Null = 21;
|
4559 | SymbolKind.EnumMember = 22;
|
4560 | SymbolKind.Struct = 23;
|
4561 | SymbolKind.Event = 24;
|
4562 | SymbolKind.Operator = 25;
|
4563 | SymbolKind.TypeParameter = 26;
|
4564 | })(SymbolKind || (SymbolKind = {}));
|
4565 |
|
4566 |
|
4567 |
|
4568 |
|
4569 | var SymbolTag;
|
4570 | (function (SymbolTag) {
|
4571 | |
4572 |
|
4573 |
|
4574 | SymbolTag.Deprecated = 1;
|
4575 | })(SymbolTag || (SymbolTag = {}));
|
4576 | var SymbolInformation;
|
4577 | (function (SymbolInformation) {
|
4578 | |
4579 |
|
4580 |
|
4581 |
|
4582 |
|
4583 |
|
4584 |
|
4585 |
|
4586 |
|
4587 | function create(name, kind, range, uri, containerName) {
|
4588 | var result = {
|
4589 | name: name,
|
4590 | kind: kind,
|
4591 | location: { uri: uri, range: range }
|
4592 | };
|
4593 | if (containerName) {
|
4594 | result.containerName = containerName;
|
4595 | }
|
4596 | return result;
|
4597 | }
|
4598 | SymbolInformation.create = create;
|
4599 | })(SymbolInformation || (SymbolInformation = {}));
|
4600 | var DocumentSymbol;
|
4601 | (function (DocumentSymbol) {
|
4602 | |
4603 |
|
4604 |
|
4605 |
|
4606 |
|
4607 |
|
4608 |
|
4609 |
|
4610 |
|
4611 |
|
4612 | function create(name, detail, kind, range, selectionRange, children) {
|
4613 | var result = {
|
4614 | name: name,
|
4615 | detail: detail,
|
4616 | kind: kind,
|
4617 | range: range,
|
4618 | selectionRange: selectionRange
|
4619 | };
|
4620 | if (children !== void 0) {
|
4621 | result.children = children;
|
4622 | }
|
4623 | return result;
|
4624 | }
|
4625 | DocumentSymbol.create = create;
|
4626 | |
4627 |
|
4628 |
|
4629 | function is(value) {
|
4630 | var candidate = value;
|
4631 | return candidate &&
|
4632 | Is.string(candidate.name) && Is.number(candidate.kind) &&
|
4633 | Range.is(candidate.range) && Range.is(candidate.selectionRange) &&
|
4634 | (candidate.detail === void 0 || Is.string(candidate.detail)) &&
|
4635 | (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) &&
|
4636 | (candidate.children === void 0 || Array.isArray(candidate.children));
|
4637 | }
|
4638 | DocumentSymbol.is = is;
|
4639 | })(DocumentSymbol || (DocumentSymbol = {}));
|
4640 |
|
4641 |
|
4642 |
|
4643 | var CodeActionKind;
|
4644 | (function (CodeActionKind) {
|
4645 | |
4646 |
|
4647 |
|
4648 | CodeActionKind.Empty = '';
|
4649 | |
4650 |
|
4651 |
|
4652 | CodeActionKind.QuickFix = 'quickfix';
|
4653 | |
4654 |
|
4655 |
|
4656 | CodeActionKind.Refactor = 'refactor';
|
4657 | |
4658 |
|
4659 |
|
4660 |
|
4661 |
|
4662 |
|
4663 |
|
4664 |
|
4665 |
|
4666 |
|
4667 |
|
4668 | CodeActionKind.RefactorExtract = 'refactor.extract';
|
4669 | |
4670 |
|
4671 |
|
4672 |
|
4673 |
|
4674 |
|
4675 |
|
4676 |
|
4677 |
|
4678 |
|
4679 | CodeActionKind.RefactorInline = 'refactor.inline';
|
4680 | |
4681 |
|
4682 |
|
4683 |
|
4684 |
|
4685 |
|
4686 |
|
4687 |
|
4688 |
|
4689 |
|
4690 |
|
4691 |
|
4692 | CodeActionKind.RefactorRewrite = 'refactor.rewrite';
|
4693 | |
4694 |
|
4695 |
|
4696 |
|
4697 |
|
4698 | CodeActionKind.Source = 'source';
|
4699 | |
4700 |
|
4701 |
|
4702 | CodeActionKind.SourceOrganizeImports = 'source.organizeImports';
|
4703 | |
4704 |
|
4705 |
|
4706 |
|
4707 |
|
4708 |
|
4709 |
|
4710 |
|
4711 | CodeActionKind.SourceFixAll = 'source.fixAll';
|
4712 | })(CodeActionKind || (CodeActionKind = {}));
|
4713 |
|
4714 |
|
4715 |
|
4716 |
|
4717 | var CodeActionContext;
|
4718 | (function (CodeActionContext) {
|
4719 | |
4720 |
|
4721 |
|
4722 | function create(diagnostics, only) {
|
4723 | var result = { diagnostics: diagnostics };
|
4724 | if (only !== void 0 && only !== null) {
|
4725 | result.only = only;
|
4726 | }
|
4727 | return result;
|
4728 | }
|
4729 | CodeActionContext.create = create;
|
4730 | |
4731 |
|
4732 |
|
4733 | function is(value) {
|
4734 | var candidate = value;
|
4735 | return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string));
|
4736 | }
|
4737 | CodeActionContext.is = is;
|
4738 | })(CodeActionContext || (CodeActionContext = {}));
|
4739 | var CodeAction;
|
4740 | (function (CodeAction) {
|
4741 | function create(title, commandOrEdit, kind) {
|
4742 | var result = { title: title };
|
4743 | if (Command.is(commandOrEdit)) {
|
4744 | result.command = commandOrEdit;
|
4745 | }
|
4746 | else {
|
4747 | result.edit = commandOrEdit;
|
4748 | }
|
4749 | if (kind !== void 0) {
|
4750 | result.kind = kind;
|
4751 | }
|
4752 | return result;
|
4753 | }
|
4754 | CodeAction.create = create;
|
4755 | function is(value) {
|
4756 | var candidate = value;
|
4757 | return candidate && Is.string(candidate.title) &&
|
4758 | (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) &&
|
4759 | (candidate.kind === void 0 || Is.string(candidate.kind)) &&
|
4760 | (candidate.edit !== void 0 || candidate.command !== void 0) &&
|
4761 | (candidate.command === void 0 || Command.is(candidate.command)) &&
|
4762 | (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) &&
|
4763 | (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit));
|
4764 | }
|
4765 | CodeAction.is = is;
|
4766 | })(CodeAction || (CodeAction = {}));
|
4767 |
|
4768 |
|
4769 |
|
4770 |
|
4771 | var CodeLens;
|
4772 | (function (CodeLens) {
|
4773 | |
4774 |
|
4775 |
|
4776 | function create(range, data) {
|
4777 | var result = { range: range };
|
4778 | if (Is.defined(data)) {
|
4779 | result.data = data;
|
4780 | }
|
4781 | return result;
|
4782 | }
|
4783 | CodeLens.create = create;
|
4784 | |
4785 |
|
4786 |
|
4787 | function is(value) {
|
4788 | var candidate = value;
|
4789 | return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));
|
4790 | }
|
4791 | CodeLens.is = is;
|
4792 | })(CodeLens || (CodeLens = {}));
|
4793 |
|
4794 |
|
4795 |
|
4796 |
|
4797 | var FormattingOptions;
|
4798 | (function (FormattingOptions) {
|
4799 | |
4800 |
|
4801 |
|
4802 | function create(tabSize, insertSpaces) {
|
4803 | return { tabSize: tabSize, insertSpaces: insertSpaces };
|
4804 | }
|
4805 | FormattingOptions.create = create;
|
4806 | |
4807 |
|
4808 |
|
4809 | function is(value) {
|
4810 | var candidate = value;
|
4811 | return Is.defined(candidate) && Is.number(candidate.tabSize) && Is.boolean(candidate.insertSpaces);
|
4812 | }
|
4813 | FormattingOptions.is = is;
|
4814 | })(FormattingOptions || (FormattingOptions = {}));
|
4815 |
|
4816 |
|
4817 |
|
4818 |
|
4819 | var DocumentLink;
|
4820 | (function (DocumentLink) {
|
4821 | |
4822 |
|
4823 |
|
4824 | function create(range, target, data) {
|
4825 | return { range: range, target: target, data: data };
|
4826 | }
|
4827 | DocumentLink.create = create;
|
4828 | |
4829 |
|
4830 |
|
4831 | function is(value) {
|
4832 | var candidate = value;
|
4833 | return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
|
4834 | }
|
4835 | DocumentLink.is = is;
|
4836 | })(DocumentLink || (DocumentLink = {}));
|
4837 |
|
4838 |
|
4839 |
|
4840 |
|
4841 | var SelectionRange;
|
4842 | (function (SelectionRange) {
|
4843 | |
4844 |
|
4845 |
|
4846 |
|
4847 |
|
4848 | function create(range, parent) {
|
4849 | return { range: range, parent: parent };
|
4850 | }
|
4851 | SelectionRange.create = create;
|
4852 | function is(value) {
|
4853 | var candidate = value;
|
4854 | return candidate !== undefined && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent));
|
4855 | }
|
4856 | SelectionRange.is = is;
|
4857 | })(SelectionRange || (SelectionRange = {}));
|
4858 | var EOL = ['\n', '\r\n', '\r'];
|
4859 |
|
4860 |
|
4861 |
|
4862 | var TextDocument;
|
4863 | (function (TextDocument) {
|
4864 | |
4865 |
|
4866 |
|
4867 |
|
4868 |
|
4869 |
|
4870 | function create(uri, languageId, version, content) {
|
4871 | return new FullTextDocument(uri, languageId, version, content);
|
4872 | }
|
4873 | TextDocument.create = create;
|
4874 | |
4875 |
|
4876 |
|
4877 | function is(value) {
|
4878 | var candidate = value;
|
4879 | return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)
|
4880 | && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;
|
4881 | }
|
4882 | TextDocument.is = is;
|
4883 | function applyEdits(document, edits) {
|
4884 | var text = document.getText();
|
4885 | var sortedEdits = mergeSort(edits, function (a, b) {
|
4886 | var diff = a.range.start.line - b.range.start.line;
|
4887 | if (diff === 0) {
|
4888 | return a.range.start.character - b.range.start.character;
|
4889 | }
|
4890 | return diff;
|
4891 | });
|
4892 | var lastModifiedOffset = text.length;
|
4893 | for (var i = sortedEdits.length - 1; i >= 0; i--) {
|
4894 | var e = sortedEdits[i];
|
4895 | var startOffset = document.offsetAt(e.range.start);
|
4896 | var endOffset = document.offsetAt(e.range.end);
|
4897 | if (endOffset <= lastModifiedOffset) {
|
4898 | text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);
|
4899 | }
|
4900 | else {
|
4901 | throw new Error('Overlapping edit');
|
4902 | }
|
4903 | lastModifiedOffset = startOffset;
|
4904 | }
|
4905 | return text;
|
4906 | }
|
4907 | TextDocument.applyEdits = applyEdits;
|
4908 | function mergeSort(data, compare) {
|
4909 | if (data.length <= 1) {
|
4910 |
|
4911 | return data;
|
4912 | }
|
4913 | var p = (data.length / 2) | 0;
|
4914 | var left = data.slice(0, p);
|
4915 | var right = data.slice(p);
|
4916 | mergeSort(left, compare);
|
4917 | mergeSort(right, compare);
|
4918 | var leftIdx = 0;
|
4919 | var rightIdx = 0;
|
4920 | var i = 0;
|
4921 | while (leftIdx < left.length && rightIdx < right.length) {
|
4922 | var ret = compare(left[leftIdx], right[rightIdx]);
|
4923 | if (ret <= 0) {
|
4924 |
|
4925 | data[i++] = left[leftIdx++];
|
4926 | }
|
4927 | else {
|
4928 |
|
4929 | data[i++] = right[rightIdx++];
|
4930 | }
|
4931 | }
|
4932 | while (leftIdx < left.length) {
|
4933 | data[i++] = left[leftIdx++];
|
4934 | }
|
4935 | while (rightIdx < right.length) {
|
4936 | data[i++] = right[rightIdx++];
|
4937 | }
|
4938 | return data;
|
4939 | }
|
4940 | })(TextDocument || (TextDocument = {}));
|
4941 | var FullTextDocument = (function () {
|
4942 | function FullTextDocument(uri, languageId, version, content) {
|
4943 | this._uri = uri;
|
4944 | this._languageId = languageId;
|
4945 | this._version = version;
|
4946 | this._content = content;
|
4947 | this._lineOffsets = undefined;
|
4948 | }
|
4949 | Object.defineProperty(FullTextDocument.prototype, "uri", {
|
4950 | get: function () {
|
4951 | return this._uri;
|
4952 | },
|
4953 | enumerable: true,
|
4954 | configurable: true
|
4955 | });
|
4956 | Object.defineProperty(FullTextDocument.prototype, "languageId", {
|
4957 | get: function () {
|
4958 | return this._languageId;
|
4959 | },
|
4960 | enumerable: true,
|
4961 | configurable: true
|
4962 | });
|
4963 | Object.defineProperty(FullTextDocument.prototype, "version", {
|
4964 | get: function () {
|
4965 | return this._version;
|
4966 | },
|
4967 | enumerable: true,
|
4968 | configurable: true
|
4969 | });
|
4970 | FullTextDocument.prototype.getText = function (range) {
|
4971 | if (range) {
|
4972 | var start = this.offsetAt(range.start);
|
4973 | var end = this.offsetAt(range.end);
|
4974 | return this._content.substring(start, end);
|
4975 | }
|
4976 | return this._content;
|
4977 | };
|
4978 | FullTextDocument.prototype.update = function (event, version) {
|
4979 | this._content = event.text;
|
4980 | this._version = version;
|
4981 | this._lineOffsets = undefined;
|
4982 | };
|
4983 | FullTextDocument.prototype.getLineOffsets = function () {
|
4984 | if (this._lineOffsets === undefined) {
|
4985 | var lineOffsets = [];
|
4986 | var text = this._content;
|
4987 | var isLineStart = true;
|
4988 | for (var i = 0; i < text.length; i++) {
|
4989 | if (isLineStart) {
|
4990 | lineOffsets.push(i);
|
4991 | isLineStart = false;
|
4992 | }
|
4993 | var ch = text.charAt(i);
|
4994 | isLineStart = (ch === '\r' || ch === '\n');
|
4995 | if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') {
|
4996 | i++;
|
4997 | }
|
4998 | }
|
4999 | if (isLineStart && text.length > 0) {
|
5000 | lineOffsets.push(text.length);
|
5001 | }
|
5002 | this._lineOffsets = lineOffsets;
|
5003 | }
|
5004 | return this._lineOffsets;
|
5005 | };
|
5006 | FullTextDocument.prototype.positionAt = function (offset) {
|
5007 | offset = Math.max(Math.min(offset, this._content.length), 0);
|
5008 | var lineOffsets = this.getLineOffsets();
|
5009 | var low = 0, high = lineOffsets.length;
|
5010 | if (high === 0) {
|
5011 | return Position.create(0, offset);
|
5012 | }
|
5013 | while (low < high) {
|
5014 | var mid = Math.floor((low + high) / 2);
|
5015 | if (lineOffsets[mid] > offset) {
|
5016 | high = mid;
|
5017 | }
|
5018 | else {
|
5019 | low = mid + 1;
|
5020 | }
|
5021 | }
|
5022 |
|
5023 |
|
5024 | var line = low - 1;
|
5025 | return Position.create(line, offset - lineOffsets[line]);
|
5026 | };
|
5027 | FullTextDocument.prototype.offsetAt = function (position) {
|
5028 | var lineOffsets = this.getLineOffsets();
|
5029 | if (position.line >= lineOffsets.length) {
|
5030 | return this._content.length;
|
5031 | }
|
5032 | else if (position.line < 0) {
|
5033 | return 0;
|
5034 | }
|
5035 | var lineOffset = lineOffsets[position.line];
|
5036 | var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;
|
5037 | return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);
|
5038 | };
|
5039 | Object.defineProperty(FullTextDocument.prototype, "lineCount", {
|
5040 | get: function () {
|
5041 | return this.getLineOffsets().length;
|
5042 | },
|
5043 | enumerable: true,
|
5044 | configurable: true
|
5045 | });
|
5046 | return FullTextDocument;
|
5047 | }());
|
5048 | var Is;
|
5049 | (function (Is) {
|
5050 | var toString = Object.prototype.toString;
|
5051 | function defined(value) {
|
5052 | return typeof value !== 'undefined';
|
5053 | }
|
5054 | Is.defined = defined;
|
5055 | function undefined(value) {
|
5056 | return typeof value === 'undefined';
|
5057 | }
|
5058 | Is.undefined = undefined;
|
5059 | function boolean(value) {
|
5060 | return value === true || value === false;
|
5061 | }
|
5062 | Is.boolean = boolean;
|
5063 | function string(value) {
|
5064 | return toString.call(value) === '[object String]';
|
5065 | }
|
5066 | Is.string = string;
|
5067 | function number(value) {
|
5068 | return toString.call(value) === '[object Number]';
|
5069 | }
|
5070 | Is.number = number;
|
5071 | function func(value) {
|
5072 | return toString.call(value) === '[object Function]';
|
5073 | }
|
5074 | Is.func = func;
|
5075 | function objectLiteral(value) {
|
5076 |
|
5077 |
|
5078 |
|
5079 | return value !== null && typeof value === 'object';
|
5080 | }
|
5081 | Is.objectLiteral = objectLiteral;
|
5082 | function typedArray(value, check) {
|
5083 | return Array.isArray(value) && value.every(check);
|
5084 | }
|
5085 | Is.typedArray = typedArray;
|
5086 | })(Is || (Is = {}));
|
5087 |
|
5088 |
|
5089 | }),
|
5090 |
|
5091 | (function(module, exports, __webpack_require__) {
|
5092 |
|
5093 | "use strict";
|
5094 |
|
5095 |
|
5096 |
|
5097 |
|
5098 |
|
5099 | Object.defineProperty(exports, "__esModule", { value: true });
|
5100 | const Is = __webpack_require__(20);
|
5101 | const vscode_jsonrpc_1 = __webpack_require__(4);
|
5102 | const messages_1 = __webpack_require__(21);
|
5103 | const protocol_implementation_1 = __webpack_require__(22);
|
5104 | exports.ImplementationRequest = protocol_implementation_1.ImplementationRequest;
|
5105 | const protocol_typeDefinition_1 = __webpack_require__(23);
|
5106 | exports.TypeDefinitionRequest = protocol_typeDefinition_1.TypeDefinitionRequest;
|
5107 | const protocol_workspaceFolders_1 = __webpack_require__(24);
|
5108 | exports.WorkspaceFoldersRequest = protocol_workspaceFolders_1.WorkspaceFoldersRequest;
|
5109 | exports.DidChangeWorkspaceFoldersNotification = protocol_workspaceFolders_1.DidChangeWorkspaceFoldersNotification;
|
5110 | const protocol_configuration_1 = __webpack_require__(25);
|
5111 | exports.ConfigurationRequest = protocol_configuration_1.ConfigurationRequest;
|
5112 | const protocol_colorProvider_1 = __webpack_require__(26);
|
5113 | exports.DocumentColorRequest = protocol_colorProvider_1.DocumentColorRequest;
|
5114 | exports.ColorPresentationRequest = protocol_colorProvider_1.ColorPresentationRequest;
|
5115 | const protocol_foldingRange_1 = __webpack_require__(27);
|
5116 | exports.FoldingRangeRequest = protocol_foldingRange_1.FoldingRangeRequest;
|
5117 | const protocol_declaration_1 = __webpack_require__(28);
|
5118 | exports.DeclarationRequest = protocol_declaration_1.DeclarationRequest;
|
5119 | const protocol_selectionRange_1 = __webpack_require__(29);
|
5120 | exports.SelectionRangeRequest = protocol_selectionRange_1.SelectionRangeRequest;
|
5121 | const protocol_progress_1 = __webpack_require__(30);
|
5122 | exports.WorkDoneProgress = protocol_progress_1.WorkDoneProgress;
|
5123 | exports.WorkDoneProgressCreateRequest = protocol_progress_1.WorkDoneProgressCreateRequest;
|
5124 | exports.WorkDoneProgressCancelNotification = protocol_progress_1.WorkDoneProgressCancelNotification;
|
5125 |
|
5126 | let __noDynamicImport;
|
5127 |
|
5128 |
|
5129 |
|
5130 |
|
5131 | var DocumentFilter;
|
5132 | (function (DocumentFilter) {
|
5133 | function is(value) {
|
5134 | const candidate = value;
|
5135 | return Is.string(candidate.language) || Is.string(candidate.scheme) || Is.string(candidate.pattern);
|
5136 | }
|
5137 | DocumentFilter.is = is;
|
5138 | })(DocumentFilter = exports.DocumentFilter || (exports.DocumentFilter = {}));
|
5139 |
|
5140 |
|
5141 |
|
5142 |
|
5143 | var DocumentSelector;
|
5144 | (function (DocumentSelector) {
|
5145 | function is(value) {
|
5146 | if (!Array.isArray(value)) {
|
5147 | return false;
|
5148 | }
|
5149 | for (let elem of value) {
|
5150 | if (!Is.string(elem) && !DocumentFilter.is(elem)) {
|
5151 | return false;
|
5152 | }
|
5153 | }
|
5154 | return true;
|
5155 | }
|
5156 | DocumentSelector.is = is;
|
5157 | })(DocumentSelector = exports.DocumentSelector || (exports.DocumentSelector = {}));
|
5158 |
|
5159 |
|
5160 |
|
5161 |
|
5162 | var RegistrationRequest;
|
5163 | (function (RegistrationRequest) {
|
5164 | RegistrationRequest.type = new messages_1.ProtocolRequestType('client/registerCapability');
|
5165 | })(RegistrationRequest = exports.RegistrationRequest || (exports.RegistrationRequest = {}));
|
5166 |
|
5167 |
|
5168 |
|
5169 |
|
5170 | var UnregistrationRequest;
|
5171 | (function (UnregistrationRequest) {
|
5172 | UnregistrationRequest.type = new messages_1.ProtocolRequestType('client/unregisterCapability');
|
5173 | })(UnregistrationRequest = exports.UnregistrationRequest || (exports.UnregistrationRequest = {}));
|
5174 | var ResourceOperationKind;
|
5175 | (function (ResourceOperationKind) {
|
5176 | |
5177 |
|
5178 |
|
5179 | ResourceOperationKind.Create = 'create';
|
5180 | |
5181 |
|
5182 |
|
5183 | ResourceOperationKind.Rename = 'rename';
|
5184 | |
5185 |
|
5186 |
|
5187 | ResourceOperationKind.Delete = 'delete';
|
5188 | })(ResourceOperationKind = exports.ResourceOperationKind || (exports.ResourceOperationKind = {}));
|
5189 | var FailureHandlingKind;
|
5190 | (function (FailureHandlingKind) {
|
5191 | |
5192 |
|
5193 |
|
5194 |
|
5195 | FailureHandlingKind.Abort = 'abort';
|
5196 | |
5197 |
|
5198 |
|
5199 |
|
5200 | FailureHandlingKind.Transactional = 'transactional';
|
5201 | |
5202 |
|
5203 |
|
5204 |
|
5205 |
|
5206 | FailureHandlingKind.TextOnlyTransactional = 'textOnlyTransactional';
|
5207 | |
5208 |
|
5209 |
|
5210 |
|
5211 | FailureHandlingKind.Undo = 'undo';
|
5212 | })(FailureHandlingKind = exports.FailureHandlingKind || (exports.FailureHandlingKind = {}));
|
5213 |
|
5214 |
|
5215 |
|
5216 |
|
5217 | var StaticRegistrationOptions;
|
5218 | (function (StaticRegistrationOptions) {
|
5219 | function hasId(value) {
|
5220 | const candidate = value;
|
5221 | return candidate && Is.string(candidate.id) && candidate.id.length > 0;
|
5222 | }
|
5223 | StaticRegistrationOptions.hasId = hasId;
|
5224 | })(StaticRegistrationOptions = exports.StaticRegistrationOptions || (exports.StaticRegistrationOptions = {}));
|
5225 |
|
5226 |
|
5227 |
|
5228 |
|
5229 | var TextDocumentRegistrationOptions;
|
5230 | (function (TextDocumentRegistrationOptions) {
|
5231 | function is(value) {
|
5232 | const candidate = value;
|
5233 | return candidate && (candidate.documentSelector === null || DocumentSelector.is(candidate.documentSelector));
|
5234 | }
|
5235 | TextDocumentRegistrationOptions.is = is;
|
5236 | })(TextDocumentRegistrationOptions = exports.TextDocumentRegistrationOptions || (exports.TextDocumentRegistrationOptions = {}));
|
5237 |
|
5238 |
|
5239 |
|
5240 |
|
5241 | var WorkDoneProgressOptions;
|
5242 | (function (WorkDoneProgressOptions) {
|
5243 | function is(value) {
|
5244 | const candidate = value;
|
5245 | return Is.objectLiteral(candidate) && (candidate.workDoneProgress === undefined || Is.boolean(candidate.workDoneProgress));
|
5246 | }
|
5247 | WorkDoneProgressOptions.is = is;
|
5248 | function hasWorkDoneProgress(value) {
|
5249 | const candidate = value;
|
5250 | return candidate && Is.boolean(candidate.workDoneProgress);
|
5251 | }
|
5252 | WorkDoneProgressOptions.hasWorkDoneProgress = hasWorkDoneProgress;
|
5253 | })(WorkDoneProgressOptions = exports.WorkDoneProgressOptions || (exports.WorkDoneProgressOptions = {}));
|
5254 |
|
5255 |
|
5256 |
|
5257 |
|
5258 |
|
5259 |
|
5260 |
|
5261 | var InitializeRequest;
|
5262 | (function (InitializeRequest) {
|
5263 | InitializeRequest.type = new messages_1.ProtocolRequestType('initialize');
|
5264 | })(InitializeRequest = exports.InitializeRequest || (exports.InitializeRequest = {}));
|
5265 |
|
5266 |
|
5267 |
|
5268 | var InitializeError;
|
5269 | (function (InitializeError) {
|
5270 | |
5271 |
|
5272 |
|
5273 |
|
5274 |
|
5275 | InitializeError.unknownProtocolVersion = 1;
|
5276 | })(InitializeError = exports.InitializeError || (exports.InitializeError = {}));
|
5277 |
|
5278 |
|
5279 |
|
5280 |
|
5281 |
|
5282 | var InitializedNotification;
|
5283 | (function (InitializedNotification) {
|
5284 | InitializedNotification.type = new messages_1.ProtocolNotificationType('initialized');
|
5285 | })(InitializedNotification = exports.InitializedNotification || (exports.InitializedNotification = {}));
|
5286 |
|
5287 |
|
5288 |
|
5289 |
|
5290 |
|
5291 |
|
5292 |
|
5293 | var ShutdownRequest;
|
5294 | (function (ShutdownRequest) {
|
5295 | ShutdownRequest.type = new messages_1.ProtocolRequestType0('shutdown');
|
5296 | })(ShutdownRequest = exports.ShutdownRequest || (exports.ShutdownRequest = {}));
|
5297 |
|
5298 |
|
5299 |
|
5300 |
|
5301 |
|
5302 | var ExitNotification;
|
5303 | (function (ExitNotification) {
|
5304 | ExitNotification.type = new messages_1.ProtocolNotificationType0('exit');
|
5305 | })(ExitNotification = exports.ExitNotification || (exports.ExitNotification = {}));
|
5306 |
|
5307 |
|
5308 |
|
5309 |
|
5310 |
|
5311 | var DidChangeConfigurationNotification;
|
5312 | (function (DidChangeConfigurationNotification) {
|
5313 | DidChangeConfigurationNotification.type = new messages_1.ProtocolNotificationType('workspace/didChangeConfiguration');
|
5314 | })(DidChangeConfigurationNotification = exports.DidChangeConfigurationNotification || (exports.DidChangeConfigurationNotification = {}));
|
5315 |
|
5316 |
|
5317 |
|
5318 |
|
5319 | var MessageType;
|
5320 | (function (MessageType) {
|
5321 | |
5322 |
|
5323 |
|
5324 | MessageType.Error = 1;
|
5325 | |
5326 |
|
5327 |
|
5328 | MessageType.Warning = 2;
|
5329 | |
5330 |
|
5331 |
|
5332 | MessageType.Info = 3;
|
5333 | |
5334 |
|
5335 |
|
5336 | MessageType.Log = 4;
|
5337 | })(MessageType = exports.MessageType || (exports.MessageType = {}));
|
5338 |
|
5339 |
|
5340 |
|
5341 |
|
5342 | var ShowMessageNotification;
|
5343 | (function (ShowMessageNotification) {
|
5344 | ShowMessageNotification.type = new messages_1.ProtocolNotificationType('window/showMessage');
|
5345 | })(ShowMessageNotification = exports.ShowMessageNotification || (exports.ShowMessageNotification = {}));
|
5346 |
|
5347 |
|
5348 |
|
5349 |
|
5350 | var ShowMessageRequest;
|
5351 | (function (ShowMessageRequest) {
|
5352 | ShowMessageRequest.type = new messages_1.ProtocolRequestType('window/showMessageRequest');
|
5353 | })(ShowMessageRequest = exports.ShowMessageRequest || (exports.ShowMessageRequest = {}));
|
5354 |
|
5355 |
|
5356 |
|
5357 |
|
5358 | var LogMessageNotification;
|
5359 | (function (LogMessageNotification) {
|
5360 | LogMessageNotification.type = new messages_1.ProtocolNotificationType('window/logMessage');
|
5361 | })(LogMessageNotification = exports.LogMessageNotification || (exports.LogMessageNotification = {}));
|
5362 |
|
5363 |
|
5364 |
|
5365 |
|
5366 |
|
5367 | var TelemetryEventNotification;
|
5368 | (function (TelemetryEventNotification) {
|
5369 | TelemetryEventNotification.type = new messages_1.ProtocolNotificationType('telemetry/event');
|
5370 | })(TelemetryEventNotification = exports.TelemetryEventNotification || (exports.TelemetryEventNotification = {}));
|
5371 |
|
5372 |
|
5373 |
|
5374 |
|
5375 | var TextDocumentSyncKind;
|
5376 | (function (TextDocumentSyncKind) {
|
5377 | |
5378 |
|
5379 |
|
5380 | TextDocumentSyncKind.None = 0;
|
5381 | |
5382 |
|
5383 |
|
5384 |
|
5385 | TextDocumentSyncKind.Full = 1;
|
5386 | |
5387 |
|
5388 |
|
5389 |
|
5390 |
|
5391 | TextDocumentSyncKind.Incremental = 2;
|
5392 | })(TextDocumentSyncKind = exports.TextDocumentSyncKind || (exports.TextDocumentSyncKind = {}));
|
5393 |
|
5394 |
|
5395 |
|
5396 |
|
5397 |
|
5398 |
|
5399 |
|
5400 |
|
5401 |
|
5402 |
|
5403 | var DidOpenTextDocumentNotification;
|
5404 | (function (DidOpenTextDocumentNotification) {
|
5405 | DidOpenTextDocumentNotification.method = 'textDocument/didOpen';
|
5406 | DidOpenTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidOpenTextDocumentNotification.method);
|
5407 | })(DidOpenTextDocumentNotification = exports.DidOpenTextDocumentNotification || (exports.DidOpenTextDocumentNotification = {}));
|
5408 |
|
5409 |
|
5410 |
|
5411 |
|
5412 | var DidChangeTextDocumentNotification;
|
5413 | (function (DidChangeTextDocumentNotification) {
|
5414 | DidChangeTextDocumentNotification.method = 'textDocument/didChange';
|
5415 | DidChangeTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidChangeTextDocumentNotification.method);
|
5416 | })(DidChangeTextDocumentNotification = exports.DidChangeTextDocumentNotification || (exports.DidChangeTextDocumentNotification = {}));
|
5417 |
|
5418 |
|
5419 |
|
5420 |
|
5421 |
|
5422 |
|
5423 |
|
5424 |
|
5425 |
|
5426 | var DidCloseTextDocumentNotification;
|
5427 | (function (DidCloseTextDocumentNotification) {
|
5428 | DidCloseTextDocumentNotification.method = 'textDocument/didClose';
|
5429 | DidCloseTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidCloseTextDocumentNotification.method);
|
5430 | })(DidCloseTextDocumentNotification = exports.DidCloseTextDocumentNotification || (exports.DidCloseTextDocumentNotification = {}));
|
5431 |
|
5432 |
|
5433 |
|
5434 |
|
5435 | var DidSaveTextDocumentNotification;
|
5436 | (function (DidSaveTextDocumentNotification) {
|
5437 | DidSaveTextDocumentNotification.method = 'textDocument/didSave';
|
5438 | DidSaveTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidSaveTextDocumentNotification.method);
|
5439 | })(DidSaveTextDocumentNotification = exports.DidSaveTextDocumentNotification || (exports.DidSaveTextDocumentNotification = {}));
|
5440 |
|
5441 |
|
5442 |
|
5443 | var TextDocumentSaveReason;
|
5444 | (function (TextDocumentSaveReason) {
|
5445 | |
5446 |
|
5447 |
|
5448 |
|
5449 | TextDocumentSaveReason.Manual = 1;
|
5450 | |
5451 |
|
5452 |
|
5453 | TextDocumentSaveReason.AfterDelay = 2;
|
5454 | |
5455 |
|
5456 |
|
5457 | TextDocumentSaveReason.FocusOut = 3;
|
5458 | })(TextDocumentSaveReason = exports.TextDocumentSaveReason || (exports.TextDocumentSaveReason = {}));
|
5459 |
|
5460 |
|
5461 |
|
5462 |
|
5463 | var WillSaveTextDocumentNotification;
|
5464 | (function (WillSaveTextDocumentNotification) {
|
5465 | WillSaveTextDocumentNotification.method = 'textDocument/willSave';
|
5466 | WillSaveTextDocumentNotification.type = new messages_1.ProtocolNotificationType(WillSaveTextDocumentNotification.method);
|
5467 | })(WillSaveTextDocumentNotification = exports.WillSaveTextDocumentNotification || (exports.WillSaveTextDocumentNotification = {}));
|
5468 |
|
5469 |
|
5470 |
|
5471 |
|
5472 |
|
5473 |
|
5474 |
|
5475 |
|
5476 | var WillSaveTextDocumentWaitUntilRequest;
|
5477 | (function (WillSaveTextDocumentWaitUntilRequest) {
|
5478 | WillSaveTextDocumentWaitUntilRequest.method = 'textDocument/willSaveWaitUntil';
|
5479 | WillSaveTextDocumentWaitUntilRequest.type = new messages_1.ProtocolRequestType(WillSaveTextDocumentWaitUntilRequest.method);
|
5480 | })(WillSaveTextDocumentWaitUntilRequest = exports.WillSaveTextDocumentWaitUntilRequest || (exports.WillSaveTextDocumentWaitUntilRequest = {}));
|
5481 |
|
5482 |
|
5483 |
|
5484 |
|
5485 | var DidChangeWatchedFilesNotification;
|
5486 | (function (DidChangeWatchedFilesNotification) {
|
5487 | DidChangeWatchedFilesNotification.type = new messages_1.ProtocolNotificationType('workspace/didChangeWatchedFiles');
|
5488 | })(DidChangeWatchedFilesNotification = exports.DidChangeWatchedFilesNotification || (exports.DidChangeWatchedFilesNotification = {}));
|
5489 |
|
5490 |
|
5491 |
|
5492 | var FileChangeType;
|
5493 | (function (FileChangeType) {
|
5494 | |
5495 |
|
5496 |
|
5497 | FileChangeType.Created = 1;
|
5498 | |
5499 |
|
5500 |
|
5501 | FileChangeType.Changed = 2;
|
5502 | |
5503 |
|
5504 |
|
5505 | FileChangeType.Deleted = 3;
|
5506 | })(FileChangeType = exports.FileChangeType || (exports.FileChangeType = {}));
|
5507 | var WatchKind;
|
5508 | (function (WatchKind) {
|
5509 | |
5510 |
|
5511 |
|
5512 | WatchKind.Create = 1;
|
5513 | |
5514 |
|
5515 |
|
5516 | WatchKind.Change = 2;
|
5517 | |
5518 |
|
5519 |
|
5520 | WatchKind.Delete = 4;
|
5521 | })(WatchKind = exports.WatchKind || (exports.WatchKind = {}));
|
5522 |
|
5523 |
|
5524 |
|
5525 |
|
5526 | var PublishDiagnosticsNotification;
|
5527 | (function (PublishDiagnosticsNotification) {
|
5528 | PublishDiagnosticsNotification.type = new messages_1.ProtocolNotificationType('textDocument/publishDiagnostics');
|
5529 | })(PublishDiagnosticsNotification = exports.PublishDiagnosticsNotification || (exports.PublishDiagnosticsNotification = {}));
|
5530 |
|
5531 |
|
5532 |
|
5533 | var CompletionTriggerKind;
|
5534 | (function (CompletionTriggerKind) {
|
5535 | |
5536 |
|
5537 |
|
5538 |
|
5539 | CompletionTriggerKind.Invoked = 1;
|
5540 | |
5541 |
|
5542 |
|
5543 |
|
5544 | CompletionTriggerKind.TriggerCharacter = 2;
|
5545 | |
5546 |
|
5547 |
|
5548 | CompletionTriggerKind.TriggerForIncompleteCompletions = 3;
|
5549 | })(CompletionTriggerKind = exports.CompletionTriggerKind || (exports.CompletionTriggerKind = {}));
|
5550 |
|
5551 |
|
5552 |
|
5553 |
|
5554 |
|
5555 |
|
5556 |
|
5557 |
|
5558 |
|
5559 |
|
5560 |
|
5561 | var CompletionRequest;
|
5562 | (function (CompletionRequest) {
|
5563 | CompletionRequest.method = 'textDocument/completion';
|
5564 | CompletionRequest.type = new messages_1.ProtocolRequestType(CompletionRequest.method);
|
5565 |
|
5566 | CompletionRequest.resultType = new vscode_jsonrpc_1.ProgressType();
|
5567 | })(CompletionRequest = exports.CompletionRequest || (exports.CompletionRequest = {}));
|
5568 |
|
5569 |
|
5570 |
|
5571 |
|
5572 |
|
5573 | var CompletionResolveRequest;
|
5574 | (function (CompletionResolveRequest) {
|
5575 | CompletionResolveRequest.method = 'completionItem/resolve';
|
5576 | CompletionResolveRequest.type = new messages_1.ProtocolRequestType(CompletionResolveRequest.method);
|
5577 | })(CompletionResolveRequest = exports.CompletionResolveRequest || (exports.CompletionResolveRequest = {}));
|
5578 |
|
5579 |
|
5580 |
|
5581 |
|
5582 |
|
5583 | var HoverRequest;
|
5584 | (function (HoverRequest) {
|
5585 | HoverRequest.method = 'textDocument/hover';
|
5586 | HoverRequest.type = new messages_1.ProtocolRequestType(HoverRequest.method);
|
5587 | })(HoverRequest = exports.HoverRequest || (exports.HoverRequest = {}));
|
5588 |
|
5589 |
|
5590 |
|
5591 |
|
5592 |
|
5593 | var SignatureHelpTriggerKind;
|
5594 | (function (SignatureHelpTriggerKind) {
|
5595 | |
5596 |
|
5597 |
|
5598 | SignatureHelpTriggerKind.Invoked = 1;
|
5599 | |
5600 |
|
5601 |
|
5602 | SignatureHelpTriggerKind.TriggerCharacter = 2;
|
5603 | |
5604 |
|
5605 |
|
5606 | SignatureHelpTriggerKind.ContentChange = 3;
|
5607 | })(SignatureHelpTriggerKind = exports.SignatureHelpTriggerKind || (exports.SignatureHelpTriggerKind = {}));
|
5608 | var SignatureHelpRequest;
|
5609 | (function (SignatureHelpRequest) {
|
5610 | SignatureHelpRequest.method = 'textDocument/signatureHelp';
|
5611 | SignatureHelpRequest.type = new messages_1.ProtocolRequestType(SignatureHelpRequest.method);
|
5612 | })(SignatureHelpRequest = exports.SignatureHelpRequest || (exports.SignatureHelpRequest = {}));
|
5613 |
|
5614 |
|
5615 |
|
5616 |
|
5617 |
|
5618 |
|
5619 |
|
5620 | var DefinitionRequest;
|
5621 | (function (DefinitionRequest) {
|
5622 | DefinitionRequest.method = 'textDocument/definition';
|
5623 | DefinitionRequest.type = new messages_1.ProtocolRequestType(DefinitionRequest.method);
|
5624 |
|
5625 | DefinitionRequest.resultType = new vscode_jsonrpc_1.ProgressType();
|
5626 | })(DefinitionRequest = exports.DefinitionRequest || (exports.DefinitionRequest = {}));
|
5627 |
|
5628 |
|
5629 |
|
5630 |
|
5631 |
|
5632 |
|
5633 | var ReferencesRequest;
|
5634 | (function (ReferencesRequest) {
|
5635 | ReferencesRequest.method = 'textDocument/references';
|
5636 | ReferencesRequest.type = new messages_1.ProtocolRequestType(ReferencesRequest.method);
|
5637 |
|
5638 | ReferencesRequest.resultType = new vscode_jsonrpc_1.ProgressType();
|
5639 | })(ReferencesRequest = exports.ReferencesRequest || (exports.ReferencesRequest = {}));
|
5640 |
|
5641 |
|
5642 |
|
5643 |
|
5644 |
|
5645 |
|
5646 | var DocumentHighlightRequest;
|
5647 | (function (DocumentHighlightRequest) {
|
5648 | DocumentHighlightRequest.method = 'textDocument/documentHighlight';
|
5649 | DocumentHighlightRequest.type = new messages_1.ProtocolRequestType(DocumentHighlightRequest.method);
|
5650 |
|
5651 | DocumentHighlightRequest.resultType = new vscode_jsonrpc_1.ProgressType();
|
5652 | })(DocumentHighlightRequest = exports.DocumentHighlightRequest || (exports.DocumentHighlightRequest = {}));
|
5653 |
|
5654 |
|
5655 |
|
5656 |
|
5657 |
|
5658 |
|
5659 | var DocumentSymbolRequest;
|
5660 | (function (DocumentSymbolRequest) {
|
5661 | DocumentSymbolRequest.method = 'textDocument/documentSymbol';
|
5662 | DocumentSymbolRequest.type = new messages_1.ProtocolRequestType(DocumentSymbolRequest.method);
|
5663 |
|
5664 | DocumentSymbolRequest.resultType = new vscode_jsonrpc_1.ProgressType();
|
5665 | })(DocumentSymbolRequest = exports.DocumentSymbolRequest || (exports.DocumentSymbolRequest = {}));
|
5666 |
|
5667 |
|
5668 |
|
5669 | var CodeActionRequest;
|
5670 | (function (CodeActionRequest) {
|
5671 | CodeActionRequest.method = 'textDocument/codeAction';
|
5672 | CodeActionRequest.type = new messages_1.ProtocolRequestType(CodeActionRequest.method);
|
5673 |
|
5674 | CodeActionRequest.resultType = new vscode_jsonrpc_1.ProgressType();
|
5675 | })(CodeActionRequest = exports.CodeActionRequest || (exports.CodeActionRequest = {}));
|
5676 |
|
5677 |
|
5678 |
|
5679 |
|
5680 |
|
5681 |
|
5682 | var WorkspaceSymbolRequest;
|
5683 | (function (WorkspaceSymbolRequest) {
|
5684 | WorkspaceSymbolRequest.method = 'workspace/symbol';
|
5685 | WorkspaceSymbolRequest.type = new messages_1.ProtocolRequestType(WorkspaceSymbolRequest.method);
|
5686 |
|
5687 | WorkspaceSymbolRequest.resultType = new vscode_jsonrpc_1.ProgressType();
|
5688 | })(WorkspaceSymbolRequest = exports.WorkspaceSymbolRequest || (exports.WorkspaceSymbolRequest = {}));
|
5689 |
|
5690 |
|
5691 |
|
5692 | var CodeLensRequest;
|
5693 | (function (CodeLensRequest) {
|
5694 | CodeLensRequest.type = new messages_1.ProtocolRequestType('textDocument/codeLens');
|
5695 |
|
5696 | CodeLensRequest.resultType = new vscode_jsonrpc_1.ProgressType();
|
5697 | })(CodeLensRequest = exports.CodeLensRequest || (exports.CodeLensRequest = {}));
|
5698 |
|
5699 |
|
5700 |
|
5701 | var CodeLensResolveRequest;
|
5702 | (function (CodeLensResolveRequest) {
|
5703 | CodeLensResolveRequest.type = new messages_1.ProtocolRequestType('codeLens/resolve');
|
5704 | })(CodeLensResolveRequest = exports.CodeLensResolveRequest || (exports.CodeLensResolveRequest = {}));
|
5705 |
|
5706 |
|
5707 |
|
5708 | var DocumentLinkRequest;
|
5709 | (function (DocumentLinkRequest) {
|
5710 | DocumentLinkRequest.method = 'textDocument/documentLink';
|
5711 | DocumentLinkRequest.type = new messages_1.ProtocolRequestType(DocumentLinkRequest.method);
|
5712 |
|
5713 | DocumentLinkRequest.resultType = new vscode_jsonrpc_1.ProgressType();
|
5714 | })(DocumentLinkRequest = exports.DocumentLinkRequest || (exports.DocumentLinkRequest = {}));
|
5715 |
|
5716 |
|
5717 |
|
5718 |
|
5719 |
|
5720 | var DocumentLinkResolveRequest;
|
5721 | (function (DocumentLinkResolveRequest) {
|
5722 | DocumentLinkResolveRequest.type = new messages_1.ProtocolRequestType('documentLink/resolve');
|
5723 | })(DocumentLinkResolveRequest = exports.DocumentLinkResolveRequest || (exports.DocumentLinkResolveRequest = {}));
|
5724 |
|
5725 |
|
5726 |
|
5727 | var DocumentFormattingRequest;
|
5728 | (function (DocumentFormattingRequest) {
|
5729 | DocumentFormattingRequest.method = 'textDocument/formatting';
|
5730 | DocumentFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentFormattingRequest.method);
|
5731 | })(DocumentFormattingRequest = exports.DocumentFormattingRequest || (exports.DocumentFormattingRequest = {}));
|
5732 |
|
5733 |
|
5734 |
|
5735 | var DocumentRangeFormattingRequest;
|
5736 | (function (DocumentRangeFormattingRequest) {
|
5737 | DocumentRangeFormattingRequest.method = 'textDocument/rangeFormatting';
|
5738 | DocumentRangeFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentRangeFormattingRequest.method);
|
5739 | })(DocumentRangeFormattingRequest = exports.DocumentRangeFormattingRequest || (exports.DocumentRangeFormattingRequest = {}));
|
5740 |
|
5741 |
|
5742 |
|
5743 | var DocumentOnTypeFormattingRequest;
|
5744 | (function (DocumentOnTypeFormattingRequest) {
|
5745 | DocumentOnTypeFormattingRequest.method = 'textDocument/onTypeFormatting';
|
5746 | DocumentOnTypeFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentOnTypeFormattingRequest.method);
|
5747 | })(DocumentOnTypeFormattingRequest = exports.DocumentOnTypeFormattingRequest || (exports.DocumentOnTypeFormattingRequest = {}));
|
5748 |
|
5749 |
|
5750 |
|
5751 | var RenameRequest;
|
5752 | (function (RenameRequest) {
|
5753 | RenameRequest.method = 'textDocument/rename';
|
5754 | RenameRequest.type = new messages_1.ProtocolRequestType(RenameRequest.method);
|
5755 | })(RenameRequest = exports.RenameRequest || (exports.RenameRequest = {}));
|
5756 |
|
5757 |
|
5758 |
|
5759 | var PrepareRenameRequest;
|
5760 | (function (PrepareRenameRequest) {
|
5761 | PrepareRenameRequest.method = 'textDocument/prepareRename';
|
5762 | PrepareRenameRequest.type = new messages_1.ProtocolRequestType(PrepareRenameRequest.method);
|
5763 | })(PrepareRenameRequest = exports.PrepareRenameRequest || (exports.PrepareRenameRequest = {}));
|
5764 |
|
5765 |
|
5766 |
|
5767 |
|
5768 | var ExecuteCommandRequest;
|
5769 | (function (ExecuteCommandRequest) {
|
5770 | ExecuteCommandRequest.type = new messages_1.ProtocolRequestType('workspace/executeCommand');
|
5771 | })(ExecuteCommandRequest = exports.ExecuteCommandRequest || (exports.ExecuteCommandRequest = {}));
|
5772 |
|
5773 |
|
5774 |
|
5775 | var ApplyWorkspaceEditRequest;
|
5776 | (function (ApplyWorkspaceEditRequest) {
|
5777 | ApplyWorkspaceEditRequest.type = new messages_1.ProtocolRequestType('workspace/applyEdit');
|
5778 | })(ApplyWorkspaceEditRequest = exports.ApplyWorkspaceEditRequest || (exports.ApplyWorkspaceEditRequest = {}));
|
5779 |
|
5780 |
|
5781 | }),
|
5782 |
|
5783 | (function(module, exports, __webpack_require__) {
|
5784 |
|
5785 | "use strict";
|
5786 |
|
5787 |
|
5788 |
|
5789 |
|
5790 |
|
5791 | Object.defineProperty(exports, "__esModule", { value: true });
|
5792 | function boolean(value) {
|
5793 | return value === true || value === false;
|
5794 | }
|
5795 | exports.boolean = boolean;
|
5796 | function string(value) {
|
5797 | return typeof value === 'string' || value instanceof String;
|
5798 | }
|
5799 | exports.string = string;
|
5800 | function number(value) {
|
5801 | return typeof value === 'number' || value instanceof Number;
|
5802 | }
|
5803 | exports.number = number;
|
5804 | function error(value) {
|
5805 | return value instanceof Error;
|
5806 | }
|
5807 | exports.error = error;
|
5808 | function func(value) {
|
5809 | return typeof value === 'function';
|
5810 | }
|
5811 | exports.func = func;
|
5812 | function array(value) {
|
5813 | return Array.isArray(value);
|
5814 | }
|
5815 | exports.array = array;
|
5816 | function stringArray(value) {
|
5817 | return array(value) && value.every(elem => string(elem));
|
5818 | }
|
5819 | exports.stringArray = stringArray;
|
5820 | function typedArray(value, check) {
|
5821 | return Array.isArray(value) && value.every(check);
|
5822 | }
|
5823 | exports.typedArray = typedArray;
|
5824 | function objectLiteral(value) {
|
5825 |
|
5826 |
|
5827 |
|
5828 | return value !== null && typeof value === 'object';
|
5829 | }
|
5830 | exports.objectLiteral = objectLiteral;
|
5831 |
|
5832 |
|
5833 | }),
|
5834 |
|
5835 | (function(module, exports, __webpack_require__) {
|
5836 |
|
5837 | "use strict";
|
5838 |
|
5839 |
|
5840 |
|
5841 |
|
5842 |
|
5843 | Object.defineProperty(exports, "__esModule", { value: true });
|
5844 | const vscode_jsonrpc_1 = __webpack_require__(4);
|
5845 | class ProtocolRequestType0 extends vscode_jsonrpc_1.RequestType0 {
|
5846 | constructor(method) {
|
5847 | super(method);
|
5848 | }
|
5849 | }
|
5850 | exports.ProtocolRequestType0 = ProtocolRequestType0;
|
5851 | class ProtocolRequestType extends vscode_jsonrpc_1.RequestType {
|
5852 | constructor(method) {
|
5853 | super(method);
|
5854 | }
|
5855 | }
|
5856 | exports.ProtocolRequestType = ProtocolRequestType;
|
5857 | class ProtocolNotificationType extends vscode_jsonrpc_1.NotificationType {
|
5858 | constructor(method) {
|
5859 | super(method);
|
5860 | }
|
5861 | }
|
5862 | exports.ProtocolNotificationType = ProtocolNotificationType;
|
5863 | class ProtocolNotificationType0 extends vscode_jsonrpc_1.NotificationType0 {
|
5864 | constructor(method) {
|
5865 | super(method);
|
5866 | }
|
5867 | }
|
5868 | exports.ProtocolNotificationType0 = ProtocolNotificationType0;
|
5869 |
|
5870 |
|
5871 | }),
|
5872 |
|
5873 | (function(module, exports, __webpack_require__) {
|
5874 |
|
5875 | "use strict";
|
5876 |
|
5877 |
|
5878 |
|
5879 |
|
5880 |
|
5881 | Object.defineProperty(exports, "__esModule", { value: true });
|
5882 | const vscode_jsonrpc_1 = __webpack_require__(4);
|
5883 | const messages_1 = __webpack_require__(21);
|
5884 |
|
5885 | let __noDynamicImport;
|
5886 |
|
5887 |
|
5888 |
|
5889 |
|
5890 |
|
5891 |
|
5892 | var ImplementationRequest;
|
5893 | (function (ImplementationRequest) {
|
5894 | ImplementationRequest.method = 'textDocument/implementation';
|
5895 | ImplementationRequest.type = new messages_1.ProtocolRequestType(ImplementationRequest.method);
|
5896 |
|
5897 | ImplementationRequest.resultType = new vscode_jsonrpc_1.ProgressType();
|
5898 | })(ImplementationRequest = exports.ImplementationRequest || (exports.ImplementationRequest = {}));
|
5899 |
|
5900 |
|
5901 | }),
|
5902 |
|
5903 | (function(module, exports, __webpack_require__) {
|
5904 |
|
5905 | "use strict";
|
5906 |
|
5907 |
|
5908 |
|
5909 |
|
5910 |
|
5911 | Object.defineProperty(exports, "__esModule", { value: true });
|
5912 | const vscode_jsonrpc_1 = __webpack_require__(4);
|
5913 | const messages_1 = __webpack_require__(21);
|
5914 |
|
5915 | let __noDynamicImport;
|
5916 |
|
5917 |
|
5918 |
|
5919 |
|
5920 |
|
5921 |
|
5922 | var TypeDefinitionRequest;
|
5923 | (function (TypeDefinitionRequest) {
|
5924 | TypeDefinitionRequest.method = 'textDocument/typeDefinition';
|
5925 | TypeDefinitionRequest.type = new messages_1.ProtocolRequestType(TypeDefinitionRequest.method);
|
5926 |
|
5927 | TypeDefinitionRequest.resultType = new vscode_jsonrpc_1.ProgressType();
|
5928 | })(TypeDefinitionRequest = exports.TypeDefinitionRequest || (exports.TypeDefinitionRequest = {}));
|
5929 |
|
5930 |
|
5931 | }),
|
5932 |
|
5933 | (function(module, exports, __webpack_require__) {
|
5934 |
|
5935 | "use strict";
|
5936 |
|
5937 |
|
5938 |
|
5939 |
|
5940 |
|
5941 | Object.defineProperty(exports, "__esModule", { value: true });
|
5942 | const messages_1 = __webpack_require__(21);
|
5943 |
|
5944 |
|
5945 |
|
5946 | var WorkspaceFoldersRequest;
|
5947 | (function (WorkspaceFoldersRequest) {
|
5948 | WorkspaceFoldersRequest.type = new messages_1.ProtocolRequestType0('workspace/workspaceFolders');
|
5949 | })(WorkspaceFoldersRequest = exports.WorkspaceFoldersRequest || (exports.WorkspaceFoldersRequest = {}));
|
5950 |
|
5951 |
|
5952 |
|
5953 |
|
5954 | var DidChangeWorkspaceFoldersNotification;
|
5955 | (function (DidChangeWorkspaceFoldersNotification) {
|
5956 | DidChangeWorkspaceFoldersNotification.type = new messages_1.ProtocolNotificationType('workspace/didChangeWorkspaceFolders');
|
5957 | })(DidChangeWorkspaceFoldersNotification = exports.DidChangeWorkspaceFoldersNotification || (exports.DidChangeWorkspaceFoldersNotification = {}));
|
5958 |
|
5959 |
|
5960 | }),
|
5961 |
|
5962 | (function(module, exports, __webpack_require__) {
|
5963 |
|
5964 | "use strict";
|
5965 |
|
5966 |
|
5967 |
|
5968 |
|
5969 |
|
5970 | Object.defineProperty(exports, "__esModule", { value: true });
|
5971 | const messages_1 = __webpack_require__(21);
|
5972 |
|
5973 |
|
5974 |
|
5975 |
|
5976 |
|
5977 |
|
5978 |
|
5979 |
|
5980 |
|
5981 | var ConfigurationRequest;
|
5982 | (function (ConfigurationRequest) {
|
5983 | ConfigurationRequest.type = new messages_1.ProtocolRequestType('workspace/configuration');
|
5984 | })(ConfigurationRequest = exports.ConfigurationRequest || (exports.ConfigurationRequest = {}));
|
5985 |
|
5986 |
|
5987 | }),
|
5988 |
|
5989 | (function(module, exports, __webpack_require__) {
|
5990 |
|
5991 | "use strict";
|
5992 |
|
5993 |
|
5994 |
|
5995 |
|
5996 |
|
5997 | Object.defineProperty(exports, "__esModule", { value: true });
|
5998 | const vscode_jsonrpc_1 = __webpack_require__(4);
|
5999 | const messages_1 = __webpack_require__(21);
|
6000 |
|
6001 |
|
6002 |
|
6003 |
|
6004 |
|
6005 |
|
6006 | var DocumentColorRequest;
|
6007 | (function (DocumentColorRequest) {
|
6008 | DocumentColorRequest.method = 'textDocument/documentColor';
|
6009 | DocumentColorRequest.type = new messages_1.ProtocolRequestType(DocumentColorRequest.method);
|
6010 |
|
6011 | DocumentColorRequest.resultType = new vscode_jsonrpc_1.ProgressType();
|
6012 | })(DocumentColorRequest = exports.DocumentColorRequest || (exports.DocumentColorRequest = {}));
|
6013 |
|
6014 |
|
6015 |
|
6016 |
|
6017 |
|
6018 |
|
6019 | var ColorPresentationRequest;
|
6020 | (function (ColorPresentationRequest) {
|
6021 | ColorPresentationRequest.type = new messages_1.ProtocolRequestType('textDocument/colorPresentation');
|
6022 | })(ColorPresentationRequest = exports.ColorPresentationRequest || (exports.ColorPresentationRequest = {}));
|
6023 |
|
6024 |
|
6025 | }),
|
6026 |
|
6027 | (function(module, exports, __webpack_require__) {
|
6028 |
|
6029 | "use strict";
|
6030 |
|
6031 |
|
6032 |
|
6033 |
|
6034 |
|
6035 | Object.defineProperty(exports, "__esModule", { value: true });
|
6036 | const vscode_jsonrpc_1 = __webpack_require__(4);
|
6037 | const messages_1 = __webpack_require__(21);
|
6038 |
|
6039 |
|
6040 |
|
6041 | var FoldingRangeKind;
|
6042 | (function (FoldingRangeKind) {
|
6043 | |
6044 |
|
6045 |
|
6046 | FoldingRangeKind["Comment"] = "comment";
|
6047 | |
6048 |
|
6049 |
|
6050 | FoldingRangeKind["Imports"] = "imports";
|
6051 | |
6052 |
|
6053 |
|
6054 | FoldingRangeKind["Region"] = "region";
|
6055 | })(FoldingRangeKind = exports.FoldingRangeKind || (exports.FoldingRangeKind = {}));
|
6056 |
|
6057 |
|
6058 |
|
6059 |
|
6060 |
|
6061 |
|
6062 | var FoldingRangeRequest;
|
6063 | (function (FoldingRangeRequest) {
|
6064 | FoldingRangeRequest.method = 'textDocument/foldingRange';
|
6065 | FoldingRangeRequest.type = new messages_1.ProtocolRequestType(FoldingRangeRequest.method);
|
6066 |
|
6067 | FoldingRangeRequest.resultType = new vscode_jsonrpc_1.ProgressType();
|
6068 | })(FoldingRangeRequest = exports.FoldingRangeRequest || (exports.FoldingRangeRequest = {}));
|
6069 |
|
6070 |
|
6071 | }),
|
6072 |
|
6073 | (function(module, exports, __webpack_require__) {
|
6074 |
|
6075 | "use strict";
|
6076 |
|
6077 |
|
6078 |
|
6079 |
|
6080 |
|
6081 | Object.defineProperty(exports, "__esModule", { value: true });
|
6082 | const vscode_jsonrpc_1 = __webpack_require__(4);
|
6083 | const messages_1 = __webpack_require__(21);
|
6084 |
|
6085 | let __noDynamicImport;
|
6086 |
|
6087 |
|
6088 |
|
6089 |
|
6090 |
|
6091 |
|
6092 |
|
6093 | var DeclarationRequest;
|
6094 | (function (DeclarationRequest) {
|
6095 | DeclarationRequest.method = 'textDocument/declaration';
|
6096 | DeclarationRequest.type = new messages_1.ProtocolRequestType(DeclarationRequest.method);
|
6097 |
|
6098 | DeclarationRequest.resultType = new vscode_jsonrpc_1.ProgressType();
|
6099 | })(DeclarationRequest = exports.DeclarationRequest || (exports.DeclarationRequest = {}));
|
6100 |
|
6101 |
|
6102 | }),
|
6103 |
|
6104 | (function(module, exports, __webpack_require__) {
|
6105 |
|
6106 | "use strict";
|
6107 |
|
6108 |
|
6109 |
|
6110 |
|
6111 |
|
6112 | Object.defineProperty(exports, "__esModule", { value: true });
|
6113 | const vscode_jsonrpc_1 = __webpack_require__(4);
|
6114 | const messages_1 = __webpack_require__(21);
|
6115 |
|
6116 |
|
6117 |
|
6118 |
|
6119 |
|
6120 |
|
6121 | var SelectionRangeRequest;
|
6122 | (function (SelectionRangeRequest) {
|
6123 | SelectionRangeRequest.method = 'textDocument/selectionRange';
|
6124 | SelectionRangeRequest.type = new messages_1.ProtocolRequestType(SelectionRangeRequest.method);
|
6125 |
|
6126 | SelectionRangeRequest.resultType = new vscode_jsonrpc_1.ProgressType();
|
6127 | })(SelectionRangeRequest = exports.SelectionRangeRequest || (exports.SelectionRangeRequest = {}));
|
6128 |
|
6129 |
|
6130 | }),
|
6131 |
|
6132 | (function(module, exports, __webpack_require__) {
|
6133 |
|
6134 | "use strict";
|
6135 |
|
6136 |
|
6137 |
|
6138 |
|
6139 |
|
6140 | Object.defineProperty(exports, "__esModule", { value: true });
|
6141 | const vscode_jsonrpc_1 = __webpack_require__(4);
|
6142 | const messages_1 = __webpack_require__(21);
|
6143 | var WorkDoneProgress;
|
6144 | (function (WorkDoneProgress) {
|
6145 | WorkDoneProgress.type = new vscode_jsonrpc_1.ProgressType();
|
6146 | })(WorkDoneProgress = exports.WorkDoneProgress || (exports.WorkDoneProgress = {}));
|
6147 |
|
6148 |
|
6149 |
|
6150 |
|
6151 | var WorkDoneProgressCreateRequest;
|
6152 | (function (WorkDoneProgressCreateRequest) {
|
6153 | WorkDoneProgressCreateRequest.type = new messages_1.ProtocolRequestType('window/workDoneProgress/create');
|
6154 | })(WorkDoneProgressCreateRequest = exports.WorkDoneProgressCreateRequest || (exports.WorkDoneProgressCreateRequest = {}));
|
6155 |
|
6156 |
|
6157 |
|
6158 |
|
6159 | var WorkDoneProgressCancelNotification;
|
6160 | (function (WorkDoneProgressCancelNotification) {
|
6161 | WorkDoneProgressCancelNotification.type = new messages_1.ProtocolNotificationType('window/workDoneProgress/cancel');
|
6162 | })(WorkDoneProgressCancelNotification = exports.WorkDoneProgressCancelNotification || (exports.WorkDoneProgressCancelNotification = {}));
|
6163 |
|
6164 |
|
6165 | }),
|
6166 |
|
6167 | (function(module, exports, __webpack_require__) {
|
6168 |
|
6169 | "use strict";
|
6170 |
|
6171 |
|
6172 |
|
6173 |
|
6174 |
|
6175 | Object.defineProperty(exports, "__esModule", { value: true });
|
6176 | const messages_1 = __webpack_require__(21);
|
6177 |
|
6178 |
|
6179 |
|
6180 |
|
6181 |
|
6182 |
|
6183 | var CallHierarchyPrepareRequest;
|
6184 | (function (CallHierarchyPrepareRequest) {
|
6185 | CallHierarchyPrepareRequest.method = 'textDocument/prepareCallHierarchy';
|
6186 | CallHierarchyPrepareRequest.type = new messages_1.ProtocolRequestType(CallHierarchyPrepareRequest.method);
|
6187 | })(CallHierarchyPrepareRequest = exports.CallHierarchyPrepareRequest || (exports.CallHierarchyPrepareRequest = {}));
|
6188 |
|
6189 |
|
6190 |
|
6191 |
|
6192 |
|
6193 | var CallHierarchyIncomingCallsRequest;
|
6194 | (function (CallHierarchyIncomingCallsRequest) {
|
6195 | CallHierarchyIncomingCallsRequest.method = 'callHierarchy/incomingCalls';
|
6196 | CallHierarchyIncomingCallsRequest.type = new messages_1.ProtocolRequestType(CallHierarchyIncomingCallsRequest.method);
|
6197 | })(CallHierarchyIncomingCallsRequest = exports.CallHierarchyIncomingCallsRequest || (exports.CallHierarchyIncomingCallsRequest = {}));
|
6198 |
|
6199 |
|
6200 |
|
6201 |
|
6202 |
|
6203 | var CallHierarchyOutgoingCallsRequest;
|
6204 | (function (CallHierarchyOutgoingCallsRequest) {
|
6205 | CallHierarchyOutgoingCallsRequest.method = 'callHierarchy/outgoingCalls';
|
6206 | CallHierarchyOutgoingCallsRequest.type = new messages_1.ProtocolRequestType(CallHierarchyOutgoingCallsRequest.method);
|
6207 | })(CallHierarchyOutgoingCallsRequest = exports.CallHierarchyOutgoingCallsRequest || (exports.CallHierarchyOutgoingCallsRequest = {}));
|
6208 |
|
6209 |
|
6210 | }),
|
6211 |
|
6212 | (function(module, exports, __webpack_require__) {
|
6213 |
|
6214 | "use strict";
|
6215 |
|
6216 |
|
6217 |
|
6218 |
|
6219 |
|
6220 | Object.defineProperty(exports, "__esModule", { value: true });
|
6221 | const messages_1 = __webpack_require__(21);
|
6222 |
|
6223 |
|
6224 |
|
6225 |
|
6226 |
|
6227 |
|
6228 |
|
6229 | var SemanticTokenTypes;
|
6230 | (function (SemanticTokenTypes) {
|
6231 | SemanticTokenTypes["comment"] = "comment";
|
6232 | SemanticTokenTypes["keyword"] = "keyword";
|
6233 | SemanticTokenTypes["string"] = "string";
|
6234 | SemanticTokenTypes["number"] = "number";
|
6235 | SemanticTokenTypes["regexp"] = "regexp";
|
6236 | SemanticTokenTypes["operator"] = "operator";
|
6237 | SemanticTokenTypes["namespace"] = "namespace";
|
6238 | SemanticTokenTypes["type"] = "type";
|
6239 | SemanticTokenTypes["struct"] = "struct";
|
6240 | SemanticTokenTypes["class"] = "class";
|
6241 | SemanticTokenTypes["interface"] = "interface";
|
6242 | SemanticTokenTypes["enum"] = "enum";
|
6243 | SemanticTokenTypes["typeParameter"] = "typeParameter";
|
6244 | SemanticTokenTypes["function"] = "function";
|
6245 | SemanticTokenTypes["member"] = "member";
|
6246 | SemanticTokenTypes["property"] = "property";
|
6247 | SemanticTokenTypes["macro"] = "macro";
|
6248 | SemanticTokenTypes["variable"] = "variable";
|
6249 | SemanticTokenTypes["parameter"] = "parameter";
|
6250 | SemanticTokenTypes["label"] = "label";
|
6251 | })(SemanticTokenTypes = exports.SemanticTokenTypes || (exports.SemanticTokenTypes = {}));
|
6252 |
|
6253 |
|
6254 |
|
6255 |
|
6256 |
|
6257 |
|
6258 |
|
6259 | var SemanticTokenModifiers;
|
6260 | (function (SemanticTokenModifiers) {
|
6261 | SemanticTokenModifiers["documentation"] = "documentation";
|
6262 | SemanticTokenModifiers["declaration"] = "declaration";
|
6263 | SemanticTokenModifiers["definition"] = "definition";
|
6264 | SemanticTokenModifiers["reference"] = "reference";
|
6265 | SemanticTokenModifiers["static"] = "static";
|
6266 | SemanticTokenModifiers["abstract"] = "abstract";
|
6267 | SemanticTokenModifiers["deprecated"] = "deprecated";
|
6268 | SemanticTokenModifiers["async"] = "async";
|
6269 | SemanticTokenModifiers["volatile"] = "volatile";
|
6270 | SemanticTokenModifiers["readonly"] = "readonly";
|
6271 | })(SemanticTokenModifiers = exports.SemanticTokenModifiers || (exports.SemanticTokenModifiers = {}));
|
6272 |
|
6273 |
|
6274 |
|
6275 | var SemanticTokens;
|
6276 | (function (SemanticTokens) {
|
6277 | function is(value) {
|
6278 | const candidate = value;
|
6279 | return candidate !== undefined && (candidate.resultId === undefined || typeof candidate.resultId === 'string') &&
|
6280 | Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === 'number');
|
6281 | }
|
6282 | SemanticTokens.is = is;
|
6283 | })(SemanticTokens = exports.SemanticTokens || (exports.SemanticTokens = {}));
|
6284 |
|
6285 |
|
6286 |
|
6287 | var SemanticTokensRequest;
|
6288 | (function (SemanticTokensRequest) {
|
6289 | SemanticTokensRequest.method = 'textDocument/semanticTokens';
|
6290 | SemanticTokensRequest.type = new messages_1.ProtocolRequestType(SemanticTokensRequest.method);
|
6291 | })(SemanticTokensRequest = exports.SemanticTokensRequest || (exports.SemanticTokensRequest = {}));
|
6292 |
|
6293 |
|
6294 |
|
6295 | var SemanticTokensEditsRequest;
|
6296 | (function (SemanticTokensEditsRequest) {
|
6297 | SemanticTokensEditsRequest.method = 'textDocument/semanticTokens/edits';
|
6298 | SemanticTokensEditsRequest.type = new messages_1.ProtocolRequestType(SemanticTokensEditsRequest.method);
|
6299 | })(SemanticTokensEditsRequest = exports.SemanticTokensEditsRequest || (exports.SemanticTokensEditsRequest = {}));
|
6300 |
|
6301 |
|
6302 |
|
6303 | var SemanticTokensRangeRequest;
|
6304 | (function (SemanticTokensRangeRequest) {
|
6305 | SemanticTokensRangeRequest.method = 'textDocument/semanticTokens/range';
|
6306 | SemanticTokensRangeRequest.type = new messages_1.ProtocolRequestType(SemanticTokensRangeRequest.method);
|
6307 | })(SemanticTokensRangeRequest = exports.SemanticTokensRangeRequest || (exports.SemanticTokensRangeRequest = {}));
|
6308 |
|
6309 |
|
6310 | }),
|
6311 |
|
6312 | (function(module, exports, __webpack_require__) {
|
6313 |
|
6314 | "use strict";
|
6315 |
|
6316 |
|
6317 |
|
6318 |
|
6319 |
|
6320 | Object.defineProperty(exports, "__esModule", { value: true });
|
6321 | const vscode_languageserver_protocol_1 = __webpack_require__(3);
|
6322 | const Is = __webpack_require__(34);
|
6323 | exports.ConfigurationFeature = (Base) => {
|
6324 | return class extends Base {
|
6325 | getConfiguration(arg) {
|
6326 | if (!arg) {
|
6327 | return this._getConfiguration({});
|
6328 | }
|
6329 | else if (Is.string(arg)) {
|
6330 | return this._getConfiguration({ section: arg });
|
6331 | }
|
6332 | else {
|
6333 | return this._getConfiguration(arg);
|
6334 | }
|
6335 | }
|
6336 | _getConfiguration(arg) {
|
6337 | let params = {
|
6338 | items: Array.isArray(arg) ? arg : [arg]
|
6339 | };
|
6340 | return this.connection.sendRequest(vscode_languageserver_protocol_1.ConfigurationRequest.type, params).then((result) => {
|
6341 | return Array.isArray(arg) ? result : result[0];
|
6342 | });
|
6343 | }
|
6344 | };
|
6345 | };
|
6346 |
|
6347 |
|
6348 | }),
|
6349 |
|
6350 | (function(module, exports, __webpack_require__) {
|
6351 |
|
6352 | "use strict";
|
6353 |
|
6354 |
|
6355 |
|
6356 |
|
6357 |
|
6358 | Object.defineProperty(exports, "__esModule", { value: true });
|
6359 | function boolean(value) {
|
6360 | return value === true || value === false;
|
6361 | }
|
6362 | exports.boolean = boolean;
|
6363 | function string(value) {
|
6364 | return typeof value === 'string' || value instanceof String;
|
6365 | }
|
6366 | exports.string = string;
|
6367 | function number(value) {
|
6368 | return typeof value === 'number' || value instanceof Number;
|
6369 | }
|
6370 | exports.number = number;
|
6371 | function error(value) {
|
6372 | return value instanceof Error;
|
6373 | }
|
6374 | exports.error = error;
|
6375 | function func(value) {
|
6376 | return typeof value === 'function';
|
6377 | }
|
6378 | exports.func = func;
|
6379 | function array(value) {
|
6380 | return Array.isArray(value);
|
6381 | }
|
6382 | exports.array = array;
|
6383 | function stringArray(value) {
|
6384 | return array(value) && value.every(elem => string(elem));
|
6385 | }
|
6386 | exports.stringArray = stringArray;
|
6387 | function typedArray(value, check) {
|
6388 | return Array.isArray(value) && value.every(check);
|
6389 | }
|
6390 | exports.typedArray = typedArray;
|
6391 | function thenable(value) {
|
6392 | return value && func(value.then);
|
6393 | }
|
6394 | exports.thenable = thenable;
|
6395 |
|
6396 |
|
6397 | }),
|
6398 |
|
6399 | (function(module, exports, __webpack_require__) {
|
6400 |
|
6401 | "use strict";
|
6402 |
|
6403 |
|
6404 |
|
6405 |
|
6406 |
|
6407 | Object.defineProperty(exports, "__esModule", { value: true });
|
6408 | const vscode_languageserver_protocol_1 = __webpack_require__(3);
|
6409 | exports.WorkspaceFoldersFeature = (Base) => {
|
6410 | return class extends Base {
|
6411 | initialize(capabilities) {
|
6412 | let workspaceCapabilities = capabilities.workspace;
|
6413 | if (workspaceCapabilities && workspaceCapabilities.workspaceFolders) {
|
6414 | this._onDidChangeWorkspaceFolders = new vscode_languageserver_protocol_1.Emitter();
|
6415 | this.connection.onNotification(vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type, (params) => {
|
6416 | this._onDidChangeWorkspaceFolders.fire(params.event);
|
6417 | });
|
6418 | }
|
6419 | }
|
6420 | getWorkspaceFolders() {
|
6421 | return this.connection.sendRequest(vscode_languageserver_protocol_1.WorkspaceFoldersRequest.type);
|
6422 | }
|
6423 | get onDidChangeWorkspaceFolders() {
|
6424 | if (!this._onDidChangeWorkspaceFolders) {
|
6425 | throw new Error('Client doesn\'t support sending workspace folder change events.');
|
6426 | }
|
6427 | if (!this._unregistration) {
|
6428 | this._unregistration = this.connection.client.register(vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type);
|
6429 | }
|
6430 | return this._onDidChangeWorkspaceFolders.event;
|
6431 | }
|
6432 | };
|
6433 | };
|
6434 |
|
6435 |
|
6436 | }),
|
6437 |
|
6438 | (function(module, exports, __webpack_require__) {
|
6439 |
|
6440 | "use strict";
|
6441 |
|
6442 |
|
6443 |
|
6444 |
|
6445 |
|
6446 | Object.defineProperty(exports, "__esModule", { value: true });
|
6447 | const vscode_languageserver_protocol_1 = __webpack_require__(3);
|
6448 | const uuid_1 = __webpack_require__(37);
|
6449 | class WorkDoneProgressImpl {
|
6450 | constructor(_connection, _token) {
|
6451 | this._connection = _connection;
|
6452 | this._token = _token;
|
6453 | WorkDoneProgressImpl.Instances.set(this._token, this);
|
6454 | this._source = new vscode_languageserver_protocol_1.CancellationTokenSource();
|
6455 | }
|
6456 | get token() {
|
6457 | return this._source.token;
|
6458 | }
|
6459 | begin(title, percentage, message, cancellable) {
|
6460 | let param = {
|
6461 | kind: 'begin',
|
6462 | title,
|
6463 | percentage,
|
6464 | message,
|
6465 | cancellable
|
6466 | };
|
6467 | this._connection.sendProgress(vscode_languageserver_protocol_1.WorkDoneProgress.type, this._token, param);
|
6468 | }
|
6469 | report(arg0, arg1) {
|
6470 | let param = {
|
6471 | kind: 'report'
|
6472 | };
|
6473 | if (typeof arg0 === 'number') {
|
6474 | param.percentage = arg0;
|
6475 | if (arg1 !== undefined) {
|
6476 | param.message = arg1;
|
6477 | }
|
6478 | }
|
6479 | else {
|
6480 | param.message = arg0;
|
6481 | }
|
6482 | this._connection.sendProgress(vscode_languageserver_protocol_1.WorkDoneProgress.type, this._token, param);
|
6483 | }
|
6484 | done() {
|
6485 | WorkDoneProgressImpl.Instances.delete(this._token);
|
6486 | this._source.dispose();
|
6487 | this._connection.sendProgress(vscode_languageserver_protocol_1.WorkDoneProgress.type, this._token, { kind: 'end' });
|
6488 | }
|
6489 | cancel() {
|
6490 | this._source.cancel();
|
6491 | }
|
6492 | }
|
6493 | WorkDoneProgressImpl.Instances = new Map();
|
6494 | class NullProgress {
|
6495 | constructor() {
|
6496 | this._source = new vscode_languageserver_protocol_1.CancellationTokenSource();
|
6497 | }
|
6498 | get token() {
|
6499 | return this._source.token;
|
6500 | }
|
6501 | begin() {
|
6502 | }
|
6503 | report() {
|
6504 | }
|
6505 | done() {
|
6506 | }
|
6507 | }
|
6508 | function attachWorkDone(connection, params) {
|
6509 | if (params === undefined || params.workDoneToken === undefined) {
|
6510 | return new NullProgress();
|
6511 | }
|
6512 | const token = params.workDoneToken;
|
6513 | delete params.workDoneToken;
|
6514 | return new WorkDoneProgressImpl(connection, token);
|
6515 | }
|
6516 | exports.attachWorkDone = attachWorkDone;
|
6517 | exports.ProgressFeature = (Base) => {
|
6518 | return class extends Base {
|
6519 | initialize(capabilities) {
|
6520 | var _a;
|
6521 | if (((_a = capabilities === null || capabilities === void 0 ? void 0 : capabilities.window) === null || _a === void 0 ? void 0 : _a.workDoneProgress) === true) {
|
6522 | this._progressSupported = true;
|
6523 | this.connection.onNotification(vscode_languageserver_protocol_1.WorkDoneProgressCancelNotification.type, (params) => {
|
6524 | let progress = WorkDoneProgressImpl.Instances.get(params.token);
|
6525 | if (progress !== undefined) {
|
6526 | progress.cancel();
|
6527 | }
|
6528 | });
|
6529 | }
|
6530 | }
|
6531 | attachWorkDoneProgress(token) {
|
6532 | if (token === undefined) {
|
6533 | return new NullProgress();
|
6534 | }
|
6535 | else {
|
6536 | return new WorkDoneProgressImpl(this.connection, token);
|
6537 | }
|
6538 | }
|
6539 | createWorkDoneProgress() {
|
6540 | if (this._progressSupported) {
|
6541 | const token = uuid_1.generateUuid();
|
6542 | return this.connection.sendRequest(vscode_languageserver_protocol_1.WorkDoneProgressCreateRequest.type, { token }).then(() => {
|
6543 | const result = new WorkDoneProgressImpl(this.connection, token);
|
6544 | return result;
|
6545 | });
|
6546 | }
|
6547 | else {
|
6548 | return Promise.resolve(new NullProgress());
|
6549 | }
|
6550 | }
|
6551 | };
|
6552 | };
|
6553 | var ResultProgress;
|
6554 | (function (ResultProgress) {
|
6555 | ResultProgress.type = new vscode_languageserver_protocol_1.ProgressType();
|
6556 | })(ResultProgress || (ResultProgress = {}));
|
6557 | class ResultProgressImpl {
|
6558 | constructor(_connection, _token) {
|
6559 | this._connection = _connection;
|
6560 | this._token = _token;
|
6561 | }
|
6562 | report(data) {
|
6563 | this._connection.sendProgress(ResultProgress.type, this._token, data);
|
6564 | }
|
6565 | }
|
6566 | function attachPartialResult(connection, params) {
|
6567 | if (params === undefined || params.partialResultToken === undefined) {
|
6568 | return undefined;
|
6569 | }
|
6570 | const token = params.partialResultToken;
|
6571 | delete params.partialResultToken;
|
6572 | return new ResultProgressImpl(connection, token);
|
6573 | }
|
6574 | exports.attachPartialResult = attachPartialResult;
|
6575 |
|
6576 |
|
6577 | }),
|
6578 |
|
6579 | (function(module, exports, __webpack_require__) {
|
6580 |
|
6581 | "use strict";
|
6582 |
|
6583 |
|
6584 |
|
6585 |
|
6586 |
|
6587 | Object.defineProperty(exports, "__esModule", { value: true });
|
6588 | class ValueUUID {
|
6589 | constructor(_value) {
|
6590 | this._value = _value;
|
6591 |
|
6592 | }
|
6593 | asHex() {
|
6594 | return this._value;
|
6595 | }
|
6596 | equals(other) {
|
6597 | return this.asHex() === other.asHex();
|
6598 | }
|
6599 | }
|
6600 | class V4UUID extends ValueUUID {
|
6601 | constructor() {
|
6602 | super([
|
6603 | V4UUID._randomHex(),
|
6604 | V4UUID._randomHex(),
|
6605 | V4UUID._randomHex(),
|
6606 | V4UUID._randomHex(),
|
6607 | V4UUID._randomHex(),
|
6608 | V4UUID._randomHex(),
|
6609 | V4UUID._randomHex(),
|
6610 | V4UUID._randomHex(),
|
6611 | '-',
|
6612 | V4UUID._randomHex(),
|
6613 | V4UUID._randomHex(),
|
6614 | V4UUID._randomHex(),
|
6615 | V4UUID._randomHex(),
|
6616 | '-',
|
6617 | '4',
|
6618 | V4UUID._randomHex(),
|
6619 | V4UUID._randomHex(),
|
6620 | V4UUID._randomHex(),
|
6621 | '-',
|
6622 | V4UUID._oneOf(V4UUID._timeHighBits),
|
6623 | V4UUID._randomHex(),
|
6624 | V4UUID._randomHex(),
|
6625 | V4UUID._randomHex(),
|
6626 | '-',
|
6627 | V4UUID._randomHex(),
|
6628 | V4UUID._randomHex(),
|
6629 | V4UUID._randomHex(),
|
6630 | V4UUID._randomHex(),
|
6631 | V4UUID._randomHex(),
|
6632 | V4UUID._randomHex(),
|
6633 | V4UUID._randomHex(),
|
6634 | V4UUID._randomHex(),
|
6635 | V4UUID._randomHex(),
|
6636 | V4UUID._randomHex(),
|
6637 | V4UUID._randomHex(),
|
6638 | V4UUID._randomHex(),
|
6639 | ].join(''));
|
6640 | }
|
6641 | static _oneOf(array) {
|
6642 | return array[Math.floor(array.length * Math.random())];
|
6643 | }
|
6644 | static _randomHex() {
|
6645 | return V4UUID._oneOf(V4UUID._chars);
|
6646 | }
|
6647 | }
|
6648 | V4UUID._chars = ['0', '1', '2', '3', '4', '5', '6', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];
|
6649 | V4UUID._timeHighBits = ['8', '9', 'a', 'b'];
|
6650 |
|
6651 |
|
6652 |
|
6653 | exports.empty = new ValueUUID('00000000-0000-0000-0000-000000000000');
|
6654 | function v4() {
|
6655 | return new V4UUID();
|
6656 | }
|
6657 | exports.v4 = v4;
|
6658 | const _UUIDPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
6659 | function isUUID(value) {
|
6660 | return _UUIDPattern.test(value);
|
6661 | }
|
6662 | exports.isUUID = isUUID;
|
6663 |
|
6664 |
|
6665 |
|
6666 |
|
6667 | function parse(value) {
|
6668 | if (!isUUID(value)) {
|
6669 | throw new Error('invalid uuid');
|
6670 | }
|
6671 | return new ValueUUID(value);
|
6672 | }
|
6673 | exports.parse = parse;
|
6674 | function generateUuid() {
|
6675 | return v4().asHex();
|
6676 | }
|
6677 | exports.generateUuid = generateUuid;
|
6678 |
|
6679 |
|
6680 | }),
|
6681 |
|
6682 | (function(module, exports, __webpack_require__) {
|
6683 |
|
6684 | "use strict";
|
6685 |
|
6686 |
|
6687 |
|
6688 |
|
6689 |
|
6690 | Object.defineProperty(exports, "__esModule", { value: true });
|
6691 | const url = __webpack_require__(39);
|
6692 | const path = __webpack_require__(13);
|
6693 | const fs = __webpack_require__(40);
|
6694 | const child_process_1 = __webpack_require__(41);
|
6695 |
|
6696 |
|
6697 |
|
6698 |
|
6699 | function uriToFilePath(uri) {
|
6700 | let parsed = url.parse(uri);
|
6701 | if (parsed.protocol !== 'file:' || !parsed.path) {
|
6702 | return undefined;
|
6703 | }
|
6704 | let segments = parsed.path.split('/');
|
6705 | for (var i = 0, len = segments.length; i < len; i++) {
|
6706 | segments[i] = decodeURIComponent(segments[i]);
|
6707 | }
|
6708 | if (process.platform === 'win32' && segments.length > 1) {
|
6709 | let first = segments[0];
|
6710 | let second = segments[1];
|
6711 |
|
6712 |
|
6713 | if (first.length === 0 && second.length > 1 && second[1] === ':') {
|
6714 |
|
6715 | segments.shift();
|
6716 | }
|
6717 | }
|
6718 | return path.normalize(segments.join('/'));
|
6719 | }
|
6720 | exports.uriToFilePath = uriToFilePath;
|
6721 | function isWindows() {
|
6722 | return process.platform === 'win32';
|
6723 | }
|
6724 | function resolve(moduleName, nodePath, cwd, tracer) {
|
6725 | const nodePathKey = 'NODE_PATH';
|
6726 | const app = [
|
6727 | 'var p = process;',
|
6728 | 'p.on(\'message\',function(m){',
|
6729 | 'if(m.c===\'e\'){',
|
6730 | 'p.exit(0);',
|
6731 | '}',
|
6732 | 'else if(m.c===\'rs\'){',
|
6733 | 'try{',
|
6734 | 'var r=require.resolve(m.a);',
|
6735 | 'p.send({c:\'r\',s:true,r:r});',
|
6736 | '}',
|
6737 | 'catch(err){',
|
6738 | 'p.send({c:\'r\',s:false});',
|
6739 | '}',
|
6740 | '}',
|
6741 | '});'
|
6742 | ].join('');
|
6743 | return new Promise((resolve, reject) => {
|
6744 | let env = process.env;
|
6745 | let newEnv = Object.create(null);
|
6746 | Object.keys(env).forEach(key => newEnv[key] = env[key]);
|
6747 | if (nodePath && fs.existsSync(nodePath) ) {
|
6748 | if (newEnv[nodePathKey]) {
|
6749 | newEnv[nodePathKey] = nodePath + path.delimiter + newEnv[nodePathKey];
|
6750 | }
|
6751 | else {
|
6752 | newEnv[nodePathKey] = nodePath;
|
6753 | }
|
6754 | if (tracer) {
|
6755 | tracer(`NODE_PATH value is: ${newEnv[nodePathKey]}`);
|
6756 | }
|
6757 | }
|
6758 | newEnv['ELECTRON_RUN_AS_NODE'] = '1';
|
6759 | try {
|
6760 | let cp = child_process_1.fork('', [], {
|
6761 | cwd: cwd,
|
6762 | env: newEnv,
|
6763 | execArgv: ['-e', app]
|
6764 | });
|
6765 | if (cp.pid === void 0) {
|
6766 | reject(new Error(`Starting process to resolve node module ${moduleName} failed`));
|
6767 | return;
|
6768 | }
|
6769 | cp.on('error', (error) => {
|
6770 | reject(error);
|
6771 | });
|
6772 | cp.on('message', (message) => {
|
6773 | if (message.c === 'r') {
|
6774 | cp.send({ c: 'e' });
|
6775 | if (message.s) {
|
6776 | resolve(message.r);
|
6777 | }
|
6778 | else {
|
6779 | reject(new Error(`Failed to resolve module: ${moduleName}`));
|
6780 | }
|
6781 | }
|
6782 | });
|
6783 | let message = {
|
6784 | c: 'rs',
|
6785 | a: moduleName
|
6786 | };
|
6787 | cp.send(message);
|
6788 | }
|
6789 | catch (error) {
|
6790 | reject(error);
|
6791 | }
|
6792 | });
|
6793 | }
|
6794 | exports.resolve = resolve;
|
6795 |
|
6796 |
|
6797 |
|
6798 |
|
6799 |
|
6800 |
|
6801 | function resolveGlobalNodePath(tracer) {
|
6802 | let npmCommand = 'npm';
|
6803 | const env = Object.create(null);
|
6804 | Object.keys(process.env).forEach(key => env[key] = process.env[key]);
|
6805 | env['NO_UPDATE_NOTIFIER'] = 'true';
|
6806 | const options = {
|
6807 | encoding: 'utf8',
|
6808 | env
|
6809 | };
|
6810 | if (isWindows()) {
|
6811 | npmCommand = 'npm.cmd';
|
6812 | options.shell = true;
|
6813 | }
|
6814 | let handler = () => { };
|
6815 | try {
|
6816 | process.on('SIGPIPE', handler);
|
6817 | let stdout = child_process_1.spawnSync(npmCommand, ['config', 'get', 'prefix'], options).stdout;
|
6818 | if (!stdout) {
|
6819 | if (tracer) {
|
6820 | tracer(`'npm config get prefix' didn't return a value.`);
|
6821 | }
|
6822 | return undefined;
|
6823 | }
|
6824 | let prefix = stdout.trim();
|
6825 | if (tracer) {
|
6826 | tracer(`'npm config get prefix' value is: ${prefix}`);
|
6827 | }
|
6828 | if (prefix.length > 0) {
|
6829 | if (isWindows()) {
|
6830 | return path.join(prefix, 'node_modules');
|
6831 | }
|
6832 | else {
|
6833 | return path.join(prefix, 'lib', 'node_modules');
|
6834 | }
|
6835 | }
|
6836 | return undefined;
|
6837 | }
|
6838 | catch (err) {
|
6839 | return undefined;
|
6840 | }
|
6841 | finally {
|
6842 | process.removeListener('SIGPIPE', handler);
|
6843 | }
|
6844 | }
|
6845 | exports.resolveGlobalNodePath = resolveGlobalNodePath;
|
6846 |
|
6847 |
|
6848 |
|
6849 |
|
6850 |
|
6851 |
|
6852 | function resolveGlobalYarnPath(tracer) {
|
6853 | let yarnCommand = 'yarn';
|
6854 | let options = {
|
6855 | encoding: 'utf8'
|
6856 | };
|
6857 | if (isWindows()) {
|
6858 | yarnCommand = 'yarn.cmd';
|
6859 | options.shell = true;
|
6860 | }
|
6861 | let handler = () => { };
|
6862 | try {
|
6863 | process.on('SIGPIPE', handler);
|
6864 | let results = child_process_1.spawnSync(yarnCommand, ['global', 'dir', '--json'], options);
|
6865 | let stdout = results.stdout;
|
6866 | if (!stdout) {
|
6867 | if (tracer) {
|
6868 | tracer(`'yarn global dir' didn't return a value.`);
|
6869 | if (results.stderr) {
|
6870 | tracer(results.stderr);
|
6871 | }
|
6872 | }
|
6873 | return undefined;
|
6874 | }
|
6875 | let lines = stdout.trim().split(/\r?\n/);
|
6876 | for (let line of lines) {
|
6877 | try {
|
6878 | let yarn = JSON.parse(line);
|
6879 | if (yarn.type === 'log') {
|
6880 | return path.join(yarn.data, 'node_modules');
|
6881 | }
|
6882 | }
|
6883 | catch (e) {
|
6884 |
|
6885 | }
|
6886 | }
|
6887 | return undefined;
|
6888 | }
|
6889 | catch (err) {
|
6890 | return undefined;
|
6891 | }
|
6892 | finally {
|
6893 | process.removeListener('SIGPIPE', handler);
|
6894 | }
|
6895 | }
|
6896 | exports.resolveGlobalYarnPath = resolveGlobalYarnPath;
|
6897 | var FileSystem;
|
6898 | (function (FileSystem) {
|
6899 | let _isCaseSensitive = undefined;
|
6900 | function isCaseSensitive() {
|
6901 | if (_isCaseSensitive !== void 0) {
|
6902 | return _isCaseSensitive;
|
6903 | }
|
6904 | if (process.platform === 'win32') {
|
6905 | _isCaseSensitive = false;
|
6906 | }
|
6907 | else {
|
6908 |
|
6909 |
|
6910 | _isCaseSensitive = !fs.existsSync(__filename.toUpperCase()) || !fs.existsSync(__filename.toLowerCase());
|
6911 | }
|
6912 | return _isCaseSensitive;
|
6913 | }
|
6914 | FileSystem.isCaseSensitive = isCaseSensitive;
|
6915 | function isParent(parent, child) {
|
6916 | if (isCaseSensitive()) {
|
6917 | return path.normalize(child).indexOf(path.normalize(parent)) === 0;
|
6918 | }
|
6919 | else {
|
6920 | return path.normalize(child).toLowerCase().indexOf(path.normalize(parent).toLowerCase()) === 0;
|
6921 | }
|
6922 | }
|
6923 | FileSystem.isParent = isParent;
|
6924 | })(FileSystem = exports.FileSystem || (exports.FileSystem = {}));
|
6925 | function resolveModulePath(workspaceRoot, moduleName, nodePath, tracer) {
|
6926 | if (nodePath) {
|
6927 | if (!path.isAbsolute(nodePath)) {
|
6928 | nodePath = path.join(workspaceRoot, nodePath);
|
6929 | }
|
6930 | return resolve(moduleName, nodePath, nodePath, tracer).then((value) => {
|
6931 | if (FileSystem.isParent(nodePath, value)) {
|
6932 | return value;
|
6933 | }
|
6934 | else {
|
6935 | return Promise.reject(new Error(`Failed to load ${moduleName} from node path location.`));
|
6936 | }
|
6937 | }).then(undefined, (_error) => {
|
6938 | return resolve(moduleName, resolveGlobalNodePath(tracer), workspaceRoot, tracer);
|
6939 | });
|
6940 | }
|
6941 | else {
|
6942 | return resolve(moduleName, resolveGlobalNodePath(tracer), workspaceRoot, tracer);
|
6943 | }
|
6944 | }
|
6945 | exports.resolveModulePath = resolveModulePath;
|
6946 |
|
6947 |
|
6948 | }),
|
6949 |
|
6950 | (function(module, exports) {
|
6951 |
|
6952 | module.exports = require("url");
|
6953 |
|
6954 | }),
|
6955 |
|
6956 | (function(module, exports) {
|
6957 |
|
6958 | module.exports = require("fs");
|
6959 |
|
6960 | }),
|
6961 |
|
6962 | (function(module, exports) {
|
6963 |
|
6964 | module.exports = require("child_process");
|
6965 |
|
6966 | }),
|
6967 |
|
6968 | (function(module, exports, __webpack_require__) {
|
6969 |
|
6970 | "use strict";
|
6971 |
|
6972 |
|
6973 |
|
6974 |
|
6975 |
|
6976 | Object.defineProperty(exports, "__esModule", { value: true });
|
6977 | const vscode_languageserver_protocol_1 = __webpack_require__(3);
|
6978 | exports.CallHierarchyFeature = (Base) => {
|
6979 | return class extends Base {
|
6980 | get callHierarchy() {
|
6981 | return {
|
6982 | onPrepare: (handler) => {
|
6983 | this.connection.onRequest(vscode_languageserver_protocol_1.Proposed.CallHierarchyPrepareRequest.type, (params, cancel) => {
|
6984 | return handler(params, cancel, this.attachWorkDoneProgress(params), undefined);
|
6985 | });
|
6986 | },
|
6987 | onIncomingCalls: (handler) => {
|
6988 | const type = vscode_languageserver_protocol_1.Proposed.CallHierarchyIncomingCallsRequest.type;
|
6989 | this.connection.onRequest(type, (params, cancel) => {
|
6990 | return handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params));
|
6991 | });
|
6992 | },
|
6993 | onOutgoingCalls: (handler) => {
|
6994 | const type = vscode_languageserver_protocol_1.Proposed.CallHierarchyOutgoingCallsRequest.type;
|
6995 | this.connection.onRequest(type, (params, cancel) => {
|
6996 | return handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params));
|
6997 | });
|
6998 | }
|
6999 | };
|
7000 | }
|
7001 | };
|
7002 | };
|
7003 |
|
7004 |
|
7005 | }),
|
7006 |
|
7007 | (function(module, exports, __webpack_require__) {
|
7008 |
|
7009 | "use strict";
|
7010 |
|
7011 |
|
7012 |
|
7013 |
|
7014 |
|
7015 | Object.defineProperty(exports, "__esModule", { value: true });
|
7016 | const vscode_languageserver_protocol_1 = __webpack_require__(3);
|
7017 | exports.SemanticTokensFeature = (Base) => {
|
7018 | return class extends Base {
|
7019 | get semanticTokens() {
|
7020 | return {
|
7021 | on: (handler) => {
|
7022 | const type = vscode_languageserver_protocol_1.Proposed.SemanticTokensRequest.type;
|
7023 | this.connection.onRequest(type, (params, cancel) => {
|
7024 | return handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params));
|
7025 | });
|
7026 | },
|
7027 | onEdits: (handler) => {
|
7028 | const type = vscode_languageserver_protocol_1.Proposed.SemanticTokensEditsRequest.type;
|
7029 | this.connection.onRequest(type, (params, cancel) => {
|
7030 | return handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params));
|
7031 | });
|
7032 | },
|
7033 | onRange: (handler) => {
|
7034 | const type = vscode_languageserver_protocol_1.Proposed.SemanticTokensRangeRequest.type;
|
7035 | this.connection.onRequest(type, (params, cancel) => {
|
7036 | return handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params));
|
7037 | });
|
7038 | }
|
7039 | };
|
7040 | }
|
7041 | };
|
7042 | };
|
7043 | class SemanticTokensBuilder {
|
7044 | constructor() {
|
7045 | this._prevData = undefined;
|
7046 | this.initialize();
|
7047 | }
|
7048 | initialize() {
|
7049 | this._id = Date.now();
|
7050 | this._prevLine = 0;
|
7051 | this._prevChar = 0;
|
7052 | this._data = [];
|
7053 | this._dataLen = 0;
|
7054 | }
|
7055 | push(line, char, length, tokenType, tokenModifiers) {
|
7056 | let pushLine = line;
|
7057 | let pushChar = char;
|
7058 | if (this._dataLen > 0) {
|
7059 | pushLine -= this._prevLine;
|
7060 | if (pushLine === 0) {
|
7061 | pushChar -= this._prevChar;
|
7062 | }
|
7063 | }
|
7064 | this._data[this._dataLen++] = pushLine;
|
7065 | this._data[this._dataLen++] = pushChar;
|
7066 | this._data[this._dataLen++] = length;
|
7067 | this._data[this._dataLen++] = tokenType;
|
7068 | this._data[this._dataLen++] = tokenModifiers;
|
7069 | this._prevLine = line;
|
7070 | this._prevChar = char;
|
7071 | }
|
7072 | get id() {
|
7073 | return this._id.toString();
|
7074 | }
|
7075 | previousResult(id) {
|
7076 | if (this.id === id) {
|
7077 | this._prevData = this._data;
|
7078 | }
|
7079 | this.initialize();
|
7080 | }
|
7081 | build() {
|
7082 | this._prevData = undefined;
|
7083 | return {
|
7084 | resultId: this.id,
|
7085 | data: this._data
|
7086 | };
|
7087 | }
|
7088 | canBuildEdits() {
|
7089 | return this._prevData !== undefined;
|
7090 | }
|
7091 | buildEdits() {
|
7092 | if (this._prevData !== undefined) {
|
7093 | const prevDataLength = this._prevData.length;
|
7094 | const dataLength = this._data.length;
|
7095 | let startIndex = 0;
|
7096 | while (startIndex < dataLength && startIndex < prevDataLength && this._prevData[startIndex] === this._data[startIndex]) {
|
7097 | startIndex++;
|
7098 | }
|
7099 | if (startIndex < dataLength && startIndex < prevDataLength) {
|
7100 |
|
7101 | let endIndex = 0;
|
7102 | while (endIndex < dataLength && endIndex < prevDataLength && this._prevData[prevDataLength - 1 - endIndex] === this._data[dataLength - 1 - endIndex]) {
|
7103 | endIndex++;
|
7104 | }
|
7105 | const newData = this._data.slice(startIndex, dataLength - endIndex);
|
7106 | const result = {
|
7107 | resultId: this.id,
|
7108 | edits: [
|
7109 | { start: startIndex, deleteCount: prevDataLength - endIndex - startIndex, data: newData }
|
7110 | ]
|
7111 | };
|
7112 | return result;
|
7113 | }
|
7114 | else if (startIndex < dataLength) {
|
7115 | return { resultId: this.id, edits: [
|
7116 | { start: startIndex, deleteCount: 0, data: this._data.slice(startIndex) }
|
7117 | ] };
|
7118 | }
|
7119 | else if (startIndex < prevDataLength) {
|
7120 | return { resultId: this.id, edits: [
|
7121 | { start: startIndex, deleteCount: prevDataLength - startIndex }
|
7122 | ] };
|
7123 | }
|
7124 | else {
|
7125 | return { resultId: this.id, edits: [] };
|
7126 | }
|
7127 | }
|
7128 | else {
|
7129 | return this.build();
|
7130 | }
|
7131 | }
|
7132 | }
|
7133 | exports.SemanticTokensBuilder = SemanticTokensBuilder;
|
7134 |
|
7135 |
|
7136 | }),
|
7137 |
|
7138 | (function(module, exports, __webpack_require__) {
|
7139 |
|
7140 | "use strict";
|
7141 |
|
7142 | Object.defineProperty(exports, "__esModule", { value: true });
|
7143 | exports.sortTexts = {
|
7144 | one: "00001",
|
7145 | two: "00002",
|
7146 | three: "00003",
|
7147 | four: "00004",
|
7148 | };
|
7149 | exports.projectRootPatterns = [".git", "autoload", "plugin"];
|
7150 |
|
7151 |
|
7152 | }),
|
7153 | ,
|
7154 |
|
7155 | (function(module, exports, __webpack_require__) {
|
7156 |
|
7157 | "use strict";
|
7158 |
|
7159 | var __assign = (this && this.__assign) || function () {
|
7160 | __assign = Object.assign || function(t) {
|
7161 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
7162 | s = arguments[i];
|
7163 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
7164 | t[p] = s[p];
|
7165 | }
|
7166 | return t;
|
7167 | };
|
7168 | return __assign.apply(this, arguments);
|
7169 | };
|
7170 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
7171 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
7172 | return new (P || (P = Promise))(function (resolve, reject) {
|
7173 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
7174 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7175 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
7176 | step((generator = generator.apply(thisArg, _arguments || [])).next());
|
7177 | });
|
7178 | };
|
7179 | var __generator = (this && this.__generator) || function (thisArg, body) {
|
7180 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
7181 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
7182 | function verb(n) { return function (v) { return step([n, v]); }; }
|
7183 | function step(op) {
|
7184 | if (f) throw new TypeError("Generator is already executing.");
|
7185 | while (_) try {
|
7186 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
7187 | if (y = 0, t) op = [op[0] & 2, t.value];
|
7188 | switch (op[0]) {
|
7189 | case 0: case 1: t = op; break;
|
7190 | case 4: _.label++; return { value: op[1], done: false };
|
7191 | case 5: _.label++; y = op[1]; op = [0]; continue;
|
7192 | case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
7193 | default:
|
7194 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
7195 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
7196 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
7197 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
7198 | if (t[2]) _.ops.pop();
|
7199 | _.trys.pop(); continue;
|
7200 | }
|
7201 | op = body.call(thisArg, _);
|
7202 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
7203 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
7204 | }
|
7205 | };
|
7206 | var __spreadArrays = (this && this.__spreadArrays) || function () {
|
7207 | for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
7208 | for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
7209 | for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
7210 | r[k] = a[j];
|
7211 | return r;
|
7212 | };
|
7213 | var __importDefault = (this && this.__importDefault) || function (mod) {
|
7214 | return (mod && mod.__esModule) ? mod : { "default": mod };
|
7215 | };
|
7216 | Object.defineProperty(exports, "__esModule", { value: true });
|
7217 | var child_process_1 = __webpack_require__(41);
|
7218 | var findup_1 = __importDefault(__webpack_require__(47));
|
7219 | var fs_1 = __importDefault(__webpack_require__(40));
|
7220 | var path_1 = __importDefault(__webpack_require__(13));
|
7221 | var vscode_languageserver_1 = __webpack_require__(2);
|
7222 | var vimparser_1 = __webpack_require__(52);
|
7223 | var patterns_1 = __webpack_require__(54);
|
7224 | function isSomeMatchPattern(patterns, line) {
|
7225 | return patterns.some(function (p) { return p.test(line); });
|
7226 | }
|
7227 | exports.isSomeMatchPattern = isSomeMatchPattern;
|
7228 | function executeFile(input, command, args, option) {
|
7229 | return new Promise(function (resolve, reject) {
|
7230 | var stdout = "";
|
7231 | var stderr = "";
|
7232 | var error;
|
7233 | var isPassAsText = false;
|
7234 | args = (args || []).map(function (arg) {
|
7235 | if (/%text/.test(arg)) {
|
7236 | isPassAsText = true;
|
7237 | return arg.replace(/%text/g, input.toString());
|
7238 | }
|
7239 | return arg;
|
7240 | });
|
7241 | var cp = child_process_1.spawn(command, args, option);
|
7242 | cp.stdout.on("data", function (data) {
|
7243 | stdout += data;
|
7244 | });
|
7245 | cp.stderr.on("data", function (data) {
|
7246 | stderr += data;
|
7247 | });
|
7248 | cp.on("error", function (err) {
|
7249 | error = err;
|
7250 | reject(error);
|
7251 | });
|
7252 | cp.on("close", function (code) {
|
7253 | if (!error) {
|
7254 | resolve({ code: code, stdout: stdout, stderr: stderr });
|
7255 | }
|
7256 | });
|
7257 |
|
7258 | if (!isPassAsText) {
|
7259 | input.pipe(cp.stdin).on("error", function () { return; });
|
7260 | }
|
7261 | });
|
7262 | }
|
7263 | exports.executeFile = executeFile;
|
7264 |
|
7265 | function pcb(cb) {
|
7266 | return function () {
|
7267 | var args = [];
|
7268 | for (var _i = 0; _i < arguments.length; _i++) {
|
7269 | args[_i] = arguments[_i];
|
7270 | }
|
7271 | return new Promise(function (resolve) {
|
7272 | cb.apply(void 0, __spreadArrays(args, [function () {
|
7273 | var params = [];
|
7274 | for (var _i = 0; _i < arguments.length; _i++) {
|
7275 | params[_i] = arguments[_i];
|
7276 | }
|
7277 | resolve(params);
|
7278 | }]));
|
7279 | });
|
7280 | };
|
7281 | }
|
7282 | exports.pcb = pcb;
|
7283 |
|
7284 | function findProjectRoot(filePath, rootPatterns) {
|
7285 | return __awaiter(this, void 0, void 0, function () {
|
7286 | var dirname, patterns, dirCandidate, _i, patterns_2, pattern, _a, err, dir;
|
7287 | return __generator(this, function (_b) {
|
7288 | switch (_b.label) {
|
7289 | case 0:
|
7290 | dirname = path_1.default.dirname(filePath);
|
7291 | patterns = [].concat(rootPatterns);
|
7292 | dirCandidate = "";
|
7293 | _i = 0, patterns_2 = patterns;
|
7294 | _b.label = 1;
|
7295 | case 1:
|
7296 | if (!(_i < patterns_2.length)) return [3 , 4];
|
7297 | pattern = patterns_2[_i];
|
7298 | return [4 , pcb(findup_1.default)(dirname, pattern)];
|
7299 | case 2:
|
7300 | _a = _b.sent(), err = _a[0], dir = _a[1];
|
7301 | if (!err && dir && dir !== "/" && dir.length > dirCandidate.length) {
|
7302 | dirCandidate = dir;
|
7303 | }
|
7304 | _b.label = 3;
|
7305 | case 3:
|
7306 | _i++;
|
7307 | return [3 , 1];
|
7308 | case 4:
|
7309 | if (dirCandidate.length) {
|
7310 | return [2 , dirCandidate];
|
7311 | }
|
7312 | return [2 , dirname];
|
7313 | }
|
7314 | });
|
7315 | });
|
7316 | }
|
7317 | exports.findProjectRoot = findProjectRoot;
|
7318 | function markupSnippets(snippets) {
|
7319 | return [
|
7320 | "```vim",
|
7321 | snippets.replace(/\$\{[0-9]+(:([^}]+))?\}/g, "$2"),
|
7322 | "```",
|
7323 | ].join("\n");
|
7324 | }
|
7325 | exports.markupSnippets = markupSnippets;
|
7326 | function getWordFromPosition(doc, position) {
|
7327 | if (!doc) {
|
7328 | return;
|
7329 | }
|
7330 | var character = doc.getText(vscode_languageserver_1.Range.create(vscode_languageserver_1.Position.create(position.line, position.character), vscode_languageserver_1.Position.create(position.line, position.character + 1)));
|
7331 |
|
7332 | if (!character || !patterns_1.keywordPattern.test(character)) {
|
7333 | return;
|
7334 | }
|
7335 | var currentLine = doc.getText(vscode_languageserver_1.Range.create(vscode_languageserver_1.Position.create(position.line, 0), vscode_languageserver_1.Position.create(position.line + 1, 0)));
|
7336 |
|
7337 | if (patterns_1.commentPattern.test(currentLine)) {
|
7338 | return;
|
7339 | }
|
7340 | var preSegment = currentLine.slice(0, position.character);
|
7341 | var nextSegment = currentLine.slice(position.character);
|
7342 | var wordLeft = preSegment.match(patterns_1.wordPrePattern);
|
7343 | var wordRight = nextSegment.match(patterns_1.wordNextPattern);
|
7344 | var word = "" + (wordLeft && wordLeft[1] || "") + (wordRight && wordRight[1] || "");
|
7345 | return {
|
7346 | word: word,
|
7347 | left: wordLeft && wordLeft[1] || "",
|
7348 | right: wordRight && wordRight[1] || "",
|
7349 | wordLeft: wordLeft && wordLeft[1]
|
7350 | ? preSegment.replace(new RegExp(wordLeft[1] + "$"), word)
|
7351 | : "" + preSegment + word,
|
7352 | wordRight: wordRight && wordRight[1]
|
7353 | ? nextSegment.replace(new RegExp("^" + wordRight[1]), word)
|
7354 | : "" + word + nextSegment,
|
7355 | };
|
7356 | }
|
7357 | exports.getWordFromPosition = getWordFromPosition;
|
7358 |
|
7359 | function handleParse(textDoc) {
|
7360 | return __awaiter(this, void 0, void 0, function () {
|
7361 | var text, tokens, node;
|
7362 | return __generator(this, function (_a) {
|
7363 | text = textDoc instanceof Object ? textDoc.getText() : textDoc;
|
7364 | tokens = new vimparser_1.StringReader(text.split(/\r\n|\r|\n/));
|
7365 | try {
|
7366 | node = new vimparser_1.VimLParser(true).parse(tokens);
|
7367 | return [2 , [node, ""]];
|
7368 | }
|
7369 | catch (error) {
|
7370 | return [2 , [null, error]];
|
7371 | }
|
7372 | return [2 ];
|
7373 | });
|
7374 | });
|
7375 | }
|
7376 | exports.handleParse = handleParse;
|
7377 |
|
7378 | function removeSnippets(completionItems) {
|
7379 | if (completionItems === void 0) { completionItems = []; }
|
7380 | return completionItems.map(function (item) {
|
7381 | if (item.insertTextFormat === vscode_languageserver_1.InsertTextFormat.Snippet) {
|
7382 | return __assign(__assign({}, item), { insertText: item.label, insertTextFormat: vscode_languageserver_1.InsertTextFormat.PlainText });
|
7383 | }
|
7384 | return item;
|
7385 | });
|
7386 | }
|
7387 | exports.removeSnippets = removeSnippets;
|
7388 | exports.isSymbolLink = function (filePath) { return __awaiter(void 0, void 0, void 0, function () {
|
7389 | return __generator(this, function (_a) {
|
7390 | return [2 , new Promise(function (resolve) {
|
7391 | fs_1.default.lstat(filePath, function (err, stats) {
|
7392 | resolve({
|
7393 | err: err,
|
7394 | stats: stats && stats.isSymbolicLink(),
|
7395 | });
|
7396 | });
|
7397 | })];
|
7398 | });
|
7399 | }); };
|
7400 | exports.getRealPath = function (filePath) { return __awaiter(void 0, void 0, void 0, function () {
|
7401 | var _a, err, stats;
|
7402 | return __generator(this, function (_b) {
|
7403 | switch (_b.label) {
|
7404 | case 0: return [4 , exports.isSymbolLink(filePath)];
|
7405 | case 1:
|
7406 | _a = _b.sent(), err = _a.err, stats = _a.stats;
|
7407 | if (!err && stats) {
|
7408 | return [2 , new Promise(function (resolve) {
|
7409 | fs_1.default.realpath(filePath, function (error, realPath) {
|
7410 | if (error) {
|
7411 | return resolve(filePath);
|
7412 | }
|
7413 | resolve(realPath);
|
7414 | });
|
7415 | })];
|
7416 | }
|
7417 | return [2 , filePath];
|
7418 | }
|
7419 | });
|
7420 | }); };
|
7421 |
|
7422 |
|
7423 | }),
|
7424 |
|
7425 | (function(module, exports, __webpack_require__) {
|
7426 |
|
7427 | var fs = __webpack_require__(40),
|
7428 | Path = __webpack_require__(13),
|
7429 | util = __webpack_require__(48),
|
7430 | colors = __webpack_require__(49),
|
7431 | EE = __webpack_require__(51).EventEmitter,
|
7432 | fsExists = fs.exists ? fs.exists : Path.exists,
|
7433 | fsExistsSync = fs.existsSync ? fs.existsSync : Path.existsSync;
|
7434 |
|
7435 | module.exports = function(dir, iterator, options, callback){
|
7436 | return FindUp(dir, iterator, options, callback);
|
7437 | };
|
7438 |
|
7439 | function FindUp(dir, iterator, options, callback){
|
7440 | if (!(this instanceof FindUp)) {
|
7441 | return new FindUp(dir, iterator, options, callback);
|
7442 | }
|
7443 | if(typeof options === 'function'){
|
7444 | callback = options;
|
7445 | options = {};
|
7446 | }
|
7447 | options = options || {};
|
7448 |
|
7449 | EE.call(this);
|
7450 | this.found = false;
|
7451 | this.stopPlease = false;
|
7452 | var self = this;
|
7453 |
|
7454 | if(typeof iterator === 'string'){
|
7455 | var file = iterator;
|
7456 | iterator = function(dir, cb){
|
7457 | return fsExists(Path.join(dir, file), cb);
|
7458 | };
|
7459 | }
|
7460 |
|
7461 | if(callback) {
|
7462 | this.on('found', function(dir){
|
7463 | if(options.verbose) console.log(('found '+ dir ).green);
|
7464 | callback(null, dir);
|
7465 | self.stop();
|
7466 | });
|
7467 |
|
7468 | this.on('end', function(){
|
7469 | if(options.verbose) console.log('end'.grey);
|
7470 | if(!self.found) callback(new Error('not found'));
|
7471 | });
|
7472 |
|
7473 | this.on('error', function(err){
|
7474 | if(options.verbose) console.log('error'.red, err);
|
7475 | callback(err);
|
7476 | });
|
7477 | }
|
7478 |
|
7479 | this._find(dir, iterator, options, callback);
|
7480 | }
|
7481 | util.inherits(FindUp, EE);
|
7482 |
|
7483 | FindUp.prototype._find = function(dir, iterator, options, callback){
|
7484 | var self = this;
|
7485 |
|
7486 | iterator(dir, function(exists){
|
7487 | if(options.verbose) console.log(('traverse '+ dir).grey);
|
7488 | if(exists) {
|
7489 | self.found = true;
|
7490 | self.emit('found', dir);
|
7491 | }
|
7492 |
|
7493 | var parentDir = Path.join(dir, '..');
|
7494 | if (self.stopPlease) return self.emit('end');
|
7495 | if (dir === parentDir) return self.emit('end');
|
7496 | if(dir.indexOf('../../') !== -1 ) return self.emit('error', new Error(dir + ' is not correct.'));
|
7497 | self._find(parentDir, iterator, options, callback);
|
7498 | });
|
7499 | };
|
7500 |
|
7501 | FindUp.prototype.stop = function(){
|
7502 | this.stopPlease = true;
|
7503 | };
|
7504 |
|
7505 | module.exports.FindUp = FindUp;
|
7506 |
|
7507 | module.exports.sync = function(dir, iteratorSync){
|
7508 | if(typeof iteratorSync === 'string'){
|
7509 | var file = iteratorSync;
|
7510 | iteratorSync = function(dir){
|
7511 | return fsExistsSync(Path.join(dir, file));
|
7512 | };
|
7513 | }
|
7514 | var initialDir = dir;
|
7515 | while(dir !== Path.join(dir, '..')){
|
7516 | if(dir.indexOf('../../') !== -1 ) throw new Error(initialDir + ' is not correct.');
|
7517 | if(iteratorSync(dir)) return dir;
|
7518 | dir = Path.join(dir, '..');
|
7519 | }
|
7520 | throw new Error('not found');
|
7521 | };
|
7522 |
|
7523 |
|
7524 | }),
|
7525 |
|
7526 | (function(module, exports) {
|
7527 |
|
7528 | module.exports = require("util");
|
7529 |
|
7530 | }),
|
7531 |
|
7532 | (function(module, exports, __webpack_require__) {
|
7533 |
|
7534 |
|
7535 |
|
7536 |
|
7537 |
|
7538 |
|
7539 |
|
7540 |
|
7541 |
|
7542 |
|
7543 |
|
7544 |
|
7545 |
|
7546 |
|
7547 |
|
7548 |
|
7549 |
|
7550 |
|
7551 |
|
7552 |
|
7553 |
|
7554 |
|
7555 |
|
7556 |
|
7557 |
|
7558 |
|
7559 |
|
7560 |
|
7561 |
|
7562 | var isHeadless = false;
|
7563 |
|
7564 | if (typeof module !== 'undefined') {
|
7565 | isHeadless = true;
|
7566 | }
|
7567 |
|
7568 | if (!isHeadless) {
|
7569 | var exports = {};
|
7570 | var module = {};
|
7571 | var colors = exports;
|
7572 | exports.mode = "browser";
|
7573 | } else {
|
7574 | exports.mode = "console";
|
7575 | }
|
7576 |
|
7577 |
|
7578 |
|
7579 |
|
7580 | var addProperty = function (color, func) {
|
7581 | exports[color] = function (str) {
|
7582 | return func.apply(str);
|
7583 | };
|
7584 | String.prototype.__defineGetter__(color, func);
|
7585 | };
|
7586 |
|
7587 | function stylize(str, style) {
|
7588 |
|
7589 | var styles;
|
7590 |
|
7591 | if (exports.mode === 'console') {
|
7592 | styles = {
|
7593 |
|
7594 | 'bold' : ['\x1B[1m', '\x1B[22m'],
|
7595 | 'italic' : ['\x1B[3m', '\x1B[23m'],
|
7596 | 'underline' : ['\x1B[4m', '\x1B[24m'],
|
7597 | 'inverse' : ['\x1B[7m', '\x1B[27m'],
|
7598 | 'strikethrough' : ['\x1B[9m', '\x1B[29m'],
|
7599 |
|
7600 |
|
7601 | 'white' : ['\x1B[37m', '\x1B[39m'],
|
7602 | 'grey' : ['\x1B[90m', '\x1B[39m'],
|
7603 | 'black' : ['\x1B[30m', '\x1B[39m'],
|
7604 |
|
7605 | 'blue' : ['\x1B[34m', '\x1B[39m'],
|
7606 | 'cyan' : ['\x1B[36m', '\x1B[39m'],
|
7607 | 'green' : ['\x1B[32m', '\x1B[39m'],
|
7608 | 'magenta' : ['\x1B[35m', '\x1B[39m'],
|
7609 | 'red' : ['\x1B[31m', '\x1B[39m'],
|
7610 | 'yellow' : ['\x1B[33m', '\x1B[39m'],
|
7611 |
|
7612 |
|
7613 | 'whiteBG' : ['\x1B[47m', '\x1B[49m'],
|
7614 | 'greyBG' : ['\x1B[49;5;8m', '\x1B[49m'],
|
7615 | 'blackBG' : ['\x1B[40m', '\x1B[49m'],
|
7616 |
|
7617 | 'blueBG' : ['\x1B[44m', '\x1B[49m'],
|
7618 | 'cyanBG' : ['\x1B[46m', '\x1B[49m'],
|
7619 | 'greenBG' : ['\x1B[42m', '\x1B[49m'],
|
7620 | 'magentaBG' : ['\x1B[45m', '\x1B[49m'],
|
7621 | 'redBG' : ['\x1B[41m', '\x1B[49m'],
|
7622 | 'yellowBG' : ['\x1B[43m', '\x1B[49m']
|
7623 | };
|
7624 | } else if (exports.mode === 'browser') {
|
7625 | styles = {
|
7626 |
|
7627 | 'bold' : ['<b>', '</b>'],
|
7628 | 'italic' : ['<i>', '</i>'],
|
7629 | 'underline' : ['<u>', '</u>'],
|
7630 | 'inverse' : ['<span style="background-color:black;color:white;">', '</span>'],
|
7631 | 'strikethrough' : ['<del>', '</del>'],
|
7632 |
|
7633 |
|
7634 | 'white' : ['<span style="color:white;">', '</span>'],
|
7635 | 'grey' : ['<span style="color:gray;">', '</span>'],
|
7636 | 'black' : ['<span style="color:black;">', '</span>'],
|
7637 |
|
7638 | 'blue' : ['<span style="color:blue;">', '</span>'],
|
7639 | 'cyan' : ['<span style="color:cyan;">', '</span>'],
|
7640 | 'green' : ['<span style="color:green;">', '</span>'],
|
7641 | 'magenta' : ['<span style="color:magenta;">', '</span>'],
|
7642 | 'red' : ['<span style="color:red;">', '</span>'],
|
7643 | 'yellow' : ['<span style="color:yellow;">', '</span>'],
|
7644 |
|
7645 |
|
7646 | 'whiteBG' : ['<span style="background-color:white;">', '</span>'],
|
7647 | 'greyBG' : ['<span style="background-color:gray;">', '</span>'],
|
7648 | 'blackBG' : ['<span style="background-color:black;">', '</span>'],
|
7649 |
|
7650 | 'blueBG' : ['<span style="background-color:blue;">', '</span>'],
|
7651 | 'cyanBG' : ['<span style="background-color:cyan;">', '</span>'],
|
7652 | 'greenBG' : ['<span style="background-color:green;">', '</span>'],
|
7653 | 'magentaBG' : ['<span style="background-color:magenta;">', '</span>'],
|
7654 | 'redBG' : ['<span style="background-color:red;">', '</span>'],
|
7655 | 'yellowBG' : ['<span style="background-color:yellow;">', '</span>']
|
7656 | };
|
7657 | } else if (exports.mode === 'none') {
|
7658 | return str + '';
|
7659 | } else {
|
7660 | console.log('unsupported mode, try "browser", "console" or "none"');
|
7661 | }
|
7662 | return styles[style][0] + str + styles[style][1];
|
7663 | }
|
7664 |
|
7665 | function applyTheme(theme) {
|
7666 |
|
7667 |
|
7668 |
|
7669 |
|
7670 |
|
7671 | var stringPrototypeBlacklist = [
|
7672 | '__defineGetter__', '__defineSetter__', '__lookupGetter__', '__lookupSetter__', 'charAt', 'constructor',
|
7673 | 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf', 'charCodeAt',
|
7674 | 'indexOf', 'lastIndexof', 'length', 'localeCompare', 'match', 'replace', 'search', 'slice', 'split', 'substring',
|
7675 | 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toUpperCase', 'trim', 'trimLeft', 'trimRight'
|
7676 | ];
|
7677 |
|
7678 | Object.keys(theme).forEach(function (prop) {
|
7679 | if (stringPrototypeBlacklist.indexOf(prop) !== -1) {
|
7680 | console.log('warn: '.red + ('String.prototype' + prop).magenta + ' is probably something you don\'t want to override. Ignoring style name');
|
7681 | }
|
7682 | else {
|
7683 | if (typeof(theme[prop]) === 'string') {
|
7684 | addProperty(prop, function () {
|
7685 | return exports[theme[prop]](this);
|
7686 | });
|
7687 | }
|
7688 | else {
|
7689 | addProperty(prop, function () {
|
7690 | var ret = this;
|
7691 | for (var t = 0; t < theme[prop].length; t++) {
|
7692 | ret = exports[theme[prop][t]](ret);
|
7693 | }
|
7694 | return ret;
|
7695 | });
|
7696 | }
|
7697 | }
|
7698 | });
|
7699 | }
|
7700 |
|
7701 |
|
7702 |
|
7703 |
|
7704 |
|
7705 | var x = ['bold', 'underline', 'strikethrough', 'italic', 'inverse', 'grey', 'black', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta', 'greyBG', 'blackBG', 'yellowBG', 'redBG', 'greenBG', 'blueBG', 'whiteBG', 'cyanBG', 'magentaBG'];
|
7706 | x.forEach(function (style) {
|
7707 |
|
7708 |
|
7709 |
|
7710 |
|
7711 | addProperty(style, function () {
|
7712 | return stylize(this, style);
|
7713 | });
|
7714 | });
|
7715 |
|
7716 | function sequencer(map) {
|
7717 | return function () {
|
7718 | if (!isHeadless) {
|
7719 | return this.replace(/( )/, '$1');
|
7720 | }
|
7721 | var exploded = this.split(""), i = 0;
|
7722 | exploded = exploded.map(map);
|
7723 | return exploded.join("");
|
7724 | };
|
7725 | }
|
7726 |
|
7727 | var rainbowMap = (function () {
|
7728 | var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta'];
|
7729 | return function (letter, i, exploded) {
|
7730 | if (letter === " ") {
|
7731 | return letter;
|
7732 | } else {
|
7733 | return stylize(letter, rainbowColors[i++ % rainbowColors.length]);
|
7734 | }
|
7735 | };
|
7736 | })();
|
7737 |
|
7738 | exports.themes = {};
|
7739 |
|
7740 | exports.addSequencer = function (name, map) {
|
7741 | addProperty(name, sequencer(map));
|
7742 | };
|
7743 |
|
7744 | exports.addSequencer('rainbow', rainbowMap);
|
7745 | exports.addSequencer('zebra', function (letter, i, exploded) {
|
7746 | return i % 2 === 0 ? letter : letter.inverse;
|
7747 | });
|
7748 |
|
7749 | exports.setTheme = function (theme) {
|
7750 | if (typeof theme === 'string') {
|
7751 | try {
|
7752 | exports.themes[theme] = __webpack_require__(50)(theme);
|
7753 | applyTheme(exports.themes[theme]);
|
7754 | return exports.themes[theme];
|
7755 | } catch (err) {
|
7756 | console.log(err);
|
7757 | return err;
|
7758 | }
|
7759 | } else {
|
7760 | applyTheme(theme);
|
7761 | }
|
7762 | };
|
7763 |
|
7764 |
|
7765 | addProperty('stripColors', function () {
|
7766 | return ("" + this).replace(/\x1B\[\d+m/g, '');
|
7767 | });
|
7768 |
|
7769 |
|
7770 | function zalgo(text, options) {
|
7771 | var soul = {
|
7772 | "up" : [
|
7773 | '̍', '̎', '̄', '̅',
|
7774 | '̿', '̑', '̆', '̐',
|
7775 | '͒', '͗', '͑', '̇',
|
7776 | '̈', '̊', '͂', '̓',
|
7777 | '̈', '͊', '͋', '͌',
|
7778 | '̃', '̂', '̌', '͐',
|
7779 | '̀', '́', '̋', '̏',
|
7780 | '̒', '̓', '̔', '̽',
|
7781 | '̉', 'ͣ', 'ͤ', 'ͥ',
|
7782 | 'ͦ', 'ͧ', 'ͨ', 'ͩ',
|
7783 | 'ͪ', 'ͫ', 'ͬ', 'ͭ',
|
7784 | 'ͮ', 'ͯ', '̾', '͛',
|
7785 | '͆', '̚'
|
7786 | ],
|
7787 | "down" : [
|
7788 | '̖', '̗', '̘', '̙',
|
7789 | '̜', '̝', '̞', '̟',
|
7790 | '̠', '̤', '̥', '̦',
|
7791 | '̩', '̪', '̫', '̬',
|
7792 | '̭', '̮', '̯', '̰',
|
7793 | '̱', '̲', '̳', '̹',
|
7794 | '̺', '̻', '̼', 'ͅ',
|
7795 | '͇', '͈', '͉', '͍',
|
7796 | '͎', '͓', '͔', '͕',
|
7797 | '͖', '͙', '͚', '̣'
|
7798 | ],
|
7799 | "mid" : [
|
7800 | '̕', '̛', '̀', '́',
|
7801 | '͘', '̡', '̢', '̧',
|
7802 | '̨', '̴', '̵', '̶',
|
7803 | '͜', '͝', '͞',
|
7804 | '͟', '͠', '͢', '̸',
|
7805 | '̷', '͡', ' ҉'
|
7806 | ]
|
7807 | },
|
7808 | all = [].concat(soul.up, soul.down, soul.mid),
|
7809 | zalgo = {};
|
7810 |
|
7811 | function randomNumber(range) {
|
7812 | var r = Math.floor(Math.random() * range);
|
7813 | return r;
|
7814 | }
|
7815 |
|
7816 | function is_char(character) {
|
7817 | var bool = false;
|
7818 | all.filter(function (i) {
|
7819 | bool = (i === character);
|
7820 | });
|
7821 | return bool;
|
7822 | }
|
7823 |
|
7824 | function heComes(text, options) {
|
7825 | var result = '', counts, l;
|
7826 | options = options || {};
|
7827 | options["up"] = options["up"] || true;
|
7828 | options["mid"] = options["mid"] || true;
|
7829 | options["down"] = options["down"] || true;
|
7830 | options["size"] = options["size"] || "maxi";
|
7831 | text = text.split('');
|
7832 | for (l in text) {
|
7833 | if (is_char(l)) {
|
7834 | continue;
|
7835 | }
|
7836 | result = result + text[l];
|
7837 | counts = {"up" : 0, "down" : 0, "mid" : 0};
|
7838 | switch (options.size) {
|
7839 | case 'mini':
|
7840 | counts.up = randomNumber(8);
|
7841 | counts.min = randomNumber(2);
|
7842 | counts.down = randomNumber(8);
|
7843 | break;
|
7844 | case 'maxi':
|
7845 | counts.up = randomNumber(16) + 3;
|
7846 | counts.min = randomNumber(4) + 1;
|
7847 | counts.down = randomNumber(64) + 3;
|
7848 | break;
|
7849 | default:
|
7850 | counts.up = randomNumber(8) + 1;
|
7851 | counts.mid = randomNumber(6) / 2;
|
7852 | counts.down = randomNumber(8) + 1;
|
7853 | break;
|
7854 | }
|
7855 |
|
7856 | var arr = ["up", "mid", "down"];
|
7857 | for (var d in arr) {
|
7858 | var index = arr[d];
|
7859 | for (var i = 0 ; i <= counts[index]; i++) {
|
7860 | if (options[index]) {
|
7861 | result = result + soul[index][randomNumber(soul[index].length)];
|
7862 | }
|
7863 | }
|
7864 | }
|
7865 | }
|
7866 | return result;
|
7867 | }
|
7868 | return heComes(text);
|
7869 | }
|
7870 |
|
7871 |
|
7872 |
|
7873 | addProperty('zalgo', function () {
|
7874 | return zalgo(this);
|
7875 | });
|
7876 |
|
7877 |
|
7878 | }),
|
7879 |
|
7880 | (function(module, exports) {
|
7881 |
|
7882 | function webpackEmptyContext(req) {
|
7883 | var e = new Error("Cannot find module '" + req + "'");
|
7884 | e.code = 'MODULE_NOT_FOUND';
|
7885 | throw e;
|
7886 | }
|
7887 | webpackEmptyContext.keys = function() { return []; };
|
7888 | webpackEmptyContext.resolve = webpackEmptyContext;
|
7889 | module.exports = webpackEmptyContext;
|
7890 | webpackEmptyContext.id = 50;
|
7891 |
|
7892 | }),
|
7893 |
|
7894 | (function(module, exports) {
|
7895 |
|
7896 | module.exports = require("events");
|
7897 |
|
7898 | }),
|
7899 |
|
7900 | (function(module, exports, __webpack_require__) {
|
7901 |
|
7902 | (function(module) {
|
7903 |
|
7904 |
|
7905 | var fs = __webpack_require__(40);
|
7906 | var util = __webpack_require__(48);
|
7907 |
|
7908 | function main() {
|
7909 | var neovim = false;
|
7910 | var fpath = ''
|
7911 | var args = process.argv;
|
7912 | if (args.length == 4) {
|
7913 | if (args[2] == '--neovim') {
|
7914 | neovim = true;
|
7915 | }
|
7916 | fpath = args[3];
|
7917 | } else if (args.length == 3) {
|
7918 | neovim = false;
|
7919 | fpath = args[2]
|
7920 | }
|
7921 | var r = new StringReader(viml_readfile(fpath));
|
7922 | var p = new VimLParser(neovim);
|
7923 | var c = new Compiler();
|
7924 | try {
|
7925 | var lines = c.compile(p.parse(r));
|
7926 | for (var i in lines) {
|
7927 | process.stdout.write(lines[i] + "\n");
|
7928 | }
|
7929 | } catch (e) {
|
7930 | process.stdout.write(e + '\n');
|
7931 | }
|
7932 | }
|
7933 |
|
7934 | var pat_vim2js = {
|
7935 | "[0-9a-zA-Z]" : "[0-9a-zA-Z]",
|
7936 | "[@*!=><&~#]" : "[@*!=><&~#]",
|
7937 | "\\<ARGOPT\\>" : "\\bARGOPT\\b",
|
7938 | "\\<BANG\\>" : "\\bBANG\\b",
|
7939 | "\\<EDITCMD\\>" : "\\bEDITCMD\\b",
|
7940 | "\\<NOTRLCOM\\>" : "\\bNOTRLCOM\\b",
|
7941 | "\\<TRLBAR\\>" : "\\bTRLBAR\\b",
|
7942 | "\\<USECTRLV\\>" : "\\bUSECTRLV\\b",
|
7943 | "\\<USERCMD\\>" : "\\bUSERCMD\\b",
|
7944 | "\\<\\(XFILE\\|FILES\\|FILE1\\)\\>" : "\\b(XFILE|FILES|FILE1)\\b",
|
7945 | "\\S" : "\\S",
|
7946 | "\\a" : "[A-Za-z]",
|
7947 | "\\d" : "\\d",
|
7948 | "\\h" : "[A-Za-z_]",
|
7949 | "\\s" : "\\s",
|
7950 | "\\v^d%[elete][lp]$" : "^d(elete|elet|ele|el|e)[lp]$",
|
7951 | "\\v^s%(c[^sr][^i][^p]|g|i[^mlg]|I|r[^e])" : "^s(c[^sr][^i][^p]|g|i[^mlg]|I|r[^e])",
|
7952 | "\\w" : "[0-9A-Za-z_]",
|
7953 | "\\w\\|[:#]" : "[0-9A-Za-z_]|[:#]",
|
7954 | "\\x" : "[0-9A-Fa-f]",
|
7955 | "^++" : "^\+\+",
|
7956 | "^++bad=\\(keep\\|drop\\|.\\)\\>" : "^\\+\\+bad=(keep|drop|.)\\b",
|
7957 | "^++bad=drop" : "^\\+\\+bad=drop",
|
7958 | "^++bad=keep" : "^\\+\\+bad=keep",
|
7959 | "^++bin\\>" : "^\\+\\+bin\\b",
|
7960 | "^++edit\\>" : "^\\+\\+edit\\b",
|
7961 | "^++enc=\\S" : "^\\+\\+enc=\\S",
|
7962 | "^++encoding=\\S" : "^\\+\\+encoding=\\S",
|
7963 | "^++ff=\\(dos\\|unix\\|mac\\)\\>" : "^\\+\\+ff=(dos|unix|mac)\\b",
|
7964 | "^++fileformat=\\(dos\\|unix\\|mac\\)\\>" : "^\\+\\+fileformat=(dos|unix|mac)\\b",
|
7965 | "^++nobin\\>" : "^\\+\\+nobin\\b",
|
7966 | "^[A-Z]" : "^[A-Z]",
|
7967 | "^\\$\\w\\+" : "^\\$[0-9A-Za-z_]+",
|
7968 | "^\\(!\\|global\\|vglobal\\)$" : "^(!|global|vglobal)$",
|
7969 | "^\\(WHILE\\|FOR\\)$" : "^(WHILE|FOR)$",
|
7970 | "^\\(vimgrep\\|vimgrepadd\\|lvimgrep\\|lvimgrepadd\\)$" : "^(vimgrep|vimgrepadd|lvimgrep|lvimgrepadd)$",
|
7971 | "^\\d" : "^\\d",
|
7972 | "^\\h" : "^[A-Za-z_]",
|
7973 | "^\\s" : "^\\s",
|
7974 | "^\\s*\\\\" : "^\\s*\\\\",
|
7975 | "^[ \\t]$" : "^[ \\t]$",
|
7976 | "^[A-Za-z]$" : "^[A-Za-z]$",
|
7977 | "^[0-9A-Za-z]$" : "^[0-9A-Za-z]$",
|
7978 | "^[0-9]$" : "^[0-9]$",
|
7979 | "^[0-9A-Fa-f]$" : "^[0-9A-Fa-f]$",
|
7980 | "^[0-9A-Za-z_]$" : "^[0-9A-Za-z_]$",
|
7981 | "^[A-Za-z_]$" : "^[A-Za-z_]$",
|
7982 | "^[0-9A-Za-z_:#]$" : "^[0-9A-Za-z_:#]$",
|
7983 | "^[A-Za-z_][0-9A-Za-z_]*$" : "^[A-Za-z_][0-9A-Za-z_]*$",
|
7984 | "^[A-Z]$" : "^[A-Z]$",
|
7985 | "^[a-z]$" : "^[a-z]$",
|
7986 | "^[vgslabwt]:$\\|^\\([vgslabwt]:\\)\\?[A-Za-z_][0-9A-Za-z_#]*$" : "^[vgslabwt]:$|^([vgslabwt]:)?[A-Za-z_][0-9A-Za-z_#]*$",
|
7987 | "^[0-7]$" : "^[0-7]$",
|
7988 | "^[0-9A-Fa-f][0-9A-Fa-f]$" : "^[0-9A-Fa-f][0-9A-Fa-f]$",
|
7989 | "^\\.[0-9A-Fa-f]$" : "^\\.[0-9A-Fa-f]$",
|
7990 | "^[0-9A-Fa-f][^0-9A-Fa-f]$" : "^[0-9A-Fa-f][^0-9A-Fa-f]$",
|
7991 | }
|
7992 |
|
7993 | function viml_add(lst, item) {
|
7994 | lst.push(item);
|
7995 | }
|
7996 |
|
7997 | function viml_call(func, args) {
|
7998 | return func.apply(null, args);
|
7999 | }
|
8000 |
|
8001 | function viml_char2nr(c) {
|
8002 | return c.charCodeAt(0);
|
8003 | }
|
8004 |
|
8005 | function viml_empty(obj) {
|
8006 | return obj.length == 0;
|
8007 | }
|
8008 |
|
8009 | function viml_equalci(a, b) {
|
8010 | return a.toLowerCase() == b.toLowerCase();
|
8011 | }
|
8012 |
|
8013 | function viml_eqreg(s, reg) {
|
8014 | var mx = new RegExp(pat_vim2js[reg]);
|
8015 | return mx.exec(s) != null;
|
8016 | }
|
8017 |
|
8018 | function viml_eqregh(s, reg) {
|
8019 | var mx = new RegExp(pat_vim2js[reg]);
|
8020 | return mx.exec(s) != null;
|
8021 | }
|
8022 |
|
8023 | function viml_eqregq(s, reg) {
|
8024 | var mx = new RegExp(pat_vim2js[reg], "i");
|
8025 | return mx.exec(s) != null;
|
8026 | }
|
8027 |
|
8028 | function viml_escape(s, chars) {
|
8029 | var r = '';
|
8030 | for (var i = 0; i < s.length; ++i) {
|
8031 | if (chars.indexOf(s.charAt(i)) != -1) {
|
8032 | r = r + "\\" + s.charAt(i);
|
8033 | } else {
|
8034 | r = r + s.charAt(i);
|
8035 | }
|
8036 | }
|
8037 | return r;
|
8038 | }
|
8039 |
|
8040 | function viml_extend(obj, item) {
|
8041 | obj.push.apply(obj, item);
|
8042 | }
|
8043 |
|
8044 | function viml_insert(lst, item) {
|
8045 | var idx = arguments.length >= 3 ? arguments[2] : 0;
|
8046 | lst.splice(0, 0, item);
|
8047 | }
|
8048 |
|
8049 | function viml_join(lst, sep) {
|
8050 | return lst.join(sep);
|
8051 | }
|
8052 |
|
8053 | function viml_keys(obj) {
|
8054 | return Object.keys(obj);
|
8055 | }
|
8056 |
|
8057 | function viml_len(obj) {
|
8058 | if (typeof obj === 'string') {
|
8059 | var len = 0;
|
8060 | for (var i = 0; i < obj.length; i++) {
|
8061 | var c = obj.charCodeAt(i);
|
8062 | len += c < 128 ? 1 : ((c > 127) && (c < 2048)) ? 2 : 3;
|
8063 | }
|
8064 | return len;
|
8065 | }
|
8066 | return obj.length;
|
8067 | }
|
8068 |
|
8069 | function viml_printf() {
|
8070 | var a000 = Array.prototype.slice.call(arguments, 0);
|
8071 | if (a000.length == 1) {
|
8072 | return a000[0];
|
8073 | } else {
|
8074 | return util.format.apply(null, a000);
|
8075 | }
|
8076 | }
|
8077 |
|
8078 | function viml_range(start) {
|
8079 | var end = arguments.length >= 2 ? arguments[1] : null;
|
8080 | if (end == null) {
|
8081 | var x = [];
|
8082 | for (var i = 0; i < start; ++i) {
|
8083 | x.push(i);
|
8084 | }
|
8085 | return x;
|
8086 | } else {
|
8087 | var x = []
|
8088 | for (var i = start; i <= end; ++i) {
|
8089 | x.push(i);
|
8090 | }
|
8091 | return x;
|
8092 | }
|
8093 | }
|
8094 |
|
8095 | function viml_readfile(path) {
|
8096 |
|
8097 | return fs.readFileSync(path, 'utf-8').split(/\r\n|\r|\n/);
|
8098 | }
|
8099 |
|
8100 | function viml_remove(lst, idx) {
|
8101 | lst.splice(idx, 1);
|
8102 | }
|
8103 |
|
8104 | function viml_split(s, sep) {
|
8105 | if (sep == "\\zs") {
|
8106 | return s.split("");
|
8107 | }
|
8108 | throw "NotImplemented";
|
8109 | }
|
8110 |
|
8111 | function viml_str2nr(s) {
|
8112 | var base = arguments.length >= 2 ? arguments[1] : 10;
|
8113 | return parseInt(s, base);
|
8114 | }
|
8115 |
|
8116 | function viml_string(obj) {
|
8117 | return obj.toString();
|
8118 | }
|
8119 |
|
8120 | function viml_has_key(obj, key) {
|
8121 | return obj[key] !== undefined;
|
8122 | }
|
8123 |
|
8124 | function viml_stridx(a, b) {
|
8125 | return a.indexOf(b);
|
8126 | }
|
8127 |
|
8128 | var NIL = [];
|
8129 | var TRUE = 1;
|
8130 | var FALSE = 0;
|
8131 | var NODE_TOPLEVEL = 1;
|
8132 | var NODE_COMMENT = 2;
|
8133 | var NODE_EXCMD = 3;
|
8134 | var NODE_FUNCTION = 4;
|
8135 | var NODE_ENDFUNCTION = 5;
|
8136 | var NODE_DELFUNCTION = 6;
|
8137 | var NODE_RETURN = 7;
|
8138 | var NODE_EXCALL = 8;
|
8139 | var NODE_LET = 9;
|
8140 | var NODE_UNLET = 10;
|
8141 | var NODE_LOCKVAR = 11;
|
8142 | var NODE_UNLOCKVAR = 12;
|
8143 | var NODE_IF = 13;
|
8144 | var NODE_ELSEIF = 14;
|
8145 | var NODE_ELSE = 15;
|
8146 | var NODE_ENDIF = 16;
|
8147 | var NODE_WHILE = 17;
|
8148 | var NODE_ENDWHILE = 18;
|
8149 | var NODE_FOR = 19;
|
8150 | var NODE_ENDFOR = 20;
|
8151 | var NODE_CONTINUE = 21;
|
8152 | var NODE_BREAK = 22;
|
8153 | var NODE_TRY = 23;
|
8154 | var NODE_CATCH = 24;
|
8155 | var NODE_FINALLY = 25;
|
8156 | var NODE_ENDTRY = 26;
|
8157 | var NODE_THROW = 27;
|
8158 | var NODE_ECHO = 28;
|
8159 | var NODE_ECHON = 29;
|
8160 | var NODE_ECHOHL = 30;
|
8161 | var NODE_ECHOMSG = 31;
|
8162 | var NODE_ECHOERR = 32;
|
8163 | var NODE_EXECUTE = 33;
|
8164 | var NODE_TERNARY = 34;
|
8165 | var NODE_OR = 35;
|
8166 | var NODE_AND = 36;
|
8167 | var NODE_EQUAL = 37;
|
8168 | var NODE_EQUALCI = 38;
|
8169 | var NODE_EQUALCS = 39;
|
8170 | var NODE_NEQUAL = 40;
|
8171 | var NODE_NEQUALCI = 41;
|
8172 | var NODE_NEQUALCS = 42;
|
8173 | var NODE_GREATER = 43;
|
8174 | var NODE_GREATERCI = 44;
|
8175 | var NODE_GREATERCS = 45;
|
8176 | var NODE_GEQUAL = 46;
|
8177 | var NODE_GEQUALCI = 47;
|
8178 | var NODE_GEQUALCS = 48;
|
8179 | var NODE_SMALLER = 49;
|
8180 | var NODE_SMALLERCI = 50;
|
8181 | var NODE_SMALLERCS = 51;
|
8182 | var NODE_SEQUAL = 52;
|
8183 | var NODE_SEQUALCI = 53;
|
8184 | var NODE_SEQUALCS = 54;
|
8185 | var NODE_MATCH = 55;
|
8186 | var NODE_MATCHCI = 56;
|
8187 | var NODE_MATCHCS = 57;
|
8188 | var NODE_NOMATCH = 58;
|
8189 | var NODE_NOMATCHCI = 59;
|
8190 | var NODE_NOMATCHCS = 60;
|
8191 | var NODE_IS = 61;
|
8192 | var NODE_ISCI = 62;
|
8193 | var NODE_ISCS = 63;
|
8194 | var NODE_ISNOT = 64;
|
8195 | var NODE_ISNOTCI = 65;
|
8196 | var NODE_ISNOTCS = 66;
|
8197 | var NODE_ADD = 67;
|
8198 | var NODE_SUBTRACT = 68;
|
8199 | var NODE_CONCAT = 69;
|
8200 | var NODE_MULTIPLY = 70;
|
8201 | var NODE_DIVIDE = 71;
|
8202 | var NODE_REMAINDER = 72;
|
8203 | var NODE_NOT = 73;
|
8204 | var NODE_MINUS = 74;
|
8205 | var NODE_PLUS = 75;
|
8206 | var NODE_SUBSCRIPT = 76;
|
8207 | var NODE_SLICE = 77;
|
8208 | var NODE_CALL = 78;
|
8209 | var NODE_DOT = 79;
|
8210 | var NODE_NUMBER = 80;
|
8211 | var NODE_STRING = 81;
|
8212 | var NODE_LIST = 82;
|
8213 | var NODE_DICT = 83;
|
8214 | var NODE_OPTION = 85;
|
8215 | var NODE_IDENTIFIER = 86;
|
8216 | var NODE_CURLYNAME = 87;
|
8217 | var NODE_ENV = 88;
|
8218 | var NODE_REG = 89;
|
8219 | var NODE_CURLYNAMEPART = 90;
|
8220 | var NODE_CURLYNAMEEXPR = 91;
|
8221 | var NODE_LAMBDA = 92;
|
8222 | var NODE_BLOB = 93;
|
8223 | var NODE_CONST = 94;
|
8224 | var NODE_EVAL = 95;
|
8225 | var NODE_HEREDOC = 96;
|
8226 | var NODE_METHOD = 97;
|
8227 | var TOKEN_EOF = 1;
|
8228 | var TOKEN_EOL = 2;
|
8229 | var TOKEN_SPACE = 3;
|
8230 | var TOKEN_OROR = 4;
|
8231 | var TOKEN_ANDAND = 5;
|
8232 | var TOKEN_EQEQ = 6;
|
8233 | var TOKEN_EQEQCI = 7;
|
8234 | var TOKEN_EQEQCS = 8;
|
8235 | var TOKEN_NEQ = 9;
|
8236 | var TOKEN_NEQCI = 10;
|
8237 | var TOKEN_NEQCS = 11;
|
8238 | var TOKEN_GT = 12;
|
8239 | var TOKEN_GTCI = 13;
|
8240 | var TOKEN_GTCS = 14;
|
8241 | var TOKEN_GTEQ = 15;
|
8242 | var TOKEN_GTEQCI = 16;
|
8243 | var TOKEN_GTEQCS = 17;
|
8244 | var TOKEN_LT = 18;
|
8245 | var TOKEN_LTCI = 19;
|
8246 | var TOKEN_LTCS = 20;
|
8247 | var TOKEN_LTEQ = 21;
|
8248 | var TOKEN_LTEQCI = 22;
|
8249 | var TOKEN_LTEQCS = 23;
|
8250 | var TOKEN_MATCH = 24;
|
8251 | var TOKEN_MATCHCI = 25;
|
8252 | var TOKEN_MATCHCS = 26;
|
8253 | var TOKEN_NOMATCH = 27;
|
8254 | var TOKEN_NOMATCHCI = 28;
|
8255 | var TOKEN_NOMATCHCS = 29;
|
8256 | var TOKEN_IS = 30;
|
8257 | var TOKEN_ISCI = 31;
|
8258 | var TOKEN_ISCS = 32;
|
8259 | var TOKEN_ISNOT = 33;
|
8260 | var TOKEN_ISNOTCI = 34;
|
8261 | var TOKEN_ISNOTCS = 35;
|
8262 | var TOKEN_PLUS = 36;
|
8263 | var TOKEN_MINUS = 37;
|
8264 | var TOKEN_DOT = 38;
|
8265 | var TOKEN_STAR = 39;
|
8266 | var TOKEN_SLASH = 40;
|
8267 | var TOKEN_PERCENT = 41;
|
8268 | var TOKEN_NOT = 42;
|
8269 | var TOKEN_QUESTION = 43;
|
8270 | var TOKEN_COLON = 44;
|
8271 | var TOKEN_POPEN = 45;
|
8272 | var TOKEN_PCLOSE = 46;
|
8273 | var TOKEN_SQOPEN = 47;
|
8274 | var TOKEN_SQCLOSE = 48;
|
8275 | var TOKEN_COPEN = 49;
|
8276 | var TOKEN_CCLOSE = 50;
|
8277 | var TOKEN_COMMA = 51;
|
8278 | var TOKEN_NUMBER = 52;
|
8279 | var TOKEN_SQUOTE = 53;
|
8280 | var TOKEN_DQUOTE = 54;
|
8281 | var TOKEN_OPTION = 55;
|
8282 | var TOKEN_IDENTIFIER = 56;
|
8283 | var TOKEN_ENV = 57;
|
8284 | var TOKEN_REG = 58;
|
8285 | var TOKEN_EQ = 59;
|
8286 | var TOKEN_OR = 60;
|
8287 | var TOKEN_SEMICOLON = 61;
|
8288 | var TOKEN_BACKTICK = 62;
|
8289 | var TOKEN_DOTDOTDOT = 63;
|
8290 | var TOKEN_SHARP = 64;
|
8291 | var TOKEN_ARROW = 65;
|
8292 | var TOKEN_BLOB = 66;
|
8293 | var TOKEN_LITCOPEN = 67;
|
8294 | var TOKEN_DOTDOT = 68;
|
8295 | var TOKEN_HEREDOC = 69;
|
8296 | var MAX_FUNC_ARGS = 20;
|
8297 | function isalpha(c) {
|
8298 | return viml_eqregh(c, "^[A-Za-z]$");
|
8299 | }
|
8300 |
|
8301 | function isalnum(c) {
|
8302 | return viml_eqregh(c, "^[0-9A-Za-z]$");
|
8303 | }
|
8304 |
|
8305 | function isdigit(c) {
|
8306 | return viml_eqregh(c, "^[0-9]$");
|
8307 | }
|
8308 |
|
8309 | function isodigit(c) {
|
8310 | return viml_eqregh(c, "^[0-7]$");
|
8311 | }
|
8312 |
|
8313 | function isxdigit(c) {
|
8314 | return viml_eqregh(c, "^[0-9A-Fa-f]$");
|
8315 | }
|
8316 |
|
8317 | function iswordc(c) {
|
8318 | return viml_eqregh(c, "^[0-9A-Za-z_]$");
|
8319 | }
|
8320 |
|
8321 | function iswordc1(c) {
|
8322 | return viml_eqregh(c, "^[A-Za-z_]$");
|
8323 | }
|
8324 |
|
8325 | function iswhite(c) {
|
8326 | return viml_eqregh(c, "^[ \\t]$");
|
8327 | }
|
8328 |
|
8329 | function isnamec(c) {
|
8330 | return viml_eqregh(c, "^[0-9A-Za-z_:#]$");
|
8331 | }
|
8332 |
|
8333 | function isnamec1(c) {
|
8334 | return viml_eqregh(c, "^[A-Za-z_]$");
|
8335 | }
|
8336 |
|
8337 | function isargname(s) {
|
8338 | return viml_eqregh(s, "^[A-Za-z_][0-9A-Za-z_]*$");
|
8339 | }
|
8340 |
|
8341 | function isvarname(s) {
|
8342 | return viml_eqregh(s, "^[vgslabwt]:$\\|^\\([vgslabwt]:\\)\\?[A-Za-z_][0-9A-Za-z_#]*$");
|
8343 | }
|
8344 |
|
8345 |
|
8346 | function isidc(c) {
|
8347 | return viml_eqregh(c, "^[0-9A-Za-z_]$");
|
8348 | }
|
8349 |
|
8350 | function isupper(c) {
|
8351 | return viml_eqregh(c, "^[A-Z]$");
|
8352 | }
|
8353 |
|
8354 | function islower(c) {
|
8355 | return viml_eqregh(c, "^[a-z]$");
|
8356 | }
|
8357 |
|
8358 | function ExArg() {
|
8359 | var ea = {};
|
8360 | ea.forceit = FALSE;
|
8361 | ea.addr_count = 0;
|
8362 | ea.line1 = 0;
|
8363 | ea.line2 = 0;
|
8364 | ea.flags = 0;
|
8365 | ea.do_ecmd_cmd = "";
|
8366 | ea.do_ecmd_lnum = 0;
|
8367 | ea.append = 0;
|
8368 | ea.usefilter = FALSE;
|
8369 | ea.amount = 0;
|
8370 | ea.regname = 0;
|
8371 | ea.force_bin = 0;
|
8372 | ea.read_edit = 0;
|
8373 | ea.force_ff = 0;
|
8374 | ea.force_enc = 0;
|
8375 | ea.bad_char = 0;
|
8376 | ea.linepos = {};
|
8377 | ea.cmdpos = [];
|
8378 | ea.argpos = [];
|
8379 | ea.cmd = {};
|
8380 | ea.modifiers = [];
|
8381 | ea.range = [];
|
8382 | ea.argopt = {};
|
8383 | ea.argcmd = {};
|
8384 | return ea;
|
8385 | }
|
8386 |
|
8387 |
|
8388 |
|
8389 |
|
8390 |
|
8391 |
|
8392 |
|
8393 |
|
8394 |
|
8395 |
|
8396 |
|
8397 |
|
8398 |
|
8399 |
|
8400 |
|
8401 |
|
8402 |
|
8403 |
|
8404 |
|
8405 |
|
8406 |
|
8407 |
|
8408 |
|
8409 |
|
8410 |
|
8411 |
|
8412 |
|
8413 |
|
8414 |
|
8415 |
|
8416 |
|
8417 |
|
8418 |
|
8419 |
|
8420 |
|
8421 |
|
8422 |
|
8423 |
|
8424 |
|
8425 |
|
8426 |
|
8427 |
|
8428 |
|
8429 |
|
8430 |
|
8431 |
|
8432 |
|
8433 |
|
8434 |
|
8435 |
|
8436 |
|
8437 |
|
8438 |
|
8439 |
|
8440 |
|
8441 |
|
8442 |
|
8443 |
|
8444 |
|
8445 |
|
8446 |
|
8447 |
|
8448 |
|
8449 |
|
8450 |
|
8451 |
|
8452 |
|
8453 |
|
8454 |
|
8455 |
|
8456 |
|
8457 |
|
8458 |
|
8459 |
|
8460 |
|
8461 |
|
8462 |
|
8463 |
|
8464 |
|
8465 |
|
8466 |
|
8467 |
|
8468 |
|
8469 |
|
8470 |
|
8471 |
|
8472 |
|
8473 |
|
8474 |
|
8475 |
|
8476 |
|
8477 |
|
8478 |
|
8479 |
|
8480 |
|
8481 |
|
8482 |
|
8483 |
|
8484 |
|
8485 |
|
8486 |
|
8487 |
|
8488 |
|
8489 |
|
8490 |
|
8491 |
|
8492 |
|
8493 |
|
8494 |
|
8495 |
|
8496 |
|
8497 |
|
8498 |
|
8499 |
|
8500 | function Node(type) {
|
8501 | return {"type":type};
|
8502 | }
|
8503 |
|
8504 | function Err(msg, pos) {
|
8505 | return viml_printf("vimlparser: %s: line %d col %d", msg, pos.lnum, pos.col);
|
8506 | }
|
8507 |
|
8508 | function VimLParser() { this.__init__.apply(this, arguments); }
|
8509 | VimLParser.prototype.__init__ = function() {
|
8510 | var a000 = Array.prototype.slice.call(arguments, 0);
|
8511 | if (viml_len(a000) > 0) {
|
8512 | this.neovim = a000[0];
|
8513 | }
|
8514 | else {
|
8515 | this.neovim = 0;
|
8516 | }
|
8517 | this.find_command_cache = {};
|
8518 | }
|
8519 |
|
8520 | VimLParser.prototype.push_context = function(node) {
|
8521 | viml_insert(this.context, node);
|
8522 | }
|
8523 |
|
8524 | VimLParser.prototype.pop_context = function() {
|
8525 | viml_remove(this.context, 0);
|
8526 | }
|
8527 |
|
8528 | VimLParser.prototype.find_context = function(type) {
|
8529 | var i = 0;
|
8530 | var __c3 = this.context;
|
8531 | for (var __i3 = 0; __i3 < __c3.length; ++__i3) {
|
8532 | var node = __c3[__i3];
|
8533 | if (node.type == type) {
|
8534 | return i;
|
8535 | }
|
8536 | i += 1;
|
8537 | }
|
8538 | return -1;
|
8539 | }
|
8540 |
|
8541 | VimLParser.prototype.add_node = function(node) {
|
8542 | viml_add(this.context[0].body, node);
|
8543 | }
|
8544 |
|
8545 | VimLParser.prototype.check_missing_endfunction = function(ends, pos) {
|
8546 | if (this.context[0].type == NODE_FUNCTION) {
|
8547 | throw Err(viml_printf("E126: Missing :endfunction: %s", ends), pos);
|
8548 | }
|
8549 | }
|
8550 |
|
8551 | VimLParser.prototype.check_missing_endif = function(ends, pos) {
|
8552 | if (this.context[0].type == NODE_IF || this.context[0].type == NODE_ELSEIF || this.context[0].type == NODE_ELSE) {
|
8553 | throw Err(viml_printf("E171: Missing :endif: %s", ends), pos);
|
8554 | }
|
8555 | }
|
8556 |
|
8557 | VimLParser.prototype.check_missing_endtry = function(ends, pos) {
|
8558 | if (this.context[0].type == NODE_TRY || this.context[0].type == NODE_CATCH || this.context[0].type == NODE_FINALLY) {
|
8559 | throw Err(viml_printf("E600: Missing :endtry: %s", ends), pos);
|
8560 | }
|
8561 | }
|
8562 |
|
8563 | VimLParser.prototype.check_missing_endwhile = function(ends, pos) {
|
8564 | if (this.context[0].type == NODE_WHILE) {
|
8565 | throw Err(viml_printf("E170: Missing :endwhile: %s", ends), pos);
|
8566 | }
|
8567 | }
|
8568 |
|
8569 | VimLParser.prototype.check_missing_endfor = function(ends, pos) {
|
8570 | if (this.context[0].type == NODE_FOR) {
|
8571 | throw Err(viml_printf("E170: Missing :endfor: %s", ends), pos);
|
8572 | }
|
8573 | }
|
8574 |
|
8575 | VimLParser.prototype.parse = function(reader) {
|
8576 | this.reader = reader;
|
8577 | this.context = [];
|
8578 | var toplevel = Node(NODE_TOPLEVEL);
|
8579 | toplevel.pos = this.reader.getpos();
|
8580 | toplevel.body = [];
|
8581 | this.push_context(toplevel);
|
8582 | while (this.reader.peek() != "<EOF>") {
|
8583 | this.parse_one_cmd();
|
8584 | }
|
8585 | this.check_missing_endfunction("TOPLEVEL", this.reader.getpos());
|
8586 | this.check_missing_endif("TOPLEVEL", this.reader.getpos());
|
8587 | this.check_missing_endtry("TOPLEVEL", this.reader.getpos());
|
8588 | this.check_missing_endwhile("TOPLEVEL", this.reader.getpos());
|
8589 | this.check_missing_endfor("TOPLEVEL", this.reader.getpos());
|
8590 | this.pop_context();
|
8591 | return toplevel;
|
8592 | }
|
8593 |
|
8594 | VimLParser.prototype.parse_one_cmd = function() {
|
8595 | this.ea = ExArg();
|
8596 | if (this.reader.peekn(2) == "#!") {
|
8597 | this.parse_hashbang();
|
8598 | this.reader.get();
|
8599 | return;
|
8600 | }
|
8601 | this.reader.skip_white_and_colon();
|
8602 | if (this.reader.peekn(1) == "") {
|
8603 | this.reader.get();
|
8604 | return;
|
8605 | }
|
8606 | if (this.reader.peekn(1) == "\"") {
|
8607 | this.parse_comment();
|
8608 | this.reader.get();
|
8609 | return;
|
8610 | }
|
8611 | this.ea.linepos = this.reader.getpos();
|
8612 | this.parse_command_modifiers();
|
8613 | this.parse_range();
|
8614 | this.parse_command();
|
8615 | this.parse_trail();
|
8616 | }
|
8617 |
|
8618 |
|
8619 | VimLParser.prototype.parse_command_modifiers = function() {
|
8620 | var modifiers = [];
|
8621 | while (TRUE) {
|
8622 | var pos = this.reader.tell();
|
8623 | var d = "";
|
8624 | if (isdigit(this.reader.peekn(1))) {
|
8625 | var d = this.reader.read_digit();
|
8626 | this.reader.skip_white();
|
8627 | }
|
8628 | var k = this.reader.read_alpha();
|
8629 | var c = this.reader.peekn(1);
|
8630 | this.reader.skip_white();
|
8631 | if (viml_stridx("aboveleft", k) == 0 && viml_len(k) >= 3) {
|
8632 |
|
8633 | viml_add(modifiers, {"name":"aboveleft"});
|
8634 | }
|
8635 | else if (viml_stridx("belowright", k) == 0 && viml_len(k) >= 3) {
|
8636 |
|
8637 | viml_add(modifiers, {"name":"belowright"});
|
8638 | }
|
8639 | else if (viml_stridx("browse", k) == 0 && viml_len(k) >= 3) {
|
8640 |
|
8641 | viml_add(modifiers, {"name":"browse"});
|
8642 | }
|
8643 | else if (viml_stridx("botright", k) == 0 && viml_len(k) >= 2) {
|
8644 |
|
8645 | viml_add(modifiers, {"name":"botright"});
|
8646 | }
|
8647 | else if (viml_stridx("confirm", k) == 0 && viml_len(k) >= 4) {
|
8648 |
|
8649 | viml_add(modifiers, {"name":"confirm"});
|
8650 | }
|
8651 | else if (viml_stridx("keepmarks", k) == 0 && viml_len(k) >= 3) {
|
8652 |
|
8653 | viml_add(modifiers, {"name":"keepmarks"});
|
8654 | }
|
8655 | else if (viml_stridx("keepalt", k) == 0 && viml_len(k) >= 5) {
|
8656 |
|
8657 | viml_add(modifiers, {"name":"keepalt"});
|
8658 | }
|
8659 | else if (viml_stridx("keepjumps", k) == 0 && viml_len(k) >= 5) {
|
8660 |
|
8661 | viml_add(modifiers, {"name":"keepjumps"});
|
8662 | }
|
8663 | else if (viml_stridx("keeppatterns", k) == 0 && viml_len(k) >= 5) {
|
8664 |
|
8665 | viml_add(modifiers, {"name":"keeppatterns"});
|
8666 | }
|
8667 | else if (viml_stridx("hide", k) == 0 && viml_len(k) >= 3) {
|
8668 |
|
8669 | if (this.ends_excmds(c)) {
|
8670 | break;
|
8671 | }
|
8672 | viml_add(modifiers, {"name":"hide"});
|
8673 | }
|
8674 | else if (viml_stridx("lockmarks", k) == 0 && viml_len(k) >= 3) {
|
8675 |
|
8676 | viml_add(modifiers, {"name":"lockmarks"});
|
8677 | }
|
8678 | else if (viml_stridx("leftabove", k) == 0 && viml_len(k) >= 5) {
|
8679 |
|
8680 | viml_add(modifiers, {"name":"leftabove"});
|
8681 | }
|
8682 | else if (viml_stridx("noautocmd", k) == 0 && viml_len(k) >= 3) {
|
8683 |
|
8684 | viml_add(modifiers, {"name":"noautocmd"});
|
8685 | }
|
8686 | else if (viml_stridx("noswapfile", k) == 0 && viml_len(k) >= 3) {
|
8687 |
|
8688 | viml_add(modifiers, {"name":"noswapfile"});
|
8689 | }
|
8690 | else if (viml_stridx("rightbelow", k) == 0 && viml_len(k) >= 6) {
|
8691 |
|
8692 | viml_add(modifiers, {"name":"rightbelow"});
|
8693 | }
|
8694 | else if (viml_stridx("sandbox", k) == 0 && viml_len(k) >= 3) {
|
8695 |
|
8696 | viml_add(modifiers, {"name":"sandbox"});
|
8697 | }
|
8698 | else if (viml_stridx("silent", k) == 0 && viml_len(k) >= 3) {
|
8699 |
|
8700 | if (c == "!") {
|
8701 | this.reader.get();
|
8702 | viml_add(modifiers, {"name":"silent", "bang":1});
|
8703 | }
|
8704 | else {
|
8705 | viml_add(modifiers, {"name":"silent", "bang":0});
|
8706 | }
|
8707 | }
|
8708 | else if (k == "tab") {
|
8709 |
|
8710 | if (d != "") {
|
8711 | viml_add(modifiers, {"name":"tab", "count":viml_str2nr(d, 10)});
|
8712 | }
|
8713 | else {
|
8714 | viml_add(modifiers, {"name":"tab"});
|
8715 | }
|
8716 | }
|
8717 | else if (viml_stridx("topleft", k) == 0 && viml_len(k) >= 2) {
|
8718 |
|
8719 | viml_add(modifiers, {"name":"topleft"});
|
8720 | }
|
8721 | else if (viml_stridx("unsilent", k) == 0 && viml_len(k) >= 3) {
|
8722 |
|
8723 | viml_add(modifiers, {"name":"unsilent"});
|
8724 | }
|
8725 | else if (viml_stridx("vertical", k) == 0 && viml_len(k) >= 4) {
|
8726 |
|
8727 | viml_add(modifiers, {"name":"vertical"});
|
8728 | }
|
8729 | else if (viml_stridx("verbose", k) == 0 && viml_len(k) >= 4) {
|
8730 |
|
8731 | if (d != "") {
|
8732 | viml_add(modifiers, {"name":"verbose", "count":viml_str2nr(d, 10)});
|
8733 | }
|
8734 | else {
|
8735 | viml_add(modifiers, {"name":"verbose", "count":1});
|
8736 | }
|
8737 | }
|
8738 | else {
|
8739 | this.reader.seek_set(pos);
|
8740 | break;
|
8741 | }
|
8742 | }
|
8743 | this.ea.modifiers = modifiers;
|
8744 | }
|
8745 |
|
8746 |
|
8747 | VimLParser.prototype.parse_range = function() {
|
8748 | var tokens = [];
|
8749 | while (TRUE) {
|
8750 | while (TRUE) {
|
8751 | this.reader.skip_white();
|
8752 | var c = this.reader.peekn(1);
|
8753 | if (c == "") {
|
8754 | break;
|
8755 | }
|
8756 | if (c == ".") {
|
8757 | viml_add(tokens, this.reader.getn(1));
|
8758 | }
|
8759 | else if (c == "$") {
|
8760 | viml_add(tokens, this.reader.getn(1));
|
8761 | }
|
8762 | else if (c == "'") {
|
8763 | this.reader.getn(1);
|
8764 | var m = this.reader.getn(1);
|
8765 | if (m == "") {
|
8766 | break;
|
8767 | }
|
8768 | viml_add(tokens, "'" + m);
|
8769 | }
|
8770 | else if (c == "/") {
|
8771 | this.reader.getn(1);
|
8772 | var __tmp = this.parse_pattern(c);
|
8773 | var pattern = __tmp[0];
|
8774 | var _ = __tmp[1];
|
8775 | viml_add(tokens, pattern);
|
8776 | }
|
8777 | else if (c == "?") {
|
8778 | this.reader.getn(1);
|
8779 | var __tmp = this.parse_pattern(c);
|
8780 | var pattern = __tmp[0];
|
8781 | var _ = __tmp[1];
|
8782 | viml_add(tokens, pattern);
|
8783 | }
|
8784 | else if (c == "\\") {
|
8785 | var m = this.reader.p(1);
|
8786 | if (m == "&" || m == "?" || m == "/") {
|
8787 | this.reader.seek_cur(2);
|
8788 | viml_add(tokens, "\\" + m);
|
8789 | }
|
8790 | else {
|
8791 | throw Err("E10: \\\\ should be followed by /, ? or &", this.reader.getpos());
|
8792 | }
|
8793 | }
|
8794 | else if (isdigit(c)) {
|
8795 | viml_add(tokens, this.reader.read_digit());
|
8796 | }
|
8797 | while (TRUE) {
|
8798 | this.reader.skip_white();
|
8799 | if (this.reader.peekn(1) == "") {
|
8800 | break;
|
8801 | }
|
8802 | var n = this.reader.read_integer();
|
8803 | if (n == "") {
|
8804 | break;
|
8805 | }
|
8806 | viml_add(tokens, n);
|
8807 | }
|
8808 | if (this.reader.p(0) != "/" && this.reader.p(0) != "?") {
|
8809 | break;
|
8810 | }
|
8811 | }
|
8812 | if (this.reader.peekn(1) == "%") {
|
8813 | viml_add(tokens, this.reader.getn(1));
|
8814 | }
|
8815 | else if (this.reader.peekn(1) == "*") {
|
8816 |
|
8817 | viml_add(tokens, this.reader.getn(1));
|
8818 | }
|
8819 | if (this.reader.peekn(1) == ";") {
|
8820 | viml_add(tokens, this.reader.getn(1));
|
8821 | continue;
|
8822 | }
|
8823 | else if (this.reader.peekn(1) == ",") {
|
8824 | viml_add(tokens, this.reader.getn(1));
|
8825 | continue;
|
8826 | }
|
8827 | break;
|
8828 | }
|
8829 | this.ea.range = tokens;
|
8830 | }
|
8831 |
|
8832 |
|
8833 | VimLParser.prototype.parse_pattern = function(delimiter) {
|
8834 | var pattern = "";
|
8835 | var endc = "";
|
8836 | var inbracket = 0;
|
8837 | while (TRUE) {
|
8838 | var c = this.reader.getn(1);
|
8839 | if (c == "") {
|
8840 | break;
|
8841 | }
|
8842 | if (c == delimiter && inbracket == 0) {
|
8843 | var endc = c;
|
8844 | break;
|
8845 | }
|
8846 | pattern += c;
|
8847 | if (c == "\\") {
|
8848 | var c = this.reader.peekn(1);
|
8849 | if (c == "") {
|
8850 | throw Err("E682: Invalid search pattern or delimiter", this.reader.getpos());
|
8851 | }
|
8852 | this.reader.getn(1);
|
8853 | pattern += c;
|
8854 | }
|
8855 | else if (c == "[") {
|
8856 | inbracket += 1;
|
8857 | }
|
8858 | else if (c == "]") {
|
8859 | inbracket -= 1;
|
8860 | }
|
8861 | }
|
8862 | return [pattern, endc];
|
8863 | }
|
8864 |
|
8865 | VimLParser.prototype.parse_command = function() {
|
8866 | this.reader.skip_white_and_colon();
|
8867 | this.ea.cmdpos = this.reader.getpos();
|
8868 | if (this.reader.peekn(1) == "" || this.reader.peekn(1) == "\"") {
|
8869 | if (!viml_empty(this.ea.modifiers) || !viml_empty(this.ea.range)) {
|
8870 | this.parse_cmd_modifier_range();
|
8871 | }
|
8872 | return;
|
8873 | }
|
8874 | this.ea.cmd = this.find_command();
|
8875 | if (this.ea.cmd === NIL) {
|
8876 | this.reader.setpos(this.ea.cmdpos);
|
8877 | throw Err(viml_printf("E492: Not an editor command: %s", this.reader.peekline()), this.ea.cmdpos);
|
8878 | }
|
8879 | if (this.reader.peekn(1) == "!" && this.ea.cmd.name != "substitute" && this.ea.cmd.name != "smagic" && this.ea.cmd.name != "snomagic") {
|
8880 | this.reader.getn(1);
|
8881 | this.ea.forceit = TRUE;
|
8882 | }
|
8883 | else {
|
8884 | this.ea.forceit = FALSE;
|
8885 | }
|
8886 | if (!viml_eqregh(this.ea.cmd.flags, "\\<BANG\\>") && this.ea.forceit && !viml_eqregh(this.ea.cmd.flags, "\\<USERCMD\\>")) {
|
8887 | throw Err("E477: No ! allowed", this.ea.cmdpos);
|
8888 | }
|
8889 | if (this.ea.cmd.name != "!") {
|
8890 | this.reader.skip_white();
|
8891 | }
|
8892 | this.ea.argpos = this.reader.getpos();
|
8893 | if (viml_eqregh(this.ea.cmd.flags, "\\<ARGOPT\\>")) {
|
8894 | this.parse_argopt();
|
8895 | }
|
8896 | if (this.ea.cmd.name == "write" || this.ea.cmd.name == "update") {
|
8897 | if (this.reader.p(0) == ">") {
|
8898 | if (this.reader.p(1) != ">") {
|
8899 | throw Err("E494: Use w or w>>", this.ea.cmdpos);
|
8900 | }
|
8901 | this.reader.seek_cur(2);
|
8902 | this.reader.skip_white();
|
8903 | this.ea.append = 1;
|
8904 | }
|
8905 | else if (this.reader.peekn(1) == "!" && this.ea.cmd.name == "write") {
|
8906 | this.reader.getn(1);
|
8907 | this.ea.usefilter = TRUE;
|
8908 | }
|
8909 | }
|
8910 | if (this.ea.cmd.name == "read") {
|
8911 | if (this.ea.forceit) {
|
8912 | this.ea.usefilter = TRUE;
|
8913 | this.ea.forceit = FALSE;
|
8914 | }
|
8915 | else if (this.reader.peekn(1) == "!") {
|
8916 | this.reader.getn(1);
|
8917 | this.ea.usefilter = TRUE;
|
8918 | }
|
8919 | }
|
8920 | if (this.ea.cmd.name == "<" || this.ea.cmd.name == ">") {
|
8921 | this.ea.amount = 1;
|
8922 | while (this.reader.peekn(1) == this.ea.cmd.name) {
|
8923 | this.reader.getn(1);
|
8924 | this.ea.amount += 1;
|
8925 | }
|
8926 | this.reader.skip_white();
|
8927 | }
|
8928 | if (viml_eqregh(this.ea.cmd.flags, "\\<EDITCMD\\>") && !this.ea.usefilter) {
|
8929 | this.parse_argcmd();
|
8930 | }
|
8931 | this._parse_command(this.ea.cmd.parser);
|
8932 | }
|
8933 |
|
8934 |
|
8935 | VimLParser.prototype._parse_command = function(parser) {
|
8936 | if (parser == "parse_cmd_append") {
|
8937 | this.parse_cmd_append();
|
8938 | }
|
8939 | else if (parser == "parse_cmd_break") {
|
8940 | this.parse_cmd_break();
|
8941 | }
|
8942 | else if (parser == "parse_cmd_call") {
|
8943 | this.parse_cmd_call();
|
8944 | }
|
8945 | else if (parser == "parse_cmd_catch") {
|
8946 | this.parse_cmd_catch();
|
8947 | }
|
8948 | else if (parser == "parse_cmd_common") {
|
8949 | this.parse_cmd_common();
|
8950 | }
|
8951 | else if (parser == "parse_cmd_continue") {
|
8952 | this.parse_cmd_continue();
|
8953 | }
|
8954 | else if (parser == "parse_cmd_delfunction") {
|
8955 | this.parse_cmd_delfunction();
|
8956 | }
|
8957 | else if (parser == "parse_cmd_echo") {
|
8958 | this.parse_cmd_echo();
|
8959 | }
|
8960 | else if (parser == "parse_cmd_echoerr") {
|
8961 | this.parse_cmd_echoerr();
|
8962 | }
|
8963 | else if (parser == "parse_cmd_echohl") {
|
8964 | this.parse_cmd_echohl();
|
8965 | }
|
8966 | else if (parser == "parse_cmd_echomsg") {
|
8967 | this.parse_cmd_echomsg();
|
8968 | }
|
8969 | else if (parser == "parse_cmd_echon") {
|
8970 | this.parse_cmd_echon();
|
8971 | }
|
8972 | else if (parser == "parse_cmd_else") {
|
8973 | this.parse_cmd_else();
|
8974 | }
|
8975 | else if (parser == "parse_cmd_elseif") {
|
8976 | this.parse_cmd_elseif();
|
8977 | }
|
8978 | else if (parser == "parse_cmd_endfor") {
|
8979 | this.parse_cmd_endfor();
|
8980 | }
|
8981 | else if (parser == "parse_cmd_endfunction") {
|
8982 | this.parse_cmd_endfunction();
|
8983 | }
|
8984 | else if (parser == "parse_cmd_endif") {
|
8985 | this.parse_cmd_endif();
|
8986 | }
|
8987 | else if (parser == "parse_cmd_endtry") {
|
8988 | this.parse_cmd_endtry();
|
8989 | }
|
8990 | else if (parser == "parse_cmd_endwhile") {
|
8991 | this.parse_cmd_endwhile();
|
8992 | }
|
8993 | else if (parser == "parse_cmd_execute") {
|
8994 | this.parse_cmd_execute();
|
8995 | }
|
8996 | else if (parser == "parse_cmd_finally") {
|
8997 | this.parse_cmd_finally();
|
8998 | }
|
8999 | else if (parser == "parse_cmd_finish") {
|
9000 | this.parse_cmd_finish();
|
9001 | }
|
9002 | else if (parser == "parse_cmd_for") {
|
9003 | this.parse_cmd_for();
|
9004 | }
|
9005 | else if (parser == "parse_cmd_function") {
|
9006 | this.parse_cmd_function();
|
9007 | }
|
9008 | else if (parser == "parse_cmd_if") {
|
9009 | this.parse_cmd_if();
|
9010 | }
|
9011 | else if (parser == "parse_cmd_insert") {
|
9012 | this.parse_cmd_insert();
|
9013 | }
|
9014 | else if (parser == "parse_cmd_let") {
|
9015 | this.parse_cmd_let();
|
9016 | }
|
9017 | else if (parser == "parse_cmd_const") {
|
9018 | this.parse_cmd_const();
|
9019 | }
|
9020 | else if (parser == "parse_cmd_loadkeymap") {
|
9021 | this.parse_cmd_loadkeymap();
|
9022 | }
|
9023 | else if (parser == "parse_cmd_lockvar") {
|
9024 | this.parse_cmd_lockvar();
|
9025 | }
|
9026 | else if (parser == "parse_cmd_lua") {
|
9027 | this.parse_cmd_lua();
|
9028 | }
|
9029 | else if (parser == "parse_cmd_modifier_range") {
|
9030 | this.parse_cmd_modifier_range();
|
9031 | }
|
9032 | else if (parser == "parse_cmd_mzscheme") {
|
9033 | this.parse_cmd_mzscheme();
|
9034 | }
|
9035 | else if (parser == "parse_cmd_perl") {
|
9036 | this.parse_cmd_perl();
|
9037 | }
|
9038 | else if (parser == "parse_cmd_python") {
|
9039 | this.parse_cmd_python();
|
9040 | }
|
9041 | else if (parser == "parse_cmd_python3") {
|
9042 | this.parse_cmd_python3();
|
9043 | }
|
9044 | else if (parser == "parse_cmd_return") {
|
9045 | this.parse_cmd_return();
|
9046 | }
|
9047 | else if (parser == "parse_cmd_ruby") {
|
9048 | this.parse_cmd_ruby();
|
9049 | }
|
9050 | else if (parser == "parse_cmd_tcl") {
|
9051 | this.parse_cmd_tcl();
|
9052 | }
|
9053 | else if (parser == "parse_cmd_throw") {
|
9054 | this.parse_cmd_throw();
|
9055 | }
|
9056 | else if (parser == "parse_cmd_eval") {
|
9057 | this.parse_cmd_eval();
|
9058 | }
|
9059 | else if (parser == "parse_cmd_try") {
|
9060 | this.parse_cmd_try();
|
9061 | }
|
9062 | else if (parser == "parse_cmd_unlet") {
|
9063 | this.parse_cmd_unlet();
|
9064 | }
|
9065 | else if (parser == "parse_cmd_unlockvar") {
|
9066 | this.parse_cmd_unlockvar();
|
9067 | }
|
9068 | else if (parser == "parse_cmd_usercmd") {
|
9069 | this.parse_cmd_usercmd();
|
9070 | }
|
9071 | else if (parser == "parse_cmd_while") {
|
9072 | this.parse_cmd_while();
|
9073 | }
|
9074 | else if (parser == "parse_wincmd") {
|
9075 | this.parse_wincmd();
|
9076 | }
|
9077 | else if (parser == "parse_cmd_syntax") {
|
9078 | this.parse_cmd_syntax();
|
9079 | }
|
9080 | else {
|
9081 | throw viml_printf("unknown parser: %s", viml_string(parser));
|
9082 | }
|
9083 | }
|
9084 |
|
9085 | VimLParser.prototype.find_command = function() {
|
9086 | var c = this.reader.peekn(1);
|
9087 | var name = "";
|
9088 | if (c == "k") {
|
9089 | this.reader.getn(1);
|
9090 | var name = "k";
|
9091 | }
|
9092 | else if (c == "s" && viml_eqregh(this.reader.peekn(5), "\\v^s%(c[^sr][^i][^p]|g|i[^mlg]|I|r[^e])")) {
|
9093 | this.reader.getn(1);
|
9094 | var name = "substitute";
|
9095 | }
|
9096 | else if (viml_eqregh(c, "[@*!=><&~#]")) {
|
9097 | this.reader.getn(1);
|
9098 | var name = c;
|
9099 | }
|
9100 | else if (this.reader.peekn(2) == "py") {
|
9101 | var name = this.reader.read_alnum();
|
9102 | }
|
9103 | else {
|
9104 | var pos = this.reader.tell();
|
9105 | var name = this.reader.read_alpha();
|
9106 | if (name != "del" && viml_eqregh(name, "\\v^d%[elete][lp]$")) {
|
9107 | this.reader.seek_set(pos);
|
9108 | var name = this.reader.getn(viml_len(name) - 1);
|
9109 | }
|
9110 | }
|
9111 | if (name == "") {
|
9112 | return NIL;
|
9113 | }
|
9114 | if (viml_has_key(this.find_command_cache, name)) {
|
9115 | return this.find_command_cache[name];
|
9116 | }
|
9117 | var cmd = NIL;
|
9118 | var __c4 = this.builtin_commands;
|
9119 | for (var __i4 = 0; __i4 < __c4.length; ++__i4) {
|
9120 | var x = __c4[__i4];
|
9121 | if (viml_stridx(x.name, name) == 0 && viml_len(name) >= x.minlen) {
|
9122 | delete cmd;
|
9123 | var cmd = x;
|
9124 | break;
|
9125 | }
|
9126 | }
|
9127 | if (this.neovim) {
|
9128 | var __c5 = this.neovim_additional_commands;
|
9129 | for (var __i5 = 0; __i5 < __c5.length; ++__i5) {
|
9130 | var x = __c5[__i5];
|
9131 | if (viml_stridx(x.name, name) == 0 && viml_len(name) >= x.minlen) {
|
9132 | delete cmd;
|
9133 | var cmd = x;
|
9134 | break;
|
9135 | }
|
9136 | }
|
9137 | var __c6 = this.neovim_removed_commands;
|
9138 | for (var __i6 = 0; __i6 < __c6.length; ++__i6) {
|
9139 | var x = __c6[__i6];
|
9140 | if (viml_stridx(x.name, name) == 0 && viml_len(name) >= x.minlen) {
|
9141 | delete cmd;
|
9142 | var cmd = NIL;
|
9143 | break;
|
9144 | }
|
9145 | }
|
9146 | }
|
9147 |
|
9148 | if ((cmd === NIL || cmd.name == "Print") && viml_eqregh(name, "^[A-Z]")) {
|
9149 | name += this.reader.read_alnum();
|
9150 | delete cmd;
|
9151 | var cmd = {"name":name, "flags":"USERCMD", "parser":"parse_cmd_usercmd"};
|
9152 | }
|
9153 | this.find_command_cache[name] = cmd;
|
9154 | return cmd;
|
9155 | }
|
9156 |
|
9157 |
|
9158 | VimLParser.prototype.parse_hashbang = function() {
|
9159 | this.reader.getn(-1);
|
9160 | }
|
9161 |
|
9162 |
|
9163 |
|
9164 | VimLParser.prototype.parse_argopt = function() {
|
9165 | while (this.reader.p(0) == "+" && this.reader.p(1) == "+") {
|
9166 | var s = this.reader.peekn(20);
|
9167 | if (viml_eqregh(s, "^++bin\\>")) {
|
9168 | this.reader.getn(5);
|
9169 | this.ea.force_bin = 1;
|
9170 | }
|
9171 | else if (viml_eqregh(s, "^++nobin\\>")) {
|
9172 | this.reader.getn(7);
|
9173 | this.ea.force_bin = 2;
|
9174 | }
|
9175 | else if (viml_eqregh(s, "^++edit\\>")) {
|
9176 | this.reader.getn(6);
|
9177 | this.ea.read_edit = 1;
|
9178 | }
|
9179 | else if (viml_eqregh(s, "^++ff=\\(dos\\|unix\\|mac\\)\\>")) {
|
9180 | this.reader.getn(5);
|
9181 | this.ea.force_ff = this.reader.read_alpha();
|
9182 | }
|
9183 | else if (viml_eqregh(s, "^++fileformat=\\(dos\\|unix\\|mac\\)\\>")) {
|
9184 | this.reader.getn(13);
|
9185 | this.ea.force_ff = this.reader.read_alpha();
|
9186 | }
|
9187 | else if (viml_eqregh(s, "^++enc=\\S")) {
|
9188 | this.reader.getn(6);
|
9189 | this.ea.force_enc = this.reader.read_nonwhite();
|
9190 | }
|
9191 | else if (viml_eqregh(s, "^++encoding=\\S")) {
|
9192 | this.reader.getn(11);
|
9193 | this.ea.force_enc = this.reader.read_nonwhite();
|
9194 | }
|
9195 | else if (viml_eqregh(s, "^++bad=\\(keep\\|drop\\|.\\)\\>")) {
|
9196 | this.reader.getn(6);
|
9197 | if (viml_eqregh(s, "^++bad=keep")) {
|
9198 | this.ea.bad_char = this.reader.getn(4);
|
9199 | }
|
9200 | else if (viml_eqregh(s, "^++bad=drop")) {
|
9201 | this.ea.bad_char = this.reader.getn(4);
|
9202 | }
|
9203 | else {
|
9204 | this.ea.bad_char = this.reader.getn(1);
|
9205 | }
|
9206 | }
|
9207 | else if (viml_eqregh(s, "^++")) {
|
9208 | throw Err("E474: Invalid Argument", this.reader.getpos());
|
9209 | }
|
9210 | else {
|
9211 | break;
|
9212 | }
|
9213 | this.reader.skip_white();
|
9214 | }
|
9215 | }
|
9216 |
|
9217 |
|
9218 |
|
9219 | VimLParser.prototype.parse_argcmd = function() {
|
9220 | if (this.reader.peekn(1) == "+") {
|
9221 | this.reader.getn(1);
|
9222 | if (this.reader.peekn(1) == " ") {
|
9223 | this.ea.do_ecmd_cmd = "$";
|
9224 | }
|
9225 | else {
|
9226 | this.ea.do_ecmd_cmd = this.read_cmdarg();
|
9227 | }
|
9228 | }
|
9229 | }
|
9230 |
|
9231 | VimLParser.prototype.read_cmdarg = function() {
|
9232 | var r = "";
|
9233 | while (TRUE) {
|
9234 | var c = this.reader.peekn(1);
|
9235 | if (c == "" || iswhite(c)) {
|
9236 | break;
|
9237 | }
|
9238 | this.reader.getn(1);
|
9239 | if (c == "\\") {
|
9240 | var c = this.reader.getn(1);
|
9241 | }
|
9242 | r += c;
|
9243 | }
|
9244 | return r;
|
9245 | }
|
9246 |
|
9247 | VimLParser.prototype.parse_comment = function() {
|
9248 | var npos = this.reader.getpos();
|
9249 | var c = this.reader.get();
|
9250 | if (c != "\"") {
|
9251 | throw Err(viml_printf("unexpected character: %s", c), npos);
|
9252 | }
|
9253 | var node = Node(NODE_COMMENT);
|
9254 | node.pos = npos;
|
9255 | node.str = this.reader.getn(-1);
|
9256 | this.add_node(node);
|
9257 | }
|
9258 |
|
9259 | VimLParser.prototype.parse_trail = function() {
|
9260 | this.reader.skip_white();
|
9261 | var c = this.reader.peek();
|
9262 | if (c == "<EOF>") {
|
9263 |
|
9264 | }
|
9265 | else if (c == "<EOL>") {
|
9266 | this.reader.get();
|
9267 | }
|
9268 | else if (c == "|") {
|
9269 | this.reader.get();
|
9270 | }
|
9271 | else if (c == "\"") {
|
9272 | this.parse_comment();
|
9273 | this.reader.get();
|
9274 | }
|
9275 | else {
|
9276 | throw Err(viml_printf("E488: Trailing characters: %s", c), this.reader.getpos());
|
9277 | }
|
9278 | }
|
9279 |
|
9280 |
|
9281 | VimLParser.prototype.parse_cmd_modifier_range = function() {
|
9282 | var node = Node(NODE_EXCMD);
|
9283 | node.pos = this.ea.cmdpos;
|
9284 | node.ea = this.ea;
|
9285 | node.str = this.reader.getstr(this.ea.linepos, this.reader.getpos());
|
9286 | this.add_node(node);
|
9287 | }
|
9288 |
|
9289 |
|
9290 | VimLParser.prototype.parse_cmd_common = function() {
|
9291 | var end = this.reader.getpos();
|
9292 | if (viml_eqregh(this.ea.cmd.flags, "\\<TRLBAR\\>") && !this.ea.usefilter) {
|
9293 | var end = this.separate_nextcmd();
|
9294 | }
|
9295 | else if (this.ea.cmd.name == "!" || this.ea.cmd.name == "global" || this.ea.cmd.name == "vglobal" || this.ea.usefilter) {
|
9296 | while (TRUE) {
|
9297 | var end = this.reader.getpos();
|
9298 | if (this.reader.getn(1) == "") {
|
9299 | break;
|
9300 | }
|
9301 | }
|
9302 | }
|
9303 | else {
|
9304 | while (TRUE) {
|
9305 | var end = this.reader.getpos();
|
9306 | if (this.reader.getn(1) == "") {
|
9307 | break;
|
9308 | }
|
9309 | }
|
9310 | }
|
9311 | var node = Node(NODE_EXCMD);
|
9312 | node.pos = this.ea.cmdpos;
|
9313 | node.ea = this.ea;
|
9314 | node.str = this.reader.getstr(this.ea.linepos, end);
|
9315 | this.add_node(node);
|
9316 | }
|
9317 |
|
9318 | VimLParser.prototype.separate_nextcmd = function() {
|
9319 | if (this.ea.cmd.name == "vimgrep" || this.ea.cmd.name == "vimgrepadd" || this.ea.cmd.name == "lvimgrep" || this.ea.cmd.name == "lvimgrepadd") {
|
9320 | this.skip_vimgrep_pat();
|
9321 | }
|
9322 | var pc = "";
|
9323 | var end = this.reader.getpos();
|
9324 | var nospend = end;
|
9325 | while (TRUE) {
|
9326 | var end = this.reader.getpos();
|
9327 | if (!iswhite(pc)) {
|
9328 | var nospend = end;
|
9329 | }
|
9330 | var c = this.reader.peek();
|
9331 | if (c == "<EOF>" || c == "<EOL>") {
|
9332 | break;
|
9333 | }
|
9334 | else if (c == "\x16") {
|
9335 |
|
9336 | this.reader.get();
|
9337 | var end = this.reader.getpos();
|
9338 | var nospend = this.reader.getpos();
|
9339 | var c = this.reader.peek();
|
9340 | if (c == "<EOF>" || c == "<EOL>") {
|
9341 | break;
|
9342 | }
|
9343 | this.reader.get();
|
9344 | }
|
9345 | else if (this.reader.peekn(2) == "`=" && viml_eqregh(this.ea.cmd.flags, "\\<\\(XFILE\\|FILES\\|FILE1\\)\\>")) {
|
9346 | this.reader.getn(2);
|
9347 | this.parse_expr();
|
9348 | var c = this.reader.peekn(1);
|
9349 | if (c != "`") {
|
9350 | throw Err(viml_printf("unexpected character: %s", c), this.reader.getpos());
|
9351 | }
|
9352 | this.reader.getn(1);
|
9353 | }
|
9354 | else if (c == "|" || c == "\n" || c == "\"" && !viml_eqregh(this.ea.cmd.flags, "\\<NOTRLCOM\\>") && (this.ea.cmd.name != "@" && this.ea.cmd.name != "*" || this.reader.getpos() != this.ea.argpos) && (this.ea.cmd.name != "redir" || this.reader.getpos().i != this.ea.argpos.i + 1 || pc != "@")) {
|
9355 | var has_cpo_bar = FALSE;
|
9356 |
|
9357 | if ((!has_cpo_bar || !viml_eqregh(this.ea.cmd.flags, "\\<USECTRLV\\>")) && pc == "\\") {
|
9358 | this.reader.get();
|
9359 | }
|
9360 | else {
|
9361 | break;
|
9362 | }
|
9363 | }
|
9364 | else {
|
9365 | this.reader.get();
|
9366 | }
|
9367 | var pc = c;
|
9368 | }
|
9369 | if (!viml_eqregh(this.ea.cmd.flags, "\\<NOTRLCOM\\>")) {
|
9370 | var end = nospend;
|
9371 | }
|
9372 | return end;
|
9373 | }
|
9374 |
|
9375 |
|
9376 | VimLParser.prototype.skip_vimgrep_pat = function() {
|
9377 | if (this.reader.peekn(1) == "") {
|
9378 |
|
9379 | }
|
9380 | else if (isidc(this.reader.peekn(1))) {
|
9381 |
|
9382 | this.reader.read_nonwhite();
|
9383 | }
|
9384 | else {
|
9385 |
|
9386 | var c = this.reader.getn(1);
|
9387 | var __tmp = this.parse_pattern(c);
|
9388 | var _ = __tmp[0];
|
9389 | var endc = __tmp[1];
|
9390 | if (c != endc) {
|
9391 | return;
|
9392 | }
|
9393 | while (this.reader.p(0) == "g" || this.reader.p(0) == "j") {
|
9394 | this.reader.getn(1);
|
9395 | }
|
9396 | }
|
9397 | }
|
9398 |
|
9399 | VimLParser.prototype.parse_cmd_append = function() {
|
9400 | this.reader.setpos(this.ea.linepos);
|
9401 | var cmdline = this.reader.readline();
|
9402 | var lines = [cmdline];
|
9403 | var m = ".";
|
9404 | while (TRUE) {
|
9405 | if (this.reader.peek() == "<EOF>") {
|
9406 | break;
|
9407 | }
|
9408 | var line = this.reader.getn(-1);
|
9409 | viml_add(lines, line);
|
9410 | if (line == m) {
|
9411 | break;
|
9412 | }
|
9413 | this.reader.get();
|
9414 | }
|
9415 | var node = Node(NODE_EXCMD);
|
9416 | node.pos = this.ea.cmdpos;
|
9417 | node.ea = this.ea;
|
9418 | node.str = viml_join(lines, "\n");
|
9419 | this.add_node(node);
|
9420 | }
|
9421 |
|
9422 | VimLParser.prototype.parse_cmd_insert = function() {
|
9423 | this.parse_cmd_append();
|
9424 | }
|
9425 |
|
9426 | VimLParser.prototype.parse_cmd_loadkeymap = function() {
|
9427 | this.reader.setpos(this.ea.linepos);
|
9428 | var cmdline = this.reader.readline();
|
9429 | var lines = [cmdline];
|
9430 | while (TRUE) {
|
9431 | if (this.reader.peek() == "<EOF>") {
|
9432 | break;
|
9433 | }
|
9434 | var line = this.reader.readline();
|
9435 | viml_add(lines, line);
|
9436 | }
|
9437 | var node = Node(NODE_EXCMD);
|
9438 | node.pos = this.ea.cmdpos;
|
9439 | node.ea = this.ea;
|
9440 | node.str = viml_join(lines, "\n");
|
9441 | this.add_node(node);
|
9442 | }
|
9443 |
|
9444 | VimLParser.prototype.parse_cmd_lua = function() {
|
9445 | var lines = [];
|
9446 | this.reader.skip_white();
|
9447 | if (this.reader.peekn(2) == "<<") {
|
9448 | this.reader.getn(2);
|
9449 | this.reader.skip_white();
|
9450 | var m = this.reader.readline();
|
9451 | if (m == "") {
|
9452 | var m = ".";
|
9453 | }
|
9454 | this.reader.setpos(this.ea.linepos);
|
9455 | var cmdline = this.reader.getn(-1);
|
9456 | var lines = [cmdline];
|
9457 | this.reader.get();
|
9458 | while (TRUE) {
|
9459 | if (this.reader.peek() == "<EOF>") {
|
9460 | break;
|
9461 | }
|
9462 | var line = this.reader.getn(-1);
|
9463 | viml_add(lines, line);
|
9464 | if (line == m) {
|
9465 | break;
|
9466 | }
|
9467 | this.reader.get();
|
9468 | }
|
9469 | }
|
9470 | else {
|
9471 | this.reader.setpos(this.ea.linepos);
|
9472 | var cmdline = this.reader.getn(-1);
|
9473 | var lines = [cmdline];
|
9474 | }
|
9475 | var node = Node(NODE_EXCMD);
|
9476 | node.pos = this.ea.cmdpos;
|
9477 | node.ea = this.ea;
|
9478 | node.str = viml_join(lines, "\n");
|
9479 | this.add_node(node);
|
9480 | }
|
9481 |
|
9482 | VimLParser.prototype.parse_cmd_mzscheme = function() {
|
9483 | this.parse_cmd_lua();
|
9484 | }
|
9485 |
|
9486 | VimLParser.prototype.parse_cmd_perl = function() {
|
9487 | this.parse_cmd_lua();
|
9488 | }
|
9489 |
|
9490 | VimLParser.prototype.parse_cmd_python = function() {
|
9491 | this.parse_cmd_lua();
|
9492 | }
|
9493 |
|
9494 | VimLParser.prototype.parse_cmd_python3 = function() {
|
9495 | this.parse_cmd_lua();
|
9496 | }
|
9497 |
|
9498 | VimLParser.prototype.parse_cmd_ruby = function() {
|
9499 | this.parse_cmd_lua();
|
9500 | }
|
9501 |
|
9502 | VimLParser.prototype.parse_cmd_tcl = function() {
|
9503 | this.parse_cmd_lua();
|
9504 | }
|
9505 |
|
9506 | VimLParser.prototype.parse_cmd_finish = function() {
|
9507 | this.parse_cmd_common();
|
9508 | if (this.context[0].type == NODE_TOPLEVEL) {
|
9509 | this.reader.seek_end(0);
|
9510 | }
|
9511 | }
|
9512 |
|
9513 |
|
9514 | VimLParser.prototype.parse_cmd_usercmd = function() {
|
9515 | this.parse_cmd_common();
|
9516 | }
|
9517 |
|
9518 | VimLParser.prototype.parse_cmd_function = function() {
|
9519 | var pos = this.reader.tell();
|
9520 | this.reader.skip_white();
|
9521 |
|
9522 | if (this.ends_excmds(this.reader.peek())) {
|
9523 | this.reader.seek_set(pos);
|
9524 | this.parse_cmd_common();
|
9525 | return;
|
9526 | }
|
9527 |
|
9528 | if (this.reader.peekn(1) == "/") {
|
9529 | this.reader.seek_set(pos);
|
9530 | this.parse_cmd_common();
|
9531 | return;
|
9532 | }
|
9533 | var left = this.parse_lvalue_func();
|
9534 | this.reader.skip_white();
|
9535 | if (left.type == NODE_IDENTIFIER) {
|
9536 | var s = left.value;
|
9537 | var ss = viml_split(s, "\\zs");
|
9538 | if (ss[0] != "<" && ss[0] != "_" && !isupper(ss[0]) && viml_stridx(s, ":") == -1 && viml_stridx(s, "#") == -1) {
|
9539 | throw Err(viml_printf("E128: Function name must start with a capital or contain a colon: %s", s), left.pos);
|
9540 | }
|
9541 | }
|
9542 |
|
9543 | if (this.reader.peekn(1) != "(") {
|
9544 | this.reader.seek_set(pos);
|
9545 | this.parse_cmd_common();
|
9546 | return;
|
9547 | }
|
9548 |
|
9549 | var node = Node(NODE_FUNCTION);
|
9550 | node.pos = this.ea.cmdpos;
|
9551 | node.body = [];
|
9552 | node.ea = this.ea;
|
9553 | node.left = left;
|
9554 | node.rlist = [];
|
9555 | node.default_args = [];
|
9556 | node.attr = {"range":0, "abort":0, "dict":0, "closure":0};
|
9557 | node.endfunction = NIL;
|
9558 | this.reader.getn(1);
|
9559 | var tokenizer = new ExprTokenizer(this.reader);
|
9560 | if (tokenizer.peek().type == TOKEN_PCLOSE) {
|
9561 | tokenizer.get();
|
9562 | }
|
9563 | else {
|
9564 | var named = {};
|
9565 | while (TRUE) {
|
9566 | var varnode = Node(NODE_IDENTIFIER);
|
9567 | var token = tokenizer.get();
|
9568 | if (token.type == TOKEN_IDENTIFIER) {
|
9569 | if (!isargname(token.value) || token.value == "firstline" || token.value == "lastline") {
|
9570 | throw Err(viml_printf("E125: Illegal argument: %s", token.value), token.pos);
|
9571 | }
|
9572 | else if (viml_has_key(named, token.value)) {
|
9573 | throw Err(viml_printf("E853: Duplicate argument name: %s", token.value), token.pos);
|
9574 | }
|
9575 | named[token.value] = 1;
|
9576 | varnode.pos = token.pos;
|
9577 | varnode.value = token.value;
|
9578 | viml_add(node.rlist, varnode);
|
9579 | if (tokenizer.peek().type == TOKEN_EQ) {
|
9580 | tokenizer.get();
|
9581 | viml_add(node.default_args, this.parse_expr());
|
9582 | }
|
9583 | else if (viml_len(node.default_args) > 0) {
|
9584 | throw Err("E989: Non-default argument follows default argument", varnode.pos);
|
9585 | }
|
9586 |
|
9587 | if (iswhite(this.reader.p(0)) && tokenizer.peek().type == TOKEN_COMMA) {
|
9588 | throw Err("E475: Invalid argument: White space is not allowed before comma", this.reader.getpos());
|
9589 | }
|
9590 | var token = tokenizer.get();
|
9591 | if (token.type == TOKEN_COMMA) {
|
9592 |
|
9593 | if (tokenizer.peek().type == TOKEN_PCLOSE) {
|
9594 | tokenizer.get();
|
9595 | break;
|
9596 | }
|
9597 | }
|
9598 | else if (token.type == TOKEN_PCLOSE) {
|
9599 | break;
|
9600 | }
|
9601 | else {
|
9602 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
9603 | }
|
9604 | }
|
9605 | else if (token.type == TOKEN_DOTDOTDOT) {
|
9606 | varnode.pos = token.pos;
|
9607 | varnode.value = token.value;
|
9608 | viml_add(node.rlist, varnode);
|
9609 | var token = tokenizer.get();
|
9610 | if (token.type == TOKEN_PCLOSE) {
|
9611 | break;
|
9612 | }
|
9613 | else {
|
9614 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
9615 | }
|
9616 | }
|
9617 | else {
|
9618 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
9619 | }
|
9620 | }
|
9621 | }
|
9622 | while (TRUE) {
|
9623 | this.reader.skip_white();
|
9624 | var epos = this.reader.getpos();
|
9625 | var key = this.reader.read_alpha();
|
9626 | if (key == "") {
|
9627 | break;
|
9628 | }
|
9629 | else if (key == "range") {
|
9630 | node.attr.range = TRUE;
|
9631 | }
|
9632 | else if (key == "abort") {
|
9633 | node.attr.abort = TRUE;
|
9634 | }
|
9635 | else if (key == "dict") {
|
9636 | node.attr.dict = TRUE;
|
9637 | }
|
9638 | else if (key == "closure") {
|
9639 | node.attr.closure = TRUE;
|
9640 | }
|
9641 | else {
|
9642 | throw Err(viml_printf("unexpected token: %s", key), epos);
|
9643 | }
|
9644 | }
|
9645 | this.add_node(node);
|
9646 | this.push_context(node);
|
9647 | }
|
9648 |
|
9649 | VimLParser.prototype.parse_cmd_endfunction = function() {
|
9650 | this.check_missing_endif("ENDFUNCTION", this.ea.cmdpos);
|
9651 | this.check_missing_endtry("ENDFUNCTION", this.ea.cmdpos);
|
9652 | this.check_missing_endwhile("ENDFUNCTION", this.ea.cmdpos);
|
9653 | this.check_missing_endfor("ENDFUNCTION", this.ea.cmdpos);
|
9654 | if (this.context[0].type != NODE_FUNCTION) {
|
9655 | throw Err("E193: :endfunction not inside a function", this.ea.cmdpos);
|
9656 | }
|
9657 | this.reader.getn(-1);
|
9658 | var node = Node(NODE_ENDFUNCTION);
|
9659 | node.pos = this.ea.cmdpos;
|
9660 | node.ea = this.ea;
|
9661 | this.context[0].endfunction = node;
|
9662 | this.pop_context();
|
9663 | }
|
9664 |
|
9665 | VimLParser.prototype.parse_cmd_delfunction = function() {
|
9666 | var node = Node(NODE_DELFUNCTION);
|
9667 | node.pos = this.ea.cmdpos;
|
9668 | node.ea = this.ea;
|
9669 | node.left = this.parse_lvalue_func();
|
9670 | this.add_node(node);
|
9671 | }
|
9672 |
|
9673 | VimLParser.prototype.parse_cmd_return = function() {
|
9674 | if (this.find_context(NODE_FUNCTION) == -1) {
|
9675 | throw Err("E133: :return not inside a function", this.ea.cmdpos);
|
9676 | }
|
9677 | var node = Node(NODE_RETURN);
|
9678 | node.pos = this.ea.cmdpos;
|
9679 | node.ea = this.ea;
|
9680 | node.left = NIL;
|
9681 | this.reader.skip_white();
|
9682 | var c = this.reader.peek();
|
9683 | if (c == "\"" || !this.ends_excmds(c)) {
|
9684 | node.left = this.parse_expr();
|
9685 | }
|
9686 | this.add_node(node);
|
9687 | }
|
9688 |
|
9689 | VimLParser.prototype.parse_cmd_call = function() {
|
9690 | var node = Node(NODE_EXCALL);
|
9691 | node.pos = this.ea.cmdpos;
|
9692 | node.ea = this.ea;
|
9693 | this.reader.skip_white();
|
9694 | var c = this.reader.peek();
|
9695 | if (this.ends_excmds(c)) {
|
9696 | throw Err("E471: Argument required", this.reader.getpos());
|
9697 | }
|
9698 | node.left = this.parse_expr();
|
9699 | if (node.left.type != NODE_CALL) {
|
9700 | throw Err("Not a function call", node.left.pos);
|
9701 | }
|
9702 | this.add_node(node);
|
9703 | }
|
9704 |
|
9705 | VimLParser.prototype.parse_heredoc = function() {
|
9706 | var node = Node(NODE_HEREDOC);
|
9707 | node.pos = this.ea.cmdpos;
|
9708 | node.op = "";
|
9709 | node.rlist = [];
|
9710 | node.body = [];
|
9711 | while (TRUE) {
|
9712 | this.reader.skip_white();
|
9713 | var key = this.reader.read_word();
|
9714 | if (key == "") {
|
9715 | break;
|
9716 | }
|
9717 | if (!islower(key[0])) {
|
9718 | node.op = key;
|
9719 | break;
|
9720 | }
|
9721 | else {
|
9722 | viml_add(node.rlist, key);
|
9723 | }
|
9724 | }
|
9725 | if (node.op == "") {
|
9726 | throw Err("E172: Missing marker", this.reader.getpos());
|
9727 | }
|
9728 | this.parse_trail();
|
9729 | while (TRUE) {
|
9730 | if (this.reader.peek() == "<EOF>") {
|
9731 | break;
|
9732 | }
|
9733 | var line = this.reader.getn(-1);
|
9734 | if (line == node.op) {
|
9735 | return node;
|
9736 | }
|
9737 | viml_add(node.body, line);
|
9738 | this.reader.get();
|
9739 | }
|
9740 | throw Err(viml_printf("E990: Missing end marker '%s'", node.op), this.reader.getpos());
|
9741 | }
|
9742 |
|
9743 | VimLParser.prototype.parse_cmd_let = function() {
|
9744 | var pos = this.reader.tell();
|
9745 | this.reader.skip_white();
|
9746 |
|
9747 | if (this.ends_excmds(this.reader.peek())) {
|
9748 | this.reader.seek_set(pos);
|
9749 | this.parse_cmd_common();
|
9750 | return;
|
9751 | }
|
9752 | var lhs = this.parse_letlhs();
|
9753 | this.reader.skip_white();
|
9754 | var s1 = this.reader.peekn(1);
|
9755 | var s2 = this.reader.peekn(2);
|
9756 |
|
9757 | if (s2 == "..") {
|
9758 | var s2 = this.reader.peekn(3);
|
9759 | }
|
9760 | else if (s2 == "=<") {
|
9761 | var s2 = this.reader.peekn(3);
|
9762 | }
|
9763 |
|
9764 | if (this.ends_excmds(s1) || s2 != "+=" && s2 != "-=" && s2 != ".=" && s2 != "..=" && s2 != "*=" && s2 != "/=" && s2 != "%=" && s2 != "=<<" && s1 != "=") {
|
9765 | this.reader.seek_set(pos);
|
9766 | this.parse_cmd_common();
|
9767 | return;
|
9768 | }
|
9769 |
|
9770 | var node = Node(NODE_LET);
|
9771 | node.pos = this.ea.cmdpos;
|
9772 | node.ea = this.ea;
|
9773 | node.op = "";
|
9774 | node.left = lhs.left;
|
9775 | node.list = lhs.list;
|
9776 | node.rest = lhs.rest;
|
9777 | node.right = NIL;
|
9778 | if (s2 == "+=" || s2 == "-=" || s2 == ".=" || s2 == "..=" || s2 == "*=" || s2 == "/=" || s2 == "%=") {
|
9779 | this.reader.getn(viml_len(s2));
|
9780 | node.op = s2;
|
9781 | }
|
9782 | else if (s2 == "=<<") {
|
9783 | this.reader.getn(viml_len(s2));
|
9784 | this.reader.skip_white();
|
9785 | node.op = s2;
|
9786 | node.right = this.parse_heredoc();
|
9787 | this.add_node(node);
|
9788 | return;
|
9789 | }
|
9790 | else if (s1 == "=") {
|
9791 | this.reader.getn(1);
|
9792 | node.op = s1;
|
9793 | }
|
9794 | else {
|
9795 | throw "NOT REACHED";
|
9796 | }
|
9797 | node.right = this.parse_expr();
|
9798 | this.add_node(node);
|
9799 | }
|
9800 |
|
9801 | VimLParser.prototype.parse_cmd_const = function() {
|
9802 | var pos = this.reader.tell();
|
9803 | this.reader.skip_white();
|
9804 |
|
9805 | if (this.ends_excmds(this.reader.peek())) {
|
9806 | this.reader.seek_set(pos);
|
9807 | this.parse_cmd_common();
|
9808 | return;
|
9809 | }
|
9810 | var lhs = this.parse_constlhs();
|
9811 | this.reader.skip_white();
|
9812 | var s1 = this.reader.peekn(1);
|
9813 |
|
9814 | if (this.ends_excmds(s1) || s1 != "=") {
|
9815 | this.reader.seek_set(pos);
|
9816 | this.parse_cmd_common();
|
9817 | return;
|
9818 | }
|
9819 |
|
9820 | var node = Node(NODE_CONST);
|
9821 | node.pos = this.ea.cmdpos;
|
9822 | node.ea = this.ea;
|
9823 | this.reader.getn(1);
|
9824 | node.op = s1;
|
9825 | node.left = lhs.left;
|
9826 | node.list = lhs.list;
|
9827 | node.rest = lhs.rest;
|
9828 | node.right = this.parse_expr();
|
9829 | this.add_node(node);
|
9830 | }
|
9831 |
|
9832 | VimLParser.prototype.parse_cmd_unlet = function() {
|
9833 | var node = Node(NODE_UNLET);
|
9834 | node.pos = this.ea.cmdpos;
|
9835 | node.ea = this.ea;
|
9836 | node.list = this.parse_lvaluelist();
|
9837 | this.add_node(node);
|
9838 | }
|
9839 |
|
9840 | VimLParser.prototype.parse_cmd_lockvar = function() {
|
9841 | var node = Node(NODE_LOCKVAR);
|
9842 | node.pos = this.ea.cmdpos;
|
9843 | node.ea = this.ea;
|
9844 | node.depth = NIL;
|
9845 | node.list = [];
|
9846 | this.reader.skip_white();
|
9847 | if (isdigit(this.reader.peekn(1))) {
|
9848 | node.depth = viml_str2nr(this.reader.read_digit(), 10);
|
9849 | }
|
9850 | node.list = this.parse_lvaluelist();
|
9851 | this.add_node(node);
|
9852 | }
|
9853 |
|
9854 | VimLParser.prototype.parse_cmd_unlockvar = function() {
|
9855 | var node = Node(NODE_UNLOCKVAR);
|
9856 | node.pos = this.ea.cmdpos;
|
9857 | node.ea = this.ea;
|
9858 | node.depth = NIL;
|
9859 | node.list = [];
|
9860 | this.reader.skip_white();
|
9861 | if (isdigit(this.reader.peekn(1))) {
|
9862 | node.depth = viml_str2nr(this.reader.read_digit(), 10);
|
9863 | }
|
9864 | node.list = this.parse_lvaluelist();
|
9865 | this.add_node(node);
|
9866 | }
|
9867 |
|
9868 | VimLParser.prototype.parse_cmd_if = function() {
|
9869 | var node = Node(NODE_IF);
|
9870 | node.pos = this.ea.cmdpos;
|
9871 | node.body = [];
|
9872 | node.ea = this.ea;
|
9873 | node.cond = this.parse_expr();
|
9874 | node.elseif = [];
|
9875 | node._else = NIL;
|
9876 | node.endif = NIL;
|
9877 | this.add_node(node);
|
9878 | this.push_context(node);
|
9879 | }
|
9880 |
|
9881 | VimLParser.prototype.parse_cmd_elseif = function() {
|
9882 | if (this.context[0].type != NODE_IF && this.context[0].type != NODE_ELSEIF) {
|
9883 | throw Err("E582: :elseif without :if", this.ea.cmdpos);
|
9884 | }
|
9885 | if (this.context[0].type != NODE_IF) {
|
9886 | this.pop_context();
|
9887 | }
|
9888 | var node = Node(NODE_ELSEIF);
|
9889 | node.pos = this.ea.cmdpos;
|
9890 | node.body = [];
|
9891 | node.ea = this.ea;
|
9892 | node.cond = this.parse_expr();
|
9893 | viml_add(this.context[0].elseif, node);
|
9894 | this.push_context(node);
|
9895 | }
|
9896 |
|
9897 | VimLParser.prototype.parse_cmd_else = function() {
|
9898 | if (this.context[0].type != NODE_IF && this.context[0].type != NODE_ELSEIF) {
|
9899 | throw Err("E581: :else without :if", this.ea.cmdpos);
|
9900 | }
|
9901 | if (this.context[0].type != NODE_IF) {
|
9902 | this.pop_context();
|
9903 | }
|
9904 | var node = Node(NODE_ELSE);
|
9905 | node.pos = this.ea.cmdpos;
|
9906 | node.body = [];
|
9907 | node.ea = this.ea;
|
9908 | this.context[0]._else = node;
|
9909 | this.push_context(node);
|
9910 | }
|
9911 |
|
9912 | VimLParser.prototype.parse_cmd_endif = function() {
|
9913 | if (this.context[0].type != NODE_IF && this.context[0].type != NODE_ELSEIF && this.context[0].type != NODE_ELSE) {
|
9914 | throw Err("E580: :endif without :if", this.ea.cmdpos);
|
9915 | }
|
9916 | if (this.context[0].type != NODE_IF) {
|
9917 | this.pop_context();
|
9918 | }
|
9919 | var node = Node(NODE_ENDIF);
|
9920 | node.pos = this.ea.cmdpos;
|
9921 | node.ea = this.ea;
|
9922 | this.context[0].endif = node;
|
9923 | this.pop_context();
|
9924 | }
|
9925 |
|
9926 | VimLParser.prototype.parse_cmd_while = function() {
|
9927 | var node = Node(NODE_WHILE);
|
9928 | node.pos = this.ea.cmdpos;
|
9929 | node.body = [];
|
9930 | node.ea = this.ea;
|
9931 | node.cond = this.parse_expr();
|
9932 | node.endwhile = NIL;
|
9933 | this.add_node(node);
|
9934 | this.push_context(node);
|
9935 | }
|
9936 |
|
9937 | VimLParser.prototype.parse_cmd_endwhile = function() {
|
9938 | if (this.context[0].type != NODE_WHILE) {
|
9939 | throw Err("E588: :endwhile without :while", this.ea.cmdpos);
|
9940 | }
|
9941 | var node = Node(NODE_ENDWHILE);
|
9942 | node.pos = this.ea.cmdpos;
|
9943 | node.ea = this.ea;
|
9944 | this.context[0].endwhile = node;
|
9945 | this.pop_context();
|
9946 | }
|
9947 |
|
9948 | VimLParser.prototype.parse_cmd_for = function() {
|
9949 | var node = Node(NODE_FOR);
|
9950 | node.pos = this.ea.cmdpos;
|
9951 | node.body = [];
|
9952 | node.ea = this.ea;
|
9953 | node.left = NIL;
|
9954 | node.right = NIL;
|
9955 | node.endfor = NIL;
|
9956 | var lhs = this.parse_letlhs();
|
9957 | node.left = lhs.left;
|
9958 | node.list = lhs.list;
|
9959 | node.rest = lhs.rest;
|
9960 | this.reader.skip_white();
|
9961 | var epos = this.reader.getpos();
|
9962 | if (this.reader.read_alpha() != "in") {
|
9963 | throw Err("Missing \"in\" after :for", epos);
|
9964 | }
|
9965 | node.right = this.parse_expr();
|
9966 | this.add_node(node);
|
9967 | this.push_context(node);
|
9968 | }
|
9969 |
|
9970 | VimLParser.prototype.parse_cmd_endfor = function() {
|
9971 | if (this.context[0].type != NODE_FOR) {
|
9972 | throw Err("E588: :endfor without :for", this.ea.cmdpos);
|
9973 | }
|
9974 | var node = Node(NODE_ENDFOR);
|
9975 | node.pos = this.ea.cmdpos;
|
9976 | node.ea = this.ea;
|
9977 | this.context[0].endfor = node;
|
9978 | this.pop_context();
|
9979 | }
|
9980 |
|
9981 | VimLParser.prototype.parse_cmd_continue = function() {
|
9982 | if (this.find_context(NODE_WHILE) == -1 && this.find_context(NODE_FOR) == -1) {
|
9983 | throw Err("E586: :continue without :while or :for", this.ea.cmdpos);
|
9984 | }
|
9985 | var node = Node(NODE_CONTINUE);
|
9986 | node.pos = this.ea.cmdpos;
|
9987 | node.ea = this.ea;
|
9988 | this.add_node(node);
|
9989 | }
|
9990 |
|
9991 | VimLParser.prototype.parse_cmd_break = function() {
|
9992 | if (this.find_context(NODE_WHILE) == -1 && this.find_context(NODE_FOR) == -1) {
|
9993 | throw Err("E587: :break without :while or :for", this.ea.cmdpos);
|
9994 | }
|
9995 | var node = Node(NODE_BREAK);
|
9996 | node.pos = this.ea.cmdpos;
|
9997 | node.ea = this.ea;
|
9998 | this.add_node(node);
|
9999 | }
|
10000 |
|
10001 | VimLParser.prototype.parse_cmd_try = function() {
|
10002 | var node = Node(NODE_TRY);
|
10003 | node.pos = this.ea.cmdpos;
|
10004 | node.body = [];
|
10005 | node.ea = this.ea;
|
10006 | node.catch = [];
|
10007 | node._finally = NIL;
|
10008 | node.endtry = NIL;
|
10009 | this.add_node(node);
|
10010 | this.push_context(node);
|
10011 | }
|
10012 |
|
10013 | VimLParser.prototype.parse_cmd_catch = function() {
|
10014 | if (this.context[0].type == NODE_FINALLY) {
|
10015 | throw Err("E604: :catch after :finally", this.ea.cmdpos);
|
10016 | }
|
10017 | else if (this.context[0].type != NODE_TRY && this.context[0].type != NODE_CATCH) {
|
10018 | throw Err("E603: :catch without :try", this.ea.cmdpos);
|
10019 | }
|
10020 | if (this.context[0].type != NODE_TRY) {
|
10021 | this.pop_context();
|
10022 | }
|
10023 | var node = Node(NODE_CATCH);
|
10024 | node.pos = this.ea.cmdpos;
|
10025 | node.body = [];
|
10026 | node.ea = this.ea;
|
10027 | node.pattern = NIL;
|
10028 | this.reader.skip_white();
|
10029 | if (!this.ends_excmds(this.reader.peek())) {
|
10030 | var __tmp = this.parse_pattern(this.reader.get());
|
10031 | node.pattern = __tmp[0];
|
10032 | var _ = __tmp[1];
|
10033 | }
|
10034 | viml_add(this.context[0].catch, node);
|
10035 | this.push_context(node);
|
10036 | }
|
10037 |
|
10038 | VimLParser.prototype.parse_cmd_finally = function() {
|
10039 | if (this.context[0].type != NODE_TRY && this.context[0].type != NODE_CATCH) {
|
10040 | throw Err("E606: :finally without :try", this.ea.cmdpos);
|
10041 | }
|
10042 | if (this.context[0].type != NODE_TRY) {
|
10043 | this.pop_context();
|
10044 | }
|
10045 | var node = Node(NODE_FINALLY);
|
10046 | node.pos = this.ea.cmdpos;
|
10047 | node.body = [];
|
10048 | node.ea = this.ea;
|
10049 | this.context[0]._finally = node;
|
10050 | this.push_context(node);
|
10051 | }
|
10052 |
|
10053 | VimLParser.prototype.parse_cmd_endtry = function() {
|
10054 | if (this.context[0].type != NODE_TRY && this.context[0].type != NODE_CATCH && this.context[0].type != NODE_FINALLY) {
|
10055 | throw Err("E602: :endtry without :try", this.ea.cmdpos);
|
10056 | }
|
10057 | if (this.context[0].type != NODE_TRY) {
|
10058 | this.pop_context();
|
10059 | }
|
10060 | var node = Node(NODE_ENDTRY);
|
10061 | node.pos = this.ea.cmdpos;
|
10062 | node.ea = this.ea;
|
10063 | this.context[0].endtry = node;
|
10064 | this.pop_context();
|
10065 | }
|
10066 |
|
10067 | VimLParser.prototype.parse_cmd_throw = function() {
|
10068 | var node = Node(NODE_THROW);
|
10069 | node.pos = this.ea.cmdpos;
|
10070 | node.ea = this.ea;
|
10071 | node.left = this.parse_expr();
|
10072 | this.add_node(node);
|
10073 | }
|
10074 |
|
10075 | VimLParser.prototype.parse_cmd_eval = function() {
|
10076 | var node = Node(NODE_EVAL);
|
10077 | node.pos = this.ea.cmdpos;
|
10078 | node.ea = this.ea;
|
10079 | node.left = this.parse_expr();
|
10080 | this.add_node(node);
|
10081 | }
|
10082 |
|
10083 | VimLParser.prototype.parse_cmd_echo = function() {
|
10084 | var node = Node(NODE_ECHO);
|
10085 | node.pos = this.ea.cmdpos;
|
10086 | node.ea = this.ea;
|
10087 | node.list = this.parse_exprlist();
|
10088 | this.add_node(node);
|
10089 | }
|
10090 |
|
10091 | VimLParser.prototype.parse_cmd_echon = function() {
|
10092 | var node = Node(NODE_ECHON);
|
10093 | node.pos = this.ea.cmdpos;
|
10094 | node.ea = this.ea;
|
10095 | node.list = this.parse_exprlist();
|
10096 | this.add_node(node);
|
10097 | }
|
10098 |
|
10099 | VimLParser.prototype.parse_cmd_echohl = function() {
|
10100 | var node = Node(NODE_ECHOHL);
|
10101 | node.pos = this.ea.cmdpos;
|
10102 | node.ea = this.ea;
|
10103 | node.str = "";
|
10104 | while (!this.ends_excmds(this.reader.peek())) {
|
10105 | node.str += this.reader.get();
|
10106 | }
|
10107 | this.add_node(node);
|
10108 | }
|
10109 |
|
10110 | VimLParser.prototype.parse_cmd_echomsg = function() {
|
10111 | var node = Node(NODE_ECHOMSG);
|
10112 | node.pos = this.ea.cmdpos;
|
10113 | node.ea = this.ea;
|
10114 | node.list = this.parse_exprlist();
|
10115 | this.add_node(node);
|
10116 | }
|
10117 |
|
10118 | VimLParser.prototype.parse_cmd_echoerr = function() {
|
10119 | var node = Node(NODE_ECHOERR);
|
10120 | node.pos = this.ea.cmdpos;
|
10121 | node.ea = this.ea;
|
10122 | node.list = this.parse_exprlist();
|
10123 | this.add_node(node);
|
10124 | }
|
10125 |
|
10126 | VimLParser.prototype.parse_cmd_execute = function() {
|
10127 | var node = Node(NODE_EXECUTE);
|
10128 | node.pos = this.ea.cmdpos;
|
10129 | node.ea = this.ea;
|
10130 | node.list = this.parse_exprlist();
|
10131 | this.add_node(node);
|
10132 | }
|
10133 |
|
10134 | VimLParser.prototype.parse_expr = function() {
|
10135 | return new ExprParser(this.reader).parse();
|
10136 | }
|
10137 |
|
10138 | VimLParser.prototype.parse_exprlist = function() {
|
10139 | var list = [];
|
10140 | while (TRUE) {
|
10141 | this.reader.skip_white();
|
10142 | var c = this.reader.peek();
|
10143 | if (c != "\"" && this.ends_excmds(c)) {
|
10144 | break;
|
10145 | }
|
10146 | var node = this.parse_expr();
|
10147 | viml_add(list, node);
|
10148 | }
|
10149 | return list;
|
10150 | }
|
10151 |
|
10152 | VimLParser.prototype.parse_lvalue_func = function() {
|
10153 | var p = new LvalueParser(this.reader);
|
10154 | var node = p.parse();
|
10155 | if (node.type == NODE_IDENTIFIER || node.type == NODE_CURLYNAME || node.type == NODE_SUBSCRIPT || node.type == NODE_DOT || node.type == NODE_OPTION || node.type == NODE_ENV || node.type == NODE_REG) {
|
10156 | return node;
|
10157 | }
|
10158 | throw Err("Invalid Expression", node.pos);
|
10159 | }
|
10160 |
|
10161 |
|
10162 | VimLParser.prototype.parse_lvalue = function() {
|
10163 | var p = new LvalueParser(this.reader);
|
10164 | var node = p.parse();
|
10165 | if (node.type == NODE_IDENTIFIER) {
|
10166 | if (!isvarname(node.value)) {
|
10167 | throw Err(viml_printf("E461: Illegal variable name: %s", node.value), node.pos);
|
10168 | }
|
10169 | }
|
10170 | if (node.type == NODE_IDENTIFIER || node.type == NODE_CURLYNAME || node.type == NODE_SUBSCRIPT || node.type == NODE_SLICE || node.type == NODE_DOT || node.type == NODE_OPTION || node.type == NODE_ENV || node.type == NODE_REG) {
|
10171 | return node;
|
10172 | }
|
10173 | throw Err("Invalid Expression", node.pos);
|
10174 | }
|
10175 |
|
10176 |
|
10177 | VimLParser.prototype.parse_constlvalue = function() {
|
10178 | var p = new LvalueParser(this.reader);
|
10179 | var node = p.parse();
|
10180 | if (node.type == NODE_IDENTIFIER) {
|
10181 | if (!isvarname(node.value)) {
|
10182 | throw Err(viml_printf("E461: Illegal variable name: %s", node.value), node.pos);
|
10183 | }
|
10184 | }
|
10185 | if (node.type == NODE_IDENTIFIER || node.type == NODE_CURLYNAME) {
|
10186 | return node;
|
10187 | }
|
10188 | else if (node.type == NODE_SUBSCRIPT || node.type == NODE_SLICE || node.type == NODE_DOT) {
|
10189 | throw Err("E996: Cannot lock a list or dict", node.pos);
|
10190 | }
|
10191 | else if (node.type == NODE_OPTION) {
|
10192 | throw Err("E996: Cannot lock an option", node.pos);
|
10193 | }
|
10194 | else if (node.type == NODE_ENV) {
|
10195 | throw Err("E996: Cannot lock an environment variable", node.pos);
|
10196 | }
|
10197 | else if (node.type == NODE_REG) {
|
10198 | throw Err("E996: Cannot lock a register", node.pos);
|
10199 | }
|
10200 | throw Err("Invalid Expression", node.pos);
|
10201 | }
|
10202 |
|
10203 | VimLParser.prototype.parse_lvaluelist = function() {
|
10204 | var list = [];
|
10205 | var node = this.parse_expr();
|
10206 | viml_add(list, node);
|
10207 | while (TRUE) {
|
10208 | this.reader.skip_white();
|
10209 | if (this.ends_excmds(this.reader.peek())) {
|
10210 | break;
|
10211 | }
|
10212 | var node = this.parse_lvalue();
|
10213 | viml_add(list, node);
|
10214 | }
|
10215 | return list;
|
10216 | }
|
10217 |
|
10218 |
|
10219 | VimLParser.prototype.parse_letlhs = function() {
|
10220 | var lhs = {"left":NIL, "list":NIL, "rest":NIL};
|
10221 | var tokenizer = new ExprTokenizer(this.reader);
|
10222 | if (tokenizer.peek().type == TOKEN_SQOPEN) {
|
10223 | tokenizer.get();
|
10224 | lhs.list = [];
|
10225 | while (TRUE) {
|
10226 | var node = this.parse_lvalue();
|
10227 | viml_add(lhs.list, node);
|
10228 | var token = tokenizer.get();
|
10229 | if (token.type == TOKEN_SQCLOSE) {
|
10230 | break;
|
10231 | }
|
10232 | else if (token.type == TOKEN_COMMA) {
|
10233 | continue;
|
10234 | }
|
10235 | else if (token.type == TOKEN_SEMICOLON) {
|
10236 | var node = this.parse_lvalue();
|
10237 | lhs.rest = node;
|
10238 | var token = tokenizer.get();
|
10239 | if (token.type == TOKEN_SQCLOSE) {
|
10240 | break;
|
10241 | }
|
10242 | else {
|
10243 | throw Err(viml_printf("E475 Invalid argument: %s", token.value), token.pos);
|
10244 | }
|
10245 | }
|
10246 | else {
|
10247 | throw Err(viml_printf("E475 Invalid argument: %s", token.value), token.pos);
|
10248 | }
|
10249 | }
|
10250 | }
|
10251 | else {
|
10252 | lhs.left = this.parse_lvalue();
|
10253 | }
|
10254 | return lhs;
|
10255 | }
|
10256 |
|
10257 |
|
10258 | VimLParser.prototype.parse_constlhs = function() {
|
10259 | var lhs = {"left":NIL, "list":NIL, "rest":NIL};
|
10260 | var tokenizer = new ExprTokenizer(this.reader);
|
10261 | if (tokenizer.peek().type == TOKEN_SQOPEN) {
|
10262 | tokenizer.get();
|
10263 | lhs.list = [];
|
10264 | while (TRUE) {
|
10265 | var node = this.parse_lvalue();
|
10266 | viml_add(lhs.list, node);
|
10267 | var token = tokenizer.get();
|
10268 | if (token.type == TOKEN_SQCLOSE) {
|
10269 | break;
|
10270 | }
|
10271 | else if (token.type == TOKEN_COMMA) {
|
10272 | continue;
|
10273 | }
|
10274 | else if (token.type == TOKEN_SEMICOLON) {
|
10275 | var node = this.parse_lvalue();
|
10276 | lhs.rest = node;
|
10277 | var token = tokenizer.get();
|
10278 | if (token.type == TOKEN_SQCLOSE) {
|
10279 | break;
|
10280 | }
|
10281 | else {
|
10282 | throw Err(viml_printf("E475 Invalid argument: %s", token.value), token.pos);
|
10283 | }
|
10284 | }
|
10285 | else {
|
10286 | throw Err(viml_printf("E475 Invalid argument: %s", token.value), token.pos);
|
10287 | }
|
10288 | }
|
10289 | }
|
10290 | else {
|
10291 | lhs.left = this.parse_constlvalue();
|
10292 | }
|
10293 | return lhs;
|
10294 | }
|
10295 |
|
10296 | VimLParser.prototype.ends_excmds = function(c) {
|
10297 | return c == "" || c == "|" || c == "\"" || c == "<EOF>" || c == "<EOL>";
|
10298 | }
|
10299 |
|
10300 |
|
10301 | VimLParser.prototype.parse_wincmd = function() {
|
10302 | var c = this.reader.getn(1);
|
10303 | if (c == "") {
|
10304 | throw Err("E471: Argument required", this.reader.getpos());
|
10305 | }
|
10306 | else if (c == "g" || c == "\x07") {
|
10307 |
|
10308 | var c2 = this.reader.getn(1);
|
10309 | if (c2 == "" || iswhite(c2)) {
|
10310 | throw Err("E474: Invalid Argument", this.reader.getpos());
|
10311 | }
|
10312 | }
|
10313 | var end = this.reader.getpos();
|
10314 | this.reader.skip_white();
|
10315 | if (!this.ends_excmds(this.reader.peek())) {
|
10316 | throw Err("E474: Invalid Argument", this.reader.getpos());
|
10317 | }
|
10318 | var node = Node(NODE_EXCMD);
|
10319 | node.pos = this.ea.cmdpos;
|
10320 | node.ea = this.ea;
|
10321 | node.str = this.reader.getstr(this.ea.linepos, end);
|
10322 | this.add_node(node);
|
10323 | }
|
10324 |
|
10325 |
|
10326 | VimLParser.prototype.parse_cmd_syntax = function() {
|
10327 | var end = this.reader.getpos();
|
10328 | while (TRUE) {
|
10329 | var end = this.reader.getpos();
|
10330 | var c = this.reader.peek();
|
10331 | if (c == "/" || c == "'" || c == "\"") {
|
10332 | this.reader.getn(1);
|
10333 | this.parse_pattern(c);
|
10334 | }
|
10335 | else if (c == "=") {
|
10336 | this.reader.getn(1);
|
10337 | this.parse_pattern(" ");
|
10338 | }
|
10339 | else if (this.ends_excmds(c)) {
|
10340 | break;
|
10341 | }
|
10342 | this.reader.getn(1);
|
10343 | }
|
10344 | var node = Node(NODE_EXCMD);
|
10345 | node.pos = this.ea.cmdpos;
|
10346 | node.ea = this.ea;
|
10347 | node.str = this.reader.getstr(this.ea.linepos, end);
|
10348 | this.add_node(node);
|
10349 | }
|
10350 |
|
10351 | VimLParser.prototype.neovim_additional_commands = [{"name":"rshada", "minlen":3, "flags":"BANG|FILE1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"wshada", "minlen":3, "flags":"BANG|FILE1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}];
|
10352 | VimLParser.prototype.neovim_removed_commands = [{"name":"Print", "minlen":1, "flags":"RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"fixdel", "minlen":3, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"helpfind", "minlen":5, "flags":"EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"open", "minlen":1, "flags":"RANGE|BANG|EXTRA", "parser":"parse_cmd_common"}, {"name":"shell", "minlen":2, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"tearoff", "minlen":2, "flags":"NEEDARG|EXTRA|TRLBAR|NOTRLCOM|CMDWIN", "parser":"parse_cmd_common"}, {"name":"gvim", "minlen":2, "flags":"BANG|FILES|EDITCMD|ARGOPT|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}];
|
10353 |
|
10354 |
|
10355 | VimLParser.prototype.builtin_commands = [{"name":"append", "minlen":1, "flags":"BANG|RANGE|ZEROR|TRLBAR|CMDWIN|MODIFY", "parser":"parse_cmd_append"}, {"name":"abbreviate", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"abclear", "minlen":3, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"aboveleft", "minlen":3, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"all", "minlen":2, "flags":"BANG|RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"amenu", "minlen":2, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"anoremenu", "minlen":2, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"args", "minlen":2, "flags":"BANG|FILES|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"argadd", "minlen":4, "flags":"BANG|NEEDARG|RANGE|NOTADR|ZEROR|FILES|TRLBAR", "parser":"parse_cmd_common"}, {"name":"argdelete", "minlen":4, "flags":"BANG|RANGE|NOTADR|FILES|TRLBAR", "parser":"parse_cmd_common"}, {"name":"argedit", "minlen":4, "flags":"BANG|NEEDARG|RANGE|NOTADR|FILE1|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"argdo", "minlen":5, "flags":"BANG|NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"argglobal", "minlen":4, "flags":"BANG|FILES|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"arglocal", "minlen":4, "flags":"BANG|FILES|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"argument", "minlen":4, "flags":"BANG|RANGE|NOTADR|COUNT|EXTRA|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"ascii", "minlen":2, "flags":"TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"autocmd", "minlen":2, "flags":"BANG|EXTRA|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"augroup", "minlen":3, "flags":"BANG|WORD1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"aunmenu", "minlen":3, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"buffer", "minlen":1, "flags":"BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|TRLBAR", "parser":"parse_cmd_common"}, {"name":"bNext", "minlen":2, "flags":"BANG|RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"ball", "minlen":2, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"badd", "minlen":3, "flags":"NEEDARG|FILE1|EDITCMD|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"bdelete", "minlen":2, "flags":"BANG|RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR", "parser":"parse_cmd_common"}, {"name":"behave", "minlen":2, "flags":"NEEDARG|WORD1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"belowright", "minlen":3, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"bfirst", "minlen":2, "flags":"BANG|RANGE|NOTADR|TRLBAR", "parser":"parse_cmd_common"}, {"name":"blast", "minlen":2, "flags":"BANG|RANGE|NOTADR|TRLBAR", "parser":"parse_cmd_common"}, {"name":"bmodified", "minlen":2, "flags":"BANG|RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"bnext", "minlen":2, "flags":"BANG|RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"botright", "minlen":2, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"bprevious", "minlen":2, "flags":"BANG|RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"brewind", "minlen":2, "flags":"BANG|RANGE|NOTADR|TRLBAR", "parser":"parse_cmd_common"}, {"name":"break", "minlen":4, "flags":"TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_break"}, {"name":"breakadd", "minlen":6, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"breakdel", "minlen":6, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"breaklist", "minlen":6, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"browse", "minlen":3, "flags":"NEEDARG|EXTRA|NOTRLCOM|CMDWIN", "parser":"parse_cmd_common"}, {"name":"bufdo", "minlen":5, "flags":"BANG|NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"buffers", "minlen":7, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"bunload", "minlen":3, "flags":"BANG|RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR", "parser":"parse_cmd_common"}, {"name":"bwipeout", "minlen":2, "flags":"BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|TRLBAR", "parser":"parse_cmd_common"}, {"name":"change", "minlen":1, "flags":"BANG|WHOLEFOLD|RANGE|COUNT|TRLBAR|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"cNext", "minlen":2, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"cNfile", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"cabbrev", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"cabclear", "minlen":4, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"caddbuffer", "minlen":3, "flags":"RANGE|NOTADR|WORD1|TRLBAR", "parser":"parse_cmd_common"}, {"name":"caddexpr", "minlen":5, "flags":"NEEDARG|WORD1|NOTRLCOM|TRLBAR", "parser":"parse_cmd_common"}, {"name":"caddfile", "minlen":5, "flags":"TRLBAR|FILE1", "parser":"parse_cmd_common"}, {"name":"call", "minlen":3, "flags":"RANGE|NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_call"}, {"name":"catch", "minlen":3, "flags":"EXTRA|SBOXOK|CMDWIN", "parser":"parse_cmd_catch"}, {"name":"cbuffer", "minlen":2, "flags":"BANG|RANGE|NOTADR|WORD1|TRLBAR", "parser":"parse_cmd_common"}, {"name":"cc", "minlen":2, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"cclose", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"cd", "minlen":2, "flags":"BANG|FILE1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"center", "minlen":2, "flags":"TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"cexpr", "minlen":3, "flags":"NEEDARG|WORD1|NOTRLCOM|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"cfile", "minlen":2, "flags":"TRLBAR|FILE1|BANG", "parser":"parse_cmd_common"}, {"name":"cfirst", "minlen":4, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"cgetbuffer", "minlen":5, "flags":"RANGE|NOTADR|WORD1|TRLBAR", "parser":"parse_cmd_common"}, {"name":"cgetexpr", "minlen":5, "flags":"NEEDARG|WORD1|NOTRLCOM|TRLBAR", "parser":"parse_cmd_common"}, {"name":"cgetfile", "minlen":2, "flags":"TRLBAR|FILE1", "parser":"parse_cmd_common"}, {"name":"changes", "minlen":7, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"chdir", "minlen":3, "flags":"BANG|FILE1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"checkpath", "minlen":3, "flags":"TRLBAR|BANG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"checktime", "minlen":6, "flags":"RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR", "parser":"parse_cmd_common"}, {"name":"clist", "minlen":2, "flags":"BANG|EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"clast", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"close", "minlen":3, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"cmap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"cmapclear", "minlen":5, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"cmenu", "minlen":3, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"cnext", "minlen":2, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"cnewer", "minlen":4, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"cnfile", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"cnoremap", "minlen":3, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"cnoreabbrev", "minlen":6, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"cnoremenu", "minlen":7, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"copy", "minlen":2, "flags":"RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"colder", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"colorscheme", "minlen":4, "flags":"WORD1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"command", "minlen":3, "flags":"EXTRA|BANG|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"comclear", "minlen":4, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"compiler", "minlen":4, "flags":"BANG|TRLBAR|WORD1|CMDWIN", "parser":"parse_cmd_common"}, {"name":"continue", "minlen":3, "flags":"TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_continue"}, {"name":"confirm", "minlen":4, "flags":"NEEDARG|EXTRA|NOTRLCOM|CMDWIN", "parser":"parse_cmd_common"}, {"name":"copen", "minlen":4, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"cprevious", "minlen":2, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"cpfile", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"cquit", "minlen":2, "flags":"TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"crewind", "minlen":2, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"cscope", "minlen":2, "flags":"EXTRA|NOTRLCOM|XFILE", "parser":"parse_cmd_common"}, {"name":"cstag", "minlen":3, "flags":"BANG|TRLBAR|WORD1", "parser":"parse_cmd_common"}, {"name":"cunmap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"cunabbrev", "minlen":4, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"cunmenu", "minlen":5, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"cwindow", "minlen":2, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"delete", "minlen":1, "flags":"RANGE|WHOLEFOLD|REGSTR|COUNT|TRLBAR|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"delmarks", "minlen":4, "flags":"BANG|EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"debug", "minlen":3, "flags":"NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"debuggreedy", "minlen":6, "flags":"RANGE|NOTADR|ZEROR|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"delcommand", "minlen":4, "flags":"NEEDARG|WORD1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"delfunction", "minlen":4, "flags":"BANG|NEEDARG|WORD1|CMDWIN", "parser":"parse_cmd_delfunction"}, {"name":"diffupdate", "minlen":3, "flags":"BANG|TRLBAR", "parser":"parse_cmd_common"}, {"name":"diffget", "minlen":5, "flags":"RANGE|EXTRA|TRLBAR|MODIFY", "parser":"parse_cmd_common"}, {"name":"diffoff", "minlen":5, "flags":"BANG|TRLBAR", "parser":"parse_cmd_common"}, {"name":"diffpatch", "minlen":5, "flags":"EXTRA|FILE1|TRLBAR|MODIFY", "parser":"parse_cmd_common"}, {"name":"diffput", "minlen":6, "flags":"RANGE|EXTRA|TRLBAR", "parser":"parse_cmd_common"}, {"name":"diffsplit", "minlen":5, "flags":"EXTRA|FILE1|TRLBAR", "parser":"parse_cmd_common"}, {"name":"diffthis", "minlen":5, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"digraphs", "minlen":3, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"display", "minlen":2, "flags":"EXTRA|NOTRLCOM|TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"djump", "minlen":2, "flags":"BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA", "parser":"parse_cmd_common"}, {"name":"dlist", "minlen":2, "flags":"BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN", "parser":"parse_cmd_common"}, {"name":"doautocmd", "minlen":2, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"doautoall", "minlen":7, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"drop", "minlen":2, "flags":"FILES|EDITCMD|NEEDARG|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"dsearch", "minlen":2, "flags":"BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN", "parser":"parse_cmd_common"}, {"name":"dsplit", "minlen":3, "flags":"BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA", "parser":"parse_cmd_common"}, {"name":"edit", "minlen":1, "flags":"BANG|FILE1|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"earlier", "minlen":2, "flags":"TRLBAR|EXTRA|NOSPC|CMDWIN", "parser":"parse_cmd_common"}, {"name":"echo", "minlen":2, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_echo"}, {"name":"echoerr", "minlen":5, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_echoerr"}, {"name":"echohl", "minlen":5, "flags":"EXTRA|TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_echohl"}, {"name":"echomsg", "minlen":5, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_echomsg"}, {"name":"echon", "minlen":5, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_echon"}, {"name":"else", "minlen":2, "flags":"TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_else"}, {"name":"elseif", "minlen":5, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_elseif"}, {"name":"emenu", "minlen":2, "flags":"NEEDARG|EXTRA|TRLBAR|NOTRLCOM|RANGE|NOTADR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"endif", "minlen":2, "flags":"TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_endif"}, {"name":"endfor", "minlen":5, "flags":"TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_endfor"}, {"name":"endfunction", "minlen":4, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_endfunction"}, {"name":"endtry", "minlen":4, "flags":"TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_endtry"}, {"name":"endwhile", "minlen":4, "flags":"TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_endwhile"}, {"name":"enew", "minlen":3, "flags":"BANG|TRLBAR", "parser":"parse_cmd_common"}, {"name":"eval", "minlen":2, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_eval"}, {"name":"ex", "minlen":2, "flags":"BANG|FILE1|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"execute", "minlen":3, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_execute"}, {"name":"exit", "minlen":3, "flags":"RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"exusage", "minlen":3, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"file", "minlen":1, "flags":"RANGE|NOTADR|ZEROR|BANG|FILE1|TRLBAR", "parser":"parse_cmd_common"}, {"name":"files", "minlen":5, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"filetype", "minlen":5, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"find", "minlen":3, "flags":"RANGE|NOTADR|BANG|FILE1|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"finally", "minlen":4, "flags":"TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_finally"}, {"name":"finish", "minlen":4, "flags":"TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_finish"}, {"name":"first", "minlen":3, "flags":"EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"fixdel", "minlen":3, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"fold", "minlen":2, "flags":"RANGE|WHOLEFOLD|TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"foldclose", "minlen":5, "flags":"RANGE|BANG|WHOLEFOLD|TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"folddoopen", "minlen":5, "flags":"RANGE|DFLALL|NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"folddoclosed", "minlen":7, "flags":"RANGE|DFLALL|NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"foldopen", "minlen":5, "flags":"RANGE|BANG|WHOLEFOLD|TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"for", "minlen":3, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_for"}, {"name":"function", "minlen":2, "flags":"EXTRA|BANG|CMDWIN", "parser":"parse_cmd_function"}, {"name":"global", "minlen":1, "flags":"RANGE|WHOLEFOLD|BANG|EXTRA|DFLALL|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"goto", "minlen":2, "flags":"RANGE|NOTADR|COUNT|TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"grep", "minlen":2, "flags":"RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE", "parser":"parse_cmd_common"}, {"name":"grepadd", "minlen":5, "flags":"RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE", "parser":"parse_cmd_common"}, {"name":"gui", "minlen":2, "flags":"BANG|FILES|EDITCMD|ARGOPT|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"gvim", "minlen":2, "flags":"BANG|FILES|EDITCMD|ARGOPT|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"hardcopy", "minlen":2, "flags":"RANGE|COUNT|EXTRA|TRLBAR|DFLALL|BANG", "parser":"parse_cmd_common"}, {"name":"help", "minlen":1, "flags":"BANG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"helpfind", "minlen":5, "flags":"EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"helpgrep", "minlen":5, "flags":"EXTRA|NOTRLCOM|NEEDARG", "parser":"parse_cmd_common"}, {"name":"helptags", "minlen":5, "flags":"NEEDARG|FILES|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"highlight", "minlen":2, "flags":"BANG|EXTRA|TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"hide", "minlen":3, "flags":"BANG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"history", "minlen":3, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"insert", "minlen":1, "flags":"BANG|RANGE|TRLBAR|CMDWIN|MODIFY", "parser":"parse_cmd_insert"}, {"name":"iabbrev", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"iabclear", "minlen":4, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"if", "minlen":2, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_if"}, {"name":"ijump", "minlen":2, "flags":"BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA", "parser":"parse_cmd_common"}, {"name":"ilist", "minlen":2, "flags":"BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN", "parser":"parse_cmd_common"}, {"name":"imap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"imapclear", "minlen":5, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"imenu", "minlen":3, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"inoremap", "minlen":3, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"inoreabbrev", "minlen":6, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"inoremenu", "minlen":7, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"intro", "minlen":3, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"isearch", "minlen":2, "flags":"BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN", "parser":"parse_cmd_common"}, {"name":"isplit", "minlen":3, "flags":"BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA", "parser":"parse_cmd_common"}, {"name":"iunmap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"iunabbrev", "minlen":4, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"iunmenu", "minlen":5, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"join", "minlen":1, "flags":"BANG|RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"jumps", "minlen":2, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"k", "minlen":1, "flags":"RANGE|WORD1|TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"keepalt", "minlen":5, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"keepmarks", "minlen":3, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"keepjumps", "minlen":5, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"keeppatterns", "minlen":5, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"lNext", "minlen":2, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"lNfile", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"list", "minlen":1, "flags":"RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"laddexpr", "minlen":3, "flags":"NEEDARG|WORD1|NOTRLCOM|TRLBAR", "parser":"parse_cmd_common"}, {"name":"laddbuffer", "minlen":5, "flags":"RANGE|NOTADR|WORD1|TRLBAR", "parser":"parse_cmd_common"}, {"name":"laddfile", "minlen":5, "flags":"TRLBAR|FILE1", "parser":"parse_cmd_common"}, {"name":"last", "minlen":2, "flags":"EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"language", "minlen":3, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"later", "minlen":3, "flags":"TRLBAR|EXTRA|NOSPC|CMDWIN", "parser":"parse_cmd_common"}, {"name":"lbuffer", "minlen":2, "flags":"BANG|RANGE|NOTADR|WORD1|TRLBAR", "parser":"parse_cmd_common"}, {"name":"lcd", "minlen":2, "flags":"BANG|FILE1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"lchdir", "minlen":3, "flags":"BANG|FILE1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"lclose", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"lcscope", "minlen":3, "flags":"EXTRA|NOTRLCOM|XFILE", "parser":"parse_cmd_common"}, {"name":"left", "minlen":2, "flags":"TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"leftabove", "minlen":5, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"let", "minlen":3, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_let"}, {"name":"const", "minlen":4, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_const"}, {"name":"lexpr", "minlen":3, "flags":"NEEDARG|WORD1|NOTRLCOM|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"lfile", "minlen":2, "flags":"TRLBAR|FILE1|BANG", "parser":"parse_cmd_common"}, {"name":"lfirst", "minlen":4, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"lgetbuffer", "minlen":5, "flags":"RANGE|NOTADR|WORD1|TRLBAR", "parser":"parse_cmd_common"}, {"name":"lgetexpr", "minlen":5, "flags":"NEEDARG|WORD1|NOTRLCOM|TRLBAR", "parser":"parse_cmd_common"}, {"name":"lgetfile", "minlen":2, "flags":"TRLBAR|FILE1", "parser":"parse_cmd_common"}, {"name":"lgrep", "minlen":3, "flags":"RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE", "parser":"parse_cmd_common"}, {"name":"lgrepadd", "minlen":6, "flags":"RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE", "parser":"parse_cmd_common"}, {"name":"lhelpgrep", "minlen":2, "flags":"EXTRA|NOTRLCOM|NEEDARG", "parser":"parse_cmd_common"}, {"name":"ll", "minlen":2, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"llast", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"list", "minlen":3, "flags":"BANG|EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"lmake", "minlen":4, "flags":"BANG|EXTRA|NOTRLCOM|TRLBAR|XFILE", "parser":"parse_cmd_common"}, {"name":"lmap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"lmapclear", "minlen":5, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"lnext", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"lnewer", "minlen":4, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"lnfile", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"lnoremap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"loadkeymap", "minlen":5, "flags":"CMDWIN", "parser":"parse_cmd_loadkeymap"}, {"name":"loadview", "minlen":2, "flags":"FILE1|TRLBAR", "parser":"parse_cmd_common"}, {"name":"lockmarks", "minlen":3, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"lockvar", "minlen":5, "flags":"BANG|EXTRA|NEEDARG|SBOXOK|CMDWIN", "parser":"parse_cmd_lockvar"}, {"name":"lolder", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"lopen", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"lprevious", "minlen":2, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"lpfile", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"lrewind", "minlen":2, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"ls", "minlen":2, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"ltag", "minlen":2, "flags":"NOTADR|TRLBAR|BANG|WORD1", "parser":"parse_cmd_common"}, {"name":"lunmap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"lua", "minlen":3, "flags":"RANGE|EXTRA|NEEDARG|CMDWIN", "parser":"parse_cmd_lua"}, {"name":"luado", "minlen":4, "flags":"RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"luafile", "minlen":4, "flags":"RANGE|FILE1|NEEDARG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"lvimgrep", "minlen":2, "flags":"RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE", "parser":"parse_cmd_common"}, {"name":"lvimgrepadd", "minlen":9, "flags":"RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE", "parser":"parse_cmd_common"}, {"name":"lwindow", "minlen":2, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"move", "minlen":1, "flags":"RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"mark", "minlen":2, "flags":"RANGE|WORD1|TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"make", "minlen":3, "flags":"BANG|EXTRA|NOTRLCOM|TRLBAR|XFILE", "parser":"parse_cmd_common"}, {"name":"map", "minlen":3, "flags":"BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"mapclear", "minlen":4, "flags":"EXTRA|BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"marks", "minlen":5, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"match", "minlen":3, "flags":"RANGE|NOTADR|EXTRA|CMDWIN", "parser":"parse_cmd_common"}, {"name":"menu", "minlen":2, "flags":"RANGE|NOTADR|ZEROR|BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"menutranslate", "minlen":5, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"messages", "minlen":3, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"mkexrc", "minlen":2, "flags":"BANG|FILE1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"mksession", "minlen":3, "flags":"BANG|FILE1|TRLBAR", "parser":"parse_cmd_common"}, {"name":"mkspell", "minlen":4, "flags":"BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE", "parser":"parse_cmd_common"}, {"name":"mkvimrc", "minlen":3, "flags":"BANG|FILE1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"mkview", "minlen":5, "flags":"BANG|FILE1|TRLBAR", "parser":"parse_cmd_common"}, {"name":"mode", "minlen":3, "flags":"WORD1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"mzscheme", "minlen":2, "flags":"RANGE|EXTRA|DFLALL|NEEDARG|CMDWIN|SBOXOK", "parser":"parse_cmd_mzscheme"}, {"name":"mzfile", "minlen":3, "flags":"RANGE|FILE1|NEEDARG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"nbclose", "minlen":3, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"nbkey", "minlen":2, "flags":"EXTRA|NOTADR|NEEDARG", "parser":"parse_cmd_common"}, {"name":"nbstart", "minlen":3, "flags":"WORD1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"next", "minlen":1, "flags":"RANGE|NOTADR|BANG|FILES|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"new", "minlen":3, "flags":"BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"nmap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"nmapclear", "minlen":5, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"nmenu", "minlen":3, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"nnoremap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"nnoremenu", "minlen":7, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"noautocmd", "minlen":3, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"noremap", "minlen":2, "flags":"BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"nohlsearch", "minlen":3, "flags":"TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"noreabbrev", "minlen":5, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"noremenu", "minlen":6, "flags":"RANGE|NOTADR|ZEROR|BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"normal", "minlen":4, "flags":"RANGE|BANG|EXTRA|NEEDARG|NOTRLCOM|USECTRLV|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"number", "minlen":2, "flags":"RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"nunmap", "minlen":3, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"nunmenu", "minlen":5, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"oldfiles", "minlen":2, "flags":"BANG|TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"open", "minlen":1, "flags":"RANGE|BANG|EXTRA", "parser":"parse_cmd_common"}, {"name":"omap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"omapclear", "minlen":5, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"omenu", "minlen":3, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"only", "minlen":2, "flags":"BANG|TRLBAR", "parser":"parse_cmd_common"}, {"name":"onoremap", "minlen":3, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"onoremenu", "minlen":7, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"options", "minlen":3, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"ounmap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"ounmenu", "minlen":5, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"ownsyntax", "minlen":2, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"pclose", "minlen":2, "flags":"BANG|TRLBAR", "parser":"parse_cmd_common"}, {"name":"pedit", "minlen":3, "flags":"BANG|FILE1|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"perl", "minlen":2, "flags":"RANGE|EXTRA|DFLALL|NEEDARG|SBOXOK|CMDWIN", "parser":"parse_cmd_perl"}, {"name":"print", "minlen":1, "flags":"RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|SBOXOK", "parser":"parse_cmd_common"}, {"name":"profdel", "minlen":5, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"profile", "minlen":4, "flags":"BANG|EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"promptfind", "minlen":3, "flags":"EXTRA|NOTRLCOM|CMDWIN", "parser":"parse_cmd_common"}, {"name":"promptrepl", "minlen":7, "flags":"EXTRA|NOTRLCOM|CMDWIN", "parser":"parse_cmd_common"}, {"name":"perldo", "minlen":5, "flags":"RANGE|EXTRA|DFLALL|NEEDARG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"pop", "minlen":2, "flags":"RANGE|NOTADR|BANG|COUNT|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"popup", "minlen":4, "flags":"NEEDARG|EXTRA|BANG|TRLBAR|NOTRLCOM|CMDWIN", "parser":"parse_cmd_common"}, {"name":"ppop", "minlen":2, "flags":"RANGE|NOTADR|BANG|COUNT|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"preserve", "minlen":3, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"previous", "minlen":4, "flags":"EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"psearch", "minlen":2, "flags":"BANG|RANGE|WHOLEFOLD|DFLALL|EXTRA", "parser":"parse_cmd_common"}, {"name":"ptag", "minlen":2, "flags":"RANGE|NOTADR|BANG|WORD1|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"ptNext", "minlen":3, "flags":"RANGE|NOTADR|BANG|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"ptfirst", "minlen":3, "flags":"RANGE|NOTADR|BANG|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"ptjump", "minlen":3, "flags":"BANG|TRLBAR|WORD1", "parser":"parse_cmd_common"}, {"name":"ptlast", "minlen":3, "flags":"BANG|TRLBAR", "parser":"parse_cmd_common"}, {"name":"ptnext", "minlen":3, "flags":"RANGE|NOTADR|BANG|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"ptprevious", "minlen":3, "flags":"RANGE|NOTADR|BANG|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"ptrewind", "minlen":3, "flags":"RANGE|NOTADR|BANG|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"ptselect", "minlen":3, "flags":"BANG|TRLBAR|WORD1", "parser":"parse_cmd_common"}, {"name":"put", "minlen":2, "flags":"RANGE|WHOLEFOLD|BANG|REGSTR|TRLBAR|ZEROR|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"pwd", "minlen":2, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"py3", "minlen":3, "flags":"RANGE|EXTRA|NEEDARG|CMDWIN", "parser":"parse_cmd_python3"}, {"name":"python3", "minlen":7, "flags":"RANGE|EXTRA|NEEDARG|CMDWIN", "parser":"parse_cmd_python3"}, {"name":"py3file", "minlen":4, "flags":"RANGE|FILE1|NEEDARG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"python", "minlen":2, "flags":"RANGE|EXTRA|NEEDARG|CMDWIN", "parser":"parse_cmd_python"}, {"name":"pyfile", "minlen":3, "flags":"RANGE|FILE1|NEEDARG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"pydo", "minlen":3, "flags":"RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"py3do", "minlen":4, "flags":"RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"quit", "minlen":1, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"quitall", "minlen":5, "flags":"BANG|TRLBAR", "parser":"parse_cmd_common"}, {"name":"qall", "minlen":2, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"read", "minlen":1, "flags":"BANG|RANGE|WHOLEFOLD|FILE1|ARGOPT|TRLBAR|ZEROR|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"recover", "minlen":3, "flags":"BANG|FILE1|TRLBAR", "parser":"parse_cmd_common"}, {"name":"redo", "minlen":3, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"redir", "minlen":4, "flags":"BANG|FILES|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"redraw", "minlen":4, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"redrawstatus", "minlen":7, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"registers", "minlen":3, "flags":"EXTRA|NOTRLCOM|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"resize", "minlen":3, "flags":"RANGE|NOTADR|TRLBAR|WORD1", "parser":"parse_cmd_common"}, {"name":"retab", "minlen":3, "flags":"TRLBAR|RANGE|WHOLEFOLD|DFLALL|BANG|WORD1|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"return", "minlen":4, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_return"}, {"name":"rewind", "minlen":3, "flags":"EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"right", "minlen":2, "flags":"TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"rightbelow", "minlen":6, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"ruby", "minlen":3, "flags":"RANGE|EXTRA|NEEDARG|CMDWIN", "parser":"parse_cmd_ruby"}, {"name":"rubydo", "minlen":5, "flags":"RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"rubyfile", "minlen":5, "flags":"RANGE|FILE1|NEEDARG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"rundo", "minlen":4, "flags":"NEEDARG|FILE1", "parser":"parse_cmd_common"}, {"name":"runtime", "minlen":2, "flags":"BANG|NEEDARG|FILES|TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"rviminfo", "minlen":2, "flags":"BANG|FILE1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"substitute", "minlen":1, "flags":"RANGE|WHOLEFOLD|EXTRA|CMDWIN", "parser":"parse_cmd_common"}, {"name":"sNext", "minlen":2, "flags":"EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"sandbox", "minlen":3, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"sargument", "minlen":2, "flags":"BANG|RANGE|NOTADR|COUNT|EXTRA|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"sall", "minlen":3, "flags":"BANG|RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"saveas", "minlen":3, "flags":"BANG|DFLALL|FILE1|ARGOPT|CMDWIN|TRLBAR", "parser":"parse_cmd_common"}, {"name":"sbuffer", "minlen":2, "flags":"BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|TRLBAR", "parser":"parse_cmd_common"}, {"name":"sbNext", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"sball", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"sbfirst", "minlen":3, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"sblast", "minlen":3, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"sbmodified", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"sbnext", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"sbprevious", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"sbrewind", "minlen":3, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"scriptnames", "minlen":3, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"scriptencoding", "minlen":7, "flags":"WORD1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"scscope", "minlen":3, "flags":"EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"set", "minlen":2, "flags":"TRLBAR|EXTRA|CMDWIN|SBOXOK", "parser":"parse_cmd_common"}, {"name":"setfiletype", "minlen":4, "flags":"TRLBAR|EXTRA|NEEDARG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"setglobal", "minlen":4, "flags":"TRLBAR|EXTRA|CMDWIN|SBOXOK", "parser":"parse_cmd_common"}, {"name":"setlocal", "minlen":4, "flags":"TRLBAR|EXTRA|CMDWIN|SBOXOK", "parser":"parse_cmd_common"}, {"name":"sfind", "minlen":2, "flags":"BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"sfirst", "minlen":4, "flags":"EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"shell", "minlen":2, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"simalt", "minlen":3, "flags":"NEEDARG|WORD1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"sign", "minlen":3, "flags":"NEEDARG|RANGE|NOTADR|EXTRA|CMDWIN", "parser":"parse_cmd_common"}, {"name":"silent", "minlen":3, "flags":"NEEDARG|EXTRA|BANG|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"sleep", "minlen":2, "flags":"RANGE|NOTADR|COUNT|EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"slast", "minlen":3, "flags":"EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"smagic", "minlen":2, "flags":"RANGE|WHOLEFOLD|EXTRA|CMDWIN", "parser":"parse_cmd_common"}, {"name":"smap", "minlen":4, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"smapclear", "minlen":5, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"smenu", "minlen":3, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"snext", "minlen":2, "flags":"RANGE|NOTADR|BANG|FILES|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"sniff", "minlen":3, "flags":"EXTRA|TRLBAR", "parser":"parse_cmd_common"}, {"name":"snomagic", "minlen":3, "flags":"RANGE|WHOLEFOLD|EXTRA|CMDWIN", "parser":"parse_cmd_common"}, {"name":"snoremap", "minlen":4, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"snoremenu", "minlen":7, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"sort", "minlen":3, "flags":"RANGE|DFLALL|WHOLEFOLD|BANG|EXTRA|NOTRLCOM|MODIFY", "parser":"parse_cmd_common"}, {"name":"source", "minlen":2, "flags":"BANG|FILE1|TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"spelldump", "minlen":6, "flags":"BANG|TRLBAR", "parser":"parse_cmd_common"}, {"name":"spellgood", "minlen":3, "flags":"BANG|RANGE|NOTADR|NEEDARG|EXTRA|TRLBAR", "parser":"parse_cmd_common"}, {"name":"spellinfo", "minlen":6, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"spellrepall", "minlen":6, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"spellundo", "minlen":6, "flags":"BANG|RANGE|NOTADR|NEEDARG|EXTRA|TRLBAR", "parser":"parse_cmd_common"}, {"name":"spellwrong", "minlen":6, "flags":"BANG|RANGE|NOTADR|NEEDARG|EXTRA|TRLBAR", "parser":"parse_cmd_common"}, {"name":"split", "minlen":2, "flags":"BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"sprevious", "minlen":3, "flags":"EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"srewind", "minlen":3, "flags":"EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"stop", "minlen":2, "flags":"TRLBAR|BANG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"stag", "minlen":3, "flags":"RANGE|NOTADR|BANG|WORD1|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"startinsert", "minlen":4, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"startgreplace", "minlen":6, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"startreplace", "minlen":6, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"stopinsert", "minlen":5, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"stjump", "minlen":3, "flags":"BANG|TRLBAR|WORD1", "parser":"parse_cmd_common"}, {"name":"stselect", "minlen":3, "flags":"BANG|TRLBAR|WORD1", "parser":"parse_cmd_common"}, {"name":"sunhide", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"sunmap", "minlen":4, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"sunmenu", "minlen":5, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"suspend", "minlen":3, "flags":"TRLBAR|BANG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"sview", "minlen":2, "flags":"BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"swapname", "minlen":2, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"syntax", "minlen":2, "flags":"EXTRA|NOTRLCOM|CMDWIN", "parser":"parse_cmd_syntax"}, {"name":"syntime", "minlen":5, "flags":"NEEDARG|WORD1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"syncbind", "minlen":4, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"t", "minlen":1, "flags":"RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"tNext", "minlen":2, "flags":"RANGE|NOTADR|BANG|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"tabNext", "minlen":4, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"tabclose", "minlen":4, "flags":"RANGE|NOTADR|COUNT|BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"tabdo", "minlen":4, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"tabedit", "minlen":4, "flags":"BANG|FILE1|RANGE|NOTADR|ZEROR|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"tabfind", "minlen":4, "flags":"BANG|FILE1|RANGE|NOTADR|ZEROR|EDITCMD|ARGOPT|NEEDARG|TRLBAR", "parser":"parse_cmd_common"}, {"name":"tabfirst", "minlen":6, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"tablast", "minlen":4, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"tabmove", "minlen":4, "flags":"RANGE|NOTADR|ZEROR|EXTRA|NOSPC|TRLBAR", "parser":"parse_cmd_common"}, {"name":"tabnew", "minlen":6, "flags":"BANG|FILE1|RANGE|NOTADR|ZEROR|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"tabnext", "minlen":4, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"tabonly", "minlen":4, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"tabprevious", "minlen":4, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"tabrewind", "minlen":4, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"tabs", "minlen":4, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"tab", "minlen":3, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"tag", "minlen":2, "flags":"RANGE|NOTADR|BANG|WORD1|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"tags", "minlen":4, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"tcl", "minlen":2, "flags":"RANGE|EXTRA|NEEDARG|CMDWIN", "parser":"parse_cmd_tcl"}, {"name":"tcldo", "minlen":4, "flags":"RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"tclfile", "minlen":4, "flags":"RANGE|FILE1|NEEDARG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"tearoff", "minlen":2, "flags":"NEEDARG|EXTRA|TRLBAR|NOTRLCOM|CMDWIN", "parser":"parse_cmd_common"}, {"name":"tfirst", "minlen":2, "flags":"RANGE|NOTADR|BANG|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"throw", "minlen":2, "flags":"EXTRA|NEEDARG|SBOXOK|CMDWIN", "parser":"parse_cmd_throw"}, {"name":"tjump", "minlen":2, "flags":"BANG|TRLBAR|WORD1", "parser":"parse_cmd_common"}, {"name":"tlast", "minlen":2, "flags":"BANG|TRLBAR", "parser":"parse_cmd_common"}, {"name":"tmenu", "minlen":2, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"tnext", "minlen":2, "flags":"RANGE|NOTADR|BANG|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"topleft", "minlen":2, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"tprevious", "minlen":2, "flags":"RANGE|NOTADR|BANG|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"trewind", "minlen":2, "flags":"RANGE|NOTADR|BANG|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"try", "minlen":3, "flags":"TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_try"}, {"name":"tselect", "minlen":2, "flags":"BANG|TRLBAR|WORD1", "parser":"parse_cmd_common"}, {"name":"tunmenu", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"undo", "minlen":1, "flags":"RANGE|NOTADR|COUNT|ZEROR|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"undojoin", "minlen":5, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"undolist", "minlen":5, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"unabbreviate", "minlen":3, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"unhide", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"unlet", "minlen":3, "flags":"BANG|EXTRA|NEEDARG|SBOXOK|CMDWIN", "parser":"parse_cmd_unlet"}, {"name":"unlockvar", "minlen":4, "flags":"BANG|EXTRA|NEEDARG|SBOXOK|CMDWIN", "parser":"parse_cmd_unlockvar"}, {"name":"unmap", "minlen":3, "flags":"BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"unmenu", "minlen":4, "flags":"BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"unsilent", "minlen":3, "flags":"NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"update", "minlen":2, "flags":"RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR", "parser":"parse_cmd_common"}, {"name":"vglobal", "minlen":1, "flags":"RANGE|WHOLEFOLD|EXTRA|DFLALL|CMDWIN", "parser":"parse_cmd_common"}, {"name":"version", "minlen":2, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"verbose", "minlen":4, "flags":"NEEDARG|RANGE|NOTADR|EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"vertical", "minlen":4, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"vimgrep", "minlen":3, "flags":"RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE", "parser":"parse_cmd_common"}, {"name":"vimgrepadd", "minlen":8, "flags":"RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE", "parser":"parse_cmd_common"}, {"name":"visual", "minlen":2, "flags":"BANG|FILE1|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"viusage", "minlen":3, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"view", "minlen":3, "flags":"BANG|FILE1|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"vmap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"vmapclear", "minlen":5, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"vmenu", "minlen":3, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"vnew", "minlen":3, "flags":"BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"vnoremap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"vnoremenu", "minlen":7, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"vsplit", "minlen":2, "flags":"BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"vunmap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"vunmenu", "minlen":5, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"windo", "minlen":5, "flags":"BANG|NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"write", "minlen":1, "flags":"RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"wNext", "minlen":2, "flags":"RANGE|WHOLEFOLD|NOTADR|BANG|FILE1|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"wall", "minlen":2, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"while", "minlen":2, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_while"}, {"name":"winsize", "minlen":2, "flags":"EXTRA|NEEDARG|TRLBAR", "parser":"parse_cmd_common"}, {"name":"wincmd", "minlen":4, "flags":"NEEDARG|WORD1|RANGE|NOTADR", "parser":"parse_wincmd"}, {"name":"winpos", "minlen":4, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"wnext", "minlen":2, "flags":"RANGE|NOTADR|BANG|FILE1|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"wprevious", "minlen":2, "flags":"RANGE|NOTADR|BANG|FILE1|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"wq", "minlen":2, "flags":"RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR", "parser":"parse_cmd_common"}, {"name":"wqall", "minlen":3, "flags":"BANG|FILE1|ARGOPT|DFLALL|TRLBAR", "parser":"parse_cmd_common"}, {"name":"wsverb", "minlen":2, "flags":"EXTRA|NOTADR|NEEDARG", "parser":"parse_cmd_common"}, {"name":"wundo", "minlen":2, "flags":"BANG|NEEDARG|FILE1", "parser":"parse_cmd_common"}, {"name":"wviminfo", "minlen":2, "flags":"BANG|FILE1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"xit", "minlen":1, "flags":"RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"xall", "minlen":2, "flags":"BANG|TRLBAR", "parser":"parse_cmd_common"}, {"name":"xmapclear", "minlen":5, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"xmap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"xmenu", "minlen":3, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"xnoremap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"xnoremenu", "minlen":7, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"xunmap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"xunmenu", "minlen":5, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"yank", "minlen":1, "flags":"RANGE|WHOLEFOLD|REGSTR|COUNT|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"z", "minlen":1, "flags":"RANGE|WHOLEFOLD|EXTRA|EXFLAGS|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"!", "minlen":1, "flags":"RANGE|WHOLEFOLD|BANG|FILES|CMDWIN", "parser":"parse_cmd_common"}, {"name":"#", "minlen":1, "flags":"RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"&", "minlen":1, "flags":"RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"*", "minlen":1, "flags":"RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"<", "minlen":1, "flags":"RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"=", "minlen":1, "flags":"RANGE|TRLBAR|DFLALL|EXFLAGS|CMDWIN", "parser":"parse_cmd_common"}, {"name":">", "minlen":1, "flags":"RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"@", "minlen":1, "flags":"RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"Next", "minlen":1, "flags":"EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"Print", "minlen":1, "flags":"RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"X", "minlen":1, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"~", "minlen":1, "flags":"RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"flags":"TRLBAR", "minlen":3, "name":"cbottom", "parser":"parse_cmd_common"}, {"flags":"BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL", "minlen":3, "name":"cdo", "parser":"parse_cmd_common"}, {"flags":"BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL", "minlen":3, "name":"cfdo", "parser":"parse_cmd_common"}, {"flags":"TRLBAR", "minlen":3, "name":"chistory", "parser":"parse_cmd_common"}, {"flags":"TRLBAR|CMDWIN", "minlen":3, "name":"clearjumps", "parser":"parse_cmd_common"}, {"flags":"BANG|NEEDARG|EXTRA|NOTRLCOM", "minlen":4, "name":"filter", "parser":"parse_cmd_common"}, {"flags":"RANGE|NOTADR|COUNT|TRLBAR", "minlen":5, "name":"helpclose", "parser":"parse_cmd_common"}, {"flags":"TRLBAR", "minlen":3, "name":"lbottom", "parser":"parse_cmd_common"}, {"flags":"BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL", "minlen":2, "name":"ldo", "parser":"parse_cmd_common"}, {"flags":"BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL", "minlen":3, "name":"lfdo", "parser":"parse_cmd_common"}, {"flags":"TRLBAR", "minlen":3, "name":"lhistory", "parser":"parse_cmd_common"}, {"flags":"BANG|EXTRA|TRLBAR|CMDWIN", "minlen":3, "name":"llist", "parser":"parse_cmd_common"}, {"flags":"NEEDARG|EXTRA|NOTRLCOM", "minlen":3, "name":"noswapfile", "parser":"parse_cmd_common"}, {"flags":"BANG|FILE1|NEEDARG|TRLBAR|SBOXOK|CMDWIN", "minlen":2, "name":"packadd", "parser":"parse_cmd_common"}, {"flags":"BANG|TRLBAR|SBOXOK|CMDWIN", "minlen":5, "name":"packloadall", "parser":"parse_cmd_common"}, {"flags":"TRLBAR|CMDWIN|SBOXOK", "minlen":3, "name":"smile", "parser":"parse_cmd_common"}, {"flags":"RANGE|EXTRA|NEEDARG|CMDWIN", "minlen":3, "name":"pyx", "parser":"parse_cmd_common"}, {"flags":"RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN", "minlen":4, "name":"pyxdo", "parser":"parse_cmd_common"}, {"flags":"RANGE|EXTRA|NEEDARG|CMDWIN", "minlen":7, "name":"pythonx", "parser":"parse_cmd_common"}, {"flags":"RANGE|FILE1|NEEDARG|CMDWIN", "minlen":4, "name":"pyxfile", "parser":"parse_cmd_common"}, {"flags":"RANGE|BANG|FILES|CMDWIN", "minlen":3, "name":"terminal", "parser":"parse_cmd_common"}, {"flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "minlen":3, "name":"tmap", "parser":"parse_cmd_common"}, {"flags":"EXTRA|TRLBAR|CMDWIN", "minlen":5, "name":"tmapclear", "parser":"parse_cmd_common"}, {"flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "minlen":3, "name":"tnoremap", "parser":"parse_cmd_common"}, {"flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "minlen":5, "name":"tunmap", "parser":"parse_cmd_common"}, {"flags":"RANGE|COUNT|TRLBAR", "minlen":4, "name":"cabove", "parser":"parse_cmd_common"}, {"flags":"RANGE|COUNT|TRLBAR", "minlen":3, "name":"cafter", "parser":"parse_cmd_common"}, {"flags":"RANGE|COUNT|TRLBAR", "minlen":3, "name":"cbefore", "parser":"parse_cmd_common"}, {"flags":"RANGE|COUNT|TRLBAR", "minlen":4, "name":"cbelow", "parser":"parse_cmd_common"}, {"flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "minlen":4, "name":"const", "parser":"parse_cmd_common"}, {"flags":"RANGE|COUNT|TRLBAR", "minlen":3, "name":"labove", "parser":"parse_cmd_common"}, {"flags":"RANGE|COUNT|TRLBAR", "minlen":3, "name":"lafter", "parser":"parse_cmd_common"}, {"flags":"RANGE|COUNT|TRLBAR", "minlen":3, "name":"lbefore", "parser":"parse_cmd_common"}, {"flags":"RANGE|COUNT|TRLBAR", "minlen":4, "name":"lbelow", "parser":"parse_cmd_common"}, {"flags":"TRLBAR|CMDWIN", "minlen":7, "name":"redrawtabline", "parser":"parse_cmd_common"}, {"flags":"WORD1|TRLBAR|CMDWIN", "minlen":7, "name":"scriptversion", "parser":"parse_cmd_common"}, {"flags":"BANG|FILE1|TRLBAR|CMDWIN", "minlen":2, "name":"tcd", "parser":"parse_cmd_common"}, {"flags":"BANG|FILE1|TRLBAR|CMDWIN", "minlen":3, "name":"tchdir", "parser":"parse_cmd_common"}, {"flags":"RANGE|ZEROR|EXTRA|TRLBAR|NOTRLCOM|CTRLV|CMDWIN", "minlen":3, "name":"tlmenu", "parser":"parse_cmd_common"}, {"flags":"RANGE|ZEROR|EXTRA|TRLBAR|NOTRLCOM|CTRLV|CMDWIN", "minlen":3, "name":"tlnoremenu", "parser":"parse_cmd_common"}, {"flags":"RANGE|ZEROR|EXTRA|TRLBAR|NOTRLCOM|CTRLV|CMDWIN", "minlen":3, "name":"tlunmenu", "parser":"parse_cmd_common"}, {"flags":"EXTRA|TRLBAR|CMDWIN", "minlen":2, "name":"xrestore", "parser":"parse_cmd_common"}, {"flags":"EXTRA|BANG|SBOXOK|CMDWIN", "minlen":3, "name":"def", "parser":"parse_cmd_common"}, {"flags":"EXTRA|NEEDARG|TRLBAR|CMDWIN", "minlen":4, "name":"disassemble", "parser":"parse_cmd_common"}, {"flags":"TRLBAR|CMDWIN", "minlen":4, "name":"enddef", "parser":"parse_cmd_common"}, {"flags":"EXTRA|NOTRLCOM", "minlen":3, "name":"export", "parser":"parse_cmd_common"}, {"flags":"EXTRA|NOTRLCOM", "minlen":3, "name":"import", "parser":"parse_cmd_common"}, {"flags":"BANG|RANGE|NEEDARG|EXTRA|TRLBAR", "minlen":7, "name":"spellrare", "parser":"parse_cmd_common"}, {"flags":"", "minlen":4, "name":"vim9script", "parser":"parse_cmd_common"}];
|
10356 |
|
10357 |
|
10358 | VimLParser.prototype.builtin_functions = [{"name":"abs", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"acos", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"add", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"and", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"append", "min_argc":2, "max_argc":2, "argtype":"FEARG_LAST"}, {"name":"appendbufline", "min_argc":3, "max_argc":3, "argtype":"FEARG_LAST"}, {"name":"argc", "min_argc":0, "max_argc":1, "argtype":"0"}, {"name":"argidx", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"arglistid", "min_argc":0, "max_argc":2, "argtype":"0"}, {"name":"argv", "min_argc":0, "max_argc":2, "argtype":"0"}, {"name":"asin", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"assert_beeps", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"assert_equal", "min_argc":2, "max_argc":3, "argtype":"FEARG_2"}, {"name":"assert_equalfile", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"assert_exception", "min_argc":1, "max_argc":2, "argtype":"0"}, {"name":"assert_fails", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"assert_false", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"assert_inrange", "min_argc":3, "max_argc":4, "argtype":"FEARG_3"}, {"name":"assert_match", "min_argc":2, "max_argc":3, "argtype":"FEARG_2"}, {"name":"assert_notequal", "min_argc":2, "max_argc":3, "argtype":"FEARG_2"}, {"name":"assert_notmatch", "min_argc":2, "max_argc":3, "argtype":"FEARG_2"}, {"name":"assert_report", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"assert_true", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"atan", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"atan2", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"balloon_gettext", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"balloon_show", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"balloon_split", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"browse", "min_argc":4, "max_argc":4, "argtype":"0"}, {"name":"browsedir", "min_argc":2, "max_argc":2, "argtype":"0"}, {"name":"bufadd", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"bufexists", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"buffer_exists", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"buffer_name", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"buffer_number", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"buflisted", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"bufload", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"bufloaded", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"bufname", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"bufnr", "min_argc":0, "max_argc":2, "argtype":"FEARG_1"}, {"name":"bufwinid", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"bufwinnr", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"byte2line", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"byteidx", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"byteidxcomp", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"call", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"ceil", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"ch_canread", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"ch_close", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"ch_close_in", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"ch_evalexpr", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"ch_evalraw", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"ch_getbufnr", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"ch_getjob", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"ch_info", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"ch_log", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"ch_logfile", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"ch_open", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"ch_read", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"ch_readblob", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"ch_readraw", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"ch_sendexpr", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"ch_sendraw", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"ch_setoptions", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"ch_status", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"changenr", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"char2nr", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"chdir", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"cindent", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"clearmatches", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"col", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"complete", "min_argc":2, "max_argc":2, "argtype":"FEARG_2"}, {"name":"complete_add", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"complete_check", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"complete_info", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"confirm", "min_argc":1, "max_argc":4, "argtype":"FEARG_1"}, {"name":"copy", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"cos", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"cosh", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"count", "min_argc":2, "max_argc":4, "argtype":"FEARG_1"}, {"name":"cscope_connection", "min_argc":0, "max_argc":3, "argtype":"0"}, {"name":"cursor", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"debugbreak", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"deepcopy", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"delete", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"deletebufline", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"did_filetype", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"diff_filler", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"diff_hlID", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"echoraw", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"empty", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"environ", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"escape", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"eval", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"eventhandler", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"executable", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"execute", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"exepath", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"exists", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"exp", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"expand", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"expandcmd", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"extend", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"feedkeys", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"file_readable", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"filereadable", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"filewritable", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"filter", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"finddir", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"findfile", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"float2nr", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"floor", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"fmod", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"fnameescape", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"fnamemodify", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"foldclosed", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"foldclosedend", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"foldlevel", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"foldtext", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"foldtextresult", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"foreground", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"funcref", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"function", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"garbagecollect", "min_argc":0, "max_argc":1, "argtype":"0"}, {"name":"get", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"getbufinfo", "min_argc":0, "max_argc":1, "argtype":"0"}, {"name":"getbufline", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"getbufvar", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"getchangelist", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"getchar", "min_argc":0, "max_argc":1, "argtype":"0"}, {"name":"getcharmod", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"getcharsearch", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"getcmdline", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"getcmdpos", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"getcmdtype", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"getcmdwintype", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"getcompletion", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"getcurpos", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"getcwd", "min_argc":0, "max_argc":2, "argtype":"FEARG_1"}, {"name":"getenv", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"getfontname", "min_argc":0, "max_argc":1, "argtype":"0"}, {"name":"getfperm", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"getfsize", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"getftime", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"getftype", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"getimstatus", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"getjumplist", "min_argc":0, "max_argc":2, "argtype":"FEARG_1"}, {"name":"getline", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"getloclist", "min_argc":1, "max_argc":2, "argtype":"0"}, {"name":"getmatches", "min_argc":0, "max_argc":1, "argtype":"0"}, {"name":"getmousepos", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"getpid", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"getpos", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"getqflist", "min_argc":0, "max_argc":1, "argtype":"0"}, {"name":"getreg", "min_argc":0, "max_argc":3, "argtype":"FEARG_1"}, {"name":"getregtype", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"gettabinfo", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"gettabvar", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"gettabwinvar", "min_argc":3, "max_argc":4, "argtype":"FEARG_1"}, {"name":"gettagstack", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"getwininfo", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"getwinpos", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"getwinposx", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"getwinposy", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"getwinvar", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"glob", "min_argc":1, "max_argc":4, "argtype":"FEARG_1"}, {"name":"glob2regpat", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"globpath", "min_argc":2, "max_argc":5, "argtype":"FEARG_2"}, {"name":"has", "min_argc":1, "max_argc":1, "argtype":"0"}, {"name":"has_key", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"haslocaldir", "min_argc":0, "max_argc":2, "argtype":"FEARG_1"}, {"name":"hasmapto", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"highlightID", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"highlight_exists", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"histadd", "min_argc":2, "max_argc":2, "argtype":"FEARG_2"}, {"name":"histdel", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"histget", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"histnr", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"hlID", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"hlexists", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"hostname", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"iconv", "min_argc":3, "max_argc":3, "argtype":"FEARG_1"}, {"name":"indent", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"index", "min_argc":2, "max_argc":4, "argtype":"FEARG_1"}, {"name":"input", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"inputdialog", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"inputlist", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"inputrestore", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"inputsave", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"inputsecret", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"insert", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"interrupt", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"invert", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"isdirectory", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"isinf", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"islocked", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"isnan", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"items", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"job_getchannel", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"job_info", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"job_setoptions", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"job_start", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"job_status", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"job_stop", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"join", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"js_decode", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"js_encode", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"json_decode", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"json_encode", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"keys", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"last_buffer_nr", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"len", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"libcall", "min_argc":3, "max_argc":3, "argtype":"FEARG_3"}, {"name":"libcallnr", "min_argc":3, "max_argc":3, "argtype":"FEARG_3"}, {"name":"line", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"line2byte", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"lispindent", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"list2str", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"listener_add", "min_argc":1, "max_argc":2, "argtype":"FEARG_2"}, {"name":"listener_flush", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"listener_remove", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"localtime", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"log", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"log10", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"luaeval", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"map", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"maparg", "min_argc":1, "max_argc":4, "argtype":"FEARG_1"}, {"name":"mapcheck", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"match", "min_argc":2, "max_argc":4, "argtype":"FEARG_1"}, {"name":"matchadd", "min_argc":2, "max_argc":5, "argtype":"FEARG_1"}, {"name":"matchaddpos", "min_argc":2, "max_argc":5, "argtype":"FEARG_1"}, {"name":"matcharg", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"matchdelete", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"matchend", "min_argc":2, "max_argc":4, "argtype":"FEARG_1"}, {"name":"matchlist", "min_argc":2, "max_argc":4, "argtype":"FEARG_1"}, {"name":"matchstr", "min_argc":2, "max_argc":4, "argtype":"FEARG_1"}, {"name":"matchstrpos", "min_argc":2, "max_argc":4, "argtype":"FEARG_1"}, {"name":"max", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"min", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"mkdir", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"mode", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"mzeval", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"nextnonblank", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"nr2char", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"or", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"pathshorten", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"perleval", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"popup_atcursor", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"popup_beval", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"popup_clear", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"popup_close", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"popup_create", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"popup_dialog", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"popup_filter_menu", "min_argc":2, "max_argc":2, "argtype":"0"}, {"name":"popup_filter_yesno", "min_argc":2, "max_argc":2, "argtype":"0"}, {"name":"popup_findinfo", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"popup_findpreview", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"popup_getoptions", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"popup_getpos", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"popup_hide", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"popup_locate", "min_argc":2, "max_argc":2, "argtype":"0"}, {"name":"popup_menu", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"popup_move", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"popup_notification", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"popup_setoptions", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"popup_settext", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"popup_show", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"pow", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"prevnonblank", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"printf", "min_argc":1, "max_argc":19, "argtype":"FEARG_2"}, {"name":"prompt_setcallback", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"prompt_setinterrupt", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"prompt_setprompt", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"prop_add", "min_argc":3, "max_argc":3, "argtype":"FEARG_1"}, {"name":"prop_clear", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"prop_find", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"prop_list", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"prop_remove", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"prop_type_add", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"prop_type_change", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"prop_type_delete", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"prop_type_get", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"prop_type_list", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"pum_getpos", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"pumvisible", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"py3eval", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"pyeval", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"pyxeval", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"rand", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"range", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"readdir", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"readfile", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"reg_executing", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"reg_recording", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"reltime", "min_argc":0, "max_argc":2, "argtype":"FEARG_1"}, {"name":"reltimefloat", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"reltimestr", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"remote_expr", "min_argc":2, "max_argc":4, "argtype":"FEARG_1"}, {"name":"remote_foreground", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"remote_peek", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"remote_read", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"remote_send", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"remote_startserver", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"remove", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"rename", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"repeat", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"resolve", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"reverse", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"round", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"rubyeval", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"screenattr", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"screenchar", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"screenchars", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"screencol", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"screenpos", "min_argc":3, "max_argc":3, "argtype":"FEARG_1"}, {"name":"screenrow", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"screenstring", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"search", "min_argc":1, "max_argc":4, "argtype":"FEARG_1"}, {"name":"searchdecl", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"searchpair", "min_argc":3, "max_argc":7, "argtype":"0"}, {"name":"searchpairpos", "min_argc":3, "max_argc":7, "argtype":"0"}, {"name":"searchpos", "min_argc":1, "max_argc":4, "argtype":"FEARG_1"}, {"name":"server2client", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"serverlist", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"setbufline", "min_argc":3, "max_argc":3, "argtype":"FEARG_3"}, {"name":"setbufvar", "min_argc":3, "max_argc":3, "argtype":"FEARG_3"}, {"name":"setcharsearch", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"setcmdpos", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"setenv", "min_argc":2, "max_argc":2, "argtype":"FEARG_2"}, {"name":"setfperm", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"setline", "min_argc":2, "max_argc":2, "argtype":"FEARG_2"}, {"name":"setloclist", "min_argc":2, "max_argc":4, "argtype":"FEARG_2"}, {"name":"setmatches", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"setpos", "min_argc":2, "max_argc":2, "argtype":"FEARG_2"}, {"name":"setqflist", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"setreg", "min_argc":2, "max_argc":3, "argtype":"FEARG_2"}, {"name":"settabvar", "min_argc":3, "max_argc":3, "argtype":"FEARG_3"}, {"name":"settabwinvar", "min_argc":4, "max_argc":4, "argtype":"FEARG_4"}, {"name":"settagstack", "min_argc":2, "max_argc":3, "argtype":"FEARG_2"}, {"name":"setwinvar", "min_argc":3, "max_argc":3, "argtype":"FEARG_3"}, {"name":"sha256", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"shellescape", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"shiftwidth", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"sign_define", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"sign_getdefined", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"sign_getplaced", "min_argc":0, "max_argc":2, "argtype":"FEARG_1"}, {"name":"sign_jump", "min_argc":3, "max_argc":3, "argtype":"FEARG_1"}, {"name":"sign_place", "min_argc":4, "max_argc":5, "argtype":"FEARG_1"}, {"name":"sign_placelist", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"sign_undefine", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"sign_unplace", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"sign_unplacelist", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"simplify", "min_argc":1, "max_argc":1, "argtype":"0"}, {"name":"sin", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"sinh", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"sort", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"sound_clear", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"sound_playevent", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"sound_playfile", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"sound_stop", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"soundfold", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"spellbadword", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"spellsuggest", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"split", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"sqrt", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"srand", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"state", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"str2float", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"str2list", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"str2nr", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"strcharpart", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"strchars", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"strdisplaywidth", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"strftime", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"strgetchar", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"stridx", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"string", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"strlen", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"strpart", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"strptime", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"strridx", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"strtrans", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"strwidth", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"submatch", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"substitute", "min_argc":4, "max_argc":4, "argtype":"FEARG_1"}, {"name":"swapinfo", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"swapname", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"synID", "min_argc":3, "max_argc":3, "argtype":"0"}, {"name":"synIDattr", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"synIDtrans", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"synconcealed", "min_argc":2, "max_argc":2, "argtype":"0"}, {"name":"synstack", "min_argc":2, "max_argc":2, "argtype":"0"}, {"name":"system", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"systemlist", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"tabpagebuflist", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"tabpagenr", "min_argc":0, "max_argc":1, "argtype":"0"}, {"name":"tabpagewinnr", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"tagfiles", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"taglist", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"tan", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"tanh", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"tempname", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"term_dumpdiff", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"term_dumpload", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"term_dumpwrite", "min_argc":2, "max_argc":3, "argtype":"FEARG_2"}, {"name":"term_getaltscreen", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"term_getansicolors", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"term_getattr", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"term_getcursor", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"term_getjob", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"term_getline", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"term_getscrolled", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"term_getsize", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"term_getstatus", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"term_gettitle", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"term_gettty", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"term_list", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"term_scrape", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"term_sendkeys", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"term_setansicolors", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"term_setapi", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"term_setkill", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"term_setrestore", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"term_setsize", "min_argc":3, "max_argc":3, "argtype":"FEARG_1"}, {"name":"term_start", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"term_wait", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"test_alloc_fail", "min_argc":3, "max_argc":3, "argtype":"FEARG_1"}, {"name":"test_autochdir", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"test_feedinput", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"test_garbagecollect_now", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"test_garbagecollect_soon", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"test_getvalue", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"test_ignore_error", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"test_null_blob", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"test_null_channel", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"test_null_dict", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"test_null_job", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"test_null_list", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"test_null_partial", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"test_null_string", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"test_option_not_set", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"test_override", "min_argc":2, "max_argc":2, "argtype":"FEARG_2"}, {"name":"test_refcount", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"test_scrollbar", "min_argc":3, "max_argc":3, "argtype":"FEARG_2"}, {"name":"test_setmouse", "min_argc":2, "max_argc":2, "argtype":"0"}, {"name":"test_settime", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"test_srand_seed", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"test_unknown", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"test_void", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"timer_info", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"timer_pause", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"timer_start", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"timer_stop", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"timer_stopall", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"tolower", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"toupper", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"tr", "min_argc":3, "max_argc":3, "argtype":"FEARG_1"}, {"name":"trim", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"trunc", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"type", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"undofile", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"undotree", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"uniq", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"values", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"virtcol", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"visualmode", "min_argc":0, "max_argc":1, "argtype":"0"}, {"name":"wildmenumode", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"win_execute", "min_argc":2, "max_argc":3, "argtype":"FEARG_2"}, {"name":"win_findbuf", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"win_getid", "min_argc":0, "max_argc":2, "argtype":"FEARG_1"}, {"name":"win_gettype", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"win_gotoid", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"win_id2tabwin", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"win_id2win", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"win_screenpos", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"win_splitmove", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"winbufnr", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"wincol", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"windowsversion", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"winheight", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"winlayout", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"winline", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"winnr", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"winrestcmd", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"winrestview", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"winsaveview", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"winwidth", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"wordcount", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"writefile", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"xor", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}];
|
10359 | function ExprTokenizer() { this.__init__.apply(this, arguments); }
|
10360 | ExprTokenizer.prototype.__init__ = function(reader) {
|
10361 | this.reader = reader;
|
10362 | this.cache = {};
|
10363 | }
|
10364 |
|
10365 | ExprTokenizer.prototype.token = function(type, value, pos) {
|
10366 | return {"type":type, "value":value, "pos":pos};
|
10367 | }
|
10368 |
|
10369 | ExprTokenizer.prototype.peek = function() {
|
10370 | var pos = this.reader.tell();
|
10371 | var r = this.get();
|
10372 | this.reader.seek_set(pos);
|
10373 | return r;
|
10374 | }
|
10375 |
|
10376 | ExprTokenizer.prototype.get = function() {
|
10377 |
|
10378 | if (viml_has_key(this.cache, this.reader.tell())) {
|
10379 | var x = this.cache[this.reader.tell()];
|
10380 | this.reader.seek_set(x[0]);
|
10381 | return x[1];
|
10382 | }
|
10383 | var pos = this.reader.tell();
|
10384 | this.reader.skip_white();
|
10385 | var r = this.get2();
|
10386 | this.cache[pos] = [this.reader.tell(), r];
|
10387 | return r;
|
10388 | }
|
10389 |
|
10390 | ExprTokenizer.prototype.get2 = function() {
|
10391 | var r = this.reader;
|
10392 | var pos = r.getpos();
|
10393 | var c = r.peek();
|
10394 | if (c == "<EOF>") {
|
10395 | return this.token(TOKEN_EOF, c, pos);
|
10396 | }
|
10397 | else if (c == "<EOL>") {
|
10398 | r.seek_cur(1);
|
10399 | return this.token(TOKEN_EOL, c, pos);
|
10400 | }
|
10401 | else if (iswhite(c)) {
|
10402 | var s = r.read_white();
|
10403 | return this.token(TOKEN_SPACE, s, pos);
|
10404 | }
|
10405 | else if (c == "0" && (r.p(1) == "X" || r.p(1) == "x") && isxdigit(r.p(2))) {
|
10406 | var s = r.getn(3);
|
10407 | s += r.read_xdigit();
|
10408 | return this.token(TOKEN_NUMBER, s, pos);
|
10409 | }
|
10410 | else if (c == "0" && (r.p(1) == "B" || r.p(1) == "b") && (r.p(2) == "0" || r.p(2) == "1")) {
|
10411 | var s = r.getn(3);
|
10412 | s += r.read_bdigit();
|
10413 | return this.token(TOKEN_NUMBER, s, pos);
|
10414 | }
|
10415 | else if (c == "0" && (r.p(1) == "Z" || r.p(1) == "z") && r.p(2) != ".") {
|
10416 | var s = r.getn(2);
|
10417 | s += r.read_blob();
|
10418 | return this.token(TOKEN_BLOB, s, pos);
|
10419 | }
|
10420 | else if (isdigit(c)) {
|
10421 | var s = r.read_digit();
|
10422 | if (r.p(0) == "." && isdigit(r.p(1))) {
|
10423 | s += r.getn(1);
|
10424 | s += r.read_digit();
|
10425 | if ((r.p(0) == "E" || r.p(0) == "e") && (isdigit(r.p(1)) || (r.p(1) == "-" || r.p(1) == "+") && isdigit(r.p(2)))) {
|
10426 | s += r.getn(2);
|
10427 | s += r.read_digit();
|
10428 | }
|
10429 | }
|
10430 | return this.token(TOKEN_NUMBER, s, pos);
|
10431 | }
|
10432 | else if (c == "i" && r.p(1) == "s" && !isidc(r.p(2))) {
|
10433 | if (r.p(2) == "?") {
|
10434 | r.seek_cur(3);
|
10435 | return this.token(TOKEN_ISCI, "is?", pos);
|
10436 | }
|
10437 | else if (r.p(2) == "#") {
|
10438 | r.seek_cur(3);
|
10439 | return this.token(TOKEN_ISCS, "is#", pos);
|
10440 | }
|
10441 | else {
|
10442 | r.seek_cur(2);
|
10443 | return this.token(TOKEN_IS, "is", pos);
|
10444 | }
|
10445 | }
|
10446 | else if (c == "i" && r.p(1) == "s" && r.p(2) == "n" && r.p(3) == "o" && r.p(4) == "t" && !isidc(r.p(5))) {
|
10447 | if (r.p(5) == "?") {
|
10448 | r.seek_cur(6);
|
10449 | return this.token(TOKEN_ISNOTCI, "isnot?", pos);
|
10450 | }
|
10451 | else if (r.p(5) == "#") {
|
10452 | r.seek_cur(6);
|
10453 | return this.token(TOKEN_ISNOTCS, "isnot#", pos);
|
10454 | }
|
10455 | else {
|
10456 | r.seek_cur(5);
|
10457 | return this.token(TOKEN_ISNOT, "isnot", pos);
|
10458 | }
|
10459 | }
|
10460 | else if (isnamec1(c)) {
|
10461 | var s = r.read_name();
|
10462 | return this.token(TOKEN_IDENTIFIER, s, pos);
|
10463 | }
|
10464 | else if (c == "|" && r.p(1) == "|") {
|
10465 | r.seek_cur(2);
|
10466 | return this.token(TOKEN_OROR, "||", pos);
|
10467 | }
|
10468 | else if (c == "&" && r.p(1) == "&") {
|
10469 | r.seek_cur(2);
|
10470 | return this.token(TOKEN_ANDAND, "&&", pos);
|
10471 | }
|
10472 | else if (c == "=" && r.p(1) == "=") {
|
10473 | if (r.p(2) == "?") {
|
10474 | r.seek_cur(3);
|
10475 | return this.token(TOKEN_EQEQCI, "==?", pos);
|
10476 | }
|
10477 | else if (r.p(2) == "#") {
|
10478 | r.seek_cur(3);
|
10479 | return this.token(TOKEN_EQEQCS, "==#", pos);
|
10480 | }
|
10481 | else {
|
10482 | r.seek_cur(2);
|
10483 | return this.token(TOKEN_EQEQ, "==", pos);
|
10484 | }
|
10485 | }
|
10486 | else if (c == "!" && r.p(1) == "=") {
|
10487 | if (r.p(2) == "?") {
|
10488 | r.seek_cur(3);
|
10489 | return this.token(TOKEN_NEQCI, "!=?", pos);
|
10490 | }
|
10491 | else if (r.p(2) == "#") {
|
10492 | r.seek_cur(3);
|
10493 | return this.token(TOKEN_NEQCS, "!=#", pos);
|
10494 | }
|
10495 | else {
|
10496 | r.seek_cur(2);
|
10497 | return this.token(TOKEN_NEQ, "!=", pos);
|
10498 | }
|
10499 | }
|
10500 | else if (c == ">" && r.p(1) == "=") {
|
10501 | if (r.p(2) == "?") {
|
10502 | r.seek_cur(3);
|
10503 | return this.token(TOKEN_GTEQCI, ">=?", pos);
|
10504 | }
|
10505 | else if (r.p(2) == "#") {
|
10506 | r.seek_cur(3);
|
10507 | return this.token(TOKEN_GTEQCS, ">=#", pos);
|
10508 | }
|
10509 | else {
|
10510 | r.seek_cur(2);
|
10511 | return this.token(TOKEN_GTEQ, ">=", pos);
|
10512 | }
|
10513 | }
|
10514 | else if (c == "<" && r.p(1) == "=") {
|
10515 | if (r.p(2) == "?") {
|
10516 | r.seek_cur(3);
|
10517 | return this.token(TOKEN_LTEQCI, "<=?", pos);
|
10518 | }
|
10519 | else if (r.p(2) == "#") {
|
10520 | r.seek_cur(3);
|
10521 | return this.token(TOKEN_LTEQCS, "<=#", pos);
|
10522 | }
|
10523 | else {
|
10524 | r.seek_cur(2);
|
10525 | return this.token(TOKEN_LTEQ, "<=", pos);
|
10526 | }
|
10527 | }
|
10528 | else if (c == "=" && r.p(1) == "~") {
|
10529 | if (r.p(2) == "?") {
|
10530 | r.seek_cur(3);
|
10531 | return this.token(TOKEN_MATCHCI, "=~?", pos);
|
10532 | }
|
10533 | else if (r.p(2) == "#") {
|
10534 | r.seek_cur(3);
|
10535 | return this.token(TOKEN_MATCHCS, "=~#", pos);
|
10536 | }
|
10537 | else {
|
10538 | r.seek_cur(2);
|
10539 | return this.token(TOKEN_MATCH, "=~", pos);
|
10540 | }
|
10541 | }
|
10542 | else if (c == "!" && r.p(1) == "~") {
|
10543 | if (r.p(2) == "?") {
|
10544 | r.seek_cur(3);
|
10545 | return this.token(TOKEN_NOMATCHCI, "!~?", pos);
|
10546 | }
|
10547 | else if (r.p(2) == "#") {
|
10548 | r.seek_cur(3);
|
10549 | return this.token(TOKEN_NOMATCHCS, "!~#", pos);
|
10550 | }
|
10551 | else {
|
10552 | r.seek_cur(2);
|
10553 | return this.token(TOKEN_NOMATCH, "!~", pos);
|
10554 | }
|
10555 | }
|
10556 | else if (c == ">") {
|
10557 | if (r.p(1) == "?") {
|
10558 | r.seek_cur(2);
|
10559 | return this.token(TOKEN_GTCI, ">?", pos);
|
10560 | }
|
10561 | else if (r.p(1) == "#") {
|
10562 | r.seek_cur(2);
|
10563 | return this.token(TOKEN_GTCS, ">#", pos);
|
10564 | }
|
10565 | else {
|
10566 | r.seek_cur(1);
|
10567 | return this.token(TOKEN_GT, ">", pos);
|
10568 | }
|
10569 | }
|
10570 | else if (c == "<") {
|
10571 | if (r.p(1) == "?") {
|
10572 | r.seek_cur(2);
|
10573 | return this.token(TOKEN_LTCI, "<?", pos);
|
10574 | }
|
10575 | else if (r.p(1) == "#") {
|
10576 | r.seek_cur(2);
|
10577 | return this.token(TOKEN_LTCS, "<#", pos);
|
10578 | }
|
10579 | else {
|
10580 | r.seek_cur(1);
|
10581 | return this.token(TOKEN_LT, "<", pos);
|
10582 | }
|
10583 | }
|
10584 | else if (c == "+") {
|
10585 | r.seek_cur(1);
|
10586 | return this.token(TOKEN_PLUS, "+", pos);
|
10587 | }
|
10588 | else if (c == "-") {
|
10589 | if (r.p(1) == ">") {
|
10590 | r.seek_cur(2);
|
10591 | return this.token(TOKEN_ARROW, "->", pos);
|
10592 | }
|
10593 | else {
|
10594 | r.seek_cur(1);
|
10595 | return this.token(TOKEN_MINUS, "-", pos);
|
10596 | }
|
10597 | }
|
10598 | else if (c == ".") {
|
10599 | if (r.p(1) == "." && r.p(2) == ".") {
|
10600 | r.seek_cur(3);
|
10601 | return this.token(TOKEN_DOTDOTDOT, "...", pos);
|
10602 | }
|
10603 | else if (r.p(1) == ".") {
|
10604 | r.seek_cur(2);
|
10605 | return this.token(TOKEN_DOTDOT, "..", pos);
|
10606 |
|
10607 | }
|
10608 | else {
|
10609 | r.seek_cur(1);
|
10610 | return this.token(TOKEN_DOT, ".", pos);
|
10611 |
|
10612 | }
|
10613 | }
|
10614 | else if (c == "*") {
|
10615 | r.seek_cur(1);
|
10616 | return this.token(TOKEN_STAR, "*", pos);
|
10617 | }
|
10618 | else if (c == "/") {
|
10619 | r.seek_cur(1);
|
10620 | return this.token(TOKEN_SLASH, "/", pos);
|
10621 | }
|
10622 | else if (c == "%") {
|
10623 | r.seek_cur(1);
|
10624 | return this.token(TOKEN_PERCENT, "%", pos);
|
10625 | }
|
10626 | else if (c == "!") {
|
10627 | r.seek_cur(1);
|
10628 | return this.token(TOKEN_NOT, "!", pos);
|
10629 | }
|
10630 | else if (c == "?") {
|
10631 | r.seek_cur(1);
|
10632 | return this.token(TOKEN_QUESTION, "?", pos);
|
10633 | }
|
10634 | else if (c == ":") {
|
10635 | r.seek_cur(1);
|
10636 | return this.token(TOKEN_COLON, ":", pos);
|
10637 | }
|
10638 | else if (c == "#") {
|
10639 | if (r.p(1) == "{") {
|
10640 | r.seek_cur(2);
|
10641 | return this.token(TOKEN_LITCOPEN, "#{", pos);
|
10642 | }
|
10643 | else {
|
10644 | r.seek_cur(1);
|
10645 | return this.token(TOKEN_SHARP, "#", pos);
|
10646 | }
|
10647 | }
|
10648 | else if (c == "(") {
|
10649 | r.seek_cur(1);
|
10650 | return this.token(TOKEN_POPEN, "(", pos);
|
10651 | }
|
10652 | else if (c == ")") {
|
10653 | r.seek_cur(1);
|
10654 | return this.token(TOKEN_PCLOSE, ")", pos);
|
10655 | }
|
10656 | else if (c == "[") {
|
10657 | r.seek_cur(1);
|
10658 | return this.token(TOKEN_SQOPEN, "[", pos);
|
10659 | }
|
10660 | else if (c == "]") {
|
10661 | r.seek_cur(1);
|
10662 | return this.token(TOKEN_SQCLOSE, "]", pos);
|
10663 | }
|
10664 | else if (c == "{") {
|
10665 | r.seek_cur(1);
|
10666 | return this.token(TOKEN_COPEN, "{", pos);
|
10667 | }
|
10668 | else if (c == "}") {
|
10669 | r.seek_cur(1);
|
10670 | return this.token(TOKEN_CCLOSE, "}", pos);
|
10671 | }
|
10672 | else if (c == ",") {
|
10673 | r.seek_cur(1);
|
10674 | return this.token(TOKEN_COMMA, ",", pos);
|
10675 | }
|
10676 | else if (c == "'") {
|
10677 | r.seek_cur(1);
|
10678 | return this.token(TOKEN_SQUOTE, "'", pos);
|
10679 | }
|
10680 | else if (c == "\"") {
|
10681 | r.seek_cur(1);
|
10682 | return this.token(TOKEN_DQUOTE, "\"", pos);
|
10683 | }
|
10684 | else if (c == "$") {
|
10685 | var s = r.getn(1);
|
10686 | s += r.read_word();
|
10687 | return this.token(TOKEN_ENV, s, pos);
|
10688 | }
|
10689 | else if (c == "@") {
|
10690 |
|
10691 | return this.token(TOKEN_REG, r.getn(2), pos);
|
10692 | }
|
10693 | else if (c == "&") {
|
10694 | var s = "";
|
10695 | if ((r.p(1) == "g" || r.p(1) == "l") && r.p(2) == ":") {
|
10696 | var s = r.getn(3) + r.read_word();
|
10697 | }
|
10698 | else {
|
10699 | var s = r.getn(1) + r.read_word();
|
10700 | }
|
10701 | return this.token(TOKEN_OPTION, s, pos);
|
10702 | }
|
10703 | else if (c == "=") {
|
10704 | r.seek_cur(1);
|
10705 | return this.token(TOKEN_EQ, "=", pos);
|
10706 | }
|
10707 | else if (c == "|") {
|
10708 | r.seek_cur(1);
|
10709 | return this.token(TOKEN_OR, "|", pos);
|
10710 | }
|
10711 | else if (c == ";") {
|
10712 | r.seek_cur(1);
|
10713 | return this.token(TOKEN_SEMICOLON, ";", pos);
|
10714 | }
|
10715 | else if (c == "`") {
|
10716 | r.seek_cur(1);
|
10717 | return this.token(TOKEN_BACKTICK, "`", pos);
|
10718 | }
|
10719 | else {
|
10720 | throw Err(viml_printf("unexpected character: %s", c), this.reader.getpos());
|
10721 | }
|
10722 | }
|
10723 |
|
10724 | ExprTokenizer.prototype.get_sstring = function() {
|
10725 | this.reader.skip_white();
|
10726 | var c = this.reader.p(0);
|
10727 | if (c != "'") {
|
10728 | throw Err(viml_printf("unexpected character: %s", c), this.reader.getpos());
|
10729 | }
|
10730 | this.reader.seek_cur(1);
|
10731 | var s = "";
|
10732 | while (TRUE) {
|
10733 | var c = this.reader.p(0);
|
10734 | if (c == "<EOF>" || c == "<EOL>") {
|
10735 | throw Err("unexpected EOL", this.reader.getpos());
|
10736 | }
|
10737 | else if (c == "'") {
|
10738 | this.reader.seek_cur(1);
|
10739 | if (this.reader.p(0) == "'") {
|
10740 | this.reader.seek_cur(1);
|
10741 | s += "''";
|
10742 | }
|
10743 | else {
|
10744 | break;
|
10745 | }
|
10746 | }
|
10747 | else {
|
10748 | this.reader.seek_cur(1);
|
10749 | s += c;
|
10750 | }
|
10751 | }
|
10752 | return s;
|
10753 | }
|
10754 |
|
10755 | ExprTokenizer.prototype.get_dstring = function() {
|
10756 | this.reader.skip_white();
|
10757 | var c = this.reader.p(0);
|
10758 | if (c != "\"") {
|
10759 | throw Err(viml_printf("unexpected character: %s", c), this.reader.getpos());
|
10760 | }
|
10761 | this.reader.seek_cur(1);
|
10762 | var s = "";
|
10763 | while (TRUE) {
|
10764 | var c = this.reader.p(0);
|
10765 | if (c == "<EOF>" || c == "<EOL>") {
|
10766 | throw Err("unexpectd EOL", this.reader.getpos());
|
10767 | }
|
10768 | else if (c == "\"") {
|
10769 | this.reader.seek_cur(1);
|
10770 | break;
|
10771 | }
|
10772 | else if (c == "\\") {
|
10773 | this.reader.seek_cur(1);
|
10774 | s += c;
|
10775 | var c = this.reader.p(0);
|
10776 | if (c == "<EOF>" || c == "<EOL>") {
|
10777 | throw Err("ExprTokenizer: unexpected EOL", this.reader.getpos());
|
10778 | }
|
10779 | this.reader.seek_cur(1);
|
10780 | s += c;
|
10781 | }
|
10782 | else {
|
10783 | this.reader.seek_cur(1);
|
10784 | s += c;
|
10785 | }
|
10786 | }
|
10787 | return s;
|
10788 | }
|
10789 |
|
10790 | ExprTokenizer.prototype.parse_dict_literal_key = function() {
|
10791 | this.reader.skip_white();
|
10792 | var c = this.reader.peek();
|
10793 | if (!isalnum(c) && c != "_" && c != "-") {
|
10794 | throw Err(viml_printf("unexpected character: %s", c), this.reader.getpos());
|
10795 | }
|
10796 | var node = Node(NODE_STRING);
|
10797 | var s = c;
|
10798 | this.reader.seek_cur(1);
|
10799 | node.pos = this.reader.getpos();
|
10800 | while (TRUE) {
|
10801 | var c = this.reader.p(0);
|
10802 | if (c == "<EOF>" || c == "<EOL>") {
|
10803 | throw Err("unexpectd EOL", this.reader.getpos());
|
10804 | }
|
10805 | if (!isalnum(c) && c != "_" && c != "-") {
|
10806 | break;
|
10807 | }
|
10808 | this.reader.seek_cur(1);
|
10809 | s += c;
|
10810 | }
|
10811 | node.value = "'" + s + "'";
|
10812 | return node;
|
10813 | }
|
10814 |
|
10815 | function ExprParser() { this.__init__.apply(this, arguments); }
|
10816 | ExprParser.prototype.__init__ = function(reader) {
|
10817 | this.reader = reader;
|
10818 | this.tokenizer = new ExprTokenizer(reader);
|
10819 | }
|
10820 |
|
10821 | ExprParser.prototype.parse = function() {
|
10822 | return this.parse_expr1();
|
10823 | }
|
10824 |
|
10825 |
|
10826 | ExprParser.prototype.parse_expr1 = function() {
|
10827 | var left = this.parse_expr2();
|
10828 | var pos = this.reader.tell();
|
10829 | var token = this.tokenizer.get();
|
10830 | if (token.type == TOKEN_QUESTION) {
|
10831 | var node = Node(NODE_TERNARY);
|
10832 | node.pos = token.pos;
|
10833 | node.cond = left;
|
10834 | node.left = this.parse_expr1();
|
10835 | var token = this.tokenizer.get();
|
10836 | if (token.type != TOKEN_COLON) {
|
10837 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
10838 | }
|
10839 | node.right = this.parse_expr1();
|
10840 | var left = node;
|
10841 | }
|
10842 | else {
|
10843 | this.reader.seek_set(pos);
|
10844 | }
|
10845 | return left;
|
10846 | }
|
10847 |
|
10848 |
|
10849 | ExprParser.prototype.parse_expr2 = function() {
|
10850 | var left = this.parse_expr3();
|
10851 | while (TRUE) {
|
10852 | var pos = this.reader.tell();
|
10853 | var token = this.tokenizer.get();
|
10854 | if (token.type == TOKEN_OROR) {
|
10855 | var node = Node(NODE_OR);
|
10856 | node.pos = token.pos;
|
10857 | node.left = left;
|
10858 | node.right = this.parse_expr3();
|
10859 | var left = node;
|
10860 | }
|
10861 | else {
|
10862 | this.reader.seek_set(pos);
|
10863 | break;
|
10864 | }
|
10865 | }
|
10866 | return left;
|
10867 | }
|
10868 |
|
10869 |
|
10870 | ExprParser.prototype.parse_expr3 = function() {
|
10871 | var left = this.parse_expr4();
|
10872 | while (TRUE) {
|
10873 | var pos = this.reader.tell();
|
10874 | var token = this.tokenizer.get();
|
10875 | if (token.type == TOKEN_ANDAND) {
|
10876 | var node = Node(NODE_AND);
|
10877 | node.pos = token.pos;
|
10878 | node.left = left;
|
10879 | node.right = this.parse_expr4();
|
10880 | var left = node;
|
10881 | }
|
10882 | else {
|
10883 | this.reader.seek_set(pos);
|
10884 | break;
|
10885 | }
|
10886 | }
|
10887 | return left;
|
10888 | }
|
10889 |
|
10890 |
|
10891 |
|
10892 |
|
10893 |
|
10894 |
|
10895 |
|
10896 |
|
10897 |
|
10898 |
|
10899 |
|
10900 |
|
10901 |
|
10902 |
|
10903 |
|
10904 |
|
10905 | ExprParser.prototype.parse_expr4 = function() {
|
10906 | var left = this.parse_expr5();
|
10907 | var pos = this.reader.tell();
|
10908 | var token = this.tokenizer.get();
|
10909 | if (token.type == TOKEN_EQEQ) {
|
10910 | var node = Node(NODE_EQUAL);
|
10911 | node.pos = token.pos;
|
10912 | node.left = left;
|
10913 | node.right = this.parse_expr5();
|
10914 | var left = node;
|
10915 | }
|
10916 | else if (token.type == TOKEN_EQEQCI) {
|
10917 | var node = Node(NODE_EQUALCI);
|
10918 | node.pos = token.pos;
|
10919 | node.left = left;
|
10920 | node.right = this.parse_expr5();
|
10921 | var left = node;
|
10922 | }
|
10923 | else if (token.type == TOKEN_EQEQCS) {
|
10924 | var node = Node(NODE_EQUALCS);
|
10925 | node.pos = token.pos;
|
10926 | node.left = left;
|
10927 | node.right = this.parse_expr5();
|
10928 | var left = node;
|
10929 | }
|
10930 | else if (token.type == TOKEN_NEQ) {
|
10931 | var node = Node(NODE_NEQUAL);
|
10932 | node.pos = token.pos;
|
10933 | node.left = left;
|
10934 | node.right = this.parse_expr5();
|
10935 | var left = node;
|
10936 | }
|
10937 | else if (token.type == TOKEN_NEQCI) {
|
10938 | var node = Node(NODE_NEQUALCI);
|
10939 | node.pos = token.pos;
|
10940 | node.left = left;
|
10941 | node.right = this.parse_expr5();
|
10942 | var left = node;
|
10943 | }
|
10944 | else if (token.type == TOKEN_NEQCS) {
|
10945 | var node = Node(NODE_NEQUALCS);
|
10946 | node.pos = token.pos;
|
10947 | node.left = left;
|
10948 | node.right = this.parse_expr5();
|
10949 | var left = node;
|
10950 | }
|
10951 | else if (token.type == TOKEN_GT) {
|
10952 | var node = Node(NODE_GREATER);
|
10953 | node.pos = token.pos;
|
10954 | node.left = left;
|
10955 | node.right = this.parse_expr5();
|
10956 | var left = node;
|
10957 | }
|
10958 | else if (token.type == TOKEN_GTCI) {
|
10959 | var node = Node(NODE_GREATERCI);
|
10960 | node.pos = token.pos;
|
10961 | node.left = left;
|
10962 | node.right = this.parse_expr5();
|
10963 | var left = node;
|
10964 | }
|
10965 | else if (token.type == TOKEN_GTCS) {
|
10966 | var node = Node(NODE_GREATERCS);
|
10967 | node.pos = token.pos;
|
10968 | node.left = left;
|
10969 | node.right = this.parse_expr5();
|
10970 | var left = node;
|
10971 | }
|
10972 | else if (token.type == TOKEN_GTEQ) {
|
10973 | var node = Node(NODE_GEQUAL);
|
10974 | node.pos = token.pos;
|
10975 | node.left = left;
|
10976 | node.right = this.parse_expr5();
|
10977 | var left = node;
|
10978 | }
|
10979 | else if (token.type == TOKEN_GTEQCI) {
|
10980 | var node = Node(NODE_GEQUALCI);
|
10981 | node.pos = token.pos;
|
10982 | node.left = left;
|
10983 | node.right = this.parse_expr5();
|
10984 | var left = node;
|
10985 | }
|
10986 | else if (token.type == TOKEN_GTEQCS) {
|
10987 | var node = Node(NODE_GEQUALCS);
|
10988 | node.pos = token.pos;
|
10989 | node.left = left;
|
10990 | node.right = this.parse_expr5();
|
10991 | var left = node;
|
10992 | }
|
10993 | else if (token.type == TOKEN_LT) {
|
10994 | var node = Node(NODE_SMALLER);
|
10995 | node.pos = token.pos;
|
10996 | node.left = left;
|
10997 | node.right = this.parse_expr5();
|
10998 | var left = node;
|
10999 | }
|
11000 | else if (token.type == TOKEN_LTCI) {
|
11001 | var node = Node(NODE_SMALLERCI);
|
11002 | node.pos = token.pos;
|
11003 | node.left = left;
|
11004 | node.right = this.parse_expr5();
|
11005 | var left = node;
|
11006 | }
|
11007 | else if (token.type == TOKEN_LTCS) {
|
11008 | var node = Node(NODE_SMALLERCS);
|
11009 | node.pos = token.pos;
|
11010 | node.left = left;
|
11011 | node.right = this.parse_expr5();
|
11012 | var left = node;
|
11013 | }
|
11014 | else if (token.type == TOKEN_LTEQ) {
|
11015 | var node = Node(NODE_SEQUAL);
|
11016 | node.pos = token.pos;
|
11017 | node.left = left;
|
11018 | node.right = this.parse_expr5();
|
11019 | var left = node;
|
11020 | }
|
11021 | else if (token.type == TOKEN_LTEQCI) {
|
11022 | var node = Node(NODE_SEQUALCI);
|
11023 | node.pos = token.pos;
|
11024 | node.left = left;
|
11025 | node.right = this.parse_expr5();
|
11026 | var left = node;
|
11027 | }
|
11028 | else if (token.type == TOKEN_LTEQCS) {
|
11029 | var node = Node(NODE_SEQUALCS);
|
11030 | node.pos = token.pos;
|
11031 | node.left = left;
|
11032 | node.right = this.parse_expr5();
|
11033 | var left = node;
|
11034 | }
|
11035 | else if (token.type == TOKEN_MATCH) {
|
11036 | var node = Node(NODE_MATCH);
|
11037 | node.pos = token.pos;
|
11038 | node.left = left;
|
11039 | node.right = this.parse_expr5();
|
11040 | var left = node;
|
11041 | }
|
11042 | else if (token.type == TOKEN_MATCHCI) {
|
11043 | var node = Node(NODE_MATCHCI);
|
11044 | node.pos = token.pos;
|
11045 | node.left = left;
|
11046 | node.right = this.parse_expr5();
|
11047 | var left = node;
|
11048 | }
|
11049 | else if (token.type == TOKEN_MATCHCS) {
|
11050 | var node = Node(NODE_MATCHCS);
|
11051 | node.pos = token.pos;
|
11052 | node.left = left;
|
11053 | node.right = this.parse_expr5();
|
11054 | var left = node;
|
11055 | }
|
11056 | else if (token.type == TOKEN_NOMATCH) {
|
11057 | var node = Node(NODE_NOMATCH);
|
11058 | node.pos = token.pos;
|
11059 | node.left = left;
|
11060 | node.right = this.parse_expr5();
|
11061 | var left = node;
|
11062 | }
|
11063 | else if (token.type == TOKEN_NOMATCHCI) {
|
11064 | var node = Node(NODE_NOMATCHCI);
|
11065 | node.pos = token.pos;
|
11066 | node.left = left;
|
11067 | node.right = this.parse_expr5();
|
11068 | var left = node;
|
11069 | }
|
11070 | else if (token.type == TOKEN_NOMATCHCS) {
|
11071 | var node = Node(NODE_NOMATCHCS);
|
11072 | node.pos = token.pos;
|
11073 | node.left = left;
|
11074 | node.right = this.parse_expr5();
|
11075 | var left = node;
|
11076 | }
|
11077 | else if (token.type == TOKEN_IS) {
|
11078 | var node = Node(NODE_IS);
|
11079 | node.pos = token.pos;
|
11080 | node.left = left;
|
11081 | node.right = this.parse_expr5();
|
11082 | var left = node;
|
11083 | }
|
11084 | else if (token.type == TOKEN_ISCI) {
|
11085 | var node = Node(NODE_ISCI);
|
11086 | node.pos = token.pos;
|
11087 | node.left = left;
|
11088 | node.right = this.parse_expr5();
|
11089 | var left = node;
|
11090 | }
|
11091 | else if (token.type == TOKEN_ISCS) {
|
11092 | var node = Node(NODE_ISCS);
|
11093 | node.pos = token.pos;
|
11094 | node.left = left;
|
11095 | node.right = this.parse_expr5();
|
11096 | var left = node;
|
11097 | }
|
11098 | else if (token.type == TOKEN_ISNOT) {
|
11099 | var node = Node(NODE_ISNOT);
|
11100 | node.pos = token.pos;
|
11101 | node.left = left;
|
11102 | node.right = this.parse_expr5();
|
11103 | var left = node;
|
11104 | }
|
11105 | else if (token.type == TOKEN_ISNOTCI) {
|
11106 | var node = Node(NODE_ISNOTCI);
|
11107 | node.pos = token.pos;
|
11108 | node.left = left;
|
11109 | node.right = this.parse_expr5();
|
11110 | var left = node;
|
11111 | }
|
11112 | else if (token.type == TOKEN_ISNOTCS) {
|
11113 | var node = Node(NODE_ISNOTCS);
|
11114 | node.pos = token.pos;
|
11115 | node.left = left;
|
11116 | node.right = this.parse_expr5();
|
11117 | var left = node;
|
11118 | }
|
11119 | else {
|
11120 | this.reader.seek_set(pos);
|
11121 | }
|
11122 | return left;
|
11123 | }
|
11124 |
|
11125 |
|
11126 |
|
11127 |
|
11128 |
|
11129 | ExprParser.prototype.parse_expr5 = function() {
|
11130 | var left = this.parse_expr6();
|
11131 | while (TRUE) {
|
11132 | var pos = this.reader.tell();
|
11133 | var token = this.tokenizer.get();
|
11134 | if (token.type == TOKEN_PLUS) {
|
11135 | var node = Node(NODE_ADD);
|
11136 | node.pos = token.pos;
|
11137 | node.left = left;
|
11138 | node.right = this.parse_expr6();
|
11139 | var left = node;
|
11140 | }
|
11141 | else if (token.type == TOKEN_MINUS) {
|
11142 | var node = Node(NODE_SUBTRACT);
|
11143 | node.pos = token.pos;
|
11144 | node.left = left;
|
11145 | node.right = this.parse_expr6();
|
11146 | var left = node;
|
11147 | }
|
11148 | else if (token.type == TOKEN_DOTDOT) {
|
11149 |
|
11150 | var node = Node(NODE_CONCAT);
|
11151 | node.pos = token.pos;
|
11152 | node.left = left;
|
11153 | node.right = this.parse_expr6();
|
11154 | var left = node;
|
11155 | }
|
11156 | else if (token.type == TOKEN_DOT) {
|
11157 |
|
11158 | var node = Node(NODE_CONCAT);
|
11159 | node.pos = token.pos;
|
11160 | node.left = left;
|
11161 | node.right = this.parse_expr6();
|
11162 | var left = node;
|
11163 | }
|
11164 | else {
|
11165 | this.reader.seek_set(pos);
|
11166 | break;
|
11167 | }
|
11168 | }
|
11169 | return left;
|
11170 | }
|
11171 |
|
11172 |
|
11173 |
|
11174 |
|
11175 | ExprParser.prototype.parse_expr6 = function() {
|
11176 | var left = this.parse_expr7();
|
11177 | while (TRUE) {
|
11178 | var pos = this.reader.tell();
|
11179 | var token = this.tokenizer.get();
|
11180 | if (token.type == TOKEN_STAR) {
|
11181 | var node = Node(NODE_MULTIPLY);
|
11182 | node.pos = token.pos;
|
11183 | node.left = left;
|
11184 | node.right = this.parse_expr7();
|
11185 | var left = node;
|
11186 | }
|
11187 | else if (token.type == TOKEN_SLASH) {
|
11188 | var node = Node(NODE_DIVIDE);
|
11189 | node.pos = token.pos;
|
11190 | node.left = left;
|
11191 | node.right = this.parse_expr7();
|
11192 | var left = node;
|
11193 | }
|
11194 | else if (token.type == TOKEN_PERCENT) {
|
11195 | var node = Node(NODE_REMAINDER);
|
11196 | node.pos = token.pos;
|
11197 | node.left = left;
|
11198 | node.right = this.parse_expr7();
|
11199 | var left = node;
|
11200 | }
|
11201 | else {
|
11202 | this.reader.seek_set(pos);
|
11203 | break;
|
11204 | }
|
11205 | }
|
11206 | return left;
|
11207 | }
|
11208 |
|
11209 |
|
11210 |
|
11211 |
|
11212 | ExprParser.prototype.parse_expr7 = function() {
|
11213 | var pos = this.reader.tell();
|
11214 | var token = this.tokenizer.get();
|
11215 | if (token.type == TOKEN_NOT) {
|
11216 | var node = Node(NODE_NOT);
|
11217 | node.pos = token.pos;
|
11218 | node.left = this.parse_expr7();
|
11219 | return node;
|
11220 | }
|
11221 | else if (token.type == TOKEN_MINUS) {
|
11222 | var node = Node(NODE_MINUS);
|
11223 | node.pos = token.pos;
|
11224 | node.left = this.parse_expr7();
|
11225 | return node;
|
11226 | }
|
11227 | else if (token.type == TOKEN_PLUS) {
|
11228 | var node = Node(NODE_PLUS);
|
11229 | node.pos = token.pos;
|
11230 | node.left = this.parse_expr7();
|
11231 | return node;
|
11232 | }
|
11233 | else {
|
11234 | this.reader.seek_set(pos);
|
11235 | var node = this.parse_expr8();
|
11236 | return node;
|
11237 | }
|
11238 | }
|
11239 |
|
11240 |
|
11241 |
|
11242 |
|
11243 |
|
11244 |
|
11245 |
|
11246 |
|
11247 | ExprParser.prototype.parse_expr8 = function() {
|
11248 | var left = this.parse_expr9();
|
11249 | while (TRUE) {
|
11250 | var pos = this.reader.tell();
|
11251 | var c = this.reader.peek();
|
11252 | var token = this.tokenizer.get();
|
11253 | if (!iswhite(c) && token.type == TOKEN_SQOPEN) {
|
11254 | var npos = token.pos;
|
11255 | if (this.tokenizer.peek().type == TOKEN_COLON) {
|
11256 | this.tokenizer.get();
|
11257 | var node = Node(NODE_SLICE);
|
11258 | node.pos = npos;
|
11259 | node.left = left;
|
11260 | node.rlist = [NIL, NIL];
|
11261 | var token = this.tokenizer.peek();
|
11262 | if (token.type != TOKEN_SQCLOSE) {
|
11263 | node.rlist[1] = this.parse_expr1();
|
11264 | }
|
11265 | var token = this.tokenizer.get();
|
11266 | if (token.type != TOKEN_SQCLOSE) {
|
11267 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
11268 | }
|
11269 | var left = node;
|
11270 | }
|
11271 | else {
|
11272 | var right = this.parse_expr1();
|
11273 | if (this.tokenizer.peek().type == TOKEN_COLON) {
|
11274 | this.tokenizer.get();
|
11275 | var node = Node(NODE_SLICE);
|
11276 | node.pos = npos;
|
11277 | node.left = left;
|
11278 | node.rlist = [right, NIL];
|
11279 | var token = this.tokenizer.peek();
|
11280 | if (token.type != TOKEN_SQCLOSE) {
|
11281 | node.rlist[1] = this.parse_expr1();
|
11282 | }
|
11283 | var token = this.tokenizer.get();
|
11284 | if (token.type != TOKEN_SQCLOSE) {
|
11285 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
11286 | }
|
11287 | var left = node;
|
11288 | }
|
11289 | else {
|
11290 | var node = Node(NODE_SUBSCRIPT);
|
11291 | node.pos = npos;
|
11292 | node.left = left;
|
11293 | node.right = right;
|
11294 | var token = this.tokenizer.get();
|
11295 | if (token.type != TOKEN_SQCLOSE) {
|
11296 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
11297 | }
|
11298 | var left = node;
|
11299 | }
|
11300 | }
|
11301 | delete node;
|
11302 | }
|
11303 | else if (token.type == TOKEN_ARROW) {
|
11304 | var funcname_or_lambda = this.parse_expr9();
|
11305 | var token = this.tokenizer.get();
|
11306 | if (token.type != TOKEN_POPEN) {
|
11307 | throw Err("E107: Missing parentheses: lambda", token.pos);
|
11308 | }
|
11309 | var right = Node(NODE_CALL);
|
11310 | right.pos = token.pos;
|
11311 | right.left = funcname_or_lambda;
|
11312 | right.rlist = this.parse_rlist();
|
11313 | var node = Node(NODE_METHOD);
|
11314 | node.pos = token.pos;
|
11315 | node.left = left;
|
11316 | node.right = right;
|
11317 | var left = node;
|
11318 | delete node;
|
11319 | }
|
11320 | else if (token.type == TOKEN_POPEN) {
|
11321 | var node = Node(NODE_CALL);
|
11322 | node.pos = token.pos;
|
11323 | node.left = left;
|
11324 | node.rlist = this.parse_rlist();
|
11325 | var left = node;
|
11326 | delete node;
|
11327 | }
|
11328 | else if (!iswhite(c) && token.type == TOKEN_DOT) {
|
11329 |
|
11330 | var node = this.parse_dot(token, left);
|
11331 | if (node === NIL) {
|
11332 | this.reader.seek_set(pos);
|
11333 | break;
|
11334 | }
|
11335 | var left = node;
|
11336 | delete node;
|
11337 | }
|
11338 | else {
|
11339 | this.reader.seek_set(pos);
|
11340 | break;
|
11341 | }
|
11342 | }
|
11343 | return left;
|
11344 | }
|
11345 |
|
11346 | ExprParser.prototype.parse_rlist = function() {
|
11347 | var rlist = [];
|
11348 | var token = this.tokenizer.peek();
|
11349 | if (this.tokenizer.peek().type == TOKEN_PCLOSE) {
|
11350 | this.tokenizer.get();
|
11351 | }
|
11352 | else {
|
11353 | while (TRUE) {
|
11354 | viml_add(rlist, this.parse_expr1());
|
11355 | var token = this.tokenizer.get();
|
11356 | if (token.type == TOKEN_COMMA) {
|
11357 |
|
11358 | if (this.tokenizer.peek().type == TOKEN_PCLOSE) {
|
11359 | this.tokenizer.get();
|
11360 | break;
|
11361 | }
|
11362 | }
|
11363 | else if (token.type == TOKEN_PCLOSE) {
|
11364 | break;
|
11365 | }
|
11366 | else {
|
11367 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
11368 | }
|
11369 | }
|
11370 | }
|
11371 | if (viml_len(rlist) > MAX_FUNC_ARGS) {
|
11372 |
|
11373 | throw Err("E740: Too many arguments for function", token.pos);
|
11374 | }
|
11375 | return rlist;
|
11376 | }
|
11377 |
|
11378 |
|
11379 |
|
11380 |
|
11381 |
|
11382 |
|
11383 |
|
11384 |
|
11385 |
|
11386 |
|
11387 |
|
11388 |
|
11389 |
|
11390 |
|
11391 |
|
11392 |
|
11393 | ExprParser.prototype.parse_expr9 = function() {
|
11394 | var pos = this.reader.tell();
|
11395 | var token = this.tokenizer.get();
|
11396 | var node = Node(-1);
|
11397 | if (token.type == TOKEN_NUMBER) {
|
11398 | var node = Node(NODE_NUMBER);
|
11399 | node.pos = token.pos;
|
11400 | node.value = token.value;
|
11401 | }
|
11402 | else if (token.type == TOKEN_BLOB) {
|
11403 | var node = Node(NODE_BLOB);
|
11404 | node.pos = token.pos;
|
11405 | node.value = token.value;
|
11406 | }
|
11407 | else if (token.type == TOKEN_DQUOTE) {
|
11408 | this.reader.seek_set(pos);
|
11409 | var node = Node(NODE_STRING);
|
11410 | node.pos = token.pos;
|
11411 | node.value = "\"" + this.tokenizer.get_dstring() + "\"";
|
11412 | }
|
11413 | else if (token.type == TOKEN_SQUOTE) {
|
11414 | this.reader.seek_set(pos);
|
11415 | var node = Node(NODE_STRING);
|
11416 | node.pos = token.pos;
|
11417 | node.value = "'" + this.tokenizer.get_sstring() + "'";
|
11418 | }
|
11419 | else if (token.type == TOKEN_SQOPEN) {
|
11420 | var node = Node(NODE_LIST);
|
11421 | node.pos = token.pos;
|
11422 | node.value = [];
|
11423 | var token = this.tokenizer.peek();
|
11424 | if (token.type == TOKEN_SQCLOSE) {
|
11425 | this.tokenizer.get();
|
11426 | }
|
11427 | else {
|
11428 | while (TRUE) {
|
11429 | viml_add(node.value, this.parse_expr1());
|
11430 | var token = this.tokenizer.peek();
|
11431 | if (token.type == TOKEN_COMMA) {
|
11432 | this.tokenizer.get();
|
11433 | if (this.tokenizer.peek().type == TOKEN_SQCLOSE) {
|
11434 | this.tokenizer.get();
|
11435 | break;
|
11436 | }
|
11437 | }
|
11438 | else if (token.type == TOKEN_SQCLOSE) {
|
11439 | this.tokenizer.get();
|
11440 | break;
|
11441 | }
|
11442 | else {
|
11443 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
11444 | }
|
11445 | }
|
11446 | }
|
11447 | }
|
11448 | else if (token.type == TOKEN_COPEN || token.type == TOKEN_LITCOPEN) {
|
11449 | var is_litdict = token.type == TOKEN_LITCOPEN;
|
11450 | var savepos = this.reader.tell();
|
11451 | var nodepos = token.pos;
|
11452 | var token = this.tokenizer.get();
|
11453 | var lambda = token.type == TOKEN_ARROW;
|
11454 | if (!lambda && !(token.type == TOKEN_SQUOTE || token.type == TOKEN_DQUOTE)) {
|
11455 |
|
11456 |
|
11457 | var token2 = this.tokenizer.peek();
|
11458 | var lambda = token2.type == TOKEN_ARROW || token2.type == TOKEN_COMMA;
|
11459 | }
|
11460 |
|
11461 | var fallback = FALSE;
|
11462 | if (lambda) {
|
11463 |
|
11464 | var node = Node(NODE_LAMBDA);
|
11465 | node.pos = nodepos;
|
11466 | node.rlist = [];
|
11467 | var named = {};
|
11468 | while (TRUE) {
|
11469 | if (token.type == TOKEN_ARROW) {
|
11470 | break;
|
11471 | }
|
11472 | else if (token.type == TOKEN_IDENTIFIER) {
|
11473 | if (!isargname(token.value)) {
|
11474 | throw Err(viml_printf("E125: Illegal argument: %s", token.value), token.pos);
|
11475 | }
|
11476 | else if (viml_has_key(named, token.value)) {
|
11477 | throw Err(viml_printf("E853: Duplicate argument name: %s", token.value), token.pos);
|
11478 | }
|
11479 | named[token.value] = 1;
|
11480 | var varnode = Node(NODE_IDENTIFIER);
|
11481 | varnode.pos = token.pos;
|
11482 | varnode.value = token.value;
|
11483 |
|
11484 | if (iswhite(this.reader.p(0)) && this.tokenizer.peek().type == TOKEN_COMMA) {
|
11485 | throw Err("E475: Invalid argument: White space is not allowed before comma", this.reader.getpos());
|
11486 | }
|
11487 | var token = this.tokenizer.get();
|
11488 | viml_add(node.rlist, varnode);
|
11489 | if (token.type == TOKEN_COMMA) {
|
11490 |
|
11491 | var token = this.tokenizer.peek();
|
11492 | if (token.type == TOKEN_ARROW) {
|
11493 | this.tokenizer.get();
|
11494 | break;
|
11495 | }
|
11496 | }
|
11497 | else if (token.type == TOKEN_ARROW) {
|
11498 | break;
|
11499 | }
|
11500 | else {
|
11501 | throw Err(viml_printf("unexpected token: %s, type: %d", token.value, token.type), token.pos);
|
11502 | }
|
11503 | }
|
11504 | else if (token.type == TOKEN_DOTDOTDOT) {
|
11505 | var varnode = Node(NODE_IDENTIFIER);
|
11506 | varnode.pos = token.pos;
|
11507 | varnode.value = token.value;
|
11508 | viml_add(node.rlist, varnode);
|
11509 | var token = this.tokenizer.peek();
|
11510 | if (token.type == TOKEN_ARROW) {
|
11511 | this.tokenizer.get();
|
11512 | break;
|
11513 | }
|
11514 | else {
|
11515 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
11516 | }
|
11517 | }
|
11518 | else {
|
11519 | var fallback = TRUE;
|
11520 | break;
|
11521 | }
|
11522 | var token = this.tokenizer.get();
|
11523 | }
|
11524 | if (!fallback) {
|
11525 | node.left = this.parse_expr1();
|
11526 | var token = this.tokenizer.get();
|
11527 | if (token.type != TOKEN_CCLOSE) {
|
11528 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
11529 | }
|
11530 | return node;
|
11531 | }
|
11532 | }
|
11533 |
|
11534 | var node = Node(NODE_DICT);
|
11535 | node.pos = nodepos;
|
11536 | node.value = [];
|
11537 | this.reader.seek_set(savepos);
|
11538 | var token = this.tokenizer.peek();
|
11539 | if (token.type == TOKEN_CCLOSE) {
|
11540 | this.tokenizer.get();
|
11541 | return node;
|
11542 | }
|
11543 | while (1) {
|
11544 | var key = is_litdict ? this.tokenizer.parse_dict_literal_key() : this.parse_expr1();
|
11545 | var token = this.tokenizer.get();
|
11546 | if (token.type == TOKEN_CCLOSE) {
|
11547 | if (!viml_empty(node.value)) {
|
11548 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
11549 | }
|
11550 | this.reader.seek_set(pos);
|
11551 | var node = this.parse_identifier();
|
11552 | break;
|
11553 | }
|
11554 | if (token.type != TOKEN_COLON) {
|
11555 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
11556 | }
|
11557 | var val = this.parse_expr1();
|
11558 | viml_add(node.value, [key, val]);
|
11559 | var token = this.tokenizer.get();
|
11560 | if (token.type == TOKEN_COMMA) {
|
11561 | if (this.tokenizer.peek().type == TOKEN_CCLOSE) {
|
11562 | this.tokenizer.get();
|
11563 | break;
|
11564 | }
|
11565 | }
|
11566 | else if (token.type == TOKEN_CCLOSE) {
|
11567 | break;
|
11568 | }
|
11569 | else {
|
11570 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
11571 | }
|
11572 | }
|
11573 | return node;
|
11574 | }
|
11575 | else if (token.type == TOKEN_POPEN) {
|
11576 | var node = this.parse_expr1();
|
11577 | var token = this.tokenizer.get();
|
11578 | if (token.type != TOKEN_PCLOSE) {
|
11579 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
11580 | }
|
11581 | }
|
11582 | else if (token.type == TOKEN_OPTION) {
|
11583 | var node = Node(NODE_OPTION);
|
11584 | node.pos = token.pos;
|
11585 | node.value = token.value;
|
11586 | }
|
11587 | else if (token.type == TOKEN_IDENTIFIER) {
|
11588 | this.reader.seek_set(pos);
|
11589 | var node = this.parse_identifier();
|
11590 | }
|
11591 | else if (FALSE && (token.type == TOKEN_COLON || token.type == TOKEN_SHARP)) {
|
11592 |
|
11593 | this.reader.seek_set(pos);
|
11594 | var node = this.parse_identifier();
|
11595 | }
|
11596 | else if (token.type == TOKEN_LT && viml_equalci(this.reader.peekn(4), "SID>")) {
|
11597 | this.reader.seek_set(pos);
|
11598 | var node = this.parse_identifier();
|
11599 | }
|
11600 | else if (token.type == TOKEN_IS || token.type == TOKEN_ISCS || token.type == TOKEN_ISNOT || token.type == TOKEN_ISNOTCS) {
|
11601 | this.reader.seek_set(pos);
|
11602 | var node = this.parse_identifier();
|
11603 | }
|
11604 | else if (token.type == TOKEN_ENV) {
|
11605 | var node = Node(NODE_ENV);
|
11606 | node.pos = token.pos;
|
11607 | node.value = token.value;
|
11608 | }
|
11609 | else if (token.type == TOKEN_REG) {
|
11610 | var node = Node(NODE_REG);
|
11611 | node.pos = token.pos;
|
11612 | node.value = token.value;
|
11613 | }
|
11614 | else {
|
11615 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
11616 | }
|
11617 | return node;
|
11618 | }
|
11619 |
|
11620 |
|
11621 |
|
11622 |
|
11623 | ExprParser.prototype.parse_dot = function(token, left) {
|
11624 | if (left.type != NODE_IDENTIFIER && left.type != NODE_CURLYNAME && left.type != NODE_DICT && left.type != NODE_SUBSCRIPT && left.type != NODE_CALL && left.type != NODE_DOT) {
|
11625 | return NIL;
|
11626 | }
|
11627 | if (!iswordc(this.reader.p(0))) {
|
11628 | return NIL;
|
11629 | }
|
11630 | var pos = this.reader.getpos();
|
11631 | var name = this.reader.read_word();
|
11632 | if (isnamec(this.reader.p(0))) {
|
11633 |
|
11634 |
|
11635 | return NIL;
|
11636 | }
|
11637 | var node = Node(NODE_DOT);
|
11638 | node.pos = token.pos;
|
11639 | node.left = left;
|
11640 | node.right = Node(NODE_IDENTIFIER);
|
11641 | node.right.pos = pos;
|
11642 | node.right.value = name;
|
11643 | return node;
|
11644 | }
|
11645 |
|
11646 |
|
11647 |
|
11648 | ExprParser.prototype.parse_concat = function(token, left) {
|
11649 | if (left.type != NODE_IDENTIFIER && left.type != NODE_CURLYNAME && left.type != NODE_DICT && left.type != NODE_SUBSCRIPT && left.type != NODE_CALL && left.type != NODE_DOT) {
|
11650 | return NIL;
|
11651 | }
|
11652 | if (!iswordc(this.reader.p(0))) {
|
11653 | return NIL;
|
11654 | }
|
11655 | var pos = this.reader.getpos();
|
11656 | var name = this.reader.read_word();
|
11657 | if (isnamec(this.reader.p(0))) {
|
11658 |
|
11659 |
|
11660 | return NIL;
|
11661 | }
|
11662 | var node = Node(NODE_CONCAT);
|
11663 | node.pos = token.pos;
|
11664 | node.left = left;
|
11665 | node.right = Node(NODE_IDENTIFIER);
|
11666 | node.right.pos = pos;
|
11667 | node.right.value = name;
|
11668 | return node;
|
11669 | }
|
11670 |
|
11671 | ExprParser.prototype.parse_identifier = function() {
|
11672 | this.reader.skip_white();
|
11673 | var npos = this.reader.getpos();
|
11674 | var curly_parts = this.parse_curly_parts();
|
11675 | if (viml_len(curly_parts) == 1 && curly_parts[0].type == NODE_CURLYNAMEPART) {
|
11676 | var node = Node(NODE_IDENTIFIER);
|
11677 | node.pos = npos;
|
11678 | node.value = curly_parts[0].value;
|
11679 | return node;
|
11680 | }
|
11681 | else {
|
11682 | var node = Node(NODE_CURLYNAME);
|
11683 | node.pos = npos;
|
11684 | node.value = curly_parts;
|
11685 | return node;
|
11686 | }
|
11687 | }
|
11688 |
|
11689 | ExprParser.prototype.parse_curly_parts = function() {
|
11690 | var curly_parts = [];
|
11691 | var c = this.reader.peek();
|
11692 | var pos = this.reader.getpos();
|
11693 | if (c == "<" && viml_equalci(this.reader.peekn(5), "<SID>")) {
|
11694 | var name = this.reader.getn(5);
|
11695 | var node = Node(NODE_CURLYNAMEPART);
|
11696 | node.curly = FALSE;
|
11697 |
|
11698 | node.pos = pos;
|
11699 | node.value = name;
|
11700 | viml_add(curly_parts, node);
|
11701 | }
|
11702 | while (TRUE) {
|
11703 | var c = this.reader.peek();
|
11704 | if (isnamec(c)) {
|
11705 | var pos = this.reader.getpos();
|
11706 | var name = this.reader.read_name();
|
11707 | var node = Node(NODE_CURLYNAMEPART);
|
11708 | node.curly = FALSE;
|
11709 |
|
11710 | node.pos = pos;
|
11711 | node.value = name;
|
11712 | viml_add(curly_parts, node);
|
11713 | }
|
11714 | else if (c == "{") {
|
11715 | this.reader.get();
|
11716 | var pos = this.reader.getpos();
|
11717 | var node = Node(NODE_CURLYNAMEEXPR);
|
11718 | node.curly = TRUE;
|
11719 |
|
11720 | node.pos = pos;
|
11721 | node.value = this.parse_expr1();
|
11722 | viml_add(curly_parts, node);
|
11723 | this.reader.skip_white();
|
11724 | var c = this.reader.p(0);
|
11725 | if (c != "}") {
|
11726 | throw Err(viml_printf("unexpected token: %s", c), this.reader.getpos());
|
11727 | }
|
11728 | this.reader.seek_cur(1);
|
11729 | }
|
11730 | else {
|
11731 | break;
|
11732 | }
|
11733 | }
|
11734 | return curly_parts;
|
11735 | }
|
11736 |
|
11737 | function LvalueParser() { ExprParser.apply(this, arguments); this.__init__.apply(this, arguments); }
|
11738 | LvalueParser.prototype = Object.create(ExprParser.prototype);
|
11739 | LvalueParser.prototype.parse = function() {
|
11740 | return this.parse_lv8();
|
11741 | }
|
11742 |
|
11743 |
|
11744 |
|
11745 |
|
11746 | LvalueParser.prototype.parse_lv8 = function() {
|
11747 | var left = this.parse_lv9();
|
11748 | while (TRUE) {
|
11749 | var pos = this.reader.tell();
|
11750 | var c = this.reader.peek();
|
11751 | var token = this.tokenizer.get();
|
11752 | if (!iswhite(c) && token.type == TOKEN_SQOPEN) {
|
11753 | var npos = token.pos;
|
11754 | var node = Node(-1);
|
11755 | if (this.tokenizer.peek().type == TOKEN_COLON) {
|
11756 | this.tokenizer.get();
|
11757 | var node = Node(NODE_SLICE);
|
11758 | node.pos = npos;
|
11759 | node.left = left;
|
11760 | node.rlist = [NIL, NIL];
|
11761 | var token = this.tokenizer.peek();
|
11762 | if (token.type != TOKEN_SQCLOSE) {
|
11763 | node.rlist[1] = this.parse_expr1();
|
11764 | }
|
11765 | var token = this.tokenizer.get();
|
11766 | if (token.type != TOKEN_SQCLOSE) {
|
11767 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
11768 | }
|
11769 | }
|
11770 | else {
|
11771 | var right = this.parse_expr1();
|
11772 | if (this.tokenizer.peek().type == TOKEN_COLON) {
|
11773 | this.tokenizer.get();
|
11774 | var node = Node(NODE_SLICE);
|
11775 | node.pos = npos;
|
11776 | node.left = left;
|
11777 | node.rlist = [right, NIL];
|
11778 | var token = this.tokenizer.peek();
|
11779 | if (token.type != TOKEN_SQCLOSE) {
|
11780 | node.rlist[1] = this.parse_expr1();
|
11781 | }
|
11782 | var token = this.tokenizer.get();
|
11783 | if (token.type != TOKEN_SQCLOSE) {
|
11784 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
11785 | }
|
11786 | }
|
11787 | else {
|
11788 | var node = Node(NODE_SUBSCRIPT);
|
11789 | node.pos = npos;
|
11790 | node.left = left;
|
11791 | node.right = right;
|
11792 | var token = this.tokenizer.get();
|
11793 | if (token.type != TOKEN_SQCLOSE) {
|
11794 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
11795 | }
|
11796 | }
|
11797 | }
|
11798 | var left = node;
|
11799 | delete node;
|
11800 | }
|
11801 | else if (!iswhite(c) && token.type == TOKEN_DOT) {
|
11802 | var node = this.parse_dot(token, left);
|
11803 | if (node === NIL) {
|
11804 | this.reader.seek_set(pos);
|
11805 | break;
|
11806 | }
|
11807 | var left = node;
|
11808 | delete node;
|
11809 | }
|
11810 | else {
|
11811 | this.reader.seek_set(pos);
|
11812 | break;
|
11813 | }
|
11814 | }
|
11815 | return left;
|
11816 | }
|
11817 |
|
11818 |
|
11819 |
|
11820 |
|
11821 |
|
11822 |
|
11823 | LvalueParser.prototype.parse_lv9 = function() {
|
11824 | var pos = this.reader.tell();
|
11825 | var token = this.tokenizer.get();
|
11826 | var node = Node(-1);
|
11827 | if (token.type == TOKEN_COPEN) {
|
11828 | this.reader.seek_set(pos);
|
11829 | var node = this.parse_identifier();
|
11830 | }
|
11831 | else if (token.type == TOKEN_OPTION) {
|
11832 | var node = Node(NODE_OPTION);
|
11833 | node.pos = token.pos;
|
11834 | node.value = token.value;
|
11835 | }
|
11836 | else if (token.type == TOKEN_IDENTIFIER) {
|
11837 | this.reader.seek_set(pos);
|
11838 | var node = this.parse_identifier();
|
11839 | }
|
11840 | else if (token.type == TOKEN_LT && viml_equalci(this.reader.peekn(4), "SID>")) {
|
11841 | this.reader.seek_set(pos);
|
11842 | var node = this.parse_identifier();
|
11843 | }
|
11844 | else if (token.type == TOKEN_ENV) {
|
11845 | var node = Node(NODE_ENV);
|
11846 | node.pos = token.pos;
|
11847 | node.value = token.value;
|
11848 | }
|
11849 | else if (token.type == TOKEN_REG) {
|
11850 | var node = Node(NODE_REG);
|
11851 | node.pos = token.pos;
|
11852 | node.pos = token.pos;
|
11853 | node.value = token.value;
|
11854 | }
|
11855 | else {
|
11856 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
11857 | }
|
11858 | return node;
|
11859 | }
|
11860 |
|
11861 | function StringReader() { this.__init__.apply(this, arguments); }
|
11862 | StringReader.prototype.__init__ = function(lines) {
|
11863 | this.buf = [];
|
11864 | this.pos = [];
|
11865 | var lnum = 0;
|
11866 | var offset = 0;
|
11867 | while (lnum < viml_len(lines)) {
|
11868 | var col = 0;
|
11869 | var __c7 = viml_split(lines[lnum], "\\zs");
|
11870 | for (var __i7 = 0; __i7 < __c7.length; ++__i7) {
|
11871 | var c = __c7[__i7];
|
11872 | viml_add(this.buf, c);
|
11873 | viml_add(this.pos, [lnum + 1, col + 1, offset]);
|
11874 | col += viml_len(c);
|
11875 | offset += viml_len(c);
|
11876 | }
|
11877 | while (lnum + 1 < viml_len(lines) && viml_eqregh(lines[lnum + 1], "^\\s*\\\\")) {
|
11878 | var skip = TRUE;
|
11879 | var col = 0;
|
11880 | var __c8 = viml_split(lines[lnum + 1], "\\zs");
|
11881 | for (var __i8 = 0; __i8 < __c8.length; ++__i8) {
|
11882 | var c = __c8[__i8];
|
11883 | if (skip) {
|
11884 | if (c == "\\") {
|
11885 | var skip = FALSE;
|
11886 | }
|
11887 | }
|
11888 | else {
|
11889 | viml_add(this.buf, c);
|
11890 | viml_add(this.pos, [lnum + 2, col + 1, offset]);
|
11891 | }
|
11892 | col += viml_len(c);
|
11893 | offset += viml_len(c);
|
11894 | }
|
11895 | lnum += 1;
|
11896 | offset += 1;
|
11897 | }
|
11898 | viml_add(this.buf, "<EOL>");
|
11899 | viml_add(this.pos, [lnum + 1, col + 1, offset]);
|
11900 | lnum += 1;
|
11901 | offset += 1;
|
11902 | }
|
11903 |
|
11904 | viml_add(this.pos, [lnum + 1, 0, offset]);
|
11905 | this.i = 0;
|
11906 | }
|
11907 |
|
11908 | StringReader.prototype.eof = function() {
|
11909 | return this.i >= viml_len(this.buf);
|
11910 | }
|
11911 |
|
11912 | StringReader.prototype.tell = function() {
|
11913 | return this.i;
|
11914 | }
|
11915 |
|
11916 | StringReader.prototype.seek_set = function(i) {
|
11917 | this.i = i;
|
11918 | }
|
11919 |
|
11920 | StringReader.prototype.seek_cur = function(i) {
|
11921 | this.i = this.i + i;
|
11922 | }
|
11923 |
|
11924 | StringReader.prototype.seek_end = function(i) {
|
11925 | this.i = viml_len(this.buf) + i;
|
11926 | }
|
11927 |
|
11928 | StringReader.prototype.p = function(i) {
|
11929 | if (this.i >= viml_len(this.buf)) {
|
11930 | return "<EOF>";
|
11931 | }
|
11932 | return this.buf[this.i + i];
|
11933 | }
|
11934 |
|
11935 | StringReader.prototype.peek = function() {
|
11936 | if (this.i >= viml_len(this.buf)) {
|
11937 | return "<EOF>";
|
11938 | }
|
11939 | return this.buf[this.i];
|
11940 | }
|
11941 |
|
11942 | StringReader.prototype.get = function() {
|
11943 | if (this.i >= viml_len(this.buf)) {
|
11944 | return "<EOF>";
|
11945 | }
|
11946 | this.i += 1;
|
11947 | return this.buf[this.i - 1];
|
11948 | }
|
11949 |
|
11950 | StringReader.prototype.peekn = function(n) {
|
11951 | var pos = this.tell();
|
11952 | var r = this.getn(n);
|
11953 | this.seek_set(pos);
|
11954 | return r;
|
11955 | }
|
11956 |
|
11957 | StringReader.prototype.getn = function(n) {
|
11958 | var r = "";
|
11959 | var j = 0;
|
11960 | while (this.i < viml_len(this.buf) && (n < 0 || j < n)) {
|
11961 | var c = this.buf[this.i];
|
11962 | if (c == "<EOL>") {
|
11963 | break;
|
11964 | }
|
11965 | r += c;
|
11966 | this.i += 1;
|
11967 | j += 1;
|
11968 | }
|
11969 | return r;
|
11970 | }
|
11971 |
|
11972 | StringReader.prototype.peekline = function() {
|
11973 | return this.peekn(-1);
|
11974 | }
|
11975 |
|
11976 | StringReader.prototype.readline = function() {
|
11977 | var r = this.getn(-1);
|
11978 | this.get();
|
11979 | return r;
|
11980 | }
|
11981 |
|
11982 | StringReader.prototype.getstr = function(begin, end) {
|
11983 | var r = "";
|
11984 | var __c9 = viml_range(begin.i, end.i - 1);
|
11985 | for (var __i9 = 0; __i9 < __c9.length; ++__i9) {
|
11986 | var i = __c9[__i9];
|
11987 | if (i >= viml_len(this.buf)) {
|
11988 | break;
|
11989 | }
|
11990 | var c = this.buf[i];
|
11991 | if (c == "<EOL>") {
|
11992 | var c = "\n";
|
11993 | }
|
11994 | r += c;
|
11995 | }
|
11996 | return r;
|
11997 | }
|
11998 |
|
11999 | StringReader.prototype.getpos = function() {
|
12000 | var __tmp = this.pos[this.i];
|
12001 | var lnum = __tmp[0];
|
12002 | var col = __tmp[1];
|
12003 | var offset = __tmp[2];
|
12004 | return {"i":this.i, "lnum":lnum, "col":col, "offset":offset};
|
12005 | }
|
12006 |
|
12007 | StringReader.prototype.setpos = function(pos) {
|
12008 | this.i = pos.i;
|
12009 | }
|
12010 |
|
12011 | StringReader.prototype.read_alpha = function() {
|
12012 | var r = "";
|
12013 | while (isalpha(this.peekn(1))) {
|
12014 | r += this.getn(1);
|
12015 | }
|
12016 | return r;
|
12017 | }
|
12018 |
|
12019 | StringReader.prototype.read_alnum = function() {
|
12020 | var r = "";
|
12021 | while (isalnum(this.peekn(1))) {
|
12022 | r += this.getn(1);
|
12023 | }
|
12024 | return r;
|
12025 | }
|
12026 |
|
12027 | StringReader.prototype.read_digit = function() {
|
12028 | var r = "";
|
12029 | while (isdigit(this.peekn(1))) {
|
12030 | r += this.getn(1);
|
12031 | }
|
12032 | return r;
|
12033 | }
|
12034 |
|
12035 | StringReader.prototype.read_odigit = function() {
|
12036 | var r = "";
|
12037 | while (isodigit(this.peekn(1))) {
|
12038 | r += this.getn(1);
|
12039 | }
|
12040 | return r;
|
12041 | }
|
12042 |
|
12043 | StringReader.prototype.read_blob = function() {
|
12044 | var r = "";
|
12045 | while (1) {
|
12046 | var s = this.peekn(2);
|
12047 | if (viml_eqregh(s, "^[0-9A-Fa-f][0-9A-Fa-f]$")) {
|
12048 | r += this.getn(2);
|
12049 | }
|
12050 | else if (viml_eqregh(s, "^\\.[0-9A-Fa-f]$")) {
|
12051 | r += this.getn(1);
|
12052 | }
|
12053 | else if (viml_eqregh(s, "^[0-9A-Fa-f][^0-9A-Fa-f]$")) {
|
12054 | throw Err("E973: Blob literal should have an even number of hex characters:" + s, this.getpos());
|
12055 | }
|
12056 | else {
|
12057 | break;
|
12058 | }
|
12059 | }
|
12060 | return r;
|
12061 | }
|
12062 |
|
12063 | StringReader.prototype.read_xdigit = function() {
|
12064 | var r = "";
|
12065 | while (isxdigit(this.peekn(1))) {
|
12066 | r += this.getn(1);
|
12067 | }
|
12068 | return r;
|
12069 | }
|
12070 |
|
12071 | StringReader.prototype.read_bdigit = function() {
|
12072 | var r = "";
|
12073 | while (this.peekn(1) == "0" || this.peekn(1) == "1") {
|
12074 | r += this.getn(1);
|
12075 | }
|
12076 | return r;
|
12077 | }
|
12078 |
|
12079 | StringReader.prototype.read_integer = function() {
|
12080 | var r = "";
|
12081 | var c = this.peekn(1);
|
12082 | if (c == "-" || c == "+") {
|
12083 | var r = this.getn(1);
|
12084 | }
|
12085 | return r + this.read_digit();
|
12086 | }
|
12087 |
|
12088 | StringReader.prototype.read_word = function() {
|
12089 | var r = "";
|
12090 | while (iswordc(this.peekn(1))) {
|
12091 | r += this.getn(1);
|
12092 | }
|
12093 | return r;
|
12094 | }
|
12095 |
|
12096 | StringReader.prototype.read_white = function() {
|
12097 | var r = "";
|
12098 | while (iswhite(this.peekn(1))) {
|
12099 | r += this.getn(1);
|
12100 | }
|
12101 | return r;
|
12102 | }
|
12103 |
|
12104 | StringReader.prototype.read_nonwhite = function() {
|
12105 | var r = "";
|
12106 | var ch = this.peekn(1);
|
12107 | while (!iswhite(ch) && ch != "") {
|
12108 | r += this.getn(1);
|
12109 | var ch = this.peekn(1);
|
12110 | }
|
12111 | return r;
|
12112 | }
|
12113 |
|
12114 | StringReader.prototype.read_name = function() {
|
12115 | var r = "";
|
12116 | while (isnamec(this.peekn(1))) {
|
12117 | r += this.getn(1);
|
12118 | }
|
12119 | return r;
|
12120 | }
|
12121 |
|
12122 | StringReader.prototype.skip_white = function() {
|
12123 | while (iswhite(this.peekn(1))) {
|
12124 | this.seek_cur(1);
|
12125 | }
|
12126 | }
|
12127 |
|
12128 | StringReader.prototype.skip_white_and_colon = function() {
|
12129 | while (TRUE) {
|
12130 | var c = this.peekn(1);
|
12131 | if (!iswhite(c) && c != ":") {
|
12132 | break;
|
12133 | }
|
12134 | this.seek_cur(1);
|
12135 | }
|
12136 | }
|
12137 |
|
12138 | function Compiler() { this.__init__.apply(this, arguments); }
|
12139 | Compiler.prototype.__init__ = function() {
|
12140 | this.indent = [""];
|
12141 | this.lines = [];
|
12142 | }
|
12143 |
|
12144 | Compiler.prototype.out = function() {
|
12145 | var a000 = Array.prototype.slice.call(arguments, 0);
|
12146 | if (viml_len(a000) == 1) {
|
12147 | if (a000[0][0] == ")") {
|
12148 | this.lines[this.lines.length - 1] += a000[0];
|
12149 | }
|
12150 | else {
|
12151 | viml_add(this.lines, this.indent[0] + a000[0]);
|
12152 | }
|
12153 | }
|
12154 | else {
|
12155 | viml_add(this.lines, this.indent[0] + viml_printf.apply(null, a000));
|
12156 | }
|
12157 | }
|
12158 |
|
12159 | Compiler.prototype.incindent = function(s) {
|
12160 | viml_insert(this.indent, this.indent[0] + s);
|
12161 | }
|
12162 |
|
12163 | Compiler.prototype.decindent = function() {
|
12164 | viml_remove(this.indent, 0);
|
12165 | }
|
12166 |
|
12167 | Compiler.prototype.compile = function(node) {
|
12168 | if (node.type == NODE_TOPLEVEL) {
|
12169 | return this.compile_toplevel(node);
|
12170 | }
|
12171 | else if (node.type == NODE_COMMENT) {
|
12172 | this.compile_comment(node);
|
12173 | return NIL;
|
12174 | }
|
12175 | else if (node.type == NODE_EXCMD) {
|
12176 | this.compile_excmd(node);
|
12177 | return NIL;
|
12178 | }
|
12179 | else if (node.type == NODE_FUNCTION) {
|
12180 | this.compile_function(node);
|
12181 | return NIL;
|
12182 | }
|
12183 | else if (node.type == NODE_DELFUNCTION) {
|
12184 | this.compile_delfunction(node);
|
12185 | return NIL;
|
12186 | }
|
12187 | else if (node.type == NODE_RETURN) {
|
12188 | this.compile_return(node);
|
12189 | return NIL;
|
12190 | }
|
12191 | else if (node.type == NODE_EXCALL) {
|
12192 | this.compile_excall(node);
|
12193 | return NIL;
|
12194 | }
|
12195 | else if (node.type == NODE_EVAL) {
|
12196 | this.compile_eval(node);
|
12197 | return NIL;
|
12198 | }
|
12199 | else if (node.type == NODE_LET) {
|
12200 | this.compile_let(node);
|
12201 | return NIL;
|
12202 | }
|
12203 | else if (node.type == NODE_CONST) {
|
12204 | this.compile_const(node);
|
12205 | return NIL;
|
12206 | }
|
12207 | else if (node.type == NODE_UNLET) {
|
12208 | this.compile_unlet(node);
|
12209 | return NIL;
|
12210 | }
|
12211 | else if (node.type == NODE_LOCKVAR) {
|
12212 | this.compile_lockvar(node);
|
12213 | return NIL;
|
12214 | }
|
12215 | else if (node.type == NODE_UNLOCKVAR) {
|
12216 | this.compile_unlockvar(node);
|
12217 | return NIL;
|
12218 | }
|
12219 | else if (node.type == NODE_IF) {
|
12220 | this.compile_if(node);
|
12221 | return NIL;
|
12222 | }
|
12223 | else if (node.type == NODE_WHILE) {
|
12224 | this.compile_while(node);
|
12225 | return NIL;
|
12226 | }
|
12227 | else if (node.type == NODE_FOR) {
|
12228 | this.compile_for(node);
|
12229 | return NIL;
|
12230 | }
|
12231 | else if (node.type == NODE_CONTINUE) {
|
12232 | this.compile_continue(node);
|
12233 | return NIL;
|
12234 | }
|
12235 | else if (node.type == NODE_BREAK) {
|
12236 | this.compile_break(node);
|
12237 | return NIL;
|
12238 | }
|
12239 | else if (node.type == NODE_TRY) {
|
12240 | this.compile_try(node);
|
12241 | return NIL;
|
12242 | }
|
12243 | else if (node.type == NODE_THROW) {
|
12244 | this.compile_throw(node);
|
12245 | return NIL;
|
12246 | }
|
12247 | else if (node.type == NODE_ECHO) {
|
12248 | this.compile_echo(node);
|
12249 | return NIL;
|
12250 | }
|
12251 | else if (node.type == NODE_ECHON) {
|
12252 | this.compile_echon(node);
|
12253 | return NIL;
|
12254 | }
|
12255 | else if (node.type == NODE_ECHOHL) {
|
12256 | this.compile_echohl(node);
|
12257 | return NIL;
|
12258 | }
|
12259 | else if (node.type == NODE_ECHOMSG) {
|
12260 | this.compile_echomsg(node);
|
12261 | return NIL;
|
12262 | }
|
12263 | else if (node.type == NODE_ECHOERR) {
|
12264 | this.compile_echoerr(node);
|
12265 | return NIL;
|
12266 | }
|
12267 | else if (node.type == NODE_EXECUTE) {
|
12268 | this.compile_execute(node);
|
12269 | return NIL;
|
12270 | }
|
12271 | else if (node.type == NODE_TERNARY) {
|
12272 | return this.compile_ternary(node);
|
12273 | }
|
12274 | else if (node.type == NODE_OR) {
|
12275 | return this.compile_or(node);
|
12276 | }
|
12277 | else if (node.type == NODE_AND) {
|
12278 | return this.compile_and(node);
|
12279 | }
|
12280 | else if (node.type == NODE_EQUAL) {
|
12281 | return this.compile_equal(node);
|
12282 | }
|
12283 | else if (node.type == NODE_EQUALCI) {
|
12284 | return this.compile_equalci(node);
|
12285 | }
|
12286 | else if (node.type == NODE_EQUALCS) {
|
12287 | return this.compile_equalcs(node);
|
12288 | }
|
12289 | else if (node.type == NODE_NEQUAL) {
|
12290 | return this.compile_nequal(node);
|
12291 | }
|
12292 | else if (node.type == NODE_NEQUALCI) {
|
12293 | return this.compile_nequalci(node);
|
12294 | }
|
12295 | else if (node.type == NODE_NEQUALCS) {
|
12296 | return this.compile_nequalcs(node);
|
12297 | }
|
12298 | else if (node.type == NODE_GREATER) {
|
12299 | return this.compile_greater(node);
|
12300 | }
|
12301 | else if (node.type == NODE_GREATERCI) {
|
12302 | return this.compile_greaterci(node);
|
12303 | }
|
12304 | else if (node.type == NODE_GREATERCS) {
|
12305 | return this.compile_greatercs(node);
|
12306 | }
|
12307 | else if (node.type == NODE_GEQUAL) {
|
12308 | return this.compile_gequal(node);
|
12309 | }
|
12310 | else if (node.type == NODE_GEQUALCI) {
|
12311 | return this.compile_gequalci(node);
|
12312 | }
|
12313 | else if (node.type == NODE_GEQUALCS) {
|
12314 | return this.compile_gequalcs(node);
|
12315 | }
|
12316 | else if (node.type == NODE_SMALLER) {
|
12317 | return this.compile_smaller(node);
|
12318 | }
|
12319 | else if (node.type == NODE_SMALLERCI) {
|
12320 | return this.compile_smallerci(node);
|
12321 | }
|
12322 | else if (node.type == NODE_SMALLERCS) {
|
12323 | return this.compile_smallercs(node);
|
12324 | }
|
12325 | else if (node.type == NODE_SEQUAL) {
|
12326 | return this.compile_sequal(node);
|
12327 | }
|
12328 | else if (node.type == NODE_SEQUALCI) {
|
12329 | return this.compile_sequalci(node);
|
12330 | }
|
12331 | else if (node.type == NODE_SEQUALCS) {
|
12332 | return this.compile_sequalcs(node);
|
12333 | }
|
12334 | else if (node.type == NODE_MATCH) {
|
12335 | return this.compile_match(node);
|
12336 | }
|
12337 | else if (node.type == NODE_MATCHCI) {
|
12338 | return this.compile_matchci(node);
|
12339 | }
|
12340 | else if (node.type == NODE_MATCHCS) {
|
12341 | return this.compile_matchcs(node);
|
12342 | }
|
12343 | else if (node.type == NODE_NOMATCH) {
|
12344 | return this.compile_nomatch(node);
|
12345 | }
|
12346 | else if (node.type == NODE_NOMATCHCI) {
|
12347 | return this.compile_nomatchci(node);
|
12348 | }
|
12349 | else if (node.type == NODE_NOMATCHCS) {
|
12350 | return this.compile_nomatchcs(node);
|
12351 | }
|
12352 | else if (node.type == NODE_IS) {
|
12353 | return this.compile_is(node);
|
12354 | }
|
12355 | else if (node.type == NODE_ISCI) {
|
12356 | return this.compile_isci(node);
|
12357 | }
|
12358 | else if (node.type == NODE_ISCS) {
|
12359 | return this.compile_iscs(node);
|
12360 | }
|
12361 | else if (node.type == NODE_ISNOT) {
|
12362 | return this.compile_isnot(node);
|
12363 | }
|
12364 | else if (node.type == NODE_ISNOTCI) {
|
12365 | return this.compile_isnotci(node);
|
12366 | }
|
12367 | else if (node.type == NODE_ISNOTCS) {
|
12368 | return this.compile_isnotcs(node);
|
12369 | }
|
12370 | else if (node.type == NODE_ADD) {
|
12371 | return this.compile_add(node);
|
12372 | }
|
12373 | else if (node.type == NODE_SUBTRACT) {
|
12374 | return this.compile_subtract(node);
|
12375 | }
|
12376 | else if (node.type == NODE_CONCAT) {
|
12377 | return this.compile_concat(node);
|
12378 | }
|
12379 | else if (node.type == NODE_MULTIPLY) {
|
12380 | return this.compile_multiply(node);
|
12381 | }
|
12382 | else if (node.type == NODE_DIVIDE) {
|
12383 | return this.compile_divide(node);
|
12384 | }
|
12385 | else if (node.type == NODE_REMAINDER) {
|
12386 | return this.compile_remainder(node);
|
12387 | }
|
12388 | else if (node.type == NODE_NOT) {
|
12389 | return this.compile_not(node);
|
12390 | }
|
12391 | else if (node.type == NODE_PLUS) {
|
12392 | return this.compile_plus(node);
|
12393 | }
|
12394 | else if (node.type == NODE_MINUS) {
|
12395 | return this.compile_minus(node);
|
12396 | }
|
12397 | else if (node.type == NODE_SUBSCRIPT) {
|
12398 | return this.compile_subscript(node);
|
12399 | }
|
12400 | else if (node.type == NODE_SLICE) {
|
12401 | return this.compile_slice(node);
|
12402 | }
|
12403 | else if (node.type == NODE_DOT) {
|
12404 | return this.compile_dot(node);
|
12405 | }
|
12406 | else if (node.type == NODE_METHOD) {
|
12407 | return this.compile_method(node);
|
12408 | }
|
12409 | else if (node.type == NODE_CALL) {
|
12410 | return this.compile_call(node);
|
12411 | }
|
12412 | else if (node.type == NODE_NUMBER) {
|
12413 | return this.compile_number(node);
|
12414 | }
|
12415 | else if (node.type == NODE_BLOB) {
|
12416 | return this.compile_blob(node);
|
12417 | }
|
12418 | else if (node.type == NODE_STRING) {
|
12419 | return this.compile_string(node);
|
12420 | }
|
12421 | else if (node.type == NODE_LIST) {
|
12422 | return this.compile_list(node);
|
12423 | }
|
12424 | else if (node.type == NODE_DICT) {
|
12425 | return this.compile_dict(node);
|
12426 | }
|
12427 | else if (node.type == NODE_OPTION) {
|
12428 | return this.compile_option(node);
|
12429 | }
|
12430 | else if (node.type == NODE_IDENTIFIER) {
|
12431 | return this.compile_identifier(node);
|
12432 | }
|
12433 | else if (node.type == NODE_CURLYNAME) {
|
12434 | return this.compile_curlyname(node);
|
12435 | }
|
12436 | else if (node.type == NODE_ENV) {
|
12437 | return this.compile_env(node);
|
12438 | }
|
12439 | else if (node.type == NODE_REG) {
|
12440 | return this.compile_reg(node);
|
12441 | }
|
12442 | else if (node.type == NODE_CURLYNAMEPART) {
|
12443 | return this.compile_curlynamepart(node);
|
12444 | }
|
12445 | else if (node.type == NODE_CURLYNAMEEXPR) {
|
12446 | return this.compile_curlynameexpr(node);
|
12447 | }
|
12448 | else if (node.type == NODE_LAMBDA) {
|
12449 | return this.compile_lambda(node);
|
12450 | }
|
12451 | else if (node.type == NODE_HEREDOC) {
|
12452 | return this.compile_heredoc(node);
|
12453 | }
|
12454 | else {
|
12455 | throw viml_printf("Compiler: unknown node: %s", viml_string(node));
|
12456 | }
|
12457 | return NIL;
|
12458 | }
|
12459 |
|
12460 | Compiler.prototype.compile_body = function(body) {
|
12461 | var __c10 = body;
|
12462 | for (var __i10 = 0; __i10 < __c10.length; ++__i10) {
|
12463 | var node = __c10[__i10];
|
12464 | this.compile(node);
|
12465 | }
|
12466 | }
|
12467 |
|
12468 | Compiler.prototype.compile_toplevel = function(node) {
|
12469 | this.compile_body(node.body);
|
12470 | return this.lines;
|
12471 | }
|
12472 |
|
12473 | Compiler.prototype.compile_comment = function(node) {
|
12474 | this.out(";%s", node.str);
|
12475 | }
|
12476 |
|
12477 | Compiler.prototype.compile_excmd = function(node) {
|
12478 | this.out("(excmd \"%s\")", viml_escape(node.str, "\\\""));
|
12479 | }
|
12480 |
|
12481 | Compiler.prototype.compile_function = function(node) {
|
12482 | var left = this.compile(node.left);
|
12483 | var rlist = node.rlist.map((function(vval) { return this.compile(vval); }).bind(this));
|
12484 | var default_args = node.default_args.map((function(vval) { return this.compile(vval); }).bind(this));
|
12485 | if (!viml_empty(rlist)) {
|
12486 | var remaining = FALSE;
|
12487 | if (rlist[rlist.length - 1] == "...") {
|
12488 | viml_remove(rlist, -1);
|
12489 | var remaining = TRUE;
|
12490 | }
|
12491 | var __c11 = viml_range(viml_len(rlist));
|
12492 | for (var __i11 = 0; __i11 < __c11.length; ++__i11) {
|
12493 | var i = __c11[__i11];
|
12494 | if (i < viml_len(rlist) - viml_len(default_args)) {
|
12495 | left += viml_printf(" %s", rlist[i]);
|
12496 | }
|
12497 | else {
|
12498 | left += viml_printf(" (%s %s)", rlist[i], default_args[i + viml_len(default_args) - viml_len(rlist)]);
|
12499 | }
|
12500 | }
|
12501 | if (remaining) {
|
12502 | left += " . ...";
|
12503 | }
|
12504 | }
|
12505 | this.out("(function (%s)", left);
|
12506 | this.incindent(" ");
|
12507 | this.compile_body(node.body);
|
12508 | this.out(")");
|
12509 | this.decindent();
|
12510 | }
|
12511 |
|
12512 | Compiler.prototype.compile_delfunction = function(node) {
|
12513 | this.out("(delfunction %s)", this.compile(node.left));
|
12514 | }
|
12515 |
|
12516 | Compiler.prototype.compile_return = function(node) {
|
12517 | if (node.left === NIL) {
|
12518 | this.out("(return)");
|
12519 | }
|
12520 | else {
|
12521 | this.out("(return %s)", this.compile(node.left));
|
12522 | }
|
12523 | }
|
12524 |
|
12525 | Compiler.prototype.compile_excall = function(node) {
|
12526 | this.out("(call %s)", this.compile(node.left));
|
12527 | }
|
12528 |
|
12529 | Compiler.prototype.compile_eval = function(node) {
|
12530 | this.out("(eval %s)", this.compile(node.left));
|
12531 | }
|
12532 |
|
12533 | Compiler.prototype.compile_let = function(node) {
|
12534 | var left = "";
|
12535 | if (node.left !== NIL) {
|
12536 | var left = this.compile(node.left);
|
12537 | }
|
12538 | else {
|
12539 | var left = viml_join(node.list.map((function(vval) { return this.compile(vval); }).bind(this)), " ");
|
12540 | if (node.rest !== NIL) {
|
12541 | left += " . " + this.compile(node.rest);
|
12542 | }
|
12543 | var left = "(" + left + ")";
|
12544 | }
|
12545 | var right = this.compile(node.right);
|
12546 | this.out("(let %s %s %s)", node.op, left, right);
|
12547 | }
|
12548 |
|
12549 |
|
12550 | Compiler.prototype.compile_const = function(node) {
|
12551 | var left = "";
|
12552 | if (node.left !== NIL) {
|
12553 | var left = this.compile(node.left);
|
12554 | }
|
12555 | else {
|
12556 | var left = viml_join(node.list.map((function(vval) { return this.compile(vval); }).bind(this)), " ");
|
12557 | if (node.rest !== NIL) {
|
12558 | left += " . " + this.compile(node.rest);
|
12559 | }
|
12560 | var left = "(" + left + ")";
|
12561 | }
|
12562 | var right = this.compile(node.right);
|
12563 | this.out("(const %s %s %s)", node.op, left, right);
|
12564 | }
|
12565 |
|
12566 | Compiler.prototype.compile_unlet = function(node) {
|
12567 | var list = node.list.map((function(vval) { return this.compile(vval); }).bind(this));
|
12568 | this.out("(unlet %s)", viml_join(list, " "));
|
12569 | }
|
12570 |
|
12571 | Compiler.prototype.compile_lockvar = function(node) {
|
12572 | var list = node.list.map((function(vval) { return this.compile(vval); }).bind(this));
|
12573 | if (node.depth === NIL) {
|
12574 | this.out("(lockvar %s)", viml_join(list, " "));
|
12575 | }
|
12576 | else {
|
12577 | this.out("(lockvar %s %s)", node.depth, viml_join(list, " "));
|
12578 | }
|
12579 | }
|
12580 |
|
12581 | Compiler.prototype.compile_unlockvar = function(node) {
|
12582 | var list = node.list.map((function(vval) { return this.compile(vval); }).bind(this));
|
12583 | if (node.depth === NIL) {
|
12584 | this.out("(unlockvar %s)", viml_join(list, " "));
|
12585 | }
|
12586 | else {
|
12587 | this.out("(unlockvar %s %s)", node.depth, viml_join(list, " "));
|
12588 | }
|
12589 | }
|
12590 |
|
12591 | Compiler.prototype.compile_if = function(node) {
|
12592 | this.out("(if %s", this.compile(node.cond));
|
12593 | this.incindent(" ");
|
12594 | this.compile_body(node.body);
|
12595 | this.decindent();
|
12596 | var __c12 = node.elseif;
|
12597 | for (var __i12 = 0; __i12 < __c12.length; ++__i12) {
|
12598 | var enode = __c12[__i12];
|
12599 | this.out(" elseif %s", this.compile(enode.cond));
|
12600 | this.incindent(" ");
|
12601 | this.compile_body(enode.body);
|
12602 | this.decindent();
|
12603 | }
|
12604 | if (node._else !== NIL) {
|
12605 | this.out(" else");
|
12606 | this.incindent(" ");
|
12607 | this.compile_body(node._else.body);
|
12608 | this.decindent();
|
12609 | }
|
12610 | this.incindent(" ");
|
12611 | this.out(")");
|
12612 | this.decindent();
|
12613 | }
|
12614 |
|
12615 | Compiler.prototype.compile_while = function(node) {
|
12616 | this.out("(while %s", this.compile(node.cond));
|
12617 | this.incindent(" ");
|
12618 | this.compile_body(node.body);
|
12619 | this.out(")");
|
12620 | this.decindent();
|
12621 | }
|
12622 |
|
12623 | Compiler.prototype.compile_for = function(node) {
|
12624 | var left = "";
|
12625 | if (node.left !== NIL) {
|
12626 | var left = this.compile(node.left);
|
12627 | }
|
12628 | else {
|
12629 | var left = viml_join(node.list.map((function(vval) { return this.compile(vval); }).bind(this)), " ");
|
12630 | if (node.rest !== NIL) {
|
12631 | left += " . " + this.compile(node.rest);
|
12632 | }
|
12633 | var left = "(" + left + ")";
|
12634 | }
|
12635 | var right = this.compile(node.right);
|
12636 | this.out("(for %s %s", left, right);
|
12637 | this.incindent(" ");
|
12638 | this.compile_body(node.body);
|
12639 | this.out(")");
|
12640 | this.decindent();
|
12641 | }
|
12642 |
|
12643 | Compiler.prototype.compile_continue = function(node) {
|
12644 | this.out("(continue)");
|
12645 | }
|
12646 |
|
12647 | Compiler.prototype.compile_break = function(node) {
|
12648 | this.out("(break)");
|
12649 | }
|
12650 |
|
12651 | Compiler.prototype.compile_try = function(node) {
|
12652 | this.out("(try");
|
12653 | this.incindent(" ");
|
12654 | this.compile_body(node.body);
|
12655 | var __c13 = node.catch;
|
12656 | for (var __i13 = 0; __i13 < __c13.length; ++__i13) {
|
12657 | var cnode = __c13[__i13];
|
12658 | if (cnode.pattern !== NIL) {
|
12659 | this.decindent();
|
12660 | this.out(" catch /%s/", cnode.pattern);
|
12661 | this.incindent(" ");
|
12662 | this.compile_body(cnode.body);
|
12663 | }
|
12664 | else {
|
12665 | this.decindent();
|
12666 | this.out(" catch");
|
12667 | this.incindent(" ");
|
12668 | this.compile_body(cnode.body);
|
12669 | }
|
12670 | }
|
12671 | if (node._finally !== NIL) {
|
12672 | this.decindent();
|
12673 | this.out(" finally");
|
12674 | this.incindent(" ");
|
12675 | this.compile_body(node._finally.body);
|
12676 | }
|
12677 | this.out(")");
|
12678 | this.decindent();
|
12679 | }
|
12680 |
|
12681 | Compiler.prototype.compile_throw = function(node) {
|
12682 | this.out("(throw %s)", this.compile(node.left));
|
12683 | }
|
12684 |
|
12685 | Compiler.prototype.compile_echo = function(node) {
|
12686 | var list = node.list.map((function(vval) { return this.compile(vval); }).bind(this));
|
12687 | this.out("(echo %s)", viml_join(list, " "));
|
12688 | }
|
12689 |
|
12690 | Compiler.prototype.compile_echon = function(node) {
|
12691 | var list = node.list.map((function(vval) { return this.compile(vval); }).bind(this));
|
12692 | this.out("(echon %s)", viml_join(list, " "));
|
12693 | }
|
12694 |
|
12695 | Compiler.prototype.compile_echohl = function(node) {
|
12696 | this.out("(echohl \"%s\")", viml_escape(node.str, "\\\""));
|
12697 | }
|
12698 |
|
12699 | Compiler.prototype.compile_echomsg = function(node) {
|
12700 | var list = node.list.map((function(vval) { return this.compile(vval); }).bind(this));
|
12701 | this.out("(echomsg %s)", viml_join(list, " "));
|
12702 | }
|
12703 |
|
12704 | Compiler.prototype.compile_echoerr = function(node) {
|
12705 | var list = node.list.map((function(vval) { return this.compile(vval); }).bind(this));
|
12706 | this.out("(echoerr %s)", viml_join(list, " "));
|
12707 | }
|
12708 |
|
12709 | Compiler.prototype.compile_execute = function(node) {
|
12710 | var list = node.list.map((function(vval) { return this.compile(vval); }).bind(this));
|
12711 | this.out("(execute %s)", viml_join(list, " "));
|
12712 | }
|
12713 |
|
12714 | Compiler.prototype.compile_ternary = function(node) {
|
12715 | return viml_printf("(?: %s %s %s)", this.compile(node.cond), this.compile(node.left), this.compile(node.right));
|
12716 | }
|
12717 |
|
12718 | Compiler.prototype.compile_or = function(node) {
|
12719 | return viml_printf("(|| %s %s)", this.compile(node.left), this.compile(node.right));
|
12720 | }
|
12721 |
|
12722 | Compiler.prototype.compile_and = function(node) {
|
12723 | return viml_printf("(&& %s %s)", this.compile(node.left), this.compile(node.right));
|
12724 | }
|
12725 |
|
12726 | Compiler.prototype.compile_equal = function(node) {
|
12727 | return viml_printf("(== %s %s)", this.compile(node.left), this.compile(node.right));
|
12728 | }
|
12729 |
|
12730 | Compiler.prototype.compile_equalci = function(node) {
|
12731 | return viml_printf("(==? %s %s)", this.compile(node.left), this.compile(node.right));
|
12732 | }
|
12733 |
|
12734 | Compiler.prototype.compile_equalcs = function(node) {
|
12735 | return viml_printf("(==# %s %s)", this.compile(node.left), this.compile(node.right));
|
12736 | }
|
12737 |
|
12738 | Compiler.prototype.compile_nequal = function(node) {
|
12739 | return viml_printf("(!= %s %s)", this.compile(node.left), this.compile(node.right));
|
12740 | }
|
12741 |
|
12742 | Compiler.prototype.compile_nequalci = function(node) {
|
12743 | return viml_printf("(!=? %s %s)", this.compile(node.left), this.compile(node.right));
|
12744 | }
|
12745 |
|
12746 | Compiler.prototype.compile_nequalcs = function(node) {
|
12747 | return viml_printf("(!=# %s %s)", this.compile(node.left), this.compile(node.right));
|
12748 | }
|
12749 |
|
12750 | Compiler.prototype.compile_greater = function(node) {
|
12751 | return viml_printf("(> %s %s)", this.compile(node.left), this.compile(node.right));
|
12752 | }
|
12753 |
|
12754 | Compiler.prototype.compile_greaterci = function(node) {
|
12755 | return viml_printf("(>? %s %s)", this.compile(node.left), this.compile(node.right));
|
12756 | }
|
12757 |
|
12758 | Compiler.prototype.compile_greatercs = function(node) {
|
12759 | return viml_printf("(># %s %s)", this.compile(node.left), this.compile(node.right));
|
12760 | }
|
12761 |
|
12762 | Compiler.prototype.compile_gequal = function(node) {
|
12763 | return viml_printf("(>= %s %s)", this.compile(node.left), this.compile(node.right));
|
12764 | }
|
12765 |
|
12766 | Compiler.prototype.compile_gequalci = function(node) {
|
12767 | return viml_printf("(>=? %s %s)", this.compile(node.left), this.compile(node.right));
|
12768 | }
|
12769 |
|
12770 | Compiler.prototype.compile_gequalcs = function(node) {
|
12771 | return viml_printf("(>=# %s %s)", this.compile(node.left), this.compile(node.right));
|
12772 | }
|
12773 |
|
12774 | Compiler.prototype.compile_smaller = function(node) {
|
12775 | return viml_printf("(< %s %s)", this.compile(node.left), this.compile(node.right));
|
12776 | }
|
12777 |
|
12778 | Compiler.prototype.compile_smallerci = function(node) {
|
12779 | return viml_printf("(<? %s %s)", this.compile(node.left), this.compile(node.right));
|
12780 | }
|
12781 |
|
12782 | Compiler.prototype.compile_smallercs = function(node) {
|
12783 | return viml_printf("(<# %s %s)", this.compile(node.left), this.compile(node.right));
|
12784 | }
|
12785 |
|
12786 | Compiler.prototype.compile_sequal = function(node) {
|
12787 | return viml_printf("(<= %s %s)", this.compile(node.left), this.compile(node.right));
|
12788 | }
|
12789 |
|
12790 | Compiler.prototype.compile_sequalci = function(node) {
|
12791 | return viml_printf("(<=? %s %s)", this.compile(node.left), this.compile(node.right));
|
12792 | }
|
12793 |
|
12794 | Compiler.prototype.compile_sequalcs = function(node) {
|
12795 | return viml_printf("(<=# %s %s)", this.compile(node.left), this.compile(node.right));
|
12796 | }
|
12797 |
|
12798 | Compiler.prototype.compile_match = function(node) {
|
12799 | return viml_printf("(=~ %s %s)", this.compile(node.left), this.compile(node.right));
|
12800 | }
|
12801 |
|
12802 | Compiler.prototype.compile_matchci = function(node) {
|
12803 | return viml_printf("(=~? %s %s)", this.compile(node.left), this.compile(node.right));
|
12804 | }
|
12805 |
|
12806 | Compiler.prototype.compile_matchcs = function(node) {
|
12807 | return viml_printf("(=~# %s %s)", this.compile(node.left), this.compile(node.right));
|
12808 | }
|
12809 |
|
12810 | Compiler.prototype.compile_nomatch = function(node) {
|
12811 | return viml_printf("(!~ %s %s)", this.compile(node.left), this.compile(node.right));
|
12812 | }
|
12813 |
|
12814 | Compiler.prototype.compile_nomatchci = function(node) {
|
12815 | return viml_printf("(!~? %s %s)", this.compile(node.left), this.compile(node.right));
|
12816 | }
|
12817 |
|
12818 | Compiler.prototype.compile_nomatchcs = function(node) {
|
12819 | return viml_printf("(!~# %s %s)", this.compile(node.left), this.compile(node.right));
|
12820 | }
|
12821 |
|
12822 | Compiler.prototype.compile_is = function(node) {
|
12823 | return viml_printf("(is %s %s)", this.compile(node.left), this.compile(node.right));
|
12824 | }
|
12825 |
|
12826 | Compiler.prototype.compile_isci = function(node) {
|
12827 | return viml_printf("(is? %s %s)", this.compile(node.left), this.compile(node.right));
|
12828 | }
|
12829 |
|
12830 | Compiler.prototype.compile_iscs = function(node) {
|
12831 | return viml_printf("(is# %s %s)", this.compile(node.left), this.compile(node.right));
|
12832 | }
|
12833 |
|
12834 | Compiler.prototype.compile_isnot = function(node) {
|
12835 | return viml_printf("(isnot %s %s)", this.compile(node.left), this.compile(node.right));
|
12836 | }
|
12837 |
|
12838 | Compiler.prototype.compile_isnotci = function(node) {
|
12839 | return viml_printf("(isnot? %s %s)", this.compile(node.left), this.compile(node.right));
|
12840 | }
|
12841 |
|
12842 | Compiler.prototype.compile_isnotcs = function(node) {
|
12843 | return viml_printf("(isnot# %s %s)", this.compile(node.left), this.compile(node.right));
|
12844 | }
|
12845 |
|
12846 | Compiler.prototype.compile_add = function(node) {
|
12847 | return viml_printf("(+ %s %s)", this.compile(node.left), this.compile(node.right));
|
12848 | }
|
12849 |
|
12850 | Compiler.prototype.compile_subtract = function(node) {
|
12851 | return viml_printf("(- %s %s)", this.compile(node.left), this.compile(node.right));
|
12852 | }
|
12853 |
|
12854 | Compiler.prototype.compile_concat = function(node) {
|
12855 | return viml_printf("(concat %s %s)", this.compile(node.left), this.compile(node.right));
|
12856 | }
|
12857 |
|
12858 | Compiler.prototype.compile_multiply = function(node) {
|
12859 | return viml_printf("(* %s %s)", this.compile(node.left), this.compile(node.right));
|
12860 | }
|
12861 |
|
12862 | Compiler.prototype.compile_divide = function(node) {
|
12863 | return viml_printf("(/ %s %s)", this.compile(node.left), this.compile(node.right));
|
12864 | }
|
12865 |
|
12866 | Compiler.prototype.compile_remainder = function(node) {
|
12867 | return viml_printf("(%% %s %s)", this.compile(node.left), this.compile(node.right));
|
12868 | }
|
12869 |
|
12870 | Compiler.prototype.compile_not = function(node) {
|
12871 | return viml_printf("(! %s)", this.compile(node.left));
|
12872 | }
|
12873 |
|
12874 | Compiler.prototype.compile_plus = function(node) {
|
12875 | return viml_printf("(+ %s)", this.compile(node.left));
|
12876 | }
|
12877 |
|
12878 | Compiler.prototype.compile_minus = function(node) {
|
12879 | return viml_printf("(- %s)", this.compile(node.left));
|
12880 | }
|
12881 |
|
12882 | Compiler.prototype.compile_subscript = function(node) {
|
12883 | return viml_printf("(subscript %s %s)", this.compile(node.left), this.compile(node.right));
|
12884 | }
|
12885 |
|
12886 | Compiler.prototype.compile_slice = function(node) {
|
12887 | var r0 = node.rlist[0] === NIL ? "nil" : this.compile(node.rlist[0]);
|
12888 | var r1 = node.rlist[1] === NIL ? "nil" : this.compile(node.rlist[1]);
|
12889 | return viml_printf("(slice %s %s %s)", this.compile(node.left), r0, r1);
|
12890 | }
|
12891 |
|
12892 | Compiler.prototype.compile_dot = function(node) {
|
12893 | return viml_printf("(dot %s %s)", this.compile(node.left), this.compile(node.right));
|
12894 | }
|
12895 |
|
12896 | Compiler.prototype.compile_method = function(node) {
|
12897 | return viml_printf("(method %s %s)", this.compile(node.left), this.compile(node.right));
|
12898 | }
|
12899 |
|
12900 | Compiler.prototype.compile_call = function(node) {
|
12901 | var rlist = node.rlist.map((function(vval) { return this.compile(vval); }).bind(this));
|
12902 | if (viml_empty(rlist)) {
|
12903 | return viml_printf("(%s)", this.compile(node.left));
|
12904 | }
|
12905 | else {
|
12906 | return viml_printf("(%s %s)", this.compile(node.left), viml_join(rlist, " "));
|
12907 | }
|
12908 | }
|
12909 |
|
12910 | Compiler.prototype.compile_number = function(node) {
|
12911 | return node.value;
|
12912 | }
|
12913 |
|
12914 | Compiler.prototype.compile_blob = function(node) {
|
12915 | return node.value;
|
12916 | }
|
12917 |
|
12918 | Compiler.prototype.compile_string = function(node) {
|
12919 | return node.value;
|
12920 | }
|
12921 |
|
12922 | Compiler.prototype.compile_list = function(node) {
|
12923 | var value = node.value.map((function(vval) { return this.compile(vval); }).bind(this));
|
12924 | if (viml_empty(value)) {
|
12925 | return "(list)";
|
12926 | }
|
12927 | else {
|
12928 | return viml_printf("(list %s)", viml_join(value, " "));
|
12929 | }
|
12930 | }
|
12931 |
|
12932 | Compiler.prototype.compile_dict = function(node) {
|
12933 | var value = node.value.map((function(vval) { return "(" + this.compile(vval[0]) + " " + this.compile(vval[1]) + ")"; }).bind(this));
|
12934 | if (viml_empty(value)) {
|
12935 | return "(dict)";
|
12936 | }
|
12937 | else {
|
12938 | return viml_printf("(dict %s)", viml_join(value, " "));
|
12939 | }
|
12940 | }
|
12941 |
|
12942 | Compiler.prototype.compile_option = function(node) {
|
12943 | return node.value;
|
12944 | }
|
12945 |
|
12946 | Compiler.prototype.compile_identifier = function(node) {
|
12947 | return node.value;
|
12948 | }
|
12949 |
|
12950 | Compiler.prototype.compile_curlyname = function(node) {
|
12951 | return viml_join(node.value.map((function(vval) { return this.compile(vval); }).bind(this)), "");
|
12952 | }
|
12953 |
|
12954 | Compiler.prototype.compile_env = function(node) {
|
12955 | return node.value;
|
12956 | }
|
12957 |
|
12958 | Compiler.prototype.compile_reg = function(node) {
|
12959 | return node.value;
|
12960 | }
|
12961 |
|
12962 | Compiler.prototype.compile_curlynamepart = function(node) {
|
12963 | return node.value;
|
12964 | }
|
12965 |
|
12966 | Compiler.prototype.compile_curlynameexpr = function(node) {
|
12967 | return "{" + this.compile(node.value) + "}";
|
12968 | }
|
12969 |
|
12970 | Compiler.prototype.escape_string = function(str) {
|
12971 | var m = {"\n":"\\n", "\t":"\\t", "\r":"\\r"};
|
12972 | var out = "\"";
|
12973 | var __c14 = viml_range(viml_len(str));
|
12974 | for (var __i14 = 0; __i14 < __c14.length; ++__i14) {
|
12975 | var i = __c14[__i14];
|
12976 | var c = str[i];
|
12977 | if (viml_has_key(m, c)) {
|
12978 | out += m[c];
|
12979 | }
|
12980 | else {
|
12981 | out += c;
|
12982 | }
|
12983 | }
|
12984 | out += "\"";
|
12985 | return out;
|
12986 | }
|
12987 |
|
12988 | Compiler.prototype.compile_lambda = function(node) {
|
12989 | var rlist = node.rlist.map((function(vval) { return this.compile(vval); }).bind(this));
|
12990 | return viml_printf("(lambda (%s) %s)", viml_join(rlist, " "), this.compile(node.left));
|
12991 | }
|
12992 |
|
12993 | Compiler.prototype.compile_heredoc = function(node) {
|
12994 | if (viml_empty(node.rlist)) {
|
12995 | var rlist = "(list)";
|
12996 | }
|
12997 | else {
|
12998 | var rlist = "(list " + viml_join(node.rlist.map((function(vval) { return this.escape_string(vval); }).bind(this)), " ") + ")";
|
12999 | }
|
13000 | if (viml_empty(node.body)) {
|
13001 | var body = "(list)";
|
13002 | }
|
13003 | else {
|
13004 | var body = "(list " + viml_join(node.body.map((function(vval) { return this.escape_string(vval); }).bind(this)), " ") + ")";
|
13005 | }
|
13006 | var op = this.escape_string(node.op);
|
13007 | return viml_printf("(heredoc %s %s %s)", rlist, op, body);
|
13008 | }
|
13009 |
|
13010 |
|
13011 | function RegexpParser() { this.__init__.apply(this, arguments); }
|
13012 | RegexpParser.prototype.RE_VERY_NOMAGIC = 1;
|
13013 | RegexpParser.prototype.RE_NOMAGIC = 2;
|
13014 | RegexpParser.prototype.RE_MAGIC = 3;
|
13015 | RegexpParser.prototype.RE_VERY_MAGIC = 4;
|
13016 | RegexpParser.prototype.__init__ = function(reader, cmd, delim) {
|
13017 | this.reader = reader;
|
13018 | this.cmd = cmd;
|
13019 | this.delim = delim;
|
13020 | this.reg_magic = this.RE_MAGIC;
|
13021 | }
|
13022 |
|
13023 | RegexpParser.prototype.isend = function(c) {
|
13024 | return c == "<EOF>" || c == "<EOL>" || c == this.delim;
|
13025 | }
|
13026 |
|
13027 | RegexpParser.prototype.parse_regexp = function() {
|
13028 | var prevtoken = "";
|
13029 | var ntoken = "";
|
13030 | var ret = [];
|
13031 | if (this.reader.peekn(4) == "\\%#=") {
|
13032 | var epos = this.reader.getpos();
|
13033 | var token = this.reader.getn(5);
|
13034 | if (token != "\\%#=0" && token != "\\%#=1" && token != "\\%#=2") {
|
13035 | throw Err("E864: \\%#= can only be followed by 0, 1, or 2", epos);
|
13036 | }
|
13037 | viml_add(ret, token);
|
13038 | }
|
13039 | while (!this.isend(this.reader.peek())) {
|
13040 | var prevtoken = ntoken;
|
13041 | var __tmp = this.get_token();
|
13042 | var token = __tmp[0];
|
13043 | var ntoken = __tmp[1];
|
13044 | if (ntoken == "\\m") {
|
13045 | this.reg_magic = this.RE_MAGIC;
|
13046 | }
|
13047 | else if (ntoken == "\\M") {
|
13048 | this.reg_magic = this.RE_NOMAGIC;
|
13049 | }
|
13050 | else if (ntoken == "\\v") {
|
13051 | this.reg_magic = this.RE_VERY_MAGIC;
|
13052 | }
|
13053 | else if (ntoken == "\\V") {
|
13054 | this.reg_magic = this.RE_VERY_NOMAGIC;
|
13055 | }
|
13056 | else if (ntoken == "\\*") {
|
13057 |
|
13058 | if (prevtoken == "" || prevtoken == "\\^" || prevtoken == "\\&" || prevtoken == "\\|" || prevtoken == "\\(") {
|
13059 | var ntoken = "*";
|
13060 | }
|
13061 | }
|
13062 | else if (ntoken == "\\^") {
|
13063 |
|
13064 | if (this.reg_magic != this.RE_VERY_MAGIC && prevtoken != "" && prevtoken != "\\&" && prevtoken != "\\|" && prevtoken != "\\n" && prevtoken != "\\(" && prevtoken != "\\%(") {
|
13065 | var ntoken = "^";
|
13066 | }
|
13067 | }
|
13068 | else if (ntoken == "\\$") {
|
13069 |
|
13070 | var pos = this.reader.tell();
|
13071 | if (this.reg_magic != this.RE_VERY_MAGIC) {
|
13072 | while (!this.isend(this.reader.peek())) {
|
13073 | var __tmp = this.get_token();
|
13074 | var t = __tmp[0];
|
13075 | var n = __tmp[1];
|
13076 |
|
13077 | if (n == "\\c" || n == "\\C" || n == "\\m" || n == "\\M" || n == "\\Z") {
|
13078 | continue;
|
13079 | }
|
13080 | if (n != "\\|" && n != "\\&" && n != "\\n" && n != "\\)") {
|
13081 | var ntoken = "$";
|
13082 | }
|
13083 | break;
|
13084 | }
|
13085 | }
|
13086 | this.reader.seek_set(pos);
|
13087 | }
|
13088 | else if (ntoken == "\\?") {
|
13089 |
|
13090 | if (this.cmd == "?") {
|
13091 | var ntoken = "?";
|
13092 | }
|
13093 | }
|
13094 | viml_add(ret, ntoken);
|
13095 | }
|
13096 | return ret;
|
13097 | }
|
13098 |
|
13099 |
|
13100 | RegexpParser.prototype.get_token = function() {
|
13101 | if (this.reg_magic == this.RE_VERY_MAGIC) {
|
13102 | return this.get_token_very_magic();
|
13103 | }
|
13104 | else if (this.reg_magic == this.RE_MAGIC) {
|
13105 | return this.get_token_magic();
|
13106 | }
|
13107 | else if (this.reg_magic == this.RE_NOMAGIC) {
|
13108 | return this.get_token_nomagic();
|
13109 | }
|
13110 | else if (this.reg_magic == this.RE_VERY_NOMAGIC) {
|
13111 | return this.get_token_very_nomagic();
|
13112 | }
|
13113 | }
|
13114 |
|
13115 | RegexpParser.prototype.get_token_very_magic = function() {
|
13116 | if (this.isend(this.reader.peek())) {
|
13117 | return ["<END>", "<END>"];
|
13118 | }
|
13119 | var c = this.reader.get();
|
13120 | if (c == "\\") {
|
13121 | return this.get_token_backslash_common();
|
13122 | }
|
13123 | else if (c == "*") {
|
13124 | return ["*", "\\*"];
|
13125 | }
|
13126 | else if (c == "+") {
|
13127 | return ["+", "\\+"];
|
13128 | }
|
13129 | else if (c == "=") {
|
13130 | return ["=", "\\="];
|
13131 | }
|
13132 | else if (c == "?") {
|
13133 | return ["?", "\\?"];
|
13134 | }
|
13135 | else if (c == "{") {
|
13136 | return this.get_token_brace("{");
|
13137 | }
|
13138 | else if (c == "@") {
|
13139 | return this.get_token_at("@");
|
13140 | }
|
13141 | else if (c == "^") {
|
13142 | return ["^", "\\^"];
|
13143 | }
|
13144 | else if (c == "$") {
|
13145 | return ["$", "\\$"];
|
13146 | }
|
13147 | else if (c == ".") {
|
13148 | return [".", "\\."];
|
13149 | }
|
13150 | else if (c == "<") {
|
13151 | return ["<", "\\<"];
|
13152 | }
|
13153 | else if (c == ">") {
|
13154 | return [">", "\\>"];
|
13155 | }
|
13156 | else if (c == "%") {
|
13157 | return this.get_token_percent("%");
|
13158 | }
|
13159 | else if (c == "[") {
|
13160 | return this.get_token_sq("[");
|
13161 | }
|
13162 | else if (c == "~") {
|
13163 | return ["~", "\\~"];
|
13164 | }
|
13165 | else if (c == "|") {
|
13166 | return ["|", "\\|"];
|
13167 | }
|
13168 | else if (c == "&") {
|
13169 | return ["&", "\\&"];
|
13170 | }
|
13171 | else if (c == "(") {
|
13172 | return ["(", "\\("];
|
13173 | }
|
13174 | else if (c == ")") {
|
13175 | return [")", "\\)"];
|
13176 | }
|
13177 | return [c, c];
|
13178 | }
|
13179 |
|
13180 | RegexpParser.prototype.get_token_magic = function() {
|
13181 | if (this.isend(this.reader.peek())) {
|
13182 | return ["<END>", "<END>"];
|
13183 | }
|
13184 | var c = this.reader.get();
|
13185 | if (c == "\\") {
|
13186 | var pos = this.reader.tell();
|
13187 | var c = this.reader.get();
|
13188 | if (c == "+") {
|
13189 | return ["\\+", "\\+"];
|
13190 | }
|
13191 | else if (c == "=") {
|
13192 | return ["\\=", "\\="];
|
13193 | }
|
13194 | else if (c == "?") {
|
13195 | return ["\\?", "\\?"];
|
13196 | }
|
13197 | else if (c == "{") {
|
13198 | return this.get_token_brace("\\{");
|
13199 | }
|
13200 | else if (c == "@") {
|
13201 | return this.get_token_at("\\@");
|
13202 | }
|
13203 | else if (c == "<") {
|
13204 | return ["\\<", "\\<"];
|
13205 | }
|
13206 | else if (c == ">") {
|
13207 | return ["\\>", "\\>"];
|
13208 | }
|
13209 | else if (c == "%") {
|
13210 | return this.get_token_percent("\\%");
|
13211 | }
|
13212 | else if (c == "|") {
|
13213 | return ["\\|", "\\|"];
|
13214 | }
|
13215 | else if (c == "&") {
|
13216 | return ["\\&", "\\&"];
|
13217 | }
|
13218 | else if (c == "(") {
|
13219 | return ["\\(", "\\("];
|
13220 | }
|
13221 | else if (c == ")") {
|
13222 | return ["\\)", "\\)"];
|
13223 | }
|
13224 | this.reader.seek_set(pos);
|
13225 | return this.get_token_backslash_common();
|
13226 | }
|
13227 | else if (c == "*") {
|
13228 | return ["*", "\\*"];
|
13229 | }
|
13230 | else if (c == "^") {
|
13231 | return ["^", "\\^"];
|
13232 | }
|
13233 | else if (c == "$") {
|
13234 | return ["$", "\\$"];
|
13235 | }
|
13236 | else if (c == ".") {
|
13237 | return [".", "\\."];
|
13238 | }
|
13239 | else if (c == "[") {
|
13240 | return this.get_token_sq("[");
|
13241 | }
|
13242 | else if (c == "~") {
|
13243 | return ["~", "\\~"];
|
13244 | }
|
13245 | return [c, c];
|
13246 | }
|
13247 |
|
13248 | RegexpParser.prototype.get_token_nomagic = function() {
|
13249 | if (this.isend(this.reader.peek())) {
|
13250 | return ["<END>", "<END>"];
|
13251 | }
|
13252 | var c = this.reader.get();
|
13253 | if (c == "\\") {
|
13254 | var pos = this.reader.tell();
|
13255 | var c = this.reader.get();
|
13256 | if (c == "*") {
|
13257 | return ["\\*", "\\*"];
|
13258 | }
|
13259 | else if (c == "+") {
|
13260 | return ["\\+", "\\+"];
|
13261 | }
|
13262 | else if (c == "=") {
|
13263 | return ["\\=", "\\="];
|
13264 | }
|
13265 | else if (c == "?") {
|
13266 | return ["\\?", "\\?"];
|
13267 | }
|
13268 | else if (c == "{") {
|
13269 | return this.get_token_brace("\\{");
|
13270 | }
|
13271 | else if (c == "@") {
|
13272 | return this.get_token_at("\\@");
|
13273 | }
|
13274 | else if (c == ".") {
|
13275 | return ["\\.", "\\."];
|
13276 | }
|
13277 | else if (c == "<") {
|
13278 | return ["\\<", "\\<"];
|
13279 | }
|
13280 | else if (c == ">") {
|
13281 | return ["\\>", "\\>"];
|
13282 | }
|
13283 | else if (c == "%") {
|
13284 | return this.get_token_percent("\\%");
|
13285 | }
|
13286 | else if (c == "~") {
|
13287 | return ["\\~", "\\^"];
|
13288 | }
|
13289 | else if (c == "[") {
|
13290 | return this.get_token_sq("\\[");
|
13291 | }
|
13292 | else if (c == "|") {
|
13293 | return ["\\|", "\\|"];
|
13294 | }
|
13295 | else if (c == "&") {
|
13296 | return ["\\&", "\\&"];
|
13297 | }
|
13298 | else if (c == "(") {
|
13299 | return ["\\(", "\\("];
|
13300 | }
|
13301 | else if (c == ")") {
|
13302 | return ["\\)", "\\)"];
|
13303 | }
|
13304 | this.reader.seek_set(pos);
|
13305 | return this.get_token_backslash_common();
|
13306 | }
|
13307 | else if (c == "^") {
|
13308 | return ["^", "\\^"];
|
13309 | }
|
13310 | else if (c == "$") {
|
13311 | return ["$", "\\$"];
|
13312 | }
|
13313 | return [c, c];
|
13314 | }
|
13315 |
|
13316 | RegexpParser.prototype.get_token_very_nomagic = function() {
|
13317 | if (this.isend(this.reader.peek())) {
|
13318 | return ["<END>", "<END>"];
|
13319 | }
|
13320 | var c = this.reader.get();
|
13321 | if (c == "\\") {
|
13322 | var pos = this.reader.tell();
|
13323 | var c = this.reader.get();
|
13324 | if (c == "*") {
|
13325 | return ["\\*", "\\*"];
|
13326 | }
|
13327 | else if (c == "+") {
|
13328 | return ["\\+", "\\+"];
|
13329 | }
|
13330 | else if (c == "=") {
|
13331 | return ["\\=", "\\="];
|
13332 | }
|
13333 | else if (c == "?") {
|
13334 | return ["\\?", "\\?"];
|
13335 | }
|
13336 | else if (c == "{") {
|
13337 | return this.get_token_brace("\\{");
|
13338 | }
|
13339 | else if (c == "@") {
|
13340 | return this.get_token_at("\\@");
|
13341 | }
|
13342 | else if (c == "^") {
|
13343 | return ["\\^", "\\^"];
|
13344 | }
|
13345 | else if (c == "$") {
|
13346 | return ["\\$", "\\$"];
|
13347 | }
|
13348 | else if (c == "<") {
|
13349 | return ["\\<", "\\<"];
|
13350 | }
|
13351 | else if (c == ">") {
|
13352 | return ["\\>", "\\>"];
|
13353 | }
|
13354 | else if (c == "%") {
|
13355 | return this.get_token_percent("\\%");
|
13356 | }
|
13357 | else if (c == "~") {
|
13358 | return ["\\~", "\\~"];
|
13359 | }
|
13360 | else if (c == "[") {
|
13361 | return this.get_token_sq("\\[");
|
13362 | }
|
13363 | else if (c == "|") {
|
13364 | return ["\\|", "\\|"];
|
13365 | }
|
13366 | else if (c == "&") {
|
13367 | return ["\\&", "\\&"];
|
13368 | }
|
13369 | else if (c == "(") {
|
13370 | return ["\\(", "\\("];
|
13371 | }
|
13372 | else if (c == ")") {
|
13373 | return ["\\)", "\\)"];
|
13374 | }
|
13375 | this.reader.seek_set(pos);
|
13376 | return this.get_token_backslash_common();
|
13377 | }
|
13378 | return [c, c];
|
13379 | }
|
13380 |
|
13381 | RegexpParser.prototype.get_token_backslash_common = function() {
|
13382 | var cclass = "iIkKfFpPsSdDxXoOwWhHaAlLuU";
|
13383 | var c = this.reader.get();
|
13384 | if (c == "\\") {
|
13385 | return ["\\\\", "\\\\"];
|
13386 | }
|
13387 | else if (viml_stridx(cclass, c) != -1) {
|
13388 | return ["\\" + c, "\\" + c];
|
13389 | }
|
13390 | else if (c == "_") {
|
13391 | var epos = this.reader.getpos();
|
13392 | var c = this.reader.get();
|
13393 | if (viml_stridx(cclass, c) != -1) {
|
13394 | return ["\\_" + c, "\\_ . c"];
|
13395 | }
|
13396 | else if (c == "^") {
|
13397 | return ["\\_^", "\\_^"];
|
13398 | }
|
13399 | else if (c == "$") {
|
13400 | return ["\\_$", "\\_$"];
|
13401 | }
|
13402 | else if (c == ".") {
|
13403 | return ["\\_.", "\\_."];
|
13404 | }
|
13405 | else if (c == "[") {
|
13406 | return this.get_token_sq("\\_[");
|
13407 | }
|
13408 | throw Err("E63: Invalid use of \\_", epos);
|
13409 | }
|
13410 | else if (viml_stridx("etrb", c) != -1) {
|
13411 | return ["\\" + c, "\\" + c];
|
13412 | }
|
13413 | else if (viml_stridx("123456789", c) != -1) {
|
13414 | return ["\\" + c, "\\" + c];
|
13415 | }
|
13416 | else if (c == "z") {
|
13417 | var epos = this.reader.getpos();
|
13418 | var c = this.reader.get();
|
13419 | if (viml_stridx("123456789", c) != -1) {
|
13420 | return ["\\z" + c, "\\z" + c];
|
13421 | }
|
13422 | else if (c == "s") {
|
13423 | return ["\\zs", "\\zs"];
|
13424 | }
|
13425 | else if (c == "e") {
|
13426 | return ["\\ze", "\\ze"];
|
13427 | }
|
13428 | else if (c == "(") {
|
13429 | return ["\\z(", "\\z("];
|
13430 | }
|
13431 | throw Err("E68: Invalid character after \\z", epos);
|
13432 | }
|
13433 | else if (viml_stridx("cCmMvVZ", c) != -1) {
|
13434 | return ["\\" + c, "\\" + c];
|
13435 | }
|
13436 | else if (c == "%") {
|
13437 | var epos = this.reader.getpos();
|
13438 | var c = this.reader.get();
|
13439 | if (c == "d") {
|
13440 | var r = this.getdecchrs();
|
13441 | if (r != "") {
|
13442 | return ["\\%d" + r, "\\%d" + r];
|
13443 | }
|
13444 | }
|
13445 | else if (c == "o") {
|
13446 | var r = this.getoctchrs();
|
13447 | if (r != "") {
|
13448 | return ["\\%o" + r, "\\%o" + r];
|
13449 | }
|
13450 | }
|
13451 | else if (c == "x") {
|
13452 | var r = this.gethexchrs(2);
|
13453 | if (r != "") {
|
13454 | return ["\\%x" + r, "\\%x" + r];
|
13455 | }
|
13456 | }
|
13457 | else if (c == "u") {
|
13458 | var r = this.gethexchrs(4);
|
13459 | if (r != "") {
|
13460 | return ["\\%u" + r, "\\%u" + r];
|
13461 | }
|
13462 | }
|
13463 | else if (c == "U") {
|
13464 | var r = this.gethexchrs(8);
|
13465 | if (r != "") {
|
13466 | return ["\\%U" + r, "\\%U" + r];
|
13467 | }
|
13468 | }
|
13469 | throw Err("E678: Invalid character after \\%[dxouU]", epos);
|
13470 | }
|
13471 | return ["\\" + c, c];
|
13472 | }
|
13473 |
|
13474 |
|
13475 | RegexpParser.prototype.get_token_brace = function(pre) {
|
13476 | var r = "";
|
13477 | var minus = "";
|
13478 | var comma = "";
|
13479 | var n = "";
|
13480 | var m = "";
|
13481 | if (this.reader.p(0) == "-") {
|
13482 | var minus = this.reader.get();
|
13483 | r += minus;
|
13484 | }
|
13485 | if (isdigit(this.reader.p(0))) {
|
13486 | var n = this.reader.read_digit();
|
13487 | r += n;
|
13488 | }
|
13489 | if (this.reader.p(0) == ",") {
|
13490 | var comma = this.rader.get();
|
13491 | r += comma;
|
13492 | }
|
13493 | if (isdigit(this.reader.p(0))) {
|
13494 | var m = this.reader.read_digit();
|
13495 | r += m;
|
13496 | }
|
13497 | if (this.reader.p(0) == "\\") {
|
13498 | r += this.reader.get();
|
13499 | }
|
13500 | if (this.reader.p(0) != "}") {
|
13501 | throw Err("E554: Syntax error in \\{...}", this.reader.getpos());
|
13502 | }
|
13503 | this.reader.get();
|
13504 | return [pre + r, "\\{" + minus + n + comma + m + "}"];
|
13505 | }
|
13506 |
|
13507 |
|
13508 | RegexpParser.prototype.get_token_sq = function(pre) {
|
13509 | var start = this.reader.tell();
|
13510 | var r = "";
|
13511 |
|
13512 | if (this.reader.p(0) == "^") {
|
13513 | r += this.reader.get();
|
13514 | }
|
13515 |
|
13516 | if (this.reader.p(0) == "]" || this.reader.p(0) == "-") {
|
13517 | r += this.reader.get();
|
13518 | }
|
13519 | while (TRUE) {
|
13520 | var startc = 0;
|
13521 | var c = this.reader.p(0);
|
13522 | if (this.isend(c)) {
|
13523 |
|
13524 | this.reader.seek_set(start);
|
13525 | return [pre, "["];
|
13526 | }
|
13527 | else if (c == "]") {
|
13528 | this.reader.seek_cur(1);
|
13529 | return [pre + r + "]", "\\[" + r + "]"];
|
13530 | }
|
13531 | else if (c == "[") {
|
13532 | var e = this.get_token_sq_char_class();
|
13533 | if (e == "") {
|
13534 | var e = this.get_token_sq_equi_class();
|
13535 | if (e == "") {
|
13536 | var e = this.get_token_sq_coll_element();
|
13537 | if (e == "") {
|
13538 | var __tmp = this.get_token_sq_c();
|
13539 | var e = __tmp[0];
|
13540 | var startc = __tmp[1];
|
13541 | }
|
13542 | }
|
13543 | }
|
13544 | r += e;
|
13545 | }
|
13546 | else {
|
13547 | var __tmp = this.get_token_sq_c();
|
13548 | var e = __tmp[0];
|
13549 | var startc = __tmp[1];
|
13550 | r += e;
|
13551 | }
|
13552 | if (startc != 0 && this.reader.p(0) == "-" && !this.isend(this.reader.p(1)) && !(this.reader.p(1) == "\\" && this.reader.p(2) == "n")) {
|
13553 | this.reader.seek_cur(1);
|
13554 | r += "-";
|
13555 | var c = this.reader.p(0);
|
13556 | if (c == "[") {
|
13557 | var e = this.get_token_sq_coll_element();
|
13558 | if (e != "") {
|
13559 | var endc = viml_char2nr(e[2]);
|
13560 | }
|
13561 | else {
|
13562 | var __tmp = this.get_token_sq_c();
|
13563 | var e = __tmp[0];
|
13564 | var endc = __tmp[1];
|
13565 | }
|
13566 | r += e;
|
13567 | }
|
13568 | else {
|
13569 | var __tmp = this.get_token_sq_c();
|
13570 | var e = __tmp[0];
|
13571 | var endc = __tmp[1];
|
13572 | r += e;
|
13573 | }
|
13574 | if (startc > endc || endc > startc + 256) {
|
13575 | throw Err("E16: Invalid range", this.reader.getpos());
|
13576 | }
|
13577 | }
|
13578 | }
|
13579 | }
|
13580 |
|
13581 |
|
13582 | RegexpParser.prototype.get_token_sq_c = function() {
|
13583 | var c = this.reader.p(0);
|
13584 | if (c == "\\") {
|
13585 | this.reader.seek_cur(1);
|
13586 | var c = this.reader.p(0);
|
13587 | if (c == "n") {
|
13588 | this.reader.seek_cur(1);
|
13589 | return ["\\n", 0];
|
13590 | }
|
13591 | else if (c == "r") {
|
13592 | this.reader.seek_cur(1);
|
13593 | return ["\\r", 13];
|
13594 | }
|
13595 | else if (c == "t") {
|
13596 | this.reader.seek_cur(1);
|
13597 | return ["\\t", 9];
|
13598 | }
|
13599 | else if (c == "e") {
|
13600 | this.reader.seek_cur(1);
|
13601 | return ["\\e", 27];
|
13602 | }
|
13603 | else if (c == "b") {
|
13604 | this.reader.seek_cur(1);
|
13605 | return ["\\b", 8];
|
13606 | }
|
13607 | else if (viml_stridx("]^-\\", c) != -1) {
|
13608 | this.reader.seek_cur(1);
|
13609 | return ["\\" + c, viml_char2nr(c)];
|
13610 | }
|
13611 | else if (viml_stridx("doxuU", c) != -1) {
|
13612 | var __tmp = this.get_token_sq_coll_char();
|
13613 | var c = __tmp[0];
|
13614 | var n = __tmp[1];
|
13615 | return [c, n];
|
13616 | }
|
13617 | else {
|
13618 | return ["\\", viml_char2nr("\\")];
|
13619 | }
|
13620 | }
|
13621 | else if (c == "-") {
|
13622 | this.reader.seek_cur(1);
|
13623 | return ["-", viml_char2nr("-")];
|
13624 | }
|
13625 | else {
|
13626 | this.reader.seek_cur(1);
|
13627 | return [c, viml_char2nr(c)];
|
13628 | }
|
13629 | }
|
13630 |
|
13631 |
|
13632 | RegexpParser.prototype.get_token_sq_coll_char = function() {
|
13633 | var pos = this.reader.tell();
|
13634 | var c = this.reader.get();
|
13635 | if (c == "d") {
|
13636 | var r = this.getdecchrs();
|
13637 | var n = viml_str2nr(r, 10);
|
13638 | }
|
13639 | else if (c == "o") {
|
13640 | var r = this.getoctchrs();
|
13641 | var n = viml_str2nr(r, 8);
|
13642 | }
|
13643 | else if (c == "x") {
|
13644 | var r = this.gethexchrs(2);
|
13645 | var n = viml_str2nr(r, 16);
|
13646 | }
|
13647 | else if (c == "u") {
|
13648 | var r = this.gethexchrs(4);
|
13649 | var n = viml_str2nr(r, 16);
|
13650 | }
|
13651 | else if (c == "U") {
|
13652 | var r = this.gethexchrs(8);
|
13653 | var n = viml_str2nr(r, 16);
|
13654 | }
|
13655 | else {
|
13656 | var r = "";
|
13657 | }
|
13658 | if (r == "") {
|
13659 | this.reader.seek_set(pos);
|
13660 | return "\\";
|
13661 | }
|
13662 | return ["\\" + c + r, n];
|
13663 | }
|
13664 |
|
13665 |
|
13666 | RegexpParser.prototype.get_token_sq_coll_element = function() {
|
13667 | if (this.reader.p(0) == "[" && this.reader.p(1) == "." && !this.isend(this.reader.p(2)) && this.reader.p(3) == "." && this.reader.p(4) == "]") {
|
13668 | return this.reader.getn(5);
|
13669 | }
|
13670 | return "";
|
13671 | }
|
13672 |
|
13673 |
|
13674 | RegexpParser.prototype.get_token_sq_equi_class = function() {
|
13675 | if (this.reader.p(0) == "[" && this.reader.p(1) == "=" && !this.isend(this.reader.p(2)) && this.reader.p(3) == "=" && this.reader.p(4) == "]") {
|
13676 | return this.reader.getn(5);
|
13677 | }
|
13678 | return "";
|
13679 | }
|
13680 |
|
13681 |
|
13682 | RegexpParser.prototype.get_token_sq_char_class = function() {
|
13683 | var class_names = ["alnum", "alpha", "blank", "cntrl", "digit", "graph", "lower", "print", "punct", "space", "upper", "xdigit", "tab", "return", "backspace", "escape"];
|
13684 | var pos = this.reader.tell();
|
13685 | if (this.reader.p(0) == "[" && this.reader.p(1) == ":") {
|
13686 | this.reader.seek_cur(2);
|
13687 | var r = this.reader.read_alpha();
|
13688 | if (this.reader.p(0) == ":" && this.reader.p(1) == "]") {
|
13689 | this.reader.seek_cur(2);
|
13690 | var __c15 = class_names;
|
13691 | for (var __i15 = 0; __i15 < __c15.length; ++__i15) {
|
13692 | var name = __c15[__i15];
|
13693 | if (r == name) {
|
13694 | return "[:" + name + ":]";
|
13695 | }
|
13696 | }
|
13697 | }
|
13698 | }
|
13699 | this.reader.seek_set(pos);
|
13700 | return "";
|
13701 | }
|
13702 |
|
13703 |
|
13704 | RegexpParser.prototype.get_token_at = function(pre) {
|
13705 | var epos = this.reader.getpos();
|
13706 | var c = this.reader.get();
|
13707 | if (c == ">") {
|
13708 | return [pre + ">", "\\@>"];
|
13709 | }
|
13710 | else if (c == "=") {
|
13711 | return [pre + "=", "\\@="];
|
13712 | }
|
13713 | else if (c == "!") {
|
13714 | return [pre + "!", "\\@!"];
|
13715 | }
|
13716 | else if (c == "<") {
|
13717 | var c = this.reader.get();
|
13718 | if (c == "=") {
|
13719 | return [pre + "<=", "\\@<="];
|
13720 | }
|
13721 | else if (c == "!") {
|
13722 | return [pre + "<!", "\\@<!"];
|
13723 | }
|
13724 | }
|
13725 | throw Err("E64: @ follows nothing", epos);
|
13726 | }
|
13727 |
|
13728 |
|
13729 | RegexpParser.prototype.get_token_percent = function(pre) {
|
13730 | var c = this.reader.get();
|
13731 | if (c == "^") {
|
13732 | return [pre + "^", "\\%^"];
|
13733 | }
|
13734 | else if (c == "$") {
|
13735 | return [pre + "$", "\\%$"];
|
13736 | }
|
13737 | else if (c == "V") {
|
13738 | return [pre + "V", "\\%V"];
|
13739 | }
|
13740 | else if (c == "#") {
|
13741 | return [pre + "#", "\\%#"];
|
13742 | }
|
13743 | else if (c == "[") {
|
13744 | return this.get_token_percent_sq(pre + "[");
|
13745 | }
|
13746 | else if (c == "(") {
|
13747 | return [pre + "(", "\\%("];
|
13748 | }
|
13749 | else {
|
13750 | return this.get_token_mlcv(pre);
|
13751 | }
|
13752 | }
|
13753 |
|
13754 |
|
13755 | RegexpParser.prototype.get_token_percent_sq = function(pre) {
|
13756 | var r = "";
|
13757 | while (TRUE) {
|
13758 | var c = this.reader.peek();
|
13759 | if (this.isend(c)) {
|
13760 | throw Err("E69: Missing ] after \\%[", this.reader.getpos());
|
13761 | }
|
13762 | else if (c == "]") {
|
13763 | if (r == "") {
|
13764 | throw Err("E70: Empty \\%[", this.reader.getpos());
|
13765 | }
|
13766 | this.reader.seek_cur(1);
|
13767 | break;
|
13768 | }
|
13769 | this.reader.seek_cur(1);
|
13770 | r += c;
|
13771 | }
|
13772 | return [pre + r + "]", "\\%[" + r + "]"];
|
13773 | }
|
13774 |
|
13775 |
|
13776 | RegexpParser.prototype.get_token_mlvc = function(pre) {
|
13777 | var r = "";
|
13778 | var cmp = "";
|
13779 | if (this.reader.p(0) == "<" || this.reader.p(0) == ">") {
|
13780 | var cmp = this.reader.get();
|
13781 | r += cmp;
|
13782 | }
|
13783 | if (this.reader.p(0) == "'") {
|
13784 | r += this.reader.get();
|
13785 | var c = this.reader.p(0);
|
13786 | if (this.isend(c)) {
|
13787 |
|
13788 | var c = "";
|
13789 | }
|
13790 | else {
|
13791 | var c = this.reader.get();
|
13792 | }
|
13793 | return [pre + r + c, "\\%" + cmp + "'" + c];
|
13794 | }
|
13795 | else if (isdigit(this.reader.p(0))) {
|
13796 | var d = this.reader.read_digit();
|
13797 | r += d;
|
13798 | var c = this.reader.p(0);
|
13799 | if (c == "l") {
|
13800 | this.reader.get();
|
13801 | return [pre + r + "l", "\\%" + cmp + d + "l"];
|
13802 | }
|
13803 | else if (c == "c") {
|
13804 | this.reader.get();
|
13805 | return [pre + r + "c", "\\%" + cmp + d + "c"];
|
13806 | }
|
13807 | else if (c == "v") {
|
13808 | this.reader.get();
|
13809 | return [pre + r + "v", "\\%" + cmp + d + "v"];
|
13810 | }
|
13811 | }
|
13812 | throw Err("E71: Invalid character after %", this.reader.getpos());
|
13813 | }
|
13814 |
|
13815 | RegexpParser.prototype.getdecchrs = function() {
|
13816 | return this.reader.read_digit();
|
13817 | }
|
13818 |
|
13819 | RegexpParser.prototype.getoctchrs = function() {
|
13820 | return this.reader.read_odigit();
|
13821 | }
|
13822 |
|
13823 | RegexpParser.prototype.gethexchrs = function(n) {
|
13824 | var r = "";
|
13825 | var __c16 = viml_range(n);
|
13826 | for (var __i16 = 0; __i16 < __c16.length; ++__i16) {
|
13827 | var i = __c16[__i16];
|
13828 | var c = this.reader.peek();
|
13829 | if (!isxdigit(c)) {
|
13830 | break;
|
13831 | }
|
13832 | r += this.reader.get();
|
13833 | }
|
13834 | return r;
|
13835 | }
|
13836 |
|
13837 | if (__webpack_require__.c[__webpack_require__.s] === module) {
|
13838 | main();
|
13839 | }
|
13840 | else {
|
13841 | module.exports = {
|
13842 | VimLParser: VimLParser,
|
13843 | StringReader: StringReader,
|
13844 | Compiler: Compiler
|
13845 | };
|
13846 | }
|
13847 |
|
13848 | }.call(this, __webpack_require__(53)(module)))
|
13849 |
|
13850 | }),
|
13851 |
|
13852 | (function(module, exports) {
|
13853 |
|
13854 | module.exports = function(module) {
|
13855 | if (!module.webpackPolyfill) {
|
13856 | module.deprecate = function() {};
|
13857 | module.paths = [];
|
13858 |
|
13859 | if (!module.children) module.children = [];
|
13860 | Object.defineProperty(module, "loaded", {
|
13861 | enumerable: true,
|
13862 | get: function() {
|
13863 | return module.l;
|
13864 | }
|
13865 | });
|
13866 | Object.defineProperty(module, "id", {
|
13867 | enumerable: true,
|
13868 | get: function() {
|
13869 | return module.i;
|
13870 | }
|
13871 | });
|
13872 | module.webpackPolyfill = 1;
|
13873 | }
|
13874 | return module;
|
13875 | };
|
13876 |
|
13877 |
|
13878 | }),
|
13879 |
|
13880 | (function(module, exports, __webpack_require__) {
|
13881 |
|
13882 | "use strict";
|
13883 |
|
13884 | Object.defineProperty(exports, "__esModule", { value: true });
|
13885 | exports.errorLinePattern = /[^:]+:\s*(.+?):\s*line\s*([0-9]+)\s*col\s*([0-9]+)/;
|
13886 | exports.commentPattern = /^[ \t]*("|')/;
|
13887 | exports.keywordPattern = /[\w#&$<>.:]/;
|
13888 | exports.builtinFunctionPattern = /^((<SID>|\b(v|g|b|s|l|a):)?[\w#&]+)[ \t]*\([^)]*\)/;
|
13889 | exports.wordPrePattern = /^.*?(((<SID>|\b(v|g|b|s|l|a):)?[\w#&$.]+)|(<SID>|<SID|<SI|<S|<|\b(v|g|b|s|l|a):))$/;
|
13890 | exports.wordNextPattern = /^((SID>|ID>|D>|>|<SID>|\b(v|g|b|s|l|a):)?[\w#&$.]+|(:[\w#&$.]+)).*?(\r\n|\r|\n)?$/;
|
13891 | exports.colorschemePattern = /\bcolorscheme[ \t]+\w*$/;
|
13892 | exports.mapCommandPattern = /^([ \t]*(\[ \t]*)?)\w*map[ \t]+/;
|
13893 | exports.highlightLinkPattern = /^[ \t]*(hi|highlight)[ \t]+link([ \t]+[^ \t]+)*[ \t]*$/;
|
13894 | exports.highlightPattern = /^[ \t]*(hi|highlight)([ \t]+[^ \t]+)*[ \t]*$/;
|
13895 | exports.highlightValuePattern = /^[ \t]*(hi|highlight)([ \t]+[^ \t]+)*[ \t]+([^ \t=]+)=[^ \t=]*$/;
|
13896 | exports.autocmdPattern = /^[ \t]*(au|autocmd)!?[ \t]+([^ \t,]+,)*[^ \t,]*$/;
|
13897 | exports.builtinVariablePattern = [
|
13898 | /\bv:\w*$/,
|
13899 | ];
|
13900 | exports.optionPattern = [
|
13901 | /(^|[ \t]+)&\w*$/,
|
13902 | /(^|[ \t]+)set(l|local|g|global)?[ \t]+\w+$/,
|
13903 | ];
|
13904 | exports.notFunctionPattern = [
|
13905 | /^[ \t]*\\$/,
|
13906 | /^[ \t]*\w+$/,
|
13907 | /^[ \t]*"/,
|
13908 | /(let|set|colorscheme)[ \t][^ \t]*$/,
|
13909 | /[^([,\\ \t\w#>]\w*$/,
|
13910 | /^[ \t]*(hi|highlight)([ \t]+link)?([ \t]+[^ \t]+)*[ \t]*$/,
|
13911 | exports.autocmdPattern,
|
13912 | ];
|
13913 | exports.commandPattern = [
|
13914 | /(^|[ \t]):\w+$/,
|
13915 | /^[ \t]*\w+$/,
|
13916 | /:?silent!?[ \t]\w+/,
|
13917 | ];
|
13918 | exports.featurePattern = [
|
13919 | /\bhas\([ \t]*["']\w*/,
|
13920 | ];
|
13921 | exports.expandPattern = [
|
13922 | /\bexpand\(['"]<\w*$/,
|
13923 | /\bexpand\([ \t]*['"]\w*$/,
|
13924 | ];
|
13925 | exports.notIdentifierPattern = [
|
13926 | exports.commentPattern,
|
13927 | /("|'):\w*$/,
|
13928 | /^[ \t]*\\$/,
|
13929 | /^[ \t]*call[ \t]+[^ \t()]*$/,
|
13930 | /('|"|#|&|\$|<)\w*$/,
|
13931 | ];
|
13932 |
|
13933 |
|
13934 | /***/ }),
|
13935 | /* 55 */,
|
13936 | /* 56 */,
|
13937 | /* 57 */,
|
13938 | /* 58 */,
|
13939 | /* 59 */,
|
13940 | /* 60 */
|
13941 | /***/ (function(module, exports, __webpack_require__) {
|
13942 |
|
13943 | "use strict";
|
13944 |
|
13945 | const taskManager = __webpack_require__(61);
|
13946 | const async_1 = __webpack_require__(98);
|
13947 | const stream_1 = __webpack_require__(133);
|
13948 | const sync_1 = __webpack_require__(134);
|
13949 | const settings_1 = __webpack_require__(136);
|
13950 | const utils = __webpack_require__(62);
|
13951 | async function FastGlob(source, options) {
|
13952 | assertPatternsInput(source);
|
13953 | const works = getWorks(source, async_1.default, options);
|
13954 | const result = await Promise.all(works);
|
13955 | return utils.array.flatten(result);
|
13956 | }
|
13957 |
|
13958 |
|
13959 | (function (FastGlob) {
|
13960 | function sync(source, options) {
|
13961 | assertPatternsInput(source);
|
13962 | const works = getWorks(source, sync_1.default, options);
|
13963 | return utils.array.flatten(works);
|
13964 | }
|
13965 | FastGlob.sync = sync;
|
13966 | function stream(source, options) {
|
13967 | assertPatternsInput(source);
|
13968 | const works = getWorks(source, stream_1.default, options);
|
13969 | |
13970 |
|
13971 |
|
13972 |
|
13973 |
|
13974 | return utils.stream.merge(works);
|
13975 | }
|
13976 | FastGlob.stream = stream;
|
13977 | function generateTasks(source, options) {
|
13978 | assertPatternsInput(source);
|
13979 | const patterns = [].concat(source);
|
13980 | const settings = new settings_1.default(options);
|
13981 | return taskManager.generate(patterns, settings);
|
13982 | }
|
13983 | FastGlob.generateTasks = generateTasks;
|
13984 | function isDynamicPattern(source, options) {
|
13985 | assertPatternsInput(source);
|
13986 | const settings = new settings_1.default(options);
|
13987 | return utils.pattern.isDynamicPattern(source, settings);
|
13988 | }
|
13989 | FastGlob.isDynamicPattern = isDynamicPattern;
|
13990 | function escapePath(source) {
|
13991 | assertPatternsInput(source);
|
13992 | return utils.path.escape(source);
|
13993 | }
|
13994 | FastGlob.escapePath = escapePath;
|
13995 | })(FastGlob || (FastGlob = {}));
|
13996 | function getWorks(source, _Provider, options) {
|
13997 | const patterns = [].concat(source);
|
13998 | const settings = new settings_1.default(options);
|
13999 | const tasks = taskManager.generate(patterns, settings);
|
14000 | const provider = new _Provider(settings);
|
14001 | return tasks.map(provider.read, provider);
|
14002 | }
|
14003 | function assertPatternsInput(input) {
|
14004 | const source = [].concat(input);
|
14005 | const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item));
|
14006 | if (!isValidSource) {
|
14007 | throw new TypeError('Patterns must be a string (non empty) or an array of strings');
|
14008 | }
|
14009 | }
|
14010 | module.exports = FastGlob;
|
14011 |
|
14012 |
|
14013 | }),
|
14014 |
|
14015 | (function(module, exports, __webpack_require__) {
|
14016 |
|
14017 | "use strict";
|
14018 |
|
14019 | Object.defineProperty(exports, "__esModule", { value: true });
|
14020 | exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
|
14021 | const utils = __webpack_require__(62);
|
14022 | function generate(patterns, settings) {
|
14023 | const positivePatterns = getPositivePatterns(patterns);
|
14024 | const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore);
|
14025 | const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings));
|
14026 | const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings));
|
14027 | const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, false);
|
14028 | const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, true);
|
14029 | return staticTasks.concat(dynamicTasks);
|
14030 | }
|
14031 | exports.generate = generate;
|
14032 | function convertPatternsToTasks(positive, negative, dynamic) {
|
14033 | const positivePatternsGroup = groupPatternsByBaseDirectory(positive);
|
14034 |
|
14035 |
|
14036 | if ('.' in positivePatternsGroup) {
|
14037 | const task = convertPatternGroupToTask('.', positive, negative, dynamic);
|
14038 | return [task];
|
14039 | }
|
14040 | return convertPatternGroupsToTasks(positivePatternsGroup, negative, dynamic);
|
14041 | }
|
14042 | exports.convertPatternsToTasks = convertPatternsToTasks;
|
14043 | function getPositivePatterns(patterns) {
|
14044 | return utils.pattern.getPositivePatterns(patterns);
|
14045 | }
|
14046 | exports.getPositivePatterns = getPositivePatterns;
|
14047 | function getNegativePatternsAsPositive(patterns, ignore) {
|
14048 | const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore);
|
14049 | const positive = negative.map(utils.pattern.convertToPositivePattern);
|
14050 | return positive;
|
14051 | }
|
14052 | exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
|
14053 | function groupPatternsByBaseDirectory(patterns) {
|
14054 | const group = {};
|
14055 | return patterns.reduce((collection, pattern) => {
|
14056 | const base = utils.pattern.getBaseDirectory(pattern);
|
14057 | if (base in collection) {
|
14058 | collection[base].push(pattern);
|
14059 | }
|
14060 | else {
|
14061 | collection[base] = [pattern];
|
14062 | }
|
14063 | return collection;
|
14064 | }, group);
|
14065 | }
|
14066 | exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
|
14067 | function convertPatternGroupsToTasks(positive, negative, dynamic) {
|
14068 | return Object.keys(positive).map((base) => {
|
14069 | return convertPatternGroupToTask(base, positive[base], negative, dynamic);
|
14070 | });
|
14071 | }
|
14072 | exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks;
|
14073 | function convertPatternGroupToTask(base, positive, negative, dynamic) {
|
14074 | return {
|
14075 | dynamic,
|
14076 | positive,
|
14077 | negative,
|
14078 | base,
|
14079 | patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern))
|
14080 | };
|
14081 | }
|
14082 | exports.convertPatternGroupToTask = convertPatternGroupToTask;
|
14083 |
|
14084 |
|
14085 | }),
|
14086 |
|
14087 | (function(module, exports, __webpack_require__) {
|
14088 |
|
14089 | "use strict";
|
14090 |
|
14091 | Object.defineProperty(exports, "__esModule", { value: true });
|
14092 | exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0;
|
14093 | const array = __webpack_require__(63);
|
14094 | exports.array = array;
|
14095 | const errno = __webpack_require__(64);
|
14096 | exports.errno = errno;
|
14097 | const fs = __webpack_require__(65);
|
14098 | exports.fs = fs;
|
14099 | const path = __webpack_require__(66);
|
14100 | exports.path = path;
|
14101 | const pattern = __webpack_require__(67);
|
14102 | exports.pattern = pattern;
|
14103 | const stream = __webpack_require__(94);
|
14104 | exports.stream = stream;
|
14105 | const string = __webpack_require__(97);
|
14106 | exports.string = string;
|
14107 |
|
14108 |
|
14109 | }),
|
14110 |
|
14111 | (function(module, exports, __webpack_require__) {
|
14112 |
|
14113 | "use strict";
|
14114 |
|
14115 | Object.defineProperty(exports, "__esModule", { value: true });
|
14116 | exports.splitWhen = exports.flatten = void 0;
|
14117 | function flatten(items) {
|
14118 | return items.reduce((collection, item) => [].concat(collection, item), []);
|
14119 | }
|
14120 | exports.flatten = flatten;
|
14121 | function splitWhen(items, predicate) {
|
14122 | const result = [[]];
|
14123 | let groupIndex = 0;
|
14124 | for (const item of items) {
|
14125 | if (predicate(item)) {
|
14126 | groupIndex++;
|
14127 | result[groupIndex] = [];
|
14128 | }
|
14129 | else {
|
14130 | result[groupIndex].push(item);
|
14131 | }
|
14132 | }
|
14133 | return result;
|
14134 | }
|
14135 | exports.splitWhen = splitWhen;
|
14136 |
|
14137 |
|
14138 | }),
|
14139 |
|
14140 | (function(module, exports, __webpack_require__) {
|
14141 |
|
14142 | "use strict";
|
14143 |
|
14144 | Object.defineProperty(exports, "__esModule", { value: true });
|
14145 | exports.isEnoentCodeError = void 0;
|
14146 | function isEnoentCodeError(error) {
|
14147 | return error.code === 'ENOENT';
|
14148 | }
|
14149 | exports.isEnoentCodeError = isEnoentCodeError;
|
14150 |
|
14151 |
|
14152 | }),
|
14153 |
|
14154 | (function(module, exports, __webpack_require__) {
|
14155 |
|
14156 | "use strict";
|
14157 |
|
14158 | Object.defineProperty(exports, "__esModule", { value: true });
|
14159 | exports.createDirentFromStats = void 0;
|
14160 | class DirentFromStats {
|
14161 | constructor(name, stats) {
|
14162 | this.name = name;
|
14163 | this.isBlockDevice = stats.isBlockDevice.bind(stats);
|
14164 | this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
|
14165 | this.isDirectory = stats.isDirectory.bind(stats);
|
14166 | this.isFIFO = stats.isFIFO.bind(stats);
|
14167 | this.isFile = stats.isFile.bind(stats);
|
14168 | this.isSocket = stats.isSocket.bind(stats);
|
14169 | this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
|
14170 | }
|
14171 | }
|
14172 | function createDirentFromStats(name, stats) {
|
14173 | return new DirentFromStats(name, stats);
|
14174 | }
|
14175 | exports.createDirentFromStats = createDirentFromStats;
|
14176 |
|
14177 |
|
14178 | }),
|
14179 |
|
14180 | (function(module, exports, __webpack_require__) {
|
14181 |
|
14182 | "use strict";
|
14183 |
|
14184 | Object.defineProperty(exports, "__esModule", { value: true });
|
14185 | exports.removeLeadingDotSegment = exports.escape = exports.makeAbsolute = exports.unixify = void 0;
|
14186 | const path = __webpack_require__(13);
|
14187 | const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
|
14188 | const UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g;
|
14189 |
|
14190 |
|
14191 |
|
14192 | function unixify(filepath) {
|
14193 | return filepath.replace(/\\/g, '/');
|
14194 | }
|
14195 | exports.unixify = unixify;
|
14196 | function makeAbsolute(cwd, filepath) {
|
14197 | return path.resolve(cwd, filepath);
|
14198 | }
|
14199 | exports.makeAbsolute = makeAbsolute;
|
14200 | function escape(pattern) {
|
14201 | return pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, '\\$2');
|
14202 | }
|
14203 | exports.escape = escape;
|
14204 | function removeLeadingDotSegment(entry) {
|
14205 |
|
14206 |
|
14207 | if (entry.charAt(0) === '.') {
|
14208 | const secondCharactery = entry.charAt(1);
|
14209 | if (secondCharactery === '/' || secondCharactery === '\\') {
|
14210 | return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT);
|
14211 | }
|
14212 | }
|
14213 | return entry;
|
14214 | }
|
14215 | exports.removeLeadingDotSegment = removeLeadingDotSegment;
|
14216 |
|
14217 |
|
14218 | }),
|
14219 |
|
14220 | (function(module, exports, __webpack_require__) {
|
14221 |
|
14222 | "use strict";
|
14223 |
|
14224 | Object.defineProperty(exports, "__esModule", { value: true });
|
14225 | exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0;
|
14226 | const path = __webpack_require__(13);
|
14227 | const globParent = __webpack_require__(68);
|
14228 | const micromatch = __webpack_require__(71);
|
14229 | const picomatch = __webpack_require__(88);
|
14230 | const GLOBSTAR = '**';
|
14231 | const ESCAPE_SYMBOL = '\\';
|
14232 | const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/;
|
14233 | const REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[.*]/;
|
14234 | const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\(.*\|.*\)/;
|
14235 | const GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\(.*\)/;
|
14236 | const BRACE_EXPANSIONS_SYMBOLS_RE = /{.*(?:,|\.\.).*}/;
|
14237 | function isStaticPattern(pattern, options = {}) {
|
14238 | return !isDynamicPattern(pattern, options);
|
14239 | }
|
14240 | exports.isStaticPattern = isStaticPattern;
|
14241 | function isDynamicPattern(pattern, options = {}) {
|
14242 | |
14243 |
|
14244 |
|
14245 |
|
14246 |
|
14247 | if (pattern === '') {
|
14248 | return false;
|
14249 | }
|
14250 | |
14251 |
|
14252 |
|
14253 |
|
14254 | if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) {
|
14255 | return true;
|
14256 | }
|
14257 | if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) {
|
14258 | return true;
|
14259 | }
|
14260 | if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) {
|
14261 | return true;
|
14262 | }
|
14263 | if (options.braceExpansion !== false && BRACE_EXPANSIONS_SYMBOLS_RE.test(pattern)) {
|
14264 | return true;
|
14265 | }
|
14266 | return false;
|
14267 | }
|
14268 | exports.isDynamicPattern = isDynamicPattern;
|
14269 | function convertToPositivePattern(pattern) {
|
14270 | return isNegativePattern(pattern) ? pattern.slice(1) : pattern;
|
14271 | }
|
14272 | exports.convertToPositivePattern = convertToPositivePattern;
|
14273 | function convertToNegativePattern(pattern) {
|
14274 | return '!' + pattern;
|
14275 | }
|
14276 | exports.convertToNegativePattern = convertToNegativePattern;
|
14277 | function isNegativePattern(pattern) {
|
14278 | return pattern.startsWith('!') && pattern[1] !== '(';
|
14279 | }
|
14280 | exports.isNegativePattern = isNegativePattern;
|
14281 | function isPositivePattern(pattern) {
|
14282 | return !isNegativePattern(pattern);
|
14283 | }
|
14284 | exports.isPositivePattern = isPositivePattern;
|
14285 | function getNegativePatterns(patterns) {
|
14286 | return patterns.filter(isNegativePattern);
|
14287 | }
|
14288 | exports.getNegativePatterns = getNegativePatterns;
|
14289 | function getPositivePatterns(patterns) {
|
14290 | return patterns.filter(isPositivePattern);
|
14291 | }
|
14292 | exports.getPositivePatterns = getPositivePatterns;
|
14293 | function getBaseDirectory(pattern) {
|
14294 | return globParent(pattern, { flipBackslashes: false });
|
14295 | }
|
14296 | exports.getBaseDirectory = getBaseDirectory;
|
14297 | function hasGlobStar(pattern) {
|
14298 | return pattern.includes(GLOBSTAR);
|
14299 | }
|
14300 | exports.hasGlobStar = hasGlobStar;
|
14301 | function endsWithSlashGlobStar(pattern) {
|
14302 | return pattern.endsWith('/' + GLOBSTAR);
|
14303 | }
|
14304 | exports.endsWithSlashGlobStar = endsWithSlashGlobStar;
|
14305 | function isAffectDepthOfReadingPattern(pattern) {
|
14306 | const basename = path.basename(pattern);
|
14307 | return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
|
14308 | }
|
14309 | exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
|
14310 | function expandPatternsWithBraceExpansion(patterns) {
|
14311 | return patterns.reduce((collection, pattern) => {
|
14312 | return collection.concat(expandBraceExpansion(pattern));
|
14313 | }, []);
|
14314 | }
|
14315 | exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
|
14316 | function expandBraceExpansion(pattern) {
|
14317 | return micromatch.braces(pattern, {
|
14318 | expand: true,
|
14319 | nodupes: true
|
14320 | });
|
14321 | }
|
14322 | exports.expandBraceExpansion = expandBraceExpansion;
|
14323 | function getPatternParts(pattern, options) {
|
14324 | let { parts } = picomatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true }));
|
14325 | |
14326 |
|
14327 |
|
14328 |
|
14329 | if (parts.length === 0) {
|
14330 | parts = [pattern];
|
14331 | }
|
14332 | |
14333 |
|
14334 |
|
14335 |
|
14336 | if (parts[0].startsWith('/')) {
|
14337 | parts[0] = parts[0].slice(1);
|
14338 | parts.unshift('');
|
14339 | }
|
14340 | return parts;
|
14341 | }
|
14342 | exports.getPatternParts = getPatternParts;
|
14343 | function makeRe(pattern, options) {
|
14344 | return micromatch.makeRe(pattern, options);
|
14345 | }
|
14346 | exports.makeRe = makeRe;
|
14347 | function convertPatternsToRe(patterns, options) {
|
14348 | return patterns.map((pattern) => makeRe(pattern, options));
|
14349 | }
|
14350 | exports.convertPatternsToRe = convertPatternsToRe;
|
14351 | function matchAny(entry, patternsRe) {
|
14352 | return patternsRe.some((patternRe) => patternRe.test(entry));
|
14353 | }
|
14354 | exports.matchAny = matchAny;
|
14355 |
|
14356 |
|
14357 | }),
|
14358 |
|
14359 | (function(module, exports, __webpack_require__) {
|
14360 |
|
14361 | "use strict";
|
14362 |
|
14363 |
|
14364 | var isGlob = __webpack_require__(69);
|
14365 | var pathPosixDirname = __webpack_require__(13).posix.dirname;
|
14366 | var isWin32 = __webpack_require__(14).platform() === 'win32';
|
14367 |
|
14368 | var slash = '/';
|
14369 | var backslash = /\\/g;
|
14370 | var enclosure = /[\{\[].*[\/]*.*[\}\]]$/;
|
14371 | var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
|
14372 | var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
|
14373 |
|
14374 |
|
14375 |
|
14376 |
|
14377 |
|
14378 |
|
14379 | module.exports = function globParent(str, opts) {
|
14380 | var options = Object.assign({ flipBackslashes: true }, opts);
|
14381 |
|
14382 |
|
14383 | if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) {
|
14384 | str = str.replace(backslash, slash);
|
14385 | }
|
14386 |
|
14387 |
|
14388 | if (enclosure.test(str)) {
|
14389 | str += slash;
|
14390 | }
|
14391 |
|
14392 |
|
14393 | str += 'a';
|
14394 |
|
14395 |
|
14396 | do {
|
14397 | str = pathPosixDirname(str);
|
14398 | } while (isGlob(str) || globby.test(str));
|
14399 |
|
14400 |
|
14401 | return str.replace(escaped, '$1');
|
14402 | };
|
14403 |
|
14404 |
|
14405 | }),
|
14406 |
|
14407 | (function(module, exports, __webpack_require__) {
|
14408 |
|
14409 |
|
14410 |
|
14411 |
|
14412 |
|
14413 |
|
14414 |
|
14415 |
|
14416 | var isExtglob = __webpack_require__(70);
|
14417 | var chars = { '{': '}', '(': ')', '[': ']'};
|
14418 | var strictRegex = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
|
14419 | var relaxedRegex = /\\(.)|(^!|[*?{}()[\]]|\(\?)/;
|
14420 |
|
14421 | module.exports = function isGlob(str, options) {
|
14422 | if (typeof str !== 'string' || str === '') {
|
14423 | return false;
|
14424 | }
|
14425 |
|
14426 | if (isExtglob(str)) {
|
14427 | return true;
|
14428 | }
|
14429 |
|
14430 | var regex = strictRegex;
|
14431 | var match;
|
14432 |
|
14433 |
|
14434 | if (options && options.strict === false) {
|
14435 | regex = relaxedRegex;
|
14436 | }
|
14437 |
|
14438 | while ((match = regex.exec(str))) {
|
14439 | if (match[2]) return true;
|
14440 | var idx = match.index + match[0].length;
|
14441 |
|
14442 |
|
14443 |
|
14444 | var open = match[1];
|
14445 | var close = open ? chars[open] : null;
|
14446 | if (open && close) {
|
14447 | var n = str.indexOf(close, idx);
|
14448 | if (n !== -1) {
|
14449 | idx = n + 1;
|
14450 | }
|
14451 | }
|
14452 |
|
14453 | str = str.slice(idx);
|
14454 | }
|
14455 | return false;
|
14456 | };
|
14457 |
|
14458 |
|
14459 | }),
|
14460 |
|
14461 | (function(module, exports) {
|
14462 |
|
14463 |
|
14464 |
|
14465 |
|
14466 |
|
14467 |
|
14468 |
|
14469 |
|
14470 | module.exports = function isExtglob(str) {
|
14471 | if (typeof str !== 'string' || str === '') {
|
14472 | return false;
|
14473 | }
|
14474 |
|
14475 | var match;
|
14476 | while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) {
|
14477 | if (match[2]) return true;
|
14478 | str = str.slice(match.index + match[0].length);
|
14479 | }
|
14480 |
|
14481 | return false;
|
14482 | };
|
14483 |
|
14484 |
|
14485 | }),
|
14486 |
|
14487 | (function(module, exports, __webpack_require__) {
|
14488 |
|
14489 | "use strict";
|
14490 |
|
14491 |
|
14492 | const util = __webpack_require__(48);
|
14493 | const braces = __webpack_require__(72);
|
14494 | const picomatch = __webpack_require__(82);
|
14495 | const utils = __webpack_require__(85);
|
14496 | const isEmptyString = val => typeof val === 'string' && (val === '' || val === './');
|
14497 |
|
14498 |
|
14499 |
|
14500 |
|
14501 |
|
14502 |
|
14503 |
|
14504 |
|
14505 |
|
14506 |
|
14507 |
|
14508 |
|
14509 |
|
14510 |
|
14511 |
|
14512 |
|
14513 |
|
14514 |
|
14515 |
|
14516 | const micromatch = (list, patterns, options) => {
|
14517 | patterns = [].concat(patterns);
|
14518 | list = [].concat(list);
|
14519 |
|
14520 | let omit = new Set();
|
14521 | let keep = new Set();
|
14522 | let items = new Set();
|
14523 | let negatives = 0;
|
14524 |
|
14525 | let onResult = state => {
|
14526 | items.add(state.output);
|
14527 | if (options && options.onResult) {
|
14528 | options.onResult(state);
|
14529 | }
|
14530 | };
|
14531 |
|
14532 | for (let i = 0; i < patterns.length; i++) {
|
14533 | let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true);
|
14534 | let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
|
14535 | if (negated) negatives++;
|
14536 |
|
14537 | for (let item of list) {
|
14538 | let matched = isMatch(item, true);
|
14539 |
|
14540 | let match = negated ? !matched.isMatch : matched.isMatch;
|
14541 | if (!match) continue;
|
14542 |
|
14543 | if (negated) {
|
14544 | omit.add(matched.output);
|
14545 | } else {
|
14546 | omit.delete(matched.output);
|
14547 | keep.add(matched.output);
|
14548 | }
|
14549 | }
|
14550 | }
|
14551 |
|
14552 | let result = negatives === patterns.length ? [...items] : [...keep];
|
14553 | let matches = result.filter(item => !omit.has(item));
|
14554 |
|
14555 | if (options && matches.length === 0) {
|
14556 | if (options.failglob === true) {
|
14557 | throw new Error(`No matches found for "${patterns.join(', ')}"`);
|
14558 | }
|
14559 |
|
14560 | if (options.nonull === true || options.nullglob === true) {
|
14561 | return options.unescape ? patterns.map(p => p.replace(/\\/g, '')) : patterns;
|
14562 | }
|
14563 | }
|
14564 |
|
14565 | return matches;
|
14566 | };
|
14567 |
|
14568 |
|
14569 |
|
14570 |
|
14571 |
|
14572 | micromatch.match = micromatch;
|
14573 |
|
14574 |
|
14575 |
|
14576 |
|
14577 |
|
14578 |
|
14579 |
|
14580 |
|
14581 |
|
14582 |
|
14583 |
|
14584 |
|
14585 |
|
14586 |
|
14587 |
|
14588 |
|
14589 |
|
14590 |
|
14591 |
|
14592 |
|
14593 | micromatch.matcher = (pattern, options) => picomatch(pattern, options);
|
14594 |
|
14595 |
|
14596 |
|
14597 |
|
14598 |
|
14599 |
|
14600 |
|
14601 |
|
14602 |
|
14603 |
|
14604 |
|
14605 |
|
14606 |
|
14607 |
|
14608 |
|
14609 |
|
14610 |
|
14611 |
|
14612 | micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
14613 |
|
14614 |
|
14615 |
|
14616 |
|
14617 |
|
14618 | micromatch.any = micromatch.isMatch;
|
14619 |
|
14620 |
|
14621 |
|
14622 |
|
14623 |
|
14624 |
|
14625 |
|
14626 |
|
14627 |
|
14628 |
|
14629 |
|
14630 |
|
14631 |
|
14632 |
|
14633 |
|
14634 |
|
14635 |
|
14636 |
|
14637 | micromatch.not = (list, patterns, options = {}) => {
|
14638 | patterns = [].concat(patterns).map(String);
|
14639 | let result = new Set();
|
14640 | let items = [];
|
14641 |
|
14642 | let onResult = state => {
|
14643 | if (options.onResult) options.onResult(state);
|
14644 | items.push(state.output);
|
14645 | };
|
14646 |
|
14647 | let matches = micromatch(list, patterns, { ...options, onResult });
|
14648 |
|
14649 | for (let item of items) {
|
14650 | if (!matches.includes(item)) {
|
14651 | result.add(item);
|
14652 | }
|
14653 | }
|
14654 | return [...result];
|
14655 | };
|
14656 |
|
14657 |
|
14658 |
|
14659 |
|
14660 |
|
14661 |
|
14662 |
|
14663 |
|
14664 |
|
14665 |
|
14666 |
|
14667 |
|
14668 |
|
14669 |
|
14670 |
|
14671 |
|
14672 |
|
14673 |
|
14674 |
|
14675 |
|
14676 |
|
14677 | micromatch.contains = (str, pattern, options) => {
|
14678 | if (typeof str !== 'string') {
|
14679 | throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
14680 | }
|
14681 |
|
14682 | if (Array.isArray(pattern)) {
|
14683 | return pattern.some(p => micromatch.contains(str, p, options));
|
14684 | }
|
14685 |
|
14686 | if (typeof pattern === 'string') {
|
14687 | if (isEmptyString(str) || isEmptyString(pattern)) {
|
14688 | return false;
|
14689 | }
|
14690 |
|
14691 | if (str.includes(pattern) || (str.startsWith('./') && str.slice(2).includes(pattern))) {
|
14692 | return true;
|
14693 | }
|
14694 | }
|
14695 |
|
14696 | return micromatch.isMatch(str, pattern, { ...options, contains: true });
|
14697 | };
|
14698 |
|
14699 |
|
14700 |
|
14701 |
|
14702 |
|
14703 |
|
14704 |
|
14705 |
|
14706 |
|
14707 |
|
14708 |
|
14709 |
|
14710 |
|
14711 |
|
14712 |
|
14713 |
|
14714 |
|
14715 |
|
14716 |
|
14717 |
|
14718 |
|
14719 | micromatch.matchKeys = (obj, patterns, options) => {
|
14720 | if (!utils.isObject(obj)) {
|
14721 | throw new TypeError('Expected the first argument to be an object');
|
14722 | }
|
14723 | let keys = micromatch(Object.keys(obj), patterns, options);
|
14724 | let res = {};
|
14725 | for (let key of keys) res[key] = obj[key];
|
14726 | return res;
|
14727 | };
|
14728 |
|
14729 |
|
14730 |
|
14731 |
|
14732 |
|
14733 |
|
14734 |
|
14735 |
|
14736 |
|
14737 |
|
14738 |
|
14739 |
|
14740 |
|
14741 |
|
14742 |
|
14743 |
|
14744 |
|
14745 |
|
14746 |
|
14747 |
|
14748 | micromatch.some = (list, patterns, options) => {
|
14749 | let items = [].concat(list);
|
14750 |
|
14751 | for (let pattern of [].concat(patterns)) {
|
14752 | let isMatch = picomatch(String(pattern), options);
|
14753 | if (items.some(item => isMatch(item))) {
|
14754 | return true;
|
14755 | }
|
14756 | }
|
14757 | return false;
|
14758 | };
|
14759 |
|
14760 |
|
14761 |
|
14762 |
|
14763 |
|
14764 |
|
14765 |
|
14766 |
|
14767 |
|
14768 |
|
14769 |
|
14770 |
|
14771 |
|
14772 |
|
14773 |
|
14774 |
|
14775 |
|
14776 |
|
14777 |
|
14778 |
|
14779 |
|
14780 |
|
14781 |
|
14782 |
|
14783 |
|
14784 | micromatch.every = (list, patterns, options) => {
|
14785 | let items = [].concat(list);
|
14786 |
|
14787 | for (let pattern of [].concat(patterns)) {
|
14788 | let isMatch = picomatch(String(pattern), options);
|
14789 | if (!items.every(item => isMatch(item))) {
|
14790 | return false;
|
14791 | }
|
14792 | }
|
14793 | return true;
|
14794 | };
|
14795 |
|
14796 |
|
14797 |
|
14798 |
|
14799 |
|
14800 |
|
14801 |
|
14802 |
|
14803 |
|
14804 |
|
14805 |
|
14806 |
|
14807 |
|
14808 |
|
14809 |
|
14810 |
|
14811 |
|
14812 |
|
14813 |
|
14814 |
|
14815 |
|
14816 |
|
14817 |
|
14818 |
|
14819 |
|
14820 |
|
14821 |
|
14822 |
|
14823 | micromatch.all = (str, patterns, options) => {
|
14824 | if (typeof str !== 'string') {
|
14825 | throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
14826 | }
|
14827 |
|
14828 | return [].concat(patterns).every(p => picomatch(p, options)(str));
|
14829 | };
|
14830 |
|
14831 |
|
14832 |
|
14833 |
|
14834 |
|
14835 |
|
14836 |
|
14837 |
|
14838 |
|
14839 |
|
14840 |
|
14841 |
|
14842 |
|
14843 |
|
14844 |
|
14845 |
|
14846 |
|
14847 |
|
14848 |
|
14849 |
|
14850 | micromatch.capture = (glob, input, options) => {
|
14851 | let posix = utils.isWindows(options);
|
14852 | let regex = picomatch.makeRe(String(glob), { ...options, capture: true });
|
14853 | let match = regex.exec(posix ? utils.toPosixSlashes(input) : input);
|
14854 |
|
14855 | if (match) {
|
14856 | return match.slice(1).map(v => v === void 0 ? '' : v);
|
14857 | }
|
14858 | };
|
14859 |
|
14860 |
|
14861 |
|
14862 |
|
14863 |
|
14864 |
|
14865 |
|
14866 |
|
14867 |
|
14868 |
|
14869 |
|
14870 |
|
14871 |
|
14872 |
|
14873 |
|
14874 |
|
14875 |
|
14876 | micromatch.makeRe = (...args) => picomatch.makeRe(...args);
|
14877 |
|
14878 |
|
14879 |
|
14880 |
|
14881 |
|
14882 |
|
14883 |
|
14884 |
|
14885 |
|
14886 |
|
14887 |
|
14888 |
|
14889 |
|
14890 |
|
14891 |
|
14892 | micromatch.scan = (...args) => picomatch.scan(...args);
|
14893 |
|
14894 |
|
14895 |
|
14896 |
|
14897 |
|
14898 |
|
14899 |
|
14900 |
|
14901 |
|
14902 |
|
14903 |
|
14904 |
|
14905 |
|
14906 |
|
14907 |
|
14908 | micromatch.parse = (patterns, options) => {
|
14909 | let res = [];
|
14910 | for (let pattern of [].concat(patterns || [])) {
|
14911 | for (let str of braces(String(pattern), options)) {
|
14912 | res.push(picomatch.parse(str, options));
|
14913 | }
|
14914 | }
|
14915 | return res;
|
14916 | };
|
14917 |
|
14918 |
|
14919 |
|
14920 |
|
14921 |
|
14922 |
|
14923 |
|
14924 |
|
14925 |
|
14926 |
|
14927 |
|
14928 |
|
14929 |
|
14930 |
|
14931 |
|
14932 |
|
14933 |
|
14934 |
|
14935 | micromatch.braces = (pattern, options) => {
|
14936 | if (typeof pattern !== 'string') throw new TypeError('Expected a string');
|
14937 | if ((options && options.nobrace === true) || !/\{.*\}/.test(pattern)) {
|
14938 | return [pattern];
|
14939 | }
|
14940 | return braces(pattern, options);
|
14941 | };
|
14942 |
|
14943 |
|
14944 |
|
14945 |
|
14946 |
|
14947 | micromatch.braceExpand = (pattern, options) => {
|
14948 | if (typeof pattern !== 'string') throw new TypeError('Expected a string');
|
14949 | return micromatch.braces(pattern, { ...options, expand: true });
|
14950 | };
|
14951 |
|
14952 |
|
14953 |
|
14954 |
|
14955 |
|
14956 | module.exports = micromatch;
|
14957 |
|
14958 |
|
14959 | }),
|
14960 |
|
14961 | (function(module, exports, __webpack_require__) {
|
14962 |
|
14963 | "use strict";
|
14964 |
|
14965 |
|
14966 | const stringify = __webpack_require__(73);
|
14967 | const compile = __webpack_require__(75);
|
14968 | const expand = __webpack_require__(79);
|
14969 | const parse = __webpack_require__(80);
|
14970 |
|
14971 |
|
14972 |
|
14973 |
|
14974 |
|
14975 |
|
14976 |
|
14977 |
|
14978 |
|
14979 |
|
14980 |
|
14981 |
|
14982 |
|
14983 |
|
14984 |
|
14985 | const braces = (input, options = {}) => {
|
14986 | let output = [];
|
14987 |
|
14988 | if (Array.isArray(input)) {
|
14989 | for (let pattern of input) {
|
14990 | let result = braces.create(pattern, options);
|
14991 | if (Array.isArray(result)) {
|
14992 | output.push(...result);
|
14993 | } else {
|
14994 | output.push(result);
|
14995 | }
|
14996 | }
|
14997 | } else {
|
14998 | output = [].concat(braces.create(input, options));
|
14999 | }
|
15000 |
|
15001 | if (options && options.expand === true && options.nodupes === true) {
|
15002 | output = [...new Set(output)];
|
15003 | }
|
15004 | return output;
|
15005 | };
|
15006 |
|
15007 |
|
15008 |
|
15009 |
|
15010 |
|
15011 |
|
15012 |
|
15013 |
|
15014 |
|
15015 |
|
15016 |
|
15017 |
|
15018 |
|
15019 |
|
15020 |
|
15021 | braces.parse = (input, options = {}) => parse(input, options);
|
15022 |
|
15023 |
|
15024 |
|
15025 |
|
15026 |
|
15027 |
|
15028 |
|
15029 |
|
15030 |
|
15031 |
|
15032 |
|
15033 |
|
15034 |
|
15035 |
|
15036 |
|
15037 | braces.stringify = (input, options = {}) => {
|
15038 | if (typeof input === 'string') {
|
15039 | return stringify(braces.parse(input, options), options);
|
15040 | }
|
15041 | return stringify(input, options);
|
15042 | };
|
15043 |
|
15044 |
|
15045 |
|
15046 |
|
15047 |
|
15048 |
|
15049 |
|
15050 |
|
15051 |
|
15052 |
|
15053 |
|
15054 |
|
15055 |
|
15056 |
|
15057 |
|
15058 |
|
15059 | braces.compile = (input, options = {}) => {
|
15060 | if (typeof input === 'string') {
|
15061 | input = braces.parse(input, options);
|
15062 | }
|
15063 | return compile(input, options);
|
15064 | };
|
15065 |
|
15066 |
|
15067 |
|
15068 |
|
15069 |
|
15070 |
|
15071 |
|
15072 |
|
15073 |
|
15074 |
|
15075 |
|
15076 |
|
15077 |
|
15078 |
|
15079 |
|
15080 |
|
15081 |
|
15082 |
|
15083 | braces.expand = (input, options = {}) => {
|
15084 | if (typeof input === 'string') {
|
15085 | input = braces.parse(input, options);
|
15086 | }
|
15087 |
|
15088 | let result = expand(input, options);
|
15089 |
|
15090 |
|
15091 | if (options.noempty === true) {
|
15092 | result = result.filter(Boolean);
|
15093 | }
|
15094 |
|
15095 |
|
15096 | if (options.nodupes === true) {
|
15097 | result = [...new Set(result)];
|
15098 | }
|
15099 |
|
15100 | return result;
|
15101 | };
|
15102 |
|
15103 |
|
15104 |
|
15105 |
|
15106 |
|
15107 |
|
15108 |
|
15109 |
|
15110 |
|
15111 |
|
15112 |
|
15113 |
|
15114 |
|
15115 |
|
15116 |
|
15117 |
|
15118 |
|
15119 | braces.create = (input, options = {}) => {
|
15120 | if (input === '' || input.length < 3) {
|
15121 | return [input];
|
15122 | }
|
15123 |
|
15124 | return options.expand !== true
|
15125 | ? braces.compile(input, options)
|
15126 | : braces.expand(input, options);
|
15127 | };
|
15128 |
|
15129 |
|
15130 |
|
15131 |
|
15132 |
|
15133 | module.exports = braces;
|
15134 |
|
15135 |
|
15136 | }),
|
15137 |
|
15138 | (function(module, exports, __webpack_require__) {
|
15139 |
|
15140 | "use strict";
|
15141 |
|
15142 |
|
15143 | const utils = __webpack_require__(74);
|
15144 |
|
15145 | module.exports = (ast, options = {}) => {
|
15146 | let stringify = (node, parent = {}) => {
|
15147 | let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
|
15148 | let invalidNode = node.invalid === true && options.escapeInvalid === true;
|
15149 | let output = '';
|
15150 |
|
15151 | if (node.value) {
|
15152 | if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) {
|
15153 | return '\\' + node.value;
|
15154 | }
|
15155 | return node.value;
|
15156 | }
|
15157 |
|
15158 | if (node.value) {
|
15159 | return node.value;
|
15160 | }
|
15161 |
|
15162 | if (node.nodes) {
|
15163 | for (let child of node.nodes) {
|
15164 | output += stringify(child);
|
15165 | }
|
15166 | }
|
15167 | return output;
|
15168 | };
|
15169 |
|
15170 | return stringify(ast);
|
15171 | };
|
15172 |
|
15173 |
|
15174 |
|
15175 | }),
|
15176 |
|
15177 | (function(module, exports, __webpack_require__) {
|
15178 |
|
15179 | "use strict";
|
15180 |
|
15181 |
|
15182 | exports.isInteger = num => {
|
15183 | if (typeof num === 'number') {
|
15184 | return Number.isInteger(num);
|
15185 | }
|
15186 | if (typeof num === 'string' && num.trim() !== '') {
|
15187 | return Number.isInteger(Number(num));
|
15188 | }
|
15189 | return false;
|
15190 | };
|
15191 |
|
15192 |
|
15193 |
|
15194 |
|
15195 |
|
15196 | exports.find = (node, type) => node.nodes.find(node => node.type === type);
|
15197 |
|
15198 |
|
15199 |
|
15200 |
|
15201 |
|
15202 | exports.exceedsLimit = (min, max, step = 1, limit) => {
|
15203 | if (limit === false) return false;
|
15204 | if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
|
15205 | return ((Number(max) - Number(min)) / Number(step)) >= limit;
|
15206 | };
|
15207 |
|
15208 |
|
15209 |
|
15210 |
|
15211 |
|
15212 | exports.escapeNode = (block, n = 0, type) => {
|
15213 | let node = block.nodes[n];
|
15214 | if (!node) return;
|
15215 |
|
15216 | if ((type && node.type === type) || node.type === 'open' || node.type === 'close') {
|
15217 | if (node.escaped !== true) {
|
15218 | node.value = '\\' + node.value;
|
15219 | node.escaped = true;
|
15220 | }
|
15221 | }
|
15222 | };
|
15223 |
|
15224 |
|
15225 |
|
15226 |
|
15227 |
|
15228 | exports.encloseBrace = node => {
|
15229 | if (node.type !== 'brace') return false;
|
15230 | if ((node.commas >> 0 + node.ranges >> 0) === 0) {
|
15231 | node.invalid = true;
|
15232 | return true;
|
15233 | }
|
15234 | return false;
|
15235 | };
|
15236 |
|
15237 |
|
15238 |
|
15239 |
|
15240 |
|
15241 | exports.isInvalidBrace = block => {
|
15242 | if (block.type !== 'brace') return false;
|
15243 | if (block.invalid === true || block.dollar) return true;
|
15244 | if ((block.commas >> 0 + block.ranges >> 0) === 0) {
|
15245 | block.invalid = true;
|
15246 | return true;
|
15247 | }
|
15248 | if (block.open !== true || block.close !== true) {
|
15249 | block.invalid = true;
|
15250 | return true;
|
15251 | }
|
15252 | return false;
|
15253 | };
|
15254 |
|
15255 |
|
15256 |
|
15257 |
|
15258 |
|
15259 | exports.isOpenOrClose = node => {
|
15260 | if (node.type === 'open' || node.type === 'close') {
|
15261 | return true;
|
15262 | }
|
15263 | return node.open === true || node.close === true;
|
15264 | };
|
15265 |
|
15266 |
|
15267 |
|
15268 |
|
15269 |
|
15270 | exports.reduce = nodes => nodes.reduce((acc, node) => {
|
15271 | if (node.type === 'text') acc.push(node.value);
|
15272 | if (node.type === 'range') node.type = 'text';
|
15273 | return acc;
|
15274 | }, []);
|
15275 |
|
15276 |
|
15277 |
|
15278 |
|
15279 |
|
15280 | exports.flatten = (...args) => {
|
15281 | const result = [];
|
15282 | const flat = arr => {
|
15283 | for (let i = 0; i < arr.length; i++) {
|
15284 | let ele = arr[i];
|
15285 | Array.isArray(ele) ? flat(ele, result) : ele !== void 0 && result.push(ele);
|
15286 | }
|
15287 | return result;
|
15288 | };
|
15289 | flat(args);
|
15290 | return result;
|
15291 | };
|
15292 |
|
15293 |
|
15294 | }),
|
15295 |
|
15296 | (function(module, exports, __webpack_require__) {
|
15297 |
|
15298 | "use strict";
|
15299 |
|
15300 |
|
15301 | const fill = __webpack_require__(76);
|
15302 | const utils = __webpack_require__(74);
|
15303 |
|
15304 | const compile = (ast, options = {}) => {
|
15305 | let walk = (node, parent = {}) => {
|
15306 | let invalidBlock = utils.isInvalidBrace(parent);
|
15307 | let invalidNode = node.invalid === true && options.escapeInvalid === true;
|
15308 | let invalid = invalidBlock === true || invalidNode === true;
|
15309 | let prefix = options.escapeInvalid === true ? '\\' : '';
|
15310 | let output = '';
|
15311 |
|
15312 | if (node.isOpen === true) {
|
15313 | return prefix + node.value;
|
15314 | }
|
15315 | if (node.isClose === true) {
|
15316 | return prefix + node.value;
|
15317 | }
|
15318 |
|
15319 | if (node.type === 'open') {
|
15320 | return invalid ? (prefix + node.value) : '(';
|
15321 | }
|
15322 |
|
15323 | if (node.type === 'close') {
|
15324 | return invalid ? (prefix + node.value) : ')';
|
15325 | }
|
15326 |
|
15327 | if (node.type === 'comma') {
|
15328 | return node.prev.type === 'comma' ? '' : (invalid ? node.value : '|');
|
15329 | }
|
15330 |
|
15331 | if (node.value) {
|
15332 | return node.value;
|
15333 | }
|
15334 |
|
15335 | if (node.nodes && node.ranges > 0) {
|
15336 | let args = utils.reduce(node.nodes);
|
15337 | let range = fill(...args, { ...options, wrap: false, toRegex: true });
|
15338 |
|
15339 | if (range.length !== 0) {
|
15340 | return args.length > 1 && range.length > 1 ? `(${range})` : range;
|
15341 | }
|
15342 | }
|
15343 |
|
15344 | if (node.nodes) {
|
15345 | for (let child of node.nodes) {
|
15346 | output += walk(child, node);
|
15347 | }
|
15348 | }
|
15349 | return output;
|
15350 | };
|
15351 |
|
15352 | return walk(ast);
|
15353 | };
|
15354 |
|
15355 | module.exports = compile;
|
15356 |
|
15357 |
|
15358 | }),
|
15359 |
|
15360 | (function(module, exports, __webpack_require__) {
|
15361 |
|
15362 | "use strict";
|
15363 |
|
15364 |
|
15365 |
|
15366 |
|
15367 |
|
15368 |
|
15369 |
|
15370 |
|
15371 |
|
15372 | const util = __webpack_require__(48);
|
15373 | const toRegexRange = __webpack_require__(77);
|
15374 |
|
15375 | const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
|
15376 |
|
15377 | const transform = toNumber => {
|
15378 | return value => toNumber === true ? Number(value) : String(value);
|
15379 | };
|
15380 |
|
15381 | const isValidValue = value => {
|
15382 | return typeof value === 'number' || (typeof value === 'string' && value !== '');
|
15383 | };
|
15384 |
|
15385 | const isNumber = num => Number.isInteger(+num);
|
15386 |
|
15387 | const zeros = input => {
|
15388 | let value = `${input}`;
|
15389 | let index = -1;
|
15390 | if (value[0] === '-') value = value.slice(1);
|
15391 | if (value === '0') return false;
|
15392 | while (value[++index] === '0');
|
15393 | return index > 0;
|
15394 | };
|
15395 |
|
15396 | const stringify = (start, end, options) => {
|
15397 | if (typeof start === 'string' || typeof end === 'string') {
|
15398 | return true;
|
15399 | }
|
15400 | return options.stringify === true;
|
15401 | };
|
15402 |
|
15403 | const pad = (input, maxLength, toNumber) => {
|
15404 | if (maxLength > 0) {
|
15405 | let dash = input[0] === '-' ? '-' : '';
|
15406 | if (dash) input = input.slice(1);
|
15407 | input = (dash + input.padStart(dash ? maxLength - 1 : maxLength, '0'));
|
15408 | }
|
15409 | if (toNumber === false) {
|
15410 | return String(input);
|
15411 | }
|
15412 | return input;
|
15413 | };
|
15414 |
|
15415 | const toMaxLen = (input, maxLength) => {
|
15416 | let negative = input[0] === '-' ? '-' : '';
|
15417 | if (negative) {
|
15418 | input = input.slice(1);
|
15419 | maxLength--;
|
15420 | }
|
15421 | while (input.length < maxLength) input = '0' + input;
|
15422 | return negative ? ('-' + input) : input;
|
15423 | };
|
15424 |
|
15425 | const toSequence = (parts, options) => {
|
15426 | parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
15427 | parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
15428 |
|
15429 | let prefix = options.capture ? '' : '?:';
|
15430 | let positives = '';
|
15431 | let negatives = '';
|
15432 | let result;
|
15433 |
|
15434 | if (parts.positives.length) {
|
15435 | positives = parts.positives.join('|');
|
15436 | }
|
15437 |
|
15438 | if (parts.negatives.length) {
|
15439 | negatives = `-(${prefix}${parts.negatives.join('|')})`;
|
15440 | }
|
15441 |
|
15442 | if (positives && negatives) {
|
15443 | result = `${positives}|${negatives}`;
|
15444 | } else {
|
15445 | result = positives || negatives;
|
15446 | }
|
15447 |
|
15448 | if (options.wrap) {
|
15449 | return `(${prefix}${result})`;
|
15450 | }
|
15451 |
|
15452 | return result;
|
15453 | };
|
15454 |
|
15455 | const toRange = (a, b, isNumbers, options) => {
|
15456 | if (isNumbers) {
|
15457 | return toRegexRange(a, b, { wrap: false, ...options });
|
15458 | }
|
15459 |
|
15460 | let start = String.fromCharCode(a);
|
15461 | if (a === b) return start;
|
15462 |
|
15463 | let stop = String.fromCharCode(b);
|
15464 | return `[${start}-${stop}]`;
|
15465 | };
|
15466 |
|
15467 | const toRegex = (start, end, options) => {
|
15468 | if (Array.isArray(start)) {
|
15469 | let wrap = options.wrap === true;
|
15470 | let prefix = options.capture ? '' : '?:';
|
15471 | return wrap ? `(${prefix}${start.join('|')})` : start.join('|');
|
15472 | }
|
15473 | return toRegexRange(start, end, options);
|
15474 | };
|
15475 |
|
15476 | const rangeError = (...args) => {
|
15477 | return new RangeError('Invalid range arguments: ' + util.inspect(...args));
|
15478 | };
|
15479 |
|
15480 | const invalidRange = (start, end, options) => {
|
15481 | if (options.strictRanges === true) throw rangeError([start, end]);
|
15482 | return [];
|
15483 | };
|
15484 |
|
15485 | const invalidStep = (step, options) => {
|
15486 | if (options.strictRanges === true) {
|
15487 | throw new TypeError(`Expected step "${step}" to be a number`);
|
15488 | }
|
15489 | return [];
|
15490 | };
|
15491 |
|
15492 | const fillNumbers = (start, end, step = 1, options = {}) => {
|
15493 | let a = Number(start);
|
15494 | let b = Number(end);
|
15495 |
|
15496 | if (!Number.isInteger(a) || !Number.isInteger(b)) {
|
15497 | if (options.strictRanges === true) throw rangeError([start, end]);
|
15498 | return [];
|
15499 | }
|
15500 |
|
15501 |
|
15502 | if (a === 0) a = 0;
|
15503 | if (b === 0) b = 0;
|
15504 |
|
15505 | let descending = a > b;
|
15506 | let startString = String(start);
|
15507 | let endString = String(end);
|
15508 | let stepString = String(step);
|
15509 | step = Math.max(Math.abs(step), 1);
|
15510 |
|
15511 | let padded = zeros(startString) || zeros(endString) || zeros(stepString);
|
15512 | let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
|
15513 | let toNumber = padded === false && stringify(start, end, options) === false;
|
15514 | let format = options.transform || transform(toNumber);
|
15515 |
|
15516 | if (options.toRegex && step === 1) {
|
15517 | return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
|
15518 | }
|
15519 |
|
15520 | let parts = { negatives: [], positives: [] };
|
15521 | let push = num => parts[num < 0 ? 'negatives' : 'positives'].push(Math.abs(num));
|
15522 | let range = [];
|
15523 | let index = 0;
|
15524 |
|
15525 | while (descending ? a >= b : a <= b) {
|
15526 | if (options.toRegex === true && step > 1) {
|
15527 | push(a);
|
15528 | } else {
|
15529 | range.push(pad(format(a, index), maxLen, toNumber));
|
15530 | }
|
15531 | a = descending ? a - step : a + step;
|
15532 | index++;
|
15533 | }
|
15534 |
|
15535 | if (options.toRegex === true) {
|
15536 | return step > 1
|
15537 | ? toSequence(parts, options)
|
15538 | : toRegex(range, null, { wrap: false, ...options });
|
15539 | }
|
15540 |
|
15541 | return range;
|
15542 | };
|
15543 |
|
15544 | const fillLetters = (start, end, step = 1, options = {}) => {
|
15545 | if ((!isNumber(start) && start.length > 1) || (!isNumber(end) && end.length > 1)) {
|
15546 | return invalidRange(start, end, options);
|
15547 | }
|
15548 |
|
15549 |
|
15550 | let format = options.transform || (val => String.fromCharCode(val));
|
15551 | let a = `${start}`.charCodeAt(0);
|
15552 | let b = `${end}`.charCodeAt(0);
|
15553 |
|
15554 | let descending = a > b;
|
15555 | let min = Math.min(a, b);
|
15556 | let max = Math.max(a, b);
|
15557 |
|
15558 | if (options.toRegex && step === 1) {
|
15559 | return toRange(min, max, false, options);
|
15560 | }
|
15561 |
|
15562 | let range = [];
|
15563 | let index = 0;
|
15564 |
|
15565 | while (descending ? a >= b : a <= b) {
|
15566 | range.push(format(a, index));
|
15567 | a = descending ? a - step : a + step;
|
15568 | index++;
|
15569 | }
|
15570 |
|
15571 | if (options.toRegex === true) {
|
15572 | return toRegex(range, null, { wrap: false, options });
|
15573 | }
|
15574 |
|
15575 | return range;
|
15576 | };
|
15577 |
|
15578 | const fill = (start, end, step, options = {}) => {
|
15579 | if (end == null && isValidValue(start)) {
|
15580 | return [start];
|
15581 | }
|
15582 |
|
15583 | if (!isValidValue(start) || !isValidValue(end)) {
|
15584 | return invalidRange(start, end, options);
|
15585 | }
|
15586 |
|
15587 | if (typeof step === 'function') {
|
15588 | return fill(start, end, 1, { transform: step });
|
15589 | }
|
15590 |
|
15591 | if (isObject(step)) {
|
15592 | return fill(start, end, 0, step);
|
15593 | }
|
15594 |
|
15595 | let opts = { ...options };
|
15596 | if (opts.capture === true) opts.wrap = true;
|
15597 | step = step || opts.step || 1;
|
15598 |
|
15599 | if (!isNumber(step)) {
|
15600 | if (step != null && !isObject(step)) return invalidStep(step, opts);
|
15601 | return fill(start, end, 1, step);
|
15602 | }
|
15603 |
|
15604 | if (isNumber(start) && isNumber(end)) {
|
15605 | return fillNumbers(start, end, step, opts);
|
15606 | }
|
15607 |
|
15608 | return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
|
15609 | };
|
15610 |
|
15611 | module.exports = fill;
|
15612 |
|
15613 |
|
15614 | }),
|
15615 |
|
15616 | (function(module, exports, __webpack_require__) {
|
15617 |
|
15618 | "use strict";
|
15619 |
|
15620 |
|
15621 |
|
15622 |
|
15623 |
|
15624 |
|
15625 |
|
15626 |
|
15627 |
|
15628 | const isNumber = __webpack_require__(78);
|
15629 |
|
15630 | const toRegexRange = (min, max, options) => {
|
15631 | if (isNumber(min) === false) {
|
15632 | throw new TypeError('toRegexRange: expected the first argument to be a number');
|
15633 | }
|
15634 |
|
15635 | if (max === void 0 || min === max) {
|
15636 | return String(min);
|
15637 | }
|
15638 |
|
15639 | if (isNumber(max) === false) {
|
15640 | throw new TypeError('toRegexRange: expected the second argument to be a number.');
|
15641 | }
|
15642 |
|
15643 | let opts = { relaxZeros: true, ...options };
|
15644 | if (typeof opts.strictZeros === 'boolean') {
|
15645 | opts.relaxZeros = opts.strictZeros === false;
|
15646 | }
|
15647 |
|
15648 | let relax = String(opts.relaxZeros);
|
15649 | let shorthand = String(opts.shorthand);
|
15650 | let capture = String(opts.capture);
|
15651 | let wrap = String(opts.wrap);
|
15652 | let cacheKey = min + ':' + max + '=' + relax + shorthand + capture + wrap;
|
15653 |
|
15654 | if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
|
15655 | return toRegexRange.cache[cacheKey].result;
|
15656 | }
|
15657 |
|
15658 | let a = Math.min(min, max);
|
15659 | let b = Math.max(min, max);
|
15660 |
|
15661 | if (Math.abs(a - b) === 1) {
|
15662 | let result = min + '|' + max;
|
15663 | if (opts.capture) {
|
15664 | return `(${result})`;
|
15665 | }
|
15666 | if (opts.wrap === false) {
|
15667 | return result;
|
15668 | }
|
15669 | return `(?:${result})`;
|
15670 | }
|
15671 |
|
15672 | let isPadded = hasPadding(min) || hasPadding(max);
|
15673 | let state = { min, max, a, b };
|
15674 | let positives = [];
|
15675 | let negatives = [];
|
15676 |
|
15677 | if (isPadded) {
|
15678 | state.isPadded = isPadded;
|
15679 | state.maxLen = String(state.max).length;
|
15680 | }
|
15681 |
|
15682 | if (a < 0) {
|
15683 | let newMin = b < 0 ? Math.abs(b) : 1;
|
15684 | negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
|
15685 | a = state.a = 0;
|
15686 | }
|
15687 |
|
15688 | if (b >= 0) {
|
15689 | positives = splitToPatterns(a, b, state, opts);
|
15690 | }
|
15691 |
|
15692 | state.negatives = negatives;
|
15693 | state.positives = positives;
|
15694 | state.result = collatePatterns(negatives, positives, opts);
|
15695 |
|
15696 | if (opts.capture === true) {
|
15697 | state.result = `(${state.result})`;
|
15698 | } else if (opts.wrap !== false && (positives.length + negatives.length) > 1) {
|
15699 | state.result = `(?:${state.result})`;
|
15700 | }
|
15701 |
|
15702 | toRegexRange.cache[cacheKey] = state;
|
15703 | return state.result;
|
15704 | };
|
15705 |
|
15706 | function collatePatterns(neg, pos, options) {
|
15707 | let onlyNegative = filterPatterns(neg, pos, '-', false, options) || [];
|
15708 | let onlyPositive = filterPatterns(pos, neg, '', false, options) || [];
|
15709 | let intersected = filterPatterns(neg, pos, '-?', true, options) || [];
|
15710 | let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive);
|
15711 | return subpatterns.join('|');
|
15712 | }
|
15713 |
|
15714 | function splitToRanges(min, max) {
|
15715 | let nines = 1;
|
15716 | let zeros = 1;
|
15717 |
|
15718 | let stop = countNines(min, nines);
|
15719 | let stops = new Set([max]);
|
15720 |
|
15721 | while (min <= stop && stop <= max) {
|
15722 | stops.add(stop);
|
15723 | nines += 1;
|
15724 | stop = countNines(min, nines);
|
15725 | }
|
15726 |
|
15727 | stop = countZeros(max + 1, zeros) - 1;
|
15728 |
|
15729 | while (min < stop && stop <= max) {
|
15730 | stops.add(stop);
|
15731 | zeros += 1;
|
15732 | stop = countZeros(max + 1, zeros) - 1;
|
15733 | }
|
15734 |
|
15735 | stops = [...stops];
|
15736 | stops.sort(compare);
|
15737 | return stops;
|
15738 | }
|
15739 |
|
15740 |
|
15741 |
|
15742 |
|
15743 |
|
15744 |
|
15745 |
|
15746 |
|
15747 | function rangeToPattern(start, stop, options) {
|
15748 | if (start === stop) {
|
15749 | return { pattern: start, count: [], digits: 0 };
|
15750 | }
|
15751 |
|
15752 | let zipped = zip(start, stop);
|
15753 | let digits = zipped.length;
|
15754 | let pattern = '';
|
15755 | let count = 0;
|
15756 |
|
15757 | for (let i = 0; i < digits; i++) {
|
15758 | let [startDigit, stopDigit] = zipped[i];
|
15759 |
|
15760 | if (startDigit === stopDigit) {
|
15761 | pattern += startDigit;
|
15762 |
|
15763 | } else if (startDigit !== '0' || stopDigit !== '9') {
|
15764 | pattern += toCharacterClass(startDigit, stopDigit, options);
|
15765 |
|
15766 | } else {
|
15767 | count++;
|
15768 | }
|
15769 | }
|
15770 |
|
15771 | if (count) {
|
15772 | pattern += options.shorthand === true ? '\\d' : '[0-9]';
|
15773 | }
|
15774 |
|
15775 | return { pattern, count: [count], digits };
|
15776 | }
|
15777 |
|
15778 | function splitToPatterns(min, max, tok, options) {
|
15779 | let ranges = splitToRanges(min, max);
|
15780 | let tokens = [];
|
15781 | let start = min;
|
15782 | let prev;
|
15783 |
|
15784 | for (let i = 0; i < ranges.length; i++) {
|
15785 | let max = ranges[i];
|
15786 | let obj = rangeToPattern(String(start), String(max), options);
|
15787 | let zeros = '';
|
15788 |
|
15789 | if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
|
15790 | if (prev.count.length > 1) {
|
15791 | prev.count.pop();
|
15792 | }
|
15793 |
|
15794 | prev.count.push(obj.count[0]);
|
15795 | prev.string = prev.pattern + toQuantifier(prev.count);
|
15796 | start = max + 1;
|
15797 | continue;
|
15798 | }
|
15799 |
|
15800 | if (tok.isPadded) {
|
15801 | zeros = padZeros(max, tok, options);
|
15802 | }
|
15803 |
|
15804 | obj.string = zeros + obj.pattern + toQuantifier(obj.count);
|
15805 | tokens.push(obj);
|
15806 | start = max + 1;
|
15807 | prev = obj;
|
15808 | }
|
15809 |
|
15810 | return tokens;
|
15811 | }
|
15812 |
|
15813 | function filterPatterns(arr, comparison, prefix, intersection, options) {
|
15814 | let result = [];
|
15815 |
|
15816 | for (let ele of arr) {
|
15817 | let { string } = ele;
|
15818 |
|
15819 |
|
15820 | if (!intersection && !contains(comparison, 'string', string)) {
|
15821 | result.push(prefix + string);
|
15822 | }
|
15823 |
|
15824 |
|
15825 | if (intersection && contains(comparison, 'string', string)) {
|
15826 | result.push(prefix + string);
|
15827 | }
|
15828 | }
|
15829 | return result;
|
15830 | }
|
15831 |
|
15832 |
|
15833 |
|
15834 |
|
15835 |
|
15836 | function zip(a, b) {
|
15837 | let arr = [];
|
15838 | for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]);
|
15839 | return arr;
|
15840 | }
|
15841 |
|
15842 | function compare(a, b) {
|
15843 | return a > b ? 1 : b > a ? -1 : 0;
|
15844 | }
|
15845 |
|
15846 | function contains(arr, key, val) {
|
15847 | return arr.some(ele => ele[key] === val);
|
15848 | }
|
15849 |
|
15850 | function countNines(min, len) {
|
15851 | return Number(String(min).slice(0, -len) + '9'.repeat(len));
|
15852 | }
|
15853 |
|
15854 | function countZeros(integer, zeros) {
|
15855 | return integer - (integer % Math.pow(10, zeros));
|
15856 | }
|
15857 |
|
15858 | function toQuantifier(digits) {
|
15859 | let [start = 0, stop = ''] = digits;
|
15860 | if (stop || start > 1) {
|
15861 | return `{${start + (stop ? ',' + stop : '')}}`;
|
15862 | }
|
15863 | return '';
|
15864 | }
|
15865 |
|
15866 | function toCharacterClass(a, b, options) {
|
15867 | return `[${a}${(b - a === 1) ? '' : '-'}${b}]`;
|
15868 | }
|
15869 |
|
15870 | function hasPadding(str) {
|
15871 | return /^-?(0+)\d/.test(str);
|
15872 | }
|
15873 |
|
15874 | function padZeros(value, tok, options) {
|
15875 | if (!tok.isPadded) {
|
15876 | return value;
|
15877 | }
|
15878 |
|
15879 | let diff = Math.abs(tok.maxLen - String(value).length);
|
15880 | let relax = options.relaxZeros !== false;
|
15881 |
|
15882 | switch (diff) {
|
15883 | case 0:
|
15884 | return '';
|
15885 | case 1:
|
15886 | return relax ? '0?' : '0';
|
15887 | case 2:
|
15888 | return relax ? '0{0,2}' : '00';
|
15889 | default: {
|
15890 | return relax ? `0{0,${diff}}` : `0{${diff}}`;
|
15891 | }
|
15892 | }
|
15893 | }
|
15894 |
|
15895 |
|
15896 |
|
15897 |
|
15898 |
|
15899 | toRegexRange.cache = {};
|
15900 | toRegexRange.clearCache = () => (toRegexRange.cache = {});
|
15901 |
|
15902 |
|
15903 |
|
15904 |
|
15905 |
|
15906 | module.exports = toRegexRange;
|
15907 |
|
15908 |
|
15909 | }),
|
15910 |
|
15911 | (function(module, exports, __webpack_require__) {
|
15912 |
|
15913 | "use strict";
|
15914 |
|
15915 |
|
15916 |
|
15917 |
|
15918 |
|
15919 |
|
15920 |
|
15921 |
|
15922 |
|
15923 | module.exports = function(num) {
|
15924 | if (typeof num === 'number') {
|
15925 | return num - num === 0;
|
15926 | }
|
15927 | if (typeof num === 'string' && num.trim() !== '') {
|
15928 | return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
|
15929 | }
|
15930 | return false;
|
15931 | };
|
15932 |
|
15933 |
|
15934 | }),
|
15935 |
|
15936 | (function(module, exports, __webpack_require__) {
|
15937 |
|
15938 | "use strict";
|
15939 |
|
15940 |
|
15941 | const fill = __webpack_require__(76);
|
15942 | const stringify = __webpack_require__(73);
|
15943 | const utils = __webpack_require__(74);
|
15944 |
|
15945 | const append = (queue = '', stash = '', enclose = false) => {
|
15946 | let result = [];
|
15947 |
|
15948 | queue = [].concat(queue);
|
15949 | stash = [].concat(stash);
|
15950 |
|
15951 | if (!stash.length) return queue;
|
15952 | if (!queue.length) {
|
15953 | return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash;
|
15954 | }
|
15955 |
|
15956 | for (let item of queue) {
|
15957 | if (Array.isArray(item)) {
|
15958 | for (let value of item) {
|
15959 | result.push(append(value, stash, enclose));
|
15960 | }
|
15961 | } else {
|
15962 | for (let ele of stash) {
|
15963 | if (enclose === true && typeof ele === 'string') ele = `{${ele}}`;
|
15964 | result.push(Array.isArray(ele) ? append(item, ele, enclose) : (item + ele));
|
15965 | }
|
15966 | }
|
15967 | }
|
15968 | return utils.flatten(result);
|
15969 | };
|
15970 |
|
15971 | const expand = (ast, options = {}) => {
|
15972 | let rangeLimit = options.rangeLimit === void 0 ? 1000 : options.rangeLimit;
|
15973 |
|
15974 | let walk = (node, parent = {}) => {
|
15975 | node.queue = [];
|
15976 |
|
15977 | let p = parent;
|
15978 | let q = parent.queue;
|
15979 |
|
15980 | while (p.type !== 'brace' && p.type !== 'root' && p.parent) {
|
15981 | p = p.parent;
|
15982 | q = p.queue;
|
15983 | }
|
15984 |
|
15985 | if (node.invalid || node.dollar) {
|
15986 | q.push(append(q.pop(), stringify(node, options)));
|
15987 | return;
|
15988 | }
|
15989 |
|
15990 | if (node.type === 'brace' && node.invalid !== true && node.nodes.length === 2) {
|
15991 | q.push(append(q.pop(), ['{}']));
|
15992 | return;
|
15993 | }
|
15994 |
|
15995 | if (node.nodes && node.ranges > 0) {
|
15996 | let args = utils.reduce(node.nodes);
|
15997 |
|
15998 | if (utils.exceedsLimit(...args, options.step, rangeLimit)) {
|
15999 | throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.');
|
16000 | }
|
16001 |
|
16002 | let range = fill(...args, options);
|
16003 | if (range.length === 0) {
|
16004 | range = stringify(node, options);
|
16005 | }
|
16006 |
|
16007 | q.push(append(q.pop(), range));
|
16008 | node.nodes = [];
|
16009 | return;
|
16010 | }
|
16011 |
|
16012 | let enclose = utils.encloseBrace(node);
|
16013 | let queue = node.queue;
|
16014 | let block = node;
|
16015 |
|
16016 | while (block.type !== 'brace' && block.type !== 'root' && block.parent) {
|
16017 | block = block.parent;
|
16018 | queue = block.queue;
|
16019 | }
|
16020 |
|
16021 | for (let i = 0; i < node.nodes.length; i++) {
|
16022 | let child = node.nodes[i];
|
16023 |
|
16024 | if (child.type === 'comma' && node.type === 'brace') {
|
16025 | if (i === 1) queue.push('');
|
16026 | queue.push('');
|
16027 | continue;
|
16028 | }
|
16029 |
|
16030 | if (child.type === 'close') {
|
16031 | q.push(append(q.pop(), queue, enclose));
|
16032 | continue;
|
16033 | }
|
16034 |
|
16035 | if (child.value && child.type !== 'open') {
|
16036 | queue.push(append(queue.pop(), child.value));
|
16037 | continue;
|
16038 | }
|
16039 |
|
16040 | if (child.nodes) {
|
16041 | walk(child, node);
|
16042 | }
|
16043 | }
|
16044 |
|
16045 | return queue;
|
16046 | };
|
16047 |
|
16048 | return utils.flatten(walk(ast));
|
16049 | };
|
16050 |
|
16051 | module.exports = expand;
|
16052 |
|
16053 |
|
16054 | }),
|
16055 |
|
16056 | (function(module, exports, __webpack_require__) {
|
16057 |
|
16058 | "use strict";
|
16059 |
|
16060 |
|
16061 | const stringify = __webpack_require__(73);
|
16062 |
|
16063 |
|
16064 |
|
16065 |
|
16066 |
|
16067 | const {
|
16068 | MAX_LENGTH,
|
16069 | CHAR_BACKSLASH,
|
16070 | CHAR_BACKTICK,
|
16071 | CHAR_COMMA,
|
16072 | CHAR_DOT,
|
16073 | CHAR_LEFT_PARENTHESES,
|
16074 | CHAR_RIGHT_PARENTHESES,
|
16075 | CHAR_LEFT_CURLY_BRACE,
|
16076 | CHAR_RIGHT_CURLY_BRACE,
|
16077 | CHAR_LEFT_SQUARE_BRACKET,
|
16078 | CHAR_RIGHT_SQUARE_BRACKET,
|
16079 | CHAR_DOUBLE_QUOTE,
|
16080 | CHAR_SINGLE_QUOTE,
|
16081 | CHAR_NO_BREAK_SPACE,
|
16082 | CHAR_ZERO_WIDTH_NOBREAK_SPACE
|
16083 | } = __webpack_require__(81);
|
16084 |
|
16085 |
|
16086 |
|
16087 |
|
16088 |
|
16089 | const parse = (input, options = {}) => {
|
16090 | if (typeof input !== 'string') {
|
16091 | throw new TypeError('Expected a string');
|
16092 | }
|
16093 |
|
16094 | let opts = options || {};
|
16095 | let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
16096 | if (input.length > max) {
|
16097 | throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
|
16098 | }
|
16099 |
|
16100 | let ast = { type: 'root', input, nodes: [] };
|
16101 | let stack = [ast];
|
16102 | let block = ast;
|
16103 | let prev = ast;
|
16104 | let brackets = 0;
|
16105 | let length = input.length;
|
16106 | let index = 0;
|
16107 | let depth = 0;
|
16108 | let value;
|
16109 | let memo = {};
|
16110 |
|
16111 | |
16112 |
|
16113 |
|
16114 |
|
16115 | const advance = () => input[index++];
|
16116 | const push = node => {
|
16117 | if (node.type === 'text' && prev.type === 'dot') {
|
16118 | prev.type = 'text';
|
16119 | }
|
16120 |
|
16121 | if (prev && prev.type === 'text' && node.type === 'text') {
|
16122 | prev.value += node.value;
|
16123 | return;
|
16124 | }
|
16125 |
|
16126 | block.nodes.push(node);
|
16127 | node.parent = block;
|
16128 | node.prev = prev;
|
16129 | prev = node;
|
16130 | return node;
|
16131 | };
|
16132 |
|
16133 | push({ type: 'bos' });
|
16134 |
|
16135 | while (index < length) {
|
16136 | block = stack[stack.length - 1];
|
16137 | value = advance();
|
16138 |
|
16139 | |
16140 |
|
16141 |
|
16142 |
|
16143 | if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
|
16144 | continue;
|
16145 | }
|
16146 |
|
16147 | |
16148 |
|
16149 |
|
16150 |
|
16151 | if (value === CHAR_BACKSLASH) {
|
16152 | push({ type: 'text', value: (options.keepEscaping ? value : '') + advance() });
|
16153 | continue;
|
16154 | }
|
16155 |
|
16156 | |
16157 |
|
16158 |
|
16159 |
|
16160 | if (value === CHAR_RIGHT_SQUARE_BRACKET) {
|
16161 | push({ type: 'text', value: '\\' + value });
|
16162 | continue;
|
16163 | }
|
16164 |
|
16165 | |
16166 |
|
16167 |
|
16168 |
|
16169 | if (value === CHAR_LEFT_SQUARE_BRACKET) {
|
16170 | brackets++;
|
16171 |
|
16172 | let closed = true;
|
16173 | let next;
|
16174 |
|
16175 | while (index < length && (next = advance())) {
|
16176 | value += next;
|
16177 |
|
16178 | if (next === CHAR_LEFT_SQUARE_BRACKET) {
|
16179 | brackets++;
|
16180 | continue;
|
16181 | }
|
16182 |
|
16183 | if (next === CHAR_BACKSLASH) {
|
16184 | value += advance();
|
16185 | continue;
|
16186 | }
|
16187 |
|
16188 | if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
16189 | brackets--;
|
16190 |
|
16191 | if (brackets === 0) {
|
16192 | break;
|
16193 | }
|
16194 | }
|
16195 | }
|
16196 |
|
16197 | push({ type: 'text', value });
|
16198 | continue;
|
16199 | }
|
16200 |
|
16201 | |
16202 |
|
16203 |
|
16204 |
|
16205 | if (value === CHAR_LEFT_PARENTHESES) {
|
16206 | block = push({ type: 'paren', nodes: [] });
|
16207 | stack.push(block);
|
16208 | push({ type: 'text', value });
|
16209 | continue;
|
16210 | }
|
16211 |
|
16212 | if (value === CHAR_RIGHT_PARENTHESES) {
|
16213 | if (block.type !== 'paren') {
|
16214 | push({ type: 'text', value });
|
16215 | continue;
|
16216 | }
|
16217 | block = stack.pop();
|
16218 | push({ type: 'text', value });
|
16219 | block = stack[stack.length - 1];
|
16220 | continue;
|
16221 | }
|
16222 |
|
16223 | |
16224 |
|
16225 |
|
16226 |
|
16227 | if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
16228 | let open = value;
|
16229 | let next;
|
16230 |
|
16231 | if (options.keepQuotes !== true) {
|
16232 | value = '';
|
16233 | }
|
16234 |
|
16235 | while (index < length && (next = advance())) {
|
16236 | if (next === CHAR_BACKSLASH) {
|
16237 | value += next + advance();
|
16238 | continue;
|
16239 | }
|
16240 |
|
16241 | if (next === open) {
|
16242 | if (options.keepQuotes === true) value += next;
|
16243 | break;
|
16244 | }
|
16245 |
|
16246 | value += next;
|
16247 | }
|
16248 |
|
16249 | push({ type: 'text', value });
|
16250 | continue;
|
16251 | }
|
16252 |
|
16253 | |
16254 |
|
16255 |
|
16256 |
|
16257 | if (value === CHAR_LEFT_CURLY_BRACE) {
|
16258 | depth++;
|
16259 |
|
16260 | let dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true;
|
16261 | let brace = {
|
16262 | type: 'brace',
|
16263 | open: true,
|
16264 | close: false,
|
16265 | dollar,
|
16266 | depth,
|
16267 | commas: 0,
|
16268 | ranges: 0,
|
16269 | nodes: []
|
16270 | };
|
16271 |
|
16272 | block = push(brace);
|
16273 | stack.push(block);
|
16274 | push({ type: 'open', value });
|
16275 | continue;
|
16276 | }
|
16277 |
|
16278 | |
16279 |
|
16280 |
|
16281 |
|
16282 | if (value === CHAR_RIGHT_CURLY_BRACE) {
|
16283 | if (block.type !== 'brace') {
|
16284 | push({ type: 'text', value });
|
16285 | continue;
|
16286 | }
|
16287 |
|
16288 | let type = 'close';
|
16289 | block = stack.pop();
|
16290 | block.close = true;
|
16291 |
|
16292 | push({ type, value });
|
16293 | depth--;
|
16294 |
|
16295 | block = stack[stack.length - 1];
|
16296 | continue;
|
16297 | }
|
16298 |
|
16299 | |
16300 |
|
16301 |
|
16302 |
|
16303 | if (value === CHAR_COMMA && depth > 0) {
|
16304 | if (block.ranges > 0) {
|
16305 | block.ranges = 0;
|
16306 | let open = block.nodes.shift();
|
16307 | block.nodes = [open, { type: 'text', value: stringify(block) }];
|
16308 | }
|
16309 |
|
16310 | push({ type: 'comma', value });
|
16311 | block.commas++;
|
16312 | continue;
|
16313 | }
|
16314 |
|
16315 | |
16316 |
|
16317 |
|
16318 |
|
16319 | if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
|
16320 | let siblings = block.nodes;
|
16321 |
|
16322 | if (depth === 0 || siblings.length === 0) {
|
16323 | push({ type: 'text', value });
|
16324 | continue;
|
16325 | }
|
16326 |
|
16327 | if (prev.type === 'dot') {
|
16328 | block.range = [];
|
16329 | prev.value += value;
|
16330 | prev.type = 'range';
|
16331 |
|
16332 | if (block.nodes.length !== 3 && block.nodes.length !== 5) {
|
16333 | block.invalid = true;
|
16334 | block.ranges = 0;
|
16335 | prev.type = 'text';
|
16336 | continue;
|
16337 | }
|
16338 |
|
16339 | block.ranges++;
|
16340 | block.args = [];
|
16341 | continue;
|
16342 | }
|
16343 |
|
16344 | if (prev.type === 'range') {
|
16345 | siblings.pop();
|
16346 |
|
16347 | let before = siblings[siblings.length - 1];
|
16348 | before.value += prev.value + value;
|
16349 | prev = before;
|
16350 | block.ranges--;
|
16351 | continue;
|
16352 | }
|
16353 |
|
16354 | push({ type: 'dot', value });
|
16355 | continue;
|
16356 | }
|
16357 |
|
16358 | |
16359 |
|
16360 |
|
16361 |
|
16362 | push({ type: 'text', value });
|
16363 | }
|
16364 |
|
16365 |
|
16366 | do {
|
16367 | block = stack.pop();
|
16368 |
|
16369 | if (block.type !== 'root') {
|
16370 | block.nodes.forEach(node => {
|
16371 | if (!node.nodes) {
|
16372 | if (node.type === 'open') node.isOpen = true;
|
16373 | if (node.type === 'close') node.isClose = true;
|
16374 | if (!node.nodes) node.type = 'text';
|
16375 | node.invalid = true;
|
16376 | }
|
16377 | });
|
16378 |
|
16379 |
|
16380 | let parent = stack[stack.length - 1];
|
16381 | let index = parent.nodes.indexOf(block);
|
16382 |
|
16383 | parent.nodes.splice(index, 1, ...block.nodes);
|
16384 | }
|
16385 | } while (stack.length > 0);
|
16386 |
|
16387 | push({ type: 'eos' });
|
16388 | return ast;
|
16389 | };
|
16390 |
|
16391 | module.exports = parse;
|
16392 |
|
16393 |
|
16394 | }),
|
16395 |
|
16396 | (function(module, exports, __webpack_require__) {
|
16397 |
|
16398 | "use strict";
|
16399 |
|
16400 |
|
16401 | module.exports = {
|
16402 | MAX_LENGTH: 1024 * 64,
|
16403 |
|
16404 |
|
16405 | CHAR_0: '0',
|
16406 | CHAR_9: '9',
|
16407 |
|
16408 |
|
16409 | CHAR_UPPERCASE_A: 'A',
|
16410 | CHAR_LOWERCASE_A: 'a',
|
16411 | CHAR_UPPERCASE_Z: 'Z',
|
16412 | CHAR_LOWERCASE_Z: 'z',
|
16413 |
|
16414 | CHAR_LEFT_PARENTHESES: '(',
|
16415 | CHAR_RIGHT_PARENTHESES: ')',
|
16416 |
|
16417 | CHAR_ASTERISK: '*',
|
16418 |
|
16419 |
|
16420 | CHAR_AMPERSAND: '&',
|
16421 | CHAR_AT: '@',
|
16422 | CHAR_BACKSLASH: '\\',
|
16423 | CHAR_BACKTICK: '`',
|
16424 | CHAR_CARRIAGE_RETURN: '\r',
|
16425 | CHAR_CIRCUMFLEX_ACCENT: '^',
|
16426 | CHAR_COLON: ':',
|
16427 | CHAR_COMMA: ',',
|
16428 | CHAR_DOLLAR: '$',
|
16429 | CHAR_DOT: '.',
|
16430 | CHAR_DOUBLE_QUOTE: '"',
|
16431 | CHAR_EQUAL: '=',
|
16432 | CHAR_EXCLAMATION_MARK: '!',
|
16433 | CHAR_FORM_FEED: '\f',
|
16434 | CHAR_FORWARD_SLASH: '/',
|
16435 | CHAR_HASH: '#',
|
16436 | CHAR_HYPHEN_MINUS: '-',
|
16437 | CHAR_LEFT_ANGLE_BRACKET: '<',
|
16438 | CHAR_LEFT_CURLY_BRACE: '{',
|
16439 | CHAR_LEFT_SQUARE_BRACKET: '[',
|
16440 | CHAR_LINE_FEED: '\n',
|
16441 | CHAR_NO_BREAK_SPACE: '\u00A0',
|
16442 | CHAR_PERCENT: '%',
|
16443 | CHAR_PLUS: '+',
|
16444 | CHAR_QUESTION_MARK: '?',
|
16445 | CHAR_RIGHT_ANGLE_BRACKET: '>',
|
16446 | CHAR_RIGHT_CURLY_BRACE: '}',
|
16447 | CHAR_RIGHT_SQUARE_BRACKET: ']',
|
16448 | CHAR_SEMICOLON: ';',
|
16449 | CHAR_SINGLE_QUOTE: '\'',
|
16450 | CHAR_SPACE: ' ',
|
16451 | CHAR_TAB: '\t',
|
16452 | CHAR_UNDERSCORE: '_',
|
16453 | CHAR_VERTICAL_LINE: '|',
|
16454 | CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF'
|
16455 | };
|
16456 |
|
16457 |
|
16458 | }),
|
16459 |
|
16460 | (function(module, exports, __webpack_require__) {
|
16461 |
|
16462 | "use strict";
|
16463 |
|
16464 |
|
16465 | module.exports = __webpack_require__(83);
|
16466 |
|
16467 |
|
16468 | }),
|
16469 |
|
16470 | (function(module, exports, __webpack_require__) {
|
16471 |
|
16472 | "use strict";
|
16473 |
|
16474 |
|
16475 | const path = __webpack_require__(13);
|
16476 | const scan = __webpack_require__(84);
|
16477 | const parse = __webpack_require__(87);
|
16478 | const utils = __webpack_require__(85);
|
16479 |
|
16480 |
|
16481 |
|
16482 |
|
16483 |
|
16484 |
|
16485 |
|
16486 |
|
16487 |
|
16488 |
|
16489 |
|
16490 |
|
16491 |
|
16492 |
|
16493 |
|
16494 |
|
16495 |
|
16496 |
|
16497 |
|
16498 |
|
16499 |
|
16500 |
|
16501 |
|
16502 | const picomatch = (glob, options, returnState = false) => {
|
16503 | if (Array.isArray(glob)) {
|
16504 | let fns = glob.map(input => picomatch(input, options, returnState));
|
16505 | return str => {
|
16506 | for (let isMatch of fns) {
|
16507 | let state = isMatch(str);
|
16508 | if (state) return state;
|
16509 | }
|
16510 | return false;
|
16511 | };
|
16512 | }
|
16513 |
|
16514 | if (typeof glob !== 'string' || glob === '') {
|
16515 | throw new TypeError('Expected pattern to be a non-empty string');
|
16516 | }
|
16517 |
|
16518 | let opts = options || {};
|
16519 | let posix = utils.isWindows(options);
|
16520 | let regex = picomatch.makeRe(glob, options, false, true);
|
16521 | let state = regex.state;
|
16522 | delete regex.state;
|
16523 |
|
16524 | let isIgnored = () => false;
|
16525 | if (opts.ignore) {
|
16526 | let ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
|
16527 | isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
|
16528 | }
|
16529 |
|
16530 | const matcher = (input, returnObject = false) => {
|
16531 | let { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });
|
16532 | let result = { glob, state, regex, posix, input, output, match, isMatch };
|
16533 |
|
16534 | if (typeof opts.onResult === 'function') {
|
16535 | opts.onResult(result);
|
16536 | }
|
16537 |
|
16538 | if (isMatch === false) {
|
16539 | result.isMatch = false;
|
16540 | return returnObject ? result : false;
|
16541 | }
|
16542 |
|
16543 | if (isIgnored(input)) {
|
16544 | if (typeof opts.onIgnore === 'function') {
|
16545 | opts.onIgnore(result);
|
16546 | }
|
16547 | result.isMatch = false;
|
16548 | return returnObject ? result : false;
|
16549 | }
|
16550 |
|
16551 | if (typeof opts.onMatch === 'function') {
|
16552 | opts.onMatch(result);
|
16553 | }
|
16554 | return returnObject ? result : true;
|
16555 | };
|
16556 |
|
16557 | if (returnState) {
|
16558 | matcher.state = state;
|
16559 | }
|
16560 |
|
16561 | return matcher;
|
16562 | };
|
16563 |
|
16564 |
|
16565 |
|
16566 |
|
16567 |
|
16568 |
|
16569 |
|
16570 |
|
16571 |
|
16572 |
|
16573 |
|
16574 |
|
16575 |
|
16576 |
|
16577 |
|
16578 |
|
16579 |
|
16580 |
|
16581 | picomatch.test = (input, regex, options, { glob, posix } = {}) => {
|
16582 | if (typeof input !== 'string') {
|
16583 | throw new TypeError('Expected input to be a string');
|
16584 | }
|
16585 |
|
16586 | if (input === '') {
|
16587 | return { isMatch: false, output: '' };
|
16588 | }
|
16589 |
|
16590 | let opts = options || {};
|
16591 | let format = opts.format || (posix ? utils.toPosixSlashes : null);
|
16592 | let match = input === glob;
|
16593 | let output = (match && format) ? format(input) : input;
|
16594 |
|
16595 | if (match === false) {
|
16596 | output = format ? format(input) : input;
|
16597 | match = output === glob;
|
16598 | }
|
16599 |
|
16600 | if (match === false || opts.capture === true) {
|
16601 | if (opts.matchBase === true || opts.basename === true) {
|
16602 | match = picomatch.matchBase(input, regex, options, posix);
|
16603 | } else {
|
16604 | match = regex.exec(output);
|
16605 | }
|
16606 | }
|
16607 |
|
16608 | return { isMatch: !!match, match, output };
|
16609 | };
|
16610 |
|
16611 |
|
16612 |
|
16613 |
|
16614 |
|
16615 |
|
16616 |
|
16617 |
|
16618 |
|
16619 |
|
16620 |
|
16621 |
|
16622 |
|
16623 |
|
16624 |
|
16625 | picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
|
16626 | let regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
|
16627 | return regex.test(path.basename(input));
|
16628 | };
|
16629 |
|
16630 |
|
16631 |
|
16632 |
|
16633 |
|
16634 |
|
16635 |
|
16636 |
|
16637 |
|
16638 |
|
16639 |
|
16640 |
|
16641 |
|
16642 |
|
16643 |
|
16644 |
|
16645 |
|
16646 |
|
16647 | picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
16648 |
|
16649 |
|
16650 |
|
16651 |
|
16652 |
|
16653 |
|
16654 |
|
16655 |
|
16656 |
|
16657 |
|
16658 |
|
16659 |
|
16660 |
|
16661 |
|
16662 |
|
16663 | picomatch.parse = (glob, options) => parse(glob, options);
|
16664 |
|
16665 |
|
16666 |
|
16667 |
|
16668 |
|
16669 |
|
16670 |
|
16671 |
|
16672 |
|
16673 |
|
16674 |
|
16675 |
|
16676 |
|
16677 |
|
16678 |
|
16679 |
|
16680 |
|
16681 |
|
16682 |
|
16683 |
|
16684 |
|
16685 |
|
16686 |
|
16687 | picomatch.scan = (input, options) => scan(input, options);
|
16688 |
|
16689 |
|
16690 |
|
16691 |
|
16692 |
|
16693 |
|
16694 |
|
16695 |
|
16696 |
|
16697 |
|
16698 |
|
16699 |
|
16700 |
|
16701 |
|
16702 |
|
16703 |
|
16704 |
|
16705 | picomatch.makeRe = (input, options, returnOutput = false, returnState = false) => {
|
16706 | if (!input || typeof input !== 'string') {
|
16707 | throw new TypeError('Expected a non-empty string');
|
16708 | }
|
16709 |
|
16710 | let opts = options || {};
|
16711 | let prepend = opts.contains ? '' : '^';
|
16712 | let append = opts.contains ? '' : '$';
|
16713 | let state = { negated: false, fastpaths: true };
|
16714 | let prefix = '';
|
16715 | let output;
|
16716 |
|
16717 | if (input.startsWith('./')) {
|
16718 | input = input.slice(2);
|
16719 | prefix = state.prefix = './';
|
16720 | }
|
16721 |
|
16722 | if (opts.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
|
16723 | output = parse.fastpaths(input, options);
|
16724 | }
|
16725 |
|
16726 | if (output === void 0) {
|
16727 | state = picomatch.parse(input, options);
|
16728 | state.prefix = prefix + (state.prefix || '');
|
16729 | output = state.output;
|
16730 | }
|
16731 |
|
16732 | if (returnOutput === true) {
|
16733 | return output;
|
16734 | }
|
16735 |
|
16736 | let source = `${prepend}(?:${output})${append}`;
|
16737 | if (state && state.negated === true) {
|
16738 | source = `^(?!${source}).*$`;
|
16739 | }
|
16740 |
|
16741 | let regex = picomatch.toRegex(source, options);
|
16742 | if (returnState === true) {
|
16743 | regex.state = state;
|
16744 | }
|
16745 |
|
16746 | return regex;
|
16747 | };
|
16748 |
|
16749 |
|
16750 |
|
16751 |
|
16752 |
|
16753 |
|
16754 |
|
16755 |
|
16756 |
|
16757 |
|
16758 |
|
16759 |
|
16760 |
|
16761 |
|
16762 |
|
16763 |
|
16764 |
|
16765 |
|
16766 | picomatch.toRegex = (source, options) => {
|
16767 | try {
|
16768 | let opts = options || {};
|
16769 | return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
|
16770 | } catch (err) {
|
16771 | if (options && options.debug === true) throw err;
|
16772 | return /$^/;
|
16773 | }
|
16774 | };
|
16775 |
|
16776 |
|
16777 |
|
16778 |
|
16779 |
|
16780 |
|
16781 | picomatch.constants = __webpack_require__(86);
|
16782 |
|
16783 |
|
16784 |
|
16785 |
|
16786 |
|
16787 | module.exports = picomatch;
|
16788 |
|
16789 |
|
16790 | }),
|
16791 |
|
16792 | (function(module, exports, __webpack_require__) {
|
16793 |
|
16794 | "use strict";
|
16795 |
|
16796 |
|
16797 | const utils = __webpack_require__(85);
|
16798 |
|
16799 | const {
|
16800 | CHAR_ASTERISK,
|
16801 | CHAR_AT,
|
16802 | CHAR_BACKWARD_SLASH,
|
16803 | CHAR_COMMA,
|
16804 | CHAR_DOT,
|
16805 | CHAR_EXCLAMATION_MARK,
|
16806 | CHAR_FORWARD_SLASH,
|
16807 | CHAR_LEFT_CURLY_BRACE,
|
16808 | CHAR_LEFT_PARENTHESES,
|
16809 | CHAR_LEFT_SQUARE_BRACKET,
|
16810 | CHAR_PLUS,
|
16811 | CHAR_QUESTION_MARK,
|
16812 | CHAR_RIGHT_CURLY_BRACE,
|
16813 | CHAR_RIGHT_PARENTHESES,
|
16814 | CHAR_RIGHT_SQUARE_BRACKET
|
16815 | } = __webpack_require__(86);
|
16816 |
|
16817 | const isPathSeparator = code => {
|
16818 | return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
16819 | };
|
16820 |
|
16821 |
|
16822 |
|
16823 |
|
16824 |
|
16825 |
|
16826 |
|
16827 |
|
16828 |
|
16829 |
|
16830 |
|
16831 |
|
16832 |
|
16833 |
|
16834 |
|
16835 |
|
16836 |
|
16837 | module.exports = (input, options) => {
|
16838 | let opts = options || {};
|
16839 | let length = input.length - 1;
|
16840 | let index = -1;
|
16841 | let start = 0;
|
16842 | let lastIndex = 0;
|
16843 | let isGlob = false;
|
16844 | let backslashes = false;
|
16845 | let negated = false;
|
16846 | let braces = 0;
|
16847 | let prev;
|
16848 | let code;
|
16849 |
|
16850 | let braceEscaped = false;
|
16851 |
|
16852 | let eos = () => index >= length;
|
16853 | let advance = () => {
|
16854 | prev = code;
|
16855 | return input.charCodeAt(++index);
|
16856 | };
|
16857 |
|
16858 | while (index < length) {
|
16859 | code = advance();
|
16860 | let next;
|
16861 |
|
16862 | if (code === CHAR_BACKWARD_SLASH) {
|
16863 | backslashes = true;
|
16864 | next = advance();
|
16865 |
|
16866 | if (next === CHAR_LEFT_CURLY_BRACE) {
|
16867 | braceEscaped = true;
|
16868 | }
|
16869 | continue;
|
16870 | }
|
16871 |
|
16872 | if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
|
16873 | braces++;
|
16874 |
|
16875 | while (!eos() && (next = advance())) {
|
16876 | if (next === CHAR_BACKWARD_SLASH) {
|
16877 | backslashes = true;
|
16878 | next = advance();
|
16879 | continue;
|
16880 | }
|
16881 |
|
16882 | if (next === CHAR_LEFT_CURLY_BRACE) {
|
16883 | braces++;
|
16884 | continue;
|
16885 | }
|
16886 |
|
16887 | if (!braceEscaped && next === CHAR_DOT && (next = advance()) === CHAR_DOT) {
|
16888 | isGlob = true;
|
16889 | break;
|
16890 | }
|
16891 |
|
16892 | if (!braceEscaped && next === CHAR_COMMA) {
|
16893 | isGlob = true;
|
16894 | break;
|
16895 | }
|
16896 |
|
16897 | if (next === CHAR_RIGHT_CURLY_BRACE) {
|
16898 | braces--;
|
16899 | if (braces === 0) {
|
16900 | braceEscaped = false;
|
16901 | break;
|
16902 | }
|
16903 | }
|
16904 | }
|
16905 | }
|
16906 |
|
16907 | if (code === CHAR_FORWARD_SLASH) {
|
16908 | if (prev === CHAR_DOT && index === (start + 1)) {
|
16909 | start += 2;
|
16910 | continue;
|
16911 | }
|
16912 |
|
16913 | lastIndex = index + 1;
|
16914 | continue;
|
16915 | }
|
16916 |
|
16917 | if (code === CHAR_ASTERISK) {
|
16918 | isGlob = true;
|
16919 | break;
|
16920 | }
|
16921 |
|
16922 | if (code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK) {
|
16923 | isGlob = true;
|
16924 | break;
|
16925 | }
|
16926 |
|
16927 | if (code === CHAR_LEFT_SQUARE_BRACKET) {
|
16928 | while (!eos() && (next = advance())) {
|
16929 | if (next === CHAR_BACKWARD_SLASH) {
|
16930 | backslashes = true;
|
16931 | next = advance();
|
16932 | continue;
|
16933 | }
|
16934 |
|
16935 | if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
16936 | isGlob = true;
|
16937 | break;
|
16938 | }
|
16939 | }
|
16940 | }
|
16941 |
|
16942 | let isExtglobChar = code === CHAR_PLUS
|
16943 | || code === CHAR_AT
|
16944 | || code === CHAR_EXCLAMATION_MARK;
|
16945 |
|
16946 | if (isExtglobChar && input.charCodeAt(index + 1) === CHAR_LEFT_PARENTHESES) {
|
16947 | isGlob = true;
|
16948 | break;
|
16949 | }
|
16950 |
|
16951 | if (code === CHAR_EXCLAMATION_MARK && index === start) {
|
16952 | negated = true;
|
16953 | start++;
|
16954 | continue;
|
16955 | }
|
16956 |
|
16957 | if (code === CHAR_LEFT_PARENTHESES) {
|
16958 | while (!eos() && (next = advance())) {
|
16959 | if (next === CHAR_BACKWARD_SLASH) {
|
16960 | backslashes = true;
|
16961 | next = advance();
|
16962 | continue;
|
16963 | }
|
16964 |
|
16965 | if (next === CHAR_RIGHT_PARENTHESES) {
|
16966 | isGlob = true;
|
16967 | break;
|
16968 | }
|
16969 | }
|
16970 | }
|
16971 |
|
16972 | if (isGlob) {
|
16973 | break;
|
16974 | }
|
16975 | }
|
16976 |
|
16977 | let prefix = '';
|
16978 | let orig = input;
|
16979 | let base = input;
|
16980 | let glob = '';
|
16981 |
|
16982 | if (start > 0) {
|
16983 | prefix = input.slice(0, start);
|
16984 | input = input.slice(start);
|
16985 | lastIndex -= start;
|
16986 | }
|
16987 |
|
16988 | if (base && isGlob === true && lastIndex > 0) {
|
16989 | base = input.slice(0, lastIndex);
|
16990 | glob = input.slice(lastIndex);
|
16991 | } else if (isGlob === true) {
|
16992 | base = '';
|
16993 | glob = input;
|
16994 | } else {
|
16995 | base = input;
|
16996 | }
|
16997 |
|
16998 | if (base && base !== '' && base !== '/' && base !== input) {
|
16999 | if (isPathSeparator(base.charCodeAt(base.length - 1))) {
|
17000 | base = base.slice(0, -1);
|
17001 | }
|
17002 | }
|
17003 |
|
17004 | if (opts.unescape === true) {
|
17005 | if (glob) glob = utils.removeBackslashes(glob);
|
17006 |
|
17007 | if (base && backslashes === true) {
|
17008 | base = utils.removeBackslashes(base);
|
17009 | }
|
17010 | }
|
17011 |
|
17012 | return { prefix, input: orig, base, glob, negated, isGlob };
|
17013 | };
|
17014 |
|
17015 |
|
17016 | }),
|
17017 |
|
17018 | (function(module, exports, __webpack_require__) {
|
17019 |
|
17020 | "use strict";
|
17021 |
|
17022 |
|
17023 | const path = __webpack_require__(13);
|
17024 | const win32 = process.platform === 'win32';
|
17025 | const {
|
17026 | REGEX_SPECIAL_CHARS,
|
17027 | REGEX_SPECIAL_CHARS_GLOBAL,
|
17028 | REGEX_REMOVE_BACKSLASH
|
17029 | } = __webpack_require__(86);
|
17030 |
|
17031 | exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
|
17032 | exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
|
17033 | exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);
|
17034 | exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
|
17035 | exports.toPosixSlashes = str => str.replace(/\\/g, '/');
|
17036 |
|
17037 | exports.removeBackslashes = str => {
|
17038 | return str.replace(REGEX_REMOVE_BACKSLASH, match => {
|
17039 | return match === '\\' ? '' : match;
|
17040 | });
|
17041 | }
|
17042 |
|
17043 | exports.supportsLookbehinds = () => {
|
17044 | let segs = process.version.slice(1).split('.');
|
17045 | if (segs.length === 3 && +segs[0] >= 9 || (+segs[0] === 8 && +segs[1] >= 10)) {
|
17046 | return true;
|
17047 | }
|
17048 | return false;
|
17049 | };
|
17050 |
|
17051 | exports.isWindows = options => {
|
17052 | if (options && typeof options.windows === 'boolean') {
|
17053 | return options.windows;
|
17054 | }
|
17055 | return win32 === true || path.sep === '\\';
|
17056 | };
|
17057 |
|
17058 | exports.escapeLast = (input, char, lastIdx) => {
|
17059 | let idx = input.lastIndexOf(char, lastIdx);
|
17060 | if (idx === -1) return input;
|
17061 | if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1);
|
17062 | return input.slice(0, idx) + '\\' + input.slice(idx);
|
17063 | };
|
17064 |
|
17065 |
|
17066 | }),
|
17067 |
|
17068 | (function(module, exports, __webpack_require__) {
|
17069 |
|
17070 | "use strict";
|
17071 |
|
17072 |
|
17073 | const path = __webpack_require__(13);
|
17074 | const WIN_SLASH = '\\\\/';
|
17075 | const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
17076 |
|
17077 |
|
17078 |
|
17079 |
|
17080 |
|
17081 | const DOT_LITERAL = '\\.';
|
17082 | const PLUS_LITERAL = '\\+';
|
17083 | const QMARK_LITERAL = '\\?';
|
17084 | const SLASH_LITERAL = '\\/';
|
17085 | const ONE_CHAR = '(?=.)';
|
17086 | const QMARK = '[^/]';
|
17087 | const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
|
17088 | const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
|
17089 | const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
|
17090 | const NO_DOT = `(?!${DOT_LITERAL})`;
|
17091 | const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
|
17092 | const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
|
17093 | const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
|
17094 | const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
|
17095 | const STAR = `${QMARK}*?`;
|
17096 |
|
17097 | const POSIX_CHARS = {
|
17098 | DOT_LITERAL,
|
17099 | PLUS_LITERAL,
|
17100 | QMARK_LITERAL,
|
17101 | SLASH_LITERAL,
|
17102 | ONE_CHAR,
|
17103 | QMARK,
|
17104 | END_ANCHOR,
|
17105 | DOTS_SLASH,
|
17106 | NO_DOT,
|
17107 | NO_DOTS,
|
17108 | NO_DOT_SLASH,
|
17109 | NO_DOTS_SLASH,
|
17110 | QMARK_NO_DOT,
|
17111 | STAR,
|
17112 | START_ANCHOR
|
17113 | };
|
17114 |
|
17115 |
|
17116 |
|
17117 |
|
17118 |
|
17119 | const WINDOWS_CHARS = {
|
17120 | ...POSIX_CHARS,
|
17121 |
|
17122 | SLASH_LITERAL: `[${WIN_SLASH}]`,
|
17123 | QMARK: WIN_NO_SLASH,
|
17124 | STAR: `${WIN_NO_SLASH}*?`,
|
17125 | DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
|
17126 | NO_DOT: `(?!${DOT_LITERAL})`,
|
17127 | NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
17128 | NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
|
17129 | NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
17130 | QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
|
17131 | START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
|
17132 | END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
|
17133 | };
|
17134 |
|
17135 |
|
17136 |
|
17137 |
|
17138 |
|
17139 | const POSIX_REGEX_SOURCE = {
|
17140 | alnum: 'a-zA-Z0-9',
|
17141 | alpha: 'a-zA-Z',
|
17142 | ascii: '\\x00-\\x7F',
|
17143 | blank: ' \\t',
|
17144 | cntrl: '\\x00-\\x1F\\x7F',
|
17145 | digit: '0-9',
|
17146 | graph: '\\x21-\\x7E',
|
17147 | lower: 'a-z',
|
17148 | print: '\\x20-\\x7E ',
|
17149 | punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
|
17150 | space: ' \\t\\r\\n\\v\\f',
|
17151 | upper: 'A-Z',
|
17152 | word: 'A-Za-z0-9_',
|
17153 | xdigit: 'A-Fa-f0-9'
|
17154 | };
|
17155 |
|
17156 | module.exports = {
|
17157 | MAX_LENGTH: 1024 * 64,
|
17158 | POSIX_REGEX_SOURCE,
|
17159 |
|
17160 |
|
17161 | REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
17162 | REGEX_NON_SPECIAL_CHAR: /^[^@![\].,$*+?^{}()|\\/]+/,
|
17163 | REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
|
17164 | REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
|
17165 | REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
|
17166 | REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
17167 |
|
17168 |
|
17169 | REPLACEMENTS: {
|
17170 | '***': '*',
|
17171 | '**/**': '**',
|
17172 | '**/**/**': '**'
|
17173 | },
|
17174 |
|
17175 |
|
17176 | CHAR_0: 48,
|
17177 | CHAR_9: 57,
|
17178 |
|
17179 |
|
17180 | CHAR_UPPERCASE_A: 65,
|
17181 | CHAR_LOWERCASE_A: 97,
|
17182 | CHAR_UPPERCASE_Z: 90,
|
17183 | CHAR_LOWERCASE_Z: 122,
|
17184 |
|
17185 | CHAR_LEFT_PARENTHESES: 40,
|
17186 | CHAR_RIGHT_PARENTHESES: 41,
|
17187 |
|
17188 | CHAR_ASTERISK: 42,
|
17189 |
|
17190 |
|
17191 | CHAR_AMPERSAND: 38,
|
17192 | CHAR_AT: 64,
|
17193 | CHAR_BACKWARD_SLASH: 92,
|
17194 | CHAR_CARRIAGE_RETURN: 13,
|
17195 | CHAR_CIRCUMFLEX_ACCENT: 94,
|
17196 | CHAR_COLON: 58,
|
17197 | CHAR_COMMA: 44,
|
17198 | CHAR_DOT: 46,
|
17199 | CHAR_DOUBLE_QUOTE: 34,
|
17200 | CHAR_EQUAL: 61,
|
17201 | CHAR_EXCLAMATION_MARK: 33,
|
17202 | CHAR_FORM_FEED: 12,
|
17203 | CHAR_FORWARD_SLASH: 47,
|
17204 | CHAR_GRAVE_ACCENT: 96,
|
17205 | CHAR_HASH: 35,
|
17206 | CHAR_HYPHEN_MINUS: 45,
|
17207 | CHAR_LEFT_ANGLE_BRACKET: 60,
|
17208 | CHAR_LEFT_CURLY_BRACE: 123,
|
17209 | CHAR_LEFT_SQUARE_BRACKET: 91,
|
17210 | CHAR_LINE_FEED: 10,
|
17211 | CHAR_NO_BREAK_SPACE: 160,
|
17212 | CHAR_PERCENT: 37,
|
17213 | CHAR_PLUS: 43,
|
17214 | CHAR_QUESTION_MARK: 63,
|
17215 | CHAR_RIGHT_ANGLE_BRACKET: 62,
|
17216 | CHAR_RIGHT_CURLY_BRACE: 125,
|
17217 | CHAR_RIGHT_SQUARE_BRACKET: 93,
|
17218 | CHAR_SEMICOLON: 59,
|
17219 | CHAR_SINGLE_QUOTE: 39,
|
17220 | CHAR_SPACE: 32,
|
17221 | CHAR_TAB: 9,
|
17222 | CHAR_UNDERSCORE: 95,
|
17223 | CHAR_VERTICAL_LINE: 124,
|
17224 | CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
17225 |
|
17226 | SEP: path.sep,
|
17227 |
|
17228 | |
17229 |
|
17230 |
|
17231 |
|
17232 | extglobChars(chars) {
|
17233 | return {
|
17234 | '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` },
|
17235 | '?': { type: 'qmark', open: '(?:', close: ')?' },
|
17236 | '+': { type: 'plus', open: '(?:', close: ')+' },
|
17237 | '*': { type: 'star', open: '(?:', close: ')*' },
|
17238 | '@': { type: 'at', open: '(?:', close: ')' }
|
17239 | };
|
17240 | },
|
17241 |
|
17242 | |
17243 |
|
17244 |
|
17245 |
|
17246 | globChars(win32) {
|
17247 | return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
|
17248 | }
|
17249 | };
|
17250 |
|
17251 |
|
17252 | }),
|
17253 |
|
17254 | (function(module, exports, __webpack_require__) {
|
17255 |
|
17256 | "use strict";
|
17257 |
|
17258 |
|
17259 | const utils = __webpack_require__(85);
|
17260 | const constants = __webpack_require__(86);
|
17261 |
|
17262 |
|
17263 |
|
17264 |
|
17265 |
|
17266 | const {
|
17267 | MAX_LENGTH,
|
17268 | POSIX_REGEX_SOURCE,
|
17269 | REGEX_NON_SPECIAL_CHAR,
|
17270 | REGEX_SPECIAL_CHARS_BACKREF,
|
17271 | REPLACEMENTS
|
17272 | } = constants;
|
17273 |
|
17274 |
|
17275 |
|
17276 |
|
17277 |
|
17278 | const expandRange = (args, options) => {
|
17279 | if (typeof options.expandRange === 'function') {
|
17280 | return options.expandRange(...args, options);
|
17281 | }
|
17282 |
|
17283 | args.sort();
|
17284 | let value = `[${args.join('-')}]`;
|
17285 |
|
17286 | try {
|
17287 |
|
17288 | new RegExp(value);
|
17289 | } catch (ex) {
|
17290 | return args.map(v => utils.escapeRegex(v)).join('..');
|
17291 | }
|
17292 |
|
17293 | return value;
|
17294 | };
|
17295 |
|
17296 | const negate = state => {
|
17297 | let count = 1;
|
17298 |
|
17299 | while (state.peek() === '!' && (state.peek(2) !== '(' || state.peek(3) === '?')) {
|
17300 | state.advance();
|
17301 | state.start++;
|
17302 | count++;
|
17303 | }
|
17304 |
|
17305 | if (count % 2 === 0) {
|
17306 | return false;
|
17307 | }
|
17308 |
|
17309 | state.negated = true;
|
17310 | state.start++;
|
17311 | return true;
|
17312 | };
|
17313 |
|
17314 |
|
17315 |
|
17316 |
|
17317 |
|
17318 | const syntaxError = (type, char) => {
|
17319 | return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
17320 | };
|
17321 |
|
17322 |
|
17323 |
|
17324 |
|
17325 |
|
17326 |
|
17327 |
|
17328 |
|
17329 | const parse = (input, options) => {
|
17330 | if (typeof input !== 'string') {
|
17331 | throw new TypeError('Expected a string');
|
17332 | }
|
17333 |
|
17334 | input = REPLACEMENTS[input] || input;
|
17335 |
|
17336 | let opts = { ...options };
|
17337 | let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
17338 | let len = input.length;
|
17339 | if (len > max) {
|
17340 | throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
17341 | }
|
17342 |
|
17343 | let bos = { type: 'bos', value: '', output: opts.prepend || '' };
|
17344 | let tokens = [bos];
|
17345 |
|
17346 | let capture = opts.capture ? '' : '?:';
|
17347 | let win32 = utils.isWindows(options);
|
17348 |
|
17349 |
|
17350 | const PLATFORM_CHARS = constants.globChars(win32);
|
17351 | const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
|
17352 |
|
17353 | const {
|
17354 | DOT_LITERAL,
|
17355 | PLUS_LITERAL,
|
17356 | SLASH_LITERAL,
|
17357 | ONE_CHAR,
|
17358 | DOTS_SLASH,
|
17359 | NO_DOT,
|
17360 | NO_DOT_SLASH,
|
17361 | NO_DOTS_SLASH,
|
17362 | QMARK,
|
17363 | QMARK_NO_DOT,
|
17364 | STAR,
|
17365 | START_ANCHOR
|
17366 | } = PLATFORM_CHARS;
|
17367 |
|
17368 | const globstar = (opts) => {
|
17369 | return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
17370 | };
|
17371 |
|
17372 | let nodot = opts.dot ? '' : NO_DOT;
|
17373 | let star = opts.bash === true ? globstar(opts) : STAR;
|
17374 | let qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
|
17375 |
|
17376 | if (opts.capture) {
|
17377 | star = `(${star})`;
|
17378 | }
|
17379 |
|
17380 |
|
17381 | if (typeof opts.noext === 'boolean') {
|
17382 | opts.noextglob = opts.noext;
|
17383 | }
|
17384 |
|
17385 | let state = {
|
17386 | index: -1,
|
17387 | start: 0,
|
17388 | consumed: '',
|
17389 | output: '',
|
17390 | backtrack: false,
|
17391 | brackets: 0,
|
17392 | braces: 0,
|
17393 | parens: 0,
|
17394 | quotes: 0,
|
17395 | tokens
|
17396 | };
|
17397 |
|
17398 | let extglobs = [];
|
17399 | let stack = [];
|
17400 | let prev = bos;
|
17401 | let value;
|
17402 |
|
17403 | |
17404 |
|
17405 |
|
17406 |
|
17407 | const eos = () => state.index === len - 1;
|
17408 | const peek = state.peek = (n = 1) => input[state.index + n];
|
17409 | const advance = state.advance = () => input[++state.index];
|
17410 | const append = token => {
|
17411 | state.output += token.output != null ? token.output : token.value;
|
17412 | state.consumed += token.value || '';
|
17413 | };
|
17414 |
|
17415 | const increment = type => {
|
17416 | state[type]++;
|
17417 | stack.push(type);
|
17418 | };
|
17419 |
|
17420 | const decrement = type => {
|
17421 | state[type]--;
|
17422 | stack.pop();
|
17423 | };
|
17424 |
|
17425 | |
17426 |
|
17427 |
|
17428 |
|
17429 |
|
17430 |
|
17431 |
|
17432 |
|
17433 | const push = tok => {
|
17434 | if (prev.type === 'globstar') {
|
17435 | let isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');
|
17436 | let isExtglob = extglobs.length && (tok.type === 'pipe' || tok.type === 'paren');
|
17437 | if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {
|
17438 | state.output = state.output.slice(0, -prev.output.length);
|
17439 | prev.type = 'star';
|
17440 | prev.value = '*';
|
17441 | prev.output = star;
|
17442 | state.output += prev.output;
|
17443 | }
|
17444 | }
|
17445 |
|
17446 | if (extglobs.length && tok.type !== 'paren' && !EXTGLOB_CHARS[tok.value]) {
|
17447 | extglobs[extglobs.length - 1].inner += tok.value;
|
17448 | }
|
17449 |
|
17450 | if (tok.value || tok.output) append(tok);
|
17451 | if (prev && prev.type === 'text' && tok.type === 'text') {
|
17452 | prev.value += tok.value;
|
17453 | return;
|
17454 | }
|
17455 |
|
17456 | tok.prev = prev;
|
17457 | tokens.push(tok);
|
17458 | prev = tok;
|
17459 | };
|
17460 |
|
17461 | const extglobOpen = (type, value) => {
|
17462 | let token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' };
|
17463 |
|
17464 | token.prev = prev;
|
17465 | token.parens = state.parens;
|
17466 | token.output = state.output;
|
17467 | let output = (opts.capture ? '(' : '') + token.open;
|
17468 |
|
17469 | push({ type, value, output: state.output ? '' : ONE_CHAR });
|
17470 | push({ type: 'paren', extglob: true, value: advance(), output });
|
17471 | increment('parens');
|
17472 | extglobs.push(token);
|
17473 | };
|
17474 |
|
17475 | const extglobClose = token => {
|
17476 | let output = token.close + (opts.capture ? ')' : '');
|
17477 |
|
17478 | if (token.type === 'negate') {
|
17479 | let extglobStar = star;
|
17480 |
|
17481 | if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {
|
17482 | extglobStar = globstar(opts);
|
17483 | }
|
17484 |
|
17485 | if (extglobStar !== star || eos() || /^\)+$/.test(input.slice(state.index + 1))) {
|
17486 | output = token.close = ')$))' + extglobStar;
|
17487 | }
|
17488 |
|
17489 | if (token.prev.type === 'bos' && eos()) {
|
17490 | state.negatedExtglob = true;
|
17491 | }
|
17492 | }
|
17493 |
|
17494 | push({ type: 'paren', extglob: true, value, output });
|
17495 | decrement('parens');
|
17496 | };
|
17497 |
|
17498 | if (opts.fastpaths !== false && !/(^[*!]|[/{[()\]}"])/.test(input)) {
|
17499 | let backslashes = false;
|
17500 |
|
17501 | let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
|
17502 | if (first === '\\') {
|
17503 | backslashes = true;
|
17504 | return m;
|
17505 | }
|
17506 |
|
17507 | if (first === '?') {
|
17508 | if (esc) {
|
17509 | return esc + first + (rest ? QMARK.repeat(rest.length) : '');
|
17510 | }
|
17511 | if (index === 0) {
|
17512 | return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');
|
17513 | }
|
17514 | return QMARK.repeat(chars.length);
|
17515 | }
|
17516 |
|
17517 | if (first === '.') {
|
17518 | return DOT_LITERAL.repeat(chars.length);
|
17519 | }
|
17520 |
|
17521 | if (first === '*') {
|
17522 | if (esc) {
|
17523 | return esc + first + (rest ? star : '');
|
17524 | }
|
17525 | return star;
|
17526 | }
|
17527 | return esc ? m : '\\' + m;
|
17528 | });
|
17529 |
|
17530 | if (backslashes === true) {
|
17531 | if (opts.unescape === true) {
|
17532 | output = output.replace(/\\/g, '');
|
17533 | } else {
|
17534 | output = output.replace(/\\+/g, m => {
|
17535 | return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : '');
|
17536 | });
|
17537 | }
|
17538 | }
|
17539 |
|
17540 | state.output = output;
|
17541 | return state;
|
17542 | }
|
17543 |
|
17544 | |
17545 |
|
17546 |
|
17547 |
|
17548 | while (!eos()) {
|
17549 | value = advance();
|
17550 |
|
17551 | if (value === '\u0000') {
|
17552 | continue;
|
17553 | }
|
17554 |
|
17555 | |
17556 |
|
17557 |
|
17558 |
|
17559 | if (value === '\\') {
|
17560 | let next = peek();
|
17561 |
|
17562 | if (next === '/' && opts.bash !== true) {
|
17563 | continue;
|
17564 | }
|
17565 |
|
17566 | if (next === '.' || next === ';') {
|
17567 | continue;
|
17568 | }
|
17569 |
|
17570 | if (!next) {
|
17571 | value += '\\';
|
17572 | push({ type: 'text', value });
|
17573 | continue;
|
17574 | }
|
17575 |
|
17576 |
|
17577 | let match = /^\\+/.exec(input.slice(state.index + 1));
|
17578 | let slashes = 0;
|
17579 |
|
17580 | if (match && match[0].length > 2) {
|
17581 | slashes = match[0].length;
|
17582 | state.index += slashes;
|
17583 | if (slashes % 2 !== 0) {
|
17584 | value += '\\';
|
17585 | }
|
17586 | }
|
17587 |
|
17588 | if (opts.unescape === true) {
|
17589 | value = advance() || '';
|
17590 | } else {
|
17591 | value += advance() || '';
|
17592 | }
|
17593 |
|
17594 | if (state.brackets === 0) {
|
17595 | push({ type: 'text', value });
|
17596 | continue;
|
17597 | }
|
17598 | }
|
17599 |
|
17600 | |
17601 |
|
17602 |
|
17603 |
|
17604 |
|
17605 | if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {
|
17606 | if (opts.posix !== false && value === ':') {
|
17607 | let inner = prev.value.slice(1);
|
17608 | if (inner.includes('[')) {
|
17609 | prev.posix = true;
|
17610 |
|
17611 | if (inner.includes(':')) {
|
17612 | let idx = prev.value.lastIndexOf('[');
|
17613 | let pre = prev.value.slice(0, idx);
|
17614 | let rest = prev.value.slice(idx + 2);
|
17615 | let posix = POSIX_REGEX_SOURCE[rest];
|
17616 | if (posix) {
|
17617 | prev.value = pre + posix;
|
17618 | state.backtrack = true;
|
17619 | advance();
|
17620 |
|
17621 | if (!bos.output && tokens.indexOf(prev) === 1) {
|
17622 | bos.output = ONE_CHAR;
|
17623 | }
|
17624 | continue;
|
17625 | }
|
17626 | }
|
17627 | }
|
17628 | }
|
17629 |
|
17630 | if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) {
|
17631 | value = '\\' + value;
|
17632 | }
|
17633 |
|
17634 | if (value === ']' && (prev.value === '[' || prev.value === '[^')) {
|
17635 | value = '\\' + value;
|
17636 | }
|
17637 |
|
17638 | if (opts.posix === true && value === '!' && prev.value === '[') {
|
17639 | value = '^';
|
17640 | }
|
17641 |
|
17642 | prev.value += value;
|
17643 | append({ value });
|
17644 | continue;
|
17645 | }
|
17646 |
|
17647 | |
17648 |
|
17649 |
|
17650 |
|
17651 |
|
17652 | if (state.quotes === 1 && value !== '"') {
|
17653 | value = utils.escapeRegex(value);
|
17654 | prev.value += value;
|
17655 | append({ value });
|
17656 | continue;
|
17657 | }
|
17658 |
|
17659 | |
17660 |
|
17661 |
|
17662 |
|
17663 | if (value === '"') {
|
17664 | state.quotes = state.quotes === 1 ? 0 : 1;
|
17665 | if (opts.keepQuotes === true) {
|
17666 | push({ type: 'text', value });
|
17667 | }
|
17668 | continue;
|
17669 | }
|
17670 |
|
17671 | |
17672 |
|
17673 |
|
17674 |
|
17675 | if (value === '(') {
|
17676 | push({ type: 'paren', value });
|
17677 | increment('parens');
|
17678 | continue;
|
17679 | }
|
17680 |
|
17681 | if (value === ')') {
|
17682 | if (state.parens === 0 && opts.strictBrackets === true) {
|
17683 | throw new SyntaxError(syntaxError('opening', '('));
|
17684 | }
|
17685 |
|
17686 | let extglob = extglobs[extglobs.length - 1];
|
17687 | if (extglob && state.parens === extglob.parens + 1) {
|
17688 | extglobClose(extglobs.pop());
|
17689 | continue;
|
17690 | }
|
17691 |
|
17692 | push({ type: 'paren', value, output: state.parens ? ')' : '\\)' });
|
17693 | decrement('parens');
|
17694 | continue;
|
17695 | }
|
17696 |
|
17697 | |
17698 |
|
17699 |
|
17700 |
|
17701 | if (value === '[') {
|
17702 | if (opts.nobracket === true || !input.slice(state.index + 1).includes(']')) {
|
17703 | if (opts.nobracket !== true && opts.strictBrackets === true) {
|
17704 | throw new SyntaxError(syntaxError('closing', ']'));
|
17705 | }
|
17706 |
|
17707 | value = '\\' + value;
|
17708 | } else {
|
17709 | increment('brackets');
|
17710 | }
|
17711 |
|
17712 | push({ type: 'bracket', value });
|
17713 | continue;
|
17714 | }
|
17715 |
|
17716 | if (value === ']') {
|
17717 | if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) {
|
17718 | push({ type: 'text', value, output: '\\' + value });
|
17719 | continue;
|
17720 | }
|
17721 |
|
17722 | if (state.brackets === 0) {
|
17723 | if (opts.strictBrackets === true) {
|
17724 | throw new SyntaxError(syntaxError('opening', '['));
|
17725 | }
|
17726 |
|
17727 | push({ type: 'text', value, output: '\\' + value });
|
17728 | continue;
|
17729 | }
|
17730 |
|
17731 | decrement('brackets');
|
17732 |
|
17733 | let prevValue = prev.value.slice(1);
|
17734 | if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {
|
17735 | value = '/' + value;
|
17736 | }
|
17737 |
|
17738 | prev.value += value;
|
17739 | append({ value });
|
17740 |
|
17741 |
|
17742 |
|
17743 | if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
|
17744 | continue;
|
17745 | }
|
17746 |
|
17747 | let escaped = utils.escapeRegex(prev.value);
|
17748 | state.output = state.output.slice(0, -prev.value.length);
|
17749 |
|
17750 |
|
17751 |
|
17752 | if (opts.literalBrackets === true) {
|
17753 | state.output += escaped;
|
17754 | prev.value = escaped;
|
17755 | continue;
|
17756 | }
|
17757 |
|
17758 |
|
17759 | prev.value = `(${capture}${escaped}|${prev.value})`;
|
17760 | state.output += prev.value;
|
17761 | continue;
|
17762 | }
|
17763 |
|
17764 | |
17765 |
|
17766 |
|
17767 |
|
17768 | if (value === '{' && opts.nobrace !== true) {
|
17769 | push({ type: 'brace', value, output: '(' });
|
17770 | increment('braces');
|
17771 | continue;
|
17772 | }
|
17773 |
|
17774 | if (value === '}') {
|
17775 | if (opts.nobrace === true || state.braces === 0) {
|
17776 | push({ type: 'text', value, output: '\\' + value });
|
17777 | continue;
|
17778 | }
|
17779 |
|
17780 | let output = ')';
|
17781 |
|
17782 | if (state.dots === true) {
|
17783 | let arr = tokens.slice();
|
17784 | let range = [];
|
17785 |
|
17786 | for (let i = arr.length - 1; i >= 0; i--) {
|
17787 | tokens.pop();
|
17788 | if (arr[i].type === 'brace') {
|
17789 | break;
|
17790 | }
|
17791 | if (arr[i].type !== 'dots') {
|
17792 | range.unshift(arr[i].value);
|
17793 | }
|
17794 | }
|
17795 |
|
17796 | output = expandRange(range, opts);
|
17797 | state.backtrack = true;
|
17798 | }
|
17799 |
|
17800 | push({ type: 'brace', value, output });
|
17801 | decrement('braces');
|
17802 | continue;
|
17803 | }
|
17804 |
|
17805 | |
17806 |
|
17807 |
|
17808 |
|
17809 | if (value === '|') {
|
17810 | if (extglobs.length > 0) {
|
17811 | extglobs[extglobs.length - 1].conditions++;
|
17812 | }
|
17813 | push({ type: 'text', value });
|
17814 | continue;
|
17815 | }
|
17816 |
|
17817 | |
17818 |
|
17819 |
|
17820 |
|
17821 | if (value === ',') {
|
17822 | let output = value;
|
17823 |
|
17824 | if (state.braces > 0 && stack[stack.length - 1] === 'braces') {
|
17825 | output = '|';
|
17826 | }
|
17827 |
|
17828 | push({ type: 'comma', value, output });
|
17829 | continue;
|
17830 | }
|
17831 |
|
17832 | |
17833 |
|
17834 |
|
17835 |
|
17836 | if (value === '/') {
|
17837 |
|
17838 |
|
17839 |
|
17840 |
|
17841 | if (prev.type === 'dot' && state.index === 1) {
|
17842 | state.start = state.index + 1;
|
17843 | state.consumed = '';
|
17844 | state.output = '';
|
17845 | tokens.pop();
|
17846 | prev = bos;
|
17847 | continue;
|
17848 | }
|
17849 |
|
17850 | push({ type: 'slash', value, output: SLASH_LITERAL });
|
17851 | continue;
|
17852 | }
|
17853 |
|
17854 | |
17855 |
|
17856 |
|
17857 |
|
17858 | if (value === '.') {
|
17859 | if (state.braces > 0 && prev.type === 'dot') {
|
17860 | if (prev.value === '.') prev.output = DOT_LITERAL;
|
17861 | prev.type = 'dots';
|
17862 | prev.output += value;
|
17863 | prev.value += value;
|
17864 | state.dots = true;
|
17865 | continue;
|
17866 | }
|
17867 |
|
17868 | push({ type: 'dot', value, output: DOT_LITERAL });
|
17869 | continue;
|
17870 | }
|
17871 |
|
17872 | |
17873 |
|
17874 |
|
17875 |
|
17876 | if (value === '?') {
|
17877 | if (prev && prev.type === 'paren') {
|
17878 | let next = peek();
|
17879 | let output = value;
|
17880 |
|
17881 | if (next === '<' && !utils.supportsLookbehinds()) {
|
17882 | throw new Error('Node.js v10 or higher is required for regex lookbehinds');
|
17883 | }
|
17884 |
|
17885 | if (prev.value === '(' && !/[!=<:]/.test(next) || (next === '<' && !/[!=]/.test(peek(2)))) {
|
17886 | output = '\\' + value;
|
17887 | }
|
17888 |
|
17889 | push({ type: 'text', value, output });
|
17890 | continue;
|
17891 | }
|
17892 |
|
17893 | if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
|
17894 | extglobOpen('qmark', value);
|
17895 | continue;
|
17896 | }
|
17897 |
|
17898 | if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {
|
17899 | push({ type: 'qmark', value, output: QMARK_NO_DOT });
|
17900 | continue;
|
17901 | }
|
17902 |
|
17903 | push({ type: 'qmark', value, output: QMARK });
|
17904 | continue;
|
17905 | }
|
17906 |
|
17907 | |
17908 |
|
17909 |
|
17910 |
|
17911 | if (value === '!') {
|
17912 | if (opts.noextglob !== true && peek() === '(') {
|
17913 | if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {
|
17914 | extglobOpen('negate', value);
|
17915 | continue;
|
17916 | }
|
17917 | }
|
17918 |
|
17919 | if (opts.nonegate !== true && state.index === 0) {
|
17920 | negate(state);
|
17921 | continue;
|
17922 | }
|
17923 | }
|
17924 |
|
17925 | |
17926 |
|
17927 |
|
17928 |
|
17929 | if (value === '+') {
|
17930 | if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
|
17931 | extglobOpen('plus', value);
|
17932 | continue;
|
17933 | }
|
17934 |
|
17935 | if (prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) {
|
17936 | let output = prev.extglob === true ? '\\' + value : value;
|
17937 | push({ type: 'plus', value, output });
|
17938 | continue;
|
17939 | }
|
17940 |
|
17941 |
|
17942 | if (state.parens > 0 && opts.regex !== false) {
|
17943 | push({ type: 'plus', value });
|
17944 | continue;
|
17945 | }
|
17946 |
|
17947 | push({ type: 'plus', value: PLUS_LITERAL });
|
17948 | continue;
|
17949 | }
|
17950 |
|
17951 | |
17952 |
|
17953 |
|
17954 |
|
17955 | if (value === '@') {
|
17956 | if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
|
17957 | push({ type: 'at', value, output: '' });
|
17958 | continue;
|
17959 | }
|
17960 |
|
17961 | push({ type: 'text', value });
|
17962 | continue;
|
17963 | }
|
17964 |
|
17965 | |
17966 |
|
17967 |
|
17968 |
|
17969 | if (value !== '*') {
|
17970 | if (value === '$' || value === '^') {
|
17971 | value = '\\' + value;
|
17972 | }
|
17973 |
|
17974 | let match = REGEX_NON_SPECIAL_CHAR.exec(input.slice(state.index + 1));
|
17975 | if (match) {
|
17976 | value += match[0];
|
17977 | state.index += match[0].length;
|
17978 | }
|
17979 |
|
17980 | push({ type: 'text', value });
|
17981 | continue;
|
17982 | }
|
17983 |
|
17984 | |
17985 |
|
17986 |
|
17987 |
|
17988 | if (prev && (prev.type === 'globstar' || prev.star === true)) {
|
17989 | prev.type = 'star';
|
17990 | prev.star = true;
|
17991 | prev.value += value;
|
17992 | prev.output = star;
|
17993 | state.backtrack = true;
|
17994 | state.consumed += value;
|
17995 | continue;
|
17996 | }
|
17997 |
|
17998 | if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
|
17999 | extglobOpen('star', value);
|
18000 | continue;
|
18001 | }
|
18002 |
|
18003 | if (prev.type === 'star') {
|
18004 | if (opts.noglobstar === true) {
|
18005 | state.consumed += value;
|
18006 | continue;
|
18007 | }
|
18008 |
|
18009 | let prior = prev.prev;
|
18010 | let before = prior.prev;
|
18011 | let isStart = prior.type === 'slash' || prior.type === 'bos';
|
18012 | let afterStar = before && (before.type === 'star' || before.type === 'globstar');
|
18013 |
|
18014 | if (opts.bash === true && (!isStart || (!eos() && peek() !== '/'))) {
|
18015 | push({ type: 'star', value, output: '' });
|
18016 | continue;
|
18017 | }
|
18018 |
|
18019 | let isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');
|
18020 | let isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');
|
18021 | if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {
|
18022 | push({ type: 'star', value, output: '' });
|
18023 | continue;
|
18024 | }
|
18025 |
|
18026 |
|
18027 | while (input.slice(state.index + 1, state.index + 4) === '/**') {
|
18028 | let after = input[state.index + 4];
|
18029 | if (after && after !== '/') {
|
18030 | break;
|
18031 | }
|
18032 | state.consumed += '/**';
|
18033 | state.index += 3;
|
18034 | }
|
18035 |
|
18036 | if (prior.type === 'bos' && eos()) {
|
18037 | prev.type = 'globstar';
|
18038 | prev.value += value;
|
18039 | prev.output = globstar(opts);
|
18040 | state.output = prev.output;
|
18041 | state.consumed += value;
|
18042 | continue;
|
18043 | }
|
18044 |
|
18045 | if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {
|
18046 | state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
18047 | prior.output = '(?:' + prior.output;
|
18048 |
|
18049 | prev.type = 'globstar';
|
18050 | prev.output = globstar(opts) + '|$)';
|
18051 | prev.value += value;
|
18052 |
|
18053 | state.output += prior.output + prev.output;
|
18054 | state.consumed += value;
|
18055 | continue;
|
18056 | }
|
18057 |
|
18058 | let next = peek();
|
18059 | if (prior.type === 'slash' && prior.prev.type !== 'bos' && next === '/') {
|
18060 | let end = peek(2) !== void 0 ? '|$' : '';
|
18061 |
|
18062 | state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
18063 | prior.output = '(?:' + prior.output;
|
18064 |
|
18065 | prev.type = 'globstar';
|
18066 | prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
|
18067 | prev.value += value;
|
18068 |
|
18069 | state.output += prior.output + prev.output;
|
18070 | state.consumed += value + advance();
|
18071 |
|
18072 | push({ type: 'slash', value, output: '' });
|
18073 | continue;
|
18074 | }
|
18075 |
|
18076 | if (prior.type === 'bos' && next === '/') {
|
18077 | prev.type = 'globstar';
|
18078 | prev.value += value;
|
18079 | prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
|
18080 | state.output = prev.output;
|
18081 | state.consumed += value + advance();
|
18082 | push({ type: 'slash', value, output: '' });
|
18083 | continue;
|
18084 | }
|
18085 |
|
18086 |
|
18087 | state.output = state.output.slice(0, -prev.output.length);
|
18088 |
|
18089 |
|
18090 | prev.type = 'globstar';
|
18091 | prev.output = globstar(opts);
|
18092 | prev.value += value;
|
18093 |
|
18094 |
|
18095 | state.output += prev.output;
|
18096 | state.consumed += value;
|
18097 | continue;
|
18098 | }
|
18099 |
|
18100 | let token = { type: 'star', value, output: star };
|
18101 |
|
18102 | if (opts.bash === true) {
|
18103 | token.output = '.*?';
|
18104 | if (prev.type === 'bos' || prev.type === 'slash') {
|
18105 | token.output = nodot + token.output;
|
18106 | }
|
18107 | push(token);
|
18108 | continue;
|
18109 | }
|
18110 |
|
18111 | if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {
|
18112 | token.output = value;
|
18113 | push(token);
|
18114 | continue;
|
18115 | }
|
18116 |
|
18117 | if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {
|
18118 | if (prev.type === 'dot') {
|
18119 | state.output += NO_DOT_SLASH;
|
18120 | prev.output += NO_DOT_SLASH;
|
18121 |
|
18122 | } else if (opts.dot === true) {
|
18123 | state.output += NO_DOTS_SLASH;
|
18124 | prev.output += NO_DOTS_SLASH;
|
18125 |
|
18126 | } else {
|
18127 | state.output += nodot;
|
18128 | prev.output += nodot;
|
18129 | }
|
18130 |
|
18131 | if (peek() !== '*') {
|
18132 | state.output += ONE_CHAR;
|
18133 | prev.output += ONE_CHAR;
|
18134 | }
|
18135 | }
|
18136 |
|
18137 | push(token);
|
18138 | }
|
18139 |
|
18140 | while (state.brackets > 0) {
|
18141 | if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));
|
18142 | state.output = utils.escapeLast(state.output, '[');
|
18143 | decrement('brackets');
|
18144 | }
|
18145 |
|
18146 | while (state.parens > 0) {
|
18147 | if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));
|
18148 | state.output = utils.escapeLast(state.output, '(');
|
18149 | decrement('parens');
|
18150 | }
|
18151 |
|
18152 | while (state.braces > 0) {
|
18153 | if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));
|
18154 | state.output = utils.escapeLast(state.output, '{');
|
18155 | decrement('braces');
|
18156 | }
|
18157 |
|
18158 | if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {
|
18159 | push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` });
|
18160 | }
|
18161 |
|
18162 |
|
18163 | if (state.backtrack === true) {
|
18164 | state.output = '';
|
18165 |
|
18166 | for (let token of state.tokens) {
|
18167 | state.output += token.output != null ? token.output : token.value;
|
18168 |
|
18169 | if (token.suffix) {
|
18170 | state.output += token.suffix;
|
18171 | }
|
18172 | }
|
18173 | }
|
18174 |
|
18175 | return state;
|
18176 | };
|
18177 |
|
18178 |
|
18179 |
|
18180 |
|
18181 |
|
18182 |
|
18183 |
|
18184 | parse.fastpaths = (input, options) => {
|
18185 | let opts = { ...options };
|
18186 | let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
18187 | let len = input.length;
|
18188 | if (len > max) {
|
18189 | throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
18190 | }
|
18191 |
|
18192 | input = REPLACEMENTS[input] || input;
|
18193 | let win32 = utils.isWindows(options);
|
18194 |
|
18195 |
|
18196 | const {
|
18197 | DOT_LITERAL,
|
18198 | SLASH_LITERAL,
|
18199 | ONE_CHAR,
|
18200 | DOTS_SLASH,
|
18201 | NO_DOT,
|
18202 | NO_DOTS,
|
18203 | NO_DOTS_SLASH,
|
18204 | STAR,
|
18205 | START_ANCHOR
|
18206 | } = constants.globChars(win32);
|
18207 |
|
18208 | let capture = opts.capture ? '' : '?:';
|
18209 | let star = opts.bash === true ? '.*?' : STAR;
|
18210 | let nodot = opts.dot ? NO_DOTS : NO_DOT;
|
18211 | let slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
|
18212 |
|
18213 | if (opts.capture) {
|
18214 | star = `(${star})`;
|
18215 | }
|
18216 |
|
18217 | const globstar = (opts) => {
|
18218 | return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
18219 | };
|
18220 |
|
18221 | const create = str => {
|
18222 | switch (str) {
|
18223 | case '*':
|
18224 | return `${nodot}${ONE_CHAR}${star}`;
|
18225 |
|
18226 | case '.*':
|
18227 | return `${DOT_LITERAL}${ONE_CHAR}${star}`;
|
18228 |
|
18229 | case '*.*':
|
18230 | return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
18231 |
|
18232 | case '*/*':
|
18233 | return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
|
18234 |
|
18235 | case '**':
|
18236 | return nodot + globstar(opts);
|
18237 |
|
18238 | case '**/*':
|
18239 | return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
|
18240 |
|
18241 | case '**/*.*':
|
18242 | return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
18243 |
|
18244 | case '**/.*':
|
18245 | return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
|
18246 |
|
18247 | default: {
|
18248 | let match = /^(.*?)\.(\w+)$/.exec(str);
|
18249 | if (!match) return;
|
18250 |
|
18251 | let source = create(match[1], options);
|
18252 | if (!source) return;
|
18253 |
|
18254 | return source + DOT_LITERAL + match[2];
|
18255 | }
|
18256 | }
|
18257 | };
|
18258 |
|
18259 | let output = create(input);
|
18260 | if (output && opts.strictSlashes !== true) {
|
18261 | output += `${SLASH_LITERAL}?`;
|
18262 | }
|
18263 |
|
18264 | return output;
|
18265 | };
|
18266 |
|
18267 | module.exports = parse;
|
18268 |
|
18269 |
|
18270 | }),
|
18271 |
|
18272 | (function(module, exports, __webpack_require__) {
|
18273 |
|
18274 | "use strict";
|
18275 |
|
18276 |
|
18277 | module.exports = __webpack_require__(89);
|
18278 |
|
18279 |
|
18280 | }),
|
18281 |
|
18282 | (function(module, exports, __webpack_require__) {
|
18283 |
|
18284 | "use strict";
|
18285 |
|
18286 |
|
18287 | const path = __webpack_require__(13);
|
18288 | const scan = __webpack_require__(90);
|
18289 | const parse = __webpack_require__(93);
|
18290 | const utils = __webpack_require__(91);
|
18291 | const constants = __webpack_require__(92);
|
18292 | const isObject = val => val && typeof val === 'object' && !Array.isArray(val);
|
18293 |
|
18294 |
|
18295 |
|
18296 |
|
18297 |
|
18298 |
|
18299 |
|
18300 |
|
18301 |
|
18302 |
|
18303 |
|
18304 |
|
18305 |
|
18306 |
|
18307 |
|
18308 |
|
18309 |
|
18310 |
|
18311 |
|
18312 |
|
18313 |
|
18314 |
|
18315 |
|
18316 | const picomatch = (glob, options, returnState = false) => {
|
18317 | if (Array.isArray(glob)) {
|
18318 | const fns = glob.map(input => picomatch(input, options, returnState));
|
18319 | const arrayMatcher = str => {
|
18320 | for (const isMatch of fns) {
|
18321 | const state = isMatch(str);
|
18322 | if (state) return state;
|
18323 | }
|
18324 | return false;
|
18325 | };
|
18326 | return arrayMatcher;
|
18327 | }
|
18328 |
|
18329 | const isState = isObject(glob) && glob.tokens && glob.input;
|
18330 |
|
18331 | if (glob === '' || (typeof glob !== 'string' && !isState)) {
|
18332 | throw new TypeError('Expected pattern to be a non-empty string');
|
18333 | }
|
18334 |
|
18335 | const opts = options || {};
|
18336 | const posix = utils.isWindows(options);
|
18337 | const regex = isState
|
18338 | ? picomatch.compileRe(glob, options)
|
18339 | : picomatch.makeRe(glob, options, false, true);
|
18340 |
|
18341 | const state = regex.state;
|
18342 | delete regex.state;
|
18343 |
|
18344 | let isIgnored = () => false;
|
18345 | if (opts.ignore) {
|
18346 | const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
|
18347 | isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
|
18348 | }
|
18349 |
|
18350 | const matcher = (input, returnObject = false) => {
|
18351 | const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });
|
18352 | const result = { glob, state, regex, posix, input, output, match, isMatch };
|
18353 |
|
18354 | if (typeof opts.onResult === 'function') {
|
18355 | opts.onResult(result);
|
18356 | }
|
18357 |
|
18358 | if (isMatch === false) {
|
18359 | result.isMatch = false;
|
18360 | return returnObject ? result : false;
|
18361 | }
|
18362 |
|
18363 | if (isIgnored(input)) {
|
18364 | if (typeof opts.onIgnore === 'function') {
|
18365 | opts.onIgnore(result);
|
18366 | }
|
18367 | result.isMatch = false;
|
18368 | return returnObject ? result : false;
|
18369 | }
|
18370 |
|
18371 | if (typeof opts.onMatch === 'function') {
|
18372 | opts.onMatch(result);
|
18373 | }
|
18374 | return returnObject ? result : true;
|
18375 | };
|
18376 |
|
18377 | if (returnState) {
|
18378 | matcher.state = state;
|
18379 | }
|
18380 |
|
18381 | return matcher;
|
18382 | };
|
18383 |
|
18384 |
|
18385 |
|
18386 |
|
18387 |
|
18388 |
|
18389 |
|
18390 |
|
18391 |
|
18392 |
|
18393 |
|
18394 |
|
18395 |
|
18396 |
|
18397 |
|
18398 |
|
18399 |
|
18400 |
|
18401 | picomatch.test = (input, regex, options, { glob, posix } = {}) => {
|
18402 | if (typeof input !== 'string') {
|
18403 | throw new TypeError('Expected input to be a string');
|
18404 | }
|
18405 |
|
18406 | if (input === '') {
|
18407 | return { isMatch: false, output: '' };
|
18408 | }
|
18409 |
|
18410 | const opts = options || {};
|
18411 | const format = opts.format || (posix ? utils.toPosixSlashes : null);
|
18412 | let match = input === glob;
|
18413 | let output = (match && format) ? format(input) : input;
|
18414 |
|
18415 | if (match === false) {
|
18416 | output = format ? format(input) : input;
|
18417 | match = output === glob;
|
18418 | }
|
18419 |
|
18420 | if (match === false || opts.capture === true) {
|
18421 | if (opts.matchBase === true || opts.basename === true) {
|
18422 | match = picomatch.matchBase(input, regex, options, posix);
|
18423 | } else {
|
18424 | match = regex.exec(output);
|
18425 | }
|
18426 | }
|
18427 |
|
18428 | return { isMatch: Boolean(match), match, output };
|
18429 | };
|
18430 |
|
18431 |
|
18432 |
|
18433 |
|
18434 |
|
18435 |
|
18436 |
|
18437 |
|
18438 |
|
18439 |
|
18440 |
|
18441 |
|
18442 |
|
18443 |
|
18444 |
|
18445 | picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
|
18446 | const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
|
18447 | return regex.test(path.basename(input));
|
18448 | };
|
18449 |
|
18450 |
|
18451 |
|
18452 |
|
18453 |
|
18454 |
|
18455 |
|
18456 |
|
18457 |
|
18458 |
|
18459 |
|
18460 |
|
18461 |
|
18462 |
|
18463 |
|
18464 |
|
18465 |
|
18466 |
|
18467 | picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
18468 |
|
18469 |
|
18470 |
|
18471 |
|
18472 |
|
18473 |
|
18474 |
|
18475 |
|
18476 |
|
18477 |
|
18478 |
|
18479 |
|
18480 |
|
18481 |
|
18482 |
|
18483 | picomatch.parse = (pattern, options) => {
|
18484 | if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options));
|
18485 | return parse(pattern, { ...options, fastpaths: false });
|
18486 | };
|
18487 |
|
18488 |
|
18489 |
|
18490 |
|
18491 |
|
18492 |
|
18493 |
|
18494 |
|
18495 |
|
18496 |
|
18497 |
|
18498 |
|
18499 |
|
18500 |
|
18501 |
|
18502 |
|
18503 |
|
18504 |
|
18505 |
|
18506 |
|
18507 |
|
18508 |
|
18509 |
|
18510 |
|
18511 |
|
18512 |
|
18513 |
|
18514 |
|
18515 | picomatch.scan = (input, options) => scan(input, options);
|
18516 |
|
18517 |
|
18518 |
|
18519 |
|
18520 |
|
18521 |
|
18522 |
|
18523 |
|
18524 |
|
18525 |
|
18526 |
|
18527 |
|
18528 |
|
18529 |
|
18530 |
|
18531 |
|
18532 |
|
18533 |
|
18534 | picomatch.compileRe = (parsed, options, returnOutput = false, returnState = false) => {
|
18535 | if (returnOutput === true) {
|
18536 | return parsed.output;
|
18537 | }
|
18538 |
|
18539 | const opts = options || {};
|
18540 | const prepend = opts.contains ? '' : '^';
|
18541 | const append = opts.contains ? '' : '$';
|
18542 |
|
18543 | let source = `${prepend}(?:${parsed.output})${append}`;
|
18544 | if (parsed && parsed.negated === true) {
|
18545 | source = `^(?!${source}).*$`;
|
18546 | }
|
18547 |
|
18548 | const regex = picomatch.toRegex(source, options);
|
18549 | if (returnState === true) {
|
18550 | regex.state = parsed;
|
18551 | }
|
18552 |
|
18553 | return regex;
|
18554 | };
|
18555 |
|
18556 | picomatch.makeRe = (input, options, returnOutput = false, returnState = false) => {
|
18557 | if (!input || typeof input !== 'string') {
|
18558 | throw new TypeError('Expected a non-empty string');
|
18559 | }
|
18560 |
|
18561 | const opts = options || {};
|
18562 | let parsed = { negated: false, fastpaths: true };
|
18563 | let prefix = '';
|
18564 | let output;
|
18565 |
|
18566 | if (input.startsWith('./')) {
|
18567 | input = input.slice(2);
|
18568 | prefix = parsed.prefix = './';
|
18569 | }
|
18570 |
|
18571 | if (opts.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
|
18572 | output = parse.fastpaths(input, options);
|
18573 | }
|
18574 |
|
18575 | if (output === undefined) {
|
18576 | parsed = parse(input, options);
|
18577 | parsed.prefix = prefix + (parsed.prefix || '');
|
18578 | } else {
|
18579 | parsed.output = output;
|
18580 | }
|
18581 |
|
18582 | return picomatch.compileRe(parsed, options, returnOutput, returnState);
|
18583 | };
|
18584 |
|
18585 |
|
18586 |
|
18587 |
|
18588 |
|
18589 |
|
18590 |
|
18591 |
|
18592 |
|
18593 |
|
18594 |
|
18595 |
|
18596 |
|
18597 |
|
18598 |
|
18599 |
|
18600 |
|
18601 |
|
18602 | picomatch.toRegex = (source, options) => {
|
18603 | try {
|
18604 | const opts = options || {};
|
18605 | return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
|
18606 | } catch (err) {
|
18607 | if (options && options.debug === true) throw err;
|
18608 | return /$^/;
|
18609 | }
|
18610 | };
|
18611 |
|
18612 |
|
18613 |
|
18614 |
|
18615 |
|
18616 |
|
18617 | picomatch.constants = constants;
|
18618 |
|
18619 |
|
18620 |
|
18621 |
|
18622 |
|
18623 | module.exports = picomatch;
|
18624 |
|
18625 |
|
18626 | }),
|
18627 |
|
18628 | (function(module, exports, __webpack_require__) {
|
18629 |
|
18630 | "use strict";
|
18631 |
|
18632 |
|
18633 | const utils = __webpack_require__(91);
|
18634 | const {
|
18635 | CHAR_ASTERISK,
|
18636 | CHAR_AT,
|
18637 | CHAR_BACKWARD_SLASH,
|
18638 | CHAR_COMMA,
|
18639 | CHAR_DOT,
|
18640 | CHAR_EXCLAMATION_MARK,
|
18641 | CHAR_FORWARD_SLASH,
|
18642 | CHAR_LEFT_CURLY_BRACE,
|
18643 | CHAR_LEFT_PARENTHESES,
|
18644 | CHAR_LEFT_SQUARE_BRACKET,
|
18645 | CHAR_PLUS,
|
18646 | CHAR_QUESTION_MARK,
|
18647 | CHAR_RIGHT_CURLY_BRACE,
|
18648 | CHAR_RIGHT_PARENTHESES,
|
18649 | CHAR_RIGHT_SQUARE_BRACKET
|
18650 | } = __webpack_require__(92);
|
18651 |
|
18652 | const isPathSeparator = code => {
|
18653 | return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
18654 | };
|
18655 |
|
18656 | const depth = token => {
|
18657 | if (token.isPrefix !== true) {
|
18658 | token.depth = token.isGlobstar ? Infinity : 1;
|
18659 | }
|
18660 | };
|
18661 |
|
18662 |
|
18663 |
|
18664 |
|
18665 |
|
18666 |
|
18667 |
|
18668 |
|
18669 |
|
18670 |
|
18671 |
|
18672 |
|
18673 |
|
18674 |
|
18675 |
|
18676 |
|
18677 |
|
18678 | const scan = (input, options) => {
|
18679 | const opts = options || {};
|
18680 |
|
18681 | const length = input.length - 1;
|
18682 | const scanToEnd = opts.parts === true || opts.scanToEnd === true;
|
18683 | const slashes = [];
|
18684 | const tokens = [];
|
18685 | const parts = [];
|
18686 |
|
18687 | let str = input;
|
18688 | let index = -1;
|
18689 | let start = 0;
|
18690 | let lastIndex = 0;
|
18691 | let isBrace = false;
|
18692 | let isBracket = false;
|
18693 | let isGlob = false;
|
18694 | let isExtglob = false;
|
18695 | let isGlobstar = false;
|
18696 | let braceEscaped = false;
|
18697 | let backslashes = false;
|
18698 | let negated = false;
|
18699 | let finished = false;
|
18700 | let braces = 0;
|
18701 | let prev;
|
18702 | let code;
|
18703 | let token = { value: '', depth: 0, isGlob: false };
|
18704 |
|
18705 | const eos = () => index >= length;
|
18706 | const peek = () => str.charCodeAt(index + 1);
|
18707 | const advance = () => {
|
18708 | prev = code;
|
18709 | return str.charCodeAt(++index);
|
18710 | };
|
18711 |
|
18712 | while (index < length) {
|
18713 | code = advance();
|
18714 | let next;
|
18715 |
|
18716 | if (code === CHAR_BACKWARD_SLASH) {
|
18717 | backslashes = token.backslashes = true;
|
18718 | code = advance();
|
18719 |
|
18720 | if (code === CHAR_LEFT_CURLY_BRACE) {
|
18721 | braceEscaped = true;
|
18722 | }
|
18723 | continue;
|
18724 | }
|
18725 |
|
18726 | if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
|
18727 | braces++;
|
18728 |
|
18729 | while (eos() !== true && (code = advance())) {
|
18730 | if (code === CHAR_BACKWARD_SLASH) {
|
18731 | backslashes = token.backslashes = true;
|
18732 | advance();
|
18733 | continue;
|
18734 | }
|
18735 |
|
18736 | if (code === CHAR_LEFT_CURLY_BRACE) {
|
18737 | braces++;
|
18738 | continue;
|
18739 | }
|
18740 |
|
18741 | if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
|
18742 | isBrace = token.isBrace = true;
|
18743 | isGlob = token.isGlob = true;
|
18744 | finished = true;
|
18745 |
|
18746 | if (scanToEnd === true) {
|
18747 | continue;
|
18748 | }
|
18749 |
|
18750 | break;
|
18751 | }
|
18752 |
|
18753 | if (braceEscaped !== true && code === CHAR_COMMA) {
|
18754 | isBrace = token.isBrace = true;
|
18755 | isGlob = token.isGlob = true;
|
18756 | finished = true;
|
18757 |
|
18758 | if (scanToEnd === true) {
|
18759 | continue;
|
18760 | }
|
18761 |
|
18762 | break;
|
18763 | }
|
18764 |
|
18765 | if (code === CHAR_RIGHT_CURLY_BRACE) {
|
18766 | braces--;
|
18767 |
|
18768 | if (braces === 0) {
|
18769 | braceEscaped = false;
|
18770 | isBrace = token.isBrace = true;
|
18771 | finished = true;
|
18772 | break;
|
18773 | }
|
18774 | }
|
18775 | }
|
18776 |
|
18777 | if (scanToEnd === true) {
|
18778 | continue;
|
18779 | }
|
18780 |
|
18781 | break;
|
18782 | }
|
18783 |
|
18784 | if (code === CHAR_FORWARD_SLASH) {
|
18785 | slashes.push(index);
|
18786 | tokens.push(token);
|
18787 | token = { value: '', depth: 0, isGlob: false };
|
18788 |
|
18789 | if (finished === true) continue;
|
18790 | if (prev === CHAR_DOT && index === (start + 1)) {
|
18791 | start += 2;
|
18792 | continue;
|
18793 | }
|
18794 |
|
18795 | lastIndex = index + 1;
|
18796 | continue;
|
18797 | }
|
18798 |
|
18799 | if (opts.noext !== true) {
|
18800 | const isExtglobChar = code === CHAR_PLUS
|
18801 | || code === CHAR_AT
|
18802 | || code === CHAR_ASTERISK
|
18803 | || code === CHAR_QUESTION_MARK
|
18804 | || code === CHAR_EXCLAMATION_MARK;
|
18805 |
|
18806 | if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
|
18807 | isGlob = token.isGlob = true;
|
18808 | isExtglob = token.isExtglob = true;
|
18809 | finished = true;
|
18810 |
|
18811 | if (scanToEnd === true) {
|
18812 | while (eos() !== true && (code = advance())) {
|
18813 | if (code === CHAR_BACKWARD_SLASH) {
|
18814 | backslashes = token.backslashes = true;
|
18815 | code = advance();
|
18816 | continue;
|
18817 | }
|
18818 |
|
18819 | if (code === CHAR_RIGHT_PARENTHESES) {
|
18820 | isGlob = token.isGlob = true;
|
18821 | finished = true;
|
18822 | break;
|
18823 | }
|
18824 | }
|
18825 | continue;
|
18826 | }
|
18827 | break;
|
18828 | }
|
18829 | }
|
18830 |
|
18831 | if (code === CHAR_ASTERISK) {
|
18832 | if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
|
18833 | isGlob = token.isGlob = true;
|
18834 | finished = true;
|
18835 |
|
18836 | if (scanToEnd === true) {
|
18837 | continue;
|
18838 | }
|
18839 | break;
|
18840 | }
|
18841 |
|
18842 | if (code === CHAR_QUESTION_MARK) {
|
18843 | isGlob = token.isGlob = true;
|
18844 | finished = true;
|
18845 |
|
18846 | if (scanToEnd === true) {
|
18847 | continue;
|
18848 | }
|
18849 | break;
|
18850 | }
|
18851 |
|
18852 | if (code === CHAR_LEFT_SQUARE_BRACKET) {
|
18853 | while (eos() !== true && (next = advance())) {
|
18854 | if (next === CHAR_BACKWARD_SLASH) {
|
18855 | backslashes = token.backslashes = true;
|
18856 | advance();
|
18857 | continue;
|
18858 | }
|
18859 |
|
18860 | if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
18861 | isBracket = token.isBracket = true;
|
18862 | isGlob = token.isGlob = true;
|
18863 | finished = true;
|
18864 |
|
18865 | if (scanToEnd === true) {
|
18866 | continue;
|
18867 | }
|
18868 | break;
|
18869 | }
|
18870 | }
|
18871 | }
|
18872 |
|
18873 | if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
|
18874 | negated = token.negated = true;
|
18875 | start++;
|
18876 | continue;
|
18877 | }
|
18878 |
|
18879 | if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
|
18880 | isGlob = token.isGlob = true;
|
18881 |
|
18882 | if (scanToEnd === true) {
|
18883 | while (eos() !== true && (code = advance())) {
|
18884 | if (code === CHAR_LEFT_PARENTHESES) {
|
18885 | backslashes = token.backslashes = true;
|
18886 | code = advance();
|
18887 | continue;
|
18888 | }
|
18889 |
|
18890 | if (code === CHAR_RIGHT_PARENTHESES) {
|
18891 | finished = true;
|
18892 | break;
|
18893 | }
|
18894 | }
|
18895 | continue;
|
18896 | }
|
18897 | break;
|
18898 | }
|
18899 |
|
18900 | if (isGlob === true) {
|
18901 | finished = true;
|
18902 |
|
18903 | if (scanToEnd === true) {
|
18904 | continue;
|
18905 | }
|
18906 |
|
18907 | break;
|
18908 | }
|
18909 | }
|
18910 |
|
18911 | if (opts.noext === true) {
|
18912 | isExtglob = false;
|
18913 | isGlob = false;
|
18914 | }
|
18915 |
|
18916 | let base = str;
|
18917 | let prefix = '';
|
18918 | let glob = '';
|
18919 |
|
18920 | if (start > 0) {
|
18921 | prefix = str.slice(0, start);
|
18922 | str = str.slice(start);
|
18923 | lastIndex -= start;
|
18924 | }
|
18925 |
|
18926 | if (base && isGlob === true && lastIndex > 0) {
|
18927 | base = str.slice(0, lastIndex);
|
18928 | glob = str.slice(lastIndex);
|
18929 | } else if (isGlob === true) {
|
18930 | base = '';
|
18931 | glob = str;
|
18932 | } else {
|
18933 | base = str;
|
18934 | }
|
18935 |
|
18936 | if (base && base !== '' && base !== '/' && base !== str) {
|
18937 | if (isPathSeparator(base.charCodeAt(base.length - 1))) {
|
18938 | base = base.slice(0, -1);
|
18939 | }
|
18940 | }
|
18941 |
|
18942 | if (opts.unescape === true) {
|
18943 | if (glob) glob = utils.removeBackslashes(glob);
|
18944 |
|
18945 | if (base && backslashes === true) {
|
18946 | base = utils.removeBackslashes(base);
|
18947 | }
|
18948 | }
|
18949 |
|
18950 | const state = {
|
18951 | prefix,
|
18952 | input,
|
18953 | start,
|
18954 | base,
|
18955 | glob,
|
18956 | isBrace,
|
18957 | isBracket,
|
18958 | isGlob,
|
18959 | isExtglob,
|
18960 | isGlobstar,
|
18961 | negated
|
18962 | };
|
18963 |
|
18964 | if (opts.tokens === true) {
|
18965 | state.maxDepth = 0;
|
18966 | if (!isPathSeparator(code)) {
|
18967 | tokens.push(token);
|
18968 | }
|
18969 | state.tokens = tokens;
|
18970 | }
|
18971 |
|
18972 | if (opts.parts === true || opts.tokens === true) {
|
18973 | let prevIndex;
|
18974 |
|
18975 | for (let idx = 0; idx < slashes.length; idx++) {
|
18976 | const n = prevIndex ? prevIndex + 1 : start;
|
18977 | const i = slashes[idx];
|
18978 | const value = input.slice(n, i);
|
18979 | if (opts.tokens) {
|
18980 | if (idx === 0 && start !== 0) {
|
18981 | tokens[idx].isPrefix = true;
|
18982 | tokens[idx].value = prefix;
|
18983 | } else {
|
18984 | tokens[idx].value = value;
|
18985 | }
|
18986 | depth(tokens[idx]);
|
18987 | state.maxDepth += tokens[idx].depth;
|
18988 | }
|
18989 | if (idx !== 0 || value !== '') {
|
18990 | parts.push(value);
|
18991 | }
|
18992 | prevIndex = i;
|
18993 | }
|
18994 |
|
18995 | if (prevIndex && prevIndex + 1 < input.length) {
|
18996 | const value = input.slice(prevIndex + 1);
|
18997 | parts.push(value);
|
18998 |
|
18999 | if (opts.tokens) {
|
19000 | tokens[tokens.length - 1].value = value;
|
19001 | depth(tokens[tokens.length - 1]);
|
19002 | state.maxDepth += tokens[tokens.length - 1].depth;
|
19003 | }
|
19004 | }
|
19005 |
|
19006 | state.slashes = slashes;
|
19007 | state.parts = parts;
|
19008 | }
|
19009 |
|
19010 | return state;
|
19011 | };
|
19012 |
|
19013 | module.exports = scan;
|
19014 |
|
19015 |
|
19016 | }),
|
19017 |
|
19018 | (function(module, exports, __webpack_require__) {
|
19019 |
|
19020 | "use strict";
|
19021 |
|
19022 |
|
19023 | const path = __webpack_require__(13);
|
19024 | const win32 = process.platform === 'win32';
|
19025 | const {
|
19026 | REGEX_BACKSLASH,
|
19027 | REGEX_REMOVE_BACKSLASH,
|
19028 | REGEX_SPECIAL_CHARS,
|
19029 | REGEX_SPECIAL_CHARS_GLOBAL
|
19030 | } = __webpack_require__(92);
|
19031 |
|
19032 | exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
|
19033 | exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
|
19034 | exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);
|
19035 | exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
|
19036 | exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');
|
19037 |
|
19038 | exports.removeBackslashes = str => {
|
19039 | return str.replace(REGEX_REMOVE_BACKSLASH, match => {
|
19040 | return match === '\\' ? '' : match;
|
19041 | });
|
19042 | };
|
19043 |
|
19044 | exports.supportsLookbehinds = () => {
|
19045 | const segs = process.version.slice(1).split('.').map(Number);
|
19046 | if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) {
|
19047 | return true;
|
19048 | }
|
19049 | return false;
|
19050 | };
|
19051 |
|
19052 | exports.isWindows = options => {
|
19053 | if (options && typeof options.windows === 'boolean') {
|
19054 | return options.windows;
|
19055 | }
|
19056 | return win32 === true || path.sep === '\\';
|
19057 | };
|
19058 |
|
19059 | exports.escapeLast = (input, char, lastIdx) => {
|
19060 | const idx = input.lastIndexOf(char, lastIdx);
|
19061 | if (idx === -1) return input;
|
19062 | if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1);
|
19063 | return `${input.slice(0, idx)}\\${input.slice(idx)}`;
|
19064 | };
|
19065 |
|
19066 | exports.removePrefix = (input, state = {}) => {
|
19067 | let output = input;
|
19068 | if (output.startsWith('./')) {
|
19069 | output = output.slice(2);
|
19070 | state.prefix = './';
|
19071 | }
|
19072 | return output;
|
19073 | };
|
19074 |
|
19075 | exports.wrapOutput = (input, state = {}, options = {}) => {
|
19076 | const prepend = options.contains ? '' : '^';
|
19077 | const append = options.contains ? '' : '$';
|
19078 |
|
19079 | let output = `${prepend}(?:${input})${append}`;
|
19080 | if (state.negated === true) {
|
19081 | output = `(?:^(?!${output}).*$)`;
|
19082 | }
|
19083 | return output;
|
19084 | };
|
19085 |
|
19086 |
|
19087 | }),
|
19088 |
|
19089 | (function(module, exports, __webpack_require__) {
|
19090 |
|
19091 | "use strict";
|
19092 |
|
19093 |
|
19094 | const path = __webpack_require__(13);
|
19095 | const WIN_SLASH = '\\\\/';
|
19096 | const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
19097 |
|
19098 |
|
19099 |
|
19100 |
|
19101 |
|
19102 | const DOT_LITERAL = '\\.';
|
19103 | const PLUS_LITERAL = '\\+';
|
19104 | const QMARK_LITERAL = '\\?';
|
19105 | const SLASH_LITERAL = '\\/';
|
19106 | const ONE_CHAR = '(?=.)';
|
19107 | const QMARK = '[^/]';
|
19108 | const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
|
19109 | const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
|
19110 | const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
|
19111 | const NO_DOT = `(?!${DOT_LITERAL})`;
|
19112 | const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
|
19113 | const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
|
19114 | const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
|
19115 | const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
|
19116 | const STAR = `${QMARK}*?`;
|
19117 |
|
19118 | const POSIX_CHARS = {
|
19119 | DOT_LITERAL,
|
19120 | PLUS_LITERAL,
|
19121 | QMARK_LITERAL,
|
19122 | SLASH_LITERAL,
|
19123 | ONE_CHAR,
|
19124 | QMARK,
|
19125 | END_ANCHOR,
|
19126 | DOTS_SLASH,
|
19127 | NO_DOT,
|
19128 | NO_DOTS,
|
19129 | NO_DOT_SLASH,
|
19130 | NO_DOTS_SLASH,
|
19131 | QMARK_NO_DOT,
|
19132 | STAR,
|
19133 | START_ANCHOR
|
19134 | };
|
19135 |
|
19136 |
|
19137 |
|
19138 |
|
19139 |
|
19140 | const WINDOWS_CHARS = {
|
19141 | ...POSIX_CHARS,
|
19142 |
|
19143 | SLASH_LITERAL: `[${WIN_SLASH}]`,
|
19144 | QMARK: WIN_NO_SLASH,
|
19145 | STAR: `${WIN_NO_SLASH}*?`,
|
19146 | DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
|
19147 | NO_DOT: `(?!${DOT_LITERAL})`,
|
19148 | NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
19149 | NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
|
19150 | NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
19151 | QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
|
19152 | START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
|
19153 | END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
|
19154 | };
|
19155 |
|
19156 |
|
19157 |
|
19158 |
|
19159 |
|
19160 | const POSIX_REGEX_SOURCE = {
|
19161 | alnum: 'a-zA-Z0-9',
|
19162 | alpha: 'a-zA-Z',
|
19163 | ascii: '\\x00-\\x7F',
|
19164 | blank: ' \\t',
|
19165 | cntrl: '\\x00-\\x1F\\x7F',
|
19166 | digit: '0-9',
|
19167 | graph: '\\x21-\\x7E',
|
19168 | lower: 'a-z',
|
19169 | print: '\\x20-\\x7E ',
|
19170 | punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
|
19171 | space: ' \\t\\r\\n\\v\\f',
|
19172 | upper: 'A-Z',
|
19173 | word: 'A-Za-z0-9_',
|
19174 | xdigit: 'A-Fa-f0-9'
|
19175 | };
|
19176 |
|
19177 | module.exports = {
|
19178 | MAX_LENGTH: 1024 * 64,
|
19179 | POSIX_REGEX_SOURCE,
|
19180 |
|
19181 |
|
19182 | REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
19183 | REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
19184 | REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
|
19185 | REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
|
19186 | REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
|
19187 | REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
19188 |
|
19189 |
|
19190 | REPLACEMENTS: {
|
19191 | '***': '*',
|
19192 | '**/**': '**',
|
19193 | '**/**/**': '**'
|
19194 | },
|
19195 |
|
19196 |
|
19197 | CHAR_0: 48,
|
19198 | CHAR_9: 57,
|
19199 |
|
19200 |
|
19201 | CHAR_UPPERCASE_A: 65,
|
19202 | CHAR_LOWERCASE_A: 97,
|
19203 | CHAR_UPPERCASE_Z: 90,
|
19204 | CHAR_LOWERCASE_Z: 122,
|
19205 |
|
19206 | CHAR_LEFT_PARENTHESES: 40,
|
19207 | CHAR_RIGHT_PARENTHESES: 41,
|
19208 |
|
19209 | CHAR_ASTERISK: 42,
|
19210 |
|
19211 |
|
19212 | CHAR_AMPERSAND: 38,
|
19213 | CHAR_AT: 64,
|
19214 | CHAR_BACKWARD_SLASH: 92,
|
19215 | CHAR_CARRIAGE_RETURN: 13,
|
19216 | CHAR_CIRCUMFLEX_ACCENT: 94,
|
19217 | CHAR_COLON: 58,
|
19218 | CHAR_COMMA: 44,
|
19219 | CHAR_DOT: 46,
|
19220 | CHAR_DOUBLE_QUOTE: 34,
|
19221 | CHAR_EQUAL: 61,
|
19222 | CHAR_EXCLAMATION_MARK: 33,
|
19223 | CHAR_FORM_FEED: 12,
|
19224 | CHAR_FORWARD_SLASH: 47,
|
19225 | CHAR_GRAVE_ACCENT: 96,
|
19226 | CHAR_HASH: 35,
|
19227 | CHAR_HYPHEN_MINUS: 45,
|
19228 | CHAR_LEFT_ANGLE_BRACKET: 60,
|
19229 | CHAR_LEFT_CURLY_BRACE: 123,
|
19230 | CHAR_LEFT_SQUARE_BRACKET: 91,
|
19231 | CHAR_LINE_FEED: 10,
|
19232 | CHAR_NO_BREAK_SPACE: 160,
|
19233 | CHAR_PERCENT: 37,
|
19234 | CHAR_PLUS: 43,
|
19235 | CHAR_QUESTION_MARK: 63,
|
19236 | CHAR_RIGHT_ANGLE_BRACKET: 62,
|
19237 | CHAR_RIGHT_CURLY_BRACE: 125,
|
19238 | CHAR_RIGHT_SQUARE_BRACKET: 93,
|
19239 | CHAR_SEMICOLON: 59,
|
19240 | CHAR_SINGLE_QUOTE: 39,
|
19241 | CHAR_SPACE: 32,
|
19242 | CHAR_TAB: 9,
|
19243 | CHAR_UNDERSCORE: 95,
|
19244 | CHAR_VERTICAL_LINE: 124,
|
19245 | CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
19246 |
|
19247 | SEP: path.sep,
|
19248 |
|
19249 | |
19250 |
|
19251 |
|
19252 |
|
19253 | extglobChars(chars) {
|
19254 | return {
|
19255 | '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` },
|
19256 | '?': { type: 'qmark', open: '(?:', close: ')?' },
|
19257 | '+': { type: 'plus', open: '(?:', close: ')+' },
|
19258 | '*': { type: 'star', open: '(?:', close: ')*' },
|
19259 | '@': { type: 'at', open: '(?:', close: ')' }
|
19260 | };
|
19261 | },
|
19262 |
|
19263 | |
19264 |
|
19265 |
|
19266 |
|
19267 | globChars(win32) {
|
19268 | return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
|
19269 | }
|
19270 | };
|
19271 |
|
19272 |
|
19273 | }),
|
19274 |
|
19275 | (function(module, exports, __webpack_require__) {
|
19276 |
|
19277 | "use strict";
|
19278 |
|
19279 |
|
19280 | const constants = __webpack_require__(92);
|
19281 | const utils = __webpack_require__(91);
|
19282 |
|
19283 |
|
19284 |
|
19285 |
|
19286 |
|
19287 | const {
|
19288 | MAX_LENGTH,
|
19289 | POSIX_REGEX_SOURCE,
|
19290 | REGEX_NON_SPECIAL_CHARS,
|
19291 | REGEX_SPECIAL_CHARS_BACKREF,
|
19292 | REPLACEMENTS
|
19293 | } = constants;
|
19294 |
|
19295 |
|
19296 |
|
19297 |
|
19298 |
|
19299 | const expandRange = (args, options) => {
|
19300 | if (typeof options.expandRange === 'function') {
|
19301 | return options.expandRange(...args, options);
|
19302 | }
|
19303 |
|
19304 | args.sort();
|
19305 | const value = `[${args.join('-')}]`;
|
19306 |
|
19307 | try {
|
19308 |
|
19309 | new RegExp(value);
|
19310 | } catch (ex) {
|
19311 | return args.map(v => utils.escapeRegex(v)).join('..');
|
19312 | }
|
19313 |
|
19314 | return value;
|
19315 | };
|
19316 |
|
19317 |
|
19318 |
|
19319 |
|
19320 |
|
19321 | const syntaxError = (type, char) => {
|
19322 | return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
19323 | };
|
19324 |
|
19325 |
|
19326 |
|
19327 |
|
19328 |
|
19329 |
|
19330 |
|
19331 |
|
19332 | const parse = (input, options) => {
|
19333 | if (typeof input !== 'string') {
|
19334 | throw new TypeError('Expected a string');
|
19335 | }
|
19336 |
|
19337 | input = REPLACEMENTS[input] || input;
|
19338 |
|
19339 | const opts = { ...options };
|
19340 | const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
19341 |
|
19342 | let len = input.length;
|
19343 | if (len > max) {
|
19344 | throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
19345 | }
|
19346 |
|
19347 | const bos = { type: 'bos', value: '', output: opts.prepend || '' };
|
19348 | const tokens = [bos];
|
19349 |
|
19350 | const capture = opts.capture ? '' : '?:';
|
19351 | const win32 = utils.isWindows(options);
|
19352 |
|
19353 |
|
19354 | const PLATFORM_CHARS = constants.globChars(win32);
|
19355 | const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
|
19356 |
|
19357 | const {
|
19358 | DOT_LITERAL,
|
19359 | PLUS_LITERAL,
|
19360 | SLASH_LITERAL,
|
19361 | ONE_CHAR,
|
19362 | DOTS_SLASH,
|
19363 | NO_DOT,
|
19364 | NO_DOT_SLASH,
|
19365 | NO_DOTS_SLASH,
|
19366 | QMARK,
|
19367 | QMARK_NO_DOT,
|
19368 | STAR,
|
19369 | START_ANCHOR
|
19370 | } = PLATFORM_CHARS;
|
19371 |
|
19372 | const globstar = (opts) => {
|
19373 | return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
19374 | };
|
19375 |
|
19376 | const nodot = opts.dot ? '' : NO_DOT;
|
19377 | const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
|
19378 | let star = opts.bash === true ? globstar(opts) : STAR;
|
19379 |
|
19380 | if (opts.capture) {
|
19381 | star = `(${star})`;
|
19382 | }
|
19383 |
|
19384 |
|
19385 | if (typeof opts.noext === 'boolean') {
|
19386 | opts.noextglob = opts.noext;
|
19387 | }
|
19388 |
|
19389 | const state = {
|
19390 | input,
|
19391 | index: -1,
|
19392 | start: 0,
|
19393 | dot: opts.dot === true,
|
19394 | consumed: '',
|
19395 | output: '',
|
19396 | prefix: '',
|
19397 | backtrack: false,
|
19398 | negated: false,
|
19399 | brackets: 0,
|
19400 | braces: 0,
|
19401 | parens: 0,
|
19402 | quotes: 0,
|
19403 | globstar: false,
|
19404 | tokens
|
19405 | };
|
19406 |
|
19407 | input = utils.removePrefix(input, state);
|
19408 | len = input.length;
|
19409 |
|
19410 | const extglobs = [];
|
19411 | const braces = [];
|
19412 | const stack = [];
|
19413 | let prev = bos;
|
19414 | let value;
|
19415 |
|
19416 | |
19417 |
|
19418 |
|
19419 |
|
19420 | const eos = () => state.index === len - 1;
|
19421 | const peek = state.peek = (n = 1) => input[state.index + n];
|
19422 | const advance = state.advance = () => input[++state.index];
|
19423 | const remaining = () => input.slice(state.index + 1);
|
19424 | const consume = (value = '', num = 0) => {
|
19425 | state.consumed += value;
|
19426 | state.index += num;
|
19427 | };
|
19428 | const append = token => {
|
19429 | state.output += token.output != null ? token.output : token.value;
|
19430 | consume(token.value);
|
19431 | };
|
19432 |
|
19433 | const negate = () => {
|
19434 | let count = 1;
|
19435 |
|
19436 | while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {
|
19437 | advance();
|
19438 | state.start++;
|
19439 | count++;
|
19440 | }
|
19441 |
|
19442 | if (count % 2 === 0) {
|
19443 | return false;
|
19444 | }
|
19445 |
|
19446 | state.negated = true;
|
19447 | state.start++;
|
19448 | return true;
|
19449 | };
|
19450 |
|
19451 | const increment = type => {
|
19452 | state[type]++;
|
19453 | stack.push(type);
|
19454 | };
|
19455 |
|
19456 | const decrement = type => {
|
19457 | state[type]--;
|
19458 | stack.pop();
|
19459 | };
|
19460 |
|
19461 | |
19462 |
|
19463 |
|
19464 |
|
19465 |
|
19466 |
|
19467 |
|
19468 |
|
19469 | const push = tok => {
|
19470 | if (prev.type === 'globstar') {
|
19471 | const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');
|
19472 | const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren'));
|
19473 |
|
19474 | if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {
|
19475 | state.output = state.output.slice(0, -prev.output.length);
|
19476 | prev.type = 'star';
|
19477 | prev.value = '*';
|
19478 | prev.output = star;
|
19479 | state.output += prev.output;
|
19480 | }
|
19481 | }
|
19482 |
|
19483 | if (extglobs.length && tok.type !== 'paren' && !EXTGLOB_CHARS[tok.value]) {
|
19484 | extglobs[extglobs.length - 1].inner += tok.value;
|
19485 | }
|
19486 |
|
19487 | if (tok.value || tok.output) append(tok);
|
19488 | if (prev && prev.type === 'text' && tok.type === 'text') {
|
19489 | prev.value += tok.value;
|
19490 | prev.output = (prev.output || '') + tok.value;
|
19491 | return;
|
19492 | }
|
19493 |
|
19494 | tok.prev = prev;
|
19495 | tokens.push(tok);
|
19496 | prev = tok;
|
19497 | };
|
19498 |
|
19499 | const extglobOpen = (type, value) => {
|
19500 | const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' };
|
19501 |
|
19502 | token.prev = prev;
|
19503 | token.parens = state.parens;
|
19504 | token.output = state.output;
|
19505 | const output = (opts.capture ? '(' : '') + token.open;
|
19506 |
|
19507 | increment('parens');
|
19508 | push({ type, value, output: state.output ? '' : ONE_CHAR });
|
19509 | push({ type: 'paren', extglob: true, value: advance(), output });
|
19510 | extglobs.push(token);
|
19511 | };
|
19512 |
|
19513 | const extglobClose = token => {
|
19514 | let output = token.close + (opts.capture ? ')' : '');
|
19515 |
|
19516 | if (token.type === 'negate') {
|
19517 | let extglobStar = star;
|
19518 |
|
19519 | if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {
|
19520 | extglobStar = globstar(opts);
|
19521 | }
|
19522 |
|
19523 | if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
|
19524 | output = token.close = `)$))${extglobStar}`;
|
19525 | }
|
19526 |
|
19527 | if (token.prev.type === 'bos' && eos()) {
|
19528 | state.negatedExtglob = true;
|
19529 | }
|
19530 | }
|
19531 |
|
19532 | push({ type: 'paren', extglob: true, value, output });
|
19533 | decrement('parens');
|
19534 | };
|
19535 |
|
19536 | |
19537 |
|
19538 |
|
19539 |
|
19540 | if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
19541 | let backslashes = false;
|
19542 |
|
19543 | let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
|
19544 | if (first === '\\') {
|
19545 | backslashes = true;
|
19546 | return m;
|
19547 | }
|
19548 |
|
19549 | if (first === '?') {
|
19550 | if (esc) {
|
19551 | return esc + first + (rest ? QMARK.repeat(rest.length) : '');
|
19552 | }
|
19553 | if (index === 0) {
|
19554 | return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');
|
19555 | }
|
19556 | return QMARK.repeat(chars.length);
|
19557 | }
|
19558 |
|
19559 | if (first === '.') {
|
19560 | return DOT_LITERAL.repeat(chars.length);
|
19561 | }
|
19562 |
|
19563 | if (first === '*') {
|
19564 | if (esc) {
|
19565 | return esc + first + (rest ? star : '');
|
19566 | }
|
19567 | return star;
|
19568 | }
|
19569 | return esc ? m : `\\${m}`;
|
19570 | });
|
19571 |
|
19572 | if (backslashes === true) {
|
19573 | if (opts.unescape === true) {
|
19574 | output = output.replace(/\\/g, '');
|
19575 | } else {
|
19576 | output = output.replace(/\\+/g, m => {
|
19577 | return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : '');
|
19578 | });
|
19579 | }
|
19580 | }
|
19581 |
|
19582 | if (output === input && opts.contains === true) {
|
19583 | state.output = input;
|
19584 | return state;
|
19585 | }
|
19586 |
|
19587 | state.output = utils.wrapOutput(output, state, options);
|
19588 | return state;
|
19589 | }
|
19590 |
|
19591 | |
19592 |
|
19593 |
|
19594 |
|
19595 | while (!eos()) {
|
19596 | value = advance();
|
19597 |
|
19598 | if (value === '\u0000') {
|
19599 | continue;
|
19600 | }
|
19601 |
|
19602 | |
19603 |
|
19604 |
|
19605 |
|
19606 | if (value === '\\') {
|
19607 | const next = peek();
|
19608 |
|
19609 | if (next === '/' && opts.bash !== true) {
|
19610 | continue;
|
19611 | }
|
19612 |
|
19613 | if (next === '.' || next === ';') {
|
19614 | continue;
|
19615 | }
|
19616 |
|
19617 | if (!next) {
|
19618 | value += '\\';
|
19619 | push({ type: 'text', value });
|
19620 | continue;
|
19621 | }
|
19622 |
|
19623 |
|
19624 | const match = /^\\+/.exec(remaining());
|
19625 | let slashes = 0;
|
19626 |
|
19627 | if (match && match[0].length > 2) {
|
19628 | slashes = match[0].length;
|
19629 | state.index += slashes;
|
19630 | if (slashes % 2 !== 0) {
|
19631 | value += '\\';
|
19632 | }
|
19633 | }
|
19634 |
|
19635 | if (opts.unescape === true) {
|
19636 | value = advance() || '';
|
19637 | } else {
|
19638 | value += advance() || '';
|
19639 | }
|
19640 |
|
19641 | if (state.brackets === 0) {
|
19642 | push({ type: 'text', value });
|
19643 | continue;
|
19644 | }
|
19645 | }
|
19646 |
|
19647 | |
19648 |
|
19649 |
|
19650 |
|
19651 |
|
19652 | if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {
|
19653 | if (opts.posix !== false && value === ':') {
|
19654 | const inner = prev.value.slice(1);
|
19655 | if (inner.includes('[')) {
|
19656 | prev.posix = true;
|
19657 |
|
19658 | if (inner.includes(':')) {
|
19659 | const idx = prev.value.lastIndexOf('[');
|
19660 | const pre = prev.value.slice(0, idx);
|
19661 | const rest = prev.value.slice(idx + 2);
|
19662 | const posix = POSIX_REGEX_SOURCE[rest];
|
19663 | if (posix) {
|
19664 | prev.value = pre + posix;
|
19665 | state.backtrack = true;
|
19666 | advance();
|
19667 |
|
19668 | if (!bos.output && tokens.indexOf(prev) === 1) {
|
19669 | bos.output = ONE_CHAR;
|
19670 | }
|
19671 | continue;
|
19672 | }
|
19673 | }
|
19674 | }
|
19675 | }
|
19676 |
|
19677 | if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) {
|
19678 | value = `\\${value}`;
|
19679 | }
|
19680 |
|
19681 | if (value === ']' && (prev.value === '[' || prev.value === '[^')) {
|
19682 | value = `\\${value}`;
|
19683 | }
|
19684 |
|
19685 | if (opts.posix === true && value === '!' && prev.value === '[') {
|
19686 | value = '^';
|
19687 | }
|
19688 |
|
19689 | prev.value += value;
|
19690 | append({ value });
|
19691 | continue;
|
19692 | }
|
19693 |
|
19694 | |
19695 |
|
19696 |
|
19697 |
|
19698 |
|
19699 | if (state.quotes === 1 && value !== '"') {
|
19700 | value = utils.escapeRegex(value);
|
19701 | prev.value += value;
|
19702 | append({ value });
|
19703 | continue;
|
19704 | }
|
19705 |
|
19706 | |
19707 |
|
19708 |
|
19709 |
|
19710 | if (value === '"') {
|
19711 | state.quotes = state.quotes === 1 ? 0 : 1;
|
19712 | if (opts.keepQuotes === true) {
|
19713 | push({ type: 'text', value });
|
19714 | }
|
19715 | continue;
|
19716 | }
|
19717 |
|
19718 | |
19719 |
|
19720 |
|
19721 |
|
19722 | if (value === '(') {
|
19723 | increment('parens');
|
19724 | push({ type: 'paren', value });
|
19725 | continue;
|
19726 | }
|
19727 |
|
19728 | if (value === ')') {
|
19729 | if (state.parens === 0 && opts.strictBrackets === true) {
|
19730 | throw new SyntaxError(syntaxError('opening', '('));
|
19731 | }
|
19732 |
|
19733 | const extglob = extglobs[extglobs.length - 1];
|
19734 | if (extglob && state.parens === extglob.parens + 1) {
|
19735 | extglobClose(extglobs.pop());
|
19736 | continue;
|
19737 | }
|
19738 |
|
19739 | push({ type: 'paren', value, output: state.parens ? ')' : '\\)' });
|
19740 | decrement('parens');
|
19741 | continue;
|
19742 | }
|
19743 |
|
19744 | |
19745 |
|
19746 |
|
19747 |
|
19748 | if (value === '[') {
|
19749 | if (opts.nobracket === true || !remaining().includes(']')) {
|
19750 | if (opts.nobracket !== true && opts.strictBrackets === true) {
|
19751 | throw new SyntaxError(syntaxError('closing', ']'));
|
19752 | }
|
19753 |
|
19754 | value = `\\${value}`;
|
19755 | } else {
|
19756 | increment('brackets');
|
19757 | }
|
19758 |
|
19759 | push({ type: 'bracket', value });
|
19760 | continue;
|
19761 | }
|
19762 |
|
19763 | if (value === ']') {
|
19764 | if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) {
|
19765 | push({ type: 'text', value, output: `\\${value}` });
|
19766 | continue;
|
19767 | }
|
19768 |
|
19769 | if (state.brackets === 0) {
|
19770 | if (opts.strictBrackets === true) {
|
19771 | throw new SyntaxError(syntaxError('opening', '['));
|
19772 | }
|
19773 |
|
19774 | push({ type: 'text', value, output: `\\${value}` });
|
19775 | continue;
|
19776 | }
|
19777 |
|
19778 | decrement('brackets');
|
19779 |
|
19780 | const prevValue = prev.value.slice(1);
|
19781 | if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {
|
19782 | value = `/${value}`;
|
19783 | }
|
19784 |
|
19785 | prev.value += value;
|
19786 | append({ value });
|
19787 |
|
19788 |
|
19789 |
|
19790 | if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
|
19791 | continue;
|
19792 | }
|
19793 |
|
19794 | const escaped = utils.escapeRegex(prev.value);
|
19795 | state.output = state.output.slice(0, -prev.value.length);
|
19796 |
|
19797 |
|
19798 |
|
19799 | if (opts.literalBrackets === true) {
|
19800 | state.output += escaped;
|
19801 | prev.value = escaped;
|
19802 | continue;
|
19803 | }
|
19804 |
|
19805 |
|
19806 | prev.value = `(${capture}${escaped}|${prev.value})`;
|
19807 | state.output += prev.value;
|
19808 | continue;
|
19809 | }
|
19810 |
|
19811 | |
19812 |
|
19813 |
|
19814 |
|
19815 | if (value === '{' && opts.nobrace !== true) {
|
19816 | increment('braces');
|
19817 |
|
19818 | const open = {
|
19819 | type: 'brace',
|
19820 | value,
|
19821 | output: '(',
|
19822 | outputIndex: state.output.length,
|
19823 | tokensIndex: state.tokens.length
|
19824 | };
|
19825 |
|
19826 | braces.push(open);
|
19827 | push(open);
|
19828 | continue;
|
19829 | }
|
19830 |
|
19831 | if (value === '}') {
|
19832 | const brace = braces[braces.length - 1];
|
19833 |
|
19834 | if (opts.nobrace === true || !brace) {
|
19835 | push({ type: 'text', value, output: value });
|
19836 | continue;
|
19837 | }
|
19838 |
|
19839 | let output = ')';
|
19840 |
|
19841 | if (brace.dots === true) {
|
19842 | const arr = tokens.slice();
|
19843 | const range = [];
|
19844 |
|
19845 | for (let i = arr.length - 1; i >= 0; i--) {
|
19846 | tokens.pop();
|
19847 | if (arr[i].type === 'brace') {
|
19848 | break;
|
19849 | }
|
19850 | if (arr[i].type !== 'dots') {
|
19851 | range.unshift(arr[i].value);
|
19852 | }
|
19853 | }
|
19854 |
|
19855 | output = expandRange(range, opts);
|
19856 | state.backtrack = true;
|
19857 | }
|
19858 |
|
19859 | if (brace.comma !== true && brace.dots !== true) {
|
19860 | const out = state.output.slice(0, brace.outputIndex);
|
19861 | const toks = state.tokens.slice(brace.tokensIndex);
|
19862 | brace.value = brace.output = '\\{';
|
19863 | value = output = '\\}';
|
19864 | state.output = out;
|
19865 | for (const t of toks) {
|
19866 | state.output += (t.output || t.value);
|
19867 | }
|
19868 | }
|
19869 |
|
19870 | push({ type: 'brace', value, output });
|
19871 | decrement('braces');
|
19872 | braces.pop();
|
19873 | continue;
|
19874 | }
|
19875 |
|
19876 | |
19877 |
|
19878 |
|
19879 |
|
19880 | if (value === '|') {
|
19881 | if (extglobs.length > 0) {
|
19882 | extglobs[extglobs.length - 1].conditions++;
|
19883 | }
|
19884 | push({ type: 'text', value });
|
19885 | continue;
|
19886 | }
|
19887 |
|
19888 | |
19889 |
|
19890 |
|
19891 |
|
19892 | if (value === ',') {
|
19893 | let output = value;
|
19894 |
|
19895 | const brace = braces[braces.length - 1];
|
19896 | if (brace && stack[stack.length - 1] === 'braces') {
|
19897 | brace.comma = true;
|
19898 | output = '|';
|
19899 | }
|
19900 |
|
19901 | push({ type: 'comma', value, output });
|
19902 | continue;
|
19903 | }
|
19904 |
|
19905 | |
19906 |
|
19907 |
|
19908 |
|
19909 | if (value === '/') {
|
19910 |
|
19911 |
|
19912 |
|
19913 |
|
19914 | if (prev.type === 'dot' && state.index === state.start + 1) {
|
19915 | state.start = state.index + 1;
|
19916 | state.consumed = '';
|
19917 | state.output = '';
|
19918 | tokens.pop();
|
19919 | prev = bos;
|
19920 | continue;
|
19921 | }
|
19922 |
|
19923 | push({ type: 'slash', value, output: SLASH_LITERAL });
|
19924 | continue;
|
19925 | }
|
19926 |
|
19927 | |
19928 |
|
19929 |
|
19930 |
|
19931 | if (value === '.') {
|
19932 | if (state.braces > 0 && prev.type === 'dot') {
|
19933 | if (prev.value === '.') prev.output = DOT_LITERAL;
|
19934 | const brace = braces[braces.length - 1];
|
19935 | prev.type = 'dots';
|
19936 | prev.output += value;
|
19937 | prev.value += value;
|
19938 | brace.dots = true;
|
19939 | continue;
|
19940 | }
|
19941 |
|
19942 | if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') {
|
19943 | push({ type: 'text', value, output: DOT_LITERAL });
|
19944 | continue;
|
19945 | }
|
19946 |
|
19947 | push({ type: 'dot', value, output: DOT_LITERAL });
|
19948 | continue;
|
19949 | }
|
19950 |
|
19951 | |
19952 |
|
19953 |
|
19954 |
|
19955 | if (value === '?') {
|
19956 | const isGroup = prev && prev.value === '(';
|
19957 | if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
|
19958 | extglobOpen('qmark', value);
|
19959 | continue;
|
19960 | }
|
19961 |
|
19962 | if (prev && prev.type === 'paren') {
|
19963 | const next = peek();
|
19964 | let output = value;
|
19965 |
|
19966 | if (next === '<' && !utils.supportsLookbehinds()) {
|
19967 | throw new Error('Node.js v10 or higher is required for regex lookbehinds');
|
19968 | }
|
19969 |
|
19970 | if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) {
|
19971 | output = `\\${value}`;
|
19972 | }
|
19973 |
|
19974 | push({ type: 'text', value, output });
|
19975 | continue;
|
19976 | }
|
19977 |
|
19978 | if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {
|
19979 | push({ type: 'qmark', value, output: QMARK_NO_DOT });
|
19980 | continue;
|
19981 | }
|
19982 |
|
19983 | push({ type: 'qmark', value, output: QMARK });
|
19984 | continue;
|
19985 | }
|
19986 |
|
19987 | |
19988 |
|
19989 |
|
19990 |
|
19991 | if (value === '!') {
|
19992 | if (opts.noextglob !== true && peek() === '(') {
|
19993 | if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {
|
19994 | extglobOpen('negate', value);
|
19995 | continue;
|
19996 | }
|
19997 | }
|
19998 |
|
19999 | if (opts.nonegate !== true && state.index === 0) {
|
20000 | negate();
|
20001 | continue;
|
20002 | }
|
20003 | }
|
20004 |
|
20005 | |
20006 |
|
20007 |
|
20008 |
|
20009 | if (value === '+') {
|
20010 | if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
|
20011 | extglobOpen('plus', value);
|
20012 | continue;
|
20013 | }
|
20014 |
|
20015 | if ((prev && prev.value === '(') || opts.regex === false) {
|
20016 | push({ type: 'plus', value, output: PLUS_LITERAL });
|
20017 | continue;
|
20018 | }
|
20019 |
|
20020 | if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) {
|
20021 | push({ type: 'plus', value });
|
20022 | continue;
|
20023 | }
|
20024 |
|
20025 | push({ type: 'plus', value: PLUS_LITERAL });
|
20026 | continue;
|
20027 | }
|
20028 |
|
20029 | |
20030 |
|
20031 |
|
20032 |
|
20033 | if (value === '@') {
|
20034 | if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
|
20035 | push({ type: 'at', extglob: true, value, output: '' });
|
20036 | continue;
|
20037 | }
|
20038 |
|
20039 | push({ type: 'text', value });
|
20040 | continue;
|
20041 | }
|
20042 |
|
20043 | |
20044 |
|
20045 |
|
20046 |
|
20047 | if (value !== '*') {
|
20048 | if (value === '$' || value === '^') {
|
20049 | value = `\\${value}`;
|
20050 | }
|
20051 |
|
20052 | const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
|
20053 | if (match) {
|
20054 | value += match[0];
|
20055 | state.index += match[0].length;
|
20056 | }
|
20057 |
|
20058 | push({ type: 'text', value });
|
20059 | continue;
|
20060 | }
|
20061 |
|
20062 | |
20063 |
|
20064 |
|
20065 |
|
20066 | if (prev && (prev.type === 'globstar' || prev.star === true)) {
|
20067 | prev.type = 'star';
|
20068 | prev.star = true;
|
20069 | prev.value += value;
|
20070 | prev.output = star;
|
20071 | state.backtrack = true;
|
20072 | state.globstar = true;
|
20073 | consume(value);
|
20074 | continue;
|
20075 | }
|
20076 |
|
20077 | let rest = remaining();
|
20078 | if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
|
20079 | extglobOpen('star', value);
|
20080 | continue;
|
20081 | }
|
20082 |
|
20083 | if (prev.type === 'star') {
|
20084 | if (opts.noglobstar === true) {
|
20085 | consume(value);
|
20086 | continue;
|
20087 | }
|
20088 |
|
20089 | const prior = prev.prev;
|
20090 | const before = prior.prev;
|
20091 | const isStart = prior.type === 'slash' || prior.type === 'bos';
|
20092 | const afterStar = before && (before.type === 'star' || before.type === 'globstar');
|
20093 |
|
20094 | if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) {
|
20095 | push({ type: 'star', value, output: '' });
|
20096 | continue;
|
20097 | }
|
20098 |
|
20099 | const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');
|
20100 | const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');
|
20101 | if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {
|
20102 | push({ type: 'star', value, output: '' });
|
20103 | continue;
|
20104 | }
|
20105 |
|
20106 |
|
20107 | while (rest.slice(0, 3) === '/**') {
|
20108 | const after = input[state.index + 4];
|
20109 | if (after && after !== '/') {
|
20110 | break;
|
20111 | }
|
20112 | rest = rest.slice(3);
|
20113 | consume('/**', 3);
|
20114 | }
|
20115 |
|
20116 | if (prior.type === 'bos' && eos()) {
|
20117 | prev.type = 'globstar';
|
20118 | prev.value += value;
|
20119 | prev.output = globstar(opts);
|
20120 | state.output = prev.output;
|
20121 | state.globstar = true;
|
20122 | consume(value);
|
20123 | continue;
|
20124 | }
|
20125 |
|
20126 | if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {
|
20127 | state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
20128 | prior.output = `(?:${prior.output}`;
|
20129 |
|
20130 | prev.type = 'globstar';
|
20131 | prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');
|
20132 | prev.value += value;
|
20133 | state.globstar = true;
|
20134 | state.output += prior.output + prev.output;
|
20135 | consume(value);
|
20136 | continue;
|
20137 | }
|
20138 |
|
20139 | if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {
|
20140 | const end = rest[1] !== void 0 ? '|$' : '';
|
20141 |
|
20142 | state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
20143 | prior.output = `(?:${prior.output}`;
|
20144 |
|
20145 | prev.type = 'globstar';
|
20146 | prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
|
20147 | prev.value += value;
|
20148 |
|
20149 | state.output += prior.output + prev.output;
|
20150 | state.globstar = true;
|
20151 |
|
20152 | consume(value + advance());
|
20153 |
|
20154 | push({ type: 'slash', value: '/', output: '' });
|
20155 | continue;
|
20156 | }
|
20157 |
|
20158 | if (prior.type === 'bos' && rest[0] === '/') {
|
20159 | prev.type = 'globstar';
|
20160 | prev.value += value;
|
20161 | prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
|
20162 | state.output = prev.output;
|
20163 | state.globstar = true;
|
20164 | consume(value + advance());
|
20165 | push({ type: 'slash', value: '/', output: '' });
|
20166 | continue;
|
20167 | }
|
20168 |
|
20169 |
|
20170 | state.output = state.output.slice(0, -prev.output.length);
|
20171 |
|
20172 |
|
20173 | prev.type = 'globstar';
|
20174 | prev.output = globstar(opts);
|
20175 | prev.value += value;
|
20176 |
|
20177 |
|
20178 | state.output += prev.output;
|
20179 | state.globstar = true;
|
20180 | consume(value);
|
20181 | continue;
|
20182 | }
|
20183 |
|
20184 | const token = { type: 'star', value, output: star };
|
20185 |
|
20186 | if (opts.bash === true) {
|
20187 | token.output = '.*?';
|
20188 | if (prev.type === 'bos' || prev.type === 'slash') {
|
20189 | token.output = nodot + token.output;
|
20190 | }
|
20191 | push(token);
|
20192 | continue;
|
20193 | }
|
20194 |
|
20195 | if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {
|
20196 | token.output = value;
|
20197 | push(token);
|
20198 | continue;
|
20199 | }
|
20200 |
|
20201 | if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {
|
20202 | if (prev.type === 'dot') {
|
20203 | state.output += NO_DOT_SLASH;
|
20204 | prev.output += NO_DOT_SLASH;
|
20205 |
|
20206 | } else if (opts.dot === true) {
|
20207 | state.output += NO_DOTS_SLASH;
|
20208 | prev.output += NO_DOTS_SLASH;
|
20209 |
|
20210 | } else {
|
20211 | state.output += nodot;
|
20212 | prev.output += nodot;
|
20213 | }
|
20214 |
|
20215 | if (peek() !== '*') {
|
20216 | state.output += ONE_CHAR;
|
20217 | prev.output += ONE_CHAR;
|
20218 | }
|
20219 | }
|
20220 |
|
20221 | push(token);
|
20222 | }
|
20223 |
|
20224 | while (state.brackets > 0) {
|
20225 | if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));
|
20226 | state.output = utils.escapeLast(state.output, '[');
|
20227 | decrement('brackets');
|
20228 | }
|
20229 |
|
20230 | while (state.parens > 0) {
|
20231 | if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));
|
20232 | state.output = utils.escapeLast(state.output, '(');
|
20233 | decrement('parens');
|
20234 | }
|
20235 |
|
20236 | while (state.braces > 0) {
|
20237 | if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));
|
20238 | state.output = utils.escapeLast(state.output, '{');
|
20239 | decrement('braces');
|
20240 | }
|
20241 |
|
20242 | if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {
|
20243 | push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` });
|
20244 | }
|
20245 |
|
20246 |
|
20247 | if (state.backtrack === true) {
|
20248 | state.output = '';
|
20249 |
|
20250 | for (const token of state.tokens) {
|
20251 | state.output += token.output != null ? token.output : token.value;
|
20252 |
|
20253 | if (token.suffix) {
|
20254 | state.output += token.suffix;
|
20255 | }
|
20256 | }
|
20257 | }
|
20258 |
|
20259 | return state;
|
20260 | };
|
20261 |
|
20262 |
|
20263 |
|
20264 |
|
20265 |
|
20266 |
|
20267 |
|
20268 | parse.fastpaths = (input, options) => {
|
20269 | const opts = { ...options };
|
20270 | const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
20271 | const len = input.length;
|
20272 | if (len > max) {
|
20273 | throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
20274 | }
|
20275 |
|
20276 | input = REPLACEMENTS[input] || input;
|
20277 | const win32 = utils.isWindows(options);
|
20278 |
|
20279 |
|
20280 | const {
|
20281 | DOT_LITERAL,
|
20282 | SLASH_LITERAL,
|
20283 | ONE_CHAR,
|
20284 | DOTS_SLASH,
|
20285 | NO_DOT,
|
20286 | NO_DOTS,
|
20287 | NO_DOTS_SLASH,
|
20288 | STAR,
|
20289 | START_ANCHOR
|
20290 | } = constants.globChars(win32);
|
20291 |
|
20292 | const nodot = opts.dot ? NO_DOTS : NO_DOT;
|
20293 | const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
|
20294 | const capture = opts.capture ? '' : '?:';
|
20295 | const state = { negated: false, prefix: '' };
|
20296 | let star = opts.bash === true ? '.*?' : STAR;
|
20297 |
|
20298 | if (opts.capture) {
|
20299 | star = `(${star})`;
|
20300 | }
|
20301 |
|
20302 | const globstar = (opts) => {
|
20303 | if (opts.noglobstar === true) return star;
|
20304 | return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
20305 | };
|
20306 |
|
20307 | const create = str => {
|
20308 | switch (str) {
|
20309 | case '*':
|
20310 | return `${nodot}${ONE_CHAR}${star}`;
|
20311 |
|
20312 | case '.*':
|
20313 | return `${DOT_LITERAL}${ONE_CHAR}${star}`;
|
20314 |
|
20315 | case '*.*':
|
20316 | return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
20317 |
|
20318 | case '*/*':
|
20319 | return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
|
20320 |
|
20321 | case '**':
|
20322 | return nodot + globstar(opts);
|
20323 |
|
20324 | case '**/*':
|
20325 | return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
|
20326 |
|
20327 | case '**/*.*':
|
20328 | return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
20329 |
|
20330 | case '**/.*':
|
20331 | return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
|
20332 |
|
20333 | default: {
|
20334 | const match = /^(.*?)\.(\w+)$/.exec(str);
|
20335 | if (!match) return;
|
20336 |
|
20337 | const source = create(match[1]);
|
20338 | if (!source) return;
|
20339 |
|
20340 | return source + DOT_LITERAL + match[2];
|
20341 | }
|
20342 | }
|
20343 | };
|
20344 |
|
20345 | const output = utils.removePrefix(input, state);
|
20346 | let source = create(output);
|
20347 |
|
20348 | if (source && opts.strictSlashes !== true) {
|
20349 | source += `${SLASH_LITERAL}?`;
|
20350 | }
|
20351 |
|
20352 | return source;
|
20353 | };
|
20354 |
|
20355 | module.exports = parse;
|
20356 |
|
20357 |
|
20358 | }),
|
20359 |
|
20360 | (function(module, exports, __webpack_require__) {
|
20361 |
|
20362 | "use strict";
|
20363 |
|
20364 | Object.defineProperty(exports, "__esModule", { value: true });
|
20365 | exports.merge = void 0;
|
20366 | const merge2 = __webpack_require__(95);
|
20367 | function merge(streams) {
|
20368 | const mergedStream = merge2(streams);
|
20369 | streams.forEach((stream) => {
|
20370 | stream.once('error', (error) => mergedStream.emit('error', error));
|
20371 | });
|
20372 | mergedStream.once('close', () => propagateCloseEventToSources(streams));
|
20373 | mergedStream.once('end', () => propagateCloseEventToSources(streams));
|
20374 | return mergedStream;
|
20375 | }
|
20376 | exports.merge = merge;
|
20377 | function propagateCloseEventToSources(streams) {
|
20378 | streams.forEach((stream) => stream.emit('close'));
|
20379 | }
|
20380 |
|
20381 |
|
20382 | }),
|
20383 |
|
20384 | (function(module, exports, __webpack_require__) {
|
20385 |
|
20386 | "use strict";
|
20387 |
|
20388 |
|
20389 |
|
20390 |
|
20391 |
|
20392 |
|
20393 |
|
20394 |
|
20395 | const Stream = __webpack_require__(96)
|
20396 | const PassThrough = Stream.PassThrough
|
20397 | const slice = Array.prototype.slice
|
20398 |
|
20399 | module.exports = merge2
|
20400 |
|
20401 | function merge2 () {
|
20402 | const streamsQueue = []
|
20403 | let merging = false
|
20404 | const args = slice.call(arguments)
|
20405 | let options = args[args.length - 1]
|
20406 |
|
20407 | if (options && !Array.isArray(options) && options.pipe == null) args.pop()
|
20408 | else options = {}
|
20409 |
|
20410 | const doEnd = options.end !== false
|
20411 | if (options.objectMode == null) options.objectMode = true
|
20412 | if (options.highWaterMark == null) options.highWaterMark = 64 * 1024
|
20413 | const mergedStream = PassThrough(options)
|
20414 |
|
20415 | function addStream () {
|
20416 | for (let i = 0, len = arguments.length; i < len; i++) {
|
20417 | streamsQueue.push(pauseStreams(arguments[i], options))
|
20418 | }
|
20419 | mergeStream()
|
20420 | return this
|
20421 | }
|
20422 |
|
20423 | function mergeStream () {
|
20424 | if (merging) return
|
20425 | merging = true
|
20426 |
|
20427 | let streams = streamsQueue.shift()
|
20428 | if (!streams) {
|
20429 | process.nextTick(endStream)
|
20430 | return
|
20431 | }
|
20432 | if (!Array.isArray(streams)) streams = [streams]
|
20433 |
|
20434 | let pipesCount = streams.length + 1
|
20435 |
|
20436 | function next () {
|
20437 | if (--pipesCount > 0) return
|
20438 | merging = false
|
20439 | mergeStream()
|
20440 | }
|
20441 |
|
20442 | function pipe (stream) {
|
20443 | function onend () {
|
20444 | stream.removeListener('merge2UnpipeEnd', onend)
|
20445 | stream.removeListener('end', onend)
|
20446 | next()
|
20447 | }
|
20448 |
|
20449 | if (stream._readableState.endEmitted) return next()
|
20450 |
|
20451 | stream.on('merge2UnpipeEnd', onend)
|
20452 | stream.on('end', onend)
|
20453 | stream.pipe(mergedStream, { end: false })
|
20454 |
|
20455 | stream.resume()
|
20456 | }
|
20457 |
|
20458 | for (let i = 0; i < streams.length; i++) pipe(streams[i])
|
20459 |
|
20460 | next()
|
20461 | }
|
20462 |
|
20463 | function endStream () {
|
20464 | merging = false
|
20465 |
|
20466 | mergedStream.emit('queueDrain')
|
20467 | return doEnd && mergedStream.end()
|
20468 | }
|
20469 |
|
20470 | mergedStream.setMaxListeners(0)
|
20471 | mergedStream.add = addStream
|
20472 | mergedStream.on('unpipe', function (stream) {
|
20473 | stream.emit('merge2UnpipeEnd')
|
20474 | })
|
20475 |
|
20476 | if (args.length) addStream.apply(null, args)
|
20477 | return mergedStream
|
20478 | }
|
20479 |
|
20480 |
|
20481 | function pauseStreams (streams, options) {
|
20482 | if (!Array.isArray(streams)) {
|
20483 |
|
20484 | if (!streams._readableState && streams.pipe) streams = streams.pipe(PassThrough(options))
|
20485 | if (!streams._readableState || !streams.pause || !streams.pipe) {
|
20486 | throw new Error('Only readable stream can be merged.')
|
20487 | }
|
20488 | streams.pause()
|
20489 | } else {
|
20490 | for (let i = 0, len = streams.length; i < len; i++) streams[i] = pauseStreams(streams[i], options)
|
20491 | }
|
20492 | return streams
|
20493 | }
|
20494 |
|
20495 |
|
20496 | }),
|
20497 |
|
20498 | (function(module, exports) {
|
20499 |
|
20500 | module.exports = require("stream");
|
20501 |
|
20502 | }),
|
20503 |
|
20504 | (function(module, exports, __webpack_require__) {
|
20505 |
|
20506 | "use strict";
|
20507 |
|
20508 | Object.defineProperty(exports, "__esModule", { value: true });
|
20509 | exports.isEmpty = exports.isString = void 0;
|
20510 | function isString(input) {
|
20511 | return typeof input === 'string';
|
20512 | }
|
20513 | exports.isString = isString;
|
20514 | function isEmpty(input) {
|
20515 | return input === '';
|
20516 | }
|
20517 | exports.isEmpty = isEmpty;
|
20518 |
|
20519 |
|
20520 | }),
|
20521 |
|
20522 | (function(module, exports, __webpack_require__) {
|
20523 |
|
20524 | "use strict";
|
20525 |
|
20526 | Object.defineProperty(exports, "__esModule", { value: true });
|
20527 | const stream_1 = __webpack_require__(99);
|
20528 | const provider_1 = __webpack_require__(126);
|
20529 | class ProviderAsync extends provider_1.default {
|
20530 | constructor() {
|
20531 | super(...arguments);
|
20532 | this._reader = new stream_1.default(this._settings);
|
20533 | }
|
20534 | read(task) {
|
20535 | const root = this._getRootDirectory(task);
|
20536 | const options = this._getReaderOptions(task);
|
20537 | const entries = [];
|
20538 | return new Promise((resolve, reject) => {
|
20539 | const stream = this.api(root, task, options);
|
20540 | stream.once('error', reject);
|
20541 | stream.on('data', (entry) => entries.push(options.transform(entry)));
|
20542 | stream.once('end', () => resolve(entries));
|
20543 | });
|
20544 | }
|
20545 | api(root, task, options) {
|
20546 | if (task.dynamic) {
|
20547 | return this._reader.dynamic(root, options);
|
20548 | }
|
20549 | return this._reader.static(task.patterns, options);
|
20550 | }
|
20551 | }
|
20552 | exports.default = ProviderAsync;
|
20553 |
|
20554 |
|
20555 | }),
|
20556 |
|
20557 | (function(module, exports, __webpack_require__) {
|
20558 |
|
20559 | "use strict";
|
20560 |
|
20561 | Object.defineProperty(exports, "__esModule", { value: true });
|
20562 | const stream_1 = __webpack_require__(96);
|
20563 | const fsStat = __webpack_require__(100);
|
20564 | const fsWalk = __webpack_require__(105);
|
20565 | const reader_1 = __webpack_require__(125);
|
20566 | class ReaderStream extends reader_1.default {
|
20567 | constructor() {
|
20568 | super(...arguments);
|
20569 | this._walkStream = fsWalk.walkStream;
|
20570 | this._stat = fsStat.stat;
|
20571 | }
|
20572 | dynamic(root, options) {
|
20573 | return this._walkStream(root, options);
|
20574 | }
|
20575 | static(patterns, options) {
|
20576 | const filepaths = patterns.map(this._getFullEntryPath, this);
|
20577 | const stream = new stream_1.PassThrough({ objectMode: true });
|
20578 | stream._write = (index, _enc, done) => {
|
20579 | return this._getEntry(filepaths[index], patterns[index], options)
|
20580 | .then((entry) => {
|
20581 | if (entry !== null && options.entryFilter(entry)) {
|
20582 | stream.push(entry);
|
20583 | }
|
20584 | if (index === filepaths.length - 1) {
|
20585 | stream.end();
|
20586 | }
|
20587 | done();
|
20588 | })
|
20589 | .catch(done);
|
20590 | };
|
20591 | for (let i = 0; i < filepaths.length; i++) {
|
20592 | stream.write(i);
|
20593 | }
|
20594 | return stream;
|
20595 | }
|
20596 | _getEntry(filepath, pattern, options) {
|
20597 | return this._getStat(filepath)
|
20598 | .then((stats) => this._makeEntry(stats, pattern))
|
20599 | .catch((error) => {
|
20600 | if (options.errorFilter(error)) {
|
20601 | return null;
|
20602 | }
|
20603 | throw error;
|
20604 | });
|
20605 | }
|
20606 | _getStat(filepath) {
|
20607 | return new Promise((resolve, reject) => {
|
20608 | this._stat(filepath, this._fsStatSettings, (error, stats) => {
|
20609 | return error === null ? resolve(stats) : reject(error);
|
20610 | });
|
20611 | });
|
20612 | }
|
20613 | }
|
20614 | exports.default = ReaderStream;
|
20615 |
|
20616 |
|
20617 | }),
|
20618 |
|
20619 | (function(module, exports, __webpack_require__) {
|
20620 |
|
20621 | "use strict";
|
20622 |
|
20623 | Object.defineProperty(exports, "__esModule", { value: true });
|
20624 | const async = __webpack_require__(101);
|
20625 | const sync = __webpack_require__(102);
|
20626 | const settings_1 = __webpack_require__(103);
|
20627 | exports.Settings = settings_1.default;
|
20628 | function stat(path, optionsOrSettingsOrCallback, callback) {
|
20629 | if (typeof optionsOrSettingsOrCallback === 'function') {
|
20630 | return async.read(path, getSettings(), optionsOrSettingsOrCallback);
|
20631 | }
|
20632 | async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
|
20633 | }
|
20634 | exports.stat = stat;
|
20635 | function statSync(path, optionsOrSettings) {
|
20636 | const settings = getSettings(optionsOrSettings);
|
20637 | return sync.read(path, settings);
|
20638 | }
|
20639 | exports.statSync = statSync;
|
20640 | function getSettings(settingsOrOptions = {}) {
|
20641 | if (settingsOrOptions instanceof settings_1.default) {
|
20642 | return settingsOrOptions;
|
20643 | }
|
20644 | return new settings_1.default(settingsOrOptions);
|
20645 | }
|
20646 |
|
20647 |
|
20648 | }),
|
20649 |
|
20650 | (function(module, exports, __webpack_require__) {
|
20651 |
|
20652 | "use strict";
|
20653 |
|
20654 | Object.defineProperty(exports, "__esModule", { value: true });
|
20655 | function read(path, settings, callback) {
|
20656 | settings.fs.lstat(path, (lstatError, lstat) => {
|
20657 | if (lstatError !== null) {
|
20658 | return callFailureCallback(callback, lstatError);
|
20659 | }
|
20660 | if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
|
20661 | return callSuccessCallback(callback, lstat);
|
20662 | }
|
20663 | settings.fs.stat(path, (statError, stat) => {
|
20664 | if (statError !== null) {
|
20665 | if (settings.throwErrorOnBrokenSymbolicLink) {
|
20666 | return callFailureCallback(callback, statError);
|
20667 | }
|
20668 | return callSuccessCallback(callback, lstat);
|
20669 | }
|
20670 | if (settings.markSymbolicLink) {
|
20671 | stat.isSymbolicLink = () => true;
|
20672 | }
|
20673 | callSuccessCallback(callback, stat);
|
20674 | });
|
20675 | });
|
20676 | }
|
20677 | exports.read = read;
|
20678 | function callFailureCallback(callback, error) {
|
20679 | callback(error);
|
20680 | }
|
20681 | function callSuccessCallback(callback, result) {
|
20682 | callback(null, result);
|
20683 | }
|
20684 |
|
20685 |
|
20686 | }),
|
20687 |
|
20688 | (function(module, exports, __webpack_require__) {
|
20689 |
|
20690 | "use strict";
|
20691 |
|
20692 | Object.defineProperty(exports, "__esModule", { value: true });
|
20693 | function read(path, settings) {
|
20694 | const lstat = settings.fs.lstatSync(path);
|
20695 | if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
|
20696 | return lstat;
|
20697 | }
|
20698 | try {
|
20699 | const stat = settings.fs.statSync(path);
|
20700 | if (settings.markSymbolicLink) {
|
20701 | stat.isSymbolicLink = () => true;
|
20702 | }
|
20703 | return stat;
|
20704 | }
|
20705 | catch (error) {
|
20706 | if (!settings.throwErrorOnBrokenSymbolicLink) {
|
20707 | return lstat;
|
20708 | }
|
20709 | throw error;
|
20710 | }
|
20711 | }
|
20712 | exports.read = read;
|
20713 |
|
20714 |
|
20715 | }),
|
20716 |
|
20717 | (function(module, exports, __webpack_require__) {
|
20718 |
|
20719 | "use strict";
|
20720 |
|
20721 | Object.defineProperty(exports, "__esModule", { value: true });
|
20722 | const fs = __webpack_require__(104);
|
20723 | class Settings {
|
20724 | constructor(_options = {}) {
|
20725 | this._options = _options;
|
20726 | this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
|
20727 | this.fs = fs.createFileSystemAdapter(this._options.fs);
|
20728 | this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
|
20729 | this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
|
20730 | }
|
20731 | _getValue(option, value) {
|
20732 | return option === undefined ? value : option;
|
20733 | }
|
20734 | }
|
20735 | exports.default = Settings;
|
20736 |
|
20737 |
|
20738 | }),
|
20739 |
|
20740 | (function(module, exports, __webpack_require__) {
|
20741 |
|
20742 | "use strict";
|
20743 |
|
20744 | Object.defineProperty(exports, "__esModule", { value: true });
|
20745 | const fs = __webpack_require__(40);
|
20746 | exports.FILE_SYSTEM_ADAPTER = {
|
20747 | lstat: fs.lstat,
|
20748 | stat: fs.stat,
|
20749 | lstatSync: fs.lstatSync,
|
20750 | statSync: fs.statSync
|
20751 | };
|
20752 | function createFileSystemAdapter(fsMethods) {
|
20753 | if (fsMethods === undefined) {
|
20754 | return exports.FILE_SYSTEM_ADAPTER;
|
20755 | }
|
20756 | return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
|
20757 | }
|
20758 | exports.createFileSystemAdapter = createFileSystemAdapter;
|
20759 |
|
20760 |
|
20761 | }),
|
20762 |
|
20763 | (function(module, exports, __webpack_require__) {
|
20764 |
|
20765 | "use strict";
|
20766 |
|
20767 | Object.defineProperty(exports, "__esModule", { value: true });
|
20768 | const async_1 = __webpack_require__(106);
|
20769 | const stream_1 = __webpack_require__(121);
|
20770 | const sync_1 = __webpack_require__(122);
|
20771 | const settings_1 = __webpack_require__(124);
|
20772 | exports.Settings = settings_1.default;
|
20773 | function walk(directory, optionsOrSettingsOrCallback, callback) {
|
20774 | if (typeof optionsOrSettingsOrCallback === 'function') {
|
20775 | return new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback);
|
20776 | }
|
20777 | new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback);
|
20778 | }
|
20779 | exports.walk = walk;
|
20780 | function walkSync(directory, optionsOrSettings) {
|
20781 | const settings = getSettings(optionsOrSettings);
|
20782 | const provider = new sync_1.default(directory, settings);
|
20783 | return provider.read();
|
20784 | }
|
20785 | exports.walkSync = walkSync;
|
20786 | function walkStream(directory, optionsOrSettings) {
|
20787 | const settings = getSettings(optionsOrSettings);
|
20788 | const provider = new stream_1.default(directory, settings);
|
20789 | return provider.read();
|
20790 | }
|
20791 | exports.walkStream = walkStream;
|
20792 | function getSettings(settingsOrOptions = {}) {
|
20793 | if (settingsOrOptions instanceof settings_1.default) {
|
20794 | return settingsOrOptions;
|
20795 | }
|
20796 | return new settings_1.default(settingsOrOptions);
|
20797 | }
|
20798 |
|
20799 |
|
20800 | }),
|
20801 |
|
20802 | (function(module, exports, __webpack_require__) {
|
20803 |
|
20804 | "use strict";
|
20805 |
|
20806 | Object.defineProperty(exports, "__esModule", { value: true });
|
20807 | const async_1 = __webpack_require__(107);
|
20808 | class AsyncProvider {
|
20809 | constructor(_root, _settings) {
|
20810 | this._root = _root;
|
20811 | this._settings = _settings;
|
20812 | this._reader = new async_1.default(this._root, this._settings);
|
20813 | this._storage = new Set();
|
20814 | }
|
20815 | read(callback) {
|
20816 | this._reader.onError((error) => {
|
20817 | callFailureCallback(callback, error);
|
20818 | });
|
20819 | this._reader.onEntry((entry) => {
|
20820 | this._storage.add(entry);
|
20821 | });
|
20822 | this._reader.onEnd(() => {
|
20823 | callSuccessCallback(callback, [...this._storage]);
|
20824 | });
|
20825 | this._reader.read();
|
20826 | }
|
20827 | }
|
20828 | exports.default = AsyncProvider;
|
20829 | function callFailureCallback(callback, error) {
|
20830 | callback(error);
|
20831 | }
|
20832 | function callSuccessCallback(callback, entries) {
|
20833 | callback(null, entries);
|
20834 | }
|
20835 |
|
20836 |
|
20837 | }),
|
20838 |
|
20839 | (function(module, exports, __webpack_require__) {
|
20840 |
|
20841 | "use strict";
|
20842 |
|
20843 | Object.defineProperty(exports, "__esModule", { value: true });
|
20844 | const events_1 = __webpack_require__(51);
|
20845 | const fsScandir = __webpack_require__(108);
|
20846 | const fastq = __webpack_require__(117);
|
20847 | const common = __webpack_require__(119);
|
20848 | const reader_1 = __webpack_require__(120);
|
20849 | class AsyncReader extends reader_1.default {
|
20850 | constructor(_root, _settings) {
|
20851 | super(_root, _settings);
|
20852 | this._settings = _settings;
|
20853 | this._scandir = fsScandir.scandir;
|
20854 | this._emitter = new events_1.EventEmitter();
|
20855 | this._queue = fastq(this._worker.bind(this), this._settings.concurrency);
|
20856 | this._isFatalError = false;
|
20857 | this._isDestroyed = false;
|
20858 | this._queue.drain = () => {
|
20859 | if (!this._isFatalError) {
|
20860 | this._emitter.emit('end');
|
20861 | }
|
20862 | };
|
20863 | }
|
20864 | read() {
|
20865 | this._isFatalError = false;
|
20866 | this._isDestroyed = false;
|
20867 | setImmediate(() => {
|
20868 | this._pushToQueue(this._root, this._settings.basePath);
|
20869 | });
|
20870 | return this._emitter;
|
20871 | }
|
20872 | destroy() {
|
20873 | if (this._isDestroyed) {
|
20874 | throw new Error('The reader is already destroyed');
|
20875 | }
|
20876 | this._isDestroyed = true;
|
20877 | this._queue.killAndDrain();
|
20878 | }
|
20879 | onEntry(callback) {
|
20880 | this._emitter.on('entry', callback);
|
20881 | }
|
20882 | onError(callback) {
|
20883 | this._emitter.once('error', callback);
|
20884 | }
|
20885 | onEnd(callback) {
|
20886 | this._emitter.once('end', callback);
|
20887 | }
|
20888 | _pushToQueue(directory, base) {
|
20889 | const queueItem = { directory, base };
|
20890 | this._queue.push(queueItem, (error) => {
|
20891 | if (error !== null) {
|
20892 | this._handleError(error);
|
20893 | }
|
20894 | });
|
20895 | }
|
20896 | _worker(item, done) {
|
20897 | this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => {
|
20898 | if (error !== null) {
|
20899 | return done(error, undefined);
|
20900 | }
|
20901 | for (const entry of entries) {
|
20902 | this._handleEntry(entry, item.base);
|
20903 | }
|
20904 | done(null, undefined);
|
20905 | });
|
20906 | }
|
20907 | _handleError(error) {
|
20908 | if (!common.isFatalError(this._settings, error)) {
|
20909 | return;
|
20910 | }
|
20911 | this._isFatalError = true;
|
20912 | this._isDestroyed = true;
|
20913 | this._emitter.emit('error', error);
|
20914 | }
|
20915 | _handleEntry(entry, base) {
|
20916 | if (this._isDestroyed || this._isFatalError) {
|
20917 | return;
|
20918 | }
|
20919 | const fullpath = entry.path;
|
20920 | if (base !== undefined) {
|
20921 | entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
|
20922 | }
|
20923 | if (common.isAppliedFilter(this._settings.entryFilter, entry)) {
|
20924 | this._emitEntry(entry);
|
20925 | }
|
20926 | if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) {
|
20927 | this._pushToQueue(fullpath, entry.path);
|
20928 | }
|
20929 | }
|
20930 | _emitEntry(entry) {
|
20931 | this._emitter.emit('entry', entry);
|
20932 | }
|
20933 | }
|
20934 | exports.default = AsyncReader;
|
20935 |
|
20936 |
|
20937 | }),
|
20938 |
|
20939 | (function(module, exports, __webpack_require__) {
|
20940 |
|
20941 | "use strict";
|
20942 |
|
20943 | Object.defineProperty(exports, "__esModule", { value: true });
|
20944 | const async = __webpack_require__(109);
|
20945 | const sync = __webpack_require__(114);
|
20946 | const settings_1 = __webpack_require__(115);
|
20947 | exports.Settings = settings_1.default;
|
20948 | function scandir(path, optionsOrSettingsOrCallback, callback) {
|
20949 | if (typeof optionsOrSettingsOrCallback === 'function') {
|
20950 | return async.read(path, getSettings(), optionsOrSettingsOrCallback);
|
20951 | }
|
20952 | async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
|
20953 | }
|
20954 | exports.scandir = scandir;
|
20955 | function scandirSync(path, optionsOrSettings) {
|
20956 | const settings = getSettings(optionsOrSettings);
|
20957 | return sync.read(path, settings);
|
20958 | }
|
20959 | exports.scandirSync = scandirSync;
|
20960 | function getSettings(settingsOrOptions = {}) {
|
20961 | if (settingsOrOptions instanceof settings_1.default) {
|
20962 | return settingsOrOptions;
|
20963 | }
|
20964 | return new settings_1.default(settingsOrOptions);
|
20965 | }
|
20966 |
|
20967 |
|
20968 | }),
|
20969 |
|
20970 | (function(module, exports, __webpack_require__) {
|
20971 |
|
20972 | "use strict";
|
20973 |
|
20974 | Object.defineProperty(exports, "__esModule", { value: true });
|
20975 | const fsStat = __webpack_require__(100);
|
20976 | const rpl = __webpack_require__(110);
|
20977 | const constants_1 = __webpack_require__(111);
|
20978 | const utils = __webpack_require__(112);
|
20979 | function read(directory, settings, callback) {
|
20980 | if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
20981 | return readdirWithFileTypes(directory, settings, callback);
|
20982 | }
|
20983 | return readdir(directory, settings, callback);
|
20984 | }
|
20985 | exports.read = read;
|
20986 | function readdirWithFileTypes(directory, settings, callback) {
|
20987 | settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
|
20988 | if (readdirError !== null) {
|
20989 | return callFailureCallback(callback, readdirError);
|
20990 | }
|
20991 | const entries = dirents.map((dirent) => ({
|
20992 | dirent,
|
20993 | name: dirent.name,
|
20994 | path: `${directory}${settings.pathSegmentSeparator}${dirent.name}`
|
20995 | }));
|
20996 | if (!settings.followSymbolicLinks) {
|
20997 | return callSuccessCallback(callback, entries);
|
20998 | }
|
20999 | const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings));
|
21000 | rpl(tasks, (rplError, rplEntries) => {
|
21001 | if (rplError !== null) {
|
21002 | return callFailureCallback(callback, rplError);
|
21003 | }
|
21004 | callSuccessCallback(callback, rplEntries);
|
21005 | });
|
21006 | });
|
21007 | }
|
21008 | exports.readdirWithFileTypes = readdirWithFileTypes;
|
21009 | function makeRplTaskEntry(entry, settings) {
|
21010 | return (done) => {
|
21011 | if (!entry.dirent.isSymbolicLink()) {
|
21012 | return done(null, entry);
|
21013 | }
|
21014 | settings.fs.stat(entry.path, (statError, stats) => {
|
21015 | if (statError !== null) {
|
21016 | if (settings.throwErrorOnBrokenSymbolicLink) {
|
21017 | return done(statError);
|
21018 | }
|
21019 | return done(null, entry);
|
21020 | }
|
21021 | entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
|
21022 | return done(null, entry);
|
21023 | });
|
21024 | };
|
21025 | }
|
21026 | function readdir(directory, settings, callback) {
|
21027 | settings.fs.readdir(directory, (readdirError, names) => {
|
21028 | if (readdirError !== null) {
|
21029 | return callFailureCallback(callback, readdirError);
|
21030 | }
|
21031 | const filepaths = names.map((name) => `${directory}${settings.pathSegmentSeparator}${name}`);
|
21032 | const tasks = filepaths.map((filepath) => {
|
21033 | return (done) => fsStat.stat(filepath, settings.fsStatSettings, done);
|
21034 | });
|
21035 | rpl(tasks, (rplError, results) => {
|
21036 | if (rplError !== null) {
|
21037 | return callFailureCallback(callback, rplError);
|
21038 | }
|
21039 | const entries = [];
|
21040 | names.forEach((name, index) => {
|
21041 | const stats = results[index];
|
21042 | const entry = {
|
21043 | name,
|
21044 | path: filepaths[index],
|
21045 | dirent: utils.fs.createDirentFromStats(name, stats)
|
21046 | };
|
21047 | if (settings.stats) {
|
21048 | entry.stats = stats;
|
21049 | }
|
21050 | entries.push(entry);
|
21051 | });
|
21052 | callSuccessCallback(callback, entries);
|
21053 | });
|
21054 | });
|
21055 | }
|
21056 | exports.readdir = readdir;
|
21057 | function callFailureCallback(callback, error) {
|
21058 | callback(error);
|
21059 | }
|
21060 | function callSuccessCallback(callback, result) {
|
21061 | callback(null, result);
|
21062 | }
|
21063 |
|
21064 |
|
21065 | }),
|
21066 |
|
21067 | (function(module, exports) {
|
21068 |
|
21069 | module.exports = runParallel
|
21070 |
|
21071 | function runParallel (tasks, cb) {
|
21072 | var results, pending, keys
|
21073 | var isSync = true
|
21074 |
|
21075 | if (Array.isArray(tasks)) {
|
21076 | results = []
|
21077 | pending = tasks.length
|
21078 | } else {
|
21079 | keys = Object.keys(tasks)
|
21080 | results = {}
|
21081 | pending = keys.length
|
21082 | }
|
21083 |
|
21084 | function done (err) {
|
21085 | function end () {
|
21086 | if (cb) cb(err, results)
|
21087 | cb = null
|
21088 | }
|
21089 | if (isSync) process.nextTick(end)
|
21090 | else end()
|
21091 | }
|
21092 |
|
21093 | function each (i, err, result) {
|
21094 | results[i] = result
|
21095 | if (--pending === 0 || err) {
|
21096 | done(err)
|
21097 | }
|
21098 | }
|
21099 |
|
21100 | if (!pending) {
|
21101 |
|
21102 | done(null)
|
21103 | } else if (keys) {
|
21104 |
|
21105 | keys.forEach(function (key) {
|
21106 | tasks[key](function (err, result) { each(key, err, result) })
|
21107 | })
|
21108 | } else {
|
21109 |
|
21110 | tasks.forEach(function (task, i) {
|
21111 | task(function (err, result) { each(i, err, result) })
|
21112 | })
|
21113 | }
|
21114 |
|
21115 | isSync = false
|
21116 | }
|
21117 |
|
21118 |
|
21119 | }),
|
21120 |
|
21121 | (function(module, exports, __webpack_require__) {
|
21122 |
|
21123 | "use strict";
|
21124 |
|
21125 | Object.defineProperty(exports, "__esModule", { value: true });
|
21126 | const NODE_PROCESS_VERSION_PARTS = process.versions.node.split('.');
|
21127 | const MAJOR_VERSION = parseInt(NODE_PROCESS_VERSION_PARTS[0], 10);
|
21128 | const MINOR_VERSION = parseInt(NODE_PROCESS_VERSION_PARTS[1], 10);
|
21129 | const SUPPORTED_MAJOR_VERSION = 10;
|
21130 | const SUPPORTED_MINOR_VERSION = 10;
|
21131 | const IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION;
|
21132 | const IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION;
|
21133 |
|
21134 |
|
21135 |
|
21136 | exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR;
|
21137 |
|
21138 |
|
21139 | }),
|
21140 |
|
21141 | (function(module, exports, __webpack_require__) {
|
21142 |
|
21143 | "use strict";
|
21144 |
|
21145 | Object.defineProperty(exports, "__esModule", { value: true });
|
21146 | const fs = __webpack_require__(113);
|
21147 | exports.fs = fs;
|
21148 |
|
21149 |
|
21150 | }),
|
21151 |
|
21152 | (function(module, exports, __webpack_require__) {
|
21153 |
|
21154 | "use strict";
|
21155 |
|
21156 | Object.defineProperty(exports, "__esModule", { value: true });
|
21157 | class DirentFromStats {
|
21158 | constructor(name, stats) {
|
21159 | this.name = name;
|
21160 | this.isBlockDevice = stats.isBlockDevice.bind(stats);
|
21161 | this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
|
21162 | this.isDirectory = stats.isDirectory.bind(stats);
|
21163 | this.isFIFO = stats.isFIFO.bind(stats);
|
21164 | this.isFile = stats.isFile.bind(stats);
|
21165 | this.isSocket = stats.isSocket.bind(stats);
|
21166 | this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
|
21167 | }
|
21168 | }
|
21169 | function createDirentFromStats(name, stats) {
|
21170 | return new DirentFromStats(name, stats);
|
21171 | }
|
21172 | exports.createDirentFromStats = createDirentFromStats;
|
21173 |
|
21174 |
|
21175 | }),
|
21176 |
|
21177 | (function(module, exports, __webpack_require__) {
|
21178 |
|
21179 | "use strict";
|
21180 |
|
21181 | Object.defineProperty(exports, "__esModule", { value: true });
|
21182 | const fsStat = __webpack_require__(100);
|
21183 | const constants_1 = __webpack_require__(111);
|
21184 | const utils = __webpack_require__(112);
|
21185 | function read(directory, settings) {
|
21186 | if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
21187 | return readdirWithFileTypes(directory, settings);
|
21188 | }
|
21189 | return readdir(directory, settings);
|
21190 | }
|
21191 | exports.read = read;
|
21192 | function readdirWithFileTypes(directory, settings) {
|
21193 | const dirents = settings.fs.readdirSync(directory, { withFileTypes: true });
|
21194 | return dirents.map((dirent) => {
|
21195 | const entry = {
|
21196 | dirent,
|
21197 | name: dirent.name,
|
21198 | path: `${directory}${settings.pathSegmentSeparator}${dirent.name}`
|
21199 | };
|
21200 | if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) {
|
21201 | try {
|
21202 | const stats = settings.fs.statSync(entry.path);
|
21203 | entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
|
21204 | }
|
21205 | catch (error) {
|
21206 | if (settings.throwErrorOnBrokenSymbolicLink) {
|
21207 | throw error;
|
21208 | }
|
21209 | }
|
21210 | }
|
21211 | return entry;
|
21212 | });
|
21213 | }
|
21214 | exports.readdirWithFileTypes = readdirWithFileTypes;
|
21215 | function readdir(directory, settings) {
|
21216 | const names = settings.fs.readdirSync(directory);
|
21217 | return names.map((name) => {
|
21218 | const entryPath = `${directory}${settings.pathSegmentSeparator}${name}`;
|
21219 | const stats = fsStat.statSync(entryPath, settings.fsStatSettings);
|
21220 | const entry = {
|
21221 | name,
|
21222 | path: entryPath,
|
21223 | dirent: utils.fs.createDirentFromStats(name, stats)
|
21224 | };
|
21225 | if (settings.stats) {
|
21226 | entry.stats = stats;
|
21227 | }
|
21228 | return entry;
|
21229 | });
|
21230 | }
|
21231 | exports.readdir = readdir;
|
21232 |
|
21233 |
|
21234 | }),
|
21235 |
|
21236 | (function(module, exports, __webpack_require__) {
|
21237 |
|
21238 | "use strict";
|
21239 |
|
21240 | Object.defineProperty(exports, "__esModule", { value: true });
|
21241 | const path = __webpack_require__(13);
|
21242 | const fsStat = __webpack_require__(100);
|
21243 | const fs = __webpack_require__(116);
|
21244 | class Settings {
|
21245 | constructor(_options = {}) {
|
21246 | this._options = _options;
|
21247 | this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
|
21248 | this.fs = fs.createFileSystemAdapter(this._options.fs);
|
21249 | this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep);
|
21250 | this.stats = this._getValue(this._options.stats, false);
|
21251 | this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
|
21252 | this.fsStatSettings = new fsStat.Settings({
|
21253 | followSymbolicLink: this.followSymbolicLinks,
|
21254 | fs: this.fs,
|
21255 | throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink
|
21256 | });
|
21257 | }
|
21258 | _getValue(option, value) {
|
21259 | return option === undefined ? value : option;
|
21260 | }
|
21261 | }
|
21262 | exports.default = Settings;
|
21263 |
|
21264 |
|
21265 | }),
|
21266 |
|
21267 | (function(module, exports, __webpack_require__) {
|
21268 |
|
21269 | "use strict";
|
21270 |
|
21271 | Object.defineProperty(exports, "__esModule", { value: true });
|
21272 | const fs = __webpack_require__(40);
|
21273 | exports.FILE_SYSTEM_ADAPTER = {
|
21274 | lstat: fs.lstat,
|
21275 | stat: fs.stat,
|
21276 | lstatSync: fs.lstatSync,
|
21277 | statSync: fs.statSync,
|
21278 | readdir: fs.readdir,
|
21279 | readdirSync: fs.readdirSync
|
21280 | };
|
21281 | function createFileSystemAdapter(fsMethods) {
|
21282 | if (fsMethods === undefined) {
|
21283 | return exports.FILE_SYSTEM_ADAPTER;
|
21284 | }
|
21285 | return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
|
21286 | }
|
21287 | exports.createFileSystemAdapter = createFileSystemAdapter;
|
21288 |
|
21289 |
|
21290 | }),
|
21291 |
|
21292 | (function(module, exports, __webpack_require__) {
|
21293 |
|
21294 | "use strict";
|
21295 |
|
21296 |
|
21297 | var reusify = __webpack_require__(118)
|
21298 |
|
21299 | function fastqueue (context, worker, concurrency) {
|
21300 | if (typeof context === 'function') {
|
21301 | concurrency = worker
|
21302 | worker = context
|
21303 | context = null
|
21304 | }
|
21305 |
|
21306 | var cache = reusify(Task)
|
21307 | var queueHead = null
|
21308 | var queueTail = null
|
21309 | var _running = 0
|
21310 |
|
21311 | var self = {
|
21312 | push: push,
|
21313 | drain: noop,
|
21314 | saturated: noop,
|
21315 | pause: pause,
|
21316 | paused: false,
|
21317 | concurrency: concurrency,
|
21318 | running: running,
|
21319 | resume: resume,
|
21320 | idle: idle,
|
21321 | length: length,
|
21322 | unshift: unshift,
|
21323 | empty: noop,
|
21324 | kill: kill,
|
21325 | killAndDrain: killAndDrain
|
21326 | }
|
21327 |
|
21328 | return self
|
21329 |
|
21330 | function running () {
|
21331 | return _running
|
21332 | }
|
21333 |
|
21334 | function pause () {
|
21335 | self.paused = true
|
21336 | }
|
21337 |
|
21338 | function length () {
|
21339 | var current = queueHead
|
21340 | var counter = 0
|
21341 |
|
21342 | while (current) {
|
21343 | current = current.next
|
21344 | counter++
|
21345 | }
|
21346 |
|
21347 | return counter
|
21348 | }
|
21349 |
|
21350 | function resume () {
|
21351 | if (!self.paused) return
|
21352 | self.paused = false
|
21353 | for (var i = 0; i < self.concurrency; i++) {
|
21354 | _running++
|
21355 | release()
|
21356 | }
|
21357 | }
|
21358 |
|
21359 | function idle () {
|
21360 | return _running === 0 && self.length() === 0
|
21361 | }
|
21362 |
|
21363 | function push (value, done) {
|
21364 | var current = cache.get()
|
21365 |
|
21366 | current.context = context
|
21367 | current.release = release
|
21368 | current.value = value
|
21369 | current.callback = done || noop
|
21370 |
|
21371 | if (_running === self.concurrency || self.paused) {
|
21372 | if (queueTail) {
|
21373 | queueTail.next = current
|
21374 | queueTail = current
|
21375 | } else {
|
21376 | queueHead = current
|
21377 | queueTail = current
|
21378 | self.saturated()
|
21379 | }
|
21380 | } else {
|
21381 | _running++
|
21382 | worker.call(context, current.value, current.worked)
|
21383 | }
|
21384 | }
|
21385 |
|
21386 | function unshift (value, done) {
|
21387 | var current = cache.get()
|
21388 |
|
21389 | current.context = context
|
21390 | current.release = release
|
21391 | current.value = value
|
21392 | current.callback = done || noop
|
21393 |
|
21394 | if (_running === self.concurrency || self.paused) {
|
21395 | if (queueHead) {
|
21396 | current.next = queueHead
|
21397 | queueHead = current
|
21398 | } else {
|
21399 | queueHead = current
|
21400 | queueTail = current
|
21401 | self.saturated()
|
21402 | }
|
21403 | } else {
|
21404 | _running++
|
21405 | worker.call(context, current.value, current.worked)
|
21406 | }
|
21407 | }
|
21408 |
|
21409 | function release (holder) {
|
21410 | if (holder) {
|
21411 | cache.release(holder)
|
21412 | }
|
21413 | var next = queueHead
|
21414 | if (next) {
|
21415 | if (!self.paused) {
|
21416 | if (queueTail === queueHead) {
|
21417 | queueTail = null
|
21418 | }
|
21419 | queueHead = next.next
|
21420 | next.next = null
|
21421 | worker.call(context, next.value, next.worked)
|
21422 | if (queueTail === null) {
|
21423 | self.empty()
|
21424 | }
|
21425 | } else {
|
21426 | _running--
|
21427 | }
|
21428 | } else if (--_running === 0) {
|
21429 | self.drain()
|
21430 | }
|
21431 | }
|
21432 |
|
21433 | function kill () {
|
21434 | queueHead = null
|
21435 | queueTail = null
|
21436 | self.drain = noop
|
21437 | }
|
21438 |
|
21439 | function killAndDrain () {
|
21440 | queueHead = null
|
21441 | queueTail = null
|
21442 | self.drain()
|
21443 | self.drain = noop
|
21444 | }
|
21445 | }
|
21446 |
|
21447 | function noop () {}
|
21448 |
|
21449 | function Task () {
|
21450 | this.value = null
|
21451 | this.callback = noop
|
21452 | this.next = null
|
21453 | this.release = noop
|
21454 | this.context = null
|
21455 |
|
21456 | var self = this
|
21457 |
|
21458 | this.worked = function worked (err, result) {
|
21459 | var callback = self.callback
|
21460 | self.value = null
|
21461 | self.callback = noop
|
21462 | callback.call(self.context, err, result)
|
21463 | self.release(self)
|
21464 | }
|
21465 | }
|
21466 |
|
21467 | module.exports = fastqueue
|
21468 |
|
21469 |
|
21470 | }),
|
21471 |
|
21472 | (function(module, exports, __webpack_require__) {
|
21473 |
|
21474 | "use strict";
|
21475 |
|
21476 |
|
21477 | function reusify (Constructor) {
|
21478 | var head = new Constructor()
|
21479 | var tail = head
|
21480 |
|
21481 | function get () {
|
21482 | var current = head
|
21483 |
|
21484 | if (current.next) {
|
21485 | head = current.next
|
21486 | } else {
|
21487 | head = new Constructor()
|
21488 | tail = head
|
21489 | }
|
21490 |
|
21491 | current.next = null
|
21492 |
|
21493 | return current
|
21494 | }
|
21495 |
|
21496 | function release (obj) {
|
21497 | tail.next = obj
|
21498 | tail = obj
|
21499 | }
|
21500 |
|
21501 | return {
|
21502 | get: get,
|
21503 | release: release
|
21504 | }
|
21505 | }
|
21506 |
|
21507 | module.exports = reusify
|
21508 |
|
21509 |
|
21510 | /***/ }),
|
21511 | /* 119 */
|
21512 | /***/ (function(module, exports, __webpack_require__) {
|
21513 |
|
21514 | "use strict";
|
21515 |
|
21516 | Object.defineProperty(exports, "__esModule", { value: true });
|
21517 | function isFatalError(settings, error) {
|
21518 | if (settings.errorFilter === null) {
|
21519 | return true;
|
21520 | }
|
21521 | return !settings.errorFilter(error);
|
21522 | }
|
21523 | exports.isFatalError = isFatalError;
|
21524 | function isAppliedFilter(filter, value) {
|
21525 | return filter === null || filter(value);
|
21526 | }
|
21527 | exports.isAppliedFilter = isAppliedFilter;
|
21528 | function replacePathSegmentSeparator(filepath, separator) {
|
21529 | return filepath.split(/[\\/]/).join(separator);
|
21530 | }
|
21531 | exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
|
21532 | function joinPathSegments(a, b, separator) {
|
21533 | if (a === '') {
|
21534 | return b;
|
21535 | }
|
21536 | return a + separator + b;
|
21537 | }
|
21538 | exports.joinPathSegments = joinPathSegments;
|
21539 |
|
21540 |
|
21541 | }),
|
21542 |
|
21543 | (function(module, exports, __webpack_require__) {
|
21544 |
|
21545 | "use strict";
|
21546 |
|
21547 | Object.defineProperty(exports, "__esModule", { value: true });
|
21548 | const common = __webpack_require__(119);
|
21549 | class Reader {
|
21550 | constructor(_root, _settings) {
|
21551 | this._root = _root;
|
21552 | this._settings = _settings;
|
21553 | this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator);
|
21554 | }
|
21555 | }
|
21556 | exports.default = Reader;
|
21557 |
|
21558 |
|
21559 | }),
|
21560 |
|
21561 | (function(module, exports, __webpack_require__) {
|
21562 |
|
21563 | "use strict";
|
21564 |
|
21565 | Object.defineProperty(exports, "__esModule", { value: true });
|
21566 | const stream_1 = __webpack_require__(96);
|
21567 | const async_1 = __webpack_require__(107);
|
21568 | class StreamProvider {
|
21569 | constructor(_root, _settings) {
|
21570 | this._root = _root;
|
21571 | this._settings = _settings;
|
21572 | this._reader = new async_1.default(this._root, this._settings);
|
21573 | this._stream = new stream_1.Readable({
|
21574 | objectMode: true,
|
21575 | read: () => { },
|
21576 | destroy: this._reader.destroy.bind(this._reader)
|
21577 | });
|
21578 | }
|
21579 | read() {
|
21580 | this._reader.onError((error) => {
|
21581 | this._stream.emit('error', error);
|
21582 | });
|
21583 | this._reader.onEntry((entry) => {
|
21584 | this._stream.push(entry);
|
21585 | });
|
21586 | this._reader.onEnd(() => {
|
21587 | this._stream.push(null);
|
21588 | });
|
21589 | this._reader.read();
|
21590 | return this._stream;
|
21591 | }
|
21592 | }
|
21593 | exports.default = StreamProvider;
|
21594 |
|
21595 |
|
21596 | }),
|
21597 |
|
21598 | (function(module, exports, __webpack_require__) {
|
21599 |
|
21600 | "use strict";
|
21601 |
|
21602 | Object.defineProperty(exports, "__esModule", { value: true });
|
21603 | const sync_1 = __webpack_require__(123);
|
21604 | class SyncProvider {
|
21605 | constructor(_root, _settings) {
|
21606 | this._root = _root;
|
21607 | this._settings = _settings;
|
21608 | this._reader = new sync_1.default(this._root, this._settings);
|
21609 | }
|
21610 | read() {
|
21611 | return this._reader.read();
|
21612 | }
|
21613 | }
|
21614 | exports.default = SyncProvider;
|
21615 |
|
21616 |
|
21617 | }),
|
21618 |
|
21619 | (function(module, exports, __webpack_require__) {
|
21620 |
|
21621 | "use strict";
|
21622 |
|
21623 | Object.defineProperty(exports, "__esModule", { value: true });
|
21624 | const fsScandir = __webpack_require__(108);
|
21625 | const common = __webpack_require__(119);
|
21626 | const reader_1 = __webpack_require__(120);
|
21627 | class SyncReader extends reader_1.default {
|
21628 | constructor() {
|
21629 | super(...arguments);
|
21630 | this._scandir = fsScandir.scandirSync;
|
21631 | this._storage = new Set();
|
21632 | this._queue = new Set();
|
21633 | }
|
21634 | read() {
|
21635 | this._pushToQueue(this._root, this._settings.basePath);
|
21636 | this._handleQueue();
|
21637 | return [...this._storage];
|
21638 | }
|
21639 | _pushToQueue(directory, base) {
|
21640 | this._queue.add({ directory, base });
|
21641 | }
|
21642 | _handleQueue() {
|
21643 | for (const item of this._queue.values()) {
|
21644 | this._handleDirectory(item.directory, item.base);
|
21645 | }
|
21646 | }
|
21647 | _handleDirectory(directory, base) {
|
21648 | try {
|
21649 | const entries = this._scandir(directory, this._settings.fsScandirSettings);
|
21650 | for (const entry of entries) {
|
21651 | this._handleEntry(entry, base);
|
21652 | }
|
21653 | }
|
21654 | catch (error) {
|
21655 | this._handleError(error);
|
21656 | }
|
21657 | }
|
21658 | _handleError(error) {
|
21659 | if (!common.isFatalError(this._settings, error)) {
|
21660 | return;
|
21661 | }
|
21662 | throw error;
|
21663 | }
|
21664 | _handleEntry(entry, base) {
|
21665 | const fullpath = entry.path;
|
21666 | if (base !== undefined) {
|
21667 | entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
|
21668 | }
|
21669 | if (common.isAppliedFilter(this._settings.entryFilter, entry)) {
|
21670 | this._pushToStorage(entry);
|
21671 | }
|
21672 | if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) {
|
21673 | this._pushToQueue(fullpath, entry.path);
|
21674 | }
|
21675 | }
|
21676 | _pushToStorage(entry) {
|
21677 | this._storage.add(entry);
|
21678 | }
|
21679 | }
|
21680 | exports.default = SyncReader;
|
21681 |
|
21682 |
|
21683 | }),
|
21684 |
|
21685 | (function(module, exports, __webpack_require__) {
|
21686 |
|
21687 | "use strict";
|
21688 |
|
21689 | Object.defineProperty(exports, "__esModule", { value: true });
|
21690 | const path = __webpack_require__(13);
|
21691 | const fsScandir = __webpack_require__(108);
|
21692 | class Settings {
|
21693 | constructor(_options = {}) {
|
21694 | this._options = _options;
|
21695 | this.basePath = this._getValue(this._options.basePath, undefined);
|
21696 | this.concurrency = this._getValue(this._options.concurrency, Infinity);
|
21697 | this.deepFilter = this._getValue(this._options.deepFilter, null);
|
21698 | this.entryFilter = this._getValue(this._options.entryFilter, null);
|
21699 | this.errorFilter = this._getValue(this._options.errorFilter, null);
|
21700 | this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep);
|
21701 | this.fsScandirSettings = new fsScandir.Settings({
|
21702 | followSymbolicLinks: this._options.followSymbolicLinks,
|
21703 | fs: this._options.fs,
|
21704 | pathSegmentSeparator: this._options.pathSegmentSeparator,
|
21705 | stats: this._options.stats,
|
21706 | throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink
|
21707 | });
|
21708 | }
|
21709 | _getValue(option, value) {
|
21710 | return option === undefined ? value : option;
|
21711 | }
|
21712 | }
|
21713 | exports.default = Settings;
|
21714 |
|
21715 |
|
21716 | }),
|
21717 |
|
21718 | (function(module, exports, __webpack_require__) {
|
21719 |
|
21720 | "use strict";
|
21721 |
|
21722 | Object.defineProperty(exports, "__esModule", { value: true });
|
21723 | const path = __webpack_require__(13);
|
21724 | const fsStat = __webpack_require__(100);
|
21725 | const utils = __webpack_require__(62);
|
21726 | class Reader {
|
21727 | constructor(_settings) {
|
21728 | this._settings = _settings;
|
21729 | this._fsStatSettings = new fsStat.Settings({
|
21730 | followSymbolicLink: this._settings.followSymbolicLinks,
|
21731 | fs: this._settings.fs,
|
21732 | throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks
|
21733 | });
|
21734 | }
|
21735 | _getFullEntryPath(filepath) {
|
21736 | return path.resolve(this._settings.cwd, filepath);
|
21737 | }
|
21738 | _makeEntry(stats, pattern) {
|
21739 | const entry = {
|
21740 | name: pattern,
|
21741 | path: pattern,
|
21742 | dirent: utils.fs.createDirentFromStats(pattern, stats)
|
21743 | };
|
21744 | if (this._settings.stats) {
|
21745 | entry.stats = stats;
|
21746 | }
|
21747 | return entry;
|
21748 | }
|
21749 | _isFatalError(error) {
|
21750 | return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors;
|
21751 | }
|
21752 | }
|
21753 | exports.default = Reader;
|
21754 |
|
21755 |
|
21756 | }),
|
21757 |
|
21758 | (function(module, exports, __webpack_require__) {
|
21759 |
|
21760 | "use strict";
|
21761 |
|
21762 | Object.defineProperty(exports, "__esModule", { value: true });
|
21763 | const path = __webpack_require__(13);
|
21764 | const deep_1 = __webpack_require__(127);
|
21765 | const entry_1 = __webpack_require__(130);
|
21766 | const error_1 = __webpack_require__(131);
|
21767 | const entry_2 = __webpack_require__(132);
|
21768 | class Provider {
|
21769 | constructor(_settings) {
|
21770 | this._settings = _settings;
|
21771 | this.errorFilter = new error_1.default(this._settings);
|
21772 | this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions());
|
21773 | this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions());
|
21774 | this.entryTransformer = new entry_2.default(this._settings);
|
21775 | }
|
21776 | _getRootDirectory(task) {
|
21777 | return path.resolve(this._settings.cwd, task.base);
|
21778 | }
|
21779 | _getReaderOptions(task) {
|
21780 | const basePath = task.base === '.' ? '' : task.base;
|
21781 | return {
|
21782 | basePath,
|
21783 | pathSegmentSeparator: '/',
|
21784 | concurrency: this._settings.concurrency,
|
21785 | deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative),
|
21786 | entryFilter: this.entryFilter.getFilter(task.positive, task.negative),
|
21787 | errorFilter: this.errorFilter.getFilter(),
|
21788 | followSymbolicLinks: this._settings.followSymbolicLinks,
|
21789 | fs: this._settings.fs,
|
21790 | stats: this._settings.stats,
|
21791 | throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink,
|
21792 | transform: this.entryTransformer.getTransformer()
|
21793 | };
|
21794 | }
|
21795 | _getMicromatchOptions() {
|
21796 | return {
|
21797 | dot: this._settings.dot,
|
21798 | matchBase: this._settings.baseNameMatch,
|
21799 | nobrace: !this._settings.braceExpansion,
|
21800 | nocase: !this._settings.caseSensitiveMatch,
|
21801 | noext: !this._settings.extglob,
|
21802 | noglobstar: !this._settings.globstar,
|
21803 | posix: true,
|
21804 | strictSlashes: false
|
21805 | };
|
21806 | }
|
21807 | }
|
21808 | exports.default = Provider;
|
21809 |
|
21810 |
|
21811 | }),
|
21812 |
|
21813 | (function(module, exports, __webpack_require__) {
|
21814 |
|
21815 | "use strict";
|
21816 |
|
21817 | Object.defineProperty(exports, "__esModule", { value: true });
|
21818 | const utils = __webpack_require__(62);
|
21819 | const partial_1 = __webpack_require__(128);
|
21820 | class DeepFilter {
|
21821 | constructor(_settings, _micromatchOptions) {
|
21822 | this._settings = _settings;
|
21823 | this._micromatchOptions = _micromatchOptions;
|
21824 | }
|
21825 | getFilter(basePath, positive, negative) {
|
21826 | const matcher = this._getMatcher(positive);
|
21827 | const negativeRe = this._getNegativePatternsRe(negative);
|
21828 | return (entry) => this._filter(basePath, entry, matcher, negativeRe);
|
21829 | }
|
21830 | _getMatcher(patterns) {
|
21831 | return new partial_1.default(patterns, this._settings, this._micromatchOptions);
|
21832 | }
|
21833 | _getNegativePatternsRe(patterns) {
|
21834 | const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern);
|
21835 | return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions);
|
21836 | }
|
21837 | _filter(basePath, entry, matcher, negativeRe) {
|
21838 | if (this._isSkippedByDeep(basePath, entry.path)) {
|
21839 | return false;
|
21840 | }
|
21841 | if (this._isSkippedSymbolicLink(entry)) {
|
21842 | return false;
|
21843 | }
|
21844 | const filepath = utils.path.removeLeadingDotSegment(entry.path);
|
21845 | if (this._isSkippedByPositivePatterns(filepath, matcher)) {
|
21846 | return false;
|
21847 | }
|
21848 | return this._isSkippedByNegativePatterns(filepath, negativeRe);
|
21849 | }
|
21850 | _isSkippedByDeep(basePath, entryPath) {
|
21851 | |
21852 |
|
21853 |
|
21854 | if (this._settings.deep === Infinity) {
|
21855 | return false;
|
21856 | }
|
21857 | return this._getEntryLevel(basePath, entryPath) >= this._settings.deep;
|
21858 | }
|
21859 | _getEntryLevel(basePath, entryPath) {
|
21860 | const entryPathDepth = entryPath.split('/').length;
|
21861 | if (basePath === '') {
|
21862 | return entryPathDepth;
|
21863 | }
|
21864 | const basePathDepth = basePath.split('/').length;
|
21865 | return entryPathDepth - basePathDepth;
|
21866 | }
|
21867 | _isSkippedSymbolicLink(entry) {
|
21868 | return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
|
21869 | }
|
21870 | _isSkippedByPositivePatterns(entryPath, matcher) {
|
21871 | return !this._settings.baseNameMatch && !matcher.match(entryPath);
|
21872 | }
|
21873 | _isSkippedByNegativePatterns(entryPath, patternsRe) {
|
21874 | return !utils.pattern.matchAny(entryPath, patternsRe);
|
21875 | }
|
21876 | }
|
21877 | exports.default = DeepFilter;
|
21878 |
|
21879 |
|
21880 | }),
|
21881 |
|
21882 | (function(module, exports, __webpack_require__) {
|
21883 |
|
21884 | "use strict";
|
21885 |
|
21886 | Object.defineProperty(exports, "__esModule", { value: true });
|
21887 | const matcher_1 = __webpack_require__(129);
|
21888 | class PartialMatcher extends matcher_1.default {
|
21889 | match(filepath) {
|
21890 | const parts = filepath.split('/');
|
21891 | const levels = parts.length;
|
21892 | const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels);
|
21893 | for (const pattern of patterns) {
|
21894 | const section = pattern.sections[0];
|
21895 | |
21896 |
|
21897 |
|
21898 |
|
21899 |
|
21900 |
|
21901 |
|
21902 | if (!pattern.complete && levels > section.length) {
|
21903 | return true;
|
21904 | }
|
21905 | const match = parts.every((part, index) => {
|
21906 | const segment = pattern.segments[index];
|
21907 | if (segment.dynamic && segment.patternRe.test(part)) {
|
21908 | return true;
|
21909 | }
|
21910 | if (!segment.dynamic && segment.pattern === part) {
|
21911 | return true;
|
21912 | }
|
21913 | return false;
|
21914 | });
|
21915 | if (match) {
|
21916 | return true;
|
21917 | }
|
21918 | }
|
21919 | return false;
|
21920 | }
|
21921 | }
|
21922 | exports.default = PartialMatcher;
|
21923 |
|
21924 |
|
21925 | }),
|
21926 |
|
21927 | (function(module, exports, __webpack_require__) {
|
21928 |
|
21929 | "use strict";
|
21930 |
|
21931 | Object.defineProperty(exports, "__esModule", { value: true });
|
21932 | const utils = __webpack_require__(62);
|
21933 | class Matcher {
|
21934 | constructor(_patterns, _settings, _micromatchOptions) {
|
21935 | this._patterns = _patterns;
|
21936 | this._settings = _settings;
|
21937 | this._micromatchOptions = _micromatchOptions;
|
21938 | this._storage = [];
|
21939 | this._fillStorage();
|
21940 | }
|
21941 | _fillStorage() {
|
21942 | |
21943 |
|
21944 |
|
21945 |
|
21946 | const patterns = utils.pattern.expandPatternsWithBraceExpansion(this._patterns);
|
21947 | for (const pattern of patterns) {
|
21948 | const segments = this._getPatternSegments(pattern);
|
21949 | const sections = this._splitSegmentsIntoSections(segments);
|
21950 | this._storage.push({
|
21951 | complete: sections.length <= 1,
|
21952 | pattern,
|
21953 | segments,
|
21954 | sections
|
21955 | });
|
21956 | }
|
21957 | }
|
21958 | _getPatternSegments(pattern) {
|
21959 | const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions);
|
21960 | return parts.map((part) => {
|
21961 | const dynamic = utils.pattern.isDynamicPattern(part, this._settings);
|
21962 | if (!dynamic) {
|
21963 | return {
|
21964 | dynamic: false,
|
21965 | pattern: part
|
21966 | };
|
21967 | }
|
21968 | return {
|
21969 | dynamic: true,
|
21970 | pattern: part,
|
21971 | patternRe: utils.pattern.makeRe(part, this._micromatchOptions)
|
21972 | };
|
21973 | });
|
21974 | }
|
21975 | _splitSegmentsIntoSections(segments) {
|
21976 | return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern));
|
21977 | }
|
21978 | }
|
21979 | exports.default = Matcher;
|
21980 |
|
21981 |
|
21982 | }),
|
21983 |
|
21984 | (function(module, exports, __webpack_require__) {
|
21985 |
|
21986 | "use strict";
|
21987 |
|
21988 | Object.defineProperty(exports, "__esModule", { value: true });
|
21989 | const utils = __webpack_require__(62);
|
21990 | class EntryFilter {
|
21991 | constructor(_settings, _micromatchOptions) {
|
21992 | this._settings = _settings;
|
21993 | this._micromatchOptions = _micromatchOptions;
|
21994 | this.index = new Map();
|
21995 | }
|
21996 | getFilter(positive, negative) {
|
21997 | const positiveRe = utils.pattern.convertPatternsToRe(positive, this._micromatchOptions);
|
21998 | const negativeRe = utils.pattern.convertPatternsToRe(negative, this._micromatchOptions);
|
21999 | return (entry) => this._filter(entry, positiveRe, negativeRe);
|
22000 | }
|
22001 | _filter(entry, positiveRe, negativeRe) {
|
22002 | if (this._settings.unique && this._isDuplicateEntry(entry)) {
|
22003 | return false;
|
22004 | }
|
22005 | if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) {
|
22006 | return false;
|
22007 | }
|
22008 | if (this._isSkippedByAbsoluteNegativePatterns(entry.path, negativeRe)) {
|
22009 | return false;
|
22010 | }
|
22011 | const filepath = this._settings.baseNameMatch ? entry.name : entry.path;
|
22012 | const isMatched = this._isMatchToPatterns(filepath, positiveRe) && !this._isMatchToPatterns(entry.path, negativeRe);
|
22013 | if (this._settings.unique && isMatched) {
|
22014 | this._createIndexRecord(entry);
|
22015 | }
|
22016 | return isMatched;
|
22017 | }
|
22018 | _isDuplicateEntry(entry) {
|
22019 | return this.index.has(entry.path);
|
22020 | }
|
22021 | _createIndexRecord(entry) {
|
22022 | this.index.set(entry.path, undefined);
|
22023 | }
|
22024 | _onlyFileFilter(entry) {
|
22025 | return this._settings.onlyFiles && !entry.dirent.isFile();
|
22026 | }
|
22027 | _onlyDirectoryFilter(entry) {
|
22028 | return this._settings.onlyDirectories && !entry.dirent.isDirectory();
|
22029 | }
|
22030 | _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) {
|
22031 | if (!this._settings.absolute) {
|
22032 | return false;
|
22033 | }
|
22034 | const fullpath = utils.path.makeAbsolute(this._settings.cwd, entryPath);
|
22035 | return utils.pattern.matchAny(fullpath, patternsRe);
|
22036 | }
|
22037 | _isMatchToPatterns(entryPath, patternsRe) {
|
22038 | const filepath = utils.path.removeLeadingDotSegment(entryPath);
|
22039 | return utils.pattern.matchAny(filepath, patternsRe);
|
22040 | }
|
22041 | }
|
22042 | exports.default = EntryFilter;
|
22043 |
|
22044 |
|
22045 | }),
|
22046 |
|
22047 | (function(module, exports, __webpack_require__) {
|
22048 |
|
22049 | "use strict";
|
22050 |
|
22051 | Object.defineProperty(exports, "__esModule", { value: true });
|
22052 | const utils = __webpack_require__(62);
|
22053 | class ErrorFilter {
|
22054 | constructor(_settings) {
|
22055 | this._settings = _settings;
|
22056 | }
|
22057 | getFilter() {
|
22058 | return (error) => this._isNonFatalError(error);
|
22059 | }
|
22060 | _isNonFatalError(error) {
|
22061 | return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors;
|
22062 | }
|
22063 | }
|
22064 | exports.default = ErrorFilter;
|
22065 |
|
22066 |
|
22067 | }),
|
22068 |
|
22069 | (function(module, exports, __webpack_require__) {
|
22070 |
|
22071 | "use strict";
|
22072 |
|
22073 | Object.defineProperty(exports, "__esModule", { value: true });
|
22074 | const utils = __webpack_require__(62);
|
22075 | class EntryTransformer {
|
22076 | constructor(_settings) {
|
22077 | this._settings = _settings;
|
22078 | }
|
22079 | getTransformer() {
|
22080 | return (entry) => this._transform(entry);
|
22081 | }
|
22082 | _transform(entry) {
|
22083 | let filepath = entry.path;
|
22084 | if (this._settings.absolute) {
|
22085 | filepath = utils.path.makeAbsolute(this._settings.cwd, filepath);
|
22086 | filepath = utils.path.unixify(filepath);
|
22087 | }
|
22088 | if (this._settings.markDirectories && entry.dirent.isDirectory()) {
|
22089 | filepath += '/';
|
22090 | }
|
22091 | if (!this._settings.objectMode) {
|
22092 | return filepath;
|
22093 | }
|
22094 | return Object.assign(Object.assign({}, entry), { path: filepath });
|
22095 | }
|
22096 | }
|
22097 | exports.default = EntryTransformer;
|
22098 |
|
22099 |
|
22100 | }),
|
22101 |
|
22102 | (function(module, exports, __webpack_require__) {
|
22103 |
|
22104 | "use strict";
|
22105 |
|
22106 | Object.defineProperty(exports, "__esModule", { value: true });
|
22107 | const stream_1 = __webpack_require__(96);
|
22108 | const stream_2 = __webpack_require__(99);
|
22109 | const provider_1 = __webpack_require__(126);
|
22110 | class ProviderStream extends provider_1.default {
|
22111 | constructor() {
|
22112 | super(...arguments);
|
22113 | this._reader = new stream_2.default(this._settings);
|
22114 | }
|
22115 | read(task) {
|
22116 | const root = this._getRootDirectory(task);
|
22117 | const options = this._getReaderOptions(task);
|
22118 | const source = this.api(root, task, options);
|
22119 | const destination = new stream_1.Readable({ objectMode: true, read: () => { } });
|
22120 | source
|
22121 | .once('error', (error) => destination.emit('error', error))
|
22122 | .on('data', (entry) => destination.emit('data', options.transform(entry)))
|
22123 | .once('end', () => destination.emit('end'));
|
22124 | destination
|
22125 | .once('close', () => source.destroy());
|
22126 | return destination;
|
22127 | }
|
22128 | api(root, task, options) {
|
22129 | if (task.dynamic) {
|
22130 | return this._reader.dynamic(root, options);
|
22131 | }
|
22132 | return this._reader.static(task.patterns, options);
|
22133 | }
|
22134 | }
|
22135 | exports.default = ProviderStream;
|
22136 |
|
22137 |
|
22138 | }),
|
22139 |
|
22140 | (function(module, exports, __webpack_require__) {
|
22141 |
|
22142 | "use strict";
|
22143 |
|
22144 | Object.defineProperty(exports, "__esModule", { value: true });
|
22145 | const sync_1 = __webpack_require__(135);
|
22146 | const provider_1 = __webpack_require__(126);
|
22147 | class ProviderSync extends provider_1.default {
|
22148 | constructor() {
|
22149 | super(...arguments);
|
22150 | this._reader = new sync_1.default(this._settings);
|
22151 | }
|
22152 | read(task) {
|
22153 | const root = this._getRootDirectory(task);
|
22154 | const options = this._getReaderOptions(task);
|
22155 | const entries = this.api(root, task, options);
|
22156 | return entries.map(options.transform);
|
22157 | }
|
22158 | api(root, task, options) {
|
22159 | if (task.dynamic) {
|
22160 | return this._reader.dynamic(root, options);
|
22161 | }
|
22162 | return this._reader.static(task.patterns, options);
|
22163 | }
|
22164 | }
|
22165 | exports.default = ProviderSync;
|
22166 |
|
22167 |
|
22168 | }),
|
22169 |
|
22170 | (function(module, exports, __webpack_require__) {
|
22171 |
|
22172 | "use strict";
|
22173 |
|
22174 | Object.defineProperty(exports, "__esModule", { value: true });
|
22175 | const fsStat = __webpack_require__(100);
|
22176 | const fsWalk = __webpack_require__(105);
|
22177 | const reader_1 = __webpack_require__(125);
|
22178 | class ReaderSync extends reader_1.default {
|
22179 | constructor() {
|
22180 | super(...arguments);
|
22181 | this._walkSync = fsWalk.walkSync;
|
22182 | this._statSync = fsStat.statSync;
|
22183 | }
|
22184 | dynamic(root, options) {
|
22185 | return this._walkSync(root, options);
|
22186 | }
|
22187 | static(patterns, options) {
|
22188 | const entries = [];
|
22189 | for (const pattern of patterns) {
|
22190 | const filepath = this._getFullEntryPath(pattern);
|
22191 | const entry = this._getEntry(filepath, pattern, options);
|
22192 | if (entry === null || !options.entryFilter(entry)) {
|
22193 | continue;
|
22194 | }
|
22195 | entries.push(entry);
|
22196 | }
|
22197 | return entries;
|
22198 | }
|
22199 | _getEntry(filepath, pattern, options) {
|
22200 | try {
|
22201 | const stats = this._getStat(filepath);
|
22202 | return this._makeEntry(stats, pattern);
|
22203 | }
|
22204 | catch (error) {
|
22205 | if (options.errorFilter(error)) {
|
22206 | return null;
|
22207 | }
|
22208 | throw error;
|
22209 | }
|
22210 | }
|
22211 | _getStat(filepath) {
|
22212 | return this._statSync(filepath, this._fsStatSettings);
|
22213 | }
|
22214 | }
|
22215 | exports.default = ReaderSync;
|
22216 |
|
22217 |
|
22218 | }),
|
22219 |
|
22220 | (function(module, exports, __webpack_require__) {
|
22221 |
|
22222 | "use strict";
|
22223 |
|
22224 | Object.defineProperty(exports, "__esModule", { value: true });
|
22225 | exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
|
22226 | const fs = __webpack_require__(40);
|
22227 | const os = __webpack_require__(14);
|
22228 | const CPU_COUNT = os.cpus().length;
|
22229 | exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
|
22230 | lstat: fs.lstat,
|
22231 | lstatSync: fs.lstatSync,
|
22232 | stat: fs.stat,
|
22233 | statSync: fs.statSync,
|
22234 | readdir: fs.readdir,
|
22235 | readdirSync: fs.readdirSync
|
22236 | };
|
22237 | class Settings {
|
22238 | constructor(_options = {}) {
|
22239 | this._options = _options;
|
22240 | this.absolute = this._getValue(this._options.absolute, false);
|
22241 | this.baseNameMatch = this._getValue(this._options.baseNameMatch, false);
|
22242 | this.braceExpansion = this._getValue(this._options.braceExpansion, true);
|
22243 | this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true);
|
22244 | this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT);
|
22245 | this.cwd = this._getValue(this._options.cwd, process.cwd());
|
22246 | this.deep = this._getValue(this._options.deep, Infinity);
|
22247 | this.dot = this._getValue(this._options.dot, false);
|
22248 | this.extglob = this._getValue(this._options.extglob, true);
|
22249 | this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true);
|
22250 | this.fs = this._getFileSystemMethods(this._options.fs);
|
22251 | this.globstar = this._getValue(this._options.globstar, true);
|
22252 | this.ignore = this._getValue(this._options.ignore, []);
|
22253 | this.markDirectories = this._getValue(this._options.markDirectories, false);
|
22254 | this.objectMode = this._getValue(this._options.objectMode, false);
|
22255 | this.onlyDirectories = this._getValue(this._options.onlyDirectories, false);
|
22256 | this.onlyFiles = this._getValue(this._options.onlyFiles, true);
|
22257 | this.stats = this._getValue(this._options.stats, false);
|
22258 | this.suppressErrors = this._getValue(this._options.suppressErrors, false);
|
22259 | this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false);
|
22260 | this.unique = this._getValue(this._options.unique, true);
|
22261 | if (this.onlyDirectories) {
|
22262 | this.onlyFiles = false;
|
22263 | }
|
22264 | if (this.stats) {
|
22265 | this.objectMode = true;
|
22266 | }
|
22267 | }
|
22268 | _getValue(option, value) {
|
22269 | return option === undefined ? value : option;
|
22270 | }
|
22271 | _getFileSystemMethods(methods = {}) {
|
22272 | return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods);
|
22273 | }
|
22274 | }
|
22275 | exports.default = Settings;
|
22276 |
|
22277 |
|
22278 | }),
|
22279 | ,
|
22280 | ,
|
22281 | ,
|
22282 | ,
|
22283 | ,
|
22284 | ,
|
22285 | ,
|
22286 | ,
|
22287 | ,
|
22288 | ,
|
22289 | ,
|
22290 | ,
|
22291 |
|
22292 | (function(module, __webpack_exports__, __webpack_require__) {
|
22293 |
|
22294 | "use strict";
|
22295 | __webpack_require__.r(__webpack_exports__);
|
22296 | __webpack_require__.d(__webpack_exports__, "URI", function() { return URI; });
|
22297 | __webpack_require__.d(__webpack_exports__, "uriToFsPath", function() { return uriToFsPath; });
|
22298 |
|
22299 |
|
22300 |
|
22301 |
|
22302 |
|
22303 | var __extends = (undefined && undefined.__extends) || (function () {
|
22304 | var extendStatics = function (d, b) {
|
22305 | extendStatics = Object.setPrototypeOf ||
|
22306 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
22307 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
22308 | return extendStatics(d, b);
|
22309 | };
|
22310 | return function (d, b) {
|
22311 | extendStatics(d, b);
|
22312 | function __() { this.constructor = d; }
|
22313 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
22314 | };
|
22315 | })();
|
22316 | var _a;
|
22317 | var isWindows;
|
22318 | if (typeof process === 'object') {
|
22319 | isWindows = process.platform === 'win32';
|
22320 | }
|
22321 | else if (typeof navigator === 'object') {
|
22322 | var userAgent = navigator.userAgent;
|
22323 | isWindows = userAgent.indexOf('Windows') >= 0;
|
22324 | }
|
22325 | function isHighSurrogate(charCode) {
|
22326 | return (0xD800 <= charCode && charCode <= 0xDBFF);
|
22327 | }
|
22328 | function isLowSurrogate(charCode) {
|
22329 | return (0xDC00 <= charCode && charCode <= 0xDFFF);
|
22330 | }
|
22331 | function isLowerAsciiHex(code) {
|
22332 | return code >= 97 && code <= 102 ;
|
22333 | }
|
22334 | function isLowerAsciiLetter(code) {
|
22335 | return code >= 97 && code <= 122 ;
|
22336 | }
|
22337 | function isUpperAsciiLetter(code) {
|
22338 | return code >= 65 && code <= 90 ;
|
22339 | }
|
22340 | function isAsciiLetter(code) {
|
22341 | return isLowerAsciiLetter(code) || isUpperAsciiLetter(code);
|
22342 | }
|
22343 |
|
22344 | var _schemePattern = /^\w[\w\d+.-]*$/;
|
22345 | var _singleSlashStart = /^\//;
|
22346 | var _doubleSlashStart = /^\/\//;
|
22347 | function _validateUri(ret, _strict) {
|
22348 |
|
22349 | if (!ret.scheme && _strict) {
|
22350 | throw new Error("[UriError]: Scheme is missing: {scheme: \"\", authority: \"" + ret.authority + "\", path: \"" + ret.path + "\", query: \"" + ret.query + "\", fragment: \"" + ret.fragment + "\"}");
|
22351 | }
|
22352 |
|
22353 |
|
22354 | if (ret.scheme && !_schemePattern.test(ret.scheme)) {
|
22355 | throw new Error('[UriError]: Scheme contains illegal characters.');
|
22356 | }
|
22357 |
|
22358 |
|
22359 |
|
22360 |
|
22361 |
|
22362 | if (ret.path) {
|
22363 | if (ret.authority) {
|
22364 | if (!_singleSlashStart.test(ret.path)) {
|
22365 | throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character');
|
22366 | }
|
22367 | }
|
22368 | else {
|
22369 | if (_doubleSlashStart.test(ret.path)) {
|
22370 | throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")');
|
22371 | }
|
22372 | }
|
22373 | }
|
22374 | }
|
22375 |
|
22376 |
|
22377 |
|
22378 |
|
22379 | function _schemeFix(scheme, _strict) {
|
22380 | if (!scheme && !_strict) {
|
22381 | return 'file';
|
22382 | }
|
22383 | return scheme;
|
22384 | }
|
22385 |
|
22386 | function _referenceResolution(scheme, path) {
|
22387 |
|
22388 |
|
22389 |
|
22390 |
|
22391 | switch (scheme) {
|
22392 | case 'https':
|
22393 | case 'http':
|
22394 | case 'file':
|
22395 | if (!path) {
|
22396 | path = _slash;
|
22397 | }
|
22398 | else if (path[0] !== _slash) {
|
22399 | path = _slash + path;
|
22400 | }
|
22401 | break;
|
22402 | }
|
22403 | return path;
|
22404 | }
|
22405 | var _empty = '';
|
22406 | var _slash = '/';
|
22407 | var _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;
|
22408 |
|
22409 |
|
22410 |
|
22411 |
|
22412 |
|
22413 |
|
22414 |
|
22415 |
|
22416 |
|
22417 |
|
22418 |
|
22419 |
|
22420 |
|
22421 |
|
22422 |
|
22423 |
|
22424 | var URI = (function () {
|
22425 | |
22426 |
|
22427 |
|
22428 | function URI(schemeOrData, authority, path, query, fragment, _strict) {
|
22429 | if (_strict === void 0) { _strict = false; }
|
22430 | if (typeof schemeOrData === 'object') {
|
22431 | this.scheme = schemeOrData.scheme || _empty;
|
22432 | this.authority = schemeOrData.authority || _empty;
|
22433 | this.path = schemeOrData.path || _empty;
|
22434 | this.query = schemeOrData.query || _empty;
|
22435 | this.fragment = schemeOrData.fragment || _empty;
|
22436 |
|
22437 |
|
22438 |
|
22439 | }
|
22440 | else {
|
22441 | this.scheme = _schemeFix(schemeOrData, _strict);
|
22442 | this.authority = authority || _empty;
|
22443 | this.path = _referenceResolution(this.scheme, path || _empty);
|
22444 | this.query = query || _empty;
|
22445 | this.fragment = fragment || _empty;
|
22446 | _validateUri(this, _strict);
|
22447 | }
|
22448 | }
|
22449 | URI.isUri = function (thing) {
|
22450 | if (thing instanceof URI) {
|
22451 | return true;
|
22452 | }
|
22453 | if (!thing) {
|
22454 | return false;
|
22455 | }
|
22456 | return typeof thing.authority === 'string'
|
22457 | && typeof thing.fragment === 'string'
|
22458 | && typeof thing.path === 'string'
|
22459 | && typeof thing.query === 'string'
|
22460 | && typeof thing.scheme === 'string'
|
22461 | && typeof thing.fsPath === 'function'
|
22462 | && typeof thing.with === 'function'
|
22463 | && typeof thing.toString === 'function';
|
22464 | };
|
22465 | Object.defineProperty(URI.prototype, "fsPath", {
|
22466 |
|
22467 | |
22468 |
|
22469 |
|
22470 |
|
22471 |
|
22472 |
|
22473 |
|
22474 |
|
22475 |
|
22476 |
|
22477 |
|
22478 |
|
22479 |
|
22480 |
|
22481 |
|
22482 |
|
22483 |
|
22484 |
|
22485 |
|
22486 |
|
22487 |
|
22488 |
|
22489 |
|
22490 |
|
22491 | get: function () {
|
22492 |
|
22493 |
|
22494 |
|
22495 | return uriToFsPath(this, false);
|
22496 | },
|
22497 | enumerable: true,
|
22498 | configurable: true
|
22499 | });
|
22500 |
|
22501 | URI.prototype.with = function (change) {
|
22502 | if (!change) {
|
22503 | return this;
|
22504 | }
|
22505 | var scheme = change.scheme, authority = change.authority, path = change.path, query = change.query, fragment = change.fragment;
|
22506 | if (scheme === undefined) {
|
22507 | scheme = this.scheme;
|
22508 | }
|
22509 | else if (scheme === null) {
|
22510 | scheme = _empty;
|
22511 | }
|
22512 | if (authority === undefined) {
|
22513 | authority = this.authority;
|
22514 | }
|
22515 | else if (authority === null) {
|
22516 | authority = _empty;
|
22517 | }
|
22518 | if (path === undefined) {
|
22519 | path = this.path;
|
22520 | }
|
22521 | else if (path === null) {
|
22522 | path = _empty;
|
22523 | }
|
22524 | if (query === undefined) {
|
22525 | query = this.query;
|
22526 | }
|
22527 | else if (query === null) {
|
22528 | query = _empty;
|
22529 | }
|
22530 | if (fragment === undefined) {
|
22531 | fragment = this.fragment;
|
22532 | }
|
22533 | else if (fragment === null) {
|
22534 | fragment = _empty;
|
22535 | }
|
22536 | if (scheme === this.scheme
|
22537 | && authority === this.authority
|
22538 | && path === this.path
|
22539 | && query === this.query
|
22540 | && fragment === this.fragment) {
|
22541 | return this;
|
22542 | }
|
22543 | return new _URI(scheme, authority, path, query, fragment);
|
22544 | };
|
22545 |
|
22546 | |
22547 |
|
22548 |
|
22549 |
|
22550 |
|
22551 |
|
22552 | URI.parse = function (value, _strict) {
|
22553 | if (_strict === void 0) { _strict = false; }
|
22554 | var match = _regexp.exec(value);
|
22555 | if (!match) {
|
22556 | return new _URI(_empty, _empty, _empty, _empty, _empty);
|
22557 | }
|
22558 | return new _URI(match[2] || _empty, percentDecode(match[4] || _empty), percentDecode(match[5] || _empty), percentDecode(match[7] || _empty), percentDecode(match[9] || _empty), _strict);
|
22559 | };
|
22560 | |
22561 |
|
22562 |
|
22563 |
|
22564 |
|
22565 |
|
22566 |
|
22567 |
|
22568 |
|
22569 |
|
22570 |
|
22571 |
|
22572 |
|
22573 |
|
22574 |
|
22575 |
|
22576 |
|
22577 |
|
22578 |
|
22579 |
|
22580 |
|
22581 | URI.file = function (path) {
|
22582 | var authority = _empty;
|
22583 |
|
22584 |
|
22585 |
|
22586 | if (isWindows) {
|
22587 | path = path.replace(/\\/g, _slash);
|
22588 | }
|
22589 |
|
22590 |
|
22591 | if (path[0] === _slash && path[1] === _slash) {
|
22592 | var idx = path.indexOf(_slash, 2);
|
22593 | if (idx === -1) {
|
22594 | authority = path.substring(2);
|
22595 | path = _slash;
|
22596 | }
|
22597 | else {
|
22598 | authority = path.substring(2, idx);
|
22599 | path = path.substring(idx) || _slash;
|
22600 | }
|
22601 | }
|
22602 | return new _URI('file', authority, path, _empty, _empty);
|
22603 | };
|
22604 | URI.from = function (components) {
|
22605 | return new _URI(components.scheme, components.authority, components.path, components.query, components.fragment);
|
22606 | };
|
22607 |
|
22608 |
|
22609 |
|
22610 |
|
22611 |
|
22612 |
|
22613 |
|
22614 |
|
22615 |
|
22616 |
|
22617 |
|
22618 |
|
22619 |
|
22620 |
|
22621 |
|
22622 |
|
22623 |
|
22624 |
|
22625 |
|
22626 |
|
22627 | |
22628 |
|
22629 |
|
22630 |
|
22631 |
|
22632 |
|
22633 |
|
22634 |
|
22635 |
|
22636 |
|
22637 |
|
22638 | URI.prototype.toString = function (skipEncoding) {
|
22639 | if (skipEncoding === void 0) { skipEncoding = false; }
|
22640 | return _asFormatted(this, skipEncoding);
|
22641 | };
|
22642 | URI.prototype.toJSON = function () {
|
22643 | return this;
|
22644 | };
|
22645 | URI.revive = function (data) {
|
22646 | if (!data) {
|
22647 | return data;
|
22648 | }
|
22649 | else if (data instanceof URI) {
|
22650 | return data;
|
22651 | }
|
22652 | else {
|
22653 | var result = new _URI(data);
|
22654 | result._formatted = data.external;
|
22655 | result._fsPath = data._sep === _pathSepMarker ? data.fsPath : null;
|
22656 | return result;
|
22657 | }
|
22658 | };
|
22659 | return URI;
|
22660 | }());
|
22661 |
|
22662 | var _pathSepMarker = isWindows ? 1 : undefined;
|
22663 |
|
22664 | var _URI = (function (_super) {
|
22665 | __extends(_URI, _super);
|
22666 | function _URI() {
|
22667 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
22668 | _this._formatted = null;
|
22669 | _this._fsPath = null;
|
22670 | return _this;
|
22671 | }
|
22672 | Object.defineProperty(_URI.prototype, "fsPath", {
|
22673 | get: function () {
|
22674 | if (!this._fsPath) {
|
22675 | this._fsPath = uriToFsPath(this, false);
|
22676 | }
|
22677 | return this._fsPath;
|
22678 | },
|
22679 | enumerable: true,
|
22680 | configurable: true
|
22681 | });
|
22682 | _URI.prototype.toString = function (skipEncoding) {
|
22683 | if (skipEncoding === void 0) { skipEncoding = false; }
|
22684 | if (!skipEncoding) {
|
22685 | if (!this._formatted) {
|
22686 | this._formatted = _asFormatted(this, false);
|
22687 | }
|
22688 | return this._formatted;
|
22689 | }
|
22690 | else {
|
22691 |
|
22692 | return _asFormatted(this, true);
|
22693 | }
|
22694 | };
|
22695 | _URI.prototype.toJSON = function () {
|
22696 | var res = {
|
22697 | $mid: 1
|
22698 | };
|
22699 |
|
22700 | if (this._fsPath) {
|
22701 | res.fsPath = this._fsPath;
|
22702 | res._sep = _pathSepMarker;
|
22703 | }
|
22704 | if (this._formatted) {
|
22705 | res.external = this._formatted;
|
22706 | }
|
22707 |
|
22708 | if (this.path) {
|
22709 | res.path = this.path;
|
22710 | }
|
22711 | if (this.scheme) {
|
22712 | res.scheme = this.scheme;
|
22713 | }
|
22714 | if (this.authority) {
|
22715 | res.authority = this.authority;
|
22716 | }
|
22717 | if (this.query) {
|
22718 | res.query = this.query;
|
22719 | }
|
22720 | if (this.fragment) {
|
22721 | res.fragment = this.fragment;
|
22722 | }
|
22723 | return res;
|
22724 | };
|
22725 | return _URI;
|
22726 | }(URI));
|
22727 |
|
22728 | var encodeTable = (_a = {},
|
22729 | _a[58 ] = '%3A',
|
22730 | _a[47 ] = '%2F',
|
22731 | _a[63 ] = '%3F',
|
22732 | _a[35 ] = '%23',
|
22733 | _a[91 ] = '%5B',
|
22734 | _a[93 ] = '%5D',
|
22735 | _a[64 ] = '%40',
|
22736 | _a[33 ] = '%21',
|
22737 | _a[36 ] = '%24',
|
22738 | _a[38 ] = '%26',
|
22739 | _a[39 ] = '%27',
|
22740 | _a[40 ] = '%28',
|
22741 | _a[41 ] = '%29',
|
22742 | _a[42 ] = '%2A',
|
22743 | _a[43 ] = '%2B',
|
22744 | _a[44 ] = '%2C',
|
22745 | _a[59 ] = '%3B',
|
22746 | _a[61 ] = '%3D',
|
22747 | _a[32 ] = '%20',
|
22748 | _a);
|
22749 | function encodeURIComponentFast(uriComponent, allowSlash) {
|
22750 | var res = undefined;
|
22751 | var nativeEncodePos = -1;
|
22752 | for (var pos = 0; pos < uriComponent.length; pos++) {
|
22753 | var code = uriComponent.charCodeAt(pos);
|
22754 |
|
22755 | if ((code >= 97 && code <= 122 )
|
22756 | || (code >= 65 && code <= 90 )
|
22757 | || (code >= 48 && code <= 57 )
|
22758 | || code === 45
|
22759 | || code === 46
|
22760 | || code === 95
|
22761 | || code === 126
|
22762 | || (allowSlash && code === 47 )) {
|
22763 |
|
22764 | if (nativeEncodePos !== -1) {
|
22765 | res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));
|
22766 | nativeEncodePos = -1;
|
22767 | }
|
22768 |
|
22769 | if (res !== undefined) {
|
22770 | res += uriComponent.charAt(pos);
|
22771 | }
|
22772 | }
|
22773 | else {
|
22774 |
|
22775 | if (res === undefined) {
|
22776 | res = uriComponent.substr(0, pos);
|
22777 | }
|
22778 |
|
22779 | var escaped = encodeTable[code];
|
22780 | if (escaped !== undefined) {
|
22781 |
|
22782 | if (nativeEncodePos !== -1) {
|
22783 | res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));
|
22784 | nativeEncodePos = -1;
|
22785 | }
|
22786 |
|
22787 | res += escaped;
|
22788 | }
|
22789 | else if (nativeEncodePos === -1) {
|
22790 |
|
22791 | nativeEncodePos = pos;
|
22792 | }
|
22793 | }
|
22794 | }
|
22795 | if (nativeEncodePos !== -1) {
|
22796 | res += encodeURIComponent(uriComponent.substring(nativeEncodePos));
|
22797 | }
|
22798 | return res !== undefined ? res : uriComponent;
|
22799 | }
|
22800 | function encodeURIComponentMinimal(path) {
|
22801 | var res = undefined;
|
22802 | for (var pos = 0; pos < path.length; pos++) {
|
22803 | var code = path.charCodeAt(pos);
|
22804 | if (code === 35 || code === 63 ) {
|
22805 | if (res === undefined) {
|
22806 | res = path.substr(0, pos);
|
22807 | }
|
22808 | res += encodeTable[code];
|
22809 | }
|
22810 | else {
|
22811 | if (res !== undefined) {
|
22812 | res += path[pos];
|
22813 | }
|
22814 | }
|
22815 | }
|
22816 | return res !== undefined ? res : path;
|
22817 | }
|
22818 |
|
22819 |
|
22820 |
|
22821 | function uriToFsPath(uri, keepDriveLetterCasing) {
|
22822 | var value;
|
22823 | if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') {
|
22824 |
|
22825 | value = "//" + uri.authority + uri.path;
|
22826 | }
|
22827 | else if (uri.path.charCodeAt(0) === 47
|
22828 | && (uri.path.charCodeAt(1) >= 65 && uri.path.charCodeAt(1) <= 90 || uri.path.charCodeAt(1) >= 97 && uri.path.charCodeAt(1) <= 122 )
|
22829 | && uri.path.charCodeAt(2) === 58 ) {
|
22830 | if (!keepDriveLetterCasing) {
|
22831 |
|
22832 | value = uri.path[1].toLowerCase() + uri.path.substr(2);
|
22833 | }
|
22834 | else {
|
22835 | value = uri.path.substr(1);
|
22836 | }
|
22837 | }
|
22838 | else {
|
22839 |
|
22840 | value = uri.path;
|
22841 | }
|
22842 | if (isWindows) {
|
22843 | value = value.replace(/\//g, '\\');
|
22844 | }
|
22845 | return value;
|
22846 | }
|
22847 |
|
22848 |
|
22849 |
|
22850 | function _asFormatted(uri, skipEncoding) {
|
22851 | var encoder = !skipEncoding
|
22852 | ? encodeURIComponentFast
|
22853 | : encodeURIComponentMinimal;
|
22854 | var res = '';
|
22855 | var scheme = uri.scheme, authority = uri.authority, path = uri.path, query = uri.query, fragment = uri.fragment;
|
22856 | if (scheme) {
|
22857 | res += scheme;
|
22858 | res += ':';
|
22859 | }
|
22860 | if (authority || scheme === 'file') {
|
22861 | res += _slash;
|
22862 | res += _slash;
|
22863 | }
|
22864 | if (authority) {
|
22865 | var idx = authority.indexOf('@');
|
22866 | if (idx !== -1) {
|
22867 |
|
22868 | var userinfo = authority.substr(0, idx);
|
22869 | authority = authority.substr(idx + 1);
|
22870 | idx = userinfo.indexOf(':');
|
22871 | if (idx === -1) {
|
22872 | res += encoder(userinfo, false);
|
22873 | }
|
22874 | else {
|
22875 |
|
22876 | res += encoder(userinfo.substr(0, idx), false);
|
22877 | res += ':';
|
22878 | res += encoder(userinfo.substr(idx + 1), false);
|
22879 | }
|
22880 | res += '@';
|
22881 | }
|
22882 | authority = authority.toLowerCase();
|
22883 | idx = authority.indexOf(':');
|
22884 | if (idx === -1) {
|
22885 | res += encoder(authority, false);
|
22886 | }
|
22887 | else {
|
22888 |
|
22889 | res += encoder(authority.substr(0, idx), false);
|
22890 | res += authority.substr(idx);
|
22891 | }
|
22892 | }
|
22893 | if (path) {
|
22894 |
|
22895 | if (path.length >= 3 && path.charCodeAt(0) === 47 && path.charCodeAt(2) === 58 ) {
|
22896 | var code = path.charCodeAt(1);
|
22897 | if (code >= 65 && code <= 90 ) {
|
22898 | path = "/" + String.fromCharCode(code + 32) + ":" + path.substr(3);
|
22899 | }
|
22900 | }
|
22901 | else if (path.length >= 2 && path.charCodeAt(1) === 58 ) {
|
22902 | var code = path.charCodeAt(0);
|
22903 | if (code >= 65 && code <= 90 ) {
|
22904 | path = String.fromCharCode(code + 32) + ":" + path.substr(2);
|
22905 | }
|
22906 | }
|
22907 |
|
22908 | res += encoder(path, true);
|
22909 | }
|
22910 | if (query) {
|
22911 | res += '?';
|
22912 | res += encoder(query, false);
|
22913 | }
|
22914 | if (fragment) {
|
22915 | res += '#';
|
22916 | res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment;
|
22917 | }
|
22918 | return res;
|
22919 | }
|
22920 |
|
22921 | function decodeURIComponentGraceful(str) {
|
22922 | try {
|
22923 | return decodeURIComponent(str);
|
22924 | }
|
22925 | catch (_a) {
|
22926 | if (str.length > 3) {
|
22927 | return str.substr(0, 3) + decodeURIComponentGraceful(str.substr(3));
|
22928 | }
|
22929 | else {
|
22930 | return str;
|
22931 | }
|
22932 | }
|
22933 | }
|
22934 | var _rEncodedAsHex = /(%[0-9A-Za-z][0-9A-Za-z])+/g;
|
22935 | function percentDecode(str) {
|
22936 | if (!str.match(_rEncodedAsHex)) {
|
22937 | return str;
|
22938 | }
|
22939 | return str.replace(_rEncodedAsHex, function (match) { return decodeURIComponentGraceful(match); });
|
22940 | }
|
22941 |
|
22942 |
|
22943 | }),
|
22944 | ,
|
22945 | ,
|
22946 | ,
|
22947 | ,
|
22948 | ,
|
22949 | ,
|
22950 | ,
|
22951 | ,
|
22952 | ,
|
22953 | ,
|
22954 | ,
|
22955 | ,
|
22956 | ,
|
22957 | ,
|
22958 | ,
|
22959 | ,
|
22960 |
|
22961 | (function(module, __webpack_exports__, __webpack_require__) {
|
22962 |
|
22963 | "use strict";
|
22964 | __webpack_require__.r(__webpack_exports__);
|
22965 | var _internal_Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(167);
|
22966 | __webpack_require__.d(__webpack_exports__, "Observable", function() { return _internal_Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]; });
|
22967 |
|
22968 | var _internal_observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(184);
|
22969 | __webpack_require__.d(__webpack_exports__, "ConnectableObservable", function() { return _internal_observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_1__["ConnectableObservable"]; });
|
22970 |
|
22971 | var _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(189);
|
22972 | __webpack_require__.d(__webpack_exports__, "GroupedObservable", function() { return _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_2__["GroupedObservable"]; });
|
22973 |
|
22974 | var _internal_symbol_observable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(181);
|
22975 | __webpack_require__.d(__webpack_exports__, "observable", function() { return _internal_symbol_observable__WEBPACK_IMPORTED_MODULE_3__["observable"]; });
|
22976 |
|
22977 | var _internal_Subject__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(185);
|
22978 | __webpack_require__.d(__webpack_exports__, "Subject", function() { return _internal_Subject__WEBPACK_IMPORTED_MODULE_4__["Subject"]; });
|
22979 |
|
22980 | var _internal_BehaviorSubject__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(190);
|
22981 | __webpack_require__.d(__webpack_exports__, "BehaviorSubject", function() { return _internal_BehaviorSubject__WEBPACK_IMPORTED_MODULE_5__["BehaviorSubject"]; });
|
22982 |
|
22983 | var _internal_ReplaySubject__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(191);
|
22984 | __webpack_require__.d(__webpack_exports__, "ReplaySubject", function() { return _internal_ReplaySubject__WEBPACK_IMPORTED_MODULE_6__["ReplaySubject"]; });
|
22985 |
|
22986 | var _internal_AsyncSubject__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(208);
|
22987 | __webpack_require__.d(__webpack_exports__, "AsyncSubject", function() { return _internal_AsyncSubject__WEBPACK_IMPORTED_MODULE_7__["AsyncSubject"]; });
|
22988 |
|
22989 | var _internal_scheduler_asap__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(209);
|
22990 | __webpack_require__.d(__webpack_exports__, "asapScheduler", function() { return _internal_scheduler_asap__WEBPACK_IMPORTED_MODULE_8__["asap"]; });
|
22991 |
|
22992 | var _internal_scheduler_async__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(213);
|
22993 | __webpack_require__.d(__webpack_exports__, "asyncScheduler", function() { return _internal_scheduler_async__WEBPACK_IMPORTED_MODULE_9__["async"]; });
|
22994 |
|
22995 | var _internal_scheduler_queue__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(192);
|
22996 | __webpack_require__.d(__webpack_exports__, "queueScheduler", function() { return _internal_scheduler_queue__WEBPACK_IMPORTED_MODULE_10__["queue"]; });
|
22997 |
|
22998 | var _internal_scheduler_animationFrame__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(214);
|
22999 | __webpack_require__.d(__webpack_exports__, "animationFrameScheduler", function() { return _internal_scheduler_animationFrame__WEBPACK_IMPORTED_MODULE_11__["animationFrame"]; });
|
23000 |
|
23001 | var _internal_scheduler_VirtualTimeScheduler__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(217);
|
23002 | __webpack_require__.d(__webpack_exports__, "VirtualTimeScheduler", function() { return _internal_scheduler_VirtualTimeScheduler__WEBPACK_IMPORTED_MODULE_12__["VirtualTimeScheduler"]; });
|
23003 |
|
23004 | __webpack_require__.d(__webpack_exports__, "VirtualAction", function() { return _internal_scheduler_VirtualTimeScheduler__WEBPACK_IMPORTED_MODULE_12__["VirtualAction"]; });
|
23005 |
|
23006 | var _internal_Scheduler__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(198);
|
23007 | __webpack_require__.d(__webpack_exports__, "Scheduler", function() { return _internal_Scheduler__WEBPACK_IMPORTED_MODULE_13__["Scheduler"]; });
|
23008 |
|
23009 | var _internal_Subscription__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(175);
|
23010 | __webpack_require__.d(__webpack_exports__, "Subscription", function() { return _internal_Subscription__WEBPACK_IMPORTED_MODULE_14__["Subscription"]; });
|
23011 |
|
23012 | var _internal_Subscriber__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(169);
|
23013 | __webpack_require__.d(__webpack_exports__, "Subscriber", function() { return _internal_Subscriber__WEBPACK_IMPORTED_MODULE_15__["Subscriber"]; });
|
23014 |
|
23015 | var _internal_Notification__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(200);
|
23016 | __webpack_require__.d(__webpack_exports__, "Notification", function() { return _internal_Notification__WEBPACK_IMPORTED_MODULE_16__["Notification"]; });
|
23017 |
|
23018 | __webpack_require__.d(__webpack_exports__, "NotificationKind", function() { return _internal_Notification__WEBPACK_IMPORTED_MODULE_16__["NotificationKind"]; });
|
23019 |
|
23020 | var _internal_util_pipe__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(182);
|
23021 | __webpack_require__.d(__webpack_exports__, "pipe", function() { return _internal_util_pipe__WEBPACK_IMPORTED_MODULE_17__["pipe"]; });
|
23022 |
|
23023 | var _internal_util_noop__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(218);
|
23024 | __webpack_require__.d(__webpack_exports__, "noop", function() { return _internal_util_noop__WEBPACK_IMPORTED_MODULE_18__["noop"]; });
|
23025 |
|
23026 | var _internal_util_identity__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(183);
|
23027 | __webpack_require__.d(__webpack_exports__, "identity", function() { return _internal_util_identity__WEBPACK_IMPORTED_MODULE_19__["identity"]; });
|
23028 |
|
23029 | var _internal_util_isObservable__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(219);
|
23030 | __webpack_require__.d(__webpack_exports__, "isObservable", function() { return _internal_util_isObservable__WEBPACK_IMPORTED_MODULE_20__["isObservable"]; });
|
23031 |
|
23032 | var _internal_util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(220);
|
23033 | __webpack_require__.d(__webpack_exports__, "ArgumentOutOfRangeError", function() { return _internal_util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_21__["ArgumentOutOfRangeError"]; });
|
23034 |
|
23035 | var _internal_util_EmptyError__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(221);
|
23036 | __webpack_require__.d(__webpack_exports__, "EmptyError", function() { return _internal_util_EmptyError__WEBPACK_IMPORTED_MODULE_22__["EmptyError"]; });
|
23037 |
|
23038 | var _internal_util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(186);
|
23039 | __webpack_require__.d(__webpack_exports__, "ObjectUnsubscribedError", function() { return _internal_util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_23__["ObjectUnsubscribedError"]; });
|
23040 |
|
23041 | var _internal_util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(178);
|
23042 | __webpack_require__.d(__webpack_exports__, "UnsubscriptionError", function() { return _internal_util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_24__["UnsubscriptionError"]; });
|
23043 |
|
23044 | var _internal_util_TimeoutError__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(222);
|
23045 | __webpack_require__.d(__webpack_exports__, "TimeoutError", function() { return _internal_util_TimeoutError__WEBPACK_IMPORTED_MODULE_25__["TimeoutError"]; });
|
23046 |
|
23047 | var _internal_observable_bindCallback__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(223);
|
23048 | __webpack_require__.d(__webpack_exports__, "bindCallback", function() { return _internal_observable_bindCallback__WEBPACK_IMPORTED_MODULE_26__["bindCallback"]; });
|
23049 |
|
23050 | var _internal_observable_bindNodeCallback__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(225);
|
23051 | __webpack_require__.d(__webpack_exports__, "bindNodeCallback", function() { return _internal_observable_bindNodeCallback__WEBPACK_IMPORTED_MODULE_27__["bindNodeCallback"]; });
|
23052 |
|
23053 | var _internal_observable_combineLatest__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(226);
|
23054 | __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return _internal_observable_combineLatest__WEBPACK_IMPORTED_MODULE_28__["combineLatest"]; });
|
23055 |
|
23056 | var _internal_observable_concat__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(237);
|
23057 | __webpack_require__.d(__webpack_exports__, "concat", function() { return _internal_observable_concat__WEBPACK_IMPORTED_MODULE_29__["concat"]; });
|
23058 |
|
23059 | var _internal_observable_defer__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(248);
|
23060 | __webpack_require__.d(__webpack_exports__, "defer", function() { return _internal_observable_defer__WEBPACK_IMPORTED_MODULE_30__["defer"]; });
|
23061 |
|
23062 | var _internal_observable_empty__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(201);
|
23063 | __webpack_require__.d(__webpack_exports__, "empty", function() { return _internal_observable_empty__WEBPACK_IMPORTED_MODULE_31__["empty"]; });
|
23064 |
|
23065 | var _internal_observable_forkJoin__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(249);
|
23066 | __webpack_require__.d(__webpack_exports__, "forkJoin", function() { return _internal_observable_forkJoin__WEBPACK_IMPORTED_MODULE_32__["forkJoin"]; });
|
23067 |
|
23068 | var _internal_observable_from__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(241);
|
23069 | __webpack_require__.d(__webpack_exports__, "from", function() { return _internal_observable_from__WEBPACK_IMPORTED_MODULE_33__["from"]; });
|
23070 |
|
23071 | var _internal_observable_fromEvent__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(250);
|
23072 | __webpack_require__.d(__webpack_exports__, "fromEvent", function() { return _internal_observable_fromEvent__WEBPACK_IMPORTED_MODULE_34__["fromEvent"]; });
|
23073 |
|
23074 | var _internal_observable_fromEventPattern__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(251);
|
23075 | __webpack_require__.d(__webpack_exports__, "fromEventPattern", function() { return _internal_observable_fromEventPattern__WEBPACK_IMPORTED_MODULE_35__["fromEventPattern"]; });
|
23076 |
|
23077 | var _internal_observable_generate__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(252);
|
23078 | __webpack_require__.d(__webpack_exports__, "generate", function() { return _internal_observable_generate__WEBPACK_IMPORTED_MODULE_36__["generate"]; });
|
23079 |
|
23080 | var _internal_observable_iif__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(253);
|
23081 | __webpack_require__.d(__webpack_exports__, "iif", function() { return _internal_observable_iif__WEBPACK_IMPORTED_MODULE_37__["iif"]; });
|
23082 |
|
23083 | var _internal_observable_interval__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(254);
|
23084 | __webpack_require__.d(__webpack_exports__, "interval", function() { return _internal_observable_interval__WEBPACK_IMPORTED_MODULE_38__["interval"]; });
|
23085 |
|
23086 | var _internal_observable_merge__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(256);
|
23087 | __webpack_require__.d(__webpack_exports__, "merge", function() { return _internal_observable_merge__WEBPACK_IMPORTED_MODULE_39__["merge"]; });
|
23088 |
|
23089 | var _internal_observable_never__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(257);
|
23090 | __webpack_require__.d(__webpack_exports__, "never", function() { return _internal_observable_never__WEBPACK_IMPORTED_MODULE_40__["never"]; });
|
23091 |
|
23092 | var _internal_observable_of__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(202);
|
23093 | __webpack_require__.d(__webpack_exports__, "of", function() { return _internal_observable_of__WEBPACK_IMPORTED_MODULE_41__["of"]; });
|
23094 |
|
23095 | var _internal_observable_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(258);
|
23096 | __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return _internal_observable_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_42__["onErrorResumeNext"]; });
|
23097 |
|
23098 | var _internal_observable_pairs__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(259);
|
23099 | __webpack_require__.d(__webpack_exports__, "pairs", function() { return _internal_observable_pairs__WEBPACK_IMPORTED_MODULE_43__["pairs"]; });
|
23100 |
|
23101 | var _internal_observable_partition__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(260);
|
23102 | __webpack_require__.d(__webpack_exports__, "partition", function() { return _internal_observable_partition__WEBPACK_IMPORTED_MODULE_44__["partition"]; });
|
23103 |
|
23104 | var _internal_observable_race__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(263);
|
23105 | __webpack_require__.d(__webpack_exports__, "race", function() { return _internal_observable_race__WEBPACK_IMPORTED_MODULE_45__["race"]; });
|
23106 |
|
23107 | var _internal_observable_range__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(264);
|
23108 | __webpack_require__.d(__webpack_exports__, "range", function() { return _internal_observable_range__WEBPACK_IMPORTED_MODULE_46__["range"]; });
|
23109 |
|
23110 | var _internal_observable_throwError__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(207);
|
23111 | __webpack_require__.d(__webpack_exports__, "throwError", function() { return _internal_observable_throwError__WEBPACK_IMPORTED_MODULE_47__["throwError"]; });
|
23112 |
|
23113 | var _internal_observable_timer__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(265);
|
23114 | __webpack_require__.d(__webpack_exports__, "timer", function() { return _internal_observable_timer__WEBPACK_IMPORTED_MODULE_48__["timer"]; });
|
23115 |
|
23116 | var _internal_observable_using__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(266);
|
23117 | __webpack_require__.d(__webpack_exports__, "using", function() { return _internal_observable_using__WEBPACK_IMPORTED_MODULE_49__["using"]; });
|
23118 |
|
23119 | var _internal_observable_zip__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(267);
|
23120 | __webpack_require__.d(__webpack_exports__, "zip", function() { return _internal_observable_zip__WEBPACK_IMPORTED_MODULE_50__["zip"]; });
|
23121 |
|
23122 | var _internal_scheduled_scheduled__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(242);
|
23123 | __webpack_require__.d(__webpack_exports__, "scheduled", function() { return _internal_scheduled_scheduled__WEBPACK_IMPORTED_MODULE_51__["scheduled"]; });
|
23124 |
|
23125 | __webpack_require__.d(__webpack_exports__, "EMPTY", function() { return _internal_observable_empty__WEBPACK_IMPORTED_MODULE_31__["EMPTY"]; });
|
23126 |
|
23127 | __webpack_require__.d(__webpack_exports__, "NEVER", function() { return _internal_observable_never__WEBPACK_IMPORTED_MODULE_40__["NEVER"]; });
|
23128 |
|
23129 | var _internal_config__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(173);
|
23130 | __webpack_require__.d(__webpack_exports__, "config", function() { return _internal_config__WEBPACK_IMPORTED_MODULE_52__["config"]; });
|
23131 |
|
23132 |
|
23133 |
|
23134 |
|
23135 |
|
23136 |
|
23137 |
|
23138 |
|
23139 |
|
23140 |
|
23141 |
|
23142 |
|
23143 |
|
23144 |
|
23145 |
|
23146 |
|
23147 |
|
23148 |
|
23149 |
|
23150 |
|
23151 |
|
23152 |
|
23153 |
|
23154 |
|
23155 |
|
23156 |
|
23157 |
|
23158 |
|
23159 |
|
23160 |
|
23161 |
|
23162 |
|
23163 |
|
23164 |
|
23165 |
|
23166 |
|
23167 |
|
23168 |
|
23169 |
|
23170 |
|
23171 |
|
23172 |
|
23173 |
|
23174 |
|
23175 |
|
23176 |
|
23177 |
|
23178 |
|
23179 |
|
23180 |
|
23181 |
|
23182 |
|
23183 |
|
23184 |
|
23185 |
|
23186 |
|
23187 |
|
23188 |
|
23189 |
|
23190 |
|
23191 | }),
|
23192 |
|
23193 | (function(module, __webpack_exports__, __webpack_require__) {
|
23194 |
|
23195 | "use strict";
|
23196 | __webpack_require__.r(__webpack_exports__);
|
23197 | __webpack_require__.d(__webpack_exports__, "Observable", function() { return Observable; });
|
23198 | var _util_canReportError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(168);
|
23199 | var _util_toSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(180);
|
23200 | var _symbol_observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(181);
|
23201 | var _util_pipe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(182);
|
23202 | var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(173);
|
23203 |
|
23204 |
|
23205 |
|
23206 |
|
23207 |
|
23208 |
|
23209 | var Observable = (function () {
|
23210 | function Observable(subscribe) {
|
23211 | this._isScalar = false;
|
23212 | if (subscribe) {
|
23213 | this._subscribe = subscribe;
|
23214 | }
|
23215 | }
|
23216 | Observable.prototype.lift = function (operator) {
|
23217 | var observable = new Observable();
|
23218 | observable.source = this;
|
23219 | observable.operator = operator;
|
23220 | return observable;
|
23221 | };
|
23222 | Observable.prototype.subscribe = function (observerOrNext, error, complete) {
|
23223 | var operator = this.operator;
|
23224 | var sink = Object(_util_toSubscriber__WEBPACK_IMPORTED_MODULE_1__["toSubscriber"])(observerOrNext, error, complete);
|
23225 | if (operator) {
|
23226 | sink.add(operator.call(sink, this.source));
|
23227 | }
|
23228 | else {
|
23229 | sink.add(this.source || (_config__WEBPACK_IMPORTED_MODULE_4__["config"].useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ?
|
23230 | this._subscribe(sink) :
|
23231 | this._trySubscribe(sink));
|
23232 | }
|
23233 | if (_config__WEBPACK_IMPORTED_MODULE_4__["config"].useDeprecatedSynchronousErrorHandling) {
|
23234 | if (sink.syncErrorThrowable) {
|
23235 | sink.syncErrorThrowable = false;
|
23236 | if (sink.syncErrorThrown) {
|
23237 | throw sink.syncErrorValue;
|
23238 | }
|
23239 | }
|
23240 | }
|
23241 | return sink;
|
23242 | };
|
23243 | Observable.prototype._trySubscribe = function (sink) {
|
23244 | try {
|
23245 | return this._subscribe(sink);
|
23246 | }
|
23247 | catch (err) {
|
23248 | if (_config__WEBPACK_IMPORTED_MODULE_4__["config"].useDeprecatedSynchronousErrorHandling) {
|
23249 | sink.syncErrorThrown = true;
|
23250 | sink.syncErrorValue = err;
|
23251 | }
|
23252 | if (Object(_util_canReportError__WEBPACK_IMPORTED_MODULE_0__["canReportError"])(sink)) {
|
23253 | sink.error(err);
|
23254 | }
|
23255 | else {
|
23256 | console.warn(err);
|
23257 | }
|
23258 | }
|
23259 | };
|
23260 | Observable.prototype.forEach = function (next, promiseCtor) {
|
23261 | var _this = this;
|
23262 | promiseCtor = getPromiseCtor(promiseCtor);
|
23263 | return new promiseCtor(function (resolve, reject) {
|
23264 | var subscription;
|
23265 | subscription = _this.subscribe(function (value) {
|
23266 | try {
|
23267 | next(value);
|
23268 | }
|
23269 | catch (err) {
|
23270 | reject(err);
|
23271 | if (subscription) {
|
23272 | subscription.unsubscribe();
|
23273 | }
|
23274 | }
|
23275 | }, reject, resolve);
|
23276 | });
|
23277 | };
|
23278 | Observable.prototype._subscribe = function (subscriber) {
|
23279 | var source = this.source;
|
23280 | return source && source.subscribe(subscriber);
|
23281 | };
|
23282 | Observable.prototype[_symbol_observable__WEBPACK_IMPORTED_MODULE_2__["observable"]] = function () {
|
23283 | return this;
|
23284 | };
|
23285 | Observable.prototype.pipe = function () {
|
23286 | var operations = [];
|
23287 | for (var _i = 0; _i < arguments.length; _i++) {
|
23288 | operations[_i] = arguments[_i];
|
23289 | }
|
23290 | if (operations.length === 0) {
|
23291 | return this;
|
23292 | }
|
23293 | return Object(_util_pipe__WEBPACK_IMPORTED_MODULE_3__["pipeFromArray"])(operations)(this);
|
23294 | };
|
23295 | Observable.prototype.toPromise = function (promiseCtor) {
|
23296 | var _this = this;
|
23297 | promiseCtor = getPromiseCtor(promiseCtor);
|
23298 | return new promiseCtor(function (resolve, reject) {
|
23299 | var value;
|
23300 | _this.subscribe(function (x) { return value = x; }, function (err) { return reject(err); }, function () { return resolve(value); });
|
23301 | });
|
23302 | };
|
23303 | Observable.create = function (subscribe) {
|
23304 | return new Observable(subscribe);
|
23305 | };
|
23306 | return Observable;
|
23307 | }());
|
23308 |
|
23309 | function getPromiseCtor(promiseCtor) {
|
23310 | if (!promiseCtor) {
|
23311 | promiseCtor = _config__WEBPACK_IMPORTED_MODULE_4__["config"].Promise || Promise;
|
23312 | }
|
23313 | if (!promiseCtor) {
|
23314 | throw new Error('no Promise impl found');
|
23315 | }
|
23316 | return promiseCtor;
|
23317 | }
|
23318 |
|
23319 |
|
23320 |
|
23321 | }),
|
23322 |
|
23323 | (function(module, __webpack_exports__, __webpack_require__) {
|
23324 |
|
23325 | "use strict";
|
23326 | __webpack_require__.r(__webpack_exports__);
|
23327 | __webpack_require__.d(__webpack_exports__, "canReportError", function() { return canReportError; });
|
23328 | var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(169);
|
23329 |
|
23330 |
|
23331 | function canReportError(observer) {
|
23332 | while (observer) {
|
23333 | var _a = observer, closed_1 = _a.closed, destination = _a.destination, isStopped = _a.isStopped;
|
23334 | if (closed_1 || isStopped) {
|
23335 | return false;
|
23336 | }
|
23337 | else if (destination && destination instanceof _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"]) {
|
23338 | observer = destination;
|
23339 | }
|
23340 | else {
|
23341 | observer = null;
|
23342 | }
|
23343 | }
|
23344 | return true;
|
23345 | }
|
23346 |
|
23347 |
|
23348 |
|
23349 | }),
|
23350 |
|
23351 | (function(module, __webpack_exports__, __webpack_require__) {
|
23352 |
|
23353 | "use strict";
|
23354 | __webpack_require__.r(__webpack_exports__);
|
23355 | __webpack_require__.d(__webpack_exports__, "Subscriber", function() { return Subscriber; });
|
23356 | __webpack_require__.d(__webpack_exports__, "SafeSubscriber", function() { return SafeSubscriber; });
|
23357 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
23358 | var _util_isFunction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(171);
|
23359 | var _Observer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(172);
|
23360 | var _Subscription__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(175);
|
23361 | var _internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(179);
|
23362 | var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(173);
|
23363 | var _util_hostReportError__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(174);
|
23364 |
|
23365 |
|
23366 |
|
23367 |
|
23368 |
|
23369 |
|
23370 |
|
23371 |
|
23372 | var Subscriber = (function (_super) {
|
23373 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](Subscriber, _super);
|
23374 | function Subscriber(destinationOrNext, error, complete) {
|
23375 | var _this = _super.call(this) || this;
|
23376 | _this.syncErrorValue = null;
|
23377 | _this.syncErrorThrown = false;
|
23378 | _this.syncErrorThrowable = false;
|
23379 | _this.isStopped = false;
|
23380 | switch (arguments.length) {
|
23381 | case 0:
|
23382 | _this.destination = _Observer__WEBPACK_IMPORTED_MODULE_2__["empty"];
|
23383 | break;
|
23384 | case 1:
|
23385 | if (!destinationOrNext) {
|
23386 | _this.destination = _Observer__WEBPACK_IMPORTED_MODULE_2__["empty"];
|
23387 | break;
|
23388 | }
|
23389 | if (typeof destinationOrNext === 'object') {
|
23390 | if (destinationOrNext instanceof Subscriber) {
|
23391 | _this.syncErrorThrowable = destinationOrNext.syncErrorThrowable;
|
23392 | _this.destination = destinationOrNext;
|
23393 | destinationOrNext.add(_this);
|
23394 | }
|
23395 | else {
|
23396 | _this.syncErrorThrowable = true;
|
23397 | _this.destination = new SafeSubscriber(_this, destinationOrNext);
|
23398 | }
|
23399 | break;
|
23400 | }
|
23401 | default:
|
23402 | _this.syncErrorThrowable = true;
|
23403 | _this.destination = new SafeSubscriber(_this, destinationOrNext, error, complete);
|
23404 | break;
|
23405 | }
|
23406 | return _this;
|
23407 | }
|
23408 | Subscriber.prototype[_internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_4__["rxSubscriber"]] = function () { return this; };
|
23409 | Subscriber.create = function (next, error, complete) {
|
23410 | var subscriber = new Subscriber(next, error, complete);
|
23411 | subscriber.syncErrorThrowable = false;
|
23412 | return subscriber;
|
23413 | };
|
23414 | Subscriber.prototype.next = function (value) {
|
23415 | if (!this.isStopped) {
|
23416 | this._next(value);
|
23417 | }
|
23418 | };
|
23419 | Subscriber.prototype.error = function (err) {
|
23420 | if (!this.isStopped) {
|
23421 | this.isStopped = true;
|
23422 | this._error(err);
|
23423 | }
|
23424 | };
|
23425 | Subscriber.prototype.complete = function () {
|
23426 | if (!this.isStopped) {
|
23427 | this.isStopped = true;
|
23428 | this._complete();
|
23429 | }
|
23430 | };
|
23431 | Subscriber.prototype.unsubscribe = function () {
|
23432 | if (this.closed) {
|
23433 | return;
|
23434 | }
|
23435 | this.isStopped = true;
|
23436 | _super.prototype.unsubscribe.call(this);
|
23437 | };
|
23438 | Subscriber.prototype._next = function (value) {
|
23439 | this.destination.next(value);
|
23440 | };
|
23441 | Subscriber.prototype._error = function (err) {
|
23442 | this.destination.error(err);
|
23443 | this.unsubscribe();
|
23444 | };
|
23445 | Subscriber.prototype._complete = function () {
|
23446 | this.destination.complete();
|
23447 | this.unsubscribe();
|
23448 | };
|
23449 | Subscriber.prototype._unsubscribeAndRecycle = function () {
|
23450 | var _parentOrParents = this._parentOrParents;
|
23451 | this._parentOrParents = null;
|
23452 | this.unsubscribe();
|
23453 | this.closed = false;
|
23454 | this.isStopped = false;
|
23455 | this._parentOrParents = _parentOrParents;
|
23456 | return this;
|
23457 | };
|
23458 | return Subscriber;
|
23459 | }(_Subscription__WEBPACK_IMPORTED_MODULE_3__["Subscription"]));
|
23460 |
|
23461 | var SafeSubscriber = (function (_super) {
|
23462 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SafeSubscriber, _super);
|
23463 | function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) {
|
23464 | var _this = _super.call(this) || this;
|
23465 | _this._parentSubscriber = _parentSubscriber;
|
23466 | var next;
|
23467 | var context = _this;
|
23468 | if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_1__["isFunction"])(observerOrNext)) {
|
23469 | next = observerOrNext;
|
23470 | }
|
23471 | else if (observerOrNext) {
|
23472 | next = observerOrNext.next;
|
23473 | error = observerOrNext.error;
|
23474 | complete = observerOrNext.complete;
|
23475 | if (observerOrNext !== _Observer__WEBPACK_IMPORTED_MODULE_2__["empty"]) {
|
23476 | context = Object.create(observerOrNext);
|
23477 | if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_1__["isFunction"])(context.unsubscribe)) {
|
23478 | _this.add(context.unsubscribe.bind(context));
|
23479 | }
|
23480 | context.unsubscribe = _this.unsubscribe.bind(_this);
|
23481 | }
|
23482 | }
|
23483 | _this._context = context;
|
23484 | _this._next = next;
|
23485 | _this._error = error;
|
23486 | _this._complete = complete;
|
23487 | return _this;
|
23488 | }
|
23489 | SafeSubscriber.prototype.next = function (value) {
|
23490 | if (!this.isStopped && this._next) {
|
23491 | var _parentSubscriber = this._parentSubscriber;
|
23492 | if (!_config__WEBPACK_IMPORTED_MODULE_5__["config"].useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
|
23493 | this.__tryOrUnsub(this._next, value);
|
23494 | }
|
23495 | else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {
|
23496 | this.unsubscribe();
|
23497 | }
|
23498 | }
|
23499 | };
|
23500 | SafeSubscriber.prototype.error = function (err) {
|
23501 | if (!this.isStopped) {
|
23502 | var _parentSubscriber = this._parentSubscriber;
|
23503 | var useDeprecatedSynchronousErrorHandling = _config__WEBPACK_IMPORTED_MODULE_5__["config"].useDeprecatedSynchronousErrorHandling;
|
23504 | if (this._error) {
|
23505 | if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
|
23506 | this.__tryOrUnsub(this._error, err);
|
23507 | this.unsubscribe();
|
23508 | }
|
23509 | else {
|
23510 | this.__tryOrSetError(_parentSubscriber, this._error, err);
|
23511 | this.unsubscribe();
|
23512 | }
|
23513 | }
|
23514 | else if (!_parentSubscriber.syncErrorThrowable) {
|
23515 | this.unsubscribe();
|
23516 | if (useDeprecatedSynchronousErrorHandling) {
|
23517 | throw err;
|
23518 | }
|
23519 | Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_6__["hostReportError"])(err);
|
23520 | }
|
23521 | else {
|
23522 | if (useDeprecatedSynchronousErrorHandling) {
|
23523 | _parentSubscriber.syncErrorValue = err;
|
23524 | _parentSubscriber.syncErrorThrown = true;
|
23525 | }
|
23526 | else {
|
23527 | Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_6__["hostReportError"])(err);
|
23528 | }
|
23529 | this.unsubscribe();
|
23530 | }
|
23531 | }
|
23532 | };
|
23533 | SafeSubscriber.prototype.complete = function () {
|
23534 | var _this = this;
|
23535 | if (!this.isStopped) {
|
23536 | var _parentSubscriber = this._parentSubscriber;
|
23537 | if (this._complete) {
|
23538 | var wrappedComplete = function () { return _this._complete.call(_this._context); };
|
23539 | if (!_config__WEBPACK_IMPORTED_MODULE_5__["config"].useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
|
23540 | this.__tryOrUnsub(wrappedComplete);
|
23541 | this.unsubscribe();
|
23542 | }
|
23543 | else {
|
23544 | this.__tryOrSetError(_parentSubscriber, wrappedComplete);
|
23545 | this.unsubscribe();
|
23546 | }
|
23547 | }
|
23548 | else {
|
23549 | this.unsubscribe();
|
23550 | }
|
23551 | }
|
23552 | };
|
23553 | SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) {
|
23554 | try {
|
23555 | fn.call(this._context, value);
|
23556 | }
|
23557 | catch (err) {
|
23558 | this.unsubscribe();
|
23559 | if (_config__WEBPACK_IMPORTED_MODULE_5__["config"].useDeprecatedSynchronousErrorHandling) {
|
23560 | throw err;
|
23561 | }
|
23562 | else {
|
23563 | Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_6__["hostReportError"])(err);
|
23564 | }
|
23565 | }
|
23566 | };
|
23567 | SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) {
|
23568 | if (!_config__WEBPACK_IMPORTED_MODULE_5__["config"].useDeprecatedSynchronousErrorHandling) {
|
23569 | throw new Error('bad call');
|
23570 | }
|
23571 | try {
|
23572 | fn.call(this._context, value);
|
23573 | }
|
23574 | catch (err) {
|
23575 | if (_config__WEBPACK_IMPORTED_MODULE_5__["config"].useDeprecatedSynchronousErrorHandling) {
|
23576 | parent.syncErrorValue = err;
|
23577 | parent.syncErrorThrown = true;
|
23578 | return true;
|
23579 | }
|
23580 | else {
|
23581 | Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_6__["hostReportError"])(err);
|
23582 | return true;
|
23583 | }
|
23584 | }
|
23585 | return false;
|
23586 | };
|
23587 | SafeSubscriber.prototype._unsubscribe = function () {
|
23588 | var _parentSubscriber = this._parentSubscriber;
|
23589 | this._context = null;
|
23590 | this._parentSubscriber = null;
|
23591 | _parentSubscriber.unsubscribe();
|
23592 | };
|
23593 | return SafeSubscriber;
|
23594 | }(Subscriber));
|
23595 |
|
23596 |
|
23597 |
|
23598 |
|
23599 | }),
|
23600 |
|
23601 | (function(module, __webpack_exports__, __webpack_require__) {
|
23602 |
|
23603 | "use strict";
|
23604 | __webpack_require__.r(__webpack_exports__);
|
23605 | __webpack_require__.d(__webpack_exports__, "__extends", function() { return __extends; });
|
23606 | __webpack_require__.d(__webpack_exports__, "__assign", function() { return __assign; });
|
23607 | __webpack_require__.d(__webpack_exports__, "__rest", function() { return __rest; });
|
23608 | __webpack_require__.d(__webpack_exports__, "__decorate", function() { return __decorate; });
|
23609 | __webpack_require__.d(__webpack_exports__, "__param", function() { return __param; });
|
23610 | __webpack_require__.d(__webpack_exports__, "__metadata", function() { return __metadata; });
|
23611 | __webpack_require__.d(__webpack_exports__, "__awaiter", function() { return __awaiter; });
|
23612 | __webpack_require__.d(__webpack_exports__, "__generator", function() { return __generator; });
|
23613 | __webpack_require__.d(__webpack_exports__, "__exportStar", function() { return __exportStar; });
|
23614 | __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });
|
23615 | __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });
|
23616 | __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; });
|
23617 | __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; });
|
23618 | __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; });
|
23619 | __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; });
|
23620 | __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; });
|
23621 | __webpack_require__.d(__webpack_exports__, "__asyncValues", function() { return __asyncValues; });
|
23622 | __webpack_require__.d(__webpack_exports__, "__makeTemplateObject", function() { return __makeTemplateObject; });
|
23623 | __webpack_require__.d(__webpack_exports__, "__importStar", function() { return __importStar; });
|
23624 | __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; });
|
23625 |
|
23626 |
|
23627 |
|
23628 |
|
23629 |
|
23630 |
|
23631 |
|
23632 |
|
23633 |
|
23634 |
|
23635 |
|
23636 |
|
23637 |
|
23638 |
|
23639 |
|
23640 |
|
23641 | var extendStatics = function(d, b) {
|
23642 | extendStatics = Object.setPrototypeOf ||
|
23643 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
23644 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
23645 | return extendStatics(d, b);
|
23646 | };
|
23647 |
|
23648 | function __extends(d, b) {
|
23649 | extendStatics(d, b);
|
23650 | function __() { this.constructor = d; }
|
23651 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
23652 | }
|
23653 |
|
23654 | var __assign = function() {
|
23655 | __assign = Object.assign || function __assign(t) {
|
23656 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
23657 | s = arguments[i];
|
23658 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
23659 | }
|
23660 | return t;
|
23661 | }
|
23662 | return __assign.apply(this, arguments);
|
23663 | }
|
23664 |
|
23665 | function __rest(s, e) {
|
23666 | var t = {};
|
23667 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
23668 | t[p] = s[p];
|
23669 | if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
23670 | for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
23671 | if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
23672 | t[p[i]] = s[p[i]];
|
23673 | }
|
23674 | return t;
|
23675 | }
|
23676 |
|
23677 | function __decorate(decorators, target, key, desc) {
|
23678 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
23679 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
23680 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
23681 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
23682 | }
|
23683 |
|
23684 | function __param(paramIndex, decorator) {
|
23685 | return function (target, key) { decorator(target, key, paramIndex); }
|
23686 | }
|
23687 |
|
23688 | function __metadata(metadataKey, metadataValue) {
|
23689 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
23690 | }
|
23691 |
|
23692 | function __awaiter(thisArg, _arguments, P, generator) {
|
23693 | return new (P || (P = Promise))(function (resolve, reject) {
|
23694 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
23695 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
23696 | function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
23697 | step((generator = generator.apply(thisArg, _arguments || [])).next());
|
23698 | });
|
23699 | }
|
23700 |
|
23701 | function __generator(thisArg, body) {
|
23702 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
23703 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
23704 | function verb(n) { return function (v) { return step([n, v]); }; }
|
23705 | function step(op) {
|
23706 | if (f) throw new TypeError("Generator is already executing.");
|
23707 | while (_) try {
|
23708 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
23709 | if (y = 0, t) op = [op[0] & 2, t.value];
|
23710 | switch (op[0]) {
|
23711 | case 0: case 1: t = op; break;
|
23712 | case 4: _.label++; return { value: op[1], done: false };
|
23713 | case 5: _.label++; y = op[1]; op = [0]; continue;
|
23714 | case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
23715 | default:
|
23716 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
23717 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
23718 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
23719 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
23720 | if (t[2]) _.ops.pop();
|
23721 | _.trys.pop(); continue;
|
23722 | }
|
23723 | op = body.call(thisArg, _);
|
23724 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
23725 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
23726 | }
|
23727 | }
|
23728 |
|
23729 | function __exportStar(m, exports) {
|
23730 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
23731 | }
|
23732 |
|
23733 | function __values(o) {
|
23734 | var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
23735 | if (m) return m.call(o);
|
23736 | return {
|
23737 | next: function () {
|
23738 | if (o && i >= o.length) o = void 0;
|
23739 | return { value: o && o[i++], done: !o };
|
23740 | }
|
23741 | };
|
23742 | }
|
23743 |
|
23744 | function __read(o, n) {
|
23745 | var m = typeof Symbol === "function" && o[Symbol.iterator];
|
23746 | if (!m) return o;
|
23747 | var i = m.call(o), r, ar = [], e;
|
23748 | try {
|
23749 | while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
23750 | }
|
23751 | catch (error) { e = { error: error }; }
|
23752 | finally {
|
23753 | try {
|
23754 | if (r && !r.done && (m = i["return"])) m.call(i);
|
23755 | }
|
23756 | finally { if (e) throw e.error; }
|
23757 | }
|
23758 | return ar;
|
23759 | }
|
23760 |
|
23761 | function __spread() {
|
23762 | for (var ar = [], i = 0; i < arguments.length; i++)
|
23763 | ar = ar.concat(__read(arguments[i]));
|
23764 | return ar;
|
23765 | }
|
23766 |
|
23767 | function __spreadArrays() {
|
23768 | for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
23769 | for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
23770 | for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
23771 | r[k] = a[j];
|
23772 | return r;
|
23773 | };
|
23774 |
|
23775 | function __await(v) {
|
23776 | return this instanceof __await ? (this.v = v, this) : new __await(v);
|
23777 | }
|
23778 |
|
23779 | function __asyncGenerator(thisArg, _arguments, generator) {
|
23780 | if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
23781 | var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
23782 | return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
23783 | function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
23784 | function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
23785 | function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
23786 | function fulfill(value) { resume("next", value); }
|
23787 | function reject(value) { resume("throw", value); }
|
23788 | function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
23789 | }
|
23790 |
|
23791 | function __asyncDelegator(o) {
|
23792 | var i, p;
|
23793 | return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
23794 | function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
23795 | }
|
23796 |
|
23797 | function __asyncValues(o) {
|
23798 | if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
23799 | var m = o[Symbol.asyncIterator], i;
|
23800 | return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
23801 | function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
23802 | function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
23803 | }
|
23804 |
|
23805 | function __makeTemplateObject(cooked, raw) {
|
23806 | if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
23807 | return cooked;
|
23808 | };
|
23809 |
|
23810 | function __importStar(mod) {
|
23811 | if (mod && mod.__esModule) return mod;
|
23812 | var result = {};
|
23813 | if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
23814 | result.default = mod;
|
23815 | return result;
|
23816 | }
|
23817 |
|
23818 | function __importDefault(mod) {
|
23819 | return (mod && mod.__esModule) ? mod : { default: mod };
|
23820 | }
|
23821 |
|
23822 |
|
23823 | }),
|
23824 |
|
23825 | (function(module, __webpack_exports__, __webpack_require__) {
|
23826 |
|
23827 | "use strict";
|
23828 | __webpack_require__.r(__webpack_exports__);
|
23829 | __webpack_require__.d(__webpack_exports__, "isFunction", function() { return isFunction; });
|
23830 |
|
23831 | function isFunction(x) {
|
23832 | return typeof x === 'function';
|
23833 | }
|
23834 |
|
23835 |
|
23836 |
|
23837 | }),
|
23838 |
|
23839 | (function(module, __webpack_exports__, __webpack_require__) {
|
23840 |
|
23841 | "use strict";
|
23842 | __webpack_require__.r(__webpack_exports__);
|
23843 | __webpack_require__.d(__webpack_exports__, "empty", function() { return empty; });
|
23844 | var _config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(173);
|
23845 | var _util_hostReportError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(174);
|
23846 |
|
23847 |
|
23848 |
|
23849 | var empty = {
|
23850 | closed: true,
|
23851 | next: function (value) { },
|
23852 | error: function (err) {
|
23853 | if (_config__WEBPACK_IMPORTED_MODULE_0__["config"].useDeprecatedSynchronousErrorHandling) {
|
23854 | throw err;
|
23855 | }
|
23856 | else {
|
23857 | Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_1__["hostReportError"])(err);
|
23858 | }
|
23859 | },
|
23860 | complete: function () { }
|
23861 | };
|
23862 |
|
23863 |
|
23864 |
|
23865 | }),
|
23866 |
|
23867 | (function(module, __webpack_exports__, __webpack_require__) {
|
23868 |
|
23869 | "use strict";
|
23870 | __webpack_require__.r(__webpack_exports__);
|
23871 | __webpack_require__.d(__webpack_exports__, "config", function() { return config; });
|
23872 |
|
23873 | var _enable_super_gross_mode_that_will_cause_bad_things = false;
|
23874 | var config = {
|
23875 | Promise: undefined,
|
23876 | set useDeprecatedSynchronousErrorHandling(value) {
|
23877 | if (value) {
|
23878 | var error = new Error();
|
23879 | console.warn('DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n' + error.stack);
|
23880 | }
|
23881 | else if (_enable_super_gross_mode_that_will_cause_bad_things) {
|
23882 | console.log('RxJS: Back to a better error behavior. Thank you. <3');
|
23883 | }
|
23884 | _enable_super_gross_mode_that_will_cause_bad_things = value;
|
23885 | },
|
23886 | get useDeprecatedSynchronousErrorHandling() {
|
23887 | return _enable_super_gross_mode_that_will_cause_bad_things;
|
23888 | },
|
23889 | };
|
23890 |
|
23891 |
|
23892 |
|
23893 | }),
|
23894 |
|
23895 | (function(module, __webpack_exports__, __webpack_require__) {
|
23896 |
|
23897 | "use strict";
|
23898 | __webpack_require__.r(__webpack_exports__);
|
23899 | __webpack_require__.d(__webpack_exports__, "hostReportError", function() { return hostReportError; });
|
23900 |
|
23901 | function hostReportError(err) {
|
23902 | setTimeout(function () { throw err; }, 0);
|
23903 | }
|
23904 |
|
23905 |
|
23906 |
|
23907 | }),
|
23908 |
|
23909 | (function(module, __webpack_exports__, __webpack_require__) {
|
23910 |
|
23911 | "use strict";
|
23912 | __webpack_require__.r(__webpack_exports__);
|
23913 | __webpack_require__.d(__webpack_exports__, "Subscription", function() { return Subscription; });
|
23914 | var _util_isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(176);
|
23915 | var _util_isObject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(177);
|
23916 | var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(171);
|
23917 | var _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(178);
|
23918 |
|
23919 |
|
23920 |
|
23921 |
|
23922 |
|
23923 | var Subscription = (function () {
|
23924 | function Subscription(unsubscribe) {
|
23925 | this.closed = false;
|
23926 | this._parentOrParents = null;
|
23927 | this._subscriptions = null;
|
23928 | if (unsubscribe) {
|
23929 | this._unsubscribe = unsubscribe;
|
23930 | }
|
23931 | }
|
23932 | Subscription.prototype.unsubscribe = function () {
|
23933 | var errors;
|
23934 | if (this.closed) {
|
23935 | return;
|
23936 | }
|
23937 | var _a = this, _parentOrParents = _a._parentOrParents, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions;
|
23938 | this.closed = true;
|
23939 | this._parentOrParents = null;
|
23940 | this._subscriptions = null;
|
23941 | if (_parentOrParents instanceof Subscription) {
|
23942 | _parentOrParents.remove(this);
|
23943 | }
|
23944 | else if (_parentOrParents !== null) {
|
23945 | for (var index = 0; index < _parentOrParents.length; ++index) {
|
23946 | var parent_1 = _parentOrParents[index];
|
23947 | parent_1.remove(this);
|
23948 | }
|
23949 | }
|
23950 | if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_2__["isFunction"])(_unsubscribe)) {
|
23951 | try {
|
23952 | _unsubscribe.call(this);
|
23953 | }
|
23954 | catch (e) {
|
23955 | errors = e instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_3__["UnsubscriptionError"] ? flattenUnsubscriptionErrors(e.errors) : [e];
|
23956 | }
|
23957 | }
|
23958 | if (Object(_util_isArray__WEBPACK_IMPORTED_MODULE_0__["isArray"])(_subscriptions)) {
|
23959 | var index = -1;
|
23960 | var len = _subscriptions.length;
|
23961 | while (++index < len) {
|
23962 | var sub = _subscriptions[index];
|
23963 | if (Object(_util_isObject__WEBPACK_IMPORTED_MODULE_1__["isObject"])(sub)) {
|
23964 | try {
|
23965 | sub.unsubscribe();
|
23966 | }
|
23967 | catch (e) {
|
23968 | errors = errors || [];
|
23969 | if (e instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_3__["UnsubscriptionError"]) {
|
23970 | errors = errors.concat(flattenUnsubscriptionErrors(e.errors));
|
23971 | }
|
23972 | else {
|
23973 | errors.push(e);
|
23974 | }
|
23975 | }
|
23976 | }
|
23977 | }
|
23978 | }
|
23979 | if (errors) {
|
23980 | throw new _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_3__["UnsubscriptionError"](errors);
|
23981 | }
|
23982 | };
|
23983 | Subscription.prototype.add = function (teardown) {
|
23984 | var subscription = teardown;
|
23985 | if (!teardown) {
|
23986 | return Subscription.EMPTY;
|
23987 | }
|
23988 | switch (typeof teardown) {
|
23989 | case 'function':
|
23990 | subscription = new Subscription(teardown);
|
23991 | case 'object':
|
23992 | if (subscription === this || subscription.closed || typeof subscription.unsubscribe !== 'function') {
|
23993 | return subscription;
|
23994 | }
|
23995 | else if (this.closed) {
|
23996 | subscription.unsubscribe();
|
23997 | return subscription;
|
23998 | }
|
23999 | else if (!(subscription instanceof Subscription)) {
|
24000 | var tmp = subscription;
|
24001 | subscription = new Subscription();
|
24002 | subscription._subscriptions = [tmp];
|
24003 | }
|
24004 | break;
|
24005 | default: {
|
24006 | throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');
|
24007 | }
|
24008 | }
|
24009 | var _parentOrParents = subscription._parentOrParents;
|
24010 | if (_parentOrParents === null) {
|
24011 | subscription._parentOrParents = this;
|
24012 | }
|
24013 | else if (_parentOrParents instanceof Subscription) {
|
24014 | if (_parentOrParents === this) {
|
24015 | return subscription;
|
24016 | }
|
24017 | subscription._parentOrParents = [_parentOrParents, this];
|
24018 | }
|
24019 | else if (_parentOrParents.indexOf(this) === -1) {
|
24020 | _parentOrParents.push(this);
|
24021 | }
|
24022 | else {
|
24023 | return subscription;
|
24024 | }
|
24025 | var subscriptions = this._subscriptions;
|
24026 | if (subscriptions === null) {
|
24027 | this._subscriptions = [subscription];
|
24028 | }
|
24029 | else {
|
24030 | subscriptions.push(subscription);
|
24031 | }
|
24032 | return subscription;
|
24033 | };
|
24034 | Subscription.prototype.remove = function (subscription) {
|
24035 | var subscriptions = this._subscriptions;
|
24036 | if (subscriptions) {
|
24037 | var subscriptionIndex = subscriptions.indexOf(subscription);
|
24038 | if (subscriptionIndex !== -1) {
|
24039 | subscriptions.splice(subscriptionIndex, 1);
|
24040 | }
|
24041 | }
|
24042 | };
|
24043 | Subscription.EMPTY = (function (empty) {
|
24044 | empty.closed = true;
|
24045 | return empty;
|
24046 | }(new Subscription()));
|
24047 | return Subscription;
|
24048 | }());
|
24049 |
|
24050 | function flattenUnsubscriptionErrors(errors) {
|
24051 | return errors.reduce(function (errs, err) { return errs.concat((err instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_3__["UnsubscriptionError"]) ? err.errors : err); }, []);
|
24052 | }
|
24053 |
|
24054 |
|
24055 |
|
24056 | }),
|
24057 |
|
24058 | (function(module, __webpack_exports__, __webpack_require__) {
|
24059 |
|
24060 | "use strict";
|
24061 | __webpack_require__.r(__webpack_exports__);
|
24062 | __webpack_require__.d(__webpack_exports__, "isArray", function() { return isArray; });
|
24063 |
|
24064 | var isArray = (function () { return Array.isArray || (function (x) { return x && typeof x.length === 'number'; }); })();
|
24065 |
|
24066 |
|
24067 |
|
24068 | }),
|
24069 |
|
24070 | (function(module, __webpack_exports__, __webpack_require__) {
|
24071 |
|
24072 | "use strict";
|
24073 | __webpack_require__.r(__webpack_exports__);
|
24074 | __webpack_require__.d(__webpack_exports__, "isObject", function() { return isObject; });
|
24075 |
|
24076 | function isObject(x) {
|
24077 | return x !== null && typeof x === 'object';
|
24078 | }
|
24079 |
|
24080 |
|
24081 |
|
24082 | }),
|
24083 |
|
24084 | (function(module, __webpack_exports__, __webpack_require__) {
|
24085 |
|
24086 | "use strict";
|
24087 | __webpack_require__.r(__webpack_exports__);
|
24088 | __webpack_require__.d(__webpack_exports__, "UnsubscriptionError", function() { return UnsubscriptionError; });
|
24089 |
|
24090 | var UnsubscriptionErrorImpl = (function () {
|
24091 | function UnsubscriptionErrorImpl(errors) {
|
24092 | Error.call(this);
|
24093 | this.message = errors ?
|
24094 | errors.length + " errors occurred during unsubscription:\n" + errors.map(function (err, i) { return i + 1 + ") " + err.toString(); }).join('\n ') : '';
|
24095 | this.name = 'UnsubscriptionError';
|
24096 | this.errors = errors;
|
24097 | return this;
|
24098 | }
|
24099 | UnsubscriptionErrorImpl.prototype = Object.create(Error.prototype);
|
24100 | return UnsubscriptionErrorImpl;
|
24101 | })();
|
24102 | var UnsubscriptionError = UnsubscriptionErrorImpl;
|
24103 |
|
24104 |
|
24105 |
|
24106 | }),
|
24107 |
|
24108 | (function(module, __webpack_exports__, __webpack_require__) {
|
24109 |
|
24110 | "use strict";
|
24111 | __webpack_require__.r(__webpack_exports__);
|
24112 | __webpack_require__.d(__webpack_exports__, "rxSubscriber", function() { return rxSubscriber; });
|
24113 | __webpack_require__.d(__webpack_exports__, "$$rxSubscriber", function() { return $$rxSubscriber; });
|
24114 |
|
24115 | var rxSubscriber = (function () {
|
24116 | return typeof Symbol === 'function'
|
24117 | ? Symbol('rxSubscriber')
|
24118 | : '@@rxSubscriber_' + Math.random();
|
24119 | })();
|
24120 | var $$rxSubscriber = rxSubscriber;
|
24121 |
|
24122 |
|
24123 |
|
24124 | }),
|
24125 |
|
24126 | (function(module, __webpack_exports__, __webpack_require__) {
|
24127 |
|
24128 | "use strict";
|
24129 | __webpack_require__.r(__webpack_exports__);
|
24130 | __webpack_require__.d(__webpack_exports__, "toSubscriber", function() { return toSubscriber; });
|
24131 | var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(169);
|
24132 | var _symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(179);
|
24133 | var _Observer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(172);
|
24134 |
|
24135 |
|
24136 |
|
24137 |
|
24138 | function toSubscriber(nextOrObserver, error, complete) {
|
24139 | if (nextOrObserver) {
|
24140 | if (nextOrObserver instanceof _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"]) {
|
24141 | return nextOrObserver;
|
24142 | }
|
24143 | if (nextOrObserver[_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_1__["rxSubscriber"]]) {
|
24144 | return nextOrObserver[_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_1__["rxSubscriber"]]();
|
24145 | }
|
24146 | }
|
24147 | if (!nextOrObserver && !error && !complete) {
|
24148 | return new _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"](_Observer__WEBPACK_IMPORTED_MODULE_2__["empty"]);
|
24149 | }
|
24150 | return new _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"](nextOrObserver, error, complete);
|
24151 | }
|
24152 |
|
24153 |
|
24154 |
|
24155 | }),
|
24156 |
|
24157 | (function(module, __webpack_exports__, __webpack_require__) {
|
24158 |
|
24159 | "use strict";
|
24160 | __webpack_require__.r(__webpack_exports__);
|
24161 | __webpack_require__.d(__webpack_exports__, "observable", function() { return observable; });
|
24162 |
|
24163 | var observable = (function () { return typeof Symbol === 'function' && Symbol.observable || '@@observable'; })();
|
24164 |
|
24165 |
|
24166 |
|
24167 | }),
|
24168 |
|
24169 | (function(module, __webpack_exports__, __webpack_require__) {
|
24170 |
|
24171 | "use strict";
|
24172 | __webpack_require__.r(__webpack_exports__);
|
24173 | __webpack_require__.d(__webpack_exports__, "pipe", function() { return pipe; });
|
24174 | __webpack_require__.d(__webpack_exports__, "pipeFromArray", function() { return pipeFromArray; });
|
24175 | var _identity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(183);
|
24176 |
|
24177 |
|
24178 | function pipe() {
|
24179 | var fns = [];
|
24180 | for (var _i = 0; _i < arguments.length; _i++) {
|
24181 | fns[_i] = arguments[_i];
|
24182 | }
|
24183 | return pipeFromArray(fns);
|
24184 | }
|
24185 | function pipeFromArray(fns) {
|
24186 | if (fns.length === 0) {
|
24187 | return _identity__WEBPACK_IMPORTED_MODULE_0__["identity"];
|
24188 | }
|
24189 | if (fns.length === 1) {
|
24190 | return fns[0];
|
24191 | }
|
24192 | return function piped(input) {
|
24193 | return fns.reduce(function (prev, fn) { return fn(prev); }, input);
|
24194 | };
|
24195 | }
|
24196 |
|
24197 |
|
24198 |
|
24199 | }),
|
24200 |
|
24201 | (function(module, __webpack_exports__, __webpack_require__) {
|
24202 |
|
24203 | "use strict";
|
24204 | __webpack_require__.r(__webpack_exports__);
|
24205 | __webpack_require__.d(__webpack_exports__, "identity", function() { return identity; });
|
24206 |
|
24207 | function identity(x) {
|
24208 | return x;
|
24209 | }
|
24210 |
|
24211 |
|
24212 |
|
24213 | }),
|
24214 |
|
24215 | (function(module, __webpack_exports__, __webpack_require__) {
|
24216 |
|
24217 | "use strict";
|
24218 | __webpack_require__.r(__webpack_exports__);
|
24219 | __webpack_require__.d(__webpack_exports__, "ConnectableObservable", function() { return ConnectableObservable; });
|
24220 | __webpack_require__.d(__webpack_exports__, "connectableObservableDescriptor", function() { return connectableObservableDescriptor; });
|
24221 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
24222 | var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(185);
|
24223 | var _Observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(167);
|
24224 | var _Subscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(169);
|
24225 | var _Subscription__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(175);
|
24226 | var _operators_refCount__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(188);
|
24227 |
|
24228 |
|
24229 |
|
24230 |
|
24231 |
|
24232 |
|
24233 |
|
24234 | var ConnectableObservable = (function (_super) {
|
24235 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ConnectableObservable, _super);
|
24236 | function ConnectableObservable(source, subjectFactory) {
|
24237 | var _this = _super.call(this) || this;
|
24238 | _this.source = source;
|
24239 | _this.subjectFactory = subjectFactory;
|
24240 | _this._refCount = 0;
|
24241 | _this._isComplete = false;
|
24242 | return _this;
|
24243 | }
|
24244 | ConnectableObservable.prototype._subscribe = function (subscriber) {
|
24245 | return this.getSubject().subscribe(subscriber);
|
24246 | };
|
24247 | ConnectableObservable.prototype.getSubject = function () {
|
24248 | var subject = this._subject;
|
24249 | if (!subject || subject.isStopped) {
|
24250 | this._subject = this.subjectFactory();
|
24251 | }
|
24252 | return this._subject;
|
24253 | };
|
24254 | ConnectableObservable.prototype.connect = function () {
|
24255 | var connection = this._connection;
|
24256 | if (!connection) {
|
24257 | this._isComplete = false;
|
24258 | connection = this._connection = new _Subscription__WEBPACK_IMPORTED_MODULE_4__["Subscription"]();
|
24259 | connection.add(this.source
|
24260 | .subscribe(new ConnectableSubscriber(this.getSubject(), this)));
|
24261 | if (connection.closed) {
|
24262 | this._connection = null;
|
24263 | connection = _Subscription__WEBPACK_IMPORTED_MODULE_4__["Subscription"].EMPTY;
|
24264 | }
|
24265 | }
|
24266 | return connection;
|
24267 | };
|
24268 | ConnectableObservable.prototype.refCount = function () {
|
24269 | return Object(_operators_refCount__WEBPACK_IMPORTED_MODULE_5__["refCount"])()(this);
|
24270 | };
|
24271 | return ConnectableObservable;
|
24272 | }(_Observable__WEBPACK_IMPORTED_MODULE_2__["Observable"]));
|
24273 |
|
24274 | var connectableObservableDescriptor = (function () {
|
24275 | var connectableProto = ConnectableObservable.prototype;
|
24276 | return {
|
24277 | operator: { value: null },
|
24278 | _refCount: { value: 0, writable: true },
|
24279 | _subject: { value: null, writable: true },
|
24280 | _connection: { value: null, writable: true },
|
24281 | _subscribe: { value: connectableProto._subscribe },
|
24282 | _isComplete: { value: connectableProto._isComplete, writable: true },
|
24283 | getSubject: { value: connectableProto.getSubject },
|
24284 | connect: { value: connectableProto.connect },
|
24285 | refCount: { value: connectableProto.refCount }
|
24286 | };
|
24287 | })();
|
24288 | var ConnectableSubscriber = (function (_super) {
|
24289 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ConnectableSubscriber, _super);
|
24290 | function ConnectableSubscriber(destination, connectable) {
|
24291 | var _this = _super.call(this, destination) || this;
|
24292 | _this.connectable = connectable;
|
24293 | return _this;
|
24294 | }
|
24295 | ConnectableSubscriber.prototype._error = function (err) {
|
24296 | this._unsubscribe();
|
24297 | _super.prototype._error.call(this, err);
|
24298 | };
|
24299 | ConnectableSubscriber.prototype._complete = function () {
|
24300 | this.connectable._isComplete = true;
|
24301 | this._unsubscribe();
|
24302 | _super.prototype._complete.call(this);
|
24303 | };
|
24304 | ConnectableSubscriber.prototype._unsubscribe = function () {
|
24305 | var connectable = this.connectable;
|
24306 | if (connectable) {
|
24307 | this.connectable = null;
|
24308 | var connection = connectable._connection;
|
24309 | connectable._refCount = 0;
|
24310 | connectable._subject = null;
|
24311 | connectable._connection = null;
|
24312 | if (connection) {
|
24313 | connection.unsubscribe();
|
24314 | }
|
24315 | }
|
24316 | };
|
24317 | return ConnectableSubscriber;
|
24318 | }(_Subject__WEBPACK_IMPORTED_MODULE_1__["SubjectSubscriber"]));
|
24319 | var RefCountOperator = (function () {
|
24320 | function RefCountOperator(connectable) {
|
24321 | this.connectable = connectable;
|
24322 | }
|
24323 | RefCountOperator.prototype.call = function (subscriber, source) {
|
24324 | var connectable = this.connectable;
|
24325 | connectable._refCount++;
|
24326 | var refCounter = new RefCountSubscriber(subscriber, connectable);
|
24327 | var subscription = source.subscribe(refCounter);
|
24328 | if (!refCounter.closed) {
|
24329 | refCounter.connection = connectable.connect();
|
24330 | }
|
24331 | return subscription;
|
24332 | };
|
24333 | return RefCountOperator;
|
24334 | }());
|
24335 | var RefCountSubscriber = (function (_super) {
|
24336 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RefCountSubscriber, _super);
|
24337 | function RefCountSubscriber(destination, connectable) {
|
24338 | var _this = _super.call(this, destination) || this;
|
24339 | _this.connectable = connectable;
|
24340 | return _this;
|
24341 | }
|
24342 | RefCountSubscriber.prototype._unsubscribe = function () {
|
24343 | var connectable = this.connectable;
|
24344 | if (!connectable) {
|
24345 | this.connection = null;
|
24346 | return;
|
24347 | }
|
24348 | this.connectable = null;
|
24349 | var refCount = connectable._refCount;
|
24350 | if (refCount <= 0) {
|
24351 | this.connection = null;
|
24352 | return;
|
24353 | }
|
24354 | connectable._refCount = refCount - 1;
|
24355 | if (refCount > 1) {
|
24356 | this.connection = null;
|
24357 | return;
|
24358 | }
|
24359 | var connection = this.connection;
|
24360 | var sharedConnection = connectable._connection;
|
24361 | this.connection = null;
|
24362 | if (sharedConnection && (!connection || sharedConnection === connection)) {
|
24363 | sharedConnection.unsubscribe();
|
24364 | }
|
24365 | };
|
24366 | return RefCountSubscriber;
|
24367 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_3__["Subscriber"]));
|
24368 |
|
24369 |
|
24370 |
|
24371 | }),
|
24372 |
|
24373 | (function(module, __webpack_exports__, __webpack_require__) {
|
24374 |
|
24375 | "use strict";
|
24376 | __webpack_require__.r(__webpack_exports__);
|
24377 | __webpack_require__.d(__webpack_exports__, "SubjectSubscriber", function() { return SubjectSubscriber; });
|
24378 | __webpack_require__.d(__webpack_exports__, "Subject", function() { return Subject; });
|
24379 | __webpack_require__.d(__webpack_exports__, "AnonymousSubject", function() { return AnonymousSubject; });
|
24380 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
24381 | var _Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(167);
|
24382 | var _Subscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(169);
|
24383 | var _Subscription__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(175);
|
24384 | var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(186);
|
24385 | var _SubjectSubscription__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(187);
|
24386 | var _internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(179);
|
24387 |
|
24388 |
|
24389 |
|
24390 |
|
24391 |
|
24392 |
|
24393 |
|
24394 |
|
24395 | var SubjectSubscriber = (function (_super) {
|
24396 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SubjectSubscriber, _super);
|
24397 | function SubjectSubscriber(destination) {
|
24398 | var _this = _super.call(this, destination) || this;
|
24399 | _this.destination = destination;
|
24400 | return _this;
|
24401 | }
|
24402 | return SubjectSubscriber;
|
24403 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_2__["Subscriber"]));
|
24404 |
|
24405 | var Subject = (function (_super) {
|
24406 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](Subject, _super);
|
24407 | function Subject() {
|
24408 | var _this = _super.call(this) || this;
|
24409 | _this.observers = [];
|
24410 | _this.closed = false;
|
24411 | _this.isStopped = false;
|
24412 | _this.hasError = false;
|
24413 | _this.thrownError = null;
|
24414 | return _this;
|
24415 | }
|
24416 | Subject.prototype[_internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_6__["rxSubscriber"]] = function () {
|
24417 | return new SubjectSubscriber(this);
|
24418 | };
|
24419 | Subject.prototype.lift = function (operator) {
|
24420 | var subject = new AnonymousSubject(this, this);
|
24421 | subject.operator = operator;
|
24422 | return subject;
|
24423 | };
|
24424 | Subject.prototype.next = function (value) {
|
24425 | if (this.closed) {
|
24426 | throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__["ObjectUnsubscribedError"]();
|
24427 | }
|
24428 | if (!this.isStopped) {
|
24429 | var observers = this.observers;
|
24430 | var len = observers.length;
|
24431 | var copy = observers.slice();
|
24432 | for (var i = 0; i < len; i++) {
|
24433 | copy[i].next(value);
|
24434 | }
|
24435 | }
|
24436 | };
|
24437 | Subject.prototype.error = function (err) {
|
24438 | if (this.closed) {
|
24439 | throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__["ObjectUnsubscribedError"]();
|
24440 | }
|
24441 | this.hasError = true;
|
24442 | this.thrownError = err;
|
24443 | this.isStopped = true;
|
24444 | var observers = this.observers;
|
24445 | var len = observers.length;
|
24446 | var copy = observers.slice();
|
24447 | for (var i = 0; i < len; i++) {
|
24448 | copy[i].error(err);
|
24449 | }
|
24450 | this.observers.length = 0;
|
24451 | };
|
24452 | Subject.prototype.complete = function () {
|
24453 | if (this.closed) {
|
24454 | throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__["ObjectUnsubscribedError"]();
|
24455 | }
|
24456 | this.isStopped = true;
|
24457 | var observers = this.observers;
|
24458 | var len = observers.length;
|
24459 | var copy = observers.slice();
|
24460 | for (var i = 0; i < len; i++) {
|
24461 | copy[i].complete();
|
24462 | }
|
24463 | this.observers.length = 0;
|
24464 | };
|
24465 | Subject.prototype.unsubscribe = function () {
|
24466 | this.isStopped = true;
|
24467 | this.closed = true;
|
24468 | this.observers = null;
|
24469 | };
|
24470 | Subject.prototype._trySubscribe = function (subscriber) {
|
24471 | if (this.closed) {
|
24472 | throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__["ObjectUnsubscribedError"]();
|
24473 | }
|
24474 | else {
|
24475 | return _super.prototype._trySubscribe.call(this, subscriber);
|
24476 | }
|
24477 | };
|
24478 | Subject.prototype._subscribe = function (subscriber) {
|
24479 | if (this.closed) {
|
24480 | throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__["ObjectUnsubscribedError"]();
|
24481 | }
|
24482 | else if (this.hasError) {
|
24483 | subscriber.error(this.thrownError);
|
24484 | return _Subscription__WEBPACK_IMPORTED_MODULE_3__["Subscription"].EMPTY;
|
24485 | }
|
24486 | else if (this.isStopped) {
|
24487 | subscriber.complete();
|
24488 | return _Subscription__WEBPACK_IMPORTED_MODULE_3__["Subscription"].EMPTY;
|
24489 | }
|
24490 | else {
|
24491 | this.observers.push(subscriber);
|
24492 | return new _SubjectSubscription__WEBPACK_IMPORTED_MODULE_5__["SubjectSubscription"](this, subscriber);
|
24493 | }
|
24494 | };
|
24495 | Subject.prototype.asObservable = function () {
|
24496 | var observable = new _Observable__WEBPACK_IMPORTED_MODULE_1__["Observable"]();
|
24497 | observable.source = this;
|
24498 | return observable;
|
24499 | };
|
24500 | Subject.create = function (destination, source) {
|
24501 | return new AnonymousSubject(destination, source);
|
24502 | };
|
24503 | return Subject;
|
24504 | }(_Observable__WEBPACK_IMPORTED_MODULE_1__["Observable"]));
|
24505 |
|
24506 | var AnonymousSubject = (function (_super) {
|
24507 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AnonymousSubject, _super);
|
24508 | function AnonymousSubject(destination, source) {
|
24509 | var _this = _super.call(this) || this;
|
24510 | _this.destination = destination;
|
24511 | _this.source = source;
|
24512 | return _this;
|
24513 | }
|
24514 | AnonymousSubject.prototype.next = function (value) {
|
24515 | var destination = this.destination;
|
24516 | if (destination && destination.next) {
|
24517 | destination.next(value);
|
24518 | }
|
24519 | };
|
24520 | AnonymousSubject.prototype.error = function (err) {
|
24521 | var destination = this.destination;
|
24522 | if (destination && destination.error) {
|
24523 | this.destination.error(err);
|
24524 | }
|
24525 | };
|
24526 | AnonymousSubject.prototype.complete = function () {
|
24527 | var destination = this.destination;
|
24528 | if (destination && destination.complete) {
|
24529 | this.destination.complete();
|
24530 | }
|
24531 | };
|
24532 | AnonymousSubject.prototype._subscribe = function (subscriber) {
|
24533 | var source = this.source;
|
24534 | if (source) {
|
24535 | return this.source.subscribe(subscriber);
|
24536 | }
|
24537 | else {
|
24538 | return _Subscription__WEBPACK_IMPORTED_MODULE_3__["Subscription"].EMPTY;
|
24539 | }
|
24540 | };
|
24541 | return AnonymousSubject;
|
24542 | }(Subject));
|
24543 |
|
24544 |
|
24545 |
|
24546 |
|
24547 | }),
|
24548 |
|
24549 | (function(module, __webpack_exports__, __webpack_require__) {
|
24550 |
|
24551 | "use strict";
|
24552 | __webpack_require__.r(__webpack_exports__);
|
24553 | __webpack_require__.d(__webpack_exports__, "ObjectUnsubscribedError", function() { return ObjectUnsubscribedError; });
|
24554 |
|
24555 | var ObjectUnsubscribedErrorImpl = (function () {
|
24556 | function ObjectUnsubscribedErrorImpl() {
|
24557 | Error.call(this);
|
24558 | this.message = 'object unsubscribed';
|
24559 | this.name = 'ObjectUnsubscribedError';
|
24560 | return this;
|
24561 | }
|
24562 | ObjectUnsubscribedErrorImpl.prototype = Object.create(Error.prototype);
|
24563 | return ObjectUnsubscribedErrorImpl;
|
24564 | })();
|
24565 | var ObjectUnsubscribedError = ObjectUnsubscribedErrorImpl;
|
24566 |
|
24567 |
|
24568 |
|
24569 | }),
|
24570 |
|
24571 | (function(module, __webpack_exports__, __webpack_require__) {
|
24572 |
|
24573 | "use strict";
|
24574 | __webpack_require__.r(__webpack_exports__);
|
24575 | __webpack_require__.d(__webpack_exports__, "SubjectSubscription", function() { return SubjectSubscription; });
|
24576 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
24577 | var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(175);
|
24578 |
|
24579 |
|
24580 |
|
24581 | var SubjectSubscription = (function (_super) {
|
24582 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SubjectSubscription, _super);
|
24583 | function SubjectSubscription(subject, subscriber) {
|
24584 | var _this = _super.call(this) || this;
|
24585 | _this.subject = subject;
|
24586 | _this.subscriber = subscriber;
|
24587 | _this.closed = false;
|
24588 | return _this;
|
24589 | }
|
24590 | SubjectSubscription.prototype.unsubscribe = function () {
|
24591 | if (this.closed) {
|
24592 | return;
|
24593 | }
|
24594 | this.closed = true;
|
24595 | var subject = this.subject;
|
24596 | var observers = subject.observers;
|
24597 | this.subject = null;
|
24598 | if (!observers || observers.length === 0 || subject.isStopped || subject.closed) {
|
24599 | return;
|
24600 | }
|
24601 | var subscriberIndex = observers.indexOf(this.subscriber);
|
24602 | if (subscriberIndex !== -1) {
|
24603 | observers.splice(subscriberIndex, 1);
|
24604 | }
|
24605 | };
|
24606 | return SubjectSubscription;
|
24607 | }(_Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]));
|
24608 |
|
24609 |
|
24610 |
|
24611 |
|
24612 | }),
|
24613 |
|
24614 | (function(module, __webpack_exports__, __webpack_require__) {
|
24615 |
|
24616 | "use strict";
|
24617 | __webpack_require__.r(__webpack_exports__);
|
24618 | __webpack_require__.d(__webpack_exports__, "refCount", function() { return refCount; });
|
24619 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
24620 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
24621 |
|
24622 |
|
24623 |
|
24624 | function refCount() {
|
24625 | return function refCountOperatorFunction(source) {
|
24626 | return source.lift(new RefCountOperator(source));
|
24627 | };
|
24628 | }
|
24629 | var RefCountOperator = (function () {
|
24630 | function RefCountOperator(connectable) {
|
24631 | this.connectable = connectable;
|
24632 | }
|
24633 | RefCountOperator.prototype.call = function (subscriber, source) {
|
24634 | var connectable = this.connectable;
|
24635 | connectable._refCount++;
|
24636 | var refCounter = new RefCountSubscriber(subscriber, connectable);
|
24637 | var subscription = source.subscribe(refCounter);
|
24638 | if (!refCounter.closed) {
|
24639 | refCounter.connection = connectable.connect();
|
24640 | }
|
24641 | return subscription;
|
24642 | };
|
24643 | return RefCountOperator;
|
24644 | }());
|
24645 | var RefCountSubscriber = (function (_super) {
|
24646 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RefCountSubscriber, _super);
|
24647 | function RefCountSubscriber(destination, connectable) {
|
24648 | var _this = _super.call(this, destination) || this;
|
24649 | _this.connectable = connectable;
|
24650 | return _this;
|
24651 | }
|
24652 | RefCountSubscriber.prototype._unsubscribe = function () {
|
24653 | var connectable = this.connectable;
|
24654 | if (!connectable) {
|
24655 | this.connection = null;
|
24656 | return;
|
24657 | }
|
24658 | this.connectable = null;
|
24659 | var refCount = connectable._refCount;
|
24660 | if (refCount <= 0) {
|
24661 | this.connection = null;
|
24662 | return;
|
24663 | }
|
24664 | connectable._refCount = refCount - 1;
|
24665 | if (refCount > 1) {
|
24666 | this.connection = null;
|
24667 | return;
|
24668 | }
|
24669 | var connection = this.connection;
|
24670 | var sharedConnection = connectable._connection;
|
24671 | this.connection = null;
|
24672 | if (sharedConnection && (!connection || sharedConnection === connection)) {
|
24673 | sharedConnection.unsubscribe();
|
24674 | }
|
24675 | };
|
24676 | return RefCountSubscriber;
|
24677 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
24678 |
|
24679 |
|
24680 |
|
24681 | }),
|
24682 |
|
24683 | (function(module, __webpack_exports__, __webpack_require__) {
|
24684 |
|
24685 | "use strict";
|
24686 | __webpack_require__.r(__webpack_exports__);
|
24687 | __webpack_require__.d(__webpack_exports__, "groupBy", function() { return groupBy; });
|
24688 | __webpack_require__.d(__webpack_exports__, "GroupedObservable", function() { return GroupedObservable; });
|
24689 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
24690 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
24691 | var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(175);
|
24692 | var _Observable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(167);
|
24693 | var _Subject__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(185);
|
24694 |
|
24695 |
|
24696 |
|
24697 |
|
24698 |
|
24699 |
|
24700 | function groupBy(keySelector, elementSelector, durationSelector, subjectSelector) {
|
24701 | return function (source) {
|
24702 | return source.lift(new GroupByOperator(keySelector, elementSelector, durationSelector, subjectSelector));
|
24703 | };
|
24704 | }
|
24705 | var GroupByOperator = (function () {
|
24706 | function GroupByOperator(keySelector, elementSelector, durationSelector, subjectSelector) {
|
24707 | this.keySelector = keySelector;
|
24708 | this.elementSelector = elementSelector;
|
24709 | this.durationSelector = durationSelector;
|
24710 | this.subjectSelector = subjectSelector;
|
24711 | }
|
24712 | GroupByOperator.prototype.call = function (subscriber, source) {
|
24713 | return source.subscribe(new GroupBySubscriber(subscriber, this.keySelector, this.elementSelector, this.durationSelector, this.subjectSelector));
|
24714 | };
|
24715 | return GroupByOperator;
|
24716 | }());
|
24717 | var GroupBySubscriber = (function (_super) {
|
24718 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](GroupBySubscriber, _super);
|
24719 | function GroupBySubscriber(destination, keySelector, elementSelector, durationSelector, subjectSelector) {
|
24720 | var _this = _super.call(this, destination) || this;
|
24721 | _this.keySelector = keySelector;
|
24722 | _this.elementSelector = elementSelector;
|
24723 | _this.durationSelector = durationSelector;
|
24724 | _this.subjectSelector = subjectSelector;
|
24725 | _this.groups = null;
|
24726 | _this.attemptedToUnsubscribe = false;
|
24727 | _this.count = 0;
|
24728 | return _this;
|
24729 | }
|
24730 | GroupBySubscriber.prototype._next = function (value) {
|
24731 | var key;
|
24732 | try {
|
24733 | key = this.keySelector(value);
|
24734 | }
|
24735 | catch (err) {
|
24736 | this.error(err);
|
24737 | return;
|
24738 | }
|
24739 | this._group(value, key);
|
24740 | };
|
24741 | GroupBySubscriber.prototype._group = function (value, key) {
|
24742 | var groups = this.groups;
|
24743 | if (!groups) {
|
24744 | groups = this.groups = new Map();
|
24745 | }
|
24746 | var group = groups.get(key);
|
24747 | var element;
|
24748 | if (this.elementSelector) {
|
24749 | try {
|
24750 | element = this.elementSelector(value);
|
24751 | }
|
24752 | catch (err) {
|
24753 | this.error(err);
|
24754 | }
|
24755 | }
|
24756 | else {
|
24757 | element = value;
|
24758 | }
|
24759 | if (!group) {
|
24760 | group = (this.subjectSelector ? this.subjectSelector() : new _Subject__WEBPACK_IMPORTED_MODULE_4__["Subject"]());
|
24761 | groups.set(key, group);
|
24762 | var groupedObservable = new GroupedObservable(key, group, this);
|
24763 | this.destination.next(groupedObservable);
|
24764 | if (this.durationSelector) {
|
24765 | var duration = void 0;
|
24766 | try {
|
24767 | duration = this.durationSelector(new GroupedObservable(key, group));
|
24768 | }
|
24769 | catch (err) {
|
24770 | this.error(err);
|
24771 | return;
|
24772 | }
|
24773 | this.add(duration.subscribe(new GroupDurationSubscriber(key, group, this)));
|
24774 | }
|
24775 | }
|
24776 | if (!group.closed) {
|
24777 | group.next(element);
|
24778 | }
|
24779 | };
|
24780 | GroupBySubscriber.prototype._error = function (err) {
|
24781 | var groups = this.groups;
|
24782 | if (groups) {
|
24783 | groups.forEach(function (group, key) {
|
24784 | group.error(err);
|
24785 | });
|
24786 | groups.clear();
|
24787 | }
|
24788 | this.destination.error(err);
|
24789 | };
|
24790 | GroupBySubscriber.prototype._complete = function () {
|
24791 | var groups = this.groups;
|
24792 | if (groups) {
|
24793 | groups.forEach(function (group, key) {
|
24794 | group.complete();
|
24795 | });
|
24796 | groups.clear();
|
24797 | }
|
24798 | this.destination.complete();
|
24799 | };
|
24800 | GroupBySubscriber.prototype.removeGroup = function (key) {
|
24801 | this.groups.delete(key);
|
24802 | };
|
24803 | GroupBySubscriber.prototype.unsubscribe = function () {
|
24804 | if (!this.closed) {
|
24805 | this.attemptedToUnsubscribe = true;
|
24806 | if (this.count === 0) {
|
24807 | _super.prototype.unsubscribe.call(this);
|
24808 | }
|
24809 | }
|
24810 | };
|
24811 | return GroupBySubscriber;
|
24812 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
24813 | var GroupDurationSubscriber = (function (_super) {
|
24814 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](GroupDurationSubscriber, _super);
|
24815 | function GroupDurationSubscriber(key, group, parent) {
|
24816 | var _this = _super.call(this, group) || this;
|
24817 | _this.key = key;
|
24818 | _this.group = group;
|
24819 | _this.parent = parent;
|
24820 | return _this;
|
24821 | }
|
24822 | GroupDurationSubscriber.prototype._next = function (value) {
|
24823 | this.complete();
|
24824 | };
|
24825 | GroupDurationSubscriber.prototype._unsubscribe = function () {
|
24826 | var _a = this, parent = _a.parent, key = _a.key;
|
24827 | this.key = this.parent = null;
|
24828 | if (parent) {
|
24829 | parent.removeGroup(key);
|
24830 | }
|
24831 | };
|
24832 | return GroupDurationSubscriber;
|
24833 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
24834 | var GroupedObservable = (function (_super) {
|
24835 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](GroupedObservable, _super);
|
24836 | function GroupedObservable(key, groupSubject, refCountSubscription) {
|
24837 | var _this = _super.call(this) || this;
|
24838 | _this.key = key;
|
24839 | _this.groupSubject = groupSubject;
|
24840 | _this.refCountSubscription = refCountSubscription;
|
24841 | return _this;
|
24842 | }
|
24843 | GroupedObservable.prototype._subscribe = function (subscriber) {
|
24844 | var subscription = new _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"]();
|
24845 | var _a = this, refCountSubscription = _a.refCountSubscription, groupSubject = _a.groupSubject;
|
24846 | if (refCountSubscription && !refCountSubscription.closed) {
|
24847 | subscription.add(new InnerRefCountSubscription(refCountSubscription));
|
24848 | }
|
24849 | subscription.add(groupSubject.subscribe(subscriber));
|
24850 | return subscription;
|
24851 | };
|
24852 | return GroupedObservable;
|
24853 | }(_Observable__WEBPACK_IMPORTED_MODULE_3__["Observable"]));
|
24854 |
|
24855 | var InnerRefCountSubscription = (function (_super) {
|
24856 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](InnerRefCountSubscription, _super);
|
24857 | function InnerRefCountSubscription(parent) {
|
24858 | var _this = _super.call(this) || this;
|
24859 | _this.parent = parent;
|
24860 | parent.count++;
|
24861 | return _this;
|
24862 | }
|
24863 | InnerRefCountSubscription.prototype.unsubscribe = function () {
|
24864 | var parent = this.parent;
|
24865 | if (!parent.closed && !this.closed) {
|
24866 | _super.prototype.unsubscribe.call(this);
|
24867 | parent.count -= 1;
|
24868 | if (parent.count === 0 && parent.attemptedToUnsubscribe) {
|
24869 | parent.unsubscribe();
|
24870 | }
|
24871 | }
|
24872 | };
|
24873 | return InnerRefCountSubscription;
|
24874 | }(_Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"]));
|
24875 |
|
24876 |
|
24877 |
|
24878 | }),
|
24879 |
|
24880 | (function(module, __webpack_exports__, __webpack_require__) {
|
24881 |
|
24882 | "use strict";
|
24883 | __webpack_require__.r(__webpack_exports__);
|
24884 | __webpack_require__.d(__webpack_exports__, "BehaviorSubject", function() { return BehaviorSubject; });
|
24885 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
24886 | var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(185);
|
24887 | var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(186);
|
24888 |
|
24889 |
|
24890 |
|
24891 |
|
24892 | var BehaviorSubject = (function (_super) {
|
24893 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BehaviorSubject, _super);
|
24894 | function BehaviorSubject(_value) {
|
24895 | var _this = _super.call(this) || this;
|
24896 | _this._value = _value;
|
24897 | return _this;
|
24898 | }
|
24899 | Object.defineProperty(BehaviorSubject.prototype, "value", {
|
24900 | get: function () {
|
24901 | return this.getValue();
|
24902 | },
|
24903 | enumerable: true,
|
24904 | configurable: true
|
24905 | });
|
24906 | BehaviorSubject.prototype._subscribe = function (subscriber) {
|
24907 | var subscription = _super.prototype._subscribe.call(this, subscriber);
|
24908 | if (subscription && !subscription.closed) {
|
24909 | subscriber.next(this._value);
|
24910 | }
|
24911 | return subscription;
|
24912 | };
|
24913 | BehaviorSubject.prototype.getValue = function () {
|
24914 | if (this.hasError) {
|
24915 | throw this.thrownError;
|
24916 | }
|
24917 | else if (this.closed) {
|
24918 | throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_2__["ObjectUnsubscribedError"]();
|
24919 | }
|
24920 | else {
|
24921 | return this._value;
|
24922 | }
|
24923 | };
|
24924 | BehaviorSubject.prototype.next = function (value) {
|
24925 | _super.prototype.next.call(this, this._value = value);
|
24926 | };
|
24927 | return BehaviorSubject;
|
24928 | }(_Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]));
|
24929 |
|
24930 |
|
24931 |
|
24932 |
|
24933 | }),
|
24934 |
|
24935 | (function(module, __webpack_exports__, __webpack_require__) {
|
24936 |
|
24937 | "use strict";
|
24938 | __webpack_require__.r(__webpack_exports__);
|
24939 | __webpack_require__.d(__webpack_exports__, "ReplaySubject", function() { return ReplaySubject; });
|
24940 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
24941 | var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(185);
|
24942 | var _scheduler_queue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(192);
|
24943 | var _Subscription__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(175);
|
24944 | var _operators_observeOn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(199);
|
24945 | var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(186);
|
24946 | var _SubjectSubscription__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(187);
|
24947 |
|
24948 |
|
24949 |
|
24950 |
|
24951 |
|
24952 |
|
24953 |
|
24954 |
|
24955 | var ReplaySubject = (function (_super) {
|
24956 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ReplaySubject, _super);
|
24957 | function ReplaySubject(bufferSize, windowTime, scheduler) {
|
24958 | if (bufferSize === void 0) {
|
24959 | bufferSize = Number.POSITIVE_INFINITY;
|
24960 | }
|
24961 | if (windowTime === void 0) {
|
24962 | windowTime = Number.POSITIVE_INFINITY;
|
24963 | }
|
24964 | var _this = _super.call(this) || this;
|
24965 | _this.scheduler = scheduler;
|
24966 | _this._events = [];
|
24967 | _this._infiniteTimeWindow = false;
|
24968 | _this._bufferSize = bufferSize < 1 ? 1 : bufferSize;
|
24969 | _this._windowTime = windowTime < 1 ? 1 : windowTime;
|
24970 | if (windowTime === Number.POSITIVE_INFINITY) {
|
24971 | _this._infiniteTimeWindow = true;
|
24972 | _this.next = _this.nextInfiniteTimeWindow;
|
24973 | }
|
24974 | else {
|
24975 | _this.next = _this.nextTimeWindow;
|
24976 | }
|
24977 | return _this;
|
24978 | }
|
24979 | ReplaySubject.prototype.nextInfiniteTimeWindow = function (value) {
|
24980 | var _events = this._events;
|
24981 | _events.push(value);
|
24982 | if (_events.length > this._bufferSize) {
|
24983 | _events.shift();
|
24984 | }
|
24985 | _super.prototype.next.call(this, value);
|
24986 | };
|
24987 | ReplaySubject.prototype.nextTimeWindow = function (value) {
|
24988 | this._events.push(new ReplayEvent(this._getNow(), value));
|
24989 | this._trimBufferThenGetEvents();
|
24990 | _super.prototype.next.call(this, value);
|
24991 | };
|
24992 | ReplaySubject.prototype._subscribe = function (subscriber) {
|
24993 | var _infiniteTimeWindow = this._infiniteTimeWindow;
|
24994 | var _events = _infiniteTimeWindow ? this._events : this._trimBufferThenGetEvents();
|
24995 | var scheduler = this.scheduler;
|
24996 | var len = _events.length;
|
24997 | var subscription;
|
24998 | if (this.closed) {
|
24999 | throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_5__["ObjectUnsubscribedError"]();
|
25000 | }
|
25001 | else if (this.isStopped || this.hasError) {
|
25002 | subscription = _Subscription__WEBPACK_IMPORTED_MODULE_3__["Subscription"].EMPTY;
|
25003 | }
|
25004 | else {
|
25005 | this.observers.push(subscriber);
|
25006 | subscription = new _SubjectSubscription__WEBPACK_IMPORTED_MODULE_6__["SubjectSubscription"](this, subscriber);
|
25007 | }
|
25008 | if (scheduler) {
|
25009 | subscriber.add(subscriber = new _operators_observeOn__WEBPACK_IMPORTED_MODULE_4__["ObserveOnSubscriber"](subscriber, scheduler));
|
25010 | }
|
25011 | if (_infiniteTimeWindow) {
|
25012 | for (var i = 0; i < len && !subscriber.closed; i++) {
|
25013 | subscriber.next(_events[i]);
|
25014 | }
|
25015 | }
|
25016 | else {
|
25017 | for (var i = 0; i < len && !subscriber.closed; i++) {
|
25018 | subscriber.next(_events[i].value);
|
25019 | }
|
25020 | }
|
25021 | if (this.hasError) {
|
25022 | subscriber.error(this.thrownError);
|
25023 | }
|
25024 | else if (this.isStopped) {
|
25025 | subscriber.complete();
|
25026 | }
|
25027 | return subscription;
|
25028 | };
|
25029 | ReplaySubject.prototype._getNow = function () {
|
25030 | return (this.scheduler || _scheduler_queue__WEBPACK_IMPORTED_MODULE_2__["queue"]).now();
|
25031 | };
|
25032 | ReplaySubject.prototype._trimBufferThenGetEvents = function () {
|
25033 | var now = this._getNow();
|
25034 | var _bufferSize = this._bufferSize;
|
25035 | var _windowTime = this._windowTime;
|
25036 | var _events = this._events;
|
25037 | var eventsCount = _events.length;
|
25038 | var spliceCount = 0;
|
25039 | while (spliceCount < eventsCount) {
|
25040 | if ((now - _events[spliceCount].time) < _windowTime) {
|
25041 | break;
|
25042 | }
|
25043 | spliceCount++;
|
25044 | }
|
25045 | if (eventsCount > _bufferSize) {
|
25046 | spliceCount = Math.max(spliceCount, eventsCount - _bufferSize);
|
25047 | }
|
25048 | if (spliceCount > 0) {
|
25049 | _events.splice(0, spliceCount);
|
25050 | }
|
25051 | return _events;
|
25052 | };
|
25053 | return ReplaySubject;
|
25054 | }(_Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]));
|
25055 |
|
25056 | var ReplayEvent = (function () {
|
25057 | function ReplayEvent(time, value) {
|
25058 | this.time = time;
|
25059 | this.value = value;
|
25060 | }
|
25061 | return ReplayEvent;
|
25062 | }());
|
25063 |
|
25064 |
|
25065 |
|
25066 | }),
|
25067 |
|
25068 | (function(module, __webpack_exports__, __webpack_require__) {
|
25069 |
|
25070 | "use strict";
|
25071 | __webpack_require__.r(__webpack_exports__);
|
25072 | __webpack_require__.d(__webpack_exports__, "queue", function() { return queue; });
|
25073 | var _QueueAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(193);
|
25074 | var _QueueScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(196);
|
25075 |
|
25076 |
|
25077 |
|
25078 | var queue = new _QueueScheduler__WEBPACK_IMPORTED_MODULE_1__["QueueScheduler"](_QueueAction__WEBPACK_IMPORTED_MODULE_0__["QueueAction"]);
|
25079 |
|
25080 |
|
25081 |
|
25082 | }),
|
25083 |
|
25084 | (function(module, __webpack_exports__, __webpack_require__) {
|
25085 |
|
25086 | "use strict";
|
25087 | __webpack_require__.r(__webpack_exports__);
|
25088 | __webpack_require__.d(__webpack_exports__, "QueueAction", function() { return QueueAction; });
|
25089 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
25090 | var _AsyncAction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(194);
|
25091 |
|
25092 |
|
25093 |
|
25094 | var QueueAction = (function (_super) {
|
25095 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](QueueAction, _super);
|
25096 | function QueueAction(scheduler, work) {
|
25097 | var _this = _super.call(this, scheduler, work) || this;
|
25098 | _this.scheduler = scheduler;
|
25099 | _this.work = work;
|
25100 | return _this;
|
25101 | }
|
25102 | QueueAction.prototype.schedule = function (state, delay) {
|
25103 | if (delay === void 0) {
|
25104 | delay = 0;
|
25105 | }
|
25106 | if (delay > 0) {
|
25107 | return _super.prototype.schedule.call(this, state, delay);
|
25108 | }
|
25109 | this.delay = delay;
|
25110 | this.state = state;
|
25111 | this.scheduler.flush(this);
|
25112 | return this;
|
25113 | };
|
25114 | QueueAction.prototype.execute = function (state, delay) {
|
25115 | return (delay > 0 || this.closed) ?
|
25116 | _super.prototype.execute.call(this, state, delay) :
|
25117 | this._execute(state, delay);
|
25118 | };
|
25119 | QueueAction.prototype.requestAsyncId = function (scheduler, id, delay) {
|
25120 | if (delay === void 0) {
|
25121 | delay = 0;
|
25122 | }
|
25123 | if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {
|
25124 | return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
|
25125 | }
|
25126 | return scheduler.flush(this);
|
25127 | };
|
25128 | return QueueAction;
|
25129 | }(_AsyncAction__WEBPACK_IMPORTED_MODULE_1__["AsyncAction"]));
|
25130 |
|
25131 |
|
25132 |
|
25133 |
|
25134 | }),
|
25135 |
|
25136 | (function(module, __webpack_exports__, __webpack_require__) {
|
25137 |
|
25138 | "use strict";
|
25139 | __webpack_require__.r(__webpack_exports__);
|
25140 | __webpack_require__.d(__webpack_exports__, "AsyncAction", function() { return AsyncAction; });
|
25141 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
25142 | var _Action__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(195);
|
25143 |
|
25144 |
|
25145 |
|
25146 | var AsyncAction = (function (_super) {
|
25147 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AsyncAction, _super);
|
25148 | function AsyncAction(scheduler, work) {
|
25149 | var _this = _super.call(this, scheduler, work) || this;
|
25150 | _this.scheduler = scheduler;
|
25151 | _this.work = work;
|
25152 | _this.pending = false;
|
25153 | return _this;
|
25154 | }
|
25155 | AsyncAction.prototype.schedule = function (state, delay) {
|
25156 | if (delay === void 0) {
|
25157 | delay = 0;
|
25158 | }
|
25159 | if (this.closed) {
|
25160 | return this;
|
25161 | }
|
25162 | this.state = state;
|
25163 | var id = this.id;
|
25164 | var scheduler = this.scheduler;
|
25165 | if (id != null) {
|
25166 | this.id = this.recycleAsyncId(scheduler, id, delay);
|
25167 | }
|
25168 | this.pending = true;
|
25169 | this.delay = delay;
|
25170 | this.id = this.id || this.requestAsyncId(scheduler, this.id, delay);
|
25171 | return this;
|
25172 | };
|
25173 | AsyncAction.prototype.requestAsyncId = function (scheduler, id, delay) {
|
25174 | if (delay === void 0) {
|
25175 | delay = 0;
|
25176 | }
|
25177 | return setInterval(scheduler.flush.bind(scheduler, this), delay);
|
25178 | };
|
25179 | AsyncAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
|
25180 | if (delay === void 0) {
|
25181 | delay = 0;
|
25182 | }
|
25183 | if (delay !== null && this.delay === delay && this.pending === false) {
|
25184 | return id;
|
25185 | }
|
25186 | clearInterval(id);
|
25187 | return undefined;
|
25188 | };
|
25189 | AsyncAction.prototype.execute = function (state, delay) {
|
25190 | if (this.closed) {
|
25191 | return new Error('executing a cancelled action');
|
25192 | }
|
25193 | this.pending = false;
|
25194 | var error = this._execute(state, delay);
|
25195 | if (error) {
|
25196 | return error;
|
25197 | }
|
25198 | else if (this.pending === false && this.id != null) {
|
25199 | this.id = this.recycleAsyncId(this.scheduler, this.id, null);
|
25200 | }
|
25201 | };
|
25202 | AsyncAction.prototype._execute = function (state, delay) {
|
25203 | var errored = false;
|
25204 | var errorValue = undefined;
|
25205 | try {
|
25206 | this.work(state);
|
25207 | }
|
25208 | catch (e) {
|
25209 | errored = true;
|
25210 | errorValue = !!e && e || new Error(e);
|
25211 | }
|
25212 | if (errored) {
|
25213 | this.unsubscribe();
|
25214 | return errorValue;
|
25215 | }
|
25216 | };
|
25217 | AsyncAction.prototype._unsubscribe = function () {
|
25218 | var id = this.id;
|
25219 | var scheduler = this.scheduler;
|
25220 | var actions = scheduler.actions;
|
25221 | var index = actions.indexOf(this);
|
25222 | this.work = null;
|
25223 | this.state = null;
|
25224 | this.pending = false;
|
25225 | this.scheduler = null;
|
25226 | if (index !== -1) {
|
25227 | actions.splice(index, 1);
|
25228 | }
|
25229 | if (id != null) {
|
25230 | this.id = this.recycleAsyncId(scheduler, id, null);
|
25231 | }
|
25232 | this.delay = null;
|
25233 | };
|
25234 | return AsyncAction;
|
25235 | }(_Action__WEBPACK_IMPORTED_MODULE_1__["Action"]));
|
25236 |
|
25237 |
|
25238 |
|
25239 |
|
25240 | }),
|
25241 |
|
25242 | (function(module, __webpack_exports__, __webpack_require__) {
|
25243 |
|
25244 | "use strict";
|
25245 | __webpack_require__.r(__webpack_exports__);
|
25246 | __webpack_require__.d(__webpack_exports__, "Action", function() { return Action; });
|
25247 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
25248 | var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(175);
|
25249 |
|
25250 |
|
25251 |
|
25252 | var Action = (function (_super) {
|
25253 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](Action, _super);
|
25254 | function Action(scheduler, work) {
|
25255 | return _super.call(this) || this;
|
25256 | }
|
25257 | Action.prototype.schedule = function (state, delay) {
|
25258 | if (delay === void 0) {
|
25259 | delay = 0;
|
25260 | }
|
25261 | return this;
|
25262 | };
|
25263 | return Action;
|
25264 | }(_Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]));
|
25265 |
|
25266 |
|
25267 |
|
25268 |
|
25269 | }),
|
25270 |
|
25271 | (function(module, __webpack_exports__, __webpack_require__) {
|
25272 |
|
25273 | "use strict";
|
25274 | __webpack_require__.r(__webpack_exports__);
|
25275 | __webpack_require__.d(__webpack_exports__, "QueueScheduler", function() { return QueueScheduler; });
|
25276 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
25277 | var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(197);
|
25278 |
|
25279 |
|
25280 |
|
25281 | var QueueScheduler = (function (_super) {
|
25282 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](QueueScheduler, _super);
|
25283 | function QueueScheduler() {
|
25284 | return _super !== null && _super.apply(this, arguments) || this;
|
25285 | }
|
25286 | return QueueScheduler;
|
25287 | }(_AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__["AsyncScheduler"]));
|
25288 |
|
25289 |
|
25290 |
|
25291 |
|
25292 | }),
|
25293 |
|
25294 | (function(module, __webpack_exports__, __webpack_require__) {
|
25295 |
|
25296 | "use strict";
|
25297 | __webpack_require__.r(__webpack_exports__);
|
25298 | __webpack_require__.d(__webpack_exports__, "AsyncScheduler", function() { return AsyncScheduler; });
|
25299 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
25300 | var _Scheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(198);
|
25301 |
|
25302 |
|
25303 |
|
25304 | var AsyncScheduler = (function (_super) {
|
25305 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AsyncScheduler, _super);
|
25306 | function AsyncScheduler(SchedulerAction, now) {
|
25307 | if (now === void 0) {
|
25308 | now = _Scheduler__WEBPACK_IMPORTED_MODULE_1__["Scheduler"].now;
|
25309 | }
|
25310 | var _this = _super.call(this, SchedulerAction, function () {
|
25311 | if (AsyncScheduler.delegate && AsyncScheduler.delegate !== _this) {
|
25312 | return AsyncScheduler.delegate.now();
|
25313 | }
|
25314 | else {
|
25315 | return now();
|
25316 | }
|
25317 | }) || this;
|
25318 | _this.actions = [];
|
25319 | _this.active = false;
|
25320 | _this.scheduled = undefined;
|
25321 | return _this;
|
25322 | }
|
25323 | AsyncScheduler.prototype.schedule = function (work, delay, state) {
|
25324 | if (delay === void 0) {
|
25325 | delay = 0;
|
25326 | }
|
25327 | if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) {
|
25328 | return AsyncScheduler.delegate.schedule(work, delay, state);
|
25329 | }
|
25330 | else {
|
25331 | return _super.prototype.schedule.call(this, work, delay, state);
|
25332 | }
|
25333 | };
|
25334 | AsyncScheduler.prototype.flush = function (action) {
|
25335 | var actions = this.actions;
|
25336 | if (this.active) {
|
25337 | actions.push(action);
|
25338 | return;
|
25339 | }
|
25340 | var error;
|
25341 | this.active = true;
|
25342 | do {
|
25343 | if (error = action.execute(action.state, action.delay)) {
|
25344 | break;
|
25345 | }
|
25346 | } while (action = actions.shift());
|
25347 | this.active = false;
|
25348 | if (error) {
|
25349 | while (action = actions.shift()) {
|
25350 | action.unsubscribe();
|
25351 | }
|
25352 | throw error;
|
25353 | }
|
25354 | };
|
25355 | return AsyncScheduler;
|
25356 | }(_Scheduler__WEBPACK_IMPORTED_MODULE_1__["Scheduler"]));
|
25357 |
|
25358 |
|
25359 |
|
25360 |
|
25361 | }),
|
25362 |
|
25363 | (function(module, __webpack_exports__, __webpack_require__) {
|
25364 |
|
25365 | "use strict";
|
25366 | __webpack_require__.r(__webpack_exports__);
|
25367 | __webpack_require__.d(__webpack_exports__, "Scheduler", function() { return Scheduler; });
|
25368 | var Scheduler = (function () {
|
25369 | function Scheduler(SchedulerAction, now) {
|
25370 | if (now === void 0) {
|
25371 | now = Scheduler.now;
|
25372 | }
|
25373 | this.SchedulerAction = SchedulerAction;
|
25374 | this.now = now;
|
25375 | }
|
25376 | Scheduler.prototype.schedule = function (work, delay, state) {
|
25377 | if (delay === void 0) {
|
25378 | delay = 0;
|
25379 | }
|
25380 | return new this.SchedulerAction(this, work).schedule(state, delay);
|
25381 | };
|
25382 | Scheduler.now = function () { return Date.now(); };
|
25383 | return Scheduler;
|
25384 | }());
|
25385 |
|
25386 |
|
25387 |
|
25388 |
|
25389 | }),
|
25390 |
|
25391 | (function(module, __webpack_exports__, __webpack_require__) {
|
25392 |
|
25393 | "use strict";
|
25394 | __webpack_require__.r(__webpack_exports__);
|
25395 | __webpack_require__.d(__webpack_exports__, "observeOn", function() { return observeOn; });
|
25396 | __webpack_require__.d(__webpack_exports__, "ObserveOnOperator", function() { return ObserveOnOperator; });
|
25397 | __webpack_require__.d(__webpack_exports__, "ObserveOnSubscriber", function() { return ObserveOnSubscriber; });
|
25398 | __webpack_require__.d(__webpack_exports__, "ObserveOnMessage", function() { return ObserveOnMessage; });
|
25399 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
25400 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
25401 | var _Notification__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(200);
|
25402 |
|
25403 |
|
25404 |
|
25405 |
|
25406 | function observeOn(scheduler, delay) {
|
25407 | if (delay === void 0) {
|
25408 | delay = 0;
|
25409 | }
|
25410 | return function observeOnOperatorFunction(source) {
|
25411 | return source.lift(new ObserveOnOperator(scheduler, delay));
|
25412 | };
|
25413 | }
|
25414 | var ObserveOnOperator = (function () {
|
25415 | function ObserveOnOperator(scheduler, delay) {
|
25416 | if (delay === void 0) {
|
25417 | delay = 0;
|
25418 | }
|
25419 | this.scheduler = scheduler;
|
25420 | this.delay = delay;
|
25421 | }
|
25422 | ObserveOnOperator.prototype.call = function (subscriber, source) {
|
25423 | return source.subscribe(new ObserveOnSubscriber(subscriber, this.scheduler, this.delay));
|
25424 | };
|
25425 | return ObserveOnOperator;
|
25426 | }());
|
25427 |
|
25428 | var ObserveOnSubscriber = (function (_super) {
|
25429 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ObserveOnSubscriber, _super);
|
25430 | function ObserveOnSubscriber(destination, scheduler, delay) {
|
25431 | if (delay === void 0) {
|
25432 | delay = 0;
|
25433 | }
|
25434 | var _this = _super.call(this, destination) || this;
|
25435 | _this.scheduler = scheduler;
|
25436 | _this.delay = delay;
|
25437 | return _this;
|
25438 | }
|
25439 | ObserveOnSubscriber.dispatch = function (arg) {
|
25440 | var notification = arg.notification, destination = arg.destination;
|
25441 | notification.observe(destination);
|
25442 | this.unsubscribe();
|
25443 | };
|
25444 | ObserveOnSubscriber.prototype.scheduleMessage = function (notification) {
|
25445 | var destination = this.destination;
|
25446 | destination.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(notification, this.destination)));
|
25447 | };
|
25448 | ObserveOnSubscriber.prototype._next = function (value) {
|
25449 | this.scheduleMessage(_Notification__WEBPACK_IMPORTED_MODULE_2__["Notification"].createNext(value));
|
25450 | };
|
25451 | ObserveOnSubscriber.prototype._error = function (err) {
|
25452 | this.scheduleMessage(_Notification__WEBPACK_IMPORTED_MODULE_2__["Notification"].createError(err));
|
25453 | this.unsubscribe();
|
25454 | };
|
25455 | ObserveOnSubscriber.prototype._complete = function () {
|
25456 | this.scheduleMessage(_Notification__WEBPACK_IMPORTED_MODULE_2__["Notification"].createComplete());
|
25457 | this.unsubscribe();
|
25458 | };
|
25459 | return ObserveOnSubscriber;
|
25460 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
25461 |
|
25462 | var ObserveOnMessage = (function () {
|
25463 | function ObserveOnMessage(notification, destination) {
|
25464 | this.notification = notification;
|
25465 | this.destination = destination;
|
25466 | }
|
25467 | return ObserveOnMessage;
|
25468 | }());
|
25469 |
|
25470 |
|
25471 |
|
25472 |
|
25473 | }),
|
25474 |
|
25475 | (function(module, __webpack_exports__, __webpack_require__) {
|
25476 |
|
25477 | "use strict";
|
25478 | __webpack_require__.r(__webpack_exports__);
|
25479 | __webpack_require__.d(__webpack_exports__, "NotificationKind", function() { return NotificationKind; });
|
25480 | __webpack_require__.d(__webpack_exports__, "Notification", function() { return Notification; });
|
25481 | var _observable_empty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(201);
|
25482 | var _observable_of__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(202);
|
25483 | var _observable_throwError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(207);
|
25484 |
|
25485 |
|
25486 |
|
25487 |
|
25488 | var NotificationKind;
|
25489 | (function (NotificationKind) {
|
25490 | NotificationKind["NEXT"] = "N";
|
25491 | NotificationKind["ERROR"] = "E";
|
25492 | NotificationKind["COMPLETE"] = "C";
|
25493 | })(NotificationKind || (NotificationKind = {}));
|
25494 | var Notification = (function () {
|
25495 | function Notification(kind, value, error) {
|
25496 | this.kind = kind;
|
25497 | this.value = value;
|
25498 | this.error = error;
|
25499 | this.hasValue = kind === 'N';
|
25500 | }
|
25501 | Notification.prototype.observe = function (observer) {
|
25502 | switch (this.kind) {
|
25503 | case 'N':
|
25504 | return observer.next && observer.next(this.value);
|
25505 | case 'E':
|
25506 | return observer.error && observer.error(this.error);
|
25507 | case 'C':
|
25508 | return observer.complete && observer.complete();
|
25509 | }
|
25510 | };
|
25511 | Notification.prototype.do = function (next, error, complete) {
|
25512 | var kind = this.kind;
|
25513 | switch (kind) {
|
25514 | case 'N':
|
25515 | return next && next(this.value);
|
25516 | case 'E':
|
25517 | return error && error(this.error);
|
25518 | case 'C':
|
25519 | return complete && complete();
|
25520 | }
|
25521 | };
|
25522 | Notification.prototype.accept = function (nextOrObserver, error, complete) {
|
25523 | if (nextOrObserver && typeof nextOrObserver.next === 'function') {
|
25524 | return this.observe(nextOrObserver);
|
25525 | }
|
25526 | else {
|
25527 | return this.do(nextOrObserver, error, complete);
|
25528 | }
|
25529 | };
|
25530 | Notification.prototype.toObservable = function () {
|
25531 | var kind = this.kind;
|
25532 | switch (kind) {
|
25533 | case 'N':
|
25534 | return Object(_observable_of__WEBPACK_IMPORTED_MODULE_1__["of"])(this.value);
|
25535 | case 'E':
|
25536 | return Object(_observable_throwError__WEBPACK_IMPORTED_MODULE_2__["throwError"])(this.error);
|
25537 | case 'C':
|
25538 | return Object(_observable_empty__WEBPACK_IMPORTED_MODULE_0__["empty"])();
|
25539 | }
|
25540 | throw new Error('unexpected notification kind value');
|
25541 | };
|
25542 | Notification.createNext = function (value) {
|
25543 | if (typeof value !== 'undefined') {
|
25544 | return new Notification('N', value);
|
25545 | }
|
25546 | return Notification.undefinedValueNotification;
|
25547 | };
|
25548 | Notification.createError = function (err) {
|
25549 | return new Notification('E', undefined, err);
|
25550 | };
|
25551 | Notification.createComplete = function () {
|
25552 | return Notification.completeNotification;
|
25553 | };
|
25554 | Notification.completeNotification = new Notification('C');
|
25555 | Notification.undefinedValueNotification = new Notification('N', undefined);
|
25556 | return Notification;
|
25557 | }());
|
25558 |
|
25559 |
|
25560 |
|
25561 |
|
25562 | }),
|
25563 |
|
25564 | (function(module, __webpack_exports__, __webpack_require__) {
|
25565 |
|
25566 | "use strict";
|
25567 | __webpack_require__.r(__webpack_exports__);
|
25568 | __webpack_require__.d(__webpack_exports__, "EMPTY", function() { return EMPTY; });
|
25569 | __webpack_require__.d(__webpack_exports__, "empty", function() { return empty; });
|
25570 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(167);
|
25571 |
|
25572 |
|
25573 | var EMPTY = new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { return subscriber.complete(); });
|
25574 | function empty(scheduler) {
|
25575 | return scheduler ? emptyScheduled(scheduler) : EMPTY;
|
25576 | }
|
25577 | function emptyScheduled(scheduler) {
|
25578 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { return scheduler.schedule(function () { return subscriber.complete(); }); });
|
25579 | }
|
25580 |
|
25581 |
|
25582 |
|
25583 | }),
|
25584 |
|
25585 | (function(module, __webpack_exports__, __webpack_require__) {
|
25586 |
|
25587 | "use strict";
|
25588 | __webpack_require__.r(__webpack_exports__);
|
25589 | __webpack_require__.d(__webpack_exports__, "of", function() { return of; });
|
25590 | var _util_isScheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(203);
|
25591 | var _fromArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(204);
|
25592 | var _scheduled_scheduleArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(206);
|
25593 |
|
25594 |
|
25595 |
|
25596 |
|
25597 | function of() {
|
25598 | var args = [];
|
25599 | for (var _i = 0; _i < arguments.length; _i++) {
|
25600 | args[_i] = arguments[_i];
|
25601 | }
|
25602 | var scheduler = args[args.length - 1];
|
25603 | if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_0__["isScheduler"])(scheduler)) {
|
25604 | args.pop();
|
25605 | return Object(_scheduled_scheduleArray__WEBPACK_IMPORTED_MODULE_2__["scheduleArray"])(args, scheduler);
|
25606 | }
|
25607 | else {
|
25608 | return Object(_fromArray__WEBPACK_IMPORTED_MODULE_1__["fromArray"])(args);
|
25609 | }
|
25610 | }
|
25611 |
|
25612 |
|
25613 |
|
25614 | }),
|
25615 |
|
25616 | (function(module, __webpack_exports__, __webpack_require__) {
|
25617 |
|
25618 | "use strict";
|
25619 | __webpack_require__.r(__webpack_exports__);
|
25620 | __webpack_require__.d(__webpack_exports__, "isScheduler", function() { return isScheduler; });
|
25621 |
|
25622 | function isScheduler(value) {
|
25623 | return value && typeof value.schedule === 'function';
|
25624 | }
|
25625 |
|
25626 |
|
25627 |
|
25628 | }),
|
25629 |
|
25630 | (function(module, __webpack_exports__, __webpack_require__) {
|
25631 |
|
25632 | "use strict";
|
25633 | __webpack_require__.r(__webpack_exports__);
|
25634 | __webpack_require__.d(__webpack_exports__, "fromArray", function() { return fromArray; });
|
25635 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(167);
|
25636 | var _util_subscribeToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(205);
|
25637 | var _scheduled_scheduleArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(206);
|
25638 |
|
25639 |
|
25640 |
|
25641 |
|
25642 | function fromArray(input, scheduler) {
|
25643 | if (!scheduler) {
|
25644 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](Object(_util_subscribeToArray__WEBPACK_IMPORTED_MODULE_1__["subscribeToArray"])(input));
|
25645 | }
|
25646 | else {
|
25647 | return Object(_scheduled_scheduleArray__WEBPACK_IMPORTED_MODULE_2__["scheduleArray"])(input, scheduler);
|
25648 | }
|
25649 | }
|
25650 |
|
25651 |
|
25652 |
|
25653 | }),
|
25654 |
|
25655 | (function(module, __webpack_exports__, __webpack_require__) {
|
25656 |
|
25657 | "use strict";
|
25658 | __webpack_require__.r(__webpack_exports__);
|
25659 | __webpack_require__.d(__webpack_exports__, "subscribeToArray", function() { return subscribeToArray; });
|
25660 |
|
25661 | var subscribeToArray = function (array) {
|
25662 | return function (subscriber) {
|
25663 | for (var i = 0, len = array.length; i < len && !subscriber.closed; i++) {
|
25664 | subscriber.next(array[i]);
|
25665 | }
|
25666 | subscriber.complete();
|
25667 | };
|
25668 | };
|
25669 |
|
25670 |
|
25671 |
|
25672 | }),
|
25673 |
|
25674 | (function(module, __webpack_exports__, __webpack_require__) {
|
25675 |
|
25676 | "use strict";
|
25677 | __webpack_require__.r(__webpack_exports__);
|
25678 | __webpack_require__.d(__webpack_exports__, "scheduleArray", function() { return scheduleArray; });
|
25679 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(167);
|
25680 | var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(175);
|
25681 |
|
25682 |
|
25683 |
|
25684 | function scheduleArray(input, scheduler) {
|
25685 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
25686 | var sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
|
25687 | var i = 0;
|
25688 | sub.add(scheduler.schedule(function () {
|
25689 | if (i === input.length) {
|
25690 | subscriber.complete();
|
25691 | return;
|
25692 | }
|
25693 | subscriber.next(input[i++]);
|
25694 | if (!subscriber.closed) {
|
25695 | sub.add(this.schedule());
|
25696 | }
|
25697 | }));
|
25698 | return sub;
|
25699 | });
|
25700 | }
|
25701 |
|
25702 |
|
25703 |
|
25704 | }),
|
25705 |
|
25706 | (function(module, __webpack_exports__, __webpack_require__) {
|
25707 |
|
25708 | "use strict";
|
25709 | __webpack_require__.r(__webpack_exports__);
|
25710 | __webpack_require__.d(__webpack_exports__, "throwError", function() { return throwError; });
|
25711 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(167);
|
25712 |
|
25713 |
|
25714 | function throwError(error, scheduler) {
|
25715 | if (!scheduler) {
|
25716 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { return subscriber.error(error); });
|
25717 | }
|
25718 | else {
|
25719 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { return scheduler.schedule(dispatch, 0, { error: error, subscriber: subscriber }); });
|
25720 | }
|
25721 | }
|
25722 | function dispatch(_a) {
|
25723 | var error = _a.error, subscriber = _a.subscriber;
|
25724 | subscriber.error(error);
|
25725 | }
|
25726 |
|
25727 |
|
25728 |
|
25729 | }),
|
25730 |
|
25731 | (function(module, __webpack_exports__, __webpack_require__) {
|
25732 |
|
25733 | "use strict";
|
25734 | __webpack_require__.r(__webpack_exports__);
|
25735 | __webpack_require__.d(__webpack_exports__, "AsyncSubject", function() { return AsyncSubject; });
|
25736 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
25737 | var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(185);
|
25738 | var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(175);
|
25739 |
|
25740 |
|
25741 |
|
25742 |
|
25743 | var AsyncSubject = (function (_super) {
|
25744 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AsyncSubject, _super);
|
25745 | function AsyncSubject() {
|
25746 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
25747 | _this.value = null;
|
25748 | _this.hasNext = false;
|
25749 | _this.hasCompleted = false;
|
25750 | return _this;
|
25751 | }
|
25752 | AsyncSubject.prototype._subscribe = function (subscriber) {
|
25753 | if (this.hasError) {
|
25754 | subscriber.error(this.thrownError);
|
25755 | return _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"].EMPTY;
|
25756 | }
|
25757 | else if (this.hasCompleted && this.hasNext) {
|
25758 | subscriber.next(this.value);
|
25759 | subscriber.complete();
|
25760 | return _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"].EMPTY;
|
25761 | }
|
25762 | return _super.prototype._subscribe.call(this, subscriber);
|
25763 | };
|
25764 | AsyncSubject.prototype.next = function (value) {
|
25765 | if (!this.hasCompleted) {
|
25766 | this.value = value;
|
25767 | this.hasNext = true;
|
25768 | }
|
25769 | };
|
25770 | AsyncSubject.prototype.error = function (error) {
|
25771 | if (!this.hasCompleted) {
|
25772 | _super.prototype.error.call(this, error);
|
25773 | }
|
25774 | };
|
25775 | AsyncSubject.prototype.complete = function () {
|
25776 | this.hasCompleted = true;
|
25777 | if (this.hasNext) {
|
25778 | _super.prototype.next.call(this, this.value);
|
25779 | }
|
25780 | _super.prototype.complete.call(this);
|
25781 | };
|
25782 | return AsyncSubject;
|
25783 | }(_Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]));
|
25784 |
|
25785 |
|
25786 |
|
25787 |
|
25788 | }),
|
25789 |
|
25790 | (function(module, __webpack_exports__, __webpack_require__) {
|
25791 |
|
25792 | "use strict";
|
25793 | __webpack_require__.r(__webpack_exports__);
|
25794 | __webpack_require__.d(__webpack_exports__, "asap", function() { return asap; });
|
25795 | var _AsapAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(210);
|
25796 | var _AsapScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(212);
|
25797 |
|
25798 |
|
25799 |
|
25800 | var asap = new _AsapScheduler__WEBPACK_IMPORTED_MODULE_1__["AsapScheduler"](_AsapAction__WEBPACK_IMPORTED_MODULE_0__["AsapAction"]);
|
25801 |
|
25802 |
|
25803 |
|
25804 | }),
|
25805 |
|
25806 | (function(module, __webpack_exports__, __webpack_require__) {
|
25807 |
|
25808 | "use strict";
|
25809 | __webpack_require__.r(__webpack_exports__);
|
25810 | __webpack_require__.d(__webpack_exports__, "AsapAction", function() { return AsapAction; });
|
25811 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
25812 | var _util_Immediate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(211);
|
25813 | var _AsyncAction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(194);
|
25814 |
|
25815 |
|
25816 |
|
25817 |
|
25818 | var AsapAction = (function (_super) {
|
25819 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AsapAction, _super);
|
25820 | function AsapAction(scheduler, work) {
|
25821 | var _this = _super.call(this, scheduler, work) || this;
|
25822 | _this.scheduler = scheduler;
|
25823 | _this.work = work;
|
25824 | return _this;
|
25825 | }
|
25826 | AsapAction.prototype.requestAsyncId = function (scheduler, id, delay) {
|
25827 | if (delay === void 0) {
|
25828 | delay = 0;
|
25829 | }
|
25830 | if (delay !== null && delay > 0) {
|
25831 | return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
|
25832 | }
|
25833 | scheduler.actions.push(this);
|
25834 | return scheduler.scheduled || (scheduler.scheduled = _util_Immediate__WEBPACK_IMPORTED_MODULE_1__["Immediate"].setImmediate(scheduler.flush.bind(scheduler, null)));
|
25835 | };
|
25836 | AsapAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
|
25837 | if (delay === void 0) {
|
25838 | delay = 0;
|
25839 | }
|
25840 | if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {
|
25841 | return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
|
25842 | }
|
25843 | if (scheduler.actions.length === 0) {
|
25844 | _util_Immediate__WEBPACK_IMPORTED_MODULE_1__["Immediate"].clearImmediate(id);
|
25845 | scheduler.scheduled = undefined;
|
25846 | }
|
25847 | return undefined;
|
25848 | };
|
25849 | return AsapAction;
|
25850 | }(_AsyncAction__WEBPACK_IMPORTED_MODULE_2__["AsyncAction"]));
|
25851 |
|
25852 |
|
25853 |
|
25854 |
|
25855 | }),
|
25856 |
|
25857 | (function(module, __webpack_exports__, __webpack_require__) {
|
25858 |
|
25859 | "use strict";
|
25860 | __webpack_require__.r(__webpack_exports__);
|
25861 | __webpack_require__.d(__webpack_exports__, "Immediate", function() { return Immediate; });
|
25862 | __webpack_require__.d(__webpack_exports__, "TestTools", function() { return TestTools; });
|
25863 |
|
25864 | var nextHandle = 1;
|
25865 | var RESOLVED = (function () { return Promise.resolve(); })();
|
25866 | var activeHandles = {};
|
25867 | function findAndClearHandle(handle) {
|
25868 | if (handle in activeHandles) {
|
25869 | delete activeHandles[handle];
|
25870 | return true;
|
25871 | }
|
25872 | return false;
|
25873 | }
|
25874 | var Immediate = {
|
25875 | setImmediate: function (cb) {
|
25876 | var handle = nextHandle++;
|
25877 | activeHandles[handle] = true;
|
25878 | RESOLVED.then(function () { return findAndClearHandle(handle) && cb(); });
|
25879 | return handle;
|
25880 | },
|
25881 | clearImmediate: function (handle) {
|
25882 | findAndClearHandle(handle);
|
25883 | },
|
25884 | };
|
25885 | var TestTools = {
|
25886 | pending: function () {
|
25887 | return Object.keys(activeHandles).length;
|
25888 | }
|
25889 | };
|
25890 |
|
25891 |
|
25892 |
|
25893 | }),
|
25894 |
|
25895 | (function(module, __webpack_exports__, __webpack_require__) {
|
25896 |
|
25897 | "use strict";
|
25898 | __webpack_require__.r(__webpack_exports__);
|
25899 | __webpack_require__.d(__webpack_exports__, "AsapScheduler", function() { return AsapScheduler; });
|
25900 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
25901 | var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(197);
|
25902 |
|
25903 |
|
25904 |
|
25905 | var AsapScheduler = (function (_super) {
|
25906 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AsapScheduler, _super);
|
25907 | function AsapScheduler() {
|
25908 | return _super !== null && _super.apply(this, arguments) || this;
|
25909 | }
|
25910 | AsapScheduler.prototype.flush = function (action) {
|
25911 | this.active = true;
|
25912 | this.scheduled = undefined;
|
25913 | var actions = this.actions;
|
25914 | var error;
|
25915 | var index = -1;
|
25916 | var count = actions.length;
|
25917 | action = action || actions.shift();
|
25918 | do {
|
25919 | if (error = action.execute(action.state, action.delay)) {
|
25920 | break;
|
25921 | }
|
25922 | } while (++index < count && (action = actions.shift()));
|
25923 | this.active = false;
|
25924 | if (error) {
|
25925 | while (++index < count && (action = actions.shift())) {
|
25926 | action.unsubscribe();
|
25927 | }
|
25928 | throw error;
|
25929 | }
|
25930 | };
|
25931 | return AsapScheduler;
|
25932 | }(_AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__["AsyncScheduler"]));
|
25933 |
|
25934 |
|
25935 |
|
25936 |
|
25937 | }),
|
25938 |
|
25939 | (function(module, __webpack_exports__, __webpack_require__) {
|
25940 |
|
25941 | "use strict";
|
25942 | __webpack_require__.r(__webpack_exports__);
|
25943 | __webpack_require__.d(__webpack_exports__, "async", function() { return async; });
|
25944 | var _AsyncAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(194);
|
25945 | var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(197);
|
25946 |
|
25947 |
|
25948 |
|
25949 | var async = new _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__["AsyncScheduler"](_AsyncAction__WEBPACK_IMPORTED_MODULE_0__["AsyncAction"]);
|
25950 |
|
25951 |
|
25952 |
|
25953 | }),
|
25954 |
|
25955 | (function(module, __webpack_exports__, __webpack_require__) {
|
25956 |
|
25957 | "use strict";
|
25958 | __webpack_require__.r(__webpack_exports__);
|
25959 | __webpack_require__.d(__webpack_exports__, "animationFrame", function() { return animationFrame; });
|
25960 | var _AnimationFrameAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(215);
|
25961 | var _AnimationFrameScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(216);
|
25962 |
|
25963 |
|
25964 |
|
25965 | var animationFrame = new _AnimationFrameScheduler__WEBPACK_IMPORTED_MODULE_1__["AnimationFrameScheduler"](_AnimationFrameAction__WEBPACK_IMPORTED_MODULE_0__["AnimationFrameAction"]);
|
25966 |
|
25967 |
|
25968 |
|
25969 | }),
|
25970 |
|
25971 | (function(module, __webpack_exports__, __webpack_require__) {
|
25972 |
|
25973 | "use strict";
|
25974 | __webpack_require__.r(__webpack_exports__);
|
25975 | __webpack_require__.d(__webpack_exports__, "AnimationFrameAction", function() { return AnimationFrameAction; });
|
25976 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
25977 | var _AsyncAction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(194);
|
25978 |
|
25979 |
|
25980 |
|
25981 | var AnimationFrameAction = (function (_super) {
|
25982 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AnimationFrameAction, _super);
|
25983 | function AnimationFrameAction(scheduler, work) {
|
25984 | var _this = _super.call(this, scheduler, work) || this;
|
25985 | _this.scheduler = scheduler;
|
25986 | _this.work = work;
|
25987 | return _this;
|
25988 | }
|
25989 | AnimationFrameAction.prototype.requestAsyncId = function (scheduler, id, delay) {
|
25990 | if (delay === void 0) {
|
25991 | delay = 0;
|
25992 | }
|
25993 | if (delay !== null && delay > 0) {
|
25994 | return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
|
25995 | }
|
25996 | scheduler.actions.push(this);
|
25997 | return scheduler.scheduled || (scheduler.scheduled = requestAnimationFrame(function () { return scheduler.flush(null); }));
|
25998 | };
|
25999 | AnimationFrameAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
|
26000 | if (delay === void 0) {
|
26001 | delay = 0;
|
26002 | }
|
26003 | if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {
|
26004 | return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
|
26005 | }
|
26006 | if (scheduler.actions.length === 0) {
|
26007 | cancelAnimationFrame(id);
|
26008 | scheduler.scheduled = undefined;
|
26009 | }
|
26010 | return undefined;
|
26011 | };
|
26012 | return AnimationFrameAction;
|
26013 | }(_AsyncAction__WEBPACK_IMPORTED_MODULE_1__["AsyncAction"]));
|
26014 |
|
26015 |
|
26016 |
|
26017 |
|
26018 | }),
|
26019 |
|
26020 | (function(module, __webpack_exports__, __webpack_require__) {
|
26021 |
|
26022 | "use strict";
|
26023 | __webpack_require__.r(__webpack_exports__);
|
26024 | __webpack_require__.d(__webpack_exports__, "AnimationFrameScheduler", function() { return AnimationFrameScheduler; });
|
26025 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
26026 | var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(197);
|
26027 |
|
26028 |
|
26029 |
|
26030 | var AnimationFrameScheduler = (function (_super) {
|
26031 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AnimationFrameScheduler, _super);
|
26032 | function AnimationFrameScheduler() {
|
26033 | return _super !== null && _super.apply(this, arguments) || this;
|
26034 | }
|
26035 | AnimationFrameScheduler.prototype.flush = function (action) {
|
26036 | this.active = true;
|
26037 | this.scheduled = undefined;
|
26038 | var actions = this.actions;
|
26039 | var error;
|
26040 | var index = -1;
|
26041 | var count = actions.length;
|
26042 | action = action || actions.shift();
|
26043 | do {
|
26044 | if (error = action.execute(action.state, action.delay)) {
|
26045 | break;
|
26046 | }
|
26047 | } while (++index < count && (action = actions.shift()));
|
26048 | this.active = false;
|
26049 | if (error) {
|
26050 | while (++index < count && (action = actions.shift())) {
|
26051 | action.unsubscribe();
|
26052 | }
|
26053 | throw error;
|
26054 | }
|
26055 | };
|
26056 | return AnimationFrameScheduler;
|
26057 | }(_AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__["AsyncScheduler"]));
|
26058 |
|
26059 |
|
26060 |
|
26061 |
|
26062 | }),
|
26063 |
|
26064 | (function(module, __webpack_exports__, __webpack_require__) {
|
26065 |
|
26066 | "use strict";
|
26067 | __webpack_require__.r(__webpack_exports__);
|
26068 | __webpack_require__.d(__webpack_exports__, "VirtualTimeScheduler", function() { return VirtualTimeScheduler; });
|
26069 | __webpack_require__.d(__webpack_exports__, "VirtualAction", function() { return VirtualAction; });
|
26070 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
26071 | var _AsyncAction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(194);
|
26072 | var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(197);
|
26073 |
|
26074 |
|
26075 |
|
26076 |
|
26077 | var VirtualTimeScheduler = (function (_super) {
|
26078 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](VirtualTimeScheduler, _super);
|
26079 | function VirtualTimeScheduler(SchedulerAction, maxFrames) {
|
26080 | if (SchedulerAction === void 0) {
|
26081 | SchedulerAction = VirtualAction;
|
26082 | }
|
26083 | if (maxFrames === void 0) {
|
26084 | maxFrames = Number.POSITIVE_INFINITY;
|
26085 | }
|
26086 | var _this = _super.call(this, SchedulerAction, function () { return _this.frame; }) || this;
|
26087 | _this.maxFrames = maxFrames;
|
26088 | _this.frame = 0;
|
26089 | _this.index = -1;
|
26090 | return _this;
|
26091 | }
|
26092 | VirtualTimeScheduler.prototype.flush = function () {
|
26093 | var _a = this, actions = _a.actions, maxFrames = _a.maxFrames;
|
26094 | var error, action;
|
26095 | while ((action = actions[0]) && action.delay <= maxFrames) {
|
26096 | actions.shift();
|
26097 | this.frame = action.delay;
|
26098 | if (error = action.execute(action.state, action.delay)) {
|
26099 | break;
|
26100 | }
|
26101 | }
|
26102 | if (error) {
|
26103 | while (action = actions.shift()) {
|
26104 | action.unsubscribe();
|
26105 | }
|
26106 | throw error;
|
26107 | }
|
26108 | };
|
26109 | VirtualTimeScheduler.frameTimeFactor = 10;
|
26110 | return VirtualTimeScheduler;
|
26111 | }(_AsyncScheduler__WEBPACK_IMPORTED_MODULE_2__["AsyncScheduler"]));
|
26112 |
|
26113 | var VirtualAction = (function (_super) {
|
26114 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](VirtualAction, _super);
|
26115 | function VirtualAction(scheduler, work, index) {
|
26116 | if (index === void 0) {
|
26117 | index = scheduler.index += 1;
|
26118 | }
|
26119 | var _this = _super.call(this, scheduler, work) || this;
|
26120 | _this.scheduler = scheduler;
|
26121 | _this.work = work;
|
26122 | _this.index = index;
|
26123 | _this.active = true;
|
26124 | _this.index = scheduler.index = index;
|
26125 | return _this;
|
26126 | }
|
26127 | VirtualAction.prototype.schedule = function (state, delay) {
|
26128 | if (delay === void 0) {
|
26129 | delay = 0;
|
26130 | }
|
26131 | if (!this.id) {
|
26132 | return _super.prototype.schedule.call(this, state, delay);
|
26133 | }
|
26134 | this.active = false;
|
26135 | var action = new VirtualAction(this.scheduler, this.work);
|
26136 | this.add(action);
|
26137 | return action.schedule(state, delay);
|
26138 | };
|
26139 | VirtualAction.prototype.requestAsyncId = function (scheduler, id, delay) {
|
26140 | if (delay === void 0) {
|
26141 | delay = 0;
|
26142 | }
|
26143 | this.delay = scheduler.frame + delay;
|
26144 | var actions = scheduler.actions;
|
26145 | actions.push(this);
|
26146 | actions.sort(VirtualAction.sortActions);
|
26147 | return true;
|
26148 | };
|
26149 | VirtualAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
|
26150 | if (delay === void 0) {
|
26151 | delay = 0;
|
26152 | }
|
26153 | return undefined;
|
26154 | };
|
26155 | VirtualAction.prototype._execute = function (state, delay) {
|
26156 | if (this.active === true) {
|
26157 | return _super.prototype._execute.call(this, state, delay);
|
26158 | }
|
26159 | };
|
26160 | VirtualAction.sortActions = function (a, b) {
|
26161 | if (a.delay === b.delay) {
|
26162 | if (a.index === b.index) {
|
26163 | return 0;
|
26164 | }
|
26165 | else if (a.index > b.index) {
|
26166 | return 1;
|
26167 | }
|
26168 | else {
|
26169 | return -1;
|
26170 | }
|
26171 | }
|
26172 | else if (a.delay > b.delay) {
|
26173 | return 1;
|
26174 | }
|
26175 | else {
|
26176 | return -1;
|
26177 | }
|
26178 | };
|
26179 | return VirtualAction;
|
26180 | }(_AsyncAction__WEBPACK_IMPORTED_MODULE_1__["AsyncAction"]));
|
26181 |
|
26182 |
|
26183 |
|
26184 |
|
26185 | }),
|
26186 |
|
26187 | (function(module, __webpack_exports__, __webpack_require__) {
|
26188 |
|
26189 | "use strict";
|
26190 | __webpack_require__.r(__webpack_exports__);
|
26191 | __webpack_require__.d(__webpack_exports__, "noop", function() { return noop; });
|
26192 |
|
26193 | function noop() { }
|
26194 |
|
26195 |
|
26196 |
|
26197 | }),
|
26198 |
|
26199 | (function(module, __webpack_exports__, __webpack_require__) {
|
26200 |
|
26201 | "use strict";
|
26202 | __webpack_require__.r(__webpack_exports__);
|
26203 | __webpack_require__.d(__webpack_exports__, "isObservable", function() { return isObservable; });
|
26204 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(167);
|
26205 |
|
26206 |
|
26207 | function isObservable(obj) {
|
26208 | return !!obj && (obj instanceof _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"] || (typeof obj.lift === 'function' && typeof obj.subscribe === 'function'));
|
26209 | }
|
26210 |
|
26211 |
|
26212 |
|
26213 | }),
|
26214 |
|
26215 | (function(module, __webpack_exports__, __webpack_require__) {
|
26216 |
|
26217 | "use strict";
|
26218 | __webpack_require__.r(__webpack_exports__);
|
26219 | __webpack_require__.d(__webpack_exports__, "ArgumentOutOfRangeError", function() { return ArgumentOutOfRangeError; });
|
26220 |
|
26221 | var ArgumentOutOfRangeErrorImpl = (function () {
|
26222 | function ArgumentOutOfRangeErrorImpl() {
|
26223 | Error.call(this);
|
26224 | this.message = 'argument out of range';
|
26225 | this.name = 'ArgumentOutOfRangeError';
|
26226 | return this;
|
26227 | }
|
26228 | ArgumentOutOfRangeErrorImpl.prototype = Object.create(Error.prototype);
|
26229 | return ArgumentOutOfRangeErrorImpl;
|
26230 | })();
|
26231 | var ArgumentOutOfRangeError = ArgumentOutOfRangeErrorImpl;
|
26232 |
|
26233 |
|
26234 |
|
26235 | }),
|
26236 |
|
26237 | (function(module, __webpack_exports__, __webpack_require__) {
|
26238 |
|
26239 | "use strict";
|
26240 | __webpack_require__.r(__webpack_exports__);
|
26241 | __webpack_require__.d(__webpack_exports__, "EmptyError", function() { return EmptyError; });
|
26242 |
|
26243 | var EmptyErrorImpl = (function () {
|
26244 | function EmptyErrorImpl() {
|
26245 | Error.call(this);
|
26246 | this.message = 'no elements in sequence';
|
26247 | this.name = 'EmptyError';
|
26248 | return this;
|
26249 | }
|
26250 | EmptyErrorImpl.prototype = Object.create(Error.prototype);
|
26251 | return EmptyErrorImpl;
|
26252 | })();
|
26253 | var EmptyError = EmptyErrorImpl;
|
26254 |
|
26255 |
|
26256 |
|
26257 | }),
|
26258 |
|
26259 | (function(module, __webpack_exports__, __webpack_require__) {
|
26260 |
|
26261 | "use strict";
|
26262 | __webpack_require__.r(__webpack_exports__);
|
26263 | __webpack_require__.d(__webpack_exports__, "TimeoutError", function() { return TimeoutError; });
|
26264 |
|
26265 | var TimeoutErrorImpl = (function () {
|
26266 | function TimeoutErrorImpl() {
|
26267 | Error.call(this);
|
26268 | this.message = 'Timeout has occurred';
|
26269 | this.name = 'TimeoutError';
|
26270 | return this;
|
26271 | }
|
26272 | TimeoutErrorImpl.prototype = Object.create(Error.prototype);
|
26273 | return TimeoutErrorImpl;
|
26274 | })();
|
26275 | var TimeoutError = TimeoutErrorImpl;
|
26276 |
|
26277 |
|
26278 |
|
26279 | }),
|
26280 |
|
26281 | (function(module, __webpack_exports__, __webpack_require__) {
|
26282 |
|
26283 | "use strict";
|
26284 | __webpack_require__.r(__webpack_exports__);
|
26285 | __webpack_require__.d(__webpack_exports__, "bindCallback", function() { return bindCallback; });
|
26286 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(167);
|
26287 | var _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(208);
|
26288 | var _operators_map__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(224);
|
26289 | var _util_canReportError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(168);
|
26290 | var _util_isArray__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(176);
|
26291 | var _util_isScheduler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(203);
|
26292 |
|
26293 |
|
26294 |
|
26295 |
|
26296 |
|
26297 |
|
26298 |
|
26299 | function bindCallback(callbackFunc, resultSelector, scheduler) {
|
26300 | if (resultSelector) {
|
26301 | if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_5__["isScheduler"])(resultSelector)) {
|
26302 | scheduler = resultSelector;
|
26303 | }
|
26304 | else {
|
26305 | return function () {
|
26306 | var args = [];
|
26307 | for (var _i = 0; _i < arguments.length; _i++) {
|
26308 | args[_i] = arguments[_i];
|
26309 | }
|
26310 | return bindCallback(callbackFunc, scheduler).apply(void 0, args).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_2__["map"])(function (args) { return Object(_util_isArray__WEBPACK_IMPORTED_MODULE_4__["isArray"])(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));
|
26311 | };
|
26312 | }
|
26313 | }
|
26314 | return function () {
|
26315 | var args = [];
|
26316 | for (var _i = 0; _i < arguments.length; _i++) {
|
26317 | args[_i] = arguments[_i];
|
26318 | }
|
26319 | var context = this;
|
26320 | var subject;
|
26321 | var params = {
|
26322 | context: context,
|
26323 | subject: subject,
|
26324 | callbackFunc: callbackFunc,
|
26325 | scheduler: scheduler,
|
26326 | };
|
26327 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
26328 | if (!scheduler) {
|
26329 | if (!subject) {
|
26330 | subject = new _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__["AsyncSubject"]();
|
26331 | var handler = function () {
|
26332 | var innerArgs = [];
|
26333 | for (var _i = 0; _i < arguments.length; _i++) {
|
26334 | innerArgs[_i] = arguments[_i];
|
26335 | }
|
26336 | subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs);
|
26337 | subject.complete();
|
26338 | };
|
26339 | try {
|
26340 | callbackFunc.apply(context, args.concat([handler]));
|
26341 | }
|
26342 | catch (err) {
|
26343 | if (Object(_util_canReportError__WEBPACK_IMPORTED_MODULE_3__["canReportError"])(subject)) {
|
26344 | subject.error(err);
|
26345 | }
|
26346 | else {
|
26347 | console.warn(err);
|
26348 | }
|
26349 | }
|
26350 | }
|
26351 | return subject.subscribe(subscriber);
|
26352 | }
|
26353 | else {
|
26354 | var state = {
|
26355 | args: args, subscriber: subscriber, params: params,
|
26356 | };
|
26357 | return scheduler.schedule(dispatch, 0, state);
|
26358 | }
|
26359 | });
|
26360 | };
|
26361 | }
|
26362 | function dispatch(state) {
|
26363 | var _this = this;
|
26364 | var self = this;
|
26365 | var args = state.args, subscriber = state.subscriber, params = state.params;
|
26366 | var callbackFunc = params.callbackFunc, context = params.context, scheduler = params.scheduler;
|
26367 | var subject = params.subject;
|
26368 | if (!subject) {
|
26369 | subject = params.subject = new _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__["AsyncSubject"]();
|
26370 | var handler = function () {
|
26371 | var innerArgs = [];
|
26372 | for (var _i = 0; _i < arguments.length; _i++) {
|
26373 | innerArgs[_i] = arguments[_i];
|
26374 | }
|
26375 | var value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs;
|
26376 | _this.add(scheduler.schedule(dispatchNext, 0, { value: value, subject: subject }));
|
26377 | };
|
26378 | try {
|
26379 | callbackFunc.apply(context, args.concat([handler]));
|
26380 | }
|
26381 | catch (err) {
|
26382 | subject.error(err);
|
26383 | }
|
26384 | }
|
26385 | this.add(subject.subscribe(subscriber));
|
26386 | }
|
26387 | function dispatchNext(state) {
|
26388 | var value = state.value, subject = state.subject;
|
26389 | subject.next(value);
|
26390 | subject.complete();
|
26391 | }
|
26392 | function dispatchError(state) {
|
26393 | var err = state.err, subject = state.subject;
|
26394 | subject.error(err);
|
26395 | }
|
26396 |
|
26397 |
|
26398 |
|
26399 | }),
|
26400 |
|
26401 | (function(module, __webpack_exports__, __webpack_require__) {
|
26402 |
|
26403 | "use strict";
|
26404 | __webpack_require__.r(__webpack_exports__);
|
26405 | __webpack_require__.d(__webpack_exports__, "map", function() { return map; });
|
26406 | __webpack_require__.d(__webpack_exports__, "MapOperator", function() { return MapOperator; });
|
26407 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
26408 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
26409 |
|
26410 |
|
26411 |
|
26412 | function map(project, thisArg) {
|
26413 | return function mapOperation(source) {
|
26414 | if (typeof project !== 'function') {
|
26415 | throw new TypeError('argument is not a function. Are you looking for `mapTo()`?');
|
26416 | }
|
26417 | return source.lift(new MapOperator(project, thisArg));
|
26418 | };
|
26419 | }
|
26420 | var MapOperator = (function () {
|
26421 | function MapOperator(project, thisArg) {
|
26422 | this.project = project;
|
26423 | this.thisArg = thisArg;
|
26424 | }
|
26425 | MapOperator.prototype.call = function (subscriber, source) {
|
26426 | return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg));
|
26427 | };
|
26428 | return MapOperator;
|
26429 | }());
|
26430 |
|
26431 | var MapSubscriber = (function (_super) {
|
26432 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](MapSubscriber, _super);
|
26433 | function MapSubscriber(destination, project, thisArg) {
|
26434 | var _this = _super.call(this, destination) || this;
|
26435 | _this.project = project;
|
26436 | _this.count = 0;
|
26437 | _this.thisArg = thisArg || _this;
|
26438 | return _this;
|
26439 | }
|
26440 | MapSubscriber.prototype._next = function (value) {
|
26441 | var result;
|
26442 | try {
|
26443 | result = this.project.call(this.thisArg, value, this.count++);
|
26444 | }
|
26445 | catch (err) {
|
26446 | this.destination.error(err);
|
26447 | return;
|
26448 | }
|
26449 | this.destination.next(result);
|
26450 | };
|
26451 | return MapSubscriber;
|
26452 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
26453 |
|
26454 |
|
26455 |
|
26456 | }),
|
26457 |
|
26458 | (function(module, __webpack_exports__, __webpack_require__) {
|
26459 |
|
26460 | "use strict";
|
26461 | __webpack_require__.r(__webpack_exports__);
|
26462 | __webpack_require__.d(__webpack_exports__, "bindNodeCallback", function() { return bindNodeCallback; });
|
26463 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(167);
|
26464 | var _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(208);
|
26465 | var _operators_map__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(224);
|
26466 | var _util_canReportError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(168);
|
26467 | var _util_isScheduler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(203);
|
26468 | var _util_isArray__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(176);
|
26469 |
|
26470 |
|
26471 |
|
26472 |
|
26473 |
|
26474 |
|
26475 |
|
26476 | function bindNodeCallback(callbackFunc, resultSelector, scheduler) {
|
26477 | if (resultSelector) {
|
26478 | if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_4__["isScheduler"])(resultSelector)) {
|
26479 | scheduler = resultSelector;
|
26480 | }
|
26481 | else {
|
26482 | return function () {
|
26483 | var args = [];
|
26484 | for (var _i = 0; _i < arguments.length; _i++) {
|
26485 | args[_i] = arguments[_i];
|
26486 | }
|
26487 | return bindNodeCallback(callbackFunc, scheduler).apply(void 0, args).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_2__["map"])(function (args) { return Object(_util_isArray__WEBPACK_IMPORTED_MODULE_5__["isArray"])(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));
|
26488 | };
|
26489 | }
|
26490 | }
|
26491 | return function () {
|
26492 | var args = [];
|
26493 | for (var _i = 0; _i < arguments.length; _i++) {
|
26494 | args[_i] = arguments[_i];
|
26495 | }
|
26496 | var params = {
|
26497 | subject: undefined,
|
26498 | args: args,
|
26499 | callbackFunc: callbackFunc,
|
26500 | scheduler: scheduler,
|
26501 | context: this,
|
26502 | };
|
26503 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
26504 | var context = params.context;
|
26505 | var subject = params.subject;
|
26506 | if (!scheduler) {
|
26507 | if (!subject) {
|
26508 | subject = params.subject = new _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__["AsyncSubject"]();
|
26509 | var handler = function () {
|
26510 | var innerArgs = [];
|
26511 | for (var _i = 0; _i < arguments.length; _i++) {
|
26512 | innerArgs[_i] = arguments[_i];
|
26513 | }
|
26514 | var err = innerArgs.shift();
|
26515 | if (err) {
|
26516 | subject.error(err);
|
26517 | return;
|
26518 | }
|
26519 | subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs);
|
26520 | subject.complete();
|
26521 | };
|
26522 | try {
|
26523 | callbackFunc.apply(context, args.concat([handler]));
|
26524 | }
|
26525 | catch (err) {
|
26526 | if (Object(_util_canReportError__WEBPACK_IMPORTED_MODULE_3__["canReportError"])(subject)) {
|
26527 | subject.error(err);
|
26528 | }
|
26529 | else {
|
26530 | console.warn(err);
|
26531 | }
|
26532 | }
|
26533 | }
|
26534 | return subject.subscribe(subscriber);
|
26535 | }
|
26536 | else {
|
26537 | return scheduler.schedule(dispatch, 0, { params: params, subscriber: subscriber, context: context });
|
26538 | }
|
26539 | });
|
26540 | };
|
26541 | }
|
26542 | function dispatch(state) {
|
26543 | var _this = this;
|
26544 | var params = state.params, subscriber = state.subscriber, context = state.context;
|
26545 | var callbackFunc = params.callbackFunc, args = params.args, scheduler = params.scheduler;
|
26546 | var subject = params.subject;
|
26547 | if (!subject) {
|
26548 | subject = params.subject = new _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__["AsyncSubject"]();
|
26549 | var handler = function () {
|
26550 | var innerArgs = [];
|
26551 | for (var _i = 0; _i < arguments.length; _i++) {
|
26552 | innerArgs[_i] = arguments[_i];
|
26553 | }
|
26554 | var err = innerArgs.shift();
|
26555 | if (err) {
|
26556 | _this.add(scheduler.schedule(dispatchError, 0, { err: err, subject: subject }));
|
26557 | }
|
26558 | else {
|
26559 | var value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs;
|
26560 | _this.add(scheduler.schedule(dispatchNext, 0, { value: value, subject: subject }));
|
26561 | }
|
26562 | };
|
26563 | try {
|
26564 | callbackFunc.apply(context, args.concat([handler]));
|
26565 | }
|
26566 | catch (err) {
|
26567 | this.add(scheduler.schedule(dispatchError, 0, { err: err, subject: subject }));
|
26568 | }
|
26569 | }
|
26570 | this.add(subject.subscribe(subscriber));
|
26571 | }
|
26572 | function dispatchNext(arg) {
|
26573 | var value = arg.value, subject = arg.subject;
|
26574 | subject.next(value);
|
26575 | subject.complete();
|
26576 | }
|
26577 | function dispatchError(arg) {
|
26578 | var err = arg.err, subject = arg.subject;
|
26579 | subject.error(err);
|
26580 | }
|
26581 |
|
26582 |
|
26583 |
|
26584 | }),
|
26585 |
|
26586 | (function(module, __webpack_exports__, __webpack_require__) {
|
26587 |
|
26588 | "use strict";
|
26589 | __webpack_require__.r(__webpack_exports__);
|
26590 | __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return combineLatest; });
|
26591 | __webpack_require__.d(__webpack_exports__, "CombineLatestOperator", function() { return CombineLatestOperator; });
|
26592 | __webpack_require__.d(__webpack_exports__, "CombineLatestSubscriber", function() { return CombineLatestSubscriber; });
|
26593 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
26594 | var _util_isScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(203);
|
26595 | var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(176);
|
26596 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(227);
|
26597 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(228);
|
26598 | var _fromArray__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(204);
|
26599 |
|
26600 |
|
26601 |
|
26602 |
|
26603 |
|
26604 |
|
26605 |
|
26606 | var NONE = {};
|
26607 | function combineLatest() {
|
26608 | var observables = [];
|
26609 | for (var _i = 0; _i < arguments.length; _i++) {
|
26610 | observables[_i] = arguments[_i];
|
26611 | }
|
26612 | var resultSelector = null;
|
26613 | var scheduler = null;
|
26614 | if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_1__["isScheduler"])(observables[observables.length - 1])) {
|
26615 | scheduler = observables.pop();
|
26616 | }
|
26617 | if (typeof observables[observables.length - 1] === 'function') {
|
26618 | resultSelector = observables.pop();
|
26619 | }
|
26620 | if (observables.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_2__["isArray"])(observables[0])) {
|
26621 | observables = observables[0];
|
26622 | }
|
26623 | return Object(_fromArray__WEBPACK_IMPORTED_MODULE_5__["fromArray"])(observables, scheduler).lift(new CombineLatestOperator(resultSelector));
|
26624 | }
|
26625 | var CombineLatestOperator = (function () {
|
26626 | function CombineLatestOperator(resultSelector) {
|
26627 | this.resultSelector = resultSelector;
|
26628 | }
|
26629 | CombineLatestOperator.prototype.call = function (subscriber, source) {
|
26630 | return source.subscribe(new CombineLatestSubscriber(subscriber, this.resultSelector));
|
26631 | };
|
26632 | return CombineLatestOperator;
|
26633 | }());
|
26634 |
|
26635 | var CombineLatestSubscriber = (function (_super) {
|
26636 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](CombineLatestSubscriber, _super);
|
26637 | function CombineLatestSubscriber(destination, resultSelector) {
|
26638 | var _this = _super.call(this, destination) || this;
|
26639 | _this.resultSelector = resultSelector;
|
26640 | _this.active = 0;
|
26641 | _this.values = [];
|
26642 | _this.observables = [];
|
26643 | return _this;
|
26644 | }
|
26645 | CombineLatestSubscriber.prototype._next = function (observable) {
|
26646 | this.values.push(NONE);
|
26647 | this.observables.push(observable);
|
26648 | };
|
26649 | CombineLatestSubscriber.prototype._complete = function () {
|
26650 | var observables = this.observables;
|
26651 | var len = observables.length;
|
26652 | if (len === 0) {
|
26653 | this.destination.complete();
|
26654 | }
|
26655 | else {
|
26656 | this.active = len;
|
26657 | this.toRespond = len;
|
26658 | for (var i = 0; i < len; i++) {
|
26659 | var observable = observables[i];
|
26660 | this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(this, observable, observable, i));
|
26661 | }
|
26662 | }
|
26663 | };
|
26664 | CombineLatestSubscriber.prototype.notifyComplete = function (unused) {
|
26665 | if ((this.active -= 1) === 0) {
|
26666 | this.destination.complete();
|
26667 | }
|
26668 | };
|
26669 | CombineLatestSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
26670 | var values = this.values;
|
26671 | var oldVal = values[outerIndex];
|
26672 | var toRespond = !this.toRespond
|
26673 | ? 0
|
26674 | : oldVal === NONE ? --this.toRespond : this.toRespond;
|
26675 | values[outerIndex] = innerValue;
|
26676 | if (toRespond === 0) {
|
26677 | if (this.resultSelector) {
|
26678 | this._tryResultSelector(values);
|
26679 | }
|
26680 | else {
|
26681 | this.destination.next(values.slice());
|
26682 | }
|
26683 | }
|
26684 | };
|
26685 | CombineLatestSubscriber.prototype._tryResultSelector = function (values) {
|
26686 | var result;
|
26687 | try {
|
26688 | result = this.resultSelector.apply(this, values);
|
26689 | }
|
26690 | catch (err) {
|
26691 | this.destination.error(err);
|
26692 | return;
|
26693 | }
|
26694 | this.destination.next(result);
|
26695 | };
|
26696 | return CombineLatestSubscriber;
|
26697 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"]));
|
26698 |
|
26699 |
|
26700 |
|
26701 |
|
26702 | }),
|
26703 |
|
26704 | (function(module, __webpack_exports__, __webpack_require__) {
|
26705 |
|
26706 | "use strict";
|
26707 | __webpack_require__.r(__webpack_exports__);
|
26708 | __webpack_require__.d(__webpack_exports__, "OuterSubscriber", function() { return OuterSubscriber; });
|
26709 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
26710 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
26711 |
|
26712 |
|
26713 |
|
26714 | var OuterSubscriber = (function (_super) {
|
26715 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](OuterSubscriber, _super);
|
26716 | function OuterSubscriber() {
|
26717 | return _super !== null && _super.apply(this, arguments) || this;
|
26718 | }
|
26719 | OuterSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
26720 | this.destination.next(innerValue);
|
26721 | };
|
26722 | OuterSubscriber.prototype.notifyError = function (error, innerSub) {
|
26723 | this.destination.error(error);
|
26724 | };
|
26725 | OuterSubscriber.prototype.notifyComplete = function (innerSub) {
|
26726 | this.destination.complete();
|
26727 | };
|
26728 | return OuterSubscriber;
|
26729 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
26730 |
|
26731 |
|
26732 |
|
26733 |
|
26734 | }),
|
26735 |
|
26736 | (function(module, __webpack_exports__, __webpack_require__) {
|
26737 |
|
26738 | "use strict";
|
26739 | __webpack_require__.r(__webpack_exports__);
|
26740 | __webpack_require__.d(__webpack_exports__, "subscribeToResult", function() { return subscribeToResult; });
|
26741 | var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(229);
|
26742 | var _subscribeTo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(230);
|
26743 | var _Observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(167);
|
26744 |
|
26745 |
|
26746 |
|
26747 |
|
26748 | function subscribeToResult(outerSubscriber, result, outerValue, outerIndex, innerSubscriber) {
|
26749 | if (innerSubscriber === void 0) {
|
26750 | innerSubscriber = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_0__["InnerSubscriber"](outerSubscriber, outerValue, outerIndex);
|
26751 | }
|
26752 | if (innerSubscriber.closed) {
|
26753 | return undefined;
|
26754 | }
|
26755 | if (result instanceof _Observable__WEBPACK_IMPORTED_MODULE_2__["Observable"]) {
|
26756 | return result.subscribe(innerSubscriber);
|
26757 | }
|
26758 | return Object(_subscribeTo__WEBPACK_IMPORTED_MODULE_1__["subscribeTo"])(result)(innerSubscriber);
|
26759 | }
|
26760 |
|
26761 |
|
26762 |
|
26763 | }),
|
26764 |
|
26765 | (function(module, __webpack_exports__, __webpack_require__) {
|
26766 |
|
26767 | "use strict";
|
26768 | __webpack_require__.r(__webpack_exports__);
|
26769 | __webpack_require__.d(__webpack_exports__, "InnerSubscriber", function() { return InnerSubscriber; });
|
26770 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
26771 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
26772 |
|
26773 |
|
26774 |
|
26775 | var InnerSubscriber = (function (_super) {
|
26776 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](InnerSubscriber, _super);
|
26777 | function InnerSubscriber(parent, outerValue, outerIndex) {
|
26778 | var _this = _super.call(this) || this;
|
26779 | _this.parent = parent;
|
26780 | _this.outerValue = outerValue;
|
26781 | _this.outerIndex = outerIndex;
|
26782 | _this.index = 0;
|
26783 | return _this;
|
26784 | }
|
26785 | InnerSubscriber.prototype._next = function (value) {
|
26786 | this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this);
|
26787 | };
|
26788 | InnerSubscriber.prototype._error = function (error) {
|
26789 | this.parent.notifyError(error, this);
|
26790 | this.unsubscribe();
|
26791 | };
|
26792 | InnerSubscriber.prototype._complete = function () {
|
26793 | this.parent.notifyComplete(this);
|
26794 | this.unsubscribe();
|
26795 | };
|
26796 | return InnerSubscriber;
|
26797 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
26798 |
|
26799 |
|
26800 |
|
26801 |
|
26802 | }),
|
26803 |
|
26804 | (function(module, __webpack_exports__, __webpack_require__) {
|
26805 |
|
26806 | "use strict";
|
26807 | __webpack_require__.r(__webpack_exports__);
|
26808 | __webpack_require__.d(__webpack_exports__, "subscribeTo", function() { return subscribeTo; });
|
26809 | var _subscribeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(205);
|
26810 | var _subscribeToPromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(231);
|
26811 | var _subscribeToIterable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(232);
|
26812 | var _subscribeToObservable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(234);
|
26813 | var _isArrayLike__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(235);
|
26814 | var _isPromise__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(236);
|
26815 | var _isObject__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(177);
|
26816 | var _symbol_iterator__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(233);
|
26817 | var _symbol_observable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(181);
|
26818 |
|
26819 |
|
26820 |
|
26821 |
|
26822 |
|
26823 |
|
26824 |
|
26825 |
|
26826 |
|
26827 |
|
26828 | var subscribeTo = function (result) {
|
26829 | if (!!result && typeof result[_symbol_observable__WEBPACK_IMPORTED_MODULE_8__["observable"]] === 'function') {
|
26830 | return Object(_subscribeToObservable__WEBPACK_IMPORTED_MODULE_3__["subscribeToObservable"])(result);
|
26831 | }
|
26832 | else if (Object(_isArrayLike__WEBPACK_IMPORTED_MODULE_4__["isArrayLike"])(result)) {
|
26833 | return Object(_subscribeToArray__WEBPACK_IMPORTED_MODULE_0__["subscribeToArray"])(result);
|
26834 | }
|
26835 | else if (Object(_isPromise__WEBPACK_IMPORTED_MODULE_5__["isPromise"])(result)) {
|
26836 | return Object(_subscribeToPromise__WEBPACK_IMPORTED_MODULE_1__["subscribeToPromise"])(result);
|
26837 | }
|
26838 | else if (!!result && typeof result[_symbol_iterator__WEBPACK_IMPORTED_MODULE_7__["iterator"]] === 'function') {
|
26839 | return Object(_subscribeToIterable__WEBPACK_IMPORTED_MODULE_2__["subscribeToIterable"])(result);
|
26840 | }
|
26841 | else {
|
26842 | var value = Object(_isObject__WEBPACK_IMPORTED_MODULE_6__["isObject"])(result) ? 'an invalid object' : "'" + result + "'";
|
26843 | var msg = "You provided " + value + " where a stream was expected."
|
26844 | + ' You can provide an Observable, Promise, Array, or Iterable.';
|
26845 | throw new TypeError(msg);
|
26846 | }
|
26847 | };
|
26848 |
|
26849 |
|
26850 |
|
26851 | }),
|
26852 |
|
26853 | (function(module, __webpack_exports__, __webpack_require__) {
|
26854 |
|
26855 | "use strict";
|
26856 | __webpack_require__.r(__webpack_exports__);
|
26857 | __webpack_require__.d(__webpack_exports__, "subscribeToPromise", function() { return subscribeToPromise; });
|
26858 | var _hostReportError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(174);
|
26859 |
|
26860 |
|
26861 | var subscribeToPromise = function (promise) {
|
26862 | return function (subscriber) {
|
26863 | promise.then(function (value) {
|
26864 | if (!subscriber.closed) {
|
26865 | subscriber.next(value);
|
26866 | subscriber.complete();
|
26867 | }
|
26868 | }, function (err) { return subscriber.error(err); })
|
26869 | .then(null, _hostReportError__WEBPACK_IMPORTED_MODULE_0__["hostReportError"]);
|
26870 | return subscriber;
|
26871 | };
|
26872 | };
|
26873 |
|
26874 |
|
26875 |
|
26876 | }),
|
26877 |
|
26878 | (function(module, __webpack_exports__, __webpack_require__) {
|
26879 |
|
26880 | "use strict";
|
26881 | __webpack_require__.r(__webpack_exports__);
|
26882 | __webpack_require__.d(__webpack_exports__, "subscribeToIterable", function() { return subscribeToIterable; });
|
26883 | var _symbol_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(233);
|
26884 |
|
26885 |
|
26886 | var subscribeToIterable = function (iterable) {
|
26887 | return function (subscriber) {
|
26888 | var iterator = iterable[_symbol_iterator__WEBPACK_IMPORTED_MODULE_0__["iterator"]]();
|
26889 | do {
|
26890 | var item = iterator.next();
|
26891 | if (item.done) {
|
26892 | subscriber.complete();
|
26893 | break;
|
26894 | }
|
26895 | subscriber.next(item.value);
|
26896 | if (subscriber.closed) {
|
26897 | break;
|
26898 | }
|
26899 | } while (true);
|
26900 | if (typeof iterator.return === 'function') {
|
26901 | subscriber.add(function () {
|
26902 | if (iterator.return) {
|
26903 | iterator.return();
|
26904 | }
|
26905 | });
|
26906 | }
|
26907 | return subscriber;
|
26908 | };
|
26909 | };
|
26910 |
|
26911 |
|
26912 |
|
26913 | }),
|
26914 |
|
26915 | (function(module, __webpack_exports__, __webpack_require__) {
|
26916 |
|
26917 | "use strict";
|
26918 | __webpack_require__.r(__webpack_exports__);
|
26919 | __webpack_require__.d(__webpack_exports__, "getSymbolIterator", function() { return getSymbolIterator; });
|
26920 | __webpack_require__.d(__webpack_exports__, "iterator", function() { return iterator; });
|
26921 | __webpack_require__.d(__webpack_exports__, "$$iterator", function() { return $$iterator; });
|
26922 |
|
26923 | function getSymbolIterator() {
|
26924 | if (typeof Symbol !== 'function' || !Symbol.iterator) {
|
26925 | return '@@iterator';
|
26926 | }
|
26927 | return Symbol.iterator;
|
26928 | }
|
26929 | var iterator = getSymbolIterator();
|
26930 | var $$iterator = iterator;
|
26931 |
|
26932 |
|
26933 |
|
26934 | }),
|
26935 |
|
26936 | (function(module, __webpack_exports__, __webpack_require__) {
|
26937 |
|
26938 | "use strict";
|
26939 | __webpack_require__.r(__webpack_exports__);
|
26940 | __webpack_require__.d(__webpack_exports__, "subscribeToObservable", function() { return subscribeToObservable; });
|
26941 | var _symbol_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(181);
|
26942 |
|
26943 |
|
26944 | var subscribeToObservable = function (obj) {
|
26945 | return function (subscriber) {
|
26946 | var obs = obj[_symbol_observable__WEBPACK_IMPORTED_MODULE_0__["observable"]]();
|
26947 | if (typeof obs.subscribe !== 'function') {
|
26948 | throw new TypeError('Provided object does not correctly implement Symbol.observable');
|
26949 | }
|
26950 | else {
|
26951 | return obs.subscribe(subscriber);
|
26952 | }
|
26953 | };
|
26954 | };
|
26955 |
|
26956 |
|
26957 |
|
26958 | }),
|
26959 |
|
26960 | (function(module, __webpack_exports__, __webpack_require__) {
|
26961 |
|
26962 | "use strict";
|
26963 | __webpack_require__.r(__webpack_exports__);
|
26964 | __webpack_require__.d(__webpack_exports__, "isArrayLike", function() { return isArrayLike; });
|
26965 |
|
26966 | var isArrayLike = (function (x) { return x && typeof x.length === 'number' && typeof x !== 'function'; });
|
26967 |
|
26968 |
|
26969 |
|
26970 | }),
|
26971 |
|
26972 | (function(module, __webpack_exports__, __webpack_require__) {
|
26973 |
|
26974 | "use strict";
|
26975 | __webpack_require__.r(__webpack_exports__);
|
26976 | __webpack_require__.d(__webpack_exports__, "isPromise", function() { return isPromise; });
|
26977 |
|
26978 | function isPromise(value) {
|
26979 | return !!value && typeof value.subscribe !== 'function' && typeof value.then === 'function';
|
26980 | }
|
26981 |
|
26982 |
|
26983 |
|
26984 | }),
|
26985 |
|
26986 | (function(module, __webpack_exports__, __webpack_require__) {
|
26987 |
|
26988 | "use strict";
|
26989 | __webpack_require__.r(__webpack_exports__);
|
26990 | __webpack_require__.d(__webpack_exports__, "concat", function() { return concat; });
|
26991 | var _of__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(202);
|
26992 | var _operators_concatAll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(238);
|
26993 |
|
26994 |
|
26995 |
|
26996 | function concat() {
|
26997 | var observables = [];
|
26998 | for (var _i = 0; _i < arguments.length; _i++) {
|
26999 | observables[_i] = arguments[_i];
|
27000 | }
|
27001 | return Object(_operators_concatAll__WEBPACK_IMPORTED_MODULE_1__["concatAll"])()(_of__WEBPACK_IMPORTED_MODULE_0__["of"].apply(void 0, observables));
|
27002 | }
|
27003 |
|
27004 |
|
27005 |
|
27006 | }),
|
27007 |
|
27008 | (function(module, __webpack_exports__, __webpack_require__) {
|
27009 |
|
27010 | "use strict";
|
27011 | __webpack_require__.r(__webpack_exports__);
|
27012 | __webpack_require__.d(__webpack_exports__, "concatAll", function() { return concatAll; });
|
27013 | var _mergeAll__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(239);
|
27014 |
|
27015 |
|
27016 | function concatAll() {
|
27017 | return Object(_mergeAll__WEBPACK_IMPORTED_MODULE_0__["mergeAll"])(1);
|
27018 | }
|
27019 |
|
27020 |
|
27021 |
|
27022 | }),
|
27023 |
|
27024 | (function(module, __webpack_exports__, __webpack_require__) {
|
27025 |
|
27026 | "use strict";
|
27027 | __webpack_require__.r(__webpack_exports__);
|
27028 | __webpack_require__.d(__webpack_exports__, "mergeAll", function() { return mergeAll; });
|
27029 | var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(240);
|
27030 | var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(183);
|
27031 |
|
27032 |
|
27033 |
|
27034 | function mergeAll(concurrent) {
|
27035 | if (concurrent === void 0) {
|
27036 | concurrent = Number.POSITIVE_INFINITY;
|
27037 | }
|
27038 | return Object(_mergeMap__WEBPACK_IMPORTED_MODULE_0__["mergeMap"])(_util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"], concurrent);
|
27039 | }
|
27040 |
|
27041 |
|
27042 |
|
27043 | }),
|
27044 |
|
27045 | (function(module, __webpack_exports__, __webpack_require__) {
|
27046 |
|
27047 | "use strict";
|
27048 | __webpack_require__.r(__webpack_exports__);
|
27049 | __webpack_require__.d(__webpack_exports__, "mergeMap", function() { return mergeMap; });
|
27050 | __webpack_require__.d(__webpack_exports__, "MergeMapOperator", function() { return MergeMapOperator; });
|
27051 | __webpack_require__.d(__webpack_exports__, "MergeMapSubscriber", function() { return MergeMapSubscriber; });
|
27052 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
27053 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(228);
|
27054 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(227);
|
27055 | var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(229);
|
27056 | var _map__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(224);
|
27057 | var _observable_from__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(241);
|
27058 |
|
27059 |
|
27060 |
|
27061 |
|
27062 |
|
27063 |
|
27064 |
|
27065 | function mergeMap(project, resultSelector, concurrent) {
|
27066 | if (concurrent === void 0) {
|
27067 | concurrent = Number.POSITIVE_INFINITY;
|
27068 | }
|
27069 | if (typeof resultSelector === 'function') {
|
27070 | return function (source) { return source.pipe(mergeMap(function (a, i) { return Object(_observable_from__WEBPACK_IMPORTED_MODULE_5__["from"])(project(a, i)).pipe(Object(_map__WEBPACK_IMPORTED_MODULE_4__["map"])(function (b, ii) { return resultSelector(a, b, i, ii); })); }, concurrent)); };
|
27071 | }
|
27072 | else if (typeof resultSelector === 'number') {
|
27073 | concurrent = resultSelector;
|
27074 | }
|
27075 | return function (source) { return source.lift(new MergeMapOperator(project, concurrent)); };
|
27076 | }
|
27077 | var MergeMapOperator = (function () {
|
27078 | function MergeMapOperator(project, concurrent) {
|
27079 | if (concurrent === void 0) {
|
27080 | concurrent = Number.POSITIVE_INFINITY;
|
27081 | }
|
27082 | this.project = project;
|
27083 | this.concurrent = concurrent;
|
27084 | }
|
27085 | MergeMapOperator.prototype.call = function (observer, source) {
|
27086 | return source.subscribe(new MergeMapSubscriber(observer, this.project, this.concurrent));
|
27087 | };
|
27088 | return MergeMapOperator;
|
27089 | }());
|
27090 |
|
27091 | var MergeMapSubscriber = (function (_super) {
|
27092 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](MergeMapSubscriber, _super);
|
27093 | function MergeMapSubscriber(destination, project, concurrent) {
|
27094 | if (concurrent === void 0) {
|
27095 | concurrent = Number.POSITIVE_INFINITY;
|
27096 | }
|
27097 | var _this = _super.call(this, destination) || this;
|
27098 | _this.project = project;
|
27099 | _this.concurrent = concurrent;
|
27100 | _this.hasCompleted = false;
|
27101 | _this.buffer = [];
|
27102 | _this.active = 0;
|
27103 | _this.index = 0;
|
27104 | return _this;
|
27105 | }
|
27106 | MergeMapSubscriber.prototype._next = function (value) {
|
27107 | if (this.active < this.concurrent) {
|
27108 | this._tryNext(value);
|
27109 | }
|
27110 | else {
|
27111 | this.buffer.push(value);
|
27112 | }
|
27113 | };
|
27114 | MergeMapSubscriber.prototype._tryNext = function (value) {
|
27115 | var result;
|
27116 | var index = this.index++;
|
27117 | try {
|
27118 | result = this.project(value, index);
|
27119 | }
|
27120 | catch (err) {
|
27121 | this.destination.error(err);
|
27122 | return;
|
27123 | }
|
27124 | this.active++;
|
27125 | this._innerSub(result, value, index);
|
27126 | };
|
27127 | MergeMapSubscriber.prototype._innerSub = function (ish, value, index) {
|
27128 | var innerSubscriber = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_3__["InnerSubscriber"](this, value, index);
|
27129 | var destination = this.destination;
|
27130 | destination.add(innerSubscriber);
|
27131 | var innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__["subscribeToResult"])(this, ish, undefined, undefined, innerSubscriber);
|
27132 | if (innerSubscription !== innerSubscriber) {
|
27133 | destination.add(innerSubscription);
|
27134 | }
|
27135 | };
|
27136 | MergeMapSubscriber.prototype._complete = function () {
|
27137 | this.hasCompleted = true;
|
27138 | if (this.active === 0 && this.buffer.length === 0) {
|
27139 | this.destination.complete();
|
27140 | }
|
27141 | this.unsubscribe();
|
27142 | };
|
27143 | MergeMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
27144 | this.destination.next(innerValue);
|
27145 | };
|
27146 | MergeMapSubscriber.prototype.notifyComplete = function (innerSub) {
|
27147 | var buffer = this.buffer;
|
27148 | this.remove(innerSub);
|
27149 | this.active--;
|
27150 | if (buffer.length > 0) {
|
27151 | this._next(buffer.shift());
|
27152 | }
|
27153 | else if (this.active === 0 && this.hasCompleted) {
|
27154 | this.destination.complete();
|
27155 | }
|
27156 | };
|
27157 | return MergeMapSubscriber;
|
27158 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"]));
|
27159 |
|
27160 |
|
27161 |
|
27162 |
|
27163 | }),
|
27164 |
|
27165 | (function(module, __webpack_exports__, __webpack_require__) {
|
27166 |
|
27167 | "use strict";
|
27168 | __webpack_require__.r(__webpack_exports__);
|
27169 | __webpack_require__.d(__webpack_exports__, "from", function() { return from; });
|
27170 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(167);
|
27171 | var _util_subscribeTo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(230);
|
27172 | var _scheduled_scheduled__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(242);
|
27173 |
|
27174 |
|
27175 |
|
27176 |
|
27177 | function from(input, scheduler) {
|
27178 | if (!scheduler) {
|
27179 | if (input instanceof _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]) {
|
27180 | return input;
|
27181 | }
|
27182 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](Object(_util_subscribeTo__WEBPACK_IMPORTED_MODULE_1__["subscribeTo"])(input));
|
27183 | }
|
27184 | else {
|
27185 | return Object(_scheduled_scheduled__WEBPACK_IMPORTED_MODULE_2__["scheduled"])(input, scheduler);
|
27186 | }
|
27187 | }
|
27188 |
|
27189 |
|
27190 |
|
27191 | }),
|
27192 |
|
27193 | (function(module, __webpack_exports__, __webpack_require__) {
|
27194 |
|
27195 | "use strict";
|
27196 | __webpack_require__.r(__webpack_exports__);
|
27197 | __webpack_require__.d(__webpack_exports__, "scheduled", function() { return scheduled; });
|
27198 | var _scheduleObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(243);
|
27199 | var _schedulePromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(244);
|
27200 | var _scheduleArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(206);
|
27201 | var _scheduleIterable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(245);
|
27202 | var _util_isInteropObservable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(246);
|
27203 | var _util_isPromise__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(236);
|
27204 | var _util_isArrayLike__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(235);
|
27205 | var _util_isIterable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(247);
|
27206 |
|
27207 |
|
27208 |
|
27209 |
|
27210 |
|
27211 |
|
27212 |
|
27213 |
|
27214 |
|
27215 | function scheduled(input, scheduler) {
|
27216 | if (input != null) {
|
27217 | if (Object(_util_isInteropObservable__WEBPACK_IMPORTED_MODULE_4__["isInteropObservable"])(input)) {
|
27218 | return Object(_scheduleObservable__WEBPACK_IMPORTED_MODULE_0__["scheduleObservable"])(input, scheduler);
|
27219 | }
|
27220 | else if (Object(_util_isPromise__WEBPACK_IMPORTED_MODULE_5__["isPromise"])(input)) {
|
27221 | return Object(_schedulePromise__WEBPACK_IMPORTED_MODULE_1__["schedulePromise"])(input, scheduler);
|
27222 | }
|
27223 | else if (Object(_util_isArrayLike__WEBPACK_IMPORTED_MODULE_6__["isArrayLike"])(input)) {
|
27224 | return Object(_scheduleArray__WEBPACK_IMPORTED_MODULE_2__["scheduleArray"])(input, scheduler);
|
27225 | }
|
27226 | else if (Object(_util_isIterable__WEBPACK_IMPORTED_MODULE_7__["isIterable"])(input) || typeof input === 'string') {
|
27227 | return Object(_scheduleIterable__WEBPACK_IMPORTED_MODULE_3__["scheduleIterable"])(input, scheduler);
|
27228 | }
|
27229 | }
|
27230 | throw new TypeError((input !== null && typeof input || input) + ' is not observable');
|
27231 | }
|
27232 |
|
27233 |
|
27234 |
|
27235 | }),
|
27236 |
|
27237 | (function(module, __webpack_exports__, __webpack_require__) {
|
27238 |
|
27239 | "use strict";
|
27240 | __webpack_require__.r(__webpack_exports__);
|
27241 | __webpack_require__.d(__webpack_exports__, "scheduleObservable", function() { return scheduleObservable; });
|
27242 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(167);
|
27243 | var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(175);
|
27244 | var _symbol_observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(181);
|
27245 |
|
27246 |
|
27247 |
|
27248 |
|
27249 | function scheduleObservable(input, scheduler) {
|
27250 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
27251 | var sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
|
27252 | sub.add(scheduler.schedule(function () {
|
27253 | var observable = input[_symbol_observable__WEBPACK_IMPORTED_MODULE_2__["observable"]]();
|
27254 | sub.add(observable.subscribe({
|
27255 | next: function (value) { sub.add(scheduler.schedule(function () { return subscriber.next(value); })); },
|
27256 | error: function (err) { sub.add(scheduler.schedule(function () { return subscriber.error(err); })); },
|
27257 | complete: function () { sub.add(scheduler.schedule(function () { return subscriber.complete(); })); },
|
27258 | }));
|
27259 | }));
|
27260 | return sub;
|
27261 | });
|
27262 | }
|
27263 |
|
27264 |
|
27265 |
|
27266 | }),
|
27267 |
|
27268 | (function(module, __webpack_exports__, __webpack_require__) {
|
27269 |
|
27270 | "use strict";
|
27271 | __webpack_require__.r(__webpack_exports__);
|
27272 | __webpack_require__.d(__webpack_exports__, "schedulePromise", function() { return schedulePromise; });
|
27273 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(167);
|
27274 | var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(175);
|
27275 |
|
27276 |
|
27277 |
|
27278 | function schedulePromise(input, scheduler) {
|
27279 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
27280 | var sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
|
27281 | sub.add(scheduler.schedule(function () {
|
27282 | return input.then(function (value) {
|
27283 | sub.add(scheduler.schedule(function () {
|
27284 | subscriber.next(value);
|
27285 | sub.add(scheduler.schedule(function () { return subscriber.complete(); }));
|
27286 | }));
|
27287 | }, function (err) {
|
27288 | sub.add(scheduler.schedule(function () { return subscriber.error(err); }));
|
27289 | });
|
27290 | }));
|
27291 | return sub;
|
27292 | });
|
27293 | }
|
27294 |
|
27295 |
|
27296 |
|
27297 | }),
|
27298 |
|
27299 | (function(module, __webpack_exports__, __webpack_require__) {
|
27300 |
|
27301 | "use strict";
|
27302 | __webpack_require__.r(__webpack_exports__);
|
27303 | __webpack_require__.d(__webpack_exports__, "scheduleIterable", function() { return scheduleIterable; });
|
27304 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(167);
|
27305 | var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(175);
|
27306 | var _symbol_iterator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(233);
|
27307 |
|
27308 |
|
27309 |
|
27310 |
|
27311 | function scheduleIterable(input, scheduler) {
|
27312 | if (!input) {
|
27313 | throw new Error('Iterable cannot be null');
|
27314 | }
|
27315 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
27316 | var sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
|
27317 | var iterator;
|
27318 | sub.add(function () {
|
27319 | if (iterator && typeof iterator.return === 'function') {
|
27320 | iterator.return();
|
27321 | }
|
27322 | });
|
27323 | sub.add(scheduler.schedule(function () {
|
27324 | iterator = input[_symbol_iterator__WEBPACK_IMPORTED_MODULE_2__["iterator"]]();
|
27325 | sub.add(scheduler.schedule(function () {
|
27326 | if (subscriber.closed) {
|
27327 | return;
|
27328 | }
|
27329 | var value;
|
27330 | var done;
|
27331 | try {
|
27332 | var result = iterator.next();
|
27333 | value = result.value;
|
27334 | done = result.done;
|
27335 | }
|
27336 | catch (err) {
|
27337 | subscriber.error(err);
|
27338 | return;
|
27339 | }
|
27340 | if (done) {
|
27341 | subscriber.complete();
|
27342 | }
|
27343 | else {
|
27344 | subscriber.next(value);
|
27345 | this.schedule();
|
27346 | }
|
27347 | }));
|
27348 | }));
|
27349 | return sub;
|
27350 | });
|
27351 | }
|
27352 |
|
27353 |
|
27354 |
|
27355 | }),
|
27356 |
|
27357 | (function(module, __webpack_exports__, __webpack_require__) {
|
27358 |
|
27359 | "use strict";
|
27360 | __webpack_require__.r(__webpack_exports__);
|
27361 | __webpack_require__.d(__webpack_exports__, "isInteropObservable", function() { return isInteropObservable; });
|
27362 | var _symbol_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(181);
|
27363 |
|
27364 |
|
27365 | function isInteropObservable(input) {
|
27366 | return input && typeof input[_symbol_observable__WEBPACK_IMPORTED_MODULE_0__["observable"]] === 'function';
|
27367 | }
|
27368 |
|
27369 |
|
27370 |
|
27371 | }),
|
27372 |
|
27373 | (function(module, __webpack_exports__, __webpack_require__) {
|
27374 |
|
27375 | "use strict";
|
27376 | __webpack_require__.r(__webpack_exports__);
|
27377 | __webpack_require__.d(__webpack_exports__, "isIterable", function() { return isIterable; });
|
27378 | var _symbol_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(233);
|
27379 |
|
27380 |
|
27381 | function isIterable(input) {
|
27382 | return input && typeof input[_symbol_iterator__WEBPACK_IMPORTED_MODULE_0__["iterator"]] === 'function';
|
27383 | }
|
27384 |
|
27385 |
|
27386 |
|
27387 | }),
|
27388 |
|
27389 | (function(module, __webpack_exports__, __webpack_require__) {
|
27390 |
|
27391 | "use strict";
|
27392 | __webpack_require__.r(__webpack_exports__);
|
27393 | __webpack_require__.d(__webpack_exports__, "defer", function() { return defer; });
|
27394 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(167);
|
27395 | var _from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(241);
|
27396 | var _empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(201);
|
27397 |
|
27398 |
|
27399 |
|
27400 |
|
27401 | function defer(observableFactory) {
|
27402 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
27403 | var input;
|
27404 | try {
|
27405 | input = observableFactory();
|
27406 | }
|
27407 | catch (err) {
|
27408 | subscriber.error(err);
|
27409 | return undefined;
|
27410 | }
|
27411 | var source = input ? Object(_from__WEBPACK_IMPORTED_MODULE_1__["from"])(input) : Object(_empty__WEBPACK_IMPORTED_MODULE_2__["empty"])();
|
27412 | return source.subscribe(subscriber);
|
27413 | });
|
27414 | }
|
27415 |
|
27416 |
|
27417 |
|
27418 | }),
|
27419 |
|
27420 | (function(module, __webpack_exports__, __webpack_require__) {
|
27421 |
|
27422 | "use strict";
|
27423 | __webpack_require__.r(__webpack_exports__);
|
27424 | __webpack_require__.d(__webpack_exports__, "forkJoin", function() { return forkJoin; });
|
27425 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(167);
|
27426 | var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(176);
|
27427 | var _operators_map__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(224);
|
27428 | var _util_isObject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(177);
|
27429 | var _from__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(241);
|
27430 |
|
27431 |
|
27432 |
|
27433 |
|
27434 |
|
27435 |
|
27436 | function forkJoin() {
|
27437 | var sources = [];
|
27438 | for (var _i = 0; _i < arguments.length; _i++) {
|
27439 | sources[_i] = arguments[_i];
|
27440 | }
|
27441 | if (sources.length === 1) {
|
27442 | var first_1 = sources[0];
|
27443 | if (Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(first_1)) {
|
27444 | return forkJoinInternal(first_1, null);
|
27445 | }
|
27446 | if (Object(_util_isObject__WEBPACK_IMPORTED_MODULE_3__["isObject"])(first_1) && Object.getPrototypeOf(first_1) === Object.prototype) {
|
27447 | var keys = Object.keys(first_1);
|
27448 | return forkJoinInternal(keys.map(function (key) { return first_1[key]; }), keys);
|
27449 | }
|
27450 | }
|
27451 | if (typeof sources[sources.length - 1] === 'function') {
|
27452 | var resultSelector_1 = sources.pop();
|
27453 | sources = (sources.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(sources[0])) ? sources[0] : sources;
|
27454 | return forkJoinInternal(sources, null).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_2__["map"])(function (args) { return resultSelector_1.apply(void 0, args); }));
|
27455 | }
|
27456 | return forkJoinInternal(sources, null);
|
27457 | }
|
27458 | function forkJoinInternal(sources, keys) {
|
27459 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
27460 | var len = sources.length;
|
27461 | if (len === 0) {
|
27462 | subscriber.complete();
|
27463 | return;
|
27464 | }
|
27465 | var values = new Array(len);
|
27466 | var completed = 0;
|
27467 | var emitted = 0;
|
27468 | var _loop_1 = function (i) {
|
27469 | var source = Object(_from__WEBPACK_IMPORTED_MODULE_4__["from"])(sources[i]);
|
27470 | var hasValue = false;
|
27471 | subscriber.add(source.subscribe({
|
27472 | next: function (value) {
|
27473 | if (!hasValue) {
|
27474 | hasValue = true;
|
27475 | emitted++;
|
27476 | }
|
27477 | values[i] = value;
|
27478 | },
|
27479 | error: function (err) { return subscriber.error(err); },
|
27480 | complete: function () {
|
27481 | completed++;
|
27482 | if (completed === len || !hasValue) {
|
27483 | if (emitted === len) {
|
27484 | subscriber.next(keys ?
|
27485 | keys.reduce(function (result, key, i) { return (result[key] = values[i], result); }, {}) :
|
27486 | values);
|
27487 | }
|
27488 | subscriber.complete();
|
27489 | }
|
27490 | }
|
27491 | }));
|
27492 | };
|
27493 | for (var i = 0; i < len; i++) {
|
27494 | _loop_1(i);
|
27495 | }
|
27496 | });
|
27497 | }
|
27498 |
|
27499 |
|
27500 |
|
27501 | }),
|
27502 |
|
27503 | (function(module, __webpack_exports__, __webpack_require__) {
|
27504 |
|
27505 | "use strict";
|
27506 | __webpack_require__.r(__webpack_exports__);
|
27507 | __webpack_require__.d(__webpack_exports__, "fromEvent", function() { return fromEvent; });
|
27508 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(167);
|
27509 | var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(176);
|
27510 | var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(171);
|
27511 | var _operators_map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(224);
|
27512 |
|
27513 |
|
27514 |
|
27515 |
|
27516 |
|
27517 | var toString = (function () { return Object.prototype.toString; })();
|
27518 | function fromEvent(target, eventName, options, resultSelector) {
|
27519 | if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_2__["isFunction"])(options)) {
|
27520 | resultSelector = options;
|
27521 | options = undefined;
|
27522 | }
|
27523 | if (resultSelector) {
|
27524 | return fromEvent(target, eventName, options).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_3__["map"])(function (args) { return Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));
|
27525 | }
|
27526 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
27527 | function handler(e) {
|
27528 | if (arguments.length > 1) {
|
27529 | subscriber.next(Array.prototype.slice.call(arguments));
|
27530 | }
|
27531 | else {
|
27532 | subscriber.next(e);
|
27533 | }
|
27534 | }
|
27535 | setupSubscription(target, eventName, handler, subscriber, options);
|
27536 | });
|
27537 | }
|
27538 | function setupSubscription(sourceObj, eventName, handler, subscriber, options) {
|
27539 | var unsubscribe;
|
27540 | if (isEventTarget(sourceObj)) {
|
27541 | var source_1 = sourceObj;
|
27542 | sourceObj.addEventListener(eventName, handler, options);
|
27543 | unsubscribe = function () { return source_1.removeEventListener(eventName, handler, options); };
|
27544 | }
|
27545 | else if (isJQueryStyleEventEmitter(sourceObj)) {
|
27546 | var source_2 = sourceObj;
|
27547 | sourceObj.on(eventName, handler);
|
27548 | unsubscribe = function () { return source_2.off(eventName, handler); };
|
27549 | }
|
27550 | else if (isNodeStyleEventEmitter(sourceObj)) {
|
27551 | var source_3 = sourceObj;
|
27552 | sourceObj.addListener(eventName, handler);
|
27553 | unsubscribe = function () { return source_3.removeListener(eventName, handler); };
|
27554 | }
|
27555 | else if (sourceObj && sourceObj.length) {
|
27556 | for (var i = 0, len = sourceObj.length; i < len; i++) {
|
27557 | setupSubscription(sourceObj[i], eventName, handler, subscriber, options);
|
27558 | }
|
27559 | }
|
27560 | else {
|
27561 | throw new TypeError('Invalid event target');
|
27562 | }
|
27563 | subscriber.add(unsubscribe);
|
27564 | }
|
27565 | function isNodeStyleEventEmitter(sourceObj) {
|
27566 | return sourceObj && typeof sourceObj.addListener === 'function' && typeof sourceObj.removeListener === 'function';
|
27567 | }
|
27568 | function isJQueryStyleEventEmitter(sourceObj) {
|
27569 | return sourceObj && typeof sourceObj.on === 'function' && typeof sourceObj.off === 'function';
|
27570 | }
|
27571 | function isEventTarget(sourceObj) {
|
27572 | return sourceObj && typeof sourceObj.addEventListener === 'function' && typeof sourceObj.removeEventListener === 'function';
|
27573 | }
|
27574 |
|
27575 |
|
27576 |
|
27577 | }),
|
27578 |
|
27579 | (function(module, __webpack_exports__, __webpack_require__) {
|
27580 |
|
27581 | "use strict";
|
27582 | __webpack_require__.r(__webpack_exports__);
|
27583 | __webpack_require__.d(__webpack_exports__, "fromEventPattern", function() { return fromEventPattern; });
|
27584 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(167);
|
27585 | var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(176);
|
27586 | var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(171);
|
27587 | var _operators_map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(224);
|
27588 |
|
27589 |
|
27590 |
|
27591 |
|
27592 |
|
27593 | function fromEventPattern(addHandler, removeHandler, resultSelector) {
|
27594 | if (resultSelector) {
|
27595 | return fromEventPattern(addHandler, removeHandler).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_3__["map"])(function (args) { return Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));
|
27596 | }
|
27597 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
27598 | var handler = function () {
|
27599 | var e = [];
|
27600 | for (var _i = 0; _i < arguments.length; _i++) {
|
27601 | e[_i] = arguments[_i];
|
27602 | }
|
27603 | return subscriber.next(e.length === 1 ? e[0] : e);
|
27604 | };
|
27605 | var retValue;
|
27606 | try {
|
27607 | retValue = addHandler(handler);
|
27608 | }
|
27609 | catch (err) {
|
27610 | subscriber.error(err);
|
27611 | return undefined;
|
27612 | }
|
27613 | if (!Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_2__["isFunction"])(removeHandler)) {
|
27614 | return undefined;
|
27615 | }
|
27616 | return function () { return removeHandler(handler, retValue); };
|
27617 | });
|
27618 | }
|
27619 |
|
27620 |
|
27621 |
|
27622 | }),
|
27623 |
|
27624 | (function(module, __webpack_exports__, __webpack_require__) {
|
27625 |
|
27626 | "use strict";
|
27627 | __webpack_require__.r(__webpack_exports__);
|
27628 | __webpack_require__.d(__webpack_exports__, "generate", function() { return generate; });
|
27629 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(167);
|
27630 | var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(183);
|
27631 | var _util_isScheduler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(203);
|
27632 |
|
27633 |
|
27634 |
|
27635 |
|
27636 | function generate(initialStateOrOptions, condition, iterate, resultSelectorOrObservable, scheduler) {
|
27637 | var resultSelector;
|
27638 | var initialState;
|
27639 | if (arguments.length == 1) {
|
27640 | var options = initialStateOrOptions;
|
27641 | initialState = options.initialState;
|
27642 | condition = options.condition;
|
27643 | iterate = options.iterate;
|
27644 | resultSelector = options.resultSelector || _util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"];
|
27645 | scheduler = options.scheduler;
|
27646 | }
|
27647 | else if (resultSelectorOrObservable === undefined || Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_2__["isScheduler"])(resultSelectorOrObservable)) {
|
27648 | initialState = initialStateOrOptions;
|
27649 | resultSelector = _util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"];
|
27650 | scheduler = resultSelectorOrObservable;
|
27651 | }
|
27652 | else {
|
27653 | initialState = initialStateOrOptions;
|
27654 | resultSelector = resultSelectorOrObservable;
|
27655 | }
|
27656 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
27657 | var state = initialState;
|
27658 | if (scheduler) {
|
27659 | return scheduler.schedule(dispatch, 0, {
|
27660 | subscriber: subscriber,
|
27661 | iterate: iterate,
|
27662 | condition: condition,
|
27663 | resultSelector: resultSelector,
|
27664 | state: state
|
27665 | });
|
27666 | }
|
27667 | do {
|
27668 | if (condition) {
|
27669 | var conditionResult = void 0;
|
27670 | try {
|
27671 | conditionResult = condition(state);
|
27672 | }
|
27673 | catch (err) {
|
27674 | subscriber.error(err);
|
27675 | return undefined;
|
27676 | }
|
27677 | if (!conditionResult) {
|
27678 | subscriber.complete();
|
27679 | break;
|
27680 | }
|
27681 | }
|
27682 | var value = void 0;
|
27683 | try {
|
27684 | value = resultSelector(state);
|
27685 | }
|
27686 | catch (err) {
|
27687 | subscriber.error(err);
|
27688 | return undefined;
|
27689 | }
|
27690 | subscriber.next(value);
|
27691 | if (subscriber.closed) {
|
27692 | break;
|
27693 | }
|
27694 | try {
|
27695 | state = iterate(state);
|
27696 | }
|
27697 | catch (err) {
|
27698 | subscriber.error(err);
|
27699 | return undefined;
|
27700 | }
|
27701 | } while (true);
|
27702 | return undefined;
|
27703 | });
|
27704 | }
|
27705 | function dispatch(state) {
|
27706 | var subscriber = state.subscriber, condition = state.condition;
|
27707 | if (subscriber.closed) {
|
27708 | return undefined;
|
27709 | }
|
27710 | if (state.needIterate) {
|
27711 | try {
|
27712 | state.state = state.iterate(state.state);
|
27713 | }
|
27714 | catch (err) {
|
27715 | subscriber.error(err);
|
27716 | return undefined;
|
27717 | }
|
27718 | }
|
27719 | else {
|
27720 | state.needIterate = true;
|
27721 | }
|
27722 | if (condition) {
|
27723 | var conditionResult = void 0;
|
27724 | try {
|
27725 | conditionResult = condition(state.state);
|
27726 | }
|
27727 | catch (err) {
|
27728 | subscriber.error(err);
|
27729 | return undefined;
|
27730 | }
|
27731 | if (!conditionResult) {
|
27732 | subscriber.complete();
|
27733 | return undefined;
|
27734 | }
|
27735 | if (subscriber.closed) {
|
27736 | return undefined;
|
27737 | }
|
27738 | }
|
27739 | var value;
|
27740 | try {
|
27741 | value = state.resultSelector(state.state);
|
27742 | }
|
27743 | catch (err) {
|
27744 | subscriber.error(err);
|
27745 | return undefined;
|
27746 | }
|
27747 | if (subscriber.closed) {
|
27748 | return undefined;
|
27749 | }
|
27750 | subscriber.next(value);
|
27751 | if (subscriber.closed) {
|
27752 | return undefined;
|
27753 | }
|
27754 | return this.schedule(state);
|
27755 | }
|
27756 |
|
27757 |
|
27758 |
|
27759 | }),
|
27760 |
|
27761 | (function(module, __webpack_exports__, __webpack_require__) {
|
27762 |
|
27763 | "use strict";
|
27764 | __webpack_require__.r(__webpack_exports__);
|
27765 | __webpack_require__.d(__webpack_exports__, "iif", function() { return iif; });
|
27766 | var _defer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(248);
|
27767 | var _empty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(201);
|
27768 |
|
27769 |
|
27770 |
|
27771 | function iif(condition, trueResult, falseResult) {
|
27772 | if (trueResult === void 0) {
|
27773 | trueResult = _empty__WEBPACK_IMPORTED_MODULE_1__["EMPTY"];
|
27774 | }
|
27775 | if (falseResult === void 0) {
|
27776 | falseResult = _empty__WEBPACK_IMPORTED_MODULE_1__["EMPTY"];
|
27777 | }
|
27778 | return Object(_defer__WEBPACK_IMPORTED_MODULE_0__["defer"])(function () { return condition() ? trueResult : falseResult; });
|
27779 | }
|
27780 |
|
27781 |
|
27782 |
|
27783 | }),
|
27784 |
|
27785 | (function(module, __webpack_exports__, __webpack_require__) {
|
27786 |
|
27787 | "use strict";
|
27788 | __webpack_require__.r(__webpack_exports__);
|
27789 | __webpack_require__.d(__webpack_exports__, "interval", function() { return interval; });
|
27790 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(167);
|
27791 | var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(213);
|
27792 | var _util_isNumeric__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(255);
|
27793 |
|
27794 |
|
27795 |
|
27796 |
|
27797 | function interval(period, scheduler) {
|
27798 | if (period === void 0) {
|
27799 | period = 0;
|
27800 | }
|
27801 | if (scheduler === void 0) {
|
27802 | scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"];
|
27803 | }
|
27804 | if (!Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_2__["isNumeric"])(period) || period < 0) {
|
27805 | period = 0;
|
27806 | }
|
27807 | if (!scheduler || typeof scheduler.schedule !== 'function') {
|
27808 | scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"];
|
27809 | }
|
27810 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
27811 | subscriber.add(scheduler.schedule(dispatch, period, { subscriber: subscriber, counter: 0, period: period }));
|
27812 | return subscriber;
|
27813 | });
|
27814 | }
|
27815 | function dispatch(state) {
|
27816 | var subscriber = state.subscriber, counter = state.counter, period = state.period;
|
27817 | subscriber.next(counter);
|
27818 | this.schedule({ subscriber: subscriber, counter: counter + 1, period: period }, period);
|
27819 | }
|
27820 |
|
27821 |
|
27822 |
|
27823 | }),
|
27824 |
|
27825 | (function(module, __webpack_exports__, __webpack_require__) {
|
27826 |
|
27827 | "use strict";
|
27828 | __webpack_require__.r(__webpack_exports__);
|
27829 | __webpack_require__.d(__webpack_exports__, "isNumeric", function() { return isNumeric; });
|
27830 | var _isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(176);
|
27831 |
|
27832 |
|
27833 | function isNumeric(val) {
|
27834 | return !Object(_isArray__WEBPACK_IMPORTED_MODULE_0__["isArray"])(val) && (val - parseFloat(val) + 1) >= 0;
|
27835 | }
|
27836 |
|
27837 |
|
27838 |
|
27839 | }),
|
27840 |
|
27841 | (function(module, __webpack_exports__, __webpack_require__) {
|
27842 |
|
27843 | "use strict";
|
27844 | __webpack_require__.r(__webpack_exports__);
|
27845 | __webpack_require__.d(__webpack_exports__, "merge", function() { return merge; });
|
27846 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(167);
|
27847 | var _util_isScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(203);
|
27848 | var _operators_mergeAll__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(239);
|
27849 | var _fromArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(204);
|
27850 |
|
27851 |
|
27852 |
|
27853 |
|
27854 |
|
27855 | function merge() {
|
27856 | var observables = [];
|
27857 | for (var _i = 0; _i < arguments.length; _i++) {
|
27858 | observables[_i] = arguments[_i];
|
27859 | }
|
27860 | var concurrent = Number.POSITIVE_INFINITY;
|
27861 | var scheduler = null;
|
27862 | var last = observables[observables.length - 1];
|
27863 | if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_1__["isScheduler"])(last)) {
|
27864 | scheduler = observables.pop();
|
27865 | if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') {
|
27866 | concurrent = observables.pop();
|
27867 | }
|
27868 | }
|
27869 | else if (typeof last === 'number') {
|
27870 | concurrent = observables.pop();
|
27871 | }
|
27872 | if (scheduler === null && observables.length === 1 && observables[0] instanceof _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]) {
|
27873 | return observables[0];
|
27874 | }
|
27875 | return Object(_operators_mergeAll__WEBPACK_IMPORTED_MODULE_2__["mergeAll"])(concurrent)(Object(_fromArray__WEBPACK_IMPORTED_MODULE_3__["fromArray"])(observables, scheduler));
|
27876 | }
|
27877 |
|
27878 |
|
27879 |
|
27880 | }),
|
27881 |
|
27882 | (function(module, __webpack_exports__, __webpack_require__) {
|
27883 |
|
27884 | "use strict";
|
27885 | __webpack_require__.r(__webpack_exports__);
|
27886 | __webpack_require__.d(__webpack_exports__, "NEVER", function() { return NEVER; });
|
27887 | __webpack_require__.d(__webpack_exports__, "never", function() { return never; });
|
27888 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(167);
|
27889 | var _util_noop__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(218);
|
27890 |
|
27891 |
|
27892 |
|
27893 | var NEVER = new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](_util_noop__WEBPACK_IMPORTED_MODULE_1__["noop"]);
|
27894 | function never() {
|
27895 | return NEVER;
|
27896 | }
|
27897 |
|
27898 |
|
27899 |
|
27900 | }),
|
27901 |
|
27902 | (function(module, __webpack_exports__, __webpack_require__) {
|
27903 |
|
27904 | "use strict";
|
27905 | __webpack_require__.r(__webpack_exports__);
|
27906 | __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return onErrorResumeNext; });
|
27907 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(167);
|
27908 | var _from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(241);
|
27909 | var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(176);
|
27910 | var _empty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(201);
|
27911 |
|
27912 |
|
27913 |
|
27914 |
|
27915 |
|
27916 | function onErrorResumeNext() {
|
27917 | var sources = [];
|
27918 | for (var _i = 0; _i < arguments.length; _i++) {
|
27919 | sources[_i] = arguments[_i];
|
27920 | }
|
27921 | if (sources.length === 0) {
|
27922 | return _empty__WEBPACK_IMPORTED_MODULE_3__["EMPTY"];
|
27923 | }
|
27924 | var first = sources[0], remainder = sources.slice(1);
|
27925 | if (sources.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_2__["isArray"])(first)) {
|
27926 | return onErrorResumeNext.apply(void 0, first);
|
27927 | }
|
27928 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
27929 | var subNext = function () { return subscriber.add(onErrorResumeNext.apply(void 0, remainder).subscribe(subscriber)); };
|
27930 | return Object(_from__WEBPACK_IMPORTED_MODULE_1__["from"])(first).subscribe({
|
27931 | next: function (value) { subscriber.next(value); },
|
27932 | error: subNext,
|
27933 | complete: subNext,
|
27934 | });
|
27935 | });
|
27936 | }
|
27937 |
|
27938 |
|
27939 |
|
27940 | }),
|
27941 |
|
27942 | (function(module, __webpack_exports__, __webpack_require__) {
|
27943 |
|
27944 | "use strict";
|
27945 | __webpack_require__.r(__webpack_exports__);
|
27946 | __webpack_require__.d(__webpack_exports__, "pairs", function() { return pairs; });
|
27947 | __webpack_require__.d(__webpack_exports__, "dispatch", function() { return dispatch; });
|
27948 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(167);
|
27949 | var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(175);
|
27950 |
|
27951 |
|
27952 |
|
27953 | function pairs(obj, scheduler) {
|
27954 | if (!scheduler) {
|
27955 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
27956 | var keys = Object.keys(obj);
|
27957 | for (var i = 0; i < keys.length && !subscriber.closed; i++) {
|
27958 | var key = keys[i];
|
27959 | if (obj.hasOwnProperty(key)) {
|
27960 | subscriber.next([key, obj[key]]);
|
27961 | }
|
27962 | }
|
27963 | subscriber.complete();
|
27964 | });
|
27965 | }
|
27966 | else {
|
27967 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
27968 | var keys = Object.keys(obj);
|
27969 | var subscription = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
|
27970 | subscription.add(scheduler.schedule(dispatch, 0, { keys: keys, index: 0, subscriber: subscriber, subscription: subscription, obj: obj }));
|
27971 | return subscription;
|
27972 | });
|
27973 | }
|
27974 | }
|
27975 | function dispatch(state) {
|
27976 | var keys = state.keys, index = state.index, subscriber = state.subscriber, subscription = state.subscription, obj = state.obj;
|
27977 | if (!subscriber.closed) {
|
27978 | if (index < keys.length) {
|
27979 | var key = keys[index];
|
27980 | subscriber.next([key, obj[key]]);
|
27981 | subscription.add(this.schedule({ keys: keys, index: index + 1, subscriber: subscriber, subscription: subscription, obj: obj }));
|
27982 | }
|
27983 | else {
|
27984 | subscriber.complete();
|
27985 | }
|
27986 | }
|
27987 | }
|
27988 |
|
27989 |
|
27990 |
|
27991 | }),
|
27992 |
|
27993 | (function(module, __webpack_exports__, __webpack_require__) {
|
27994 |
|
27995 | "use strict";
|
27996 | __webpack_require__.r(__webpack_exports__);
|
27997 | __webpack_require__.d(__webpack_exports__, "partition", function() { return partition; });
|
27998 | var _util_not__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(261);
|
27999 | var _util_subscribeTo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(230);
|
28000 | var _operators_filter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(262);
|
28001 | var _Observable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(167);
|
28002 |
|
28003 |
|
28004 |
|
28005 |
|
28006 |
|
28007 | function partition(source, predicate, thisArg) {
|
28008 | return [
|
28009 | Object(_operators_filter__WEBPACK_IMPORTED_MODULE_2__["filter"])(predicate, thisArg)(new _Observable__WEBPACK_IMPORTED_MODULE_3__["Observable"](Object(_util_subscribeTo__WEBPACK_IMPORTED_MODULE_1__["subscribeTo"])(source))),
|
28010 | Object(_operators_filter__WEBPACK_IMPORTED_MODULE_2__["filter"])(Object(_util_not__WEBPACK_IMPORTED_MODULE_0__["not"])(predicate, thisArg))(new _Observable__WEBPACK_IMPORTED_MODULE_3__["Observable"](Object(_util_subscribeTo__WEBPACK_IMPORTED_MODULE_1__["subscribeTo"])(source)))
|
28011 | ];
|
28012 | }
|
28013 |
|
28014 |
|
28015 |
|
28016 | }),
|
28017 |
|
28018 | (function(module, __webpack_exports__, __webpack_require__) {
|
28019 |
|
28020 | "use strict";
|
28021 | __webpack_require__.r(__webpack_exports__);
|
28022 | __webpack_require__.d(__webpack_exports__, "not", function() { return not; });
|
28023 |
|
28024 | function not(pred, thisArg) {
|
28025 | function notPred() {
|
28026 | return !(notPred.pred.apply(notPred.thisArg, arguments));
|
28027 | }
|
28028 | notPred.pred = pred;
|
28029 | notPred.thisArg = thisArg;
|
28030 | return notPred;
|
28031 | }
|
28032 |
|
28033 |
|
28034 |
|
28035 | }),
|
28036 |
|
28037 | (function(module, __webpack_exports__, __webpack_require__) {
|
28038 |
|
28039 | "use strict";
|
28040 | __webpack_require__.r(__webpack_exports__);
|
28041 | __webpack_require__.d(__webpack_exports__, "filter", function() { return filter; });
|
28042 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
28043 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
28044 |
|
28045 |
|
28046 |
|
28047 | function filter(predicate, thisArg) {
|
28048 | return function filterOperatorFunction(source) {
|
28049 | return source.lift(new FilterOperator(predicate, thisArg));
|
28050 | };
|
28051 | }
|
28052 | var FilterOperator = (function () {
|
28053 | function FilterOperator(predicate, thisArg) {
|
28054 | this.predicate = predicate;
|
28055 | this.thisArg = thisArg;
|
28056 | }
|
28057 | FilterOperator.prototype.call = function (subscriber, source) {
|
28058 | return source.subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg));
|
28059 | };
|
28060 | return FilterOperator;
|
28061 | }());
|
28062 | var FilterSubscriber = (function (_super) {
|
28063 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](FilterSubscriber, _super);
|
28064 | function FilterSubscriber(destination, predicate, thisArg) {
|
28065 | var _this = _super.call(this, destination) || this;
|
28066 | _this.predicate = predicate;
|
28067 | _this.thisArg = thisArg;
|
28068 | _this.count = 0;
|
28069 | return _this;
|
28070 | }
|
28071 | FilterSubscriber.prototype._next = function (value) {
|
28072 | var result;
|
28073 | try {
|
28074 | result = this.predicate.call(this.thisArg, value, this.count++);
|
28075 | }
|
28076 | catch (err) {
|
28077 | this.destination.error(err);
|
28078 | return;
|
28079 | }
|
28080 | if (result) {
|
28081 | this.destination.next(value);
|
28082 | }
|
28083 | };
|
28084 | return FilterSubscriber;
|
28085 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
28086 |
|
28087 |
|
28088 |
|
28089 | }),
|
28090 |
|
28091 | (function(module, __webpack_exports__, __webpack_require__) {
|
28092 |
|
28093 | "use strict";
|
28094 | __webpack_require__.r(__webpack_exports__);
|
28095 | __webpack_require__.d(__webpack_exports__, "race", function() { return race; });
|
28096 | __webpack_require__.d(__webpack_exports__, "RaceOperator", function() { return RaceOperator; });
|
28097 | __webpack_require__.d(__webpack_exports__, "RaceSubscriber", function() { return RaceSubscriber; });
|
28098 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
28099 | var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(176);
|
28100 | var _fromArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(204);
|
28101 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(227);
|
28102 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(228);
|
28103 |
|
28104 |
|
28105 |
|
28106 |
|
28107 |
|
28108 |
|
28109 | function race() {
|
28110 | var observables = [];
|
28111 | for (var _i = 0; _i < arguments.length; _i++) {
|
28112 | observables[_i] = arguments[_i];
|
28113 | }
|
28114 | if (observables.length === 1) {
|
28115 | if (Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(observables[0])) {
|
28116 | observables = observables[0];
|
28117 | }
|
28118 | else {
|
28119 | return observables[0];
|
28120 | }
|
28121 | }
|
28122 | return Object(_fromArray__WEBPACK_IMPORTED_MODULE_2__["fromArray"])(observables, undefined).lift(new RaceOperator());
|
28123 | }
|
28124 | var RaceOperator = (function () {
|
28125 | function RaceOperator() {
|
28126 | }
|
28127 | RaceOperator.prototype.call = function (subscriber, source) {
|
28128 | return source.subscribe(new RaceSubscriber(subscriber));
|
28129 | };
|
28130 | return RaceOperator;
|
28131 | }());
|
28132 |
|
28133 | var RaceSubscriber = (function (_super) {
|
28134 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RaceSubscriber, _super);
|
28135 | function RaceSubscriber(destination) {
|
28136 | var _this = _super.call(this, destination) || this;
|
28137 | _this.hasFirst = false;
|
28138 | _this.observables = [];
|
28139 | _this.subscriptions = [];
|
28140 | return _this;
|
28141 | }
|
28142 | RaceSubscriber.prototype._next = function (observable) {
|
28143 | this.observables.push(observable);
|
28144 | };
|
28145 | RaceSubscriber.prototype._complete = function () {
|
28146 | var observables = this.observables;
|
28147 | var len = observables.length;
|
28148 | if (len === 0) {
|
28149 | this.destination.complete();
|
28150 | }
|
28151 | else {
|
28152 | for (var i = 0; i < len && !this.hasFirst; i++) {
|
28153 | var observable = observables[i];
|
28154 | var subscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(this, observable, observable, i);
|
28155 | if (this.subscriptions) {
|
28156 | this.subscriptions.push(subscription);
|
28157 | }
|
28158 | this.add(subscription);
|
28159 | }
|
28160 | this.observables = null;
|
28161 | }
|
28162 | };
|
28163 | RaceSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
28164 | if (!this.hasFirst) {
|
28165 | this.hasFirst = true;
|
28166 | for (var i = 0; i < this.subscriptions.length; i++) {
|
28167 | if (i !== outerIndex) {
|
28168 | var subscription = this.subscriptions[i];
|
28169 | subscription.unsubscribe();
|
28170 | this.remove(subscription);
|
28171 | }
|
28172 | }
|
28173 | this.subscriptions = null;
|
28174 | }
|
28175 | this.destination.next(innerValue);
|
28176 | };
|
28177 | return RaceSubscriber;
|
28178 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"]));
|
28179 |
|
28180 |
|
28181 |
|
28182 |
|
28183 | }),
|
28184 |
|
28185 | (function(module, __webpack_exports__, __webpack_require__) {
|
28186 |
|
28187 | "use strict";
|
28188 | __webpack_require__.r(__webpack_exports__);
|
28189 | __webpack_require__.d(__webpack_exports__, "range", function() { return range; });
|
28190 | __webpack_require__.d(__webpack_exports__, "dispatch", function() { return dispatch; });
|
28191 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(167);
|
28192 |
|
28193 |
|
28194 | function range(start, count, scheduler) {
|
28195 | if (start === void 0) {
|
28196 | start = 0;
|
28197 | }
|
28198 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
28199 | if (count === undefined) {
|
28200 | count = start;
|
28201 | start = 0;
|
28202 | }
|
28203 | var index = 0;
|
28204 | var current = start;
|
28205 | if (scheduler) {
|
28206 | return scheduler.schedule(dispatch, 0, {
|
28207 | index: index, count: count, start: start, subscriber: subscriber
|
28208 | });
|
28209 | }
|
28210 | else {
|
28211 | do {
|
28212 | if (index++ >= count) {
|
28213 | subscriber.complete();
|
28214 | break;
|
28215 | }
|
28216 | subscriber.next(current++);
|
28217 | if (subscriber.closed) {
|
28218 | break;
|
28219 | }
|
28220 | } while (true);
|
28221 | }
|
28222 | return undefined;
|
28223 | });
|
28224 | }
|
28225 | function dispatch(state) {
|
28226 | var start = state.start, index = state.index, count = state.count, subscriber = state.subscriber;
|
28227 | if (index >= count) {
|
28228 | subscriber.complete();
|
28229 | return;
|
28230 | }
|
28231 | subscriber.next(start);
|
28232 | if (subscriber.closed) {
|
28233 | return;
|
28234 | }
|
28235 | state.index = index + 1;
|
28236 | state.start = start + 1;
|
28237 | this.schedule(state);
|
28238 | }
|
28239 |
|
28240 |
|
28241 |
|
28242 | }),
|
28243 |
|
28244 | (function(module, __webpack_exports__, __webpack_require__) {
|
28245 |
|
28246 | "use strict";
|
28247 | __webpack_require__.r(__webpack_exports__);
|
28248 | __webpack_require__.d(__webpack_exports__, "timer", function() { return timer; });
|
28249 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(167);
|
28250 | var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(213);
|
28251 | var _util_isNumeric__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(255);
|
28252 | var _util_isScheduler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(203);
|
28253 |
|
28254 |
|
28255 |
|
28256 |
|
28257 |
|
28258 | function timer(dueTime, periodOrScheduler, scheduler) {
|
28259 | if (dueTime === void 0) {
|
28260 | dueTime = 0;
|
28261 | }
|
28262 | var period = -1;
|
28263 | if (Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_2__["isNumeric"])(periodOrScheduler)) {
|
28264 | period = Number(periodOrScheduler) < 1 && 1 || Number(periodOrScheduler);
|
28265 | }
|
28266 | else if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_3__["isScheduler"])(periodOrScheduler)) {
|
28267 | scheduler = periodOrScheduler;
|
28268 | }
|
28269 | if (!Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_3__["isScheduler"])(scheduler)) {
|
28270 | scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"];
|
28271 | }
|
28272 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
28273 | var due = Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_2__["isNumeric"])(dueTime)
|
28274 | ? dueTime
|
28275 | : (+dueTime - scheduler.now());
|
28276 | return scheduler.schedule(dispatch, due, {
|
28277 | index: 0, period: period, subscriber: subscriber
|
28278 | });
|
28279 | });
|
28280 | }
|
28281 | function dispatch(state) {
|
28282 | var index = state.index, period = state.period, subscriber = state.subscriber;
|
28283 | subscriber.next(index);
|
28284 | if (subscriber.closed) {
|
28285 | return;
|
28286 | }
|
28287 | else if (period === -1) {
|
28288 | return subscriber.complete();
|
28289 | }
|
28290 | state.index = index + 1;
|
28291 | this.schedule(state, period);
|
28292 | }
|
28293 |
|
28294 |
|
28295 |
|
28296 | }),
|
28297 |
|
28298 | (function(module, __webpack_exports__, __webpack_require__) {
|
28299 |
|
28300 | "use strict";
|
28301 | __webpack_require__.r(__webpack_exports__);
|
28302 | __webpack_require__.d(__webpack_exports__, "using", function() { return using; });
|
28303 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(167);
|
28304 | var _from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(241);
|
28305 | var _empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(201);
|
28306 |
|
28307 |
|
28308 |
|
28309 |
|
28310 | function using(resourceFactory, observableFactory) {
|
28311 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
28312 | var resource;
|
28313 | try {
|
28314 | resource = resourceFactory();
|
28315 | }
|
28316 | catch (err) {
|
28317 | subscriber.error(err);
|
28318 | return undefined;
|
28319 | }
|
28320 | var result;
|
28321 | try {
|
28322 | result = observableFactory(resource);
|
28323 | }
|
28324 | catch (err) {
|
28325 | subscriber.error(err);
|
28326 | return undefined;
|
28327 | }
|
28328 | var source = result ? Object(_from__WEBPACK_IMPORTED_MODULE_1__["from"])(result) : _empty__WEBPACK_IMPORTED_MODULE_2__["EMPTY"];
|
28329 | var subscription = source.subscribe(subscriber);
|
28330 | return function () {
|
28331 | subscription.unsubscribe();
|
28332 | if (resource) {
|
28333 | resource.unsubscribe();
|
28334 | }
|
28335 | };
|
28336 | });
|
28337 | }
|
28338 |
|
28339 |
|
28340 |
|
28341 | }),
|
28342 |
|
28343 | (function(module, __webpack_exports__, __webpack_require__) {
|
28344 |
|
28345 | "use strict";
|
28346 | __webpack_require__.r(__webpack_exports__);
|
28347 | __webpack_require__.d(__webpack_exports__, "zip", function() { return zip; });
|
28348 | __webpack_require__.d(__webpack_exports__, "ZipOperator", function() { return ZipOperator; });
|
28349 | __webpack_require__.d(__webpack_exports__, "ZipSubscriber", function() { return ZipSubscriber; });
|
28350 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
28351 | var _fromArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(204);
|
28352 | var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(176);
|
28353 | var _Subscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(169);
|
28354 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(227);
|
28355 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(228);
|
28356 | var _internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(233);
|
28357 |
|
28358 |
|
28359 |
|
28360 |
|
28361 |
|
28362 |
|
28363 |
|
28364 |
|
28365 | function zip() {
|
28366 | var observables = [];
|
28367 | for (var _i = 0; _i < arguments.length; _i++) {
|
28368 | observables[_i] = arguments[_i];
|
28369 | }
|
28370 | var resultSelector = observables[observables.length - 1];
|
28371 | if (typeof resultSelector === 'function') {
|
28372 | observables.pop();
|
28373 | }
|
28374 | return Object(_fromArray__WEBPACK_IMPORTED_MODULE_1__["fromArray"])(observables, undefined).lift(new ZipOperator(resultSelector));
|
28375 | }
|
28376 | var ZipOperator = (function () {
|
28377 | function ZipOperator(resultSelector) {
|
28378 | this.resultSelector = resultSelector;
|
28379 | }
|
28380 | ZipOperator.prototype.call = function (subscriber, source) {
|
28381 | return source.subscribe(new ZipSubscriber(subscriber, this.resultSelector));
|
28382 | };
|
28383 | return ZipOperator;
|
28384 | }());
|
28385 |
|
28386 | var ZipSubscriber = (function (_super) {
|
28387 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ZipSubscriber, _super);
|
28388 | function ZipSubscriber(destination, resultSelector, values) {
|
28389 | if (values === void 0) {
|
28390 | values = Object.create(null);
|
28391 | }
|
28392 | var _this = _super.call(this, destination) || this;
|
28393 | _this.iterators = [];
|
28394 | _this.active = 0;
|
28395 | _this.resultSelector = (typeof resultSelector === 'function') ? resultSelector : null;
|
28396 | _this.values = values;
|
28397 | return _this;
|
28398 | }
|
28399 | ZipSubscriber.prototype._next = function (value) {
|
28400 | var iterators = this.iterators;
|
28401 | if (Object(_util_isArray__WEBPACK_IMPORTED_MODULE_2__["isArray"])(value)) {
|
28402 | iterators.push(new StaticArrayIterator(value));
|
28403 | }
|
28404 | else if (typeof value[_internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_6__["iterator"]] === 'function') {
|
28405 | iterators.push(new StaticIterator(value[_internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_6__["iterator"]]()));
|
28406 | }
|
28407 | else {
|
28408 | iterators.push(new ZipBufferIterator(this.destination, this, value));
|
28409 | }
|
28410 | };
|
28411 | ZipSubscriber.prototype._complete = function () {
|
28412 | var iterators = this.iterators;
|
28413 | var len = iterators.length;
|
28414 | this.unsubscribe();
|
28415 | if (len === 0) {
|
28416 | this.destination.complete();
|
28417 | return;
|
28418 | }
|
28419 | this.active = len;
|
28420 | for (var i = 0; i < len; i++) {
|
28421 | var iterator = iterators[i];
|
28422 | if (iterator.stillUnsubscribed) {
|
28423 | var destination = this.destination;
|
28424 | destination.add(iterator.subscribe(iterator, i));
|
28425 | }
|
28426 | else {
|
28427 | this.active--;
|
28428 | }
|
28429 | }
|
28430 | };
|
28431 | ZipSubscriber.prototype.notifyInactive = function () {
|
28432 | this.active--;
|
28433 | if (this.active === 0) {
|
28434 | this.destination.complete();
|
28435 | }
|
28436 | };
|
28437 | ZipSubscriber.prototype.checkIterators = function () {
|
28438 | var iterators = this.iterators;
|
28439 | var len = iterators.length;
|
28440 | var destination = this.destination;
|
28441 | for (var i = 0; i < len; i++) {
|
28442 | var iterator = iterators[i];
|
28443 | if (typeof iterator.hasValue === 'function' && !iterator.hasValue()) {
|
28444 | return;
|
28445 | }
|
28446 | }
|
28447 | var shouldComplete = false;
|
28448 | var args = [];
|
28449 | for (var i = 0; i < len; i++) {
|
28450 | var iterator = iterators[i];
|
28451 | var result = iterator.next();
|
28452 | if (iterator.hasCompleted()) {
|
28453 | shouldComplete = true;
|
28454 | }
|
28455 | if (result.done) {
|
28456 | destination.complete();
|
28457 | return;
|
28458 | }
|
28459 | args.push(result.value);
|
28460 | }
|
28461 | if (this.resultSelector) {
|
28462 | this._tryresultSelector(args);
|
28463 | }
|
28464 | else {
|
28465 | destination.next(args);
|
28466 | }
|
28467 | if (shouldComplete) {
|
28468 | destination.complete();
|
28469 | }
|
28470 | };
|
28471 | ZipSubscriber.prototype._tryresultSelector = function (args) {
|
28472 | var result;
|
28473 | try {
|
28474 | result = this.resultSelector.apply(this, args);
|
28475 | }
|
28476 | catch (err) {
|
28477 | this.destination.error(err);
|
28478 | return;
|
28479 | }
|
28480 | this.destination.next(result);
|
28481 | };
|
28482 | return ZipSubscriber;
|
28483 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_3__["Subscriber"]));
|
28484 |
|
28485 | var StaticIterator = (function () {
|
28486 | function StaticIterator(iterator) {
|
28487 | this.iterator = iterator;
|
28488 | this.nextResult = iterator.next();
|
28489 | }
|
28490 | StaticIterator.prototype.hasValue = function () {
|
28491 | return true;
|
28492 | };
|
28493 | StaticIterator.prototype.next = function () {
|
28494 | var result = this.nextResult;
|
28495 | this.nextResult = this.iterator.next();
|
28496 | return result;
|
28497 | };
|
28498 | StaticIterator.prototype.hasCompleted = function () {
|
28499 | var nextResult = this.nextResult;
|
28500 | return nextResult && nextResult.done;
|
28501 | };
|
28502 | return StaticIterator;
|
28503 | }());
|
28504 | var StaticArrayIterator = (function () {
|
28505 | function StaticArrayIterator(array) {
|
28506 | this.array = array;
|
28507 | this.index = 0;
|
28508 | this.length = 0;
|
28509 | this.length = array.length;
|
28510 | }
|
28511 | StaticArrayIterator.prototype[_internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_6__["iterator"]] = function () {
|
28512 | return this;
|
28513 | };
|
28514 | StaticArrayIterator.prototype.next = function (value) {
|
28515 | var i = this.index++;
|
28516 | var array = this.array;
|
28517 | return i < this.length ? { value: array[i], done: false } : { value: null, done: true };
|
28518 | };
|
28519 | StaticArrayIterator.prototype.hasValue = function () {
|
28520 | return this.array.length > this.index;
|
28521 | };
|
28522 | StaticArrayIterator.prototype.hasCompleted = function () {
|
28523 | return this.array.length === this.index;
|
28524 | };
|
28525 | return StaticArrayIterator;
|
28526 | }());
|
28527 | var ZipBufferIterator = (function (_super) {
|
28528 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ZipBufferIterator, _super);
|
28529 | function ZipBufferIterator(destination, parent, observable) {
|
28530 | var _this = _super.call(this, destination) || this;
|
28531 | _this.parent = parent;
|
28532 | _this.observable = observable;
|
28533 | _this.stillUnsubscribed = true;
|
28534 | _this.buffer = [];
|
28535 | _this.isComplete = false;
|
28536 | return _this;
|
28537 | }
|
28538 | ZipBufferIterator.prototype[_internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_6__["iterator"]] = function () {
|
28539 | return this;
|
28540 | };
|
28541 | ZipBufferIterator.prototype.next = function () {
|
28542 | var buffer = this.buffer;
|
28543 | if (buffer.length === 0 && this.isComplete) {
|
28544 | return { value: null, done: true };
|
28545 | }
|
28546 | else {
|
28547 | return { value: buffer.shift(), done: false };
|
28548 | }
|
28549 | };
|
28550 | ZipBufferIterator.prototype.hasValue = function () {
|
28551 | return this.buffer.length > 0;
|
28552 | };
|
28553 | ZipBufferIterator.prototype.hasCompleted = function () {
|
28554 | return this.buffer.length === 0 && this.isComplete;
|
28555 | };
|
28556 | ZipBufferIterator.prototype.notifyComplete = function () {
|
28557 | if (this.buffer.length > 0) {
|
28558 | this.isComplete = true;
|
28559 | this.parent.notifyInactive();
|
28560 | }
|
28561 | else {
|
28562 | this.destination.complete();
|
28563 | }
|
28564 | };
|
28565 | ZipBufferIterator.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
28566 | this.buffer.push(innerValue);
|
28567 | this.parent.checkIterators();
|
28568 | };
|
28569 | ZipBufferIterator.prototype.subscribe = function (value, index) {
|
28570 | return Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__["subscribeToResult"])(this, this.observable, this, index);
|
28571 | };
|
28572 | return ZipBufferIterator;
|
28573 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__["OuterSubscriber"]));
|
28574 |
|
28575 |
|
28576 |
|
28577 | }),
|
28578 | ,
|
28579 |
|
28580 | (function(module, __webpack_exports__, __webpack_require__) {
|
28581 |
|
28582 | "use strict";
|
28583 | __webpack_require__.r(__webpack_exports__);
|
28584 | var _internal_operators_audit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(270);
|
28585 | __webpack_require__.d(__webpack_exports__, "audit", function() { return _internal_operators_audit__WEBPACK_IMPORTED_MODULE_0__["audit"]; });
|
28586 |
|
28587 | var _internal_operators_auditTime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(271);
|
28588 | __webpack_require__.d(__webpack_exports__, "auditTime", function() { return _internal_operators_auditTime__WEBPACK_IMPORTED_MODULE_1__["auditTime"]; });
|
28589 |
|
28590 | var _internal_operators_buffer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(272);
|
28591 | __webpack_require__.d(__webpack_exports__, "buffer", function() { return _internal_operators_buffer__WEBPACK_IMPORTED_MODULE_2__["buffer"]; });
|
28592 |
|
28593 | var _internal_operators_bufferCount__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(273);
|
28594 | __webpack_require__.d(__webpack_exports__, "bufferCount", function() { return _internal_operators_bufferCount__WEBPACK_IMPORTED_MODULE_3__["bufferCount"]; });
|
28595 |
|
28596 | var _internal_operators_bufferTime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(274);
|
28597 | __webpack_require__.d(__webpack_exports__, "bufferTime", function() { return _internal_operators_bufferTime__WEBPACK_IMPORTED_MODULE_4__["bufferTime"]; });
|
28598 |
|
28599 | var _internal_operators_bufferToggle__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(275);
|
28600 | __webpack_require__.d(__webpack_exports__, "bufferToggle", function() { return _internal_operators_bufferToggle__WEBPACK_IMPORTED_MODULE_5__["bufferToggle"]; });
|
28601 |
|
28602 | var _internal_operators_bufferWhen__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(276);
|
28603 | __webpack_require__.d(__webpack_exports__, "bufferWhen", function() { return _internal_operators_bufferWhen__WEBPACK_IMPORTED_MODULE_6__["bufferWhen"]; });
|
28604 |
|
28605 | var _internal_operators_catchError__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(277);
|
28606 | __webpack_require__.d(__webpack_exports__, "catchError", function() { return _internal_operators_catchError__WEBPACK_IMPORTED_MODULE_7__["catchError"]; });
|
28607 |
|
28608 | var _internal_operators_combineAll__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(278);
|
28609 | __webpack_require__.d(__webpack_exports__, "combineAll", function() { return _internal_operators_combineAll__WEBPACK_IMPORTED_MODULE_8__["combineAll"]; });
|
28610 |
|
28611 | var _internal_operators_combineLatest__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(279);
|
28612 | __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return _internal_operators_combineLatest__WEBPACK_IMPORTED_MODULE_9__["combineLatest"]; });
|
28613 |
|
28614 | var _internal_operators_concat__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(280);
|
28615 | __webpack_require__.d(__webpack_exports__, "concat", function() { return _internal_operators_concat__WEBPACK_IMPORTED_MODULE_10__["concat"]; });
|
28616 |
|
28617 | var _internal_operators_concatAll__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(238);
|
28618 | __webpack_require__.d(__webpack_exports__, "concatAll", function() { return _internal_operators_concatAll__WEBPACK_IMPORTED_MODULE_11__["concatAll"]; });
|
28619 |
|
28620 | var _internal_operators_concatMap__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(281);
|
28621 | __webpack_require__.d(__webpack_exports__, "concatMap", function() { return _internal_operators_concatMap__WEBPACK_IMPORTED_MODULE_12__["concatMap"]; });
|
28622 |
|
28623 | var _internal_operators_concatMapTo__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(282);
|
28624 | __webpack_require__.d(__webpack_exports__, "concatMapTo", function() { return _internal_operators_concatMapTo__WEBPACK_IMPORTED_MODULE_13__["concatMapTo"]; });
|
28625 |
|
28626 | var _internal_operators_count__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(283);
|
28627 | __webpack_require__.d(__webpack_exports__, "count", function() { return _internal_operators_count__WEBPACK_IMPORTED_MODULE_14__["count"]; });
|
28628 |
|
28629 | var _internal_operators_debounce__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(284);
|
28630 | __webpack_require__.d(__webpack_exports__, "debounce", function() { return _internal_operators_debounce__WEBPACK_IMPORTED_MODULE_15__["debounce"]; });
|
28631 |
|
28632 | var _internal_operators_debounceTime__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(285);
|
28633 | __webpack_require__.d(__webpack_exports__, "debounceTime", function() { return _internal_operators_debounceTime__WEBPACK_IMPORTED_MODULE_16__["debounceTime"]; });
|
28634 |
|
28635 | var _internal_operators_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(286);
|
28636 | __webpack_require__.d(__webpack_exports__, "defaultIfEmpty", function() { return _internal_operators_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_17__["defaultIfEmpty"]; });
|
28637 |
|
28638 | var _internal_operators_delay__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(287);
|
28639 | __webpack_require__.d(__webpack_exports__, "delay", function() { return _internal_operators_delay__WEBPACK_IMPORTED_MODULE_18__["delay"]; });
|
28640 |
|
28641 | var _internal_operators_delayWhen__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(289);
|
28642 | __webpack_require__.d(__webpack_exports__, "delayWhen", function() { return _internal_operators_delayWhen__WEBPACK_IMPORTED_MODULE_19__["delayWhen"]; });
|
28643 |
|
28644 | var _internal_operators_dematerialize__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(290);
|
28645 | __webpack_require__.d(__webpack_exports__, "dematerialize", function() { return _internal_operators_dematerialize__WEBPACK_IMPORTED_MODULE_20__["dematerialize"]; });
|
28646 |
|
28647 | var _internal_operators_distinct__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(291);
|
28648 | __webpack_require__.d(__webpack_exports__, "distinct", function() { return _internal_operators_distinct__WEBPACK_IMPORTED_MODULE_21__["distinct"]; });
|
28649 |
|
28650 | var _internal_operators_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(292);
|
28651 | __webpack_require__.d(__webpack_exports__, "distinctUntilChanged", function() { return _internal_operators_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_22__["distinctUntilChanged"]; });
|
28652 |
|
28653 | var _internal_operators_distinctUntilKeyChanged__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(293);
|
28654 | __webpack_require__.d(__webpack_exports__, "distinctUntilKeyChanged", function() { return _internal_operators_distinctUntilKeyChanged__WEBPACK_IMPORTED_MODULE_23__["distinctUntilKeyChanged"]; });
|
28655 |
|
28656 | var _internal_operators_elementAt__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(294);
|
28657 | __webpack_require__.d(__webpack_exports__, "elementAt", function() { return _internal_operators_elementAt__WEBPACK_IMPORTED_MODULE_24__["elementAt"]; });
|
28658 |
|
28659 | var _internal_operators_endWith__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(297);
|
28660 | __webpack_require__.d(__webpack_exports__, "endWith", function() { return _internal_operators_endWith__WEBPACK_IMPORTED_MODULE_25__["endWith"]; });
|
28661 |
|
28662 | var _internal_operators_every__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(298);
|
28663 | __webpack_require__.d(__webpack_exports__, "every", function() { return _internal_operators_every__WEBPACK_IMPORTED_MODULE_26__["every"]; });
|
28664 |
|
28665 | var _internal_operators_exhaust__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(299);
|
28666 | __webpack_require__.d(__webpack_exports__, "exhaust", function() { return _internal_operators_exhaust__WEBPACK_IMPORTED_MODULE_27__["exhaust"]; });
|
28667 |
|
28668 | var _internal_operators_exhaustMap__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(300);
|
28669 | __webpack_require__.d(__webpack_exports__, "exhaustMap", function() { return _internal_operators_exhaustMap__WEBPACK_IMPORTED_MODULE_28__["exhaustMap"]; });
|
28670 |
|
28671 | var _internal_operators_expand__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(301);
|
28672 | __webpack_require__.d(__webpack_exports__, "expand", function() { return _internal_operators_expand__WEBPACK_IMPORTED_MODULE_29__["expand"]; });
|
28673 |
|
28674 | var _internal_operators_filter__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(262);
|
28675 | __webpack_require__.d(__webpack_exports__, "filter", function() { return _internal_operators_filter__WEBPACK_IMPORTED_MODULE_30__["filter"]; });
|
28676 |
|
28677 | var _internal_operators_finalize__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(302);
|
28678 | __webpack_require__.d(__webpack_exports__, "finalize", function() { return _internal_operators_finalize__WEBPACK_IMPORTED_MODULE_31__["finalize"]; });
|
28679 |
|
28680 | var _internal_operators_find__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(303);
|
28681 | __webpack_require__.d(__webpack_exports__, "find", function() { return _internal_operators_find__WEBPACK_IMPORTED_MODULE_32__["find"]; });
|
28682 |
|
28683 | var _internal_operators_findIndex__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(304);
|
28684 | __webpack_require__.d(__webpack_exports__, "findIndex", function() { return _internal_operators_findIndex__WEBPACK_IMPORTED_MODULE_33__["findIndex"]; });
|
28685 |
|
28686 | var _internal_operators_first__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(305);
|
28687 | __webpack_require__.d(__webpack_exports__, "first", function() { return _internal_operators_first__WEBPACK_IMPORTED_MODULE_34__["first"]; });
|
28688 |
|
28689 | var _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(189);
|
28690 | __webpack_require__.d(__webpack_exports__, "groupBy", function() { return _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_35__["groupBy"]; });
|
28691 |
|
28692 | var _internal_operators_ignoreElements__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(306);
|
28693 | __webpack_require__.d(__webpack_exports__, "ignoreElements", function() { return _internal_operators_ignoreElements__WEBPACK_IMPORTED_MODULE_36__["ignoreElements"]; });
|
28694 |
|
28695 | var _internal_operators_isEmpty__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(307);
|
28696 | __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return _internal_operators_isEmpty__WEBPACK_IMPORTED_MODULE_37__["isEmpty"]; });
|
28697 |
|
28698 | var _internal_operators_last__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(308);
|
28699 | __webpack_require__.d(__webpack_exports__, "last", function() { return _internal_operators_last__WEBPACK_IMPORTED_MODULE_38__["last"]; });
|
28700 |
|
28701 | var _internal_operators_map__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(224);
|
28702 | __webpack_require__.d(__webpack_exports__, "map", function() { return _internal_operators_map__WEBPACK_IMPORTED_MODULE_39__["map"]; });
|
28703 |
|
28704 | var _internal_operators_mapTo__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(310);
|
28705 | __webpack_require__.d(__webpack_exports__, "mapTo", function() { return _internal_operators_mapTo__WEBPACK_IMPORTED_MODULE_40__["mapTo"]; });
|
28706 |
|
28707 | var _internal_operators_materialize__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(311);
|
28708 | __webpack_require__.d(__webpack_exports__, "materialize", function() { return _internal_operators_materialize__WEBPACK_IMPORTED_MODULE_41__["materialize"]; });
|
28709 |
|
28710 | var _internal_operators_max__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(312);
|
28711 | __webpack_require__.d(__webpack_exports__, "max", function() { return _internal_operators_max__WEBPACK_IMPORTED_MODULE_42__["max"]; });
|
28712 |
|
28713 | var _internal_operators_merge__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(315);
|
28714 | __webpack_require__.d(__webpack_exports__, "merge", function() { return _internal_operators_merge__WEBPACK_IMPORTED_MODULE_43__["merge"]; });
|
28715 |
|
28716 | var _internal_operators_mergeAll__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(239);
|
28717 | __webpack_require__.d(__webpack_exports__, "mergeAll", function() { return _internal_operators_mergeAll__WEBPACK_IMPORTED_MODULE_44__["mergeAll"]; });
|
28718 |
|
28719 | var _internal_operators_mergeMap__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(240);
|
28720 | __webpack_require__.d(__webpack_exports__, "mergeMap", function() { return _internal_operators_mergeMap__WEBPACK_IMPORTED_MODULE_45__["mergeMap"]; });
|
28721 |
|
28722 | __webpack_require__.d(__webpack_exports__, "flatMap", function() { return _internal_operators_mergeMap__WEBPACK_IMPORTED_MODULE_45__["mergeMap"]; });
|
28723 |
|
28724 | var _internal_operators_mergeMapTo__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(316);
|
28725 | __webpack_require__.d(__webpack_exports__, "mergeMapTo", function() { return _internal_operators_mergeMapTo__WEBPACK_IMPORTED_MODULE_46__["mergeMapTo"]; });
|
28726 |
|
28727 | var _internal_operators_mergeScan__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(317);
|
28728 | __webpack_require__.d(__webpack_exports__, "mergeScan", function() { return _internal_operators_mergeScan__WEBPACK_IMPORTED_MODULE_47__["mergeScan"]; });
|
28729 |
|
28730 | var _internal_operators_min__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(318);
|
28731 | __webpack_require__.d(__webpack_exports__, "min", function() { return _internal_operators_min__WEBPACK_IMPORTED_MODULE_48__["min"]; });
|
28732 |
|
28733 | var _internal_operators_multicast__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(319);
|
28734 | __webpack_require__.d(__webpack_exports__, "multicast", function() { return _internal_operators_multicast__WEBPACK_IMPORTED_MODULE_49__["multicast"]; });
|
28735 |
|
28736 | var _internal_operators_observeOn__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(199);
|
28737 | __webpack_require__.d(__webpack_exports__, "observeOn", function() { return _internal_operators_observeOn__WEBPACK_IMPORTED_MODULE_50__["observeOn"]; });
|
28738 |
|
28739 | var _internal_operators_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(320);
|
28740 | __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return _internal_operators_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_51__["onErrorResumeNext"]; });
|
28741 |
|
28742 | var _internal_operators_pairwise__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(321);
|
28743 | __webpack_require__.d(__webpack_exports__, "pairwise", function() { return _internal_operators_pairwise__WEBPACK_IMPORTED_MODULE_52__["pairwise"]; });
|
28744 |
|
28745 | var _internal_operators_partition__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(322);
|
28746 | __webpack_require__.d(__webpack_exports__, "partition", function() { return _internal_operators_partition__WEBPACK_IMPORTED_MODULE_53__["partition"]; });
|
28747 |
|
28748 | var _internal_operators_pluck__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(323);
|
28749 | __webpack_require__.d(__webpack_exports__, "pluck", function() { return _internal_operators_pluck__WEBPACK_IMPORTED_MODULE_54__["pluck"]; });
|
28750 |
|
28751 | var _internal_operators_publish__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(324);
|
28752 | __webpack_require__.d(__webpack_exports__, "publish", function() { return _internal_operators_publish__WEBPACK_IMPORTED_MODULE_55__["publish"]; });
|
28753 |
|
28754 | var _internal_operators_publishBehavior__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(325);
|
28755 | __webpack_require__.d(__webpack_exports__, "publishBehavior", function() { return _internal_operators_publishBehavior__WEBPACK_IMPORTED_MODULE_56__["publishBehavior"]; });
|
28756 |
|
28757 | var _internal_operators_publishLast__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(326);
|
28758 | __webpack_require__.d(__webpack_exports__, "publishLast", function() { return _internal_operators_publishLast__WEBPACK_IMPORTED_MODULE_57__["publishLast"]; });
|
28759 |
|
28760 | var _internal_operators_publishReplay__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(327);
|
28761 | __webpack_require__.d(__webpack_exports__, "publishReplay", function() { return _internal_operators_publishReplay__WEBPACK_IMPORTED_MODULE_58__["publishReplay"]; });
|
28762 |
|
28763 | var _internal_operators_race__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(328);
|
28764 | __webpack_require__.d(__webpack_exports__, "race", function() { return _internal_operators_race__WEBPACK_IMPORTED_MODULE_59__["race"]; });
|
28765 |
|
28766 | var _internal_operators_reduce__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(313);
|
28767 | __webpack_require__.d(__webpack_exports__, "reduce", function() { return _internal_operators_reduce__WEBPACK_IMPORTED_MODULE_60__["reduce"]; });
|
28768 |
|
28769 | var _internal_operators_repeat__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(329);
|
28770 | __webpack_require__.d(__webpack_exports__, "repeat", function() { return _internal_operators_repeat__WEBPACK_IMPORTED_MODULE_61__["repeat"]; });
|
28771 |
|
28772 | var _internal_operators_repeatWhen__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(330);
|
28773 | __webpack_require__.d(__webpack_exports__, "repeatWhen", function() { return _internal_operators_repeatWhen__WEBPACK_IMPORTED_MODULE_62__["repeatWhen"]; });
|
28774 |
|
28775 | var _internal_operators_retry__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(331);
|
28776 | __webpack_require__.d(__webpack_exports__, "retry", function() { return _internal_operators_retry__WEBPACK_IMPORTED_MODULE_63__["retry"]; });
|
28777 |
|
28778 | var _internal_operators_retryWhen__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(332);
|
28779 | __webpack_require__.d(__webpack_exports__, "retryWhen", function() { return _internal_operators_retryWhen__WEBPACK_IMPORTED_MODULE_64__["retryWhen"]; });
|
28780 |
|
28781 | var _internal_operators_refCount__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(188);
|
28782 | __webpack_require__.d(__webpack_exports__, "refCount", function() { return _internal_operators_refCount__WEBPACK_IMPORTED_MODULE_65__["refCount"]; });
|
28783 |
|
28784 | var _internal_operators_sample__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(333);
|
28785 | __webpack_require__.d(__webpack_exports__, "sample", function() { return _internal_operators_sample__WEBPACK_IMPORTED_MODULE_66__["sample"]; });
|
28786 |
|
28787 | var _internal_operators_sampleTime__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(334);
|
28788 | __webpack_require__.d(__webpack_exports__, "sampleTime", function() { return _internal_operators_sampleTime__WEBPACK_IMPORTED_MODULE_67__["sampleTime"]; });
|
28789 |
|
28790 | var _internal_operators_scan__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(314);
|
28791 | __webpack_require__.d(__webpack_exports__, "scan", function() { return _internal_operators_scan__WEBPACK_IMPORTED_MODULE_68__["scan"]; });
|
28792 |
|
28793 | var _internal_operators_sequenceEqual__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(335);
|
28794 | __webpack_require__.d(__webpack_exports__, "sequenceEqual", function() { return _internal_operators_sequenceEqual__WEBPACK_IMPORTED_MODULE_69__["sequenceEqual"]; });
|
28795 |
|
28796 | var _internal_operators_share__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(336);
|
28797 | __webpack_require__.d(__webpack_exports__, "share", function() { return _internal_operators_share__WEBPACK_IMPORTED_MODULE_70__["share"]; });
|
28798 |
|
28799 | var _internal_operators_shareReplay__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(337);
|
28800 | __webpack_require__.d(__webpack_exports__, "shareReplay", function() { return _internal_operators_shareReplay__WEBPACK_IMPORTED_MODULE_71__["shareReplay"]; });
|
28801 |
|
28802 | var _internal_operators_single__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(338);
|
28803 | __webpack_require__.d(__webpack_exports__, "single", function() { return _internal_operators_single__WEBPACK_IMPORTED_MODULE_72__["single"]; });
|
28804 |
|
28805 | var _internal_operators_skip__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(339);
|
28806 | __webpack_require__.d(__webpack_exports__, "skip", function() { return _internal_operators_skip__WEBPACK_IMPORTED_MODULE_73__["skip"]; });
|
28807 |
|
28808 | var _internal_operators_skipLast__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(340);
|
28809 | __webpack_require__.d(__webpack_exports__, "skipLast", function() { return _internal_operators_skipLast__WEBPACK_IMPORTED_MODULE_74__["skipLast"]; });
|
28810 |
|
28811 | var _internal_operators_skipUntil__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(341);
|
28812 | __webpack_require__.d(__webpack_exports__, "skipUntil", function() { return _internal_operators_skipUntil__WEBPACK_IMPORTED_MODULE_75__["skipUntil"]; });
|
28813 |
|
28814 | var _internal_operators_skipWhile__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(342);
|
28815 | __webpack_require__.d(__webpack_exports__, "skipWhile", function() { return _internal_operators_skipWhile__WEBPACK_IMPORTED_MODULE_76__["skipWhile"]; });
|
28816 |
|
28817 | var _internal_operators_startWith__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(343);
|
28818 | __webpack_require__.d(__webpack_exports__, "startWith", function() { return _internal_operators_startWith__WEBPACK_IMPORTED_MODULE_77__["startWith"]; });
|
28819 |
|
28820 | var _internal_operators_subscribeOn__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(344);
|
28821 | __webpack_require__.d(__webpack_exports__, "subscribeOn", function() { return _internal_operators_subscribeOn__WEBPACK_IMPORTED_MODULE_78__["subscribeOn"]; });
|
28822 |
|
28823 | var _internal_operators_switchAll__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(346);
|
28824 | __webpack_require__.d(__webpack_exports__, "switchAll", function() { return _internal_operators_switchAll__WEBPACK_IMPORTED_MODULE_79__["switchAll"]; });
|
28825 |
|
28826 | var _internal_operators_switchMap__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(347);
|
28827 | __webpack_require__.d(__webpack_exports__, "switchMap", function() { return _internal_operators_switchMap__WEBPACK_IMPORTED_MODULE_80__["switchMap"]; });
|
28828 |
|
28829 | var _internal_operators_switchMapTo__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(348);
|
28830 | __webpack_require__.d(__webpack_exports__, "switchMapTo", function() { return _internal_operators_switchMapTo__WEBPACK_IMPORTED_MODULE_81__["switchMapTo"]; });
|
28831 |
|
28832 | var _internal_operators_take__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(296);
|
28833 | __webpack_require__.d(__webpack_exports__, "take", function() { return _internal_operators_take__WEBPACK_IMPORTED_MODULE_82__["take"]; });
|
28834 |
|
28835 | var _internal_operators_takeLast__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(309);
|
28836 | __webpack_require__.d(__webpack_exports__, "takeLast", function() { return _internal_operators_takeLast__WEBPACK_IMPORTED_MODULE_83__["takeLast"]; });
|
28837 |
|
28838 | var _internal_operators_takeUntil__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(349);
|
28839 | __webpack_require__.d(__webpack_exports__, "takeUntil", function() { return _internal_operators_takeUntil__WEBPACK_IMPORTED_MODULE_84__["takeUntil"]; });
|
28840 |
|
28841 | var _internal_operators_takeWhile__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(350);
|
28842 | __webpack_require__.d(__webpack_exports__, "takeWhile", function() { return _internal_operators_takeWhile__WEBPACK_IMPORTED_MODULE_85__["takeWhile"]; });
|
28843 |
|
28844 | var _internal_operators_tap__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(351);
|
28845 | __webpack_require__.d(__webpack_exports__, "tap", function() { return _internal_operators_tap__WEBPACK_IMPORTED_MODULE_86__["tap"]; });
|
28846 |
|
28847 | var _internal_operators_throttle__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(352);
|
28848 | __webpack_require__.d(__webpack_exports__, "throttle", function() { return _internal_operators_throttle__WEBPACK_IMPORTED_MODULE_87__["throttle"]; });
|
28849 |
|
28850 | var _internal_operators_throttleTime__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(353);
|
28851 | __webpack_require__.d(__webpack_exports__, "throttleTime", function() { return _internal_operators_throttleTime__WEBPACK_IMPORTED_MODULE_88__["throttleTime"]; });
|
28852 |
|
28853 | var _internal_operators_throwIfEmpty__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(295);
|
28854 | __webpack_require__.d(__webpack_exports__, "throwIfEmpty", function() { return _internal_operators_throwIfEmpty__WEBPACK_IMPORTED_MODULE_89__["throwIfEmpty"]; });
|
28855 |
|
28856 | var _internal_operators_timeInterval__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(354);
|
28857 | __webpack_require__.d(__webpack_exports__, "timeInterval", function() { return _internal_operators_timeInterval__WEBPACK_IMPORTED_MODULE_90__["timeInterval"]; });
|
28858 |
|
28859 | var _internal_operators_timeout__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(355);
|
28860 | __webpack_require__.d(__webpack_exports__, "timeout", function() { return _internal_operators_timeout__WEBPACK_IMPORTED_MODULE_91__["timeout"]; });
|
28861 |
|
28862 | var _internal_operators_timeoutWith__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(356);
|
28863 | __webpack_require__.d(__webpack_exports__, "timeoutWith", function() { return _internal_operators_timeoutWith__WEBPACK_IMPORTED_MODULE_92__["timeoutWith"]; });
|
28864 |
|
28865 | var _internal_operators_timestamp__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(357);
|
28866 | __webpack_require__.d(__webpack_exports__, "timestamp", function() { return _internal_operators_timestamp__WEBPACK_IMPORTED_MODULE_93__["timestamp"]; });
|
28867 |
|
28868 | var _internal_operators_toArray__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(358);
|
28869 | __webpack_require__.d(__webpack_exports__, "toArray", function() { return _internal_operators_toArray__WEBPACK_IMPORTED_MODULE_94__["toArray"]; });
|
28870 |
|
28871 | var _internal_operators_window__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(359);
|
28872 | __webpack_require__.d(__webpack_exports__, "window", function() { return _internal_operators_window__WEBPACK_IMPORTED_MODULE_95__["window"]; });
|
28873 |
|
28874 | var _internal_operators_windowCount__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(360);
|
28875 | __webpack_require__.d(__webpack_exports__, "windowCount", function() { return _internal_operators_windowCount__WEBPACK_IMPORTED_MODULE_96__["windowCount"]; });
|
28876 |
|
28877 | var _internal_operators_windowTime__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(361);
|
28878 | __webpack_require__.d(__webpack_exports__, "windowTime", function() { return _internal_operators_windowTime__WEBPACK_IMPORTED_MODULE_97__["windowTime"]; });
|
28879 |
|
28880 | var _internal_operators_windowToggle__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(362);
|
28881 | __webpack_require__.d(__webpack_exports__, "windowToggle", function() { return _internal_operators_windowToggle__WEBPACK_IMPORTED_MODULE_98__["windowToggle"]; });
|
28882 |
|
28883 | var _internal_operators_windowWhen__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(363);
|
28884 | __webpack_require__.d(__webpack_exports__, "windowWhen", function() { return _internal_operators_windowWhen__WEBPACK_IMPORTED_MODULE_99__["windowWhen"]; });
|
28885 |
|
28886 | var _internal_operators_withLatestFrom__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(364);
|
28887 | __webpack_require__.d(__webpack_exports__, "withLatestFrom", function() { return _internal_operators_withLatestFrom__WEBPACK_IMPORTED_MODULE_100__["withLatestFrom"]; });
|
28888 |
|
28889 | var _internal_operators_zip__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(365);
|
28890 | __webpack_require__.d(__webpack_exports__, "zip", function() { return _internal_operators_zip__WEBPACK_IMPORTED_MODULE_101__["zip"]; });
|
28891 |
|
28892 | var _internal_operators_zipAll__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(366);
|
28893 | __webpack_require__.d(__webpack_exports__, "zipAll", function() { return _internal_operators_zipAll__WEBPACK_IMPORTED_MODULE_102__["zipAll"]; });
|
28894 |
|
28895 |
|
28896 |
|
28897 |
|
28898 |
|
28899 |
|
28900 |
|
28901 |
|
28902 |
|
28903 |
|
28904 |
|
28905 |
|
28906 |
|
28907 |
|
28908 |
|
28909 |
|
28910 |
|
28911 |
|
28912 |
|
28913 |
|
28914 |
|
28915 |
|
28916 |
|
28917 |
|
28918 |
|
28919 |
|
28920 |
|
28921 |
|
28922 |
|
28923 |
|
28924 |
|
28925 |
|
28926 |
|
28927 |
|
28928 |
|
28929 |
|
28930 |
|
28931 |
|
28932 |
|
28933 |
|
28934 |
|
28935 |
|
28936 |
|
28937 |
|
28938 |
|
28939 |
|
28940 |
|
28941 |
|
28942 |
|
28943 |
|
28944 |
|
28945 |
|
28946 |
|
28947 |
|
28948 |
|
28949 |
|
28950 |
|
28951 |
|
28952 |
|
28953 |
|
28954 |
|
28955 |
|
28956 |
|
28957 |
|
28958 |
|
28959 |
|
28960 |
|
28961 |
|
28962 |
|
28963 |
|
28964 |
|
28965 |
|
28966 |
|
28967 |
|
28968 |
|
28969 |
|
28970 |
|
28971 |
|
28972 |
|
28973 |
|
28974 |
|
28975 |
|
28976 |
|
28977 |
|
28978 |
|
28979 |
|
28980 |
|
28981 |
|
28982 |
|
28983 |
|
28984 |
|
28985 |
|
28986 |
|
28987 |
|
28988 |
|
28989 |
|
28990 |
|
28991 |
|
28992 |
|
28993 |
|
28994 |
|
28995 |
|
28996 |
|
28997 |
|
28998 |
|
28999 |
|
29000 |
|
29001 |
|
29002 |
|
29003 | }),
|
29004 |
|
29005 | (function(module, __webpack_exports__, __webpack_require__) {
|
29006 |
|
29007 | "use strict";
|
29008 | __webpack_require__.r(__webpack_exports__);
|
29009 | __webpack_require__.d(__webpack_exports__, "audit", function() { return audit; });
|
29010 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
29011 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(227);
|
29012 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(228);
|
29013 |
|
29014 |
|
29015 |
|
29016 |
|
29017 | function audit(durationSelector) {
|
29018 | return function auditOperatorFunction(source) {
|
29019 | return source.lift(new AuditOperator(durationSelector));
|
29020 | };
|
29021 | }
|
29022 | var AuditOperator = (function () {
|
29023 | function AuditOperator(durationSelector) {
|
29024 | this.durationSelector = durationSelector;
|
29025 | }
|
29026 | AuditOperator.prototype.call = function (subscriber, source) {
|
29027 | return source.subscribe(new AuditSubscriber(subscriber, this.durationSelector));
|
29028 | };
|
29029 | return AuditOperator;
|
29030 | }());
|
29031 | var AuditSubscriber = (function (_super) {
|
29032 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AuditSubscriber, _super);
|
29033 | function AuditSubscriber(destination, durationSelector) {
|
29034 | var _this = _super.call(this, destination) || this;
|
29035 | _this.durationSelector = durationSelector;
|
29036 | _this.hasValue = false;
|
29037 | return _this;
|
29038 | }
|
29039 | AuditSubscriber.prototype._next = function (value) {
|
29040 | this.value = value;
|
29041 | this.hasValue = true;
|
29042 | if (!this.throttled) {
|
29043 | var duration = void 0;
|
29044 | try {
|
29045 | var durationSelector = this.durationSelector;
|
29046 | duration = durationSelector(value);
|
29047 | }
|
29048 | catch (err) {
|
29049 | return this.destination.error(err);
|
29050 | }
|
29051 | var innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, duration);
|
29052 | if (!innerSubscription || innerSubscription.closed) {
|
29053 | this.clearThrottle();
|
29054 | }
|
29055 | else {
|
29056 | this.add(this.throttled = innerSubscription);
|
29057 | }
|
29058 | }
|
29059 | };
|
29060 | AuditSubscriber.prototype.clearThrottle = function () {
|
29061 | var _a = this, value = _a.value, hasValue = _a.hasValue, throttled = _a.throttled;
|
29062 | if (throttled) {
|
29063 | this.remove(throttled);
|
29064 | this.throttled = null;
|
29065 | throttled.unsubscribe();
|
29066 | }
|
29067 | if (hasValue) {
|
29068 | this.value = null;
|
29069 | this.hasValue = false;
|
29070 | this.destination.next(value);
|
29071 | }
|
29072 | };
|
29073 | AuditSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex) {
|
29074 | this.clearThrottle();
|
29075 | };
|
29076 | AuditSubscriber.prototype.notifyComplete = function () {
|
29077 | this.clearThrottle();
|
29078 | };
|
29079 | return AuditSubscriber;
|
29080 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
29081 |
|
29082 |
|
29083 |
|
29084 | }),
|
29085 |
|
29086 | (function(module, __webpack_exports__, __webpack_require__) {
|
29087 |
|
29088 | "use strict";
|
29089 | __webpack_require__.r(__webpack_exports__);
|
29090 | __webpack_require__.d(__webpack_exports__, "auditTime", function() { return auditTime; });
|
29091 | var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(213);
|
29092 | var _audit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(270);
|
29093 | var _observable_timer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(265);
|
29094 |
|
29095 |
|
29096 |
|
29097 |
|
29098 | function auditTime(duration, scheduler) {
|
29099 | if (scheduler === void 0) {
|
29100 | scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"];
|
29101 | }
|
29102 | return Object(_audit__WEBPACK_IMPORTED_MODULE_1__["audit"])(function () { return Object(_observable_timer__WEBPACK_IMPORTED_MODULE_2__["timer"])(duration, scheduler); });
|
29103 | }
|
29104 |
|
29105 |
|
29106 |
|
29107 | }),
|
29108 |
|
29109 | (function(module, __webpack_exports__, __webpack_require__) {
|
29110 |
|
29111 | "use strict";
|
29112 | __webpack_require__.r(__webpack_exports__);
|
29113 | __webpack_require__.d(__webpack_exports__, "buffer", function() { return buffer; });
|
29114 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
29115 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(227);
|
29116 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(228);
|
29117 |
|
29118 |
|
29119 |
|
29120 |
|
29121 | function buffer(closingNotifier) {
|
29122 | return function bufferOperatorFunction(source) {
|
29123 | return source.lift(new BufferOperator(closingNotifier));
|
29124 | };
|
29125 | }
|
29126 | var BufferOperator = (function () {
|
29127 | function BufferOperator(closingNotifier) {
|
29128 | this.closingNotifier = closingNotifier;
|
29129 | }
|
29130 | BufferOperator.prototype.call = function (subscriber, source) {
|
29131 | return source.subscribe(new BufferSubscriber(subscriber, this.closingNotifier));
|
29132 | };
|
29133 | return BufferOperator;
|
29134 | }());
|
29135 | var BufferSubscriber = (function (_super) {
|
29136 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BufferSubscriber, _super);
|
29137 | function BufferSubscriber(destination, closingNotifier) {
|
29138 | var _this = _super.call(this, destination) || this;
|
29139 | _this.buffer = [];
|
29140 | _this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(_this, closingNotifier));
|
29141 | return _this;
|
29142 | }
|
29143 | BufferSubscriber.prototype._next = function (value) {
|
29144 | this.buffer.push(value);
|
29145 | };
|
29146 | BufferSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
29147 | var buffer = this.buffer;
|
29148 | this.buffer = [];
|
29149 | this.destination.next(buffer);
|
29150 | };
|
29151 | return BufferSubscriber;
|
29152 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
29153 |
|
29154 |
|
29155 |
|
29156 | }),
|
29157 |
|
29158 | (function(module, __webpack_exports__, __webpack_require__) {
|
29159 |
|
29160 | "use strict";
|
29161 | __webpack_require__.r(__webpack_exports__);
|
29162 | __webpack_require__.d(__webpack_exports__, "bufferCount", function() { return bufferCount; });
|
29163 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
29164 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
29165 |
|
29166 |
|
29167 |
|
29168 | function bufferCount(bufferSize, startBufferEvery) {
|
29169 | if (startBufferEvery === void 0) {
|
29170 | startBufferEvery = null;
|
29171 | }
|
29172 | return function bufferCountOperatorFunction(source) {
|
29173 | return source.lift(new BufferCountOperator(bufferSize, startBufferEvery));
|
29174 | };
|
29175 | }
|
29176 | var BufferCountOperator = (function () {
|
29177 | function BufferCountOperator(bufferSize, startBufferEvery) {
|
29178 | this.bufferSize = bufferSize;
|
29179 | this.startBufferEvery = startBufferEvery;
|
29180 | if (!startBufferEvery || bufferSize === startBufferEvery) {
|
29181 | this.subscriberClass = BufferCountSubscriber;
|
29182 | }
|
29183 | else {
|
29184 | this.subscriberClass = BufferSkipCountSubscriber;
|
29185 | }
|
29186 | }
|
29187 | BufferCountOperator.prototype.call = function (subscriber, source) {
|
29188 | return source.subscribe(new this.subscriberClass(subscriber, this.bufferSize, this.startBufferEvery));
|
29189 | };
|
29190 | return BufferCountOperator;
|
29191 | }());
|
29192 | var BufferCountSubscriber = (function (_super) {
|
29193 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BufferCountSubscriber, _super);
|
29194 | function BufferCountSubscriber(destination, bufferSize) {
|
29195 | var _this = _super.call(this, destination) || this;
|
29196 | _this.bufferSize = bufferSize;
|
29197 | _this.buffer = [];
|
29198 | return _this;
|
29199 | }
|
29200 | BufferCountSubscriber.prototype._next = function (value) {
|
29201 | var buffer = this.buffer;
|
29202 | buffer.push(value);
|
29203 | if (buffer.length == this.bufferSize) {
|
29204 | this.destination.next(buffer);
|
29205 | this.buffer = [];
|
29206 | }
|
29207 | };
|
29208 | BufferCountSubscriber.prototype._complete = function () {
|
29209 | var buffer = this.buffer;
|
29210 | if (buffer.length > 0) {
|
29211 | this.destination.next(buffer);
|
29212 | }
|
29213 | _super.prototype._complete.call(this);
|
29214 | };
|
29215 | return BufferCountSubscriber;
|
29216 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
29217 | var BufferSkipCountSubscriber = (function (_super) {
|
29218 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BufferSkipCountSubscriber, _super);
|
29219 | function BufferSkipCountSubscriber(destination, bufferSize, startBufferEvery) {
|
29220 | var _this = _super.call(this, destination) || this;
|
29221 | _this.bufferSize = bufferSize;
|
29222 | _this.startBufferEvery = startBufferEvery;
|
29223 | _this.buffers = [];
|
29224 | _this.count = 0;
|
29225 | return _this;
|
29226 | }
|
29227 | BufferSkipCountSubscriber.prototype._next = function (value) {
|
29228 | var _a = this, bufferSize = _a.bufferSize, startBufferEvery = _a.startBufferEvery, buffers = _a.buffers, count = _a.count;
|
29229 | this.count++;
|
29230 | if (count % startBufferEvery === 0) {
|
29231 | buffers.push([]);
|
29232 | }
|
29233 | for (var i = buffers.length; i--;) {
|
29234 | var buffer = buffers[i];
|
29235 | buffer.push(value);
|
29236 | if (buffer.length === bufferSize) {
|
29237 | buffers.splice(i, 1);
|
29238 | this.destination.next(buffer);
|
29239 | }
|
29240 | }
|
29241 | };
|
29242 | BufferSkipCountSubscriber.prototype._complete = function () {
|
29243 | var _a = this, buffers = _a.buffers, destination = _a.destination;
|
29244 | while (buffers.length > 0) {
|
29245 | var buffer = buffers.shift();
|
29246 | if (buffer.length > 0) {
|
29247 | destination.next(buffer);
|
29248 | }
|
29249 | }
|
29250 | _super.prototype._complete.call(this);
|
29251 | };
|
29252 | return BufferSkipCountSubscriber;
|
29253 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
29254 |
|
29255 |
|
29256 |
|
29257 | }),
|
29258 |
|
29259 | (function(module, __webpack_exports__, __webpack_require__) {
|
29260 |
|
29261 | "use strict";
|
29262 | __webpack_require__.r(__webpack_exports__);
|
29263 | __webpack_require__.d(__webpack_exports__, "bufferTime", function() { return bufferTime; });
|
29264 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
29265 | var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(213);
|
29266 | var _Subscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(169);
|
29267 | var _util_isScheduler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(203);
|
29268 |
|
29269 |
|
29270 |
|
29271 |
|
29272 |
|
29273 | function bufferTime(bufferTimeSpan) {
|
29274 | var length = arguments.length;
|
29275 | var scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"];
|
29276 | if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_3__["isScheduler"])(arguments[arguments.length - 1])) {
|
29277 | scheduler = arguments[arguments.length - 1];
|
29278 | length--;
|
29279 | }
|
29280 | var bufferCreationInterval = null;
|
29281 | if (length >= 2) {
|
29282 | bufferCreationInterval = arguments[1];
|
29283 | }
|
29284 | var maxBufferSize = Number.POSITIVE_INFINITY;
|
29285 | if (length >= 3) {
|
29286 | maxBufferSize = arguments[2];
|
29287 | }
|
29288 | return function bufferTimeOperatorFunction(source) {
|
29289 | return source.lift(new BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler));
|
29290 | };
|
29291 | }
|
29292 | var BufferTimeOperator = (function () {
|
29293 | function BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler) {
|
29294 | this.bufferTimeSpan = bufferTimeSpan;
|
29295 | this.bufferCreationInterval = bufferCreationInterval;
|
29296 | this.maxBufferSize = maxBufferSize;
|
29297 | this.scheduler = scheduler;
|
29298 | }
|
29299 | BufferTimeOperator.prototype.call = function (subscriber, source) {
|
29300 | return source.subscribe(new BufferTimeSubscriber(subscriber, this.bufferTimeSpan, this.bufferCreationInterval, this.maxBufferSize, this.scheduler));
|
29301 | };
|
29302 | return BufferTimeOperator;
|
29303 | }());
|
29304 | var Context = (function () {
|
29305 | function Context() {
|
29306 | this.buffer = [];
|
29307 | }
|
29308 | return Context;
|
29309 | }());
|
29310 | var BufferTimeSubscriber = (function (_super) {
|
29311 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BufferTimeSubscriber, _super);
|
29312 | function BufferTimeSubscriber(destination, bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler) {
|
29313 | var _this = _super.call(this, destination) || this;
|
29314 | _this.bufferTimeSpan = bufferTimeSpan;
|
29315 | _this.bufferCreationInterval = bufferCreationInterval;
|
29316 | _this.maxBufferSize = maxBufferSize;
|
29317 | _this.scheduler = scheduler;
|
29318 | _this.contexts = [];
|
29319 | var context = _this.openContext();
|
29320 | _this.timespanOnly = bufferCreationInterval == null || bufferCreationInterval < 0;
|
29321 | if (_this.timespanOnly) {
|
29322 | var timeSpanOnlyState = { subscriber: _this, context: context, bufferTimeSpan: bufferTimeSpan };
|
29323 | _this.add(context.closeAction = scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState));
|
29324 | }
|
29325 | else {
|
29326 | var closeState = { subscriber: _this, context: context };
|
29327 | var creationState = { bufferTimeSpan: bufferTimeSpan, bufferCreationInterval: bufferCreationInterval, subscriber: _this, scheduler: scheduler };
|
29328 | _this.add(context.closeAction = scheduler.schedule(dispatchBufferClose, bufferTimeSpan, closeState));
|
29329 | _this.add(scheduler.schedule(dispatchBufferCreation, bufferCreationInterval, creationState));
|
29330 | }
|
29331 | return _this;
|
29332 | }
|
29333 | BufferTimeSubscriber.prototype._next = function (value) {
|
29334 | var contexts = this.contexts;
|
29335 | var len = contexts.length;
|
29336 | var filledBufferContext;
|
29337 | for (var i = 0; i < len; i++) {
|
29338 | var context_1 = contexts[i];
|
29339 | var buffer = context_1.buffer;
|
29340 | buffer.push(value);
|
29341 | if (buffer.length == this.maxBufferSize) {
|
29342 | filledBufferContext = context_1;
|
29343 | }
|
29344 | }
|
29345 | if (filledBufferContext) {
|
29346 | this.onBufferFull(filledBufferContext);
|
29347 | }
|
29348 | };
|
29349 | BufferTimeSubscriber.prototype._error = function (err) {
|
29350 | this.contexts.length = 0;
|
29351 | _super.prototype._error.call(this, err);
|
29352 | };
|
29353 | BufferTimeSubscriber.prototype._complete = function () {
|
29354 | var _a = this, contexts = _a.contexts, destination = _a.destination;
|
29355 | while (contexts.length > 0) {
|
29356 | var context_2 = contexts.shift();
|
29357 | destination.next(context_2.buffer);
|
29358 | }
|
29359 | _super.prototype._complete.call(this);
|
29360 | };
|
29361 | BufferTimeSubscriber.prototype._unsubscribe = function () {
|
29362 | this.contexts = null;
|
29363 | };
|
29364 | BufferTimeSubscriber.prototype.onBufferFull = function (context) {
|
29365 | this.closeContext(context);
|
29366 | var closeAction = context.closeAction;
|
29367 | closeAction.unsubscribe();
|
29368 | this.remove(closeAction);
|
29369 | if (!this.closed && this.timespanOnly) {
|
29370 | context = this.openContext();
|
29371 | var bufferTimeSpan = this.bufferTimeSpan;
|
29372 | var timeSpanOnlyState = { subscriber: this, context: context, bufferTimeSpan: bufferTimeSpan };
|
29373 | this.add(context.closeAction = this.scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState));
|
29374 | }
|
29375 | };
|
29376 | BufferTimeSubscriber.prototype.openContext = function () {
|
29377 | var context = new Context();
|
29378 | this.contexts.push(context);
|
29379 | return context;
|
29380 | };
|
29381 | BufferTimeSubscriber.prototype.closeContext = function (context) {
|
29382 | this.destination.next(context.buffer);
|
29383 | var contexts = this.contexts;
|
29384 | var spliceIndex = contexts ? contexts.indexOf(context) : -1;
|
29385 | if (spliceIndex >= 0) {
|
29386 | contexts.splice(contexts.indexOf(context), 1);
|
29387 | }
|
29388 | };
|
29389 | return BufferTimeSubscriber;
|
29390 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_2__["Subscriber"]));
|
29391 | function dispatchBufferTimeSpanOnly(state) {
|
29392 | var subscriber = state.subscriber;
|
29393 | var prevContext = state.context;
|
29394 | if (prevContext) {
|
29395 | subscriber.closeContext(prevContext);
|
29396 | }
|
29397 | if (!subscriber.closed) {
|
29398 | state.context = subscriber.openContext();
|
29399 | state.context.closeAction = this.schedule(state, state.bufferTimeSpan);
|
29400 | }
|
29401 | }
|
29402 | function dispatchBufferCreation(state) {
|
29403 | var bufferCreationInterval = state.bufferCreationInterval, bufferTimeSpan = state.bufferTimeSpan, subscriber = state.subscriber, scheduler = state.scheduler;
|
29404 | var context = subscriber.openContext();
|
29405 | var action = this;
|
29406 | if (!subscriber.closed) {
|
29407 | subscriber.add(context.closeAction = scheduler.schedule(dispatchBufferClose, bufferTimeSpan, { subscriber: subscriber, context: context }));
|
29408 | action.schedule(state, bufferCreationInterval);
|
29409 | }
|
29410 | }
|
29411 | function dispatchBufferClose(arg) {
|
29412 | var subscriber = arg.subscriber, context = arg.context;
|
29413 | subscriber.closeContext(context);
|
29414 | }
|
29415 |
|
29416 |
|
29417 |
|
29418 | }),
|
29419 |
|
29420 | (function(module, __webpack_exports__, __webpack_require__) {
|
29421 |
|
29422 | "use strict";
|
29423 | __webpack_require__.r(__webpack_exports__);
|
29424 | __webpack_require__.d(__webpack_exports__, "bufferToggle", function() { return bufferToggle; });
|
29425 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
29426 | var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(175);
|
29427 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(228);
|
29428 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(227);
|
29429 |
|
29430 |
|
29431 |
|
29432 |
|
29433 |
|
29434 | function bufferToggle(openings, closingSelector) {
|
29435 | return function bufferToggleOperatorFunction(source) {
|
29436 | return source.lift(new BufferToggleOperator(openings, closingSelector));
|
29437 | };
|
29438 | }
|
29439 | var BufferToggleOperator = (function () {
|
29440 | function BufferToggleOperator(openings, closingSelector) {
|
29441 | this.openings = openings;
|
29442 | this.closingSelector = closingSelector;
|
29443 | }
|
29444 | BufferToggleOperator.prototype.call = function (subscriber, source) {
|
29445 | return source.subscribe(new BufferToggleSubscriber(subscriber, this.openings, this.closingSelector));
|
29446 | };
|
29447 | return BufferToggleOperator;
|
29448 | }());
|
29449 | var BufferToggleSubscriber = (function (_super) {
|
29450 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BufferToggleSubscriber, _super);
|
29451 | function BufferToggleSubscriber(destination, openings, closingSelector) {
|
29452 | var _this = _super.call(this, destination) || this;
|
29453 | _this.openings = openings;
|
29454 | _this.closingSelector = closingSelector;
|
29455 | _this.contexts = [];
|
29456 | _this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(_this, openings));
|
29457 | return _this;
|
29458 | }
|
29459 | BufferToggleSubscriber.prototype._next = function (value) {
|
29460 | var contexts = this.contexts;
|
29461 | var len = contexts.length;
|
29462 | for (var i = 0; i < len; i++) {
|
29463 | contexts[i].buffer.push(value);
|
29464 | }
|
29465 | };
|
29466 | BufferToggleSubscriber.prototype._error = function (err) {
|
29467 | var contexts = this.contexts;
|
29468 | while (contexts.length > 0) {
|
29469 | var context_1 = contexts.shift();
|
29470 | context_1.subscription.unsubscribe();
|
29471 | context_1.buffer = null;
|
29472 | context_1.subscription = null;
|
29473 | }
|
29474 | this.contexts = null;
|
29475 | _super.prototype._error.call(this, err);
|
29476 | };
|
29477 | BufferToggleSubscriber.prototype._complete = function () {
|
29478 | var contexts = this.contexts;
|
29479 | while (contexts.length > 0) {
|
29480 | var context_2 = contexts.shift();
|
29481 | this.destination.next(context_2.buffer);
|
29482 | context_2.subscription.unsubscribe();
|
29483 | context_2.buffer = null;
|
29484 | context_2.subscription = null;
|
29485 | }
|
29486 | this.contexts = null;
|
29487 | _super.prototype._complete.call(this);
|
29488 | };
|
29489 | BufferToggleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
29490 | outerValue ? this.closeBuffer(outerValue) : this.openBuffer(innerValue);
|
29491 | };
|
29492 | BufferToggleSubscriber.prototype.notifyComplete = function (innerSub) {
|
29493 | this.closeBuffer(innerSub.context);
|
29494 | };
|
29495 | BufferToggleSubscriber.prototype.openBuffer = function (value) {
|
29496 | try {
|
29497 | var closingSelector = this.closingSelector;
|
29498 | var closingNotifier = closingSelector.call(this, value);
|
29499 | if (closingNotifier) {
|
29500 | this.trySubscribe(closingNotifier);
|
29501 | }
|
29502 | }
|
29503 | catch (err) {
|
29504 | this._error(err);
|
29505 | }
|
29506 | };
|
29507 | BufferToggleSubscriber.prototype.closeBuffer = function (context) {
|
29508 | var contexts = this.contexts;
|
29509 | if (contexts && context) {
|
29510 | var buffer = context.buffer, subscription = context.subscription;
|
29511 | this.destination.next(buffer);
|
29512 | contexts.splice(contexts.indexOf(context), 1);
|
29513 | this.remove(subscription);
|
29514 | subscription.unsubscribe();
|
29515 | }
|
29516 | };
|
29517 | BufferToggleSubscriber.prototype.trySubscribe = function (closingNotifier) {
|
29518 | var contexts = this.contexts;
|
29519 | var buffer = [];
|
29520 | var subscription = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
|
29521 | var context = { buffer: buffer, subscription: subscription };
|
29522 | contexts.push(context);
|
29523 | var innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, closingNotifier, context);
|
29524 | if (!innerSubscription || innerSubscription.closed) {
|
29525 | this.closeBuffer(context);
|
29526 | }
|
29527 | else {
|
29528 | innerSubscription.context = context;
|
29529 | this.add(innerSubscription);
|
29530 | subscription.add(innerSubscription);
|
29531 | }
|
29532 | };
|
29533 | return BufferToggleSubscriber;
|
29534 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"]));
|
29535 |
|
29536 |
|
29537 |
|
29538 | }),
|
29539 |
|
29540 | (function(module, __webpack_exports__, __webpack_require__) {
|
29541 |
|
29542 | "use strict";
|
29543 | __webpack_require__.r(__webpack_exports__);
|
29544 | __webpack_require__.d(__webpack_exports__, "bufferWhen", function() { return bufferWhen; });
|
29545 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
29546 | var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(175);
|
29547 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(227);
|
29548 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(228);
|
29549 |
|
29550 |
|
29551 |
|
29552 |
|
29553 |
|
29554 | function bufferWhen(closingSelector) {
|
29555 | return function (source) {
|
29556 | return source.lift(new BufferWhenOperator(closingSelector));
|
29557 | };
|
29558 | }
|
29559 | var BufferWhenOperator = (function () {
|
29560 | function BufferWhenOperator(closingSelector) {
|
29561 | this.closingSelector = closingSelector;
|
29562 | }
|
29563 | BufferWhenOperator.prototype.call = function (subscriber, source) {
|
29564 | return source.subscribe(new BufferWhenSubscriber(subscriber, this.closingSelector));
|
29565 | };
|
29566 | return BufferWhenOperator;
|
29567 | }());
|
29568 | var BufferWhenSubscriber = (function (_super) {
|
29569 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BufferWhenSubscriber, _super);
|
29570 | function BufferWhenSubscriber(destination, closingSelector) {
|
29571 | var _this = _super.call(this, destination) || this;
|
29572 | _this.closingSelector = closingSelector;
|
29573 | _this.subscribing = false;
|
29574 | _this.openBuffer();
|
29575 | return _this;
|
29576 | }
|
29577 | BufferWhenSubscriber.prototype._next = function (value) {
|
29578 | this.buffer.push(value);
|
29579 | };
|
29580 | BufferWhenSubscriber.prototype._complete = function () {
|
29581 | var buffer = this.buffer;
|
29582 | if (buffer) {
|
29583 | this.destination.next(buffer);
|
29584 | }
|
29585 | _super.prototype._complete.call(this);
|
29586 | };
|
29587 | BufferWhenSubscriber.prototype._unsubscribe = function () {
|
29588 | this.buffer = null;
|
29589 | this.subscribing = false;
|
29590 | };
|
29591 | BufferWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
29592 | this.openBuffer();
|
29593 | };
|
29594 | BufferWhenSubscriber.prototype.notifyComplete = function () {
|
29595 | if (this.subscribing) {
|
29596 | this.complete();
|
29597 | }
|
29598 | else {
|
29599 | this.openBuffer();
|
29600 | }
|
29601 | };
|
29602 | BufferWhenSubscriber.prototype.openBuffer = function () {
|
29603 | var closingSubscription = this.closingSubscription;
|
29604 | if (closingSubscription) {
|
29605 | this.remove(closingSubscription);
|
29606 | closingSubscription.unsubscribe();
|
29607 | }
|
29608 | var buffer = this.buffer;
|
29609 | if (this.buffer) {
|
29610 | this.destination.next(buffer);
|
29611 | }
|
29612 | this.buffer = [];
|
29613 | var closingNotifier;
|
29614 | try {
|
29615 | var closingSelector = this.closingSelector;
|
29616 | closingNotifier = closingSelector();
|
29617 | }
|
29618 | catch (err) {
|
29619 | return this.error(err);
|
29620 | }
|
29621 | closingSubscription = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
|
29622 | this.closingSubscription = closingSubscription;
|
29623 | this.add(closingSubscription);
|
29624 | this.subscribing = true;
|
29625 | closingSubscription.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(this, closingNotifier));
|
29626 | this.subscribing = false;
|
29627 | };
|
29628 | return BufferWhenSubscriber;
|
29629 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"]));
|
29630 |
|
29631 |
|
29632 |
|
29633 | }),
|
29634 |
|
29635 | (function(module, __webpack_exports__, __webpack_require__) {
|
29636 |
|
29637 | "use strict";
|
29638 | __webpack_require__.r(__webpack_exports__);
|
29639 | __webpack_require__.d(__webpack_exports__, "catchError", function() { return catchError; });
|
29640 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
29641 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(227);
|
29642 | var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(229);
|
29643 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(228);
|
29644 |
|
29645 |
|
29646 |
|
29647 |
|
29648 |
|
29649 | function catchError(selector) {
|
29650 | return function catchErrorOperatorFunction(source) {
|
29651 | var operator = new CatchOperator(selector);
|
29652 | var caught = source.lift(operator);
|
29653 | return (operator.caught = caught);
|
29654 | };
|
29655 | }
|
29656 | var CatchOperator = (function () {
|
29657 | function CatchOperator(selector) {
|
29658 | this.selector = selector;
|
29659 | }
|
29660 | CatchOperator.prototype.call = function (subscriber, source) {
|
29661 | return source.subscribe(new CatchSubscriber(subscriber, this.selector, this.caught));
|
29662 | };
|
29663 | return CatchOperator;
|
29664 | }());
|
29665 | var CatchSubscriber = (function (_super) {
|
29666 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](CatchSubscriber, _super);
|
29667 | function CatchSubscriber(destination, selector, caught) {
|
29668 | var _this = _super.call(this, destination) || this;
|
29669 | _this.selector = selector;
|
29670 | _this.caught = caught;
|
29671 | return _this;
|
29672 | }
|
29673 | CatchSubscriber.prototype.error = function (err) {
|
29674 | if (!this.isStopped) {
|
29675 | var result = void 0;
|
29676 | try {
|
29677 | result = this.selector(err, this.caught);
|
29678 | }
|
29679 | catch (err2) {
|
29680 | _super.prototype.error.call(this, err2);
|
29681 | return;
|
29682 | }
|
29683 | this._unsubscribeAndRecycle();
|
29684 | var innerSubscriber = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__["InnerSubscriber"](this, undefined, undefined);
|
29685 | this.add(innerSubscriber);
|
29686 | var innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(this, result, undefined, undefined, innerSubscriber);
|
29687 | if (innerSubscription !== innerSubscriber) {
|
29688 | this.add(innerSubscription);
|
29689 | }
|
29690 | }
|
29691 | };
|
29692 | return CatchSubscriber;
|
29693 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
29694 |
|
29695 |
|
29696 |
|
29697 | }),
|
29698 |
|
29699 | (function(module, __webpack_exports__, __webpack_require__) {
|
29700 |
|
29701 | "use strict";
|
29702 | __webpack_require__.r(__webpack_exports__);
|
29703 | __webpack_require__.d(__webpack_exports__, "combineAll", function() { return combineAll; });
|
29704 | var _observable_combineLatest__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(226);
|
29705 |
|
29706 |
|
29707 | function combineAll(project) {
|
29708 | return function (source) { return source.lift(new _observable_combineLatest__WEBPACK_IMPORTED_MODULE_0__["CombineLatestOperator"](project)); };
|
29709 | }
|
29710 |
|
29711 |
|
29712 |
|
29713 | }),
|
29714 |
|
29715 | (function(module, __webpack_exports__, __webpack_require__) {
|
29716 |
|
29717 | "use strict";
|
29718 | __webpack_require__.r(__webpack_exports__);
|
29719 | __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return combineLatest; });
|
29720 | var _util_isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(176);
|
29721 | var _observable_combineLatest__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(226);
|
29722 | var _observable_from__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(241);
|
29723 |
|
29724 |
|
29725 |
|
29726 |
|
29727 | var none = {};
|
29728 | function combineLatest() {
|
29729 | var observables = [];
|
29730 | for (var _i = 0; _i < arguments.length; _i++) {
|
29731 | observables[_i] = arguments[_i];
|
29732 | }
|
29733 | var project = null;
|
29734 | if (typeof observables[observables.length - 1] === 'function') {
|
29735 | project = observables.pop();
|
29736 | }
|
29737 | if (observables.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_0__["isArray"])(observables[0])) {
|
29738 | observables = observables[0].slice();
|
29739 | }
|
29740 | return function (source) { return source.lift.call(Object(_observable_from__WEBPACK_IMPORTED_MODULE_2__["from"])([source].concat(observables)), new _observable_combineLatest__WEBPACK_IMPORTED_MODULE_1__["CombineLatestOperator"](project)); };
|
29741 | }
|
29742 |
|
29743 |
|
29744 |
|
29745 | }),
|
29746 |
|
29747 | (function(module, __webpack_exports__, __webpack_require__) {
|
29748 |
|
29749 | "use strict";
|
29750 | __webpack_require__.r(__webpack_exports__);
|
29751 | __webpack_require__.d(__webpack_exports__, "concat", function() { return concat; });
|
29752 | var _observable_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(237);
|
29753 |
|
29754 |
|
29755 | function concat() {
|
29756 | var observables = [];
|
29757 | for (var _i = 0; _i < arguments.length; _i++) {
|
29758 | observables[_i] = arguments[_i];
|
29759 | }
|
29760 | return function (source) { return source.lift.call(_observable_concat__WEBPACK_IMPORTED_MODULE_0__["concat"].apply(void 0, [source].concat(observables))); };
|
29761 | }
|
29762 |
|
29763 |
|
29764 |
|
29765 | }),
|
29766 |
|
29767 | (function(module, __webpack_exports__, __webpack_require__) {
|
29768 |
|
29769 | "use strict";
|
29770 | __webpack_require__.r(__webpack_exports__);
|
29771 | __webpack_require__.d(__webpack_exports__, "concatMap", function() { return concatMap; });
|
29772 | var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(240);
|
29773 |
|
29774 |
|
29775 | function concatMap(project, resultSelector) {
|
29776 | return Object(_mergeMap__WEBPACK_IMPORTED_MODULE_0__["mergeMap"])(project, resultSelector, 1);
|
29777 | }
|
29778 |
|
29779 |
|
29780 |
|
29781 | }),
|
29782 |
|
29783 | (function(module, __webpack_exports__, __webpack_require__) {
|
29784 |
|
29785 | "use strict";
|
29786 | __webpack_require__.r(__webpack_exports__);
|
29787 | __webpack_require__.d(__webpack_exports__, "concatMapTo", function() { return concatMapTo; });
|
29788 | var _concatMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(281);
|
29789 |
|
29790 |
|
29791 | function concatMapTo(innerObservable, resultSelector) {
|
29792 | return Object(_concatMap__WEBPACK_IMPORTED_MODULE_0__["concatMap"])(function () { return innerObservable; }, resultSelector);
|
29793 | }
|
29794 |
|
29795 |
|
29796 |
|
29797 | }),
|
29798 |
|
29799 | (function(module, __webpack_exports__, __webpack_require__) {
|
29800 |
|
29801 | "use strict";
|
29802 | __webpack_require__.r(__webpack_exports__);
|
29803 | __webpack_require__.d(__webpack_exports__, "count", function() { return count; });
|
29804 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
29805 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
29806 |
|
29807 |
|
29808 |
|
29809 | function count(predicate) {
|
29810 | return function (source) { return source.lift(new CountOperator(predicate, source)); };
|
29811 | }
|
29812 | var CountOperator = (function () {
|
29813 | function CountOperator(predicate, source) {
|
29814 | this.predicate = predicate;
|
29815 | this.source = source;
|
29816 | }
|
29817 | CountOperator.prototype.call = function (subscriber, source) {
|
29818 | return source.subscribe(new CountSubscriber(subscriber, this.predicate, this.source));
|
29819 | };
|
29820 | return CountOperator;
|
29821 | }());
|
29822 | var CountSubscriber = (function (_super) {
|
29823 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](CountSubscriber, _super);
|
29824 | function CountSubscriber(destination, predicate, source) {
|
29825 | var _this = _super.call(this, destination) || this;
|
29826 | _this.predicate = predicate;
|
29827 | _this.source = source;
|
29828 | _this.count = 0;
|
29829 | _this.index = 0;
|
29830 | return _this;
|
29831 | }
|
29832 | CountSubscriber.prototype._next = function (value) {
|
29833 | if (this.predicate) {
|
29834 | this._tryPredicate(value);
|
29835 | }
|
29836 | else {
|
29837 | this.count++;
|
29838 | }
|
29839 | };
|
29840 | CountSubscriber.prototype._tryPredicate = function (value) {
|
29841 | var result;
|
29842 | try {
|
29843 | result = this.predicate(value, this.index++, this.source);
|
29844 | }
|
29845 | catch (err) {
|
29846 | this.destination.error(err);
|
29847 | return;
|
29848 | }
|
29849 | if (result) {
|
29850 | this.count++;
|
29851 | }
|
29852 | };
|
29853 | CountSubscriber.prototype._complete = function () {
|
29854 | this.destination.next(this.count);
|
29855 | this.destination.complete();
|
29856 | };
|
29857 | return CountSubscriber;
|
29858 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
29859 |
|
29860 |
|
29861 |
|
29862 | }),
|
29863 |
|
29864 | (function(module, __webpack_exports__, __webpack_require__) {
|
29865 |
|
29866 | "use strict";
|
29867 | __webpack_require__.r(__webpack_exports__);
|
29868 | __webpack_require__.d(__webpack_exports__, "debounce", function() { return debounce; });
|
29869 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
29870 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(227);
|
29871 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(228);
|
29872 |
|
29873 |
|
29874 |
|
29875 |
|
29876 | function debounce(durationSelector) {
|
29877 | return function (source) { return source.lift(new DebounceOperator(durationSelector)); };
|
29878 | }
|
29879 | var DebounceOperator = (function () {
|
29880 | function DebounceOperator(durationSelector) {
|
29881 | this.durationSelector = durationSelector;
|
29882 | }
|
29883 | DebounceOperator.prototype.call = function (subscriber, source) {
|
29884 | return source.subscribe(new DebounceSubscriber(subscriber, this.durationSelector));
|
29885 | };
|
29886 | return DebounceOperator;
|
29887 | }());
|
29888 | var DebounceSubscriber = (function (_super) {
|
29889 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DebounceSubscriber, _super);
|
29890 | function DebounceSubscriber(destination, durationSelector) {
|
29891 | var _this = _super.call(this, destination) || this;
|
29892 | _this.durationSelector = durationSelector;
|
29893 | _this.hasValue = false;
|
29894 | _this.durationSubscription = null;
|
29895 | return _this;
|
29896 | }
|
29897 | DebounceSubscriber.prototype._next = function (value) {
|
29898 | try {
|
29899 | var result = this.durationSelector.call(this, value);
|
29900 | if (result) {
|
29901 | this._tryNext(value, result);
|
29902 | }
|
29903 | }
|
29904 | catch (err) {
|
29905 | this.destination.error(err);
|
29906 | }
|
29907 | };
|
29908 | DebounceSubscriber.prototype._complete = function () {
|
29909 | this.emitValue();
|
29910 | this.destination.complete();
|
29911 | };
|
29912 | DebounceSubscriber.prototype._tryNext = function (value, duration) {
|
29913 | var subscription = this.durationSubscription;
|
29914 | this.value = value;
|
29915 | this.hasValue = true;
|
29916 | if (subscription) {
|
29917 | subscription.unsubscribe();
|
29918 | this.remove(subscription);
|
29919 | }
|
29920 | subscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, duration);
|
29921 | if (subscription && !subscription.closed) {
|
29922 | this.add(this.durationSubscription = subscription);
|
29923 | }
|
29924 | };
|
29925 | DebounceSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
29926 | this.emitValue();
|
29927 | };
|
29928 | DebounceSubscriber.prototype.notifyComplete = function () {
|
29929 | this.emitValue();
|
29930 | };
|
29931 | DebounceSubscriber.prototype.emitValue = function () {
|
29932 | if (this.hasValue) {
|
29933 | var value = this.value;
|
29934 | var subscription = this.durationSubscription;
|
29935 | if (subscription) {
|
29936 | this.durationSubscription = null;
|
29937 | subscription.unsubscribe();
|
29938 | this.remove(subscription);
|
29939 | }
|
29940 | this.value = null;
|
29941 | this.hasValue = false;
|
29942 | _super.prototype._next.call(this, value);
|
29943 | }
|
29944 | };
|
29945 | return DebounceSubscriber;
|
29946 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
29947 |
|
29948 |
|
29949 |
|
29950 | }),
|
29951 |
|
29952 | (function(module, __webpack_exports__, __webpack_require__) {
|
29953 |
|
29954 | "use strict";
|
29955 | __webpack_require__.r(__webpack_exports__);
|
29956 | __webpack_require__.d(__webpack_exports__, "debounceTime", function() { return debounceTime; });
|
29957 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
29958 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
29959 | var _scheduler_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(213);
|
29960 |
|
29961 |
|
29962 |
|
29963 |
|
29964 | function debounceTime(dueTime, scheduler) {
|
29965 | if (scheduler === void 0) {
|
29966 | scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_2__["async"];
|
29967 | }
|
29968 | return function (source) { return source.lift(new DebounceTimeOperator(dueTime, scheduler)); };
|
29969 | }
|
29970 | var DebounceTimeOperator = (function () {
|
29971 | function DebounceTimeOperator(dueTime, scheduler) {
|
29972 | this.dueTime = dueTime;
|
29973 | this.scheduler = scheduler;
|
29974 | }
|
29975 | DebounceTimeOperator.prototype.call = function (subscriber, source) {
|
29976 | return source.subscribe(new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler));
|
29977 | };
|
29978 | return DebounceTimeOperator;
|
29979 | }());
|
29980 | var DebounceTimeSubscriber = (function (_super) {
|
29981 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DebounceTimeSubscriber, _super);
|
29982 | function DebounceTimeSubscriber(destination, dueTime, scheduler) {
|
29983 | var _this = _super.call(this, destination) || this;
|
29984 | _this.dueTime = dueTime;
|
29985 | _this.scheduler = scheduler;
|
29986 | _this.debouncedSubscription = null;
|
29987 | _this.lastValue = null;
|
29988 | _this.hasValue = false;
|
29989 | return _this;
|
29990 | }
|
29991 | DebounceTimeSubscriber.prototype._next = function (value) {
|
29992 | this.clearDebounce();
|
29993 | this.lastValue = value;
|
29994 | this.hasValue = true;
|
29995 | this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this));
|
29996 | };
|
29997 | DebounceTimeSubscriber.prototype._complete = function () {
|
29998 | this.debouncedNext();
|
29999 | this.destination.complete();
|
30000 | };
|
30001 | DebounceTimeSubscriber.prototype.debouncedNext = function () {
|
30002 | this.clearDebounce();
|
30003 | if (this.hasValue) {
|
30004 | var lastValue = this.lastValue;
|
30005 | this.lastValue = null;
|
30006 | this.hasValue = false;
|
30007 | this.destination.next(lastValue);
|
30008 | }
|
30009 | };
|
30010 | DebounceTimeSubscriber.prototype.clearDebounce = function () {
|
30011 | var debouncedSubscription = this.debouncedSubscription;
|
30012 | if (debouncedSubscription !== null) {
|
30013 | this.remove(debouncedSubscription);
|
30014 | debouncedSubscription.unsubscribe();
|
30015 | this.debouncedSubscription = null;
|
30016 | }
|
30017 | };
|
30018 | return DebounceTimeSubscriber;
|
30019 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
30020 | function dispatchNext(subscriber) {
|
30021 | subscriber.debouncedNext();
|
30022 | }
|
30023 |
|
30024 |
|
30025 |
|
30026 | }),
|
30027 |
|
30028 | (function(module, __webpack_exports__, __webpack_require__) {
|
30029 |
|
30030 | "use strict";
|
30031 | __webpack_require__.r(__webpack_exports__);
|
30032 | __webpack_require__.d(__webpack_exports__, "defaultIfEmpty", function() { return defaultIfEmpty; });
|
30033 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
30034 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
30035 |
|
30036 |
|
30037 |
|
30038 | function defaultIfEmpty(defaultValue) {
|
30039 | if (defaultValue === void 0) {
|
30040 | defaultValue = null;
|
30041 | }
|
30042 | return function (source) { return source.lift(new DefaultIfEmptyOperator(defaultValue)); };
|
30043 | }
|
30044 | var DefaultIfEmptyOperator = (function () {
|
30045 | function DefaultIfEmptyOperator(defaultValue) {
|
30046 | this.defaultValue = defaultValue;
|
30047 | }
|
30048 | DefaultIfEmptyOperator.prototype.call = function (subscriber, source) {
|
30049 | return source.subscribe(new DefaultIfEmptySubscriber(subscriber, this.defaultValue));
|
30050 | };
|
30051 | return DefaultIfEmptyOperator;
|
30052 | }());
|
30053 | var DefaultIfEmptySubscriber = (function (_super) {
|
30054 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DefaultIfEmptySubscriber, _super);
|
30055 | function DefaultIfEmptySubscriber(destination, defaultValue) {
|
30056 | var _this = _super.call(this, destination) || this;
|
30057 | _this.defaultValue = defaultValue;
|
30058 | _this.isEmpty = true;
|
30059 | return _this;
|
30060 | }
|
30061 | DefaultIfEmptySubscriber.prototype._next = function (value) {
|
30062 | this.isEmpty = false;
|
30063 | this.destination.next(value);
|
30064 | };
|
30065 | DefaultIfEmptySubscriber.prototype._complete = function () {
|
30066 | if (this.isEmpty) {
|
30067 | this.destination.next(this.defaultValue);
|
30068 | }
|
30069 | this.destination.complete();
|
30070 | };
|
30071 | return DefaultIfEmptySubscriber;
|
30072 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
30073 |
|
30074 |
|
30075 |
|
30076 | }),
|
30077 |
|
30078 | (function(module, __webpack_exports__, __webpack_require__) {
|
30079 |
|
30080 | "use strict";
|
30081 | __webpack_require__.r(__webpack_exports__);
|
30082 | __webpack_require__.d(__webpack_exports__, "delay", function() { return delay; });
|
30083 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
30084 | var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(213);
|
30085 | var _util_isDate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(288);
|
30086 | var _Subscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(169);
|
30087 | var _Notification__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(200);
|
30088 |
|
30089 |
|
30090 |
|
30091 |
|
30092 |
|
30093 |
|
30094 | function delay(delay, scheduler) {
|
30095 | if (scheduler === void 0) {
|
30096 | scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"];
|
30097 | }
|
30098 | var absoluteDelay = Object(_util_isDate__WEBPACK_IMPORTED_MODULE_2__["isDate"])(delay);
|
30099 | var delayFor = absoluteDelay ? (+delay - scheduler.now()) : Math.abs(delay);
|
30100 | return function (source) { return source.lift(new DelayOperator(delayFor, scheduler)); };
|
30101 | }
|
30102 | var DelayOperator = (function () {
|
30103 | function DelayOperator(delay, scheduler) {
|
30104 | this.delay = delay;
|
30105 | this.scheduler = scheduler;
|
30106 | }
|
30107 | DelayOperator.prototype.call = function (subscriber, source) {
|
30108 | return source.subscribe(new DelaySubscriber(subscriber, this.delay, this.scheduler));
|
30109 | };
|
30110 | return DelayOperator;
|
30111 | }());
|
30112 | var DelaySubscriber = (function (_super) {
|
30113 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DelaySubscriber, _super);
|
30114 | function DelaySubscriber(destination, delay, scheduler) {
|
30115 | var _this = _super.call(this, destination) || this;
|
30116 | _this.delay = delay;
|
30117 | _this.scheduler = scheduler;
|
30118 | _this.queue = [];
|
30119 | _this.active = false;
|
30120 | _this.errored = false;
|
30121 | return _this;
|
30122 | }
|
30123 | DelaySubscriber.dispatch = function (state) {
|
30124 | var source = state.source;
|
30125 | var queue = source.queue;
|
30126 | var scheduler = state.scheduler;
|
30127 | var destination = state.destination;
|
30128 | while (queue.length > 0 && (queue[0].time - scheduler.now()) <= 0) {
|
30129 | queue.shift().notification.observe(destination);
|
30130 | }
|
30131 | if (queue.length > 0) {
|
30132 | var delay_1 = Math.max(0, queue[0].time - scheduler.now());
|
30133 | this.schedule(state, delay_1);
|
30134 | }
|
30135 | else {
|
30136 | this.unsubscribe();
|
30137 | source.active = false;
|
30138 | }
|
30139 | };
|
30140 | DelaySubscriber.prototype._schedule = function (scheduler) {
|
30141 | this.active = true;
|
30142 | var destination = this.destination;
|
30143 | destination.add(scheduler.schedule(DelaySubscriber.dispatch, this.delay, {
|
30144 | source: this, destination: this.destination, scheduler: scheduler
|
30145 | }));
|
30146 | };
|
30147 | DelaySubscriber.prototype.scheduleNotification = function (notification) {
|
30148 | if (this.errored === true) {
|
30149 | return;
|
30150 | }
|
30151 | var scheduler = this.scheduler;
|
30152 | var message = new DelayMessage(scheduler.now() + this.delay, notification);
|
30153 | this.queue.push(message);
|
30154 | if (this.active === false) {
|
30155 | this._schedule(scheduler);
|
30156 | }
|
30157 | };
|
30158 | DelaySubscriber.prototype._next = function (value) {
|
30159 | this.scheduleNotification(_Notification__WEBPACK_IMPORTED_MODULE_4__["Notification"].createNext(value));
|
30160 | };
|
30161 | DelaySubscriber.prototype._error = function (err) {
|
30162 | this.errored = true;
|
30163 | this.queue = [];
|
30164 | this.destination.error(err);
|
30165 | this.unsubscribe();
|
30166 | };
|
30167 | DelaySubscriber.prototype._complete = function () {
|
30168 | this.scheduleNotification(_Notification__WEBPACK_IMPORTED_MODULE_4__["Notification"].createComplete());
|
30169 | this.unsubscribe();
|
30170 | };
|
30171 | return DelaySubscriber;
|
30172 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_3__["Subscriber"]));
|
30173 | var DelayMessage = (function () {
|
30174 | function DelayMessage(time, notification) {
|
30175 | this.time = time;
|
30176 | this.notification = notification;
|
30177 | }
|
30178 | return DelayMessage;
|
30179 | }());
|
30180 |
|
30181 |
|
30182 |
|
30183 | }),
|
30184 |
|
30185 | (function(module, __webpack_exports__, __webpack_require__) {
|
30186 |
|
30187 | "use strict";
|
30188 | __webpack_require__.r(__webpack_exports__);
|
30189 | __webpack_require__.d(__webpack_exports__, "isDate", function() { return isDate; });
|
30190 |
|
30191 | function isDate(value) {
|
30192 | return value instanceof Date && !isNaN(+value);
|
30193 | }
|
30194 |
|
30195 |
|
30196 |
|
30197 | }),
|
30198 |
|
30199 | (function(module, __webpack_exports__, __webpack_require__) {
|
30200 |
|
30201 | "use strict";
|
30202 | __webpack_require__.r(__webpack_exports__);
|
30203 | __webpack_require__.d(__webpack_exports__, "delayWhen", function() { return delayWhen; });
|
30204 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
30205 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
30206 | var _Observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(167);
|
30207 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(227);
|
30208 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(228);
|
30209 |
|
30210 |
|
30211 |
|
30212 |
|
30213 |
|
30214 |
|
30215 | function delayWhen(delayDurationSelector, subscriptionDelay) {
|
30216 | if (subscriptionDelay) {
|
30217 | return function (source) {
|
30218 | return new SubscriptionDelayObservable(source, subscriptionDelay)
|
30219 | .lift(new DelayWhenOperator(delayDurationSelector));
|
30220 | };
|
30221 | }
|
30222 | return function (source) { return source.lift(new DelayWhenOperator(delayDurationSelector)); };
|
30223 | }
|
30224 | var DelayWhenOperator = (function () {
|
30225 | function DelayWhenOperator(delayDurationSelector) {
|
30226 | this.delayDurationSelector = delayDurationSelector;
|
30227 | }
|
30228 | DelayWhenOperator.prototype.call = function (subscriber, source) {
|
30229 | return source.subscribe(new DelayWhenSubscriber(subscriber, this.delayDurationSelector));
|
30230 | };
|
30231 | return DelayWhenOperator;
|
30232 | }());
|
30233 | var DelayWhenSubscriber = (function (_super) {
|
30234 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DelayWhenSubscriber, _super);
|
30235 | function DelayWhenSubscriber(destination, delayDurationSelector) {
|
30236 | var _this = _super.call(this, destination) || this;
|
30237 | _this.delayDurationSelector = delayDurationSelector;
|
30238 | _this.completed = false;
|
30239 | _this.delayNotifierSubscriptions = [];
|
30240 | _this.index = 0;
|
30241 | return _this;
|
30242 | }
|
30243 | DelayWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
30244 | this.destination.next(outerValue);
|
30245 | this.removeSubscription(innerSub);
|
30246 | this.tryComplete();
|
30247 | };
|
30248 | DelayWhenSubscriber.prototype.notifyError = function (error, innerSub) {
|
30249 | this._error(error);
|
30250 | };
|
30251 | DelayWhenSubscriber.prototype.notifyComplete = function (innerSub) {
|
30252 | var value = this.removeSubscription(innerSub);
|
30253 | if (value) {
|
30254 | this.destination.next(value);
|
30255 | }
|
30256 | this.tryComplete();
|
30257 | };
|
30258 | DelayWhenSubscriber.prototype._next = function (value) {
|
30259 | var index = this.index++;
|
30260 | try {
|
30261 | var delayNotifier = this.delayDurationSelector(value, index);
|
30262 | if (delayNotifier) {
|
30263 | this.tryDelay(delayNotifier, value);
|
30264 | }
|
30265 | }
|
30266 | catch (err) {
|
30267 | this.destination.error(err);
|
30268 | }
|
30269 | };
|
30270 | DelayWhenSubscriber.prototype._complete = function () {
|
30271 | this.completed = true;
|
30272 | this.tryComplete();
|
30273 | this.unsubscribe();
|
30274 | };
|
30275 | DelayWhenSubscriber.prototype.removeSubscription = function (subscription) {
|
30276 | subscription.unsubscribe();
|
30277 | var subscriptionIdx = this.delayNotifierSubscriptions.indexOf(subscription);
|
30278 | if (subscriptionIdx !== -1) {
|
30279 | this.delayNotifierSubscriptions.splice(subscriptionIdx, 1);
|
30280 | }
|
30281 | return subscription.outerValue;
|
30282 | };
|
30283 | DelayWhenSubscriber.prototype.tryDelay = function (delayNotifier, value) {
|
30284 | var notifierSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(this, delayNotifier, value);
|
30285 | if (notifierSubscription && !notifierSubscription.closed) {
|
30286 | var destination = this.destination;
|
30287 | destination.add(notifierSubscription);
|
30288 | this.delayNotifierSubscriptions.push(notifierSubscription);
|
30289 | }
|
30290 | };
|
30291 | DelayWhenSubscriber.prototype.tryComplete = function () {
|
30292 | if (this.completed && this.delayNotifierSubscriptions.length === 0) {
|
30293 | this.destination.complete();
|
30294 | }
|
30295 | };
|
30296 | return DelayWhenSubscriber;
|
30297 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"]));
|
30298 | var SubscriptionDelayObservable = (function (_super) {
|
30299 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SubscriptionDelayObservable, _super);
|
30300 | function SubscriptionDelayObservable(source, subscriptionDelay) {
|
30301 | var _this = _super.call(this) || this;
|
30302 | _this.source = source;
|
30303 | _this.subscriptionDelay = subscriptionDelay;
|
30304 | return _this;
|
30305 | }
|
30306 | SubscriptionDelayObservable.prototype._subscribe = function (subscriber) {
|
30307 | this.subscriptionDelay.subscribe(new SubscriptionDelaySubscriber(subscriber, this.source));
|
30308 | };
|
30309 | return SubscriptionDelayObservable;
|
30310 | }(_Observable__WEBPACK_IMPORTED_MODULE_2__["Observable"]));
|
30311 | var SubscriptionDelaySubscriber = (function (_super) {
|
30312 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SubscriptionDelaySubscriber, _super);
|
30313 | function SubscriptionDelaySubscriber(parent, source) {
|
30314 | var _this = _super.call(this) || this;
|
30315 | _this.parent = parent;
|
30316 | _this.source = source;
|
30317 | _this.sourceSubscribed = false;
|
30318 | return _this;
|
30319 | }
|
30320 | SubscriptionDelaySubscriber.prototype._next = function (unused) {
|
30321 | this.subscribeToSource();
|
30322 | };
|
30323 | SubscriptionDelaySubscriber.prototype._error = function (err) {
|
30324 | this.unsubscribe();
|
30325 | this.parent.error(err);
|
30326 | };
|
30327 | SubscriptionDelaySubscriber.prototype._complete = function () {
|
30328 | this.unsubscribe();
|
30329 | this.subscribeToSource();
|
30330 | };
|
30331 | SubscriptionDelaySubscriber.prototype.subscribeToSource = function () {
|
30332 | if (!this.sourceSubscribed) {
|
30333 | this.sourceSubscribed = true;
|
30334 | this.unsubscribe();
|
30335 | this.source.subscribe(this.parent);
|
30336 | }
|
30337 | };
|
30338 | return SubscriptionDelaySubscriber;
|
30339 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
30340 |
|
30341 |
|
30342 |
|
30343 | }),
|
30344 |
|
30345 | (function(module, __webpack_exports__, __webpack_require__) {
|
30346 |
|
30347 | "use strict";
|
30348 | __webpack_require__.r(__webpack_exports__);
|
30349 | __webpack_require__.d(__webpack_exports__, "dematerialize", function() { return dematerialize; });
|
30350 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
30351 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
30352 |
|
30353 |
|
30354 |
|
30355 | function dematerialize() {
|
30356 | return function dematerializeOperatorFunction(source) {
|
30357 | return source.lift(new DeMaterializeOperator());
|
30358 | };
|
30359 | }
|
30360 | var DeMaterializeOperator = (function () {
|
30361 | function DeMaterializeOperator() {
|
30362 | }
|
30363 | DeMaterializeOperator.prototype.call = function (subscriber, source) {
|
30364 | return source.subscribe(new DeMaterializeSubscriber(subscriber));
|
30365 | };
|
30366 | return DeMaterializeOperator;
|
30367 | }());
|
30368 | var DeMaterializeSubscriber = (function (_super) {
|
30369 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DeMaterializeSubscriber, _super);
|
30370 | function DeMaterializeSubscriber(destination) {
|
30371 | return _super.call(this, destination) || this;
|
30372 | }
|
30373 | DeMaterializeSubscriber.prototype._next = function (value) {
|
30374 | value.observe(this.destination);
|
30375 | };
|
30376 | return DeMaterializeSubscriber;
|
30377 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
30378 |
|
30379 |
|
30380 |
|
30381 | }),
|
30382 |
|
30383 | (function(module, __webpack_exports__, __webpack_require__) {
|
30384 |
|
30385 | "use strict";
|
30386 | __webpack_require__.r(__webpack_exports__);
|
30387 | __webpack_require__.d(__webpack_exports__, "distinct", function() { return distinct; });
|
30388 | __webpack_require__.d(__webpack_exports__, "DistinctSubscriber", function() { return DistinctSubscriber; });
|
30389 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
30390 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(227);
|
30391 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(228);
|
30392 |
|
30393 |
|
30394 |
|
30395 |
|
30396 | function distinct(keySelector, flushes) {
|
30397 | return function (source) { return source.lift(new DistinctOperator(keySelector, flushes)); };
|
30398 | }
|
30399 | var DistinctOperator = (function () {
|
30400 | function DistinctOperator(keySelector, flushes) {
|
30401 | this.keySelector = keySelector;
|
30402 | this.flushes = flushes;
|
30403 | }
|
30404 | DistinctOperator.prototype.call = function (subscriber, source) {
|
30405 | return source.subscribe(new DistinctSubscriber(subscriber, this.keySelector, this.flushes));
|
30406 | };
|
30407 | return DistinctOperator;
|
30408 | }());
|
30409 | var DistinctSubscriber = (function (_super) {
|
30410 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DistinctSubscriber, _super);
|
30411 | function DistinctSubscriber(destination, keySelector, flushes) {
|
30412 | var _this = _super.call(this, destination) || this;
|
30413 | _this.keySelector = keySelector;
|
30414 | _this.values = new Set();
|
30415 | if (flushes) {
|
30416 | _this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(_this, flushes));
|
30417 | }
|
30418 | return _this;
|
30419 | }
|
30420 | DistinctSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
30421 | this.values.clear();
|
30422 | };
|
30423 | DistinctSubscriber.prototype.notifyError = function (error, innerSub) {
|
30424 | this._error(error);
|
30425 | };
|
30426 | DistinctSubscriber.prototype._next = function (value) {
|
30427 | if (this.keySelector) {
|
30428 | this._useKeySelector(value);
|
30429 | }
|
30430 | else {
|
30431 | this._finalizeNext(value, value);
|
30432 | }
|
30433 | };
|
30434 | DistinctSubscriber.prototype._useKeySelector = function (value) {
|
30435 | var key;
|
30436 | var destination = this.destination;
|
30437 | try {
|
30438 | key = this.keySelector(value);
|
30439 | }
|
30440 | catch (err) {
|
30441 | destination.error(err);
|
30442 | return;
|
30443 | }
|
30444 | this._finalizeNext(key, value);
|
30445 | };
|
30446 | DistinctSubscriber.prototype._finalizeNext = function (key, value) {
|
30447 | var values = this.values;
|
30448 | if (!values.has(key)) {
|
30449 | values.add(key);
|
30450 | this.destination.next(value);
|
30451 | }
|
30452 | };
|
30453 | return DistinctSubscriber;
|
30454 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
30455 |
|
30456 |
|
30457 |
|
30458 |
|
30459 | }),
|
30460 |
|
30461 | (function(module, __webpack_exports__, __webpack_require__) {
|
30462 |
|
30463 | "use strict";
|
30464 | __webpack_require__.r(__webpack_exports__);
|
30465 | __webpack_require__.d(__webpack_exports__, "distinctUntilChanged", function() { return distinctUntilChanged; });
|
30466 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
30467 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
30468 |
|
30469 |
|
30470 |
|
30471 | function distinctUntilChanged(compare, keySelector) {
|
30472 | return function (source) { return source.lift(new DistinctUntilChangedOperator(compare, keySelector)); };
|
30473 | }
|
30474 | var DistinctUntilChangedOperator = (function () {
|
30475 | function DistinctUntilChangedOperator(compare, keySelector) {
|
30476 | this.compare = compare;
|
30477 | this.keySelector = keySelector;
|
30478 | }
|
30479 | DistinctUntilChangedOperator.prototype.call = function (subscriber, source) {
|
30480 | return source.subscribe(new DistinctUntilChangedSubscriber(subscriber, this.compare, this.keySelector));
|
30481 | };
|
30482 | return DistinctUntilChangedOperator;
|
30483 | }());
|
30484 | var DistinctUntilChangedSubscriber = (function (_super) {
|
30485 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DistinctUntilChangedSubscriber, _super);
|
30486 | function DistinctUntilChangedSubscriber(destination, compare, keySelector) {
|
30487 | var _this = _super.call(this, destination) || this;
|
30488 | _this.keySelector = keySelector;
|
30489 | _this.hasKey = false;
|
30490 | if (typeof compare === 'function') {
|
30491 | _this.compare = compare;
|
30492 | }
|
30493 | return _this;
|
30494 | }
|
30495 | DistinctUntilChangedSubscriber.prototype.compare = function (x, y) {
|
30496 | return x === y;
|
30497 | };
|
30498 | DistinctUntilChangedSubscriber.prototype._next = function (value) {
|
30499 | var key;
|
30500 | try {
|
30501 | var keySelector = this.keySelector;
|
30502 | key = keySelector ? keySelector(value) : value;
|
30503 | }
|
30504 | catch (err) {
|
30505 | return this.destination.error(err);
|
30506 | }
|
30507 | var result = false;
|
30508 | if (this.hasKey) {
|
30509 | try {
|
30510 | var compare = this.compare;
|
30511 | result = compare(this.key, key);
|
30512 | }
|
30513 | catch (err) {
|
30514 | return this.destination.error(err);
|
30515 | }
|
30516 | }
|
30517 | else {
|
30518 | this.hasKey = true;
|
30519 | }
|
30520 | if (!result) {
|
30521 | this.key = key;
|
30522 | this.destination.next(value);
|
30523 | }
|
30524 | };
|
30525 | return DistinctUntilChangedSubscriber;
|
30526 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
30527 |
|
30528 |
|
30529 |
|
30530 | }),
|
30531 |
|
30532 | (function(module, __webpack_exports__, __webpack_require__) {
|
30533 |
|
30534 | "use strict";
|
30535 | __webpack_require__.r(__webpack_exports__);
|
30536 | __webpack_require__.d(__webpack_exports__, "distinctUntilKeyChanged", function() { return distinctUntilKeyChanged; });
|
30537 | var _distinctUntilChanged__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(292);
|
30538 |
|
30539 |
|
30540 | function distinctUntilKeyChanged(key, compare) {
|
30541 | return Object(_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_0__["distinctUntilChanged"])(function (x, y) { return compare ? compare(x[key], y[key]) : x[key] === y[key]; });
|
30542 | }
|
30543 |
|
30544 |
|
30545 |
|
30546 | }),
|
30547 |
|
30548 | (function(module, __webpack_exports__, __webpack_require__) {
|
30549 |
|
30550 | "use strict";
|
30551 | __webpack_require__.r(__webpack_exports__);
|
30552 | __webpack_require__.d(__webpack_exports__, "elementAt", function() { return elementAt; });
|
30553 | var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(220);
|
30554 | var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(262);
|
30555 | var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(295);
|
30556 | var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(286);
|
30557 | var _take__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(296);
|
30558 |
|
30559 |
|
30560 |
|
30561 |
|
30562 |
|
30563 |
|
30564 | function elementAt(index, defaultValue) {
|
30565 | if (index < 0) {
|
30566 | throw new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_0__["ArgumentOutOfRangeError"]();
|
30567 | }
|
30568 | var hasDefaultValue = arguments.length >= 2;
|
30569 | return function (source) {
|
30570 | return source.pipe(Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])(function (v, i) { return i === index; }), Object(_take__WEBPACK_IMPORTED_MODULE_4__["take"])(1), hasDefaultValue
|
30571 | ? Object(_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__["defaultIfEmpty"])(defaultValue)
|
30572 | : Object(_throwIfEmpty__WEBPACK_IMPORTED_MODULE_2__["throwIfEmpty"])(function () { return new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_0__["ArgumentOutOfRangeError"](); }));
|
30573 | };
|
30574 | }
|
30575 |
|
30576 |
|
30577 |
|
30578 | }),
|
30579 |
|
30580 | (function(module, __webpack_exports__, __webpack_require__) {
|
30581 |
|
30582 | "use strict";
|
30583 | __webpack_require__.r(__webpack_exports__);
|
30584 | __webpack_require__.d(__webpack_exports__, "throwIfEmpty", function() { return throwIfEmpty; });
|
30585 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
30586 | var _util_EmptyError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(221);
|
30587 | var _Subscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(169);
|
30588 |
|
30589 |
|
30590 |
|
30591 |
|
30592 | function throwIfEmpty(errorFactory) {
|
30593 | if (errorFactory === void 0) {
|
30594 | errorFactory = defaultErrorFactory;
|
30595 | }
|
30596 | return function (source) {
|
30597 | return source.lift(new ThrowIfEmptyOperator(errorFactory));
|
30598 | };
|
30599 | }
|
30600 | var ThrowIfEmptyOperator = (function () {
|
30601 | function ThrowIfEmptyOperator(errorFactory) {
|
30602 | this.errorFactory = errorFactory;
|
30603 | }
|
30604 | ThrowIfEmptyOperator.prototype.call = function (subscriber, source) {
|
30605 | return source.subscribe(new ThrowIfEmptySubscriber(subscriber, this.errorFactory));
|
30606 | };
|
30607 | return ThrowIfEmptyOperator;
|
30608 | }());
|
30609 | var ThrowIfEmptySubscriber = (function (_super) {
|
30610 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ThrowIfEmptySubscriber, _super);
|
30611 | function ThrowIfEmptySubscriber(destination, errorFactory) {
|
30612 | var _this = _super.call(this, destination) || this;
|
30613 | _this.errorFactory = errorFactory;
|
30614 | _this.hasValue = false;
|
30615 | return _this;
|
30616 | }
|
30617 | ThrowIfEmptySubscriber.prototype._next = function (value) {
|
30618 | this.hasValue = true;
|
30619 | this.destination.next(value);
|
30620 | };
|
30621 | ThrowIfEmptySubscriber.prototype._complete = function () {
|
30622 | if (!this.hasValue) {
|
30623 | var err = void 0;
|
30624 | try {
|
30625 | err = this.errorFactory();
|
30626 | }
|
30627 | catch (e) {
|
30628 | err = e;
|
30629 | }
|
30630 | this.destination.error(err);
|
30631 | }
|
30632 | else {
|
30633 | return this.destination.complete();
|
30634 | }
|
30635 | };
|
30636 | return ThrowIfEmptySubscriber;
|
30637 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_2__["Subscriber"]));
|
30638 | function defaultErrorFactory() {
|
30639 | return new _util_EmptyError__WEBPACK_IMPORTED_MODULE_1__["EmptyError"]();
|
30640 | }
|
30641 |
|
30642 |
|
30643 |
|
30644 | }),
|
30645 |
|
30646 | (function(module, __webpack_exports__, __webpack_require__) {
|
30647 |
|
30648 | "use strict";
|
30649 | __webpack_require__.r(__webpack_exports__);
|
30650 | __webpack_require__.d(__webpack_exports__, "take", function() { return take; });
|
30651 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
30652 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
30653 | var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(220);
|
30654 | var _observable_empty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(201);
|
30655 |
|
30656 |
|
30657 |
|
30658 |
|
30659 |
|
30660 | function take(count) {
|
30661 | return function (source) {
|
30662 | if (count === 0) {
|
30663 | return Object(_observable_empty__WEBPACK_IMPORTED_MODULE_3__["empty"])();
|
30664 | }
|
30665 | else {
|
30666 | return source.lift(new TakeOperator(count));
|
30667 | }
|
30668 | };
|
30669 | }
|
30670 | var TakeOperator = (function () {
|
30671 | function TakeOperator(total) {
|
30672 | this.total = total;
|
30673 | if (this.total < 0) {
|
30674 | throw new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__["ArgumentOutOfRangeError"];
|
30675 | }
|
30676 | }
|
30677 | TakeOperator.prototype.call = function (subscriber, source) {
|
30678 | return source.subscribe(new TakeSubscriber(subscriber, this.total));
|
30679 | };
|
30680 | return TakeOperator;
|
30681 | }());
|
30682 | var TakeSubscriber = (function (_super) {
|
30683 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](TakeSubscriber, _super);
|
30684 | function TakeSubscriber(destination, total) {
|
30685 | var _this = _super.call(this, destination) || this;
|
30686 | _this.total = total;
|
30687 | _this.count = 0;
|
30688 | return _this;
|
30689 | }
|
30690 | TakeSubscriber.prototype._next = function (value) {
|
30691 | var total = this.total;
|
30692 | var count = ++this.count;
|
30693 | if (count <= total) {
|
30694 | this.destination.next(value);
|
30695 | if (count === total) {
|
30696 | this.destination.complete();
|
30697 | this.unsubscribe();
|
30698 | }
|
30699 | }
|
30700 | };
|
30701 | return TakeSubscriber;
|
30702 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
30703 |
|
30704 |
|
30705 |
|
30706 | }),
|
30707 |
|
30708 | (function(module, __webpack_exports__, __webpack_require__) {
|
30709 |
|
30710 | "use strict";
|
30711 | __webpack_require__.r(__webpack_exports__);
|
30712 | __webpack_require__.d(__webpack_exports__, "endWith", function() { return endWith; });
|
30713 | var _observable_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(237);
|
30714 | var _observable_of__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(202);
|
30715 |
|
30716 |
|
30717 |
|
30718 | function endWith() {
|
30719 | var array = [];
|
30720 | for (var _i = 0; _i < arguments.length; _i++) {
|
30721 | array[_i] = arguments[_i];
|
30722 | }
|
30723 | return function (source) { return Object(_observable_concat__WEBPACK_IMPORTED_MODULE_0__["concat"])(source, _observable_of__WEBPACK_IMPORTED_MODULE_1__["of"].apply(void 0, array)); };
|
30724 | }
|
30725 |
|
30726 |
|
30727 |
|
30728 | }),
|
30729 |
|
30730 | (function(module, __webpack_exports__, __webpack_require__) {
|
30731 |
|
30732 | "use strict";
|
30733 | __webpack_require__.r(__webpack_exports__);
|
30734 | __webpack_require__.d(__webpack_exports__, "every", function() { return every; });
|
30735 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
30736 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
30737 |
|
30738 |
|
30739 |
|
30740 | function every(predicate, thisArg) {
|
30741 | return function (source) { return source.lift(new EveryOperator(predicate, thisArg, source)); };
|
30742 | }
|
30743 | var EveryOperator = (function () {
|
30744 | function EveryOperator(predicate, thisArg, source) {
|
30745 | this.predicate = predicate;
|
30746 | this.thisArg = thisArg;
|
30747 | this.source = source;
|
30748 | }
|
30749 | EveryOperator.prototype.call = function (observer, source) {
|
30750 | return source.subscribe(new EverySubscriber(observer, this.predicate, this.thisArg, this.source));
|
30751 | };
|
30752 | return EveryOperator;
|
30753 | }());
|
30754 | var EverySubscriber = (function (_super) {
|
30755 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](EverySubscriber, _super);
|
30756 | function EverySubscriber(destination, predicate, thisArg, source) {
|
30757 | var _this = _super.call(this, destination) || this;
|
30758 | _this.predicate = predicate;
|
30759 | _this.thisArg = thisArg;
|
30760 | _this.source = source;
|
30761 | _this.index = 0;
|
30762 | _this.thisArg = thisArg || _this;
|
30763 | return _this;
|
30764 | }
|
30765 | EverySubscriber.prototype.notifyComplete = function (everyValueMatch) {
|
30766 | this.destination.next(everyValueMatch);
|
30767 | this.destination.complete();
|
30768 | };
|
30769 | EverySubscriber.prototype._next = function (value) {
|
30770 | var result = false;
|
30771 | try {
|
30772 | result = this.predicate.call(this.thisArg, value, this.index++, this.source);
|
30773 | }
|
30774 | catch (err) {
|
30775 | this.destination.error(err);
|
30776 | return;
|
30777 | }
|
30778 | if (!result) {
|
30779 | this.notifyComplete(false);
|
30780 | }
|
30781 | };
|
30782 | EverySubscriber.prototype._complete = function () {
|
30783 | this.notifyComplete(true);
|
30784 | };
|
30785 | return EverySubscriber;
|
30786 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
30787 |
|
30788 |
|
30789 |
|
30790 | }),
|
30791 |
|
30792 | (function(module, __webpack_exports__, __webpack_require__) {
|
30793 |
|
30794 | "use strict";
|
30795 | __webpack_require__.r(__webpack_exports__);
|
30796 | __webpack_require__.d(__webpack_exports__, "exhaust", function() { return exhaust; });
|
30797 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
30798 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(227);
|
30799 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(228);
|
30800 |
|
30801 |
|
30802 |
|
30803 |
|
30804 | function exhaust() {
|
30805 | return function (source) { return source.lift(new SwitchFirstOperator()); };
|
30806 | }
|
30807 | var SwitchFirstOperator = (function () {
|
30808 | function SwitchFirstOperator() {
|
30809 | }
|
30810 | SwitchFirstOperator.prototype.call = function (subscriber, source) {
|
30811 | return source.subscribe(new SwitchFirstSubscriber(subscriber));
|
30812 | };
|
30813 | return SwitchFirstOperator;
|
30814 | }());
|
30815 | var SwitchFirstSubscriber = (function (_super) {
|
30816 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SwitchFirstSubscriber, _super);
|
30817 | function SwitchFirstSubscriber(destination) {
|
30818 | var _this = _super.call(this, destination) || this;
|
30819 | _this.hasCompleted = false;
|
30820 | _this.hasSubscription = false;
|
30821 | return _this;
|
30822 | }
|
30823 | SwitchFirstSubscriber.prototype._next = function (value) {
|
30824 | if (!this.hasSubscription) {
|
30825 | this.hasSubscription = true;
|
30826 | this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, value));
|
30827 | }
|
30828 | };
|
30829 | SwitchFirstSubscriber.prototype._complete = function () {
|
30830 | this.hasCompleted = true;
|
30831 | if (!this.hasSubscription) {
|
30832 | this.destination.complete();
|
30833 | }
|
30834 | };
|
30835 | SwitchFirstSubscriber.prototype.notifyComplete = function (innerSub) {
|
30836 | this.remove(innerSub);
|
30837 | this.hasSubscription = false;
|
30838 | if (this.hasCompleted) {
|
30839 | this.destination.complete();
|
30840 | }
|
30841 | };
|
30842 | return SwitchFirstSubscriber;
|
30843 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
30844 |
|
30845 |
|
30846 |
|
30847 | }),
|
30848 |
|
30849 | (function(module, __webpack_exports__, __webpack_require__) {
|
30850 |
|
30851 | "use strict";
|
30852 | __webpack_require__.r(__webpack_exports__);
|
30853 | __webpack_require__.d(__webpack_exports__, "exhaustMap", function() { return exhaustMap; });
|
30854 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
30855 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(227);
|
30856 | var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(229);
|
30857 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(228);
|
30858 | var _map__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(224);
|
30859 | var _observable_from__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(241);
|
30860 |
|
30861 |
|
30862 |
|
30863 |
|
30864 |
|
30865 |
|
30866 |
|
30867 | function exhaustMap(project, resultSelector) {
|
30868 | if (resultSelector) {
|
30869 | return function (source) { return source.pipe(exhaustMap(function (a, i) { return Object(_observable_from__WEBPACK_IMPORTED_MODULE_5__["from"])(project(a, i)).pipe(Object(_map__WEBPACK_IMPORTED_MODULE_4__["map"])(function (b, ii) { return resultSelector(a, b, i, ii); })); })); };
|
30870 | }
|
30871 | return function (source) {
|
30872 | return source.lift(new ExhaustMapOperator(project));
|
30873 | };
|
30874 | }
|
30875 | var ExhaustMapOperator = (function () {
|
30876 | function ExhaustMapOperator(project) {
|
30877 | this.project = project;
|
30878 | }
|
30879 | ExhaustMapOperator.prototype.call = function (subscriber, source) {
|
30880 | return source.subscribe(new ExhaustMapSubscriber(subscriber, this.project));
|
30881 | };
|
30882 | return ExhaustMapOperator;
|
30883 | }());
|
30884 | var ExhaustMapSubscriber = (function (_super) {
|
30885 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ExhaustMapSubscriber, _super);
|
30886 | function ExhaustMapSubscriber(destination, project) {
|
30887 | var _this = _super.call(this, destination) || this;
|
30888 | _this.project = project;
|
30889 | _this.hasSubscription = false;
|
30890 | _this.hasCompleted = false;
|
30891 | _this.index = 0;
|
30892 | return _this;
|
30893 | }
|
30894 | ExhaustMapSubscriber.prototype._next = function (value) {
|
30895 | if (!this.hasSubscription) {
|
30896 | this.tryNext(value);
|
30897 | }
|
30898 | };
|
30899 | ExhaustMapSubscriber.prototype.tryNext = function (value) {
|
30900 | var result;
|
30901 | var index = this.index++;
|
30902 | try {
|
30903 | result = this.project(value, index);
|
30904 | }
|
30905 | catch (err) {
|
30906 | this.destination.error(err);
|
30907 | return;
|
30908 | }
|
30909 | this.hasSubscription = true;
|
30910 | this._innerSub(result, value, index);
|
30911 | };
|
30912 | ExhaustMapSubscriber.prototype._innerSub = function (result, value, index) {
|
30913 | var innerSubscriber = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__["InnerSubscriber"](this, value, index);
|
30914 | var destination = this.destination;
|
30915 | destination.add(innerSubscriber);
|
30916 | var innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(this, result, undefined, undefined, innerSubscriber);
|
30917 | if (innerSubscription !== innerSubscriber) {
|
30918 | destination.add(innerSubscription);
|
30919 | }
|
30920 | };
|
30921 | ExhaustMapSubscriber.prototype._complete = function () {
|
30922 | this.hasCompleted = true;
|
30923 | if (!this.hasSubscription) {
|
30924 | this.destination.complete();
|
30925 | }
|
30926 | this.unsubscribe();
|
30927 | };
|
30928 | ExhaustMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
30929 | this.destination.next(innerValue);
|
30930 | };
|
30931 | ExhaustMapSubscriber.prototype.notifyError = function (err) {
|
30932 | this.destination.error(err);
|
30933 | };
|
30934 | ExhaustMapSubscriber.prototype.notifyComplete = function (innerSub) {
|
30935 | var destination = this.destination;
|
30936 | destination.remove(innerSub);
|
30937 | this.hasSubscription = false;
|
30938 | if (this.hasCompleted) {
|
30939 | this.destination.complete();
|
30940 | }
|
30941 | };
|
30942 | return ExhaustMapSubscriber;
|
30943 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
30944 |
|
30945 |
|
30946 |
|
30947 | }),
|
30948 |
|
30949 | (function(module, __webpack_exports__, __webpack_require__) {
|
30950 |
|
30951 | "use strict";
|
30952 | __webpack_require__.r(__webpack_exports__);
|
30953 | __webpack_require__.d(__webpack_exports__, "expand", function() { return expand; });
|
30954 | __webpack_require__.d(__webpack_exports__, "ExpandOperator", function() { return ExpandOperator; });
|
30955 | __webpack_require__.d(__webpack_exports__, "ExpandSubscriber", function() { return ExpandSubscriber; });
|
30956 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
30957 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(227);
|
30958 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(228);
|
30959 |
|
30960 |
|
30961 |
|
30962 |
|
30963 | function expand(project, concurrent, scheduler) {
|
30964 | if (concurrent === void 0) {
|
30965 | concurrent = Number.POSITIVE_INFINITY;
|
30966 | }
|
30967 | if (scheduler === void 0) {
|
30968 | scheduler = undefined;
|
30969 | }
|
30970 | concurrent = (concurrent || 0) < 1 ? Number.POSITIVE_INFINITY : concurrent;
|
30971 | return function (source) { return source.lift(new ExpandOperator(project, concurrent, scheduler)); };
|
30972 | }
|
30973 | var ExpandOperator = (function () {
|
30974 | function ExpandOperator(project, concurrent, scheduler) {
|
30975 | this.project = project;
|
30976 | this.concurrent = concurrent;
|
30977 | this.scheduler = scheduler;
|
30978 | }
|
30979 | ExpandOperator.prototype.call = function (subscriber, source) {
|
30980 | return source.subscribe(new ExpandSubscriber(subscriber, this.project, this.concurrent, this.scheduler));
|
30981 | };
|
30982 | return ExpandOperator;
|
30983 | }());
|
30984 |
|
30985 | var ExpandSubscriber = (function (_super) {
|
30986 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ExpandSubscriber, _super);
|
30987 | function ExpandSubscriber(destination, project, concurrent, scheduler) {
|
30988 | var _this = _super.call(this, destination) || this;
|
30989 | _this.project = project;
|
30990 | _this.concurrent = concurrent;
|
30991 | _this.scheduler = scheduler;
|
30992 | _this.index = 0;
|
30993 | _this.active = 0;
|
30994 | _this.hasCompleted = false;
|
30995 | if (concurrent < Number.POSITIVE_INFINITY) {
|
30996 | _this.buffer = [];
|
30997 | }
|
30998 | return _this;
|
30999 | }
|
31000 | ExpandSubscriber.dispatch = function (arg) {
|
31001 | var subscriber = arg.subscriber, result = arg.result, value = arg.value, index = arg.index;
|
31002 | subscriber.subscribeToProjection(result, value, index);
|
31003 | };
|
31004 | ExpandSubscriber.prototype._next = function (value) {
|
31005 | var destination = this.destination;
|
31006 | if (destination.closed) {
|
31007 | this._complete();
|
31008 | return;
|
31009 | }
|
31010 | var index = this.index++;
|
31011 | if (this.active < this.concurrent) {
|
31012 | destination.next(value);
|
31013 | try {
|
31014 | var project = this.project;
|
31015 | var result = project(value, index);
|
31016 | if (!this.scheduler) {
|
31017 | this.subscribeToProjection(result, value, index);
|
31018 | }
|
31019 | else {
|
31020 | var state = { subscriber: this, result: result, value: value, index: index };
|
31021 | var destination_1 = this.destination;
|
31022 | destination_1.add(this.scheduler.schedule(ExpandSubscriber.dispatch, 0, state));
|
31023 | }
|
31024 | }
|
31025 | catch (e) {
|
31026 | destination.error(e);
|
31027 | }
|
31028 | }
|
31029 | else {
|
31030 | this.buffer.push(value);
|
31031 | }
|
31032 | };
|
31033 | ExpandSubscriber.prototype.subscribeToProjection = function (result, value, index) {
|
31034 | this.active++;
|
31035 | var destination = this.destination;
|
31036 | destination.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, result, value, index));
|
31037 | };
|
31038 | ExpandSubscriber.prototype._complete = function () {
|
31039 | this.hasCompleted = true;
|
31040 | if (this.hasCompleted && this.active === 0) {
|
31041 | this.destination.complete();
|
31042 | }
|
31043 | this.unsubscribe();
|
31044 | };
|
31045 | ExpandSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
31046 | this._next(innerValue);
|
31047 | };
|
31048 | ExpandSubscriber.prototype.notifyComplete = function (innerSub) {
|
31049 | var buffer = this.buffer;
|
31050 | var destination = this.destination;
|
31051 | destination.remove(innerSub);
|
31052 | this.active--;
|
31053 | if (buffer && buffer.length > 0) {
|
31054 | this._next(buffer.shift());
|
31055 | }
|
31056 | if (this.hasCompleted && this.active === 0) {
|
31057 | this.destination.complete();
|
31058 | }
|
31059 | };
|
31060 | return ExpandSubscriber;
|
31061 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
31062 |
|
31063 |
|
31064 |
|
31065 |
|
31066 | }),
|
31067 |
|
31068 | (function(module, __webpack_exports__, __webpack_require__) {
|
31069 |
|
31070 | "use strict";
|
31071 | __webpack_require__.r(__webpack_exports__);
|
31072 | __webpack_require__.d(__webpack_exports__, "finalize", function() { return finalize; });
|
31073 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
31074 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
31075 | var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(175);
|
31076 |
|
31077 |
|
31078 |
|
31079 |
|
31080 | function finalize(callback) {
|
31081 | return function (source) { return source.lift(new FinallyOperator(callback)); };
|
31082 | }
|
31083 | var FinallyOperator = (function () {
|
31084 | function FinallyOperator(callback) {
|
31085 | this.callback = callback;
|
31086 | }
|
31087 | FinallyOperator.prototype.call = function (subscriber, source) {
|
31088 | return source.subscribe(new FinallySubscriber(subscriber, this.callback));
|
31089 | };
|
31090 | return FinallyOperator;
|
31091 | }());
|
31092 | var FinallySubscriber = (function (_super) {
|
31093 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](FinallySubscriber, _super);
|
31094 | function FinallySubscriber(destination, callback) {
|
31095 | var _this = _super.call(this, destination) || this;
|
31096 | _this.add(new _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"](callback));
|
31097 | return _this;
|
31098 | }
|
31099 | return FinallySubscriber;
|
31100 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
31101 |
|
31102 |
|
31103 |
|
31104 | }),
|
31105 |
|
31106 | (function(module, __webpack_exports__, __webpack_require__) {
|
31107 |
|
31108 | "use strict";
|
31109 | __webpack_require__.r(__webpack_exports__);
|
31110 | __webpack_require__.d(__webpack_exports__, "find", function() { return find; });
|
31111 | __webpack_require__.d(__webpack_exports__, "FindValueOperator", function() { return FindValueOperator; });
|
31112 | __webpack_require__.d(__webpack_exports__, "FindValueSubscriber", function() { return FindValueSubscriber; });
|
31113 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
31114 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
31115 |
|
31116 |
|
31117 |
|
31118 | function find(predicate, thisArg) {
|
31119 | if (typeof predicate !== 'function') {
|
31120 | throw new TypeError('predicate is not a function');
|
31121 | }
|
31122 | return function (source) { return source.lift(new FindValueOperator(predicate, source, false, thisArg)); };
|
31123 | }
|
31124 | var FindValueOperator = (function () {
|
31125 | function FindValueOperator(predicate, source, yieldIndex, thisArg) {
|
31126 | this.predicate = predicate;
|
31127 | this.source = source;
|
31128 | this.yieldIndex = yieldIndex;
|
31129 | this.thisArg = thisArg;
|
31130 | }
|
31131 | FindValueOperator.prototype.call = function (observer, source) {
|
31132 | return source.subscribe(new FindValueSubscriber(observer, this.predicate, this.source, this.yieldIndex, this.thisArg));
|
31133 | };
|
31134 | return FindValueOperator;
|
31135 | }());
|
31136 |
|
31137 | var FindValueSubscriber = (function (_super) {
|
31138 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](FindValueSubscriber, _super);
|
31139 | function FindValueSubscriber(destination, predicate, source, yieldIndex, thisArg) {
|
31140 | var _this = _super.call(this, destination) || this;
|
31141 | _this.predicate = predicate;
|
31142 | _this.source = source;
|
31143 | _this.yieldIndex = yieldIndex;
|
31144 | _this.thisArg = thisArg;
|
31145 | _this.index = 0;
|
31146 | return _this;
|
31147 | }
|
31148 | FindValueSubscriber.prototype.notifyComplete = function (value) {
|
31149 | var destination = this.destination;
|
31150 | destination.next(value);
|
31151 | destination.complete();
|
31152 | this.unsubscribe();
|
31153 | };
|
31154 | FindValueSubscriber.prototype._next = function (value) {
|
31155 | var _a = this, predicate = _a.predicate, thisArg = _a.thisArg;
|
31156 | var index = this.index++;
|
31157 | try {
|
31158 | var result = predicate.call(thisArg || this, value, index, this.source);
|
31159 | if (result) {
|
31160 | this.notifyComplete(this.yieldIndex ? index : value);
|
31161 | }
|
31162 | }
|
31163 | catch (err) {
|
31164 | this.destination.error(err);
|
31165 | }
|
31166 | };
|
31167 | FindValueSubscriber.prototype._complete = function () {
|
31168 | this.notifyComplete(this.yieldIndex ? -1 : undefined);
|
31169 | };
|
31170 | return FindValueSubscriber;
|
31171 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
31172 |
|
31173 |
|
31174 |
|
31175 |
|
31176 | }),
|
31177 |
|
31178 | (function(module, __webpack_exports__, __webpack_require__) {
|
31179 |
|
31180 | "use strict";
|
31181 | __webpack_require__.r(__webpack_exports__);
|
31182 | __webpack_require__.d(__webpack_exports__, "findIndex", function() { return findIndex; });
|
31183 | var _operators_find__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(303);
|
31184 |
|
31185 |
|
31186 | function findIndex(predicate, thisArg) {
|
31187 | return function (source) { return source.lift(new _operators_find__WEBPACK_IMPORTED_MODULE_0__["FindValueOperator"](predicate, source, true, thisArg)); };
|
31188 | }
|
31189 |
|
31190 |
|
31191 |
|
31192 | }),
|
31193 |
|
31194 | (function(module, __webpack_exports__, __webpack_require__) {
|
31195 |
|
31196 | "use strict";
|
31197 | __webpack_require__.r(__webpack_exports__);
|
31198 | __webpack_require__.d(__webpack_exports__, "first", function() { return first; });
|
31199 | var _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(221);
|
31200 | var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(262);
|
31201 | var _take__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(296);
|
31202 | var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(286);
|
31203 | var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(295);
|
31204 | var _util_identity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(183);
|
31205 |
|
31206 |
|
31207 |
|
31208 |
|
31209 |
|
31210 |
|
31211 |
|
31212 | function first(predicate, defaultValue) {
|
31213 | var hasDefaultValue = arguments.length >= 2;
|
31214 | return function (source) { return source.pipe(predicate ? Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])(function (v, i) { return predicate(v, i, source); }) : _util_identity__WEBPACK_IMPORTED_MODULE_5__["identity"], Object(_take__WEBPACK_IMPORTED_MODULE_2__["take"])(1), hasDefaultValue ? Object(_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__["defaultIfEmpty"])(defaultValue) : Object(_throwIfEmpty__WEBPACK_IMPORTED_MODULE_4__["throwIfEmpty"])(function () { return new _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__["EmptyError"](); })); };
|
31215 | }
|
31216 |
|
31217 |
|
31218 |
|
31219 | }),
|
31220 |
|
31221 | (function(module, __webpack_exports__, __webpack_require__) {
|
31222 |
|
31223 | "use strict";
|
31224 | __webpack_require__.r(__webpack_exports__);
|
31225 | __webpack_require__.d(__webpack_exports__, "ignoreElements", function() { return ignoreElements; });
|
31226 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
31227 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
31228 |
|
31229 |
|
31230 |
|
31231 | function ignoreElements() {
|
31232 | return function ignoreElementsOperatorFunction(source) {
|
31233 | return source.lift(new IgnoreElementsOperator());
|
31234 | };
|
31235 | }
|
31236 | var IgnoreElementsOperator = (function () {
|
31237 | function IgnoreElementsOperator() {
|
31238 | }
|
31239 | IgnoreElementsOperator.prototype.call = function (subscriber, source) {
|
31240 | return source.subscribe(new IgnoreElementsSubscriber(subscriber));
|
31241 | };
|
31242 | return IgnoreElementsOperator;
|
31243 | }());
|
31244 | var IgnoreElementsSubscriber = (function (_super) {
|
31245 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](IgnoreElementsSubscriber, _super);
|
31246 | function IgnoreElementsSubscriber() {
|
31247 | return _super !== null && _super.apply(this, arguments) || this;
|
31248 | }
|
31249 | IgnoreElementsSubscriber.prototype._next = function (unused) {
|
31250 | };
|
31251 | return IgnoreElementsSubscriber;
|
31252 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
31253 |
|
31254 |
|
31255 |
|
31256 | }),
|
31257 |
|
31258 | (function(module, __webpack_exports__, __webpack_require__) {
|
31259 |
|
31260 | "use strict";
|
31261 | __webpack_require__.r(__webpack_exports__);
|
31262 | __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return isEmpty; });
|
31263 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
31264 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
31265 |
|
31266 |
|
31267 |
|
31268 | function isEmpty() {
|
31269 | return function (source) { return source.lift(new IsEmptyOperator()); };
|
31270 | }
|
31271 | var IsEmptyOperator = (function () {
|
31272 | function IsEmptyOperator() {
|
31273 | }
|
31274 | IsEmptyOperator.prototype.call = function (observer, source) {
|
31275 | return source.subscribe(new IsEmptySubscriber(observer));
|
31276 | };
|
31277 | return IsEmptyOperator;
|
31278 | }());
|
31279 | var IsEmptySubscriber = (function (_super) {
|
31280 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](IsEmptySubscriber, _super);
|
31281 | function IsEmptySubscriber(destination) {
|
31282 | return _super.call(this, destination) || this;
|
31283 | }
|
31284 | IsEmptySubscriber.prototype.notifyComplete = function (isEmpty) {
|
31285 | var destination = this.destination;
|
31286 | destination.next(isEmpty);
|
31287 | destination.complete();
|
31288 | };
|
31289 | IsEmptySubscriber.prototype._next = function (value) {
|
31290 | this.notifyComplete(false);
|
31291 | };
|
31292 | IsEmptySubscriber.prototype._complete = function () {
|
31293 | this.notifyComplete(true);
|
31294 | };
|
31295 | return IsEmptySubscriber;
|
31296 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
31297 |
|
31298 |
|
31299 |
|
31300 | }),
|
31301 |
|
31302 | (function(module, __webpack_exports__, __webpack_require__) {
|
31303 |
|
31304 | "use strict";
|
31305 | __webpack_require__.r(__webpack_exports__);
|
31306 | __webpack_require__.d(__webpack_exports__, "last", function() { return last; });
|
31307 | var _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(221);
|
31308 | var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(262);
|
31309 | var _takeLast__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(309);
|
31310 | var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(295);
|
31311 | var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(286);
|
31312 | var _util_identity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(183);
|
31313 |
|
31314 |
|
31315 |
|
31316 |
|
31317 |
|
31318 |
|
31319 |
|
31320 | function last(predicate, defaultValue) {
|
31321 | var hasDefaultValue = arguments.length >= 2;
|
31322 | return function (source) { return source.pipe(predicate ? Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])(function (v, i) { return predicate(v, i, source); }) : _util_identity__WEBPACK_IMPORTED_MODULE_5__["identity"], Object(_takeLast__WEBPACK_IMPORTED_MODULE_2__["takeLast"])(1), hasDefaultValue ? Object(_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_4__["defaultIfEmpty"])(defaultValue) : Object(_throwIfEmpty__WEBPACK_IMPORTED_MODULE_3__["throwIfEmpty"])(function () { return new _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__["EmptyError"](); })); };
|
31323 | }
|
31324 |
|
31325 |
|
31326 |
|
31327 | }),
|
31328 |
|
31329 | (function(module, __webpack_exports__, __webpack_require__) {
|
31330 |
|
31331 | "use strict";
|
31332 | __webpack_require__.r(__webpack_exports__);
|
31333 | __webpack_require__.d(__webpack_exports__, "takeLast", function() { return takeLast; });
|
31334 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
31335 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
31336 | var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(220);
|
31337 | var _observable_empty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(201);
|
31338 |
|
31339 |
|
31340 |
|
31341 |
|
31342 |
|
31343 | function takeLast(count) {
|
31344 | return function takeLastOperatorFunction(source) {
|
31345 | if (count === 0) {
|
31346 | return Object(_observable_empty__WEBPACK_IMPORTED_MODULE_3__["empty"])();
|
31347 | }
|
31348 | else {
|
31349 | return source.lift(new TakeLastOperator(count));
|
31350 | }
|
31351 | };
|
31352 | }
|
31353 | var TakeLastOperator = (function () {
|
31354 | function TakeLastOperator(total) {
|
31355 | this.total = total;
|
31356 | if (this.total < 0) {
|
31357 | throw new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__["ArgumentOutOfRangeError"];
|
31358 | }
|
31359 | }
|
31360 | TakeLastOperator.prototype.call = function (subscriber, source) {
|
31361 | return source.subscribe(new TakeLastSubscriber(subscriber, this.total));
|
31362 | };
|
31363 | return TakeLastOperator;
|
31364 | }());
|
31365 | var TakeLastSubscriber = (function (_super) {
|
31366 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](TakeLastSubscriber, _super);
|
31367 | function TakeLastSubscriber(destination, total) {
|
31368 | var _this = _super.call(this, destination) || this;
|
31369 | _this.total = total;
|
31370 | _this.ring = new Array();
|
31371 | _this.count = 0;
|
31372 | return _this;
|
31373 | }
|
31374 | TakeLastSubscriber.prototype._next = function (value) {
|
31375 | var ring = this.ring;
|
31376 | var total = this.total;
|
31377 | var count = this.count++;
|
31378 | if (ring.length < total) {
|
31379 | ring.push(value);
|
31380 | }
|
31381 | else {
|
31382 | var index = count % total;
|
31383 | ring[index] = value;
|
31384 | }
|
31385 | };
|
31386 | TakeLastSubscriber.prototype._complete = function () {
|
31387 | var destination = this.destination;
|
31388 | var count = this.count;
|
31389 | if (count > 0) {
|
31390 | var total = this.count >= this.total ? this.total : this.count;
|
31391 | var ring = this.ring;
|
31392 | for (var i = 0; i < total; i++) {
|
31393 | var idx = (count++) % total;
|
31394 | destination.next(ring[idx]);
|
31395 | }
|
31396 | }
|
31397 | destination.complete();
|
31398 | };
|
31399 | return TakeLastSubscriber;
|
31400 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
31401 |
|
31402 |
|
31403 |
|
31404 | }),
|
31405 |
|
31406 | (function(module, __webpack_exports__, __webpack_require__) {
|
31407 |
|
31408 | "use strict";
|
31409 | __webpack_require__.r(__webpack_exports__);
|
31410 | __webpack_require__.d(__webpack_exports__, "mapTo", function() { return mapTo; });
|
31411 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
31412 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
31413 |
|
31414 |
|
31415 |
|
31416 | function mapTo(value) {
|
31417 | return function (source) { return source.lift(new MapToOperator(value)); };
|
31418 | }
|
31419 | var MapToOperator = (function () {
|
31420 | function MapToOperator(value) {
|
31421 | this.value = value;
|
31422 | }
|
31423 | MapToOperator.prototype.call = function (subscriber, source) {
|
31424 | return source.subscribe(new MapToSubscriber(subscriber, this.value));
|
31425 | };
|
31426 | return MapToOperator;
|
31427 | }());
|
31428 | var MapToSubscriber = (function (_super) {
|
31429 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](MapToSubscriber, _super);
|
31430 | function MapToSubscriber(destination, value) {
|
31431 | var _this = _super.call(this, destination) || this;
|
31432 | _this.value = value;
|
31433 | return _this;
|
31434 | }
|
31435 | MapToSubscriber.prototype._next = function (x) {
|
31436 | this.destination.next(this.value);
|
31437 | };
|
31438 | return MapToSubscriber;
|
31439 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
31440 |
|
31441 |
|
31442 |
|
31443 | }),
|
31444 |
|
31445 | (function(module, __webpack_exports__, __webpack_require__) {
|
31446 |
|
31447 | "use strict";
|
31448 | __webpack_require__.r(__webpack_exports__);
|
31449 | __webpack_require__.d(__webpack_exports__, "materialize", function() { return materialize; });
|
31450 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
31451 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
31452 | var _Notification__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(200);
|
31453 |
|
31454 |
|
31455 |
|
31456 |
|
31457 | function materialize() {
|
31458 | return function materializeOperatorFunction(source) {
|
31459 | return source.lift(new MaterializeOperator());
|
31460 | };
|
31461 | }
|
31462 | var MaterializeOperator = (function () {
|
31463 | function MaterializeOperator() {
|
31464 | }
|
31465 | MaterializeOperator.prototype.call = function (subscriber, source) {
|
31466 | return source.subscribe(new MaterializeSubscriber(subscriber));
|
31467 | };
|
31468 | return MaterializeOperator;
|
31469 | }());
|
31470 | var MaterializeSubscriber = (function (_super) {
|
31471 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](MaterializeSubscriber, _super);
|
31472 | function MaterializeSubscriber(destination) {
|
31473 | return _super.call(this, destination) || this;
|
31474 | }
|
31475 | MaterializeSubscriber.prototype._next = function (value) {
|
31476 | this.destination.next(_Notification__WEBPACK_IMPORTED_MODULE_2__["Notification"].createNext(value));
|
31477 | };
|
31478 | MaterializeSubscriber.prototype._error = function (err) {
|
31479 | var destination = this.destination;
|
31480 | destination.next(_Notification__WEBPACK_IMPORTED_MODULE_2__["Notification"].createError(err));
|
31481 | destination.complete();
|
31482 | };
|
31483 | MaterializeSubscriber.prototype._complete = function () {
|
31484 | var destination = this.destination;
|
31485 | destination.next(_Notification__WEBPACK_IMPORTED_MODULE_2__["Notification"].createComplete());
|
31486 | destination.complete();
|
31487 | };
|
31488 | return MaterializeSubscriber;
|
31489 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
31490 |
|
31491 |
|
31492 |
|
31493 | }),
|
31494 |
|
31495 | (function(module, __webpack_exports__, __webpack_require__) {
|
31496 |
|
31497 | "use strict";
|
31498 | __webpack_require__.r(__webpack_exports__);
|
31499 | __webpack_require__.d(__webpack_exports__, "max", function() { return max; });
|
31500 | var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(313);
|
31501 |
|
31502 |
|
31503 | function max(comparer) {
|
31504 | var max = (typeof comparer === 'function')
|
31505 | ? function (x, y) { return comparer(x, y) > 0 ? x : y; }
|
31506 | : function (x, y) { return x > y ? x : y; };
|
31507 | return Object(_reduce__WEBPACK_IMPORTED_MODULE_0__["reduce"])(max);
|
31508 | }
|
31509 |
|
31510 |
|
31511 |
|
31512 | }),
|
31513 |
|
31514 | (function(module, __webpack_exports__, __webpack_require__) {
|
31515 |
|
31516 | "use strict";
|
31517 | __webpack_require__.r(__webpack_exports__);
|
31518 | __webpack_require__.d(__webpack_exports__, "reduce", function() { return reduce; });
|
31519 | var _scan__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(314);
|
31520 | var _takeLast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(309);
|
31521 | var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(286);
|
31522 | var _util_pipe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(182);
|
31523 |
|
31524 |
|
31525 |
|
31526 |
|
31527 |
|
31528 | function reduce(accumulator, seed) {
|
31529 | if (arguments.length >= 2) {
|
31530 | return function reduceOperatorFunctionWithSeed(source) {
|
31531 | return Object(_util_pipe__WEBPACK_IMPORTED_MODULE_3__["pipe"])(Object(_scan__WEBPACK_IMPORTED_MODULE_0__["scan"])(accumulator, seed), Object(_takeLast__WEBPACK_IMPORTED_MODULE_1__["takeLast"])(1), Object(_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_2__["defaultIfEmpty"])(seed))(source);
|
31532 | };
|
31533 | }
|
31534 | return function reduceOperatorFunction(source) {
|
31535 | return Object(_util_pipe__WEBPACK_IMPORTED_MODULE_3__["pipe"])(Object(_scan__WEBPACK_IMPORTED_MODULE_0__["scan"])(function (acc, value, index) { return accumulator(acc, value, index + 1); }), Object(_takeLast__WEBPACK_IMPORTED_MODULE_1__["takeLast"])(1))(source);
|
31536 | };
|
31537 | }
|
31538 |
|
31539 |
|
31540 |
|
31541 | }),
|
31542 |
|
31543 | (function(module, __webpack_exports__, __webpack_require__) {
|
31544 |
|
31545 | "use strict";
|
31546 | __webpack_require__.r(__webpack_exports__);
|
31547 | __webpack_require__.d(__webpack_exports__, "scan", function() { return scan; });
|
31548 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
31549 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
31550 |
|
31551 |
|
31552 |
|
31553 | function scan(accumulator, seed) {
|
31554 | var hasSeed = false;
|
31555 | if (arguments.length >= 2) {
|
31556 | hasSeed = true;
|
31557 | }
|
31558 | return function scanOperatorFunction(source) {
|
31559 | return source.lift(new ScanOperator(accumulator, seed, hasSeed));
|
31560 | };
|
31561 | }
|
31562 | var ScanOperator = (function () {
|
31563 | function ScanOperator(accumulator, seed, hasSeed) {
|
31564 | if (hasSeed === void 0) {
|
31565 | hasSeed = false;
|
31566 | }
|
31567 | this.accumulator = accumulator;
|
31568 | this.seed = seed;
|
31569 | this.hasSeed = hasSeed;
|
31570 | }
|
31571 | ScanOperator.prototype.call = function (subscriber, source) {
|
31572 | return source.subscribe(new ScanSubscriber(subscriber, this.accumulator, this.seed, this.hasSeed));
|
31573 | };
|
31574 | return ScanOperator;
|
31575 | }());
|
31576 | var ScanSubscriber = (function (_super) {
|
31577 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ScanSubscriber, _super);
|
31578 | function ScanSubscriber(destination, accumulator, _seed, hasSeed) {
|
31579 | var _this = _super.call(this, destination) || this;
|
31580 | _this.accumulator = accumulator;
|
31581 | _this._seed = _seed;
|
31582 | _this.hasSeed = hasSeed;
|
31583 | _this.index = 0;
|
31584 | return _this;
|
31585 | }
|
31586 | Object.defineProperty(ScanSubscriber.prototype, "seed", {
|
31587 | get: function () {
|
31588 | return this._seed;
|
31589 | },
|
31590 | set: function (value) {
|
31591 | this.hasSeed = true;
|
31592 | this._seed = value;
|
31593 | },
|
31594 | enumerable: true,
|
31595 | configurable: true
|
31596 | });
|
31597 | ScanSubscriber.prototype._next = function (value) {
|
31598 | if (!this.hasSeed) {
|
31599 | this.seed = value;
|
31600 | this.destination.next(value);
|
31601 | }
|
31602 | else {
|
31603 | return this._tryNext(value);
|
31604 | }
|
31605 | };
|
31606 | ScanSubscriber.prototype._tryNext = function (value) {
|
31607 | var index = this.index++;
|
31608 | var result;
|
31609 | try {
|
31610 | result = this.accumulator(this.seed, value, index);
|
31611 | }
|
31612 | catch (err) {
|
31613 | this.destination.error(err);
|
31614 | }
|
31615 | this.seed = result;
|
31616 | this.destination.next(result);
|
31617 | };
|
31618 | return ScanSubscriber;
|
31619 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
31620 |
|
31621 |
|
31622 |
|
31623 | }),
|
31624 |
|
31625 | (function(module, __webpack_exports__, __webpack_require__) {
|
31626 |
|
31627 | "use strict";
|
31628 | __webpack_require__.r(__webpack_exports__);
|
31629 | __webpack_require__.d(__webpack_exports__, "merge", function() { return merge; });
|
31630 | var _observable_merge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(256);
|
31631 |
|
31632 |
|
31633 | function merge() {
|
31634 | var observables = [];
|
31635 | for (var _i = 0; _i < arguments.length; _i++) {
|
31636 | observables[_i] = arguments[_i];
|
31637 | }
|
31638 | return function (source) { return source.lift.call(_observable_merge__WEBPACK_IMPORTED_MODULE_0__["merge"].apply(void 0, [source].concat(observables))); };
|
31639 | }
|
31640 |
|
31641 |
|
31642 |
|
31643 | }),
|
31644 |
|
31645 | (function(module, __webpack_exports__, __webpack_require__) {
|
31646 |
|
31647 | "use strict";
|
31648 | __webpack_require__.r(__webpack_exports__);
|
31649 | __webpack_require__.d(__webpack_exports__, "mergeMapTo", function() { return mergeMapTo; });
|
31650 | var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(240);
|
31651 |
|
31652 |
|
31653 | function mergeMapTo(innerObservable, resultSelector, concurrent) {
|
31654 | if (concurrent === void 0) {
|
31655 | concurrent = Number.POSITIVE_INFINITY;
|
31656 | }
|
31657 | if (typeof resultSelector === 'function') {
|
31658 | return Object(_mergeMap__WEBPACK_IMPORTED_MODULE_0__["mergeMap"])(function () { return innerObservable; }, resultSelector, concurrent);
|
31659 | }
|
31660 | if (typeof resultSelector === 'number') {
|
31661 | concurrent = resultSelector;
|
31662 | }
|
31663 | return Object(_mergeMap__WEBPACK_IMPORTED_MODULE_0__["mergeMap"])(function () { return innerObservable; }, concurrent);
|
31664 | }
|
31665 |
|
31666 |
|
31667 |
|
31668 | }),
|
31669 |
|
31670 | (function(module, __webpack_exports__, __webpack_require__) {
|
31671 |
|
31672 | "use strict";
|
31673 | __webpack_require__.r(__webpack_exports__);
|
31674 | __webpack_require__.d(__webpack_exports__, "mergeScan", function() { return mergeScan; });
|
31675 | __webpack_require__.d(__webpack_exports__, "MergeScanOperator", function() { return MergeScanOperator; });
|
31676 | __webpack_require__.d(__webpack_exports__, "MergeScanSubscriber", function() { return MergeScanSubscriber; });
|
31677 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
31678 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(228);
|
31679 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(227);
|
31680 | var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(229);
|
31681 |
|
31682 |
|
31683 |
|
31684 |
|
31685 |
|
31686 | function mergeScan(accumulator, seed, concurrent) {
|
31687 | if (concurrent === void 0) {
|
31688 | concurrent = Number.POSITIVE_INFINITY;
|
31689 | }
|
31690 | return function (source) { return source.lift(new MergeScanOperator(accumulator, seed, concurrent)); };
|
31691 | }
|
31692 | var MergeScanOperator = (function () {
|
31693 | function MergeScanOperator(accumulator, seed, concurrent) {
|
31694 | this.accumulator = accumulator;
|
31695 | this.seed = seed;
|
31696 | this.concurrent = concurrent;
|
31697 | }
|
31698 | MergeScanOperator.prototype.call = function (subscriber, source) {
|
31699 | return source.subscribe(new MergeScanSubscriber(subscriber, this.accumulator, this.seed, this.concurrent));
|
31700 | };
|
31701 | return MergeScanOperator;
|
31702 | }());
|
31703 |
|
31704 | var MergeScanSubscriber = (function (_super) {
|
31705 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](MergeScanSubscriber, _super);
|
31706 | function MergeScanSubscriber(destination, accumulator, acc, concurrent) {
|
31707 | var _this = _super.call(this, destination) || this;
|
31708 | _this.accumulator = accumulator;
|
31709 | _this.acc = acc;
|
31710 | _this.concurrent = concurrent;
|
31711 | _this.hasValue = false;
|
31712 | _this.hasCompleted = false;
|
31713 | _this.buffer = [];
|
31714 | _this.active = 0;
|
31715 | _this.index = 0;
|
31716 | return _this;
|
31717 | }
|
31718 | MergeScanSubscriber.prototype._next = function (value) {
|
31719 | if (this.active < this.concurrent) {
|
31720 | var index = this.index++;
|
31721 | var destination = this.destination;
|
31722 | var ish = void 0;
|
31723 | try {
|
31724 | var accumulator = this.accumulator;
|
31725 | ish = accumulator(this.acc, value, index);
|
31726 | }
|
31727 | catch (e) {
|
31728 | return destination.error(e);
|
31729 | }
|
31730 | this.active++;
|
31731 | this._innerSub(ish, value, index);
|
31732 | }
|
31733 | else {
|
31734 | this.buffer.push(value);
|
31735 | }
|
31736 | };
|
31737 | MergeScanSubscriber.prototype._innerSub = function (ish, value, index) {
|
31738 | var innerSubscriber = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_3__["InnerSubscriber"](this, value, index);
|
31739 | var destination = this.destination;
|
31740 | destination.add(innerSubscriber);
|
31741 | var innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__["subscribeToResult"])(this, ish, undefined, undefined, innerSubscriber);
|
31742 | if (innerSubscription !== innerSubscriber) {
|
31743 | destination.add(innerSubscription);
|
31744 | }
|
31745 | };
|
31746 | MergeScanSubscriber.prototype._complete = function () {
|
31747 | this.hasCompleted = true;
|
31748 | if (this.active === 0 && this.buffer.length === 0) {
|
31749 | if (this.hasValue === false) {
|
31750 | this.destination.next(this.acc);
|
31751 | }
|
31752 | this.destination.complete();
|
31753 | }
|
31754 | this.unsubscribe();
|
31755 | };
|
31756 | MergeScanSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
31757 | var destination = this.destination;
|
31758 | this.acc = innerValue;
|
31759 | this.hasValue = true;
|
31760 | destination.next(innerValue);
|
31761 | };
|
31762 | MergeScanSubscriber.prototype.notifyComplete = function (innerSub) {
|
31763 | var buffer = this.buffer;
|
31764 | var destination = this.destination;
|
31765 | destination.remove(innerSub);
|
31766 | this.active--;
|
31767 | if (buffer.length > 0) {
|
31768 | this._next(buffer.shift());
|
31769 | }
|
31770 | else if (this.active === 0 && this.hasCompleted) {
|
31771 | if (this.hasValue === false) {
|
31772 | this.destination.next(this.acc);
|
31773 | }
|
31774 | this.destination.complete();
|
31775 | }
|
31776 | };
|
31777 | return MergeScanSubscriber;
|
31778 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"]));
|
31779 |
|
31780 |
|
31781 |
|
31782 |
|
31783 | }),
|
31784 |
|
31785 | (function(module, __webpack_exports__, __webpack_require__) {
|
31786 |
|
31787 | "use strict";
|
31788 | __webpack_require__.r(__webpack_exports__);
|
31789 | __webpack_require__.d(__webpack_exports__, "min", function() { return min; });
|
31790 | var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(313);
|
31791 |
|
31792 |
|
31793 | function min(comparer) {
|
31794 | var min = (typeof comparer === 'function')
|
31795 | ? function (x, y) { return comparer(x, y) < 0 ? x : y; }
|
31796 | : function (x, y) { return x < y ? x : y; };
|
31797 | return Object(_reduce__WEBPACK_IMPORTED_MODULE_0__["reduce"])(min);
|
31798 | }
|
31799 |
|
31800 |
|
31801 |
|
31802 | }),
|
31803 |
|
31804 | (function(module, __webpack_exports__, __webpack_require__) {
|
31805 |
|
31806 | "use strict";
|
31807 | __webpack_require__.r(__webpack_exports__);
|
31808 | __webpack_require__.d(__webpack_exports__, "multicast", function() { return multicast; });
|
31809 | __webpack_require__.d(__webpack_exports__, "MulticastOperator", function() { return MulticastOperator; });
|
31810 | var _observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(184);
|
31811 |
|
31812 |
|
31813 | function multicast(subjectOrSubjectFactory, selector) {
|
31814 | return function multicastOperatorFunction(source) {
|
31815 | var subjectFactory;
|
31816 | if (typeof subjectOrSubjectFactory === 'function') {
|
31817 | subjectFactory = subjectOrSubjectFactory;
|
31818 | }
|
31819 | else {
|
31820 | subjectFactory = function subjectFactory() {
|
31821 | return subjectOrSubjectFactory;
|
31822 | };
|
31823 | }
|
31824 | if (typeof selector === 'function') {
|
31825 | return source.lift(new MulticastOperator(subjectFactory, selector));
|
31826 | }
|
31827 | var connectable = Object.create(source, _observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_0__["connectableObservableDescriptor"]);
|
31828 | connectable.source = source;
|
31829 | connectable.subjectFactory = subjectFactory;
|
31830 | return connectable;
|
31831 | };
|
31832 | }
|
31833 | var MulticastOperator = (function () {
|
31834 | function MulticastOperator(subjectFactory, selector) {
|
31835 | this.subjectFactory = subjectFactory;
|
31836 | this.selector = selector;
|
31837 | }
|
31838 | MulticastOperator.prototype.call = function (subscriber, source) {
|
31839 | var selector = this.selector;
|
31840 | var subject = this.subjectFactory();
|
31841 | var subscription = selector(subject).subscribe(subscriber);
|
31842 | subscription.add(source.subscribe(subject));
|
31843 | return subscription;
|
31844 | };
|
31845 | return MulticastOperator;
|
31846 | }());
|
31847 |
|
31848 |
|
31849 |
|
31850 |
|
31851 | }),
|
31852 |
|
31853 | (function(module, __webpack_exports__, __webpack_require__) {
|
31854 |
|
31855 | "use strict";
|
31856 | __webpack_require__.r(__webpack_exports__);
|
31857 | __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return onErrorResumeNext; });
|
31858 | __webpack_require__.d(__webpack_exports__, "onErrorResumeNextStatic", function() { return onErrorResumeNextStatic; });
|
31859 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
31860 | var _observable_from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(241);
|
31861 | var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(176);
|
31862 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(227);
|
31863 | var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(229);
|
31864 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(228);
|
31865 |
|
31866 |
|
31867 |
|
31868 |
|
31869 |
|
31870 |
|
31871 |
|
31872 | function onErrorResumeNext() {
|
31873 | var nextSources = [];
|
31874 | for (var _i = 0; _i < arguments.length; _i++) {
|
31875 | nextSources[_i] = arguments[_i];
|
31876 | }
|
31877 | if (nextSources.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_2__["isArray"])(nextSources[0])) {
|
31878 | nextSources = nextSources[0];
|
31879 | }
|
31880 | return function (source) { return source.lift(new OnErrorResumeNextOperator(nextSources)); };
|
31881 | }
|
31882 | function onErrorResumeNextStatic() {
|
31883 | var nextSources = [];
|
31884 | for (var _i = 0; _i < arguments.length; _i++) {
|
31885 | nextSources[_i] = arguments[_i];
|
31886 | }
|
31887 | var source = null;
|
31888 | if (nextSources.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_2__["isArray"])(nextSources[0])) {
|
31889 | nextSources = nextSources[0];
|
31890 | }
|
31891 | source = nextSources.shift();
|
31892 | return Object(_observable_from__WEBPACK_IMPORTED_MODULE_1__["from"])(source, null).lift(new OnErrorResumeNextOperator(nextSources));
|
31893 | }
|
31894 | var OnErrorResumeNextOperator = (function () {
|
31895 | function OnErrorResumeNextOperator(nextSources) {
|
31896 | this.nextSources = nextSources;
|
31897 | }
|
31898 | OnErrorResumeNextOperator.prototype.call = function (subscriber, source) {
|
31899 | return source.subscribe(new OnErrorResumeNextSubscriber(subscriber, this.nextSources));
|
31900 | };
|
31901 | return OnErrorResumeNextOperator;
|
31902 | }());
|
31903 | var OnErrorResumeNextSubscriber = (function (_super) {
|
31904 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](OnErrorResumeNextSubscriber, _super);
|
31905 | function OnErrorResumeNextSubscriber(destination, nextSources) {
|
31906 | var _this = _super.call(this, destination) || this;
|
31907 | _this.destination = destination;
|
31908 | _this.nextSources = nextSources;
|
31909 | return _this;
|
31910 | }
|
31911 | OnErrorResumeNextSubscriber.prototype.notifyError = function (error, innerSub) {
|
31912 | this.subscribeToNextSource();
|
31913 | };
|
31914 | OnErrorResumeNextSubscriber.prototype.notifyComplete = function (innerSub) {
|
31915 | this.subscribeToNextSource();
|
31916 | };
|
31917 | OnErrorResumeNextSubscriber.prototype._error = function (err) {
|
31918 | this.subscribeToNextSource();
|
31919 | this.unsubscribe();
|
31920 | };
|
31921 | OnErrorResumeNextSubscriber.prototype._complete = function () {
|
31922 | this.subscribeToNextSource();
|
31923 | this.unsubscribe();
|
31924 | };
|
31925 | OnErrorResumeNextSubscriber.prototype.subscribeToNextSource = function () {
|
31926 | var next = this.nextSources.shift();
|
31927 | if (!!next) {
|
31928 | var innerSubscriber = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_4__["InnerSubscriber"](this, undefined, undefined);
|
31929 | var destination = this.destination;
|
31930 | destination.add(innerSubscriber);
|
31931 | var innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__["subscribeToResult"])(this, next, undefined, undefined, innerSubscriber);
|
31932 | if (innerSubscription !== innerSubscriber) {
|
31933 | destination.add(innerSubscription);
|
31934 | }
|
31935 | }
|
31936 | else {
|
31937 | this.destination.complete();
|
31938 | }
|
31939 | };
|
31940 | return OnErrorResumeNextSubscriber;
|
31941 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"]));
|
31942 |
|
31943 |
|
31944 |
|
31945 | }),
|
31946 |
|
31947 | (function(module, __webpack_exports__, __webpack_require__) {
|
31948 |
|
31949 | "use strict";
|
31950 | __webpack_require__.r(__webpack_exports__);
|
31951 | __webpack_require__.d(__webpack_exports__, "pairwise", function() { return pairwise; });
|
31952 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
31953 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
31954 |
|
31955 |
|
31956 |
|
31957 | function pairwise() {
|
31958 | return function (source) { return source.lift(new PairwiseOperator()); };
|
31959 | }
|
31960 | var PairwiseOperator = (function () {
|
31961 | function PairwiseOperator() {
|
31962 | }
|
31963 | PairwiseOperator.prototype.call = function (subscriber, source) {
|
31964 | return source.subscribe(new PairwiseSubscriber(subscriber));
|
31965 | };
|
31966 | return PairwiseOperator;
|
31967 | }());
|
31968 | var PairwiseSubscriber = (function (_super) {
|
31969 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](PairwiseSubscriber, _super);
|
31970 | function PairwiseSubscriber(destination) {
|
31971 | var _this = _super.call(this, destination) || this;
|
31972 | _this.hasPrev = false;
|
31973 | return _this;
|
31974 | }
|
31975 | PairwiseSubscriber.prototype._next = function (value) {
|
31976 | var pair;
|
31977 | if (this.hasPrev) {
|
31978 | pair = [this.prev, value];
|
31979 | }
|
31980 | else {
|
31981 | this.hasPrev = true;
|
31982 | }
|
31983 | this.prev = value;
|
31984 | if (pair) {
|
31985 | this.destination.next(pair);
|
31986 | }
|
31987 | };
|
31988 | return PairwiseSubscriber;
|
31989 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
31990 |
|
31991 |
|
31992 |
|
31993 | }),
|
31994 |
|
31995 | (function(module, __webpack_exports__, __webpack_require__) {
|
31996 |
|
31997 | "use strict";
|
31998 | __webpack_require__.r(__webpack_exports__);
|
31999 | __webpack_require__.d(__webpack_exports__, "partition", function() { return partition; });
|
32000 | var _util_not__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(261);
|
32001 | var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(262);
|
32002 |
|
32003 |
|
32004 |
|
32005 | function partition(predicate, thisArg) {
|
32006 | return function (source) {
|
32007 | return [
|
32008 | Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])(predicate, thisArg)(source),
|
32009 | Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])(Object(_util_not__WEBPACK_IMPORTED_MODULE_0__["not"])(predicate, thisArg))(source)
|
32010 | ];
|
32011 | };
|
32012 | }
|
32013 |
|
32014 |
|
32015 |
|
32016 | }),
|
32017 |
|
32018 | (function(module, __webpack_exports__, __webpack_require__) {
|
32019 |
|
32020 | "use strict";
|
32021 | __webpack_require__.r(__webpack_exports__);
|
32022 | __webpack_require__.d(__webpack_exports__, "pluck", function() { return pluck; });
|
32023 | var _map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(224);
|
32024 |
|
32025 |
|
32026 | function pluck() {
|
32027 | var properties = [];
|
32028 | for (var _i = 0; _i < arguments.length; _i++) {
|
32029 | properties[_i] = arguments[_i];
|
32030 | }
|
32031 | var length = properties.length;
|
32032 | if (length === 0) {
|
32033 | throw new Error('list of properties cannot be empty.');
|
32034 | }
|
32035 | return function (source) { return Object(_map__WEBPACK_IMPORTED_MODULE_0__["map"])(plucker(properties, length))(source); };
|
32036 | }
|
32037 | function plucker(props, length) {
|
32038 | var mapper = function (x) {
|
32039 | var currentProp = x;
|
32040 | for (var i = 0; i < length; i++) {
|
32041 | var p = currentProp[props[i]];
|
32042 | if (typeof p !== 'undefined') {
|
32043 | currentProp = p;
|
32044 | }
|
32045 | else {
|
32046 | return undefined;
|
32047 | }
|
32048 | }
|
32049 | return currentProp;
|
32050 | };
|
32051 | return mapper;
|
32052 | }
|
32053 |
|
32054 |
|
32055 |
|
32056 | }),
|
32057 |
|
32058 | (function(module, __webpack_exports__, __webpack_require__) {
|
32059 |
|
32060 | "use strict";
|
32061 | __webpack_require__.r(__webpack_exports__);
|
32062 | __webpack_require__.d(__webpack_exports__, "publish", function() { return publish; });
|
32063 | var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(185);
|
32064 | var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(319);
|
32065 |
|
32066 |
|
32067 |
|
32068 | function publish(selector) {
|
32069 | return selector ?
|
32070 | Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(function () { return new _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"](); }, selector) :
|
32071 | Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(new _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"]());
|
32072 | }
|
32073 |
|
32074 |
|
32075 |
|
32076 | }),
|
32077 |
|
32078 | (function(module, __webpack_exports__, __webpack_require__) {
|
32079 |
|
32080 | "use strict";
|
32081 | __webpack_require__.r(__webpack_exports__);
|
32082 | __webpack_require__.d(__webpack_exports__, "publishBehavior", function() { return publishBehavior; });
|
32083 | var _BehaviorSubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(190);
|
32084 | var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(319);
|
32085 |
|
32086 |
|
32087 |
|
32088 | function publishBehavior(value) {
|
32089 | return function (source) { return Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(new _BehaviorSubject__WEBPACK_IMPORTED_MODULE_0__["BehaviorSubject"](value))(source); };
|
32090 | }
|
32091 |
|
32092 |
|
32093 |
|
32094 | }),
|
32095 |
|
32096 | (function(module, __webpack_exports__, __webpack_require__) {
|
32097 |
|
32098 | "use strict";
|
32099 | __webpack_require__.r(__webpack_exports__);
|
32100 | __webpack_require__.d(__webpack_exports__, "publishLast", function() { return publishLast; });
|
32101 | var _AsyncSubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(208);
|
32102 | var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(319);
|
32103 |
|
32104 |
|
32105 |
|
32106 | function publishLast() {
|
32107 | return function (source) { return Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(new _AsyncSubject__WEBPACK_IMPORTED_MODULE_0__["AsyncSubject"]())(source); };
|
32108 | }
|
32109 |
|
32110 |
|
32111 |
|
32112 | }),
|
32113 |
|
32114 | (function(module, __webpack_exports__, __webpack_require__) {
|
32115 |
|
32116 | "use strict";
|
32117 | __webpack_require__.r(__webpack_exports__);
|
32118 | __webpack_require__.d(__webpack_exports__, "publishReplay", function() { return publishReplay; });
|
32119 | var _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(191);
|
32120 | var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(319);
|
32121 |
|
32122 |
|
32123 |
|
32124 | function publishReplay(bufferSize, windowTime, selectorOrScheduler, scheduler) {
|
32125 | if (selectorOrScheduler && typeof selectorOrScheduler !== 'function') {
|
32126 | scheduler = selectorOrScheduler;
|
32127 | }
|
32128 | var selector = typeof selectorOrScheduler === 'function' ? selectorOrScheduler : undefined;
|
32129 | var subject = new _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__["ReplaySubject"](bufferSize, windowTime, scheduler);
|
32130 | return function (source) { return Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(function () { return subject; }, selector)(source); };
|
32131 | }
|
32132 |
|
32133 |
|
32134 |
|
32135 | }),
|
32136 |
|
32137 | (function(module, __webpack_exports__, __webpack_require__) {
|
32138 |
|
32139 | "use strict";
|
32140 | __webpack_require__.r(__webpack_exports__);
|
32141 | __webpack_require__.d(__webpack_exports__, "race", function() { return race; });
|
32142 | var _util_isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(176);
|
32143 | var _observable_race__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(263);
|
32144 |
|
32145 |
|
32146 |
|
32147 | function race() {
|
32148 | var observables = [];
|
32149 | for (var _i = 0; _i < arguments.length; _i++) {
|
32150 | observables[_i] = arguments[_i];
|
32151 | }
|
32152 | return function raceOperatorFunction(source) {
|
32153 | if (observables.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_0__["isArray"])(observables[0])) {
|
32154 | observables = observables[0];
|
32155 | }
|
32156 | return source.lift.call(_observable_race__WEBPACK_IMPORTED_MODULE_1__["race"].apply(void 0, [source].concat(observables)));
|
32157 | };
|
32158 | }
|
32159 |
|
32160 |
|
32161 |
|
32162 | }),
|
32163 |
|
32164 | (function(module, __webpack_exports__, __webpack_require__) {
|
32165 |
|
32166 | "use strict";
|
32167 | __webpack_require__.r(__webpack_exports__);
|
32168 | __webpack_require__.d(__webpack_exports__, "repeat", function() { return repeat; });
|
32169 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
32170 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
32171 | var _observable_empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(201);
|
32172 |
|
32173 |
|
32174 |
|
32175 |
|
32176 | function repeat(count) {
|
32177 | if (count === void 0) {
|
32178 | count = -1;
|
32179 | }
|
32180 | return function (source) {
|
32181 | if (count === 0) {
|
32182 | return Object(_observable_empty__WEBPACK_IMPORTED_MODULE_2__["empty"])();
|
32183 | }
|
32184 | else if (count < 0) {
|
32185 | return source.lift(new RepeatOperator(-1, source));
|
32186 | }
|
32187 | else {
|
32188 | return source.lift(new RepeatOperator(count - 1, source));
|
32189 | }
|
32190 | };
|
32191 | }
|
32192 | var RepeatOperator = (function () {
|
32193 | function RepeatOperator(count, source) {
|
32194 | this.count = count;
|
32195 | this.source = source;
|
32196 | }
|
32197 | RepeatOperator.prototype.call = function (subscriber, source) {
|
32198 | return source.subscribe(new RepeatSubscriber(subscriber, this.count, this.source));
|
32199 | };
|
32200 | return RepeatOperator;
|
32201 | }());
|
32202 | var RepeatSubscriber = (function (_super) {
|
32203 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RepeatSubscriber, _super);
|
32204 | function RepeatSubscriber(destination, count, source) {
|
32205 | var _this = _super.call(this, destination) || this;
|
32206 | _this.count = count;
|
32207 | _this.source = source;
|
32208 | return _this;
|
32209 | }
|
32210 | RepeatSubscriber.prototype.complete = function () {
|
32211 | if (!this.isStopped) {
|
32212 | var _a = this, source = _a.source, count = _a.count;
|
32213 | if (count === 0) {
|
32214 | return _super.prototype.complete.call(this);
|
32215 | }
|
32216 | else if (count > -1) {
|
32217 | this.count = count - 1;
|
32218 | }
|
32219 | source.subscribe(this._unsubscribeAndRecycle());
|
32220 | }
|
32221 | };
|
32222 | return RepeatSubscriber;
|
32223 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
32224 |
|
32225 |
|
32226 |
|
32227 | }),
|
32228 |
|
32229 | (function(module, __webpack_exports__, __webpack_require__) {
|
32230 |
|
32231 | "use strict";
|
32232 | __webpack_require__.r(__webpack_exports__);
|
32233 | __webpack_require__.d(__webpack_exports__, "repeatWhen", function() { return repeatWhen; });
|
32234 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
32235 | var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(185);
|
32236 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(227);
|
32237 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(228);
|
32238 |
|
32239 |
|
32240 |
|
32241 |
|
32242 |
|
32243 | function repeatWhen(notifier) {
|
32244 | return function (source) { return source.lift(new RepeatWhenOperator(notifier)); };
|
32245 | }
|
32246 | var RepeatWhenOperator = (function () {
|
32247 | function RepeatWhenOperator(notifier) {
|
32248 | this.notifier = notifier;
|
32249 | }
|
32250 | RepeatWhenOperator.prototype.call = function (subscriber, source) {
|
32251 | return source.subscribe(new RepeatWhenSubscriber(subscriber, this.notifier, source));
|
32252 | };
|
32253 | return RepeatWhenOperator;
|
32254 | }());
|
32255 | var RepeatWhenSubscriber = (function (_super) {
|
32256 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RepeatWhenSubscriber, _super);
|
32257 | function RepeatWhenSubscriber(destination, notifier, source) {
|
32258 | var _this = _super.call(this, destination) || this;
|
32259 | _this.notifier = notifier;
|
32260 | _this.source = source;
|
32261 | _this.sourceIsBeingSubscribedTo = true;
|
32262 | return _this;
|
32263 | }
|
32264 | RepeatWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
32265 | this.sourceIsBeingSubscribedTo = true;
|
32266 | this.source.subscribe(this);
|
32267 | };
|
32268 | RepeatWhenSubscriber.prototype.notifyComplete = function (innerSub) {
|
32269 | if (this.sourceIsBeingSubscribedTo === false) {
|
32270 | return _super.prototype.complete.call(this);
|
32271 | }
|
32272 | };
|
32273 | RepeatWhenSubscriber.prototype.complete = function () {
|
32274 | this.sourceIsBeingSubscribedTo = false;
|
32275 | if (!this.isStopped) {
|
32276 | if (!this.retries) {
|
32277 | this.subscribeToRetries();
|
32278 | }
|
32279 | if (!this.retriesSubscription || this.retriesSubscription.closed) {
|
32280 | return _super.prototype.complete.call(this);
|
32281 | }
|
32282 | this._unsubscribeAndRecycle();
|
32283 | this.notifications.next();
|
32284 | }
|
32285 | };
|
32286 | RepeatWhenSubscriber.prototype._unsubscribe = function () {
|
32287 | var _a = this, notifications = _a.notifications, retriesSubscription = _a.retriesSubscription;
|
32288 | if (notifications) {
|
32289 | notifications.unsubscribe();
|
32290 | this.notifications = null;
|
32291 | }
|
32292 | if (retriesSubscription) {
|
32293 | retriesSubscription.unsubscribe();
|
32294 | this.retriesSubscription = null;
|
32295 | }
|
32296 | this.retries = null;
|
32297 | };
|
32298 | RepeatWhenSubscriber.prototype._unsubscribeAndRecycle = function () {
|
32299 | var _unsubscribe = this._unsubscribe;
|
32300 | this._unsubscribe = null;
|
32301 | _super.prototype._unsubscribeAndRecycle.call(this);
|
32302 | this._unsubscribe = _unsubscribe;
|
32303 | return this;
|
32304 | };
|
32305 | RepeatWhenSubscriber.prototype.subscribeToRetries = function () {
|
32306 | this.notifications = new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]();
|
32307 | var retries;
|
32308 | try {
|
32309 | var notifier = this.notifier;
|
32310 | retries = notifier(this.notifications);
|
32311 | }
|
32312 | catch (e) {
|
32313 | return _super.prototype.complete.call(this);
|
32314 | }
|
32315 | this.retries = retries;
|
32316 | this.retriesSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(this, retries);
|
32317 | };
|
32318 | return RepeatWhenSubscriber;
|
32319 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"]));
|
32320 |
|
32321 |
|
32322 |
|
32323 | }),
|
32324 |
|
32325 | (function(module, __webpack_exports__, __webpack_require__) {
|
32326 |
|
32327 | "use strict";
|
32328 | __webpack_require__.r(__webpack_exports__);
|
32329 | __webpack_require__.d(__webpack_exports__, "retry", function() { return retry; });
|
32330 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
32331 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
32332 |
|
32333 |
|
32334 |
|
32335 | function retry(count) {
|
32336 | if (count === void 0) {
|
32337 | count = -1;
|
32338 | }
|
32339 | return function (source) { return source.lift(new RetryOperator(count, source)); };
|
32340 | }
|
32341 | var RetryOperator = (function () {
|
32342 | function RetryOperator(count, source) {
|
32343 | this.count = count;
|
32344 | this.source = source;
|
32345 | }
|
32346 | RetryOperator.prototype.call = function (subscriber, source) {
|
32347 | return source.subscribe(new RetrySubscriber(subscriber, this.count, this.source));
|
32348 | };
|
32349 | return RetryOperator;
|
32350 | }());
|
32351 | var RetrySubscriber = (function (_super) {
|
32352 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RetrySubscriber, _super);
|
32353 | function RetrySubscriber(destination, count, source) {
|
32354 | var _this = _super.call(this, destination) || this;
|
32355 | _this.count = count;
|
32356 | _this.source = source;
|
32357 | return _this;
|
32358 | }
|
32359 | RetrySubscriber.prototype.error = function (err) {
|
32360 | if (!this.isStopped) {
|
32361 | var _a = this, source = _a.source, count = _a.count;
|
32362 | if (count === 0) {
|
32363 | return _super.prototype.error.call(this, err);
|
32364 | }
|
32365 | else if (count > -1) {
|
32366 | this.count = count - 1;
|
32367 | }
|
32368 | source.subscribe(this._unsubscribeAndRecycle());
|
32369 | }
|
32370 | };
|
32371 | return RetrySubscriber;
|
32372 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
32373 |
|
32374 |
|
32375 |
|
32376 | }),
|
32377 |
|
32378 | (function(module, __webpack_exports__, __webpack_require__) {
|
32379 |
|
32380 | "use strict";
|
32381 | __webpack_require__.r(__webpack_exports__);
|
32382 | __webpack_require__.d(__webpack_exports__, "retryWhen", function() { return retryWhen; });
|
32383 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
32384 | var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(185);
|
32385 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(227);
|
32386 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(228);
|
32387 |
|
32388 |
|
32389 |
|
32390 |
|
32391 |
|
32392 | function retryWhen(notifier) {
|
32393 | return function (source) { return source.lift(new RetryWhenOperator(notifier, source)); };
|
32394 | }
|
32395 | var RetryWhenOperator = (function () {
|
32396 | function RetryWhenOperator(notifier, source) {
|
32397 | this.notifier = notifier;
|
32398 | this.source = source;
|
32399 | }
|
32400 | RetryWhenOperator.prototype.call = function (subscriber, source) {
|
32401 | return source.subscribe(new RetryWhenSubscriber(subscriber, this.notifier, this.source));
|
32402 | };
|
32403 | return RetryWhenOperator;
|
32404 | }());
|
32405 | var RetryWhenSubscriber = (function (_super) {
|
32406 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RetryWhenSubscriber, _super);
|
32407 | function RetryWhenSubscriber(destination, notifier, source) {
|
32408 | var _this = _super.call(this, destination) || this;
|
32409 | _this.notifier = notifier;
|
32410 | _this.source = source;
|
32411 | return _this;
|
32412 | }
|
32413 | RetryWhenSubscriber.prototype.error = function (err) {
|
32414 | if (!this.isStopped) {
|
32415 | var errors = this.errors;
|
32416 | var retries = this.retries;
|
32417 | var retriesSubscription = this.retriesSubscription;
|
32418 | if (!retries) {
|
32419 | errors = new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]();
|
32420 | try {
|
32421 | var notifier = this.notifier;
|
32422 | retries = notifier(errors);
|
32423 | }
|
32424 | catch (e) {
|
32425 | return _super.prototype.error.call(this, e);
|
32426 | }
|
32427 | retriesSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(this, retries);
|
32428 | }
|
32429 | else {
|
32430 | this.errors = null;
|
32431 | this.retriesSubscription = null;
|
32432 | }
|
32433 | this._unsubscribeAndRecycle();
|
32434 | this.errors = errors;
|
32435 | this.retries = retries;
|
32436 | this.retriesSubscription = retriesSubscription;
|
32437 | errors.next(err);
|
32438 | }
|
32439 | };
|
32440 | RetryWhenSubscriber.prototype._unsubscribe = function () {
|
32441 | var _a = this, errors = _a.errors, retriesSubscription = _a.retriesSubscription;
|
32442 | if (errors) {
|
32443 | errors.unsubscribe();
|
32444 | this.errors = null;
|
32445 | }
|
32446 | if (retriesSubscription) {
|
32447 | retriesSubscription.unsubscribe();
|
32448 | this.retriesSubscription = null;
|
32449 | }
|
32450 | this.retries = null;
|
32451 | };
|
32452 | RetryWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
32453 | var _unsubscribe = this._unsubscribe;
|
32454 | this._unsubscribe = null;
|
32455 | this._unsubscribeAndRecycle();
|
32456 | this._unsubscribe = _unsubscribe;
|
32457 | this.source.subscribe(this);
|
32458 | };
|
32459 | return RetryWhenSubscriber;
|
32460 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"]));
|
32461 |
|
32462 |
|
32463 |
|
32464 | }),
|
32465 |
|
32466 | (function(module, __webpack_exports__, __webpack_require__) {
|
32467 |
|
32468 | "use strict";
|
32469 | __webpack_require__.r(__webpack_exports__);
|
32470 | __webpack_require__.d(__webpack_exports__, "sample", function() { return sample; });
|
32471 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
32472 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(227);
|
32473 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(228);
|
32474 |
|
32475 |
|
32476 |
|
32477 |
|
32478 | function sample(notifier) {
|
32479 | return function (source) { return source.lift(new SampleOperator(notifier)); };
|
32480 | }
|
32481 | var SampleOperator = (function () {
|
32482 | function SampleOperator(notifier) {
|
32483 | this.notifier = notifier;
|
32484 | }
|
32485 | SampleOperator.prototype.call = function (subscriber, source) {
|
32486 | var sampleSubscriber = new SampleSubscriber(subscriber);
|
32487 | var subscription = source.subscribe(sampleSubscriber);
|
32488 | subscription.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(sampleSubscriber, this.notifier));
|
32489 | return subscription;
|
32490 | };
|
32491 | return SampleOperator;
|
32492 | }());
|
32493 | var SampleSubscriber = (function (_super) {
|
32494 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SampleSubscriber, _super);
|
32495 | function SampleSubscriber() {
|
32496 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
32497 | _this.hasValue = false;
|
32498 | return _this;
|
32499 | }
|
32500 | SampleSubscriber.prototype._next = function (value) {
|
32501 | this.value = value;
|
32502 | this.hasValue = true;
|
32503 | };
|
32504 | SampleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
32505 | this.emitValue();
|
32506 | };
|
32507 | SampleSubscriber.prototype.notifyComplete = function () {
|
32508 | this.emitValue();
|
32509 | };
|
32510 | SampleSubscriber.prototype.emitValue = function () {
|
32511 | if (this.hasValue) {
|
32512 | this.hasValue = false;
|
32513 | this.destination.next(this.value);
|
32514 | }
|
32515 | };
|
32516 | return SampleSubscriber;
|
32517 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
32518 |
|
32519 |
|
32520 |
|
32521 | }),
|
32522 |
|
32523 | (function(module, __webpack_exports__, __webpack_require__) {
|
32524 |
|
32525 | "use strict";
|
32526 | __webpack_require__.r(__webpack_exports__);
|
32527 | __webpack_require__.d(__webpack_exports__, "sampleTime", function() { return sampleTime; });
|
32528 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
32529 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
32530 | var _scheduler_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(213);
|
32531 |
|
32532 |
|
32533 |
|
32534 |
|
32535 | function sampleTime(period, scheduler) {
|
32536 | if (scheduler === void 0) {
|
32537 | scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_2__["async"];
|
32538 | }
|
32539 | return function (source) { return source.lift(new SampleTimeOperator(period, scheduler)); };
|
32540 | }
|
32541 | var SampleTimeOperator = (function () {
|
32542 | function SampleTimeOperator(period, scheduler) {
|
32543 | this.period = period;
|
32544 | this.scheduler = scheduler;
|
32545 | }
|
32546 | SampleTimeOperator.prototype.call = function (subscriber, source) {
|
32547 | return source.subscribe(new SampleTimeSubscriber(subscriber, this.period, this.scheduler));
|
32548 | };
|
32549 | return SampleTimeOperator;
|
32550 | }());
|
32551 | var SampleTimeSubscriber = (function (_super) {
|
32552 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SampleTimeSubscriber, _super);
|
32553 | function SampleTimeSubscriber(destination, period, scheduler) {
|
32554 | var _this = _super.call(this, destination) || this;
|
32555 | _this.period = period;
|
32556 | _this.scheduler = scheduler;
|
32557 | _this.hasValue = false;
|
32558 | _this.add(scheduler.schedule(dispatchNotification, period, { subscriber: _this, period: period }));
|
32559 | return _this;
|
32560 | }
|
32561 | SampleTimeSubscriber.prototype._next = function (value) {
|
32562 | this.lastValue = value;
|
32563 | this.hasValue = true;
|
32564 | };
|
32565 | SampleTimeSubscriber.prototype.notifyNext = function () {
|
32566 | if (this.hasValue) {
|
32567 | this.hasValue = false;
|
32568 | this.destination.next(this.lastValue);
|
32569 | }
|
32570 | };
|
32571 | return SampleTimeSubscriber;
|
32572 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
32573 | function dispatchNotification(state) {
|
32574 | var subscriber = state.subscriber, period = state.period;
|
32575 | subscriber.notifyNext();
|
32576 | this.schedule(state, period);
|
32577 | }
|
32578 |
|
32579 |
|
32580 |
|
32581 | }),
|
32582 |
|
32583 | (function(module, __webpack_exports__, __webpack_require__) {
|
32584 |
|
32585 | "use strict";
|
32586 | __webpack_require__.r(__webpack_exports__);
|
32587 | __webpack_require__.d(__webpack_exports__, "sequenceEqual", function() { return sequenceEqual; });
|
32588 | __webpack_require__.d(__webpack_exports__, "SequenceEqualOperator", function() { return SequenceEqualOperator; });
|
32589 | __webpack_require__.d(__webpack_exports__, "SequenceEqualSubscriber", function() { return SequenceEqualSubscriber; });
|
32590 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
32591 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
32592 |
|
32593 |
|
32594 |
|
32595 | function sequenceEqual(compareTo, comparator) {
|
32596 | return function (source) { return source.lift(new SequenceEqualOperator(compareTo, comparator)); };
|
32597 | }
|
32598 | var SequenceEqualOperator = (function () {
|
32599 | function SequenceEqualOperator(compareTo, comparator) {
|
32600 | this.compareTo = compareTo;
|
32601 | this.comparator = comparator;
|
32602 | }
|
32603 | SequenceEqualOperator.prototype.call = function (subscriber, source) {
|
32604 | return source.subscribe(new SequenceEqualSubscriber(subscriber, this.compareTo, this.comparator));
|
32605 | };
|
32606 | return SequenceEqualOperator;
|
32607 | }());
|
32608 |
|
32609 | var SequenceEqualSubscriber = (function (_super) {
|
32610 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SequenceEqualSubscriber, _super);
|
32611 | function SequenceEqualSubscriber(destination, compareTo, comparator) {
|
32612 | var _this = _super.call(this, destination) || this;
|
32613 | _this.compareTo = compareTo;
|
32614 | _this.comparator = comparator;
|
32615 | _this._a = [];
|
32616 | _this._b = [];
|
32617 | _this._oneComplete = false;
|
32618 | _this.destination.add(compareTo.subscribe(new SequenceEqualCompareToSubscriber(destination, _this)));
|
32619 | return _this;
|
32620 | }
|
32621 | SequenceEqualSubscriber.prototype._next = function (value) {
|
32622 | if (this._oneComplete && this._b.length === 0) {
|
32623 | this.emit(false);
|
32624 | }
|
32625 | else {
|
32626 | this._a.push(value);
|
32627 | this.checkValues();
|
32628 | }
|
32629 | };
|
32630 | SequenceEqualSubscriber.prototype._complete = function () {
|
32631 | if (this._oneComplete) {
|
32632 | this.emit(this._a.length === 0 && this._b.length === 0);
|
32633 | }
|
32634 | else {
|
32635 | this._oneComplete = true;
|
32636 | }
|
32637 | this.unsubscribe();
|
32638 | };
|
32639 | SequenceEqualSubscriber.prototype.checkValues = function () {
|
32640 | var _c = this, _a = _c._a, _b = _c._b, comparator = _c.comparator;
|
32641 | while (_a.length > 0 && _b.length > 0) {
|
32642 | var a = _a.shift();
|
32643 | var b = _b.shift();
|
32644 | var areEqual = false;
|
32645 | try {
|
32646 | areEqual = comparator ? comparator(a, b) : a === b;
|
32647 | }
|
32648 | catch (e) {
|
32649 | this.destination.error(e);
|
32650 | }
|
32651 | if (!areEqual) {
|
32652 | this.emit(false);
|
32653 | }
|
32654 | }
|
32655 | };
|
32656 | SequenceEqualSubscriber.prototype.emit = function (value) {
|
32657 | var destination = this.destination;
|
32658 | destination.next(value);
|
32659 | destination.complete();
|
32660 | };
|
32661 | SequenceEqualSubscriber.prototype.nextB = function (value) {
|
32662 | if (this._oneComplete && this._a.length === 0) {
|
32663 | this.emit(false);
|
32664 | }
|
32665 | else {
|
32666 | this._b.push(value);
|
32667 | this.checkValues();
|
32668 | }
|
32669 | };
|
32670 | SequenceEqualSubscriber.prototype.completeB = function () {
|
32671 | if (this._oneComplete) {
|
32672 | this.emit(this._a.length === 0 && this._b.length === 0);
|
32673 | }
|
32674 | else {
|
32675 | this._oneComplete = true;
|
32676 | }
|
32677 | };
|
32678 | return SequenceEqualSubscriber;
|
32679 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
32680 |
|
32681 | var SequenceEqualCompareToSubscriber = (function (_super) {
|
32682 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SequenceEqualCompareToSubscriber, _super);
|
32683 | function SequenceEqualCompareToSubscriber(destination, parent) {
|
32684 | var _this = _super.call(this, destination) || this;
|
32685 | _this.parent = parent;
|
32686 | return _this;
|
32687 | }
|
32688 | SequenceEqualCompareToSubscriber.prototype._next = function (value) {
|
32689 | this.parent.nextB(value);
|
32690 | };
|
32691 | SequenceEqualCompareToSubscriber.prototype._error = function (err) {
|
32692 | this.parent.error(err);
|
32693 | this.unsubscribe();
|
32694 | };
|
32695 | SequenceEqualCompareToSubscriber.prototype._complete = function () {
|
32696 | this.parent.completeB();
|
32697 | this.unsubscribe();
|
32698 | };
|
32699 | return SequenceEqualCompareToSubscriber;
|
32700 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
32701 |
|
32702 |
|
32703 |
|
32704 | }),
|
32705 |
|
32706 | (function(module, __webpack_exports__, __webpack_require__) {
|
32707 |
|
32708 | "use strict";
|
32709 | __webpack_require__.r(__webpack_exports__);
|
32710 | __webpack_require__.d(__webpack_exports__, "share", function() { return share; });
|
32711 | var _multicast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319);
|
32712 | var _refCount__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(188);
|
32713 | var _Subject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(185);
|
32714 |
|
32715 |
|
32716 |
|
32717 |
|
32718 | function shareSubjectFactory() {
|
32719 | return new _Subject__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
|
32720 | }
|
32721 | function share() {
|
32722 | return function (source) { return Object(_refCount__WEBPACK_IMPORTED_MODULE_1__["refCount"])()(Object(_multicast__WEBPACK_IMPORTED_MODULE_0__["multicast"])(shareSubjectFactory)(source)); };
|
32723 | }
|
32724 |
|
32725 |
|
32726 |
|
32727 | }),
|
32728 |
|
32729 | (function(module, __webpack_exports__, __webpack_require__) {
|
32730 |
|
32731 | "use strict";
|
32732 | __webpack_require__.r(__webpack_exports__);
|
32733 | __webpack_require__.d(__webpack_exports__, "shareReplay", function() { return shareReplay; });
|
32734 | var _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(191);
|
32735 |
|
32736 |
|
32737 | function shareReplay(configOrBufferSize, windowTime, scheduler) {
|
32738 | var config;
|
32739 | if (configOrBufferSize && typeof configOrBufferSize === 'object') {
|
32740 | config = configOrBufferSize;
|
32741 | }
|
32742 | else {
|
32743 | config = {
|
32744 | bufferSize: configOrBufferSize,
|
32745 | windowTime: windowTime,
|
32746 | refCount: false,
|
32747 | scheduler: scheduler
|
32748 | };
|
32749 | }
|
32750 | return function (source) { return source.lift(shareReplayOperator(config)); };
|
32751 | }
|
32752 | function shareReplayOperator(_a) {
|
32753 | var _b = _a.bufferSize, bufferSize = _b === void 0 ? Number.POSITIVE_INFINITY : _b, _c = _a.windowTime, windowTime = _c === void 0 ? Number.POSITIVE_INFINITY : _c, useRefCount = _a.refCount, scheduler = _a.scheduler;
|
32754 | var subject;
|
32755 | var refCount = 0;
|
32756 | var subscription;
|
32757 | var hasError = false;
|
32758 | var isComplete = false;
|
32759 | return function shareReplayOperation(source) {
|
32760 | refCount++;
|
32761 | if (!subject || hasError) {
|
32762 | hasError = false;
|
32763 | subject = new _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__["ReplaySubject"](bufferSize, windowTime, scheduler);
|
32764 | subscription = source.subscribe({
|
32765 | next: function (value) { subject.next(value); },
|
32766 | error: function (err) {
|
32767 | hasError = true;
|
32768 | subject.error(err);
|
32769 | },
|
32770 | complete: function () {
|
32771 | isComplete = true;
|
32772 | subscription = undefined;
|
32773 | subject.complete();
|
32774 | },
|
32775 | });
|
32776 | }
|
32777 | var innerSub = subject.subscribe(this);
|
32778 | this.add(function () {
|
32779 | refCount--;
|
32780 | innerSub.unsubscribe();
|
32781 | if (subscription && !isComplete && useRefCount && refCount === 0) {
|
32782 | subscription.unsubscribe();
|
32783 | subscription = undefined;
|
32784 | subject = undefined;
|
32785 | }
|
32786 | });
|
32787 | };
|
32788 | }
|
32789 |
|
32790 |
|
32791 |
|
32792 | }),
|
32793 |
|
32794 | (function(module, __webpack_exports__, __webpack_require__) {
|
32795 |
|
32796 | "use strict";
|
32797 | __webpack_require__.r(__webpack_exports__);
|
32798 | __webpack_require__.d(__webpack_exports__, "single", function() { return single; });
|
32799 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
32800 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
32801 | var _util_EmptyError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(221);
|
32802 |
|
32803 |
|
32804 |
|
32805 |
|
32806 | function single(predicate) {
|
32807 | return function (source) { return source.lift(new SingleOperator(predicate, source)); };
|
32808 | }
|
32809 | var SingleOperator = (function () {
|
32810 | function SingleOperator(predicate, source) {
|
32811 | this.predicate = predicate;
|
32812 | this.source = source;
|
32813 | }
|
32814 | SingleOperator.prototype.call = function (subscriber, source) {
|
32815 | return source.subscribe(new SingleSubscriber(subscriber, this.predicate, this.source));
|
32816 | };
|
32817 | return SingleOperator;
|
32818 | }());
|
32819 | var SingleSubscriber = (function (_super) {
|
32820 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SingleSubscriber, _super);
|
32821 | function SingleSubscriber(destination, predicate, source) {
|
32822 | var _this = _super.call(this, destination) || this;
|
32823 | _this.predicate = predicate;
|
32824 | _this.source = source;
|
32825 | _this.seenValue = false;
|
32826 | _this.index = 0;
|
32827 | return _this;
|
32828 | }
|
32829 | SingleSubscriber.prototype.applySingleValue = function (value) {
|
32830 | if (this.seenValue) {
|
32831 | this.destination.error('Sequence contains more than one element');
|
32832 | }
|
32833 | else {
|
32834 | this.seenValue = true;
|
32835 | this.singleValue = value;
|
32836 | }
|
32837 | };
|
32838 | SingleSubscriber.prototype._next = function (value) {
|
32839 | var index = this.index++;
|
32840 | if (this.predicate) {
|
32841 | this.tryNext(value, index);
|
32842 | }
|
32843 | else {
|
32844 | this.applySingleValue(value);
|
32845 | }
|
32846 | };
|
32847 | SingleSubscriber.prototype.tryNext = function (value, index) {
|
32848 | try {
|
32849 | if (this.predicate(value, index, this.source)) {
|
32850 | this.applySingleValue(value);
|
32851 | }
|
32852 | }
|
32853 | catch (err) {
|
32854 | this.destination.error(err);
|
32855 | }
|
32856 | };
|
32857 | SingleSubscriber.prototype._complete = function () {
|
32858 | var destination = this.destination;
|
32859 | if (this.index > 0) {
|
32860 | destination.next(this.seenValue ? this.singleValue : undefined);
|
32861 | destination.complete();
|
32862 | }
|
32863 | else {
|
32864 | destination.error(new _util_EmptyError__WEBPACK_IMPORTED_MODULE_2__["EmptyError"]);
|
32865 | }
|
32866 | };
|
32867 | return SingleSubscriber;
|
32868 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
32869 |
|
32870 |
|
32871 |
|
32872 | }),
|
32873 |
|
32874 | (function(module, __webpack_exports__, __webpack_require__) {
|
32875 |
|
32876 | "use strict";
|
32877 | __webpack_require__.r(__webpack_exports__);
|
32878 | __webpack_require__.d(__webpack_exports__, "skip", function() { return skip; });
|
32879 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
32880 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
32881 |
|
32882 |
|
32883 |
|
32884 | function skip(count) {
|
32885 | return function (source) { return source.lift(new SkipOperator(count)); };
|
32886 | }
|
32887 | var SkipOperator = (function () {
|
32888 | function SkipOperator(total) {
|
32889 | this.total = total;
|
32890 | }
|
32891 | SkipOperator.prototype.call = function (subscriber, source) {
|
32892 | return source.subscribe(new SkipSubscriber(subscriber, this.total));
|
32893 | };
|
32894 | return SkipOperator;
|
32895 | }());
|
32896 | var SkipSubscriber = (function (_super) {
|
32897 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SkipSubscriber, _super);
|
32898 | function SkipSubscriber(destination, total) {
|
32899 | var _this = _super.call(this, destination) || this;
|
32900 | _this.total = total;
|
32901 | _this.count = 0;
|
32902 | return _this;
|
32903 | }
|
32904 | SkipSubscriber.prototype._next = function (x) {
|
32905 | if (++this.count > this.total) {
|
32906 | this.destination.next(x);
|
32907 | }
|
32908 | };
|
32909 | return SkipSubscriber;
|
32910 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
32911 |
|
32912 |
|
32913 |
|
32914 | }),
|
32915 |
|
32916 | (function(module, __webpack_exports__, __webpack_require__) {
|
32917 |
|
32918 | "use strict";
|
32919 | __webpack_require__.r(__webpack_exports__);
|
32920 | __webpack_require__.d(__webpack_exports__, "skipLast", function() { return skipLast; });
|
32921 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
32922 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
32923 | var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(220);
|
32924 |
|
32925 |
|
32926 |
|
32927 |
|
32928 | function skipLast(count) {
|
32929 | return function (source) { return source.lift(new SkipLastOperator(count)); };
|
32930 | }
|
32931 | var SkipLastOperator = (function () {
|
32932 | function SkipLastOperator(_skipCount) {
|
32933 | this._skipCount = _skipCount;
|
32934 | if (this._skipCount < 0) {
|
32935 | throw new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__["ArgumentOutOfRangeError"];
|
32936 | }
|
32937 | }
|
32938 | SkipLastOperator.prototype.call = function (subscriber, source) {
|
32939 | if (this._skipCount === 0) {
|
32940 | return source.subscribe(new _Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"](subscriber));
|
32941 | }
|
32942 | else {
|
32943 | return source.subscribe(new SkipLastSubscriber(subscriber, this._skipCount));
|
32944 | }
|
32945 | };
|
32946 | return SkipLastOperator;
|
32947 | }());
|
32948 | var SkipLastSubscriber = (function (_super) {
|
32949 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SkipLastSubscriber, _super);
|
32950 | function SkipLastSubscriber(destination, _skipCount) {
|
32951 | var _this = _super.call(this, destination) || this;
|
32952 | _this._skipCount = _skipCount;
|
32953 | _this._count = 0;
|
32954 | _this._ring = new Array(_skipCount);
|
32955 | return _this;
|
32956 | }
|
32957 | SkipLastSubscriber.prototype._next = function (value) {
|
32958 | var skipCount = this._skipCount;
|
32959 | var count = this._count++;
|
32960 | if (count < skipCount) {
|
32961 | this._ring[count] = value;
|
32962 | }
|
32963 | else {
|
32964 | var currentIndex = count % skipCount;
|
32965 | var ring = this._ring;
|
32966 | var oldValue = ring[currentIndex];
|
32967 | ring[currentIndex] = value;
|
32968 | this.destination.next(oldValue);
|
32969 | }
|
32970 | };
|
32971 | return SkipLastSubscriber;
|
32972 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
32973 |
|
32974 |
|
32975 |
|
32976 | }),
|
32977 |
|
32978 | (function(module, __webpack_exports__, __webpack_require__) {
|
32979 |
|
32980 | "use strict";
|
32981 | __webpack_require__.r(__webpack_exports__);
|
32982 | __webpack_require__.d(__webpack_exports__, "skipUntil", function() { return skipUntil; });
|
32983 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
32984 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(227);
|
32985 | var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(229);
|
32986 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(228);
|
32987 |
|
32988 |
|
32989 |
|
32990 |
|
32991 |
|
32992 | function skipUntil(notifier) {
|
32993 | return function (source) { return source.lift(new SkipUntilOperator(notifier)); };
|
32994 | }
|
32995 | var SkipUntilOperator = (function () {
|
32996 | function SkipUntilOperator(notifier) {
|
32997 | this.notifier = notifier;
|
32998 | }
|
32999 | SkipUntilOperator.prototype.call = function (destination, source) {
|
33000 | return source.subscribe(new SkipUntilSubscriber(destination, this.notifier));
|
33001 | };
|
33002 | return SkipUntilOperator;
|
33003 | }());
|
33004 | var SkipUntilSubscriber = (function (_super) {
|
33005 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SkipUntilSubscriber, _super);
|
33006 | function SkipUntilSubscriber(destination, notifier) {
|
33007 | var _this = _super.call(this, destination) || this;
|
33008 | _this.hasValue = false;
|
33009 | var innerSubscriber = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__["InnerSubscriber"](_this, undefined, undefined);
|
33010 | _this.add(innerSubscriber);
|
33011 | _this.innerSubscription = innerSubscriber;
|
33012 | var innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(_this, notifier, undefined, undefined, innerSubscriber);
|
33013 | if (innerSubscription !== innerSubscriber) {
|
33014 | _this.add(innerSubscription);
|
33015 | _this.innerSubscription = innerSubscription;
|
33016 | }
|
33017 | return _this;
|
33018 | }
|
33019 | SkipUntilSubscriber.prototype._next = function (value) {
|
33020 | if (this.hasValue) {
|
33021 | _super.prototype._next.call(this, value);
|
33022 | }
|
33023 | };
|
33024 | SkipUntilSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
33025 | this.hasValue = true;
|
33026 | if (this.innerSubscription) {
|
33027 | this.innerSubscription.unsubscribe();
|
33028 | }
|
33029 | };
|
33030 | SkipUntilSubscriber.prototype.notifyComplete = function () {
|
33031 | };
|
33032 | return SkipUntilSubscriber;
|
33033 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
33034 |
|
33035 |
|
33036 |
|
33037 | }),
|
33038 |
|
33039 | (function(module, __webpack_exports__, __webpack_require__) {
|
33040 |
|
33041 | "use strict";
|
33042 | __webpack_require__.r(__webpack_exports__);
|
33043 | __webpack_require__.d(__webpack_exports__, "skipWhile", function() { return skipWhile; });
|
33044 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
33045 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
33046 |
|
33047 |
|
33048 |
|
33049 | function skipWhile(predicate) {
|
33050 | return function (source) { return source.lift(new SkipWhileOperator(predicate)); };
|
33051 | }
|
33052 | var SkipWhileOperator = (function () {
|
33053 | function SkipWhileOperator(predicate) {
|
33054 | this.predicate = predicate;
|
33055 | }
|
33056 | SkipWhileOperator.prototype.call = function (subscriber, source) {
|
33057 | return source.subscribe(new SkipWhileSubscriber(subscriber, this.predicate));
|
33058 | };
|
33059 | return SkipWhileOperator;
|
33060 | }());
|
33061 | var SkipWhileSubscriber = (function (_super) {
|
33062 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SkipWhileSubscriber, _super);
|
33063 | function SkipWhileSubscriber(destination, predicate) {
|
33064 | var _this = _super.call(this, destination) || this;
|
33065 | _this.predicate = predicate;
|
33066 | _this.skipping = true;
|
33067 | _this.index = 0;
|
33068 | return _this;
|
33069 | }
|
33070 | SkipWhileSubscriber.prototype._next = function (value) {
|
33071 | var destination = this.destination;
|
33072 | if (this.skipping) {
|
33073 | this.tryCallPredicate(value);
|
33074 | }
|
33075 | if (!this.skipping) {
|
33076 | destination.next(value);
|
33077 | }
|
33078 | };
|
33079 | SkipWhileSubscriber.prototype.tryCallPredicate = function (value) {
|
33080 | try {
|
33081 | var result = this.predicate(value, this.index++);
|
33082 | this.skipping = Boolean(result);
|
33083 | }
|
33084 | catch (err) {
|
33085 | this.destination.error(err);
|
33086 | }
|
33087 | };
|
33088 | return SkipWhileSubscriber;
|
33089 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
33090 |
|
33091 |
|
33092 |
|
33093 | }),
|
33094 |
|
33095 | (function(module, __webpack_exports__, __webpack_require__) {
|
33096 |
|
33097 | "use strict";
|
33098 | __webpack_require__.r(__webpack_exports__);
|
33099 | __webpack_require__.d(__webpack_exports__, "startWith", function() { return startWith; });
|
33100 | var _observable_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(237);
|
33101 | var _util_isScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(203);
|
33102 |
|
33103 |
|
33104 |
|
33105 | function startWith() {
|
33106 | var array = [];
|
33107 | for (var _i = 0; _i < arguments.length; _i++) {
|
33108 | array[_i] = arguments[_i];
|
33109 | }
|
33110 | var scheduler = array[array.length - 1];
|
33111 | if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_1__["isScheduler"])(scheduler)) {
|
33112 | array.pop();
|
33113 | return function (source) { return Object(_observable_concat__WEBPACK_IMPORTED_MODULE_0__["concat"])(array, source, scheduler); };
|
33114 | }
|
33115 | else {
|
33116 | return function (source) { return Object(_observable_concat__WEBPACK_IMPORTED_MODULE_0__["concat"])(array, source); };
|
33117 | }
|
33118 | }
|
33119 |
|
33120 |
|
33121 |
|
33122 | }),
|
33123 |
|
33124 | (function(module, __webpack_exports__, __webpack_require__) {
|
33125 |
|
33126 | "use strict";
|
33127 | __webpack_require__.r(__webpack_exports__);
|
33128 | __webpack_require__.d(__webpack_exports__, "subscribeOn", function() { return subscribeOn; });
|
33129 | var _observable_SubscribeOnObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(345);
|
33130 |
|
33131 |
|
33132 | function subscribeOn(scheduler, delay) {
|
33133 | if (delay === void 0) {
|
33134 | delay = 0;
|
33135 | }
|
33136 | return function subscribeOnOperatorFunction(source) {
|
33137 | return source.lift(new SubscribeOnOperator(scheduler, delay));
|
33138 | };
|
33139 | }
|
33140 | var SubscribeOnOperator = (function () {
|
33141 | function SubscribeOnOperator(scheduler, delay) {
|
33142 | this.scheduler = scheduler;
|
33143 | this.delay = delay;
|
33144 | }
|
33145 | SubscribeOnOperator.prototype.call = function (subscriber, source) {
|
33146 | return new _observable_SubscribeOnObservable__WEBPACK_IMPORTED_MODULE_0__["SubscribeOnObservable"](source, this.delay, this.scheduler).subscribe(subscriber);
|
33147 | };
|
33148 | return SubscribeOnOperator;
|
33149 | }());
|
33150 |
|
33151 |
|
33152 |
|
33153 | }),
|
33154 |
|
33155 | (function(module, __webpack_exports__, __webpack_require__) {
|
33156 |
|
33157 | "use strict";
|
33158 | __webpack_require__.r(__webpack_exports__);
|
33159 | __webpack_require__.d(__webpack_exports__, "SubscribeOnObservable", function() { return SubscribeOnObservable; });
|
33160 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
33161 | var _Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(167);
|
33162 | var _scheduler_asap__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(209);
|
33163 | var _util_isNumeric__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(255);
|
33164 |
|
33165 |
|
33166 |
|
33167 |
|
33168 |
|
33169 | var SubscribeOnObservable = (function (_super) {
|
33170 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SubscribeOnObservable, _super);
|
33171 | function SubscribeOnObservable(source, delayTime, scheduler) {
|
33172 | if (delayTime === void 0) {
|
33173 | delayTime = 0;
|
33174 | }
|
33175 | if (scheduler === void 0) {
|
33176 | scheduler = _scheduler_asap__WEBPACK_IMPORTED_MODULE_2__["asap"];
|
33177 | }
|
33178 | var _this = _super.call(this) || this;
|
33179 | _this.source = source;
|
33180 | _this.delayTime = delayTime;
|
33181 | _this.scheduler = scheduler;
|
33182 | if (!Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_3__["isNumeric"])(delayTime) || delayTime < 0) {
|
33183 | _this.delayTime = 0;
|
33184 | }
|
33185 | if (!scheduler || typeof scheduler.schedule !== 'function') {
|
33186 | _this.scheduler = _scheduler_asap__WEBPACK_IMPORTED_MODULE_2__["asap"];
|
33187 | }
|
33188 | return _this;
|
33189 | }
|
33190 | SubscribeOnObservable.create = function (source, delay, scheduler) {
|
33191 | if (delay === void 0) {
|
33192 | delay = 0;
|
33193 | }
|
33194 | if (scheduler === void 0) {
|
33195 | scheduler = _scheduler_asap__WEBPACK_IMPORTED_MODULE_2__["asap"];
|
33196 | }
|
33197 | return new SubscribeOnObservable(source, delay, scheduler);
|
33198 | };
|
33199 | SubscribeOnObservable.dispatch = function (arg) {
|
33200 | var source = arg.source, subscriber = arg.subscriber;
|
33201 | return this.add(source.subscribe(subscriber));
|
33202 | };
|
33203 | SubscribeOnObservable.prototype._subscribe = function (subscriber) {
|
33204 | var delay = this.delayTime;
|
33205 | var source = this.source;
|
33206 | var scheduler = this.scheduler;
|
33207 | return scheduler.schedule(SubscribeOnObservable.dispatch, delay, {
|
33208 | source: source, subscriber: subscriber
|
33209 | });
|
33210 | };
|
33211 | return SubscribeOnObservable;
|
33212 | }(_Observable__WEBPACK_IMPORTED_MODULE_1__["Observable"]));
|
33213 |
|
33214 |
|
33215 |
|
33216 |
|
33217 | }),
|
33218 |
|
33219 | (function(module, __webpack_exports__, __webpack_require__) {
|
33220 |
|
33221 | "use strict";
|
33222 | __webpack_require__.r(__webpack_exports__);
|
33223 | __webpack_require__.d(__webpack_exports__, "switchAll", function() { return switchAll; });
|
33224 | var _switchMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(347);
|
33225 | var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(183);
|
33226 |
|
33227 |
|
33228 |
|
33229 | function switchAll() {
|
33230 | return Object(_switchMap__WEBPACK_IMPORTED_MODULE_0__["switchMap"])(_util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"]);
|
33231 | }
|
33232 |
|
33233 |
|
33234 |
|
33235 | }),
|
33236 |
|
33237 | (function(module, __webpack_exports__, __webpack_require__) {
|
33238 |
|
33239 | "use strict";
|
33240 | __webpack_require__.r(__webpack_exports__);
|
33241 | __webpack_require__.d(__webpack_exports__, "switchMap", function() { return switchMap; });
|
33242 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
33243 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(227);
|
33244 | var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(229);
|
33245 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(228);
|
33246 | var _map__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(224);
|
33247 | var _observable_from__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(241);
|
33248 |
|
33249 |
|
33250 |
|
33251 |
|
33252 |
|
33253 |
|
33254 |
|
33255 | function switchMap(project, resultSelector) {
|
33256 | if (typeof resultSelector === 'function') {
|
33257 | return function (source) { return source.pipe(switchMap(function (a, i) { return Object(_observable_from__WEBPACK_IMPORTED_MODULE_5__["from"])(project(a, i)).pipe(Object(_map__WEBPACK_IMPORTED_MODULE_4__["map"])(function (b, ii) { return resultSelector(a, b, i, ii); })); })); };
|
33258 | }
|
33259 | return function (source) { return source.lift(new SwitchMapOperator(project)); };
|
33260 | }
|
33261 | var SwitchMapOperator = (function () {
|
33262 | function SwitchMapOperator(project) {
|
33263 | this.project = project;
|
33264 | }
|
33265 | SwitchMapOperator.prototype.call = function (subscriber, source) {
|
33266 | return source.subscribe(new SwitchMapSubscriber(subscriber, this.project));
|
33267 | };
|
33268 | return SwitchMapOperator;
|
33269 | }());
|
33270 | var SwitchMapSubscriber = (function (_super) {
|
33271 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SwitchMapSubscriber, _super);
|
33272 | function SwitchMapSubscriber(destination, project) {
|
33273 | var _this = _super.call(this, destination) || this;
|
33274 | _this.project = project;
|
33275 | _this.index = 0;
|
33276 | return _this;
|
33277 | }
|
33278 | SwitchMapSubscriber.prototype._next = function (value) {
|
33279 | var result;
|
33280 | var index = this.index++;
|
33281 | try {
|
33282 | result = this.project(value, index);
|
33283 | }
|
33284 | catch (error) {
|
33285 | this.destination.error(error);
|
33286 | return;
|
33287 | }
|
33288 | this._innerSub(result, value, index);
|
33289 | };
|
33290 | SwitchMapSubscriber.prototype._innerSub = function (result, value, index) {
|
33291 | var innerSubscription = this.innerSubscription;
|
33292 | if (innerSubscription) {
|
33293 | innerSubscription.unsubscribe();
|
33294 | }
|
33295 | var innerSubscriber = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__["InnerSubscriber"](this, value, index);
|
33296 | var destination = this.destination;
|
33297 | destination.add(innerSubscriber);
|
33298 | this.innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(this, result, undefined, undefined, innerSubscriber);
|
33299 | if (this.innerSubscription !== innerSubscriber) {
|
33300 | destination.add(this.innerSubscription);
|
33301 | }
|
33302 | };
|
33303 | SwitchMapSubscriber.prototype._complete = function () {
|
33304 | var innerSubscription = this.innerSubscription;
|
33305 | if (!innerSubscription || innerSubscription.closed) {
|
33306 | _super.prototype._complete.call(this);
|
33307 | }
|
33308 | this.unsubscribe();
|
33309 | };
|
33310 | SwitchMapSubscriber.prototype._unsubscribe = function () {
|
33311 | this.innerSubscription = null;
|
33312 | };
|
33313 | SwitchMapSubscriber.prototype.notifyComplete = function (innerSub) {
|
33314 | var destination = this.destination;
|
33315 | destination.remove(innerSub);
|
33316 | this.innerSubscription = null;
|
33317 | if (this.isStopped) {
|
33318 | _super.prototype._complete.call(this);
|
33319 | }
|
33320 | };
|
33321 | SwitchMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
33322 | this.destination.next(innerValue);
|
33323 | };
|
33324 | return SwitchMapSubscriber;
|
33325 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
33326 |
|
33327 |
|
33328 |
|
33329 | }),
|
33330 |
|
33331 | (function(module, __webpack_exports__, __webpack_require__) {
|
33332 |
|
33333 | "use strict";
|
33334 | __webpack_require__.r(__webpack_exports__);
|
33335 | __webpack_require__.d(__webpack_exports__, "switchMapTo", function() { return switchMapTo; });
|
33336 | var _switchMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(347);
|
33337 |
|
33338 |
|
33339 | function switchMapTo(innerObservable, resultSelector) {
|
33340 | return resultSelector ? Object(_switchMap__WEBPACK_IMPORTED_MODULE_0__["switchMap"])(function () { return innerObservable; }, resultSelector) : Object(_switchMap__WEBPACK_IMPORTED_MODULE_0__["switchMap"])(function () { return innerObservable; });
|
33341 | }
|
33342 |
|
33343 |
|
33344 |
|
33345 | }),
|
33346 |
|
33347 | (function(module, __webpack_exports__, __webpack_require__) {
|
33348 |
|
33349 | "use strict";
|
33350 | __webpack_require__.r(__webpack_exports__);
|
33351 | __webpack_require__.d(__webpack_exports__, "takeUntil", function() { return takeUntil; });
|
33352 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
33353 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(227);
|
33354 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(228);
|
33355 |
|
33356 |
|
33357 |
|
33358 |
|
33359 | function takeUntil(notifier) {
|
33360 | return function (source) { return source.lift(new TakeUntilOperator(notifier)); };
|
33361 | }
|
33362 | var TakeUntilOperator = (function () {
|
33363 | function TakeUntilOperator(notifier) {
|
33364 | this.notifier = notifier;
|
33365 | }
|
33366 | TakeUntilOperator.prototype.call = function (subscriber, source) {
|
33367 | var takeUntilSubscriber = new TakeUntilSubscriber(subscriber);
|
33368 | var notifierSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(takeUntilSubscriber, this.notifier);
|
33369 | if (notifierSubscription && !takeUntilSubscriber.seenValue) {
|
33370 | takeUntilSubscriber.add(notifierSubscription);
|
33371 | return source.subscribe(takeUntilSubscriber);
|
33372 | }
|
33373 | return takeUntilSubscriber;
|
33374 | };
|
33375 | return TakeUntilOperator;
|
33376 | }());
|
33377 | var TakeUntilSubscriber = (function (_super) {
|
33378 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](TakeUntilSubscriber, _super);
|
33379 | function TakeUntilSubscriber(destination) {
|
33380 | var _this = _super.call(this, destination) || this;
|
33381 | _this.seenValue = false;
|
33382 | return _this;
|
33383 | }
|
33384 | TakeUntilSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
33385 | this.seenValue = true;
|
33386 | this.complete();
|
33387 | };
|
33388 | TakeUntilSubscriber.prototype.notifyComplete = function () {
|
33389 | };
|
33390 | return TakeUntilSubscriber;
|
33391 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
33392 |
|
33393 |
|
33394 |
|
33395 | }),
|
33396 |
|
33397 | (function(module, __webpack_exports__, __webpack_require__) {
|
33398 |
|
33399 | "use strict";
|
33400 | __webpack_require__.r(__webpack_exports__);
|
33401 | __webpack_require__.d(__webpack_exports__, "takeWhile", function() { return takeWhile; });
|
33402 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
33403 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
33404 |
|
33405 |
|
33406 |
|
33407 | function takeWhile(predicate, inclusive) {
|
33408 | if (inclusive === void 0) {
|
33409 | inclusive = false;
|
33410 | }
|
33411 | return function (source) {
|
33412 | return source.lift(new TakeWhileOperator(predicate, inclusive));
|
33413 | };
|
33414 | }
|
33415 | var TakeWhileOperator = (function () {
|
33416 | function TakeWhileOperator(predicate, inclusive) {
|
33417 | this.predicate = predicate;
|
33418 | this.inclusive = inclusive;
|
33419 | }
|
33420 | TakeWhileOperator.prototype.call = function (subscriber, source) {
|
33421 | return source.subscribe(new TakeWhileSubscriber(subscriber, this.predicate, this.inclusive));
|
33422 | };
|
33423 | return TakeWhileOperator;
|
33424 | }());
|
33425 | var TakeWhileSubscriber = (function (_super) {
|
33426 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](TakeWhileSubscriber, _super);
|
33427 | function TakeWhileSubscriber(destination, predicate, inclusive) {
|
33428 | var _this = _super.call(this, destination) || this;
|
33429 | _this.predicate = predicate;
|
33430 | _this.inclusive = inclusive;
|
33431 | _this.index = 0;
|
33432 | return _this;
|
33433 | }
|
33434 | TakeWhileSubscriber.prototype._next = function (value) {
|
33435 | var destination = this.destination;
|
33436 | var result;
|
33437 | try {
|
33438 | result = this.predicate(value, this.index++);
|
33439 | }
|
33440 | catch (err) {
|
33441 | destination.error(err);
|
33442 | return;
|
33443 | }
|
33444 | this.nextOrComplete(value, result);
|
33445 | };
|
33446 | TakeWhileSubscriber.prototype.nextOrComplete = function (value, predicateResult) {
|
33447 | var destination = this.destination;
|
33448 | if (Boolean(predicateResult)) {
|
33449 | destination.next(value);
|
33450 | }
|
33451 | else {
|
33452 | if (this.inclusive) {
|
33453 | destination.next(value);
|
33454 | }
|
33455 | destination.complete();
|
33456 | }
|
33457 | };
|
33458 | return TakeWhileSubscriber;
|
33459 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
33460 |
|
33461 |
|
33462 |
|
33463 | }),
|
33464 |
|
33465 | (function(module, __webpack_exports__, __webpack_require__) {
|
33466 |
|
33467 | "use strict";
|
33468 | __webpack_require__.r(__webpack_exports__);
|
33469 | __webpack_require__.d(__webpack_exports__, "tap", function() { return tap; });
|
33470 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
33471 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
33472 | var _util_noop__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(218);
|
33473 | var _util_isFunction__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(171);
|
33474 |
|
33475 |
|
33476 |
|
33477 |
|
33478 |
|
33479 | function tap(nextOrObserver, error, complete) {
|
33480 | return function tapOperatorFunction(source) {
|
33481 | return source.lift(new DoOperator(nextOrObserver, error, complete));
|
33482 | };
|
33483 | }
|
33484 | var DoOperator = (function () {
|
33485 | function DoOperator(nextOrObserver, error, complete) {
|
33486 | this.nextOrObserver = nextOrObserver;
|
33487 | this.error = error;
|
33488 | this.complete = complete;
|
33489 | }
|
33490 | DoOperator.prototype.call = function (subscriber, source) {
|
33491 | return source.subscribe(new TapSubscriber(subscriber, this.nextOrObserver, this.error, this.complete));
|
33492 | };
|
33493 | return DoOperator;
|
33494 | }());
|
33495 | var TapSubscriber = (function (_super) {
|
33496 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](TapSubscriber, _super);
|
33497 | function TapSubscriber(destination, observerOrNext, error, complete) {
|
33498 | var _this = _super.call(this, destination) || this;
|
33499 | _this._tapNext = _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"];
|
33500 | _this._tapError = _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"];
|
33501 | _this._tapComplete = _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"];
|
33502 | _this._tapError = error || _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"];
|
33503 | _this._tapComplete = complete || _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"];
|
33504 | if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_3__["isFunction"])(observerOrNext)) {
|
33505 | _this._context = _this;
|
33506 | _this._tapNext = observerOrNext;
|
33507 | }
|
33508 | else if (observerOrNext) {
|
33509 | _this._context = observerOrNext;
|
33510 | _this._tapNext = observerOrNext.next || _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"];
|
33511 | _this._tapError = observerOrNext.error || _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"];
|
33512 | _this._tapComplete = observerOrNext.complete || _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"];
|
33513 | }
|
33514 | return _this;
|
33515 | }
|
33516 | TapSubscriber.prototype._next = function (value) {
|
33517 | try {
|
33518 | this._tapNext.call(this._context, value);
|
33519 | }
|
33520 | catch (err) {
|
33521 | this.destination.error(err);
|
33522 | return;
|
33523 | }
|
33524 | this.destination.next(value);
|
33525 | };
|
33526 | TapSubscriber.prototype._error = function (err) {
|
33527 | try {
|
33528 | this._tapError.call(this._context, err);
|
33529 | }
|
33530 | catch (err) {
|
33531 | this.destination.error(err);
|
33532 | return;
|
33533 | }
|
33534 | this.destination.error(err);
|
33535 | };
|
33536 | TapSubscriber.prototype._complete = function () {
|
33537 | try {
|
33538 | this._tapComplete.call(this._context);
|
33539 | }
|
33540 | catch (err) {
|
33541 | this.destination.error(err);
|
33542 | return;
|
33543 | }
|
33544 | return this.destination.complete();
|
33545 | };
|
33546 | return TapSubscriber;
|
33547 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
33548 |
|
33549 |
|
33550 |
|
33551 | }),
|
33552 |
|
33553 | (function(module, __webpack_exports__, __webpack_require__) {
|
33554 |
|
33555 | "use strict";
|
33556 | __webpack_require__.r(__webpack_exports__);
|
33557 | __webpack_require__.d(__webpack_exports__, "defaultThrottleConfig", function() { return defaultThrottleConfig; });
|
33558 | __webpack_require__.d(__webpack_exports__, "throttle", function() { return throttle; });
|
33559 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
33560 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(227);
|
33561 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(228);
|
33562 |
|
33563 |
|
33564 |
|
33565 |
|
33566 | var defaultThrottleConfig = {
|
33567 | leading: true,
|
33568 | trailing: false
|
33569 | };
|
33570 | function throttle(durationSelector, config) {
|
33571 | if (config === void 0) {
|
33572 | config = defaultThrottleConfig;
|
33573 | }
|
33574 | return function (source) { return source.lift(new ThrottleOperator(durationSelector, config.leading, config.trailing)); };
|
33575 | }
|
33576 | var ThrottleOperator = (function () {
|
33577 | function ThrottleOperator(durationSelector, leading, trailing) {
|
33578 | this.durationSelector = durationSelector;
|
33579 | this.leading = leading;
|
33580 | this.trailing = trailing;
|
33581 | }
|
33582 | ThrottleOperator.prototype.call = function (subscriber, source) {
|
33583 | return source.subscribe(new ThrottleSubscriber(subscriber, this.durationSelector, this.leading, this.trailing));
|
33584 | };
|
33585 | return ThrottleOperator;
|
33586 | }());
|
33587 | var ThrottleSubscriber = (function (_super) {
|
33588 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ThrottleSubscriber, _super);
|
33589 | function ThrottleSubscriber(destination, durationSelector, _leading, _trailing) {
|
33590 | var _this = _super.call(this, destination) || this;
|
33591 | _this.destination = destination;
|
33592 | _this.durationSelector = durationSelector;
|
33593 | _this._leading = _leading;
|
33594 | _this._trailing = _trailing;
|
33595 | _this._hasValue = false;
|
33596 | return _this;
|
33597 | }
|
33598 | ThrottleSubscriber.prototype._next = function (value) {
|
33599 | this._hasValue = true;
|
33600 | this._sendValue = value;
|
33601 | if (!this._throttled) {
|
33602 | if (this._leading) {
|
33603 | this.send();
|
33604 | }
|
33605 | else {
|
33606 | this.throttle(value);
|
33607 | }
|
33608 | }
|
33609 | };
|
33610 | ThrottleSubscriber.prototype.send = function () {
|
33611 | var _a = this, _hasValue = _a._hasValue, _sendValue = _a._sendValue;
|
33612 | if (_hasValue) {
|
33613 | this.destination.next(_sendValue);
|
33614 | this.throttle(_sendValue);
|
33615 | }
|
33616 | this._hasValue = false;
|
33617 | this._sendValue = null;
|
33618 | };
|
33619 | ThrottleSubscriber.prototype.throttle = function (value) {
|
33620 | var duration = this.tryDurationSelector(value);
|
33621 | if (!!duration) {
|
33622 | this.add(this._throttled = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, duration));
|
33623 | }
|
33624 | };
|
33625 | ThrottleSubscriber.prototype.tryDurationSelector = function (value) {
|
33626 | try {
|
33627 | return this.durationSelector(value);
|
33628 | }
|
33629 | catch (err) {
|
33630 | this.destination.error(err);
|
33631 | return null;
|
33632 | }
|
33633 | };
|
33634 | ThrottleSubscriber.prototype.throttlingDone = function () {
|
33635 | var _a = this, _throttled = _a._throttled, _trailing = _a._trailing;
|
33636 | if (_throttled) {
|
33637 | _throttled.unsubscribe();
|
33638 | }
|
33639 | this._throttled = null;
|
33640 | if (_trailing) {
|
33641 | this.send();
|
33642 | }
|
33643 | };
|
33644 | ThrottleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
33645 | this.throttlingDone();
|
33646 | };
|
33647 | ThrottleSubscriber.prototype.notifyComplete = function () {
|
33648 | this.throttlingDone();
|
33649 | };
|
33650 | return ThrottleSubscriber;
|
33651 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
33652 |
|
33653 |
|
33654 |
|
33655 | }),
|
33656 |
|
33657 | (function(module, __webpack_exports__, __webpack_require__) {
|
33658 |
|
33659 | "use strict";
|
33660 | __webpack_require__.r(__webpack_exports__);
|
33661 | __webpack_require__.d(__webpack_exports__, "throttleTime", function() { return throttleTime; });
|
33662 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
33663 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
33664 | var _scheduler_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(213);
|
33665 | var _throttle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(352);
|
33666 |
|
33667 |
|
33668 |
|
33669 |
|
33670 |
|
33671 | function throttleTime(duration, scheduler, config) {
|
33672 | if (scheduler === void 0) {
|
33673 | scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_2__["async"];
|
33674 | }
|
33675 | if (config === void 0) {
|
33676 | config = _throttle__WEBPACK_IMPORTED_MODULE_3__["defaultThrottleConfig"];
|
33677 | }
|
33678 | return function (source) { return source.lift(new ThrottleTimeOperator(duration, scheduler, config.leading, config.trailing)); };
|
33679 | }
|
33680 | var ThrottleTimeOperator = (function () {
|
33681 | function ThrottleTimeOperator(duration, scheduler, leading, trailing) {
|
33682 | this.duration = duration;
|
33683 | this.scheduler = scheduler;
|
33684 | this.leading = leading;
|
33685 | this.trailing = trailing;
|
33686 | }
|
33687 | ThrottleTimeOperator.prototype.call = function (subscriber, source) {
|
33688 | return source.subscribe(new ThrottleTimeSubscriber(subscriber, this.duration, this.scheduler, this.leading, this.trailing));
|
33689 | };
|
33690 | return ThrottleTimeOperator;
|
33691 | }());
|
33692 | var ThrottleTimeSubscriber = (function (_super) {
|
33693 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ThrottleTimeSubscriber, _super);
|
33694 | function ThrottleTimeSubscriber(destination, duration, scheduler, leading, trailing) {
|
33695 | var _this = _super.call(this, destination) || this;
|
33696 | _this.duration = duration;
|
33697 | _this.scheduler = scheduler;
|
33698 | _this.leading = leading;
|
33699 | _this.trailing = trailing;
|
33700 | _this._hasTrailingValue = false;
|
33701 | _this._trailingValue = null;
|
33702 | return _this;
|
33703 | }
|
33704 | ThrottleTimeSubscriber.prototype._next = function (value) {
|
33705 | if (this.throttled) {
|
33706 | if (this.trailing) {
|
33707 | this._trailingValue = value;
|
33708 | this._hasTrailingValue = true;
|
33709 | }
|
33710 | }
|
33711 | else {
|
33712 | this.add(this.throttled = this.scheduler.schedule(dispatchNext, this.duration, { subscriber: this }));
|
33713 | if (this.leading) {
|
33714 | this.destination.next(value);
|
33715 | }
|
33716 | else if (this.trailing) {
|
33717 | this._trailingValue = value;
|
33718 | this._hasTrailingValue = true;
|
33719 | }
|
33720 | }
|
33721 | };
|
33722 | ThrottleTimeSubscriber.prototype._complete = function () {
|
33723 | if (this._hasTrailingValue) {
|
33724 | this.destination.next(this._trailingValue);
|
33725 | this.destination.complete();
|
33726 | }
|
33727 | else {
|
33728 | this.destination.complete();
|
33729 | }
|
33730 | };
|
33731 | ThrottleTimeSubscriber.prototype.clearThrottle = function () {
|
33732 | var throttled = this.throttled;
|
33733 | if (throttled) {
|
33734 | if (this.trailing && this._hasTrailingValue) {
|
33735 | this.destination.next(this._trailingValue);
|
33736 | this._trailingValue = null;
|
33737 | this._hasTrailingValue = false;
|
33738 | }
|
33739 | throttled.unsubscribe();
|
33740 | this.remove(throttled);
|
33741 | this.throttled = null;
|
33742 | }
|
33743 | };
|
33744 | return ThrottleTimeSubscriber;
|
33745 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
33746 | function dispatchNext(arg) {
|
33747 | var subscriber = arg.subscriber;
|
33748 | subscriber.clearThrottle();
|
33749 | }
|
33750 |
|
33751 |
|
33752 |
|
33753 | }),
|
33754 |
|
33755 | (function(module, __webpack_exports__, __webpack_require__) {
|
33756 |
|
33757 | "use strict";
|
33758 | __webpack_require__.r(__webpack_exports__);
|
33759 | __webpack_require__.d(__webpack_exports__, "timeInterval", function() { return timeInterval; });
|
33760 | __webpack_require__.d(__webpack_exports__, "TimeInterval", function() { return TimeInterval; });
|
33761 | var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(213);
|
33762 | var _scan__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(314);
|
33763 | var _observable_defer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(248);
|
33764 | var _map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(224);
|
33765 |
|
33766 |
|
33767 |
|
33768 |
|
33769 |
|
33770 | function timeInterval(scheduler) {
|
33771 | if (scheduler === void 0) {
|
33772 | scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"];
|
33773 | }
|
33774 | return function (source) {
|
33775 | return Object(_observable_defer__WEBPACK_IMPORTED_MODULE_2__["defer"])(function () {
|
33776 | return source.pipe(Object(_scan__WEBPACK_IMPORTED_MODULE_1__["scan"])(function (_a, value) {
|
33777 | var current = _a.current;
|
33778 | return ({ value: value, current: scheduler.now(), last: current });
|
33779 | }, { current: scheduler.now(), value: undefined, last: undefined }), Object(_map__WEBPACK_IMPORTED_MODULE_3__["map"])(function (_a) {
|
33780 | var current = _a.current, last = _a.last, value = _a.value;
|
33781 | return new TimeInterval(value, current - last);
|
33782 | }));
|
33783 | });
|
33784 | };
|
33785 | }
|
33786 | var TimeInterval = (function () {
|
33787 | function TimeInterval(value, interval) {
|
33788 | this.value = value;
|
33789 | this.interval = interval;
|
33790 | }
|
33791 | return TimeInterval;
|
33792 | }());
|
33793 |
|
33794 |
|
33795 |
|
33796 |
|
33797 | }),
|
33798 |
|
33799 | (function(module, __webpack_exports__, __webpack_require__) {
|
33800 |
|
33801 | "use strict";
|
33802 | __webpack_require__.r(__webpack_exports__);
|
33803 | __webpack_require__.d(__webpack_exports__, "timeout", function() { return timeout; });
|
33804 | var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(213);
|
33805 | var _util_TimeoutError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(222);
|
33806 | var _timeoutWith__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(356);
|
33807 | var _observable_throwError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(207);
|
33808 |
|
33809 |
|
33810 |
|
33811 |
|
33812 |
|
33813 | function timeout(due, scheduler) {
|
33814 | if (scheduler === void 0) {
|
33815 | scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"];
|
33816 | }
|
33817 | return Object(_timeoutWith__WEBPACK_IMPORTED_MODULE_2__["timeoutWith"])(due, Object(_observable_throwError__WEBPACK_IMPORTED_MODULE_3__["throwError"])(new _util_TimeoutError__WEBPACK_IMPORTED_MODULE_1__["TimeoutError"]()), scheduler);
|
33818 | }
|
33819 |
|
33820 |
|
33821 |
|
33822 | }),
|
33823 |
|
33824 | (function(module, __webpack_exports__, __webpack_require__) {
|
33825 |
|
33826 | "use strict";
|
33827 | __webpack_require__.r(__webpack_exports__);
|
33828 | __webpack_require__.d(__webpack_exports__, "timeoutWith", function() { return timeoutWith; });
|
33829 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
33830 | var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(213);
|
33831 | var _util_isDate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(288);
|
33832 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(227);
|
33833 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(228);
|
33834 |
|
33835 |
|
33836 |
|
33837 |
|
33838 |
|
33839 |
|
33840 | function timeoutWith(due, withObservable, scheduler) {
|
33841 | if (scheduler === void 0) {
|
33842 | scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"];
|
33843 | }
|
33844 | return function (source) {
|
33845 | var absoluteTimeout = Object(_util_isDate__WEBPACK_IMPORTED_MODULE_2__["isDate"])(due);
|
33846 | var waitFor = absoluteTimeout ? (+due - scheduler.now()) : Math.abs(due);
|
33847 | return source.lift(new TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler));
|
33848 | };
|
33849 | }
|
33850 | var TimeoutWithOperator = (function () {
|
33851 | function TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler) {
|
33852 | this.waitFor = waitFor;
|
33853 | this.absoluteTimeout = absoluteTimeout;
|
33854 | this.withObservable = withObservable;
|
33855 | this.scheduler = scheduler;
|
33856 | }
|
33857 | TimeoutWithOperator.prototype.call = function (subscriber, source) {
|
33858 | return source.subscribe(new TimeoutWithSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.withObservable, this.scheduler));
|
33859 | };
|
33860 | return TimeoutWithOperator;
|
33861 | }());
|
33862 | var TimeoutWithSubscriber = (function (_super) {
|
33863 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](TimeoutWithSubscriber, _super);
|
33864 | function TimeoutWithSubscriber(destination, absoluteTimeout, waitFor, withObservable, scheduler) {
|
33865 | var _this = _super.call(this, destination) || this;
|
33866 | _this.absoluteTimeout = absoluteTimeout;
|
33867 | _this.waitFor = waitFor;
|
33868 | _this.withObservable = withObservable;
|
33869 | _this.scheduler = scheduler;
|
33870 | _this.action = null;
|
33871 | _this.scheduleTimeout();
|
33872 | return _this;
|
33873 | }
|
33874 | TimeoutWithSubscriber.dispatchTimeout = function (subscriber) {
|
33875 | var withObservable = subscriber.withObservable;
|
33876 | subscriber._unsubscribeAndRecycle();
|
33877 | subscriber.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(subscriber, withObservable));
|
33878 | };
|
33879 | TimeoutWithSubscriber.prototype.scheduleTimeout = function () {
|
33880 | var action = this.action;
|
33881 | if (action) {
|
33882 | this.action = action.schedule(this, this.waitFor);
|
33883 | }
|
33884 | else {
|
33885 | this.add(this.action = this.scheduler.schedule(TimeoutWithSubscriber.dispatchTimeout, this.waitFor, this));
|
33886 | }
|
33887 | };
|
33888 | TimeoutWithSubscriber.prototype._next = function (value) {
|
33889 | if (!this.absoluteTimeout) {
|
33890 | this.scheduleTimeout();
|
33891 | }
|
33892 | _super.prototype._next.call(this, value);
|
33893 | };
|
33894 | TimeoutWithSubscriber.prototype._unsubscribe = function () {
|
33895 | this.action = null;
|
33896 | this.scheduler = null;
|
33897 | this.withObservable = null;
|
33898 | };
|
33899 | return TimeoutWithSubscriber;
|
33900 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"]));
|
33901 |
|
33902 |
|
33903 |
|
33904 | }),
|
33905 |
|
33906 | (function(module, __webpack_exports__, __webpack_require__) {
|
33907 |
|
33908 | "use strict";
|
33909 | __webpack_require__.r(__webpack_exports__);
|
33910 | __webpack_require__.d(__webpack_exports__, "timestamp", function() { return timestamp; });
|
33911 | __webpack_require__.d(__webpack_exports__, "Timestamp", function() { return Timestamp; });
|
33912 | var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(213);
|
33913 | var _map__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(224);
|
33914 |
|
33915 |
|
33916 |
|
33917 | function timestamp(scheduler) {
|
33918 | if (scheduler === void 0) {
|
33919 | scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"];
|
33920 | }
|
33921 | return Object(_map__WEBPACK_IMPORTED_MODULE_1__["map"])(function (value) { return new Timestamp(value, scheduler.now()); });
|
33922 | }
|
33923 | var Timestamp = (function () {
|
33924 | function Timestamp(value, timestamp) {
|
33925 | this.value = value;
|
33926 | this.timestamp = timestamp;
|
33927 | }
|
33928 | return Timestamp;
|
33929 | }());
|
33930 |
|
33931 |
|
33932 |
|
33933 |
|
33934 | }),
|
33935 |
|
33936 | (function(module, __webpack_exports__, __webpack_require__) {
|
33937 |
|
33938 | "use strict";
|
33939 | __webpack_require__.r(__webpack_exports__);
|
33940 | __webpack_require__.d(__webpack_exports__, "toArray", function() { return toArray; });
|
33941 | var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(313);
|
33942 |
|
33943 |
|
33944 | function toArrayReducer(arr, item, index) {
|
33945 | if (index === 0) {
|
33946 | return [item];
|
33947 | }
|
33948 | arr.push(item);
|
33949 | return arr;
|
33950 | }
|
33951 | function toArray() {
|
33952 | return Object(_reduce__WEBPACK_IMPORTED_MODULE_0__["reduce"])(toArrayReducer, []);
|
33953 | }
|
33954 |
|
33955 |
|
33956 |
|
33957 | }),
|
33958 |
|
33959 | (function(module, __webpack_exports__, __webpack_require__) {
|
33960 |
|
33961 | "use strict";
|
33962 | __webpack_require__.r(__webpack_exports__);
|
33963 | __webpack_require__.d(__webpack_exports__, "window", function() { return window; });
|
33964 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
33965 | var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(185);
|
33966 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(227);
|
33967 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(228);
|
33968 |
|
33969 |
|
33970 |
|
33971 |
|
33972 |
|
33973 | function window(windowBoundaries) {
|
33974 | return function windowOperatorFunction(source) {
|
33975 | return source.lift(new WindowOperator(windowBoundaries));
|
33976 | };
|
33977 | }
|
33978 | var WindowOperator = (function () {
|
33979 | function WindowOperator(windowBoundaries) {
|
33980 | this.windowBoundaries = windowBoundaries;
|
33981 | }
|
33982 | WindowOperator.prototype.call = function (subscriber, source) {
|
33983 | var windowSubscriber = new WindowSubscriber(subscriber);
|
33984 | var sourceSubscription = source.subscribe(windowSubscriber);
|
33985 | if (!sourceSubscription.closed) {
|
33986 | windowSubscriber.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(windowSubscriber, this.windowBoundaries));
|
33987 | }
|
33988 | return sourceSubscription;
|
33989 | };
|
33990 | return WindowOperator;
|
33991 | }());
|
33992 | var WindowSubscriber = (function (_super) {
|
33993 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](WindowSubscriber, _super);
|
33994 | function WindowSubscriber(destination) {
|
33995 | var _this = _super.call(this, destination) || this;
|
33996 | _this.window = new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]();
|
33997 | destination.next(_this.window);
|
33998 | return _this;
|
33999 | }
|
34000 | WindowSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
34001 | this.openWindow();
|
34002 | };
|
34003 | WindowSubscriber.prototype.notifyError = function (error, innerSub) {
|
34004 | this._error(error);
|
34005 | };
|
34006 | WindowSubscriber.prototype.notifyComplete = function (innerSub) {
|
34007 | this._complete();
|
34008 | };
|
34009 | WindowSubscriber.prototype._next = function (value) {
|
34010 | this.window.next(value);
|
34011 | };
|
34012 | WindowSubscriber.prototype._error = function (err) {
|
34013 | this.window.error(err);
|
34014 | this.destination.error(err);
|
34015 | };
|
34016 | WindowSubscriber.prototype._complete = function () {
|
34017 | this.window.complete();
|
34018 | this.destination.complete();
|
34019 | };
|
34020 | WindowSubscriber.prototype._unsubscribe = function () {
|
34021 | this.window = null;
|
34022 | };
|
34023 | WindowSubscriber.prototype.openWindow = function () {
|
34024 | var prevWindow = this.window;
|
34025 | if (prevWindow) {
|
34026 | prevWindow.complete();
|
34027 | }
|
34028 | var destination = this.destination;
|
34029 | var newWindow = this.window = new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]();
|
34030 | destination.next(newWindow);
|
34031 | };
|
34032 | return WindowSubscriber;
|
34033 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"]));
|
34034 |
|
34035 |
|
34036 |
|
34037 | }),
|
34038 |
|
34039 | (function(module, __webpack_exports__, __webpack_require__) {
|
34040 |
|
34041 | "use strict";
|
34042 | __webpack_require__.r(__webpack_exports__);
|
34043 | __webpack_require__.d(__webpack_exports__, "windowCount", function() { return windowCount; });
|
34044 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
34045 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
34046 | var _Subject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(185);
|
34047 |
|
34048 |
|
34049 |
|
34050 |
|
34051 | function windowCount(windowSize, startWindowEvery) {
|
34052 | if (startWindowEvery === void 0) {
|
34053 | startWindowEvery = 0;
|
34054 | }
|
34055 | return function windowCountOperatorFunction(source) {
|
34056 | return source.lift(new WindowCountOperator(windowSize, startWindowEvery));
|
34057 | };
|
34058 | }
|
34059 | var WindowCountOperator = (function () {
|
34060 | function WindowCountOperator(windowSize, startWindowEvery) {
|
34061 | this.windowSize = windowSize;
|
34062 | this.startWindowEvery = startWindowEvery;
|
34063 | }
|
34064 | WindowCountOperator.prototype.call = function (subscriber, source) {
|
34065 | return source.subscribe(new WindowCountSubscriber(subscriber, this.windowSize, this.startWindowEvery));
|
34066 | };
|
34067 | return WindowCountOperator;
|
34068 | }());
|
34069 | var WindowCountSubscriber = (function (_super) {
|
34070 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](WindowCountSubscriber, _super);
|
34071 | function WindowCountSubscriber(destination, windowSize, startWindowEvery) {
|
34072 | var _this = _super.call(this, destination) || this;
|
34073 | _this.destination = destination;
|
34074 | _this.windowSize = windowSize;
|
34075 | _this.startWindowEvery = startWindowEvery;
|
34076 | _this.windows = [new _Subject__WEBPACK_IMPORTED_MODULE_2__["Subject"]()];
|
34077 | _this.count = 0;
|
34078 | destination.next(_this.windows[0]);
|
34079 | return _this;
|
34080 | }
|
34081 | WindowCountSubscriber.prototype._next = function (value) {
|
34082 | var startWindowEvery = (this.startWindowEvery > 0) ? this.startWindowEvery : this.windowSize;
|
34083 | var destination = this.destination;
|
34084 | var windowSize = this.windowSize;
|
34085 | var windows = this.windows;
|
34086 | var len = windows.length;
|
34087 | for (var i = 0; i < len && !this.closed; i++) {
|
34088 | windows[i].next(value);
|
34089 | }
|
34090 | var c = this.count - windowSize + 1;
|
34091 | if (c >= 0 && c % startWindowEvery === 0 && !this.closed) {
|
34092 | windows.shift().complete();
|
34093 | }
|
34094 | if (++this.count % startWindowEvery === 0 && !this.closed) {
|
34095 | var window_1 = new _Subject__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
|
34096 | windows.push(window_1);
|
34097 | destination.next(window_1);
|
34098 | }
|
34099 | };
|
34100 | WindowCountSubscriber.prototype._error = function (err) {
|
34101 | var windows = this.windows;
|
34102 | if (windows) {
|
34103 | while (windows.length > 0 && !this.closed) {
|
34104 | windows.shift().error(err);
|
34105 | }
|
34106 | }
|
34107 | this.destination.error(err);
|
34108 | };
|
34109 | WindowCountSubscriber.prototype._complete = function () {
|
34110 | var windows = this.windows;
|
34111 | if (windows) {
|
34112 | while (windows.length > 0 && !this.closed) {
|
34113 | windows.shift().complete();
|
34114 | }
|
34115 | }
|
34116 | this.destination.complete();
|
34117 | };
|
34118 | WindowCountSubscriber.prototype._unsubscribe = function () {
|
34119 | this.count = 0;
|
34120 | this.windows = null;
|
34121 | };
|
34122 | return WindowCountSubscriber;
|
34123 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
34124 |
|
34125 |
|
34126 |
|
34127 | }),
|
34128 |
|
34129 | (function(module, __webpack_exports__, __webpack_require__) {
|
34130 |
|
34131 | "use strict";
|
34132 | __webpack_require__.r(__webpack_exports__);
|
34133 | __webpack_require__.d(__webpack_exports__, "windowTime", function() { return windowTime; });
|
34134 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
34135 | var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(185);
|
34136 | var _scheduler_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(213);
|
34137 | var _Subscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(169);
|
34138 | var _util_isNumeric__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(255);
|
34139 | var _util_isScheduler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(203);
|
34140 |
|
34141 |
|
34142 |
|
34143 |
|
34144 |
|
34145 |
|
34146 |
|
34147 | function windowTime(windowTimeSpan) {
|
34148 | var scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_2__["async"];
|
34149 | var windowCreationInterval = null;
|
34150 | var maxWindowSize = Number.POSITIVE_INFINITY;
|
34151 | if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_5__["isScheduler"])(arguments[3])) {
|
34152 | scheduler = arguments[3];
|
34153 | }
|
34154 | if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_5__["isScheduler"])(arguments[2])) {
|
34155 | scheduler = arguments[2];
|
34156 | }
|
34157 | else if (Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_4__["isNumeric"])(arguments[2])) {
|
34158 | maxWindowSize = arguments[2];
|
34159 | }
|
34160 | if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_5__["isScheduler"])(arguments[1])) {
|
34161 | scheduler = arguments[1];
|
34162 | }
|
34163 | else if (Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_4__["isNumeric"])(arguments[1])) {
|
34164 | windowCreationInterval = arguments[1];
|
34165 | }
|
34166 | return function windowTimeOperatorFunction(source) {
|
34167 | return source.lift(new WindowTimeOperator(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler));
|
34168 | };
|
34169 | }
|
34170 | var WindowTimeOperator = (function () {
|
34171 | function WindowTimeOperator(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) {
|
34172 | this.windowTimeSpan = windowTimeSpan;
|
34173 | this.windowCreationInterval = windowCreationInterval;
|
34174 | this.maxWindowSize = maxWindowSize;
|
34175 | this.scheduler = scheduler;
|
34176 | }
|
34177 | WindowTimeOperator.prototype.call = function (subscriber, source) {
|
34178 | return source.subscribe(new WindowTimeSubscriber(subscriber, this.windowTimeSpan, this.windowCreationInterval, this.maxWindowSize, this.scheduler));
|
34179 | };
|
34180 | return WindowTimeOperator;
|
34181 | }());
|
34182 | var CountedSubject = (function (_super) {
|
34183 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](CountedSubject, _super);
|
34184 | function CountedSubject() {
|
34185 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
34186 | _this._numberOfNextedValues = 0;
|
34187 | return _this;
|
34188 | }
|
34189 | CountedSubject.prototype.next = function (value) {
|
34190 | this._numberOfNextedValues++;
|
34191 | _super.prototype.next.call(this, value);
|
34192 | };
|
34193 | Object.defineProperty(CountedSubject.prototype, "numberOfNextedValues", {
|
34194 | get: function () {
|
34195 | return this._numberOfNextedValues;
|
34196 | },
|
34197 | enumerable: true,
|
34198 | configurable: true
|
34199 | });
|
34200 | return CountedSubject;
|
34201 | }(_Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]));
|
34202 | var WindowTimeSubscriber = (function (_super) {
|
34203 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](WindowTimeSubscriber, _super);
|
34204 | function WindowTimeSubscriber(destination, windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) {
|
34205 | var _this = _super.call(this, destination) || this;
|
34206 | _this.destination = destination;
|
34207 | _this.windowTimeSpan = windowTimeSpan;
|
34208 | _this.windowCreationInterval = windowCreationInterval;
|
34209 | _this.maxWindowSize = maxWindowSize;
|
34210 | _this.scheduler = scheduler;
|
34211 | _this.windows = [];
|
34212 | var window = _this.openWindow();
|
34213 | if (windowCreationInterval !== null && windowCreationInterval >= 0) {
|
34214 | var closeState = { subscriber: _this, window: window, context: null };
|
34215 | var creationState = { windowTimeSpan: windowTimeSpan, windowCreationInterval: windowCreationInterval, subscriber: _this, scheduler: scheduler };
|
34216 | _this.add(scheduler.schedule(dispatchWindowClose, windowTimeSpan, closeState));
|
34217 | _this.add(scheduler.schedule(dispatchWindowCreation, windowCreationInterval, creationState));
|
34218 | }
|
34219 | else {
|
34220 | var timeSpanOnlyState = { subscriber: _this, window: window, windowTimeSpan: windowTimeSpan };
|
34221 | _this.add(scheduler.schedule(dispatchWindowTimeSpanOnly, windowTimeSpan, timeSpanOnlyState));
|
34222 | }
|
34223 | return _this;
|
34224 | }
|
34225 | WindowTimeSubscriber.prototype._next = function (value) {
|
34226 | var windows = this.windows;
|
34227 | var len = windows.length;
|
34228 | for (var i = 0; i < len; i++) {
|
34229 | var window_1 = windows[i];
|
34230 | if (!window_1.closed) {
|
34231 | window_1.next(value);
|
34232 | if (window_1.numberOfNextedValues >= this.maxWindowSize) {
|
34233 | this.closeWindow(window_1);
|
34234 | }
|
34235 | }
|
34236 | }
|
34237 | };
|
34238 | WindowTimeSubscriber.prototype._error = function (err) {
|
34239 | var windows = this.windows;
|
34240 | while (windows.length > 0) {
|
34241 | windows.shift().error(err);
|
34242 | }
|
34243 | this.destination.error(err);
|
34244 | };
|
34245 | WindowTimeSubscriber.prototype._complete = function () {
|
34246 | var windows = this.windows;
|
34247 | while (windows.length > 0) {
|
34248 | var window_2 = windows.shift();
|
34249 | if (!window_2.closed) {
|
34250 | window_2.complete();
|
34251 | }
|
34252 | }
|
34253 | this.destination.complete();
|
34254 | };
|
34255 | WindowTimeSubscriber.prototype.openWindow = function () {
|
34256 | var window = new CountedSubject();
|
34257 | this.windows.push(window);
|
34258 | var destination = this.destination;
|
34259 | destination.next(window);
|
34260 | return window;
|
34261 | };
|
34262 | WindowTimeSubscriber.prototype.closeWindow = function (window) {
|
34263 | window.complete();
|
34264 | var windows = this.windows;
|
34265 | windows.splice(windows.indexOf(window), 1);
|
34266 | };
|
34267 | return WindowTimeSubscriber;
|
34268 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_3__["Subscriber"]));
|
34269 | function dispatchWindowTimeSpanOnly(state) {
|
34270 | var subscriber = state.subscriber, windowTimeSpan = state.windowTimeSpan, window = state.window;
|
34271 | if (window) {
|
34272 | subscriber.closeWindow(window);
|
34273 | }
|
34274 | state.window = subscriber.openWindow();
|
34275 | this.schedule(state, windowTimeSpan);
|
34276 | }
|
34277 | function dispatchWindowCreation(state) {
|
34278 | var windowTimeSpan = state.windowTimeSpan, subscriber = state.subscriber, scheduler = state.scheduler, windowCreationInterval = state.windowCreationInterval;
|
34279 | var window = subscriber.openWindow();
|
34280 | var action = this;
|
34281 | var context = { action: action, subscription: null };
|
34282 | var timeSpanState = { subscriber: subscriber, window: window, context: context };
|
34283 | context.subscription = scheduler.schedule(dispatchWindowClose, windowTimeSpan, timeSpanState);
|
34284 | action.add(context.subscription);
|
34285 | action.schedule(state, windowCreationInterval);
|
34286 | }
|
34287 | function dispatchWindowClose(state) {
|
34288 | var subscriber = state.subscriber, window = state.window, context = state.context;
|
34289 | if (context && context.action && context.subscription) {
|
34290 | context.action.remove(context.subscription);
|
34291 | }
|
34292 | subscriber.closeWindow(window);
|
34293 | }
|
34294 |
|
34295 |
|
34296 |
|
34297 | }),
|
34298 |
|
34299 | (function(module, __webpack_exports__, __webpack_require__) {
|
34300 |
|
34301 | "use strict";
|
34302 | __webpack_require__.r(__webpack_exports__);
|
34303 | __webpack_require__.d(__webpack_exports__, "windowToggle", function() { return windowToggle; });
|
34304 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
34305 | var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(185);
|
34306 | var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(175);
|
34307 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(227);
|
34308 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(228);
|
34309 |
|
34310 |
|
34311 |
|
34312 |
|
34313 |
|
34314 |
|
34315 | function windowToggle(openings, closingSelector) {
|
34316 | return function (source) { return source.lift(new WindowToggleOperator(openings, closingSelector)); };
|
34317 | }
|
34318 | var WindowToggleOperator = (function () {
|
34319 | function WindowToggleOperator(openings, closingSelector) {
|
34320 | this.openings = openings;
|
34321 | this.closingSelector = closingSelector;
|
34322 | }
|
34323 | WindowToggleOperator.prototype.call = function (subscriber, source) {
|
34324 | return source.subscribe(new WindowToggleSubscriber(subscriber, this.openings, this.closingSelector));
|
34325 | };
|
34326 | return WindowToggleOperator;
|
34327 | }());
|
34328 | var WindowToggleSubscriber = (function (_super) {
|
34329 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](WindowToggleSubscriber, _super);
|
34330 | function WindowToggleSubscriber(destination, openings, closingSelector) {
|
34331 | var _this = _super.call(this, destination) || this;
|
34332 | _this.openings = openings;
|
34333 | _this.closingSelector = closingSelector;
|
34334 | _this.contexts = [];
|
34335 | _this.add(_this.openSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(_this, openings, openings));
|
34336 | return _this;
|
34337 | }
|
34338 | WindowToggleSubscriber.prototype._next = function (value) {
|
34339 | var contexts = this.contexts;
|
34340 | if (contexts) {
|
34341 | var len = contexts.length;
|
34342 | for (var i = 0; i < len; i++) {
|
34343 | contexts[i].window.next(value);
|
34344 | }
|
34345 | }
|
34346 | };
|
34347 | WindowToggleSubscriber.prototype._error = function (err) {
|
34348 | var contexts = this.contexts;
|
34349 | this.contexts = null;
|
34350 | if (contexts) {
|
34351 | var len = contexts.length;
|
34352 | var index = -1;
|
34353 | while (++index < len) {
|
34354 | var context_1 = contexts[index];
|
34355 | context_1.window.error(err);
|
34356 | context_1.subscription.unsubscribe();
|
34357 | }
|
34358 | }
|
34359 | _super.prototype._error.call(this, err);
|
34360 | };
|
34361 | WindowToggleSubscriber.prototype._complete = function () {
|
34362 | var contexts = this.contexts;
|
34363 | this.contexts = null;
|
34364 | if (contexts) {
|
34365 | var len = contexts.length;
|
34366 | var index = -1;
|
34367 | while (++index < len) {
|
34368 | var context_2 = contexts[index];
|
34369 | context_2.window.complete();
|
34370 | context_2.subscription.unsubscribe();
|
34371 | }
|
34372 | }
|
34373 | _super.prototype._complete.call(this);
|
34374 | };
|
34375 | WindowToggleSubscriber.prototype._unsubscribe = function () {
|
34376 | var contexts = this.contexts;
|
34377 | this.contexts = null;
|
34378 | if (contexts) {
|
34379 | var len = contexts.length;
|
34380 | var index = -1;
|
34381 | while (++index < len) {
|
34382 | var context_3 = contexts[index];
|
34383 | context_3.window.unsubscribe();
|
34384 | context_3.subscription.unsubscribe();
|
34385 | }
|
34386 | }
|
34387 | };
|
34388 | WindowToggleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
34389 | if (outerValue === this.openings) {
|
34390 | var closingNotifier = void 0;
|
34391 | try {
|
34392 | var closingSelector = this.closingSelector;
|
34393 | closingNotifier = closingSelector(innerValue);
|
34394 | }
|
34395 | catch (e) {
|
34396 | return this.error(e);
|
34397 | }
|
34398 | var window_1 = new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]();
|
34399 | var subscription = new _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"]();
|
34400 | var context_4 = { window: window_1, subscription: subscription };
|
34401 | this.contexts.push(context_4);
|
34402 | var innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(this, closingNotifier, context_4);
|
34403 | if (innerSubscription.closed) {
|
34404 | this.closeWindow(this.contexts.length - 1);
|
34405 | }
|
34406 | else {
|
34407 | innerSubscription.context = context_4;
|
34408 | subscription.add(innerSubscription);
|
34409 | }
|
34410 | this.destination.next(window_1);
|
34411 | }
|
34412 | else {
|
34413 | this.closeWindow(this.contexts.indexOf(outerValue));
|
34414 | }
|
34415 | };
|
34416 | WindowToggleSubscriber.prototype.notifyError = function (err) {
|
34417 | this.error(err);
|
34418 | };
|
34419 | WindowToggleSubscriber.prototype.notifyComplete = function (inner) {
|
34420 | if (inner !== this.openSubscription) {
|
34421 | this.closeWindow(this.contexts.indexOf(inner.context));
|
34422 | }
|
34423 | };
|
34424 | WindowToggleSubscriber.prototype.closeWindow = function (index) {
|
34425 | if (index === -1) {
|
34426 | return;
|
34427 | }
|
34428 | var contexts = this.contexts;
|
34429 | var context = contexts[index];
|
34430 | var window = context.window, subscription = context.subscription;
|
34431 | contexts.splice(index, 1);
|
34432 | window.complete();
|
34433 | subscription.unsubscribe();
|
34434 | };
|
34435 | return WindowToggleSubscriber;
|
34436 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"]));
|
34437 |
|
34438 |
|
34439 |
|
34440 | }),
|
34441 |
|
34442 | (function(module, __webpack_exports__, __webpack_require__) {
|
34443 |
|
34444 | "use strict";
|
34445 | __webpack_require__.r(__webpack_exports__);
|
34446 | __webpack_require__.d(__webpack_exports__, "windowWhen", function() { return windowWhen; });
|
34447 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
34448 | var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(185);
|
34449 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(227);
|
34450 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(228);
|
34451 |
|
34452 |
|
34453 |
|
34454 |
|
34455 |
|
34456 | function windowWhen(closingSelector) {
|
34457 | return function windowWhenOperatorFunction(source) {
|
34458 | return source.lift(new WindowOperator(closingSelector));
|
34459 | };
|
34460 | }
|
34461 | var WindowOperator = (function () {
|
34462 | function WindowOperator(closingSelector) {
|
34463 | this.closingSelector = closingSelector;
|
34464 | }
|
34465 | WindowOperator.prototype.call = function (subscriber, source) {
|
34466 | return source.subscribe(new WindowSubscriber(subscriber, this.closingSelector));
|
34467 | };
|
34468 | return WindowOperator;
|
34469 | }());
|
34470 | var WindowSubscriber = (function (_super) {
|
34471 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](WindowSubscriber, _super);
|
34472 | function WindowSubscriber(destination, closingSelector) {
|
34473 | var _this = _super.call(this, destination) || this;
|
34474 | _this.destination = destination;
|
34475 | _this.closingSelector = closingSelector;
|
34476 | _this.openWindow();
|
34477 | return _this;
|
34478 | }
|
34479 | WindowSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
34480 | this.openWindow(innerSub);
|
34481 | };
|
34482 | WindowSubscriber.prototype.notifyError = function (error, innerSub) {
|
34483 | this._error(error);
|
34484 | };
|
34485 | WindowSubscriber.prototype.notifyComplete = function (innerSub) {
|
34486 | this.openWindow(innerSub);
|
34487 | };
|
34488 | WindowSubscriber.prototype._next = function (value) {
|
34489 | this.window.next(value);
|
34490 | };
|
34491 | WindowSubscriber.prototype._error = function (err) {
|
34492 | this.window.error(err);
|
34493 | this.destination.error(err);
|
34494 | this.unsubscribeClosingNotification();
|
34495 | };
|
34496 | WindowSubscriber.prototype._complete = function () {
|
34497 | this.window.complete();
|
34498 | this.destination.complete();
|
34499 | this.unsubscribeClosingNotification();
|
34500 | };
|
34501 | WindowSubscriber.prototype.unsubscribeClosingNotification = function () {
|
34502 | if (this.closingNotification) {
|
34503 | this.closingNotification.unsubscribe();
|
34504 | }
|
34505 | };
|
34506 | WindowSubscriber.prototype.openWindow = function (innerSub) {
|
34507 | if (innerSub === void 0) {
|
34508 | innerSub = null;
|
34509 | }
|
34510 | if (innerSub) {
|
34511 | this.remove(innerSub);
|
34512 | innerSub.unsubscribe();
|
34513 | }
|
34514 | var prevWindow = this.window;
|
34515 | if (prevWindow) {
|
34516 | prevWindow.complete();
|
34517 | }
|
34518 | var window = this.window = new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]();
|
34519 | this.destination.next(window);
|
34520 | var closingNotifier;
|
34521 | try {
|
34522 | var closingSelector = this.closingSelector;
|
34523 | closingNotifier = closingSelector();
|
34524 | }
|
34525 | catch (e) {
|
34526 | this.destination.error(e);
|
34527 | this.window.error(e);
|
34528 | return;
|
34529 | }
|
34530 | this.add(this.closingNotification = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(this, closingNotifier));
|
34531 | };
|
34532 | return WindowSubscriber;
|
34533 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"]));
|
34534 |
|
34535 |
|
34536 |
|
34537 | }),
|
34538 |
|
34539 | (function(module, __webpack_exports__, __webpack_require__) {
|
34540 |
|
34541 | "use strict";
|
34542 | __webpack_require__.r(__webpack_exports__);
|
34543 | __webpack_require__.d(__webpack_exports__, "withLatestFrom", function() { return withLatestFrom; });
|
34544 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
34545 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(227);
|
34546 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(228);
|
34547 |
|
34548 |
|
34549 |
|
34550 |
|
34551 | function withLatestFrom() {
|
34552 | var args = [];
|
34553 | for (var _i = 0; _i < arguments.length; _i++) {
|
34554 | args[_i] = arguments[_i];
|
34555 | }
|
34556 | return function (source) {
|
34557 | var project;
|
34558 | if (typeof args[args.length - 1] === 'function') {
|
34559 | project = args.pop();
|
34560 | }
|
34561 | var observables = args;
|
34562 | return source.lift(new WithLatestFromOperator(observables, project));
|
34563 | };
|
34564 | }
|
34565 | var WithLatestFromOperator = (function () {
|
34566 | function WithLatestFromOperator(observables, project) {
|
34567 | this.observables = observables;
|
34568 | this.project = project;
|
34569 | }
|
34570 | WithLatestFromOperator.prototype.call = function (subscriber, source) {
|
34571 | return source.subscribe(new WithLatestFromSubscriber(subscriber, this.observables, this.project));
|
34572 | };
|
34573 | return WithLatestFromOperator;
|
34574 | }());
|
34575 | var WithLatestFromSubscriber = (function (_super) {
|
34576 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](WithLatestFromSubscriber, _super);
|
34577 | function WithLatestFromSubscriber(destination, observables, project) {
|
34578 | var _this = _super.call(this, destination) || this;
|
34579 | _this.observables = observables;
|
34580 | _this.project = project;
|
34581 | _this.toRespond = [];
|
34582 | var len = observables.length;
|
34583 | _this.values = new Array(len);
|
34584 | for (var i = 0; i < len; i++) {
|
34585 | _this.toRespond.push(i);
|
34586 | }
|
34587 | for (var i = 0; i < len; i++) {
|
34588 | var observable = observables[i];
|
34589 | _this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(_this, observable, observable, i));
|
34590 | }
|
34591 | return _this;
|
34592 | }
|
34593 | WithLatestFromSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
34594 | this.values[outerIndex] = innerValue;
|
34595 | var toRespond = this.toRespond;
|
34596 | if (toRespond.length > 0) {
|
34597 | var found = toRespond.indexOf(outerIndex);
|
34598 | if (found !== -1) {
|
34599 | toRespond.splice(found, 1);
|
34600 | }
|
34601 | }
|
34602 | };
|
34603 | WithLatestFromSubscriber.prototype.notifyComplete = function () {
|
34604 | };
|
34605 | WithLatestFromSubscriber.prototype._next = function (value) {
|
34606 | if (this.toRespond.length === 0) {
|
34607 | var args = [value].concat(this.values);
|
34608 | if (this.project) {
|
34609 | this._tryProject(args);
|
34610 | }
|
34611 | else {
|
34612 | this.destination.next(args);
|
34613 | }
|
34614 | }
|
34615 | };
|
34616 | WithLatestFromSubscriber.prototype._tryProject = function (args) {
|
34617 | var result;
|
34618 | try {
|
34619 | result = this.project.apply(this, args);
|
34620 | }
|
34621 | catch (err) {
|
34622 | this.destination.error(err);
|
34623 | return;
|
34624 | }
|
34625 | this.destination.next(result);
|
34626 | };
|
34627 | return WithLatestFromSubscriber;
|
34628 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
34629 |
|
34630 |
|
34631 |
|
34632 | }),
|
34633 |
|
34634 | (function(module, __webpack_exports__, __webpack_require__) {
|
34635 |
|
34636 | "use strict";
|
34637 | __webpack_require__.r(__webpack_exports__);
|
34638 | __webpack_require__.d(__webpack_exports__, "zip", function() { return zip; });
|
34639 | var _observable_zip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(267);
|
34640 |
|
34641 |
|
34642 | function zip() {
|
34643 | var observables = [];
|
34644 | for (var _i = 0; _i < arguments.length; _i++) {
|
34645 | observables[_i] = arguments[_i];
|
34646 | }
|
34647 | return function zipOperatorFunction(source) {
|
34648 | return source.lift.call(_observable_zip__WEBPACK_IMPORTED_MODULE_0__["zip"].apply(void 0, [source].concat(observables)));
|
34649 | };
|
34650 | }
|
34651 |
|
34652 |
|
34653 |
|
34654 | }),
|
34655 |
|
34656 | (function(module, __webpack_exports__, __webpack_require__) {
|
34657 |
|
34658 | "use strict";
|
34659 | __webpack_require__.r(__webpack_exports__);
|
34660 | __webpack_require__.d(__webpack_exports__, "zipAll", function() { return zipAll; });
|
34661 | var _observable_zip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(267);
|
34662 |
|
34663 |
|
34664 | function zipAll(project) {
|
34665 | return function (source) { return source.lift(new _observable_zip__WEBPACK_IMPORTED_MODULE_0__["ZipOperator"](project)); };
|
34666 | }
|
34667 |
|
34668 |
|
34669 |
|
34670 | }),
|
34671 | ,
|
34672 | ,
|
34673 | ,
|
34674 |
|
34675 | (function(module, exports, __webpack_require__) {
|
34676 |
|
34677 | "use strict";
|
34678 |
|
34679 | var __importDefault = (this && this.__importDefault) || function (mod) {
|
34680 | return (mod && mod.__esModule) ? mod : { "default": mod };
|
34681 | };
|
34682 | Object.defineProperty(exports, "__esModule", { value: true });
|
34683 | var fast_glob_1 = __importDefault(__webpack_require__(60));
|
34684 | var os_1 = __importDefault(__webpack_require__(14));
|
34685 | var path_1 = __webpack_require__(13);
|
34686 | var rxjs_1 = __webpack_require__(166);
|
34687 | var operators_1 = __webpack_require__(269);
|
34688 | var vscode_uri_1 = __webpack_require__(149);
|
34689 | var fs_1 = __webpack_require__(40);
|
34690 | var constant_1 = __webpack_require__(44);
|
34691 | var util_1 = __webpack_require__(46);
|
34692 | var indexes = {};
|
34693 | var indexesFiles = {};
|
34694 | var queue = [];
|
34695 | var source$;
|
34696 | var gap = 100;
|
34697 | var count = 3;
|
34698 | var customProjectRootPatterns = constant_1.projectRootPatterns;
|
34699 | function initSource() {
|
34700 | if (source$) {
|
34701 | return;
|
34702 | }
|
34703 | source$ = new rxjs_1.Subject();
|
34704 | source$.pipe(operators_1.concatMap(function (uri) {
|
34705 | return rxjs_1.from(util_1.findProjectRoot(vscode_uri_1.URI.parse(uri).fsPath, customProjectRootPatterns)).pipe(operators_1.switchMap(function (projectRoot) {
|
34706 | return rxjs_1.from(util_1.getRealPath(projectRoot));
|
34707 | }), operators_1.filter(function (projectRoot) { return projectRoot && projectRoot !== os_1.default.homedir(); }), operators_1.map(function (projectRoot) { return ({
|
34708 | uri: uri,
|
34709 | projectRoot: projectRoot,
|
34710 | }); }));
|
34711 | }), operators_1.filter(function (_a) {
|
34712 | var projectRoot = _a.projectRoot;
|
34713 | if (!indexes[projectRoot]) {
|
34714 | indexes[projectRoot] = true;
|
34715 | return true;
|
34716 | }
|
34717 | return false;
|
34718 | }), operators_1.concatMap(function (_a) {
|
34719 | var projectRoot = _a.projectRoot;
|
34720 | var indexPath = path_1.join(projectRoot, "**/*.vim");
|
34721 | return rxjs_1.from(fast_glob_1.default([indexPath, "!**/node_modules/**"])).pipe(operators_1.catchError(function (error) {
|
34722 | process.send({
|
34723 | msglog: [
|
34724 | "Index Workspace Error: " + indexPath,
|
34725 | "Error => " + (error.stack || error.message || error),
|
34726 | ].join("\n"),
|
34727 | });
|
34728 | return rxjs_1.of(undefined);
|
34729 | }), operators_1.filter(function (list) { return list && list.length > 0; }), operators_1.concatMap(function (list) {
|
34730 | return rxjs_1.of.apply(void 0, list.sort(function (a, b) { return a.length - b.length; })).pipe(operators_1.filter(function (fpath) {
|
34731 | if (!indexesFiles[fpath]) {
|
34732 | indexesFiles[fpath] = true;
|
34733 | return true;
|
34734 | }
|
34735 | return false;
|
34736 | }), operators_1.mergeMap(function (fpath) {
|
34737 | return rxjs_1.timer(gap).pipe(operators_1.concatMap(function () {
|
34738 | var content = fs_1.readFileSync(fpath).toString();
|
34739 | return rxjs_1.from(util_1.handleParse(content)).pipe(operators_1.filter(function (res) { return res[0] !== null; }), operators_1.map(function (res) { return ({
|
34740 | node: res[0],
|
34741 | uri: vscode_uri_1.URI.file(fpath).toString(),
|
34742 | }); }), operators_1.catchError(function (error) {
|
34743 | process.send({
|
34744 | msglog: fpath + ":\n" + (error.stack || error.message || error),
|
34745 | });
|
34746 | return rxjs_1.of(undefined);
|
34747 | }));
|
34748 | }));
|
34749 | }, count));
|
34750 | }));
|
34751 | }), operators_1.filter(function (res) { return !!res; })).subscribe(function (res) {
|
34752 | process.send({
|
34753 | data: res,
|
34754 | });
|
34755 | }, function (error) {
|
34756 | process.send({
|
34757 | msglog: error.stack || error.message || error,
|
34758 | });
|
34759 | });
|
34760 | if (queue.length) {
|
34761 | queue.forEach(function (uri) {
|
34762 | source$.next(uri);
|
34763 | });
|
34764 | queue = [];
|
34765 | }
|
34766 | }
|
34767 | process.on("message", function (mess) {
|
34768 | var uri = mess.uri, config = mess.config;
|
34769 | if (uri) {
|
34770 | if (source$) {
|
34771 | source$.next(uri);
|
34772 | }
|
34773 | else {
|
34774 | queue.push(uri);
|
34775 | }
|
34776 | }
|
34777 | if (config) {
|
34778 | if (config.gap !== undefined) {
|
34779 | gap = config.gap;
|
34780 | }
|
34781 | if (config.count !== undefined) {
|
34782 | count = config.count;
|
34783 | }
|
34784 | if (config.projectRootPatterns !== undefined) {
|
34785 | customProjectRootPatterns = config.projectRootPatterns;
|
34786 | }
|
34787 | initSource();
|
34788 | }
|
34789 | });
|
34790 |
|
34791 |
|
34792 | })
|
34793 | ]))); |
\ | No newline at end of file |