emberjs-source 3.28.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2679 @@
1
+ (function() {
2
+ /*!
3
+ * @overview Ember - JavaScript Application Framework
4
+ * @copyright Copyright 2011-2021 Tilde Inc. and contributors
5
+ * Portions Copyright 2006-2011 Strobe Inc.
6
+ * Portions Copyright 2008-2011 Apple Inc. All rights reserved.
7
+ * @license Licensed under MIT license
8
+ * See https://raw.github.com/emberjs/ember.js/master/LICENSE
9
+ * @version 3.28.8
10
+ */
11
+ /* eslint-disable no-var */
12
+
13
+ /* globals global globalThis self */
14
+ var define, require;
15
+
16
+ (function () {
17
+ var globalObj = typeof globalThis !== 'undefined' ? globalThis : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : null;
18
+
19
+ if (globalObj === null) {
20
+ throw new Error('unable to locate global object');
21
+ }
22
+
23
+ if (typeof globalObj.define === 'function' && typeof globalObj.require === 'function') {
24
+ define = globalObj.define;
25
+ require = globalObj.require;
26
+ return;
27
+ }
28
+
29
+ var registry = Object.create(null);
30
+ var seen = Object.create(null);
31
+
32
+ function missingModule(name, referrerName) {
33
+ if (referrerName) {
34
+ throw new Error('Could not find module ' + name + ' required by: ' + referrerName);
35
+ } else {
36
+ throw new Error('Could not find module ' + name);
37
+ }
38
+ }
39
+
40
+ function internalRequire(_name, referrerName) {
41
+ var name = _name;
42
+ var mod = registry[name];
43
+
44
+ if (!mod) {
45
+ name = name + '/index';
46
+ mod = registry[name];
47
+ }
48
+
49
+ var exports = seen[name];
50
+
51
+ if (exports !== undefined) {
52
+ return exports;
53
+ }
54
+
55
+ exports = seen[name] = {};
56
+
57
+ if (!mod) {
58
+ missingModule(_name, referrerName);
59
+ }
60
+
61
+ var deps = mod.deps;
62
+ var callback = mod.callback;
63
+ var reified = new Array(deps.length);
64
+
65
+ for (var i = 0; i < deps.length; i++) {
66
+ if (deps[i] === 'exports') {
67
+ reified[i] = exports;
68
+ } else if (deps[i] === 'require') {
69
+ reified[i] = require;
70
+ } else {
71
+ reified[i] = require(deps[i], name);
72
+ }
73
+ }
74
+
75
+ callback.apply(this, reified);
76
+ return exports;
77
+ }
78
+
79
+ require = function (name) {
80
+ return internalRequire(name, null);
81
+ }; // eslint-disable-next-line no-unused-vars
82
+
83
+
84
+ define = function (name, deps, callback) {
85
+ registry[name] = {
86
+ deps: deps,
87
+ callback: callback
88
+ };
89
+ }; // setup `require` module
90
+
91
+
92
+ require['default'] = require;
93
+
94
+ require.has = function registryHas(moduleName) {
95
+ return Boolean(registry[moduleName]) || Boolean(registry[moduleName + '/index']);
96
+ };
97
+
98
+ require._eak_seen = require.entries = registry;
99
+ })();
100
+ define("@ember/debug/index", ["exports", "@ember/-internals/browser-environment", "@ember/error", "@ember/debug/lib/deprecate", "@ember/debug/lib/testing", "@ember/debug/lib/warn", "@ember/-internals/utils", "@ember/debug/lib/capture-render-tree"], function (_exports, _browserEnvironment, _error, _deprecate2, _testing, _warn2, _utils, _captureRenderTree) {
101
+ "use strict";
102
+
103
+ Object.defineProperty(_exports, "__esModule", {
104
+ value: true
105
+ });
106
+ Object.defineProperty(_exports, "registerDeprecationHandler", {
107
+ enumerable: true,
108
+ get: function () {
109
+ return _deprecate2.registerHandler;
110
+ }
111
+ });
112
+ Object.defineProperty(_exports, "isTesting", {
113
+ enumerable: true,
114
+ get: function () {
115
+ return _testing.isTesting;
116
+ }
117
+ });
118
+ Object.defineProperty(_exports, "setTesting", {
119
+ enumerable: true,
120
+ get: function () {
121
+ return _testing.setTesting;
122
+ }
123
+ });
124
+ Object.defineProperty(_exports, "registerWarnHandler", {
125
+ enumerable: true,
126
+ get: function () {
127
+ return _warn2.registerHandler;
128
+ }
129
+ });
130
+ Object.defineProperty(_exports, "inspect", {
131
+ enumerable: true,
132
+ get: function () {
133
+ return _utils.inspect;
134
+ }
135
+ });
136
+ Object.defineProperty(_exports, "captureRenderTree", {
137
+ enumerable: true,
138
+ get: function () {
139
+ return _captureRenderTree.default;
140
+ }
141
+ });
142
+ _exports._warnIfUsingStrippedFeatureFlags = _exports.getDebugFunction = _exports.setDebugFunction = _exports.deprecateFunc = _exports.runInDebug = _exports.debugFreeze = _exports.debugSeal = _exports.deprecate = _exports.debug = _exports.warn = _exports.info = _exports.assert = void 0;
143
+
144
+ // These are the default production build versions:
145
+ var noop = () => {};
146
+
147
+ var assert = noop;
148
+ _exports.assert = assert;
149
+ var info = noop;
150
+ _exports.info = info;
151
+ var warn = noop;
152
+ _exports.warn = warn;
153
+ var debug = noop;
154
+ _exports.debug = debug;
155
+ var deprecate = noop;
156
+ _exports.deprecate = deprecate;
157
+ var debugSeal = noop;
158
+ _exports.debugSeal = debugSeal;
159
+ var debugFreeze = noop;
160
+ _exports.debugFreeze = debugFreeze;
161
+ var runInDebug = noop;
162
+ _exports.runInDebug = runInDebug;
163
+ var setDebugFunction = noop;
164
+ _exports.setDebugFunction = setDebugFunction;
165
+ var getDebugFunction = noop;
166
+ _exports.getDebugFunction = getDebugFunction;
167
+
168
+ var deprecateFunc = function () {
169
+ return arguments[arguments.length - 1];
170
+ };
171
+
172
+ _exports.deprecateFunc = deprecateFunc;
173
+
174
+ if (true
175
+ /* DEBUG */
176
+ ) {
177
+ _exports.setDebugFunction = setDebugFunction = function (type, callback) {
178
+ switch (type) {
179
+ case 'assert':
180
+ return _exports.assert = assert = callback;
181
+
182
+ case 'info':
183
+ return _exports.info = info = callback;
184
+
185
+ case 'warn':
186
+ return _exports.warn = warn = callback;
187
+
188
+ case 'debug':
189
+ return _exports.debug = debug = callback;
190
+
191
+ case 'deprecate':
192
+ return _exports.deprecate = deprecate = callback;
193
+
194
+ case 'debugSeal':
195
+ return _exports.debugSeal = debugSeal = callback;
196
+
197
+ case 'debugFreeze':
198
+ return _exports.debugFreeze = debugFreeze = callback;
199
+
200
+ case 'runInDebug':
201
+ return _exports.runInDebug = runInDebug = callback;
202
+
203
+ case 'deprecateFunc':
204
+ return _exports.deprecateFunc = deprecateFunc = callback;
205
+ }
206
+ };
207
+
208
+ _exports.getDebugFunction = getDebugFunction = function (type) {
209
+ switch (type) {
210
+ case 'assert':
211
+ return assert;
212
+
213
+ case 'info':
214
+ return info;
215
+
216
+ case 'warn':
217
+ return warn;
218
+
219
+ case 'debug':
220
+ return debug;
221
+
222
+ case 'deprecate':
223
+ return deprecate;
224
+
225
+ case 'debugSeal':
226
+ return debugSeal;
227
+
228
+ case 'debugFreeze':
229
+ return debugFreeze;
230
+
231
+ case 'runInDebug':
232
+ return runInDebug;
233
+
234
+ case 'deprecateFunc':
235
+ return deprecateFunc;
236
+ }
237
+ };
238
+ }
239
+ /**
240
+ @module @ember/debug
241
+ */
242
+
243
+
244
+ if (true
245
+ /* DEBUG */
246
+ ) {
247
+ /**
248
+ Verify that a certain expectation is met, or throw a exception otherwise.
249
+ This is useful for communicating assumptions in the code to other human
250
+ readers as well as catching bugs that accidentally violates these
251
+ expectations.
252
+ Assertions are removed from production builds, so they can be freely added
253
+ for documentation and debugging purposes without worries of incuring any
254
+ performance penalty. However, because of that, they should not be used for
255
+ checks that could reasonably fail during normal usage. Furthermore, care
256
+ should be taken to avoid accidentally relying on side-effects produced from
257
+ evaluating the condition itself, since the code will not run in production.
258
+ ```javascript
259
+ import { assert } from '@ember/debug';
260
+ // Test for truthiness
261
+ assert('Must pass a string', typeof str === 'string');
262
+ // Fail unconditionally
263
+ assert('This code path should never be run');
264
+ ```
265
+ @method assert
266
+ @static
267
+ @for @ember/debug
268
+ @param {String} description Describes the expectation. This will become the
269
+ text of the Error thrown if the assertion fails.
270
+ @param {any} condition Must be truthy for the assertion to pass. If
271
+ falsy, an exception will be thrown.
272
+ @public
273
+ @since 1.0.0
274
+ */
275
+ setDebugFunction('assert', function assert(desc, test) {
276
+ if (!test) {
277
+ throw new _error.default(`Assertion Failed: ${desc}`);
278
+ }
279
+ });
280
+ /**
281
+ Display a debug notice.
282
+ Calls to this function are not invoked in production builds.
283
+ ```javascript
284
+ import { debug } from '@ember/debug';
285
+ debug('I\'m a debug notice!');
286
+ ```
287
+ @method debug
288
+ @for @ember/debug
289
+ @static
290
+ @param {String} message A debug message to display.
291
+ @public
292
+ */
293
+
294
+ setDebugFunction('debug', function debug(message) {
295
+ /* eslint-disable no-console */
296
+ if (console.debug) {
297
+ console.debug(`DEBUG: ${message}`);
298
+ } else {
299
+ console.log(`DEBUG: ${message}`);
300
+ }
301
+ /* eslint-ensable no-console */
302
+
303
+ });
304
+ /**
305
+ Display an info notice.
306
+ Calls to this function are removed from production builds, so they can be
307
+ freely added for documentation and debugging purposes without worries of
308
+ incuring any performance penalty.
309
+ @method info
310
+ @private
311
+ */
312
+
313
+ setDebugFunction('info', function info() {
314
+ console.info(...arguments);
315
+ /* eslint-disable-line no-console */
316
+ });
317
+ /**
318
+ @module @ember/debug
319
+ @public
320
+ */
321
+
322
+ /**
323
+ Alias an old, deprecated method with its new counterpart.
324
+ Display a deprecation warning with the provided message and a stack trace
325
+ (Chrome and Firefox only) when the assigned method is called.
326
+ Calls to this function are removed from production builds, so they can be
327
+ freely added for documentation and debugging purposes without worries of
328
+ incuring any performance penalty.
329
+ ```javascript
330
+ import { deprecateFunc } from '@ember/debug';
331
+ Ember.oldMethod = deprecateFunc('Please use the new, updated method', options, Ember.newMethod);
332
+ ```
333
+ @method deprecateFunc
334
+ @static
335
+ @for @ember/debug
336
+ @param {String} message A description of the deprecation.
337
+ @param {Object} [options] The options object for `deprecate`.
338
+ @param {Function} func The new function called to replace its deprecated counterpart.
339
+ @return {Function} A new function that wraps the original function with a deprecation warning
340
+ @private
341
+ */
342
+
343
+ setDebugFunction('deprecateFunc', function deprecateFunc(...args) {
344
+ if (args.length === 3) {
345
+ var [message, options, func] = args;
346
+ return function (...args) {
347
+ deprecate(message, false, options);
348
+ return func.apply(this, args);
349
+ };
350
+ } else {
351
+ var [_message, _func] = args;
352
+ return function () {
353
+ deprecate(_message);
354
+ return _func.apply(this, arguments);
355
+ };
356
+ }
357
+ });
358
+ /**
359
+ @module @ember/debug
360
+ @public
361
+ */
362
+
363
+ /**
364
+ Run a function meant for debugging.
365
+ Calls to this function are removed from production builds, so they can be
366
+ freely added for documentation and debugging purposes without worries of
367
+ incuring any performance penalty.
368
+ ```javascript
369
+ import Component from '@ember/component';
370
+ import { runInDebug } from '@ember/debug';
371
+ runInDebug(() => {
372
+ Component.reopen({
373
+ didInsertElement() {
374
+ console.log("I'm happy");
375
+ }
376
+ });
377
+ });
378
+ ```
379
+ @method runInDebug
380
+ @for @ember/debug
381
+ @static
382
+ @param {Function} func The function to be executed.
383
+ @since 1.5.0
384
+ @public
385
+ */
386
+
387
+ setDebugFunction('runInDebug', function runInDebug(func) {
388
+ func();
389
+ });
390
+ setDebugFunction('debugSeal', function debugSeal(obj) {
391
+ Object.seal(obj);
392
+ });
393
+ setDebugFunction('debugFreeze', function debugFreeze(obj) {
394
+ // re-freezing an already frozen object introduces a significant
395
+ // performance penalty on Chrome (tested through 59).
396
+ //
397
+ // See: https://bugs.chromium.org/p/v8/issues/detail?id=6450
398
+ if (!Object.isFrozen(obj)) {
399
+ Object.freeze(obj);
400
+ }
401
+ });
402
+ setDebugFunction('deprecate', _deprecate2.default);
403
+ setDebugFunction('warn', _warn2.default);
404
+ }
405
+
406
+ var _warnIfUsingStrippedFeatureFlags;
407
+
408
+ _exports._warnIfUsingStrippedFeatureFlags = _warnIfUsingStrippedFeatureFlags;
409
+
410
+ if (true
411
+ /* DEBUG */
412
+ && !(0, _testing.isTesting)()) {
413
+ if (typeof window !== 'undefined' && (_browserEnvironment.isFirefox || _browserEnvironment.isChrome) && window.addEventListener) {
414
+ window.addEventListener('load', () => {
415
+ if (document.documentElement && document.documentElement.dataset && !document.documentElement.dataset.emberExtension) {
416
+ var downloadURL;
417
+
418
+ if (_browserEnvironment.isChrome) {
419
+ downloadURL = 'https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi';
420
+ } else if (_browserEnvironment.isFirefox) {
421
+ downloadURL = 'https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/';
422
+ }
423
+
424
+ debug(`For more advanced debugging, install the Ember Inspector from ${downloadURL}`);
425
+ }
426
+ }, false);
427
+ }
428
+ }
429
+ });
430
+ define("@ember/debug/lib/capture-render-tree", ["exports", "@glimmer/util"], function (_exports, _util) {
431
+ "use strict";
432
+
433
+ Object.defineProperty(_exports, "__esModule", {
434
+ value: true
435
+ });
436
+ _exports.default = captureRenderTree;
437
+
438
+ /**
439
+ @module @ember/debug
440
+ */
441
+
442
+ /**
443
+ Ember Inspector calls this function to capture the current render tree.
444
+
445
+ In production mode, this requires turning on `ENV._DEBUG_RENDER_TREE`
446
+ before loading Ember.
447
+
448
+ @private
449
+ @static
450
+ @method captureRenderTree
451
+ @for @ember/debug
452
+ @param app {ApplicationInstance} An `ApplicationInstance`.
453
+ @since 3.14.0
454
+ */
455
+ function captureRenderTree(app) {
456
+ var renderer = (0, _util.expect)(app.lookup('renderer:-dom'), `BUG: owner is missing renderer`);
457
+ return renderer.debugRenderTree.capture();
458
+ }
459
+ });
460
+ define("@ember/debug/lib/deprecate", ["exports", "@ember/-internals/environment", "@ember/debug/index", "@ember/debug/lib/handlers"], function (_exports, _environment, _index, _handlers) {
461
+ "use strict";
462
+
463
+ Object.defineProperty(_exports, "__esModule", {
464
+ value: true
465
+ });
466
+ _exports.SINCE_MISSING_DEPRECATIONS = _exports.FOR_MISSING_DEPRECATIONS = _exports.missingOptionsSinceDeprecation = _exports.missingOptionsForDeprecation = _exports.missingOptionsUntilDeprecation = _exports.missingOptionsIdDeprecation = _exports.missingOptionsDeprecation = _exports.registerHandler = _exports.default = void 0;
467
+
468
+ /**
469
+ @module @ember/debug
470
+ @public
471
+ */
472
+
473
+ /**
474
+ Allows for runtime registration of handler functions that override the default deprecation behavior.
475
+ Deprecations are invoked by calls to [@ember/debug/deprecate](/ember/release/classes/@ember%2Fdebug/methods/deprecate?anchor=deprecate).
476
+ The following example demonstrates its usage by registering a handler that throws an error if the
477
+ message contains the word "should", otherwise defers to the default handler.
478
+
479
+ ```javascript
480
+ import { registerDeprecationHandler } from '@ember/debug';
481
+
482
+ registerDeprecationHandler((message, options, next) => {
483
+ if (message.indexOf('should') !== -1) {
484
+ throw new Error(`Deprecation message with should: ${message}`);
485
+ } else {
486
+ // defer to whatever handler was registered before this one
487
+ next(message, options);
488
+ }
489
+ });
490
+ ```
491
+
492
+ The handler function takes the following arguments:
493
+
494
+ <ul>
495
+ <li> <code>message</code> - The message received from the deprecation call.</li>
496
+ <li> <code>options</code> - An object passed in with the deprecation call containing additional information including:</li>
497
+ <ul>
498
+ <li> <code>id</code> - An id of the deprecation in the form of <code>package-name.specific-deprecation</code>.</li>
499
+ <li> <code>until</code> - The Ember version number the feature and deprecation will be removed in.</li>
500
+ </ul>
501
+ <li> <code>next</code> - A function that calls into the previously registered handler.</li>
502
+ </ul>
503
+
504
+ @public
505
+ @static
506
+ @method registerDeprecationHandler
507
+ @for @ember/debug
508
+ @param handler {Function} A function to handle deprecation calls.
509
+ @since 2.1.0
510
+ */
511
+ var registerHandler = () => {};
512
+
513
+ _exports.registerHandler = registerHandler;
514
+ var missingOptionsDeprecation;
515
+ _exports.missingOptionsDeprecation = missingOptionsDeprecation;
516
+ var missingOptionsIdDeprecation;
517
+ _exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation;
518
+ var missingOptionsUntilDeprecation;
519
+ _exports.missingOptionsUntilDeprecation = missingOptionsUntilDeprecation;
520
+
521
+ var missingOptionsForDeprecation = () => '';
522
+
523
+ _exports.missingOptionsForDeprecation = missingOptionsForDeprecation;
524
+
525
+ var missingOptionsSinceDeprecation = () => '';
526
+
527
+ _exports.missingOptionsSinceDeprecation = missingOptionsSinceDeprecation;
528
+
529
+ var deprecate = () => {};
530
+
531
+ var FOR_MISSING_DEPRECATIONS = new Set();
532
+ _exports.FOR_MISSING_DEPRECATIONS = FOR_MISSING_DEPRECATIONS;
533
+ var SINCE_MISSING_DEPRECATIONS = new Set();
534
+ _exports.SINCE_MISSING_DEPRECATIONS = SINCE_MISSING_DEPRECATIONS;
535
+
536
+ if (true
537
+ /* DEBUG */
538
+ ) {
539
+ _exports.registerHandler = registerHandler = function registerHandler(handler) {
540
+ (0, _handlers.registerHandler)('deprecate', handler);
541
+ };
542
+
543
+ var formatMessage = function formatMessage(_message, options) {
544
+ var message = _message;
545
+
546
+ if (options && options.id) {
547
+ message = message + ` [deprecation id: ${options.id}]`;
548
+ }
549
+
550
+ if (options && options.url) {
551
+ message += ` See ${options.url} for more details.`;
552
+ }
553
+
554
+ return message;
555
+ };
556
+
557
+ registerHandler(function logDeprecationToConsole(message, options) {
558
+ var updatedMessage = formatMessage(message, options);
559
+ console.warn(`DEPRECATION: ${updatedMessage}`); // eslint-disable-line no-console
560
+ });
561
+ var captureErrorForStack;
562
+
563
+ if (new Error().stack) {
564
+ captureErrorForStack = () => new Error();
565
+ } else {
566
+ captureErrorForStack = () => {
567
+ try {
568
+ __fail__.fail();
569
+ } catch (e) {
570
+ return e;
571
+ }
572
+ };
573
+ }
574
+
575
+ registerHandler(function logDeprecationStackTrace(message, options, next) {
576
+ if (_environment.ENV.LOG_STACKTRACE_ON_DEPRECATION) {
577
+ var stackStr = '';
578
+ var error = captureErrorForStack();
579
+ var stack;
580
+
581
+ if (error.stack) {
582
+ if (error['arguments']) {
583
+ // Chrome
584
+ stack = error.stack.replace(/^\s+at\s+/gm, '').replace(/^([^(]+?)([\n$])/gm, '{anonymous}($1)$2').replace(/^Object.<anonymous>\s*\(([^)]+)\)/gm, '{anonymous}($1)').split('\n');
585
+ stack.shift();
586
+ } else {
587
+ // Firefox
588
+ stack = error.stack.replace(/(?:\n@:0)?\s+$/m, '').replace(/^\(/gm, '{anonymous}(').split('\n');
589
+ }
590
+
591
+ stackStr = `\n ${stack.slice(2).join('\n ')}`;
592
+ }
593
+
594
+ var updatedMessage = formatMessage(message, options);
595
+ console.warn(`DEPRECATION: ${updatedMessage}${stackStr}`); // eslint-disable-line no-console
596
+ } else {
597
+ next(message, options);
598
+ }
599
+ });
600
+ registerHandler(function raiseOnDeprecation(message, options, next) {
601
+ if (_environment.ENV.RAISE_ON_DEPRECATION) {
602
+ var updatedMessage = formatMessage(message);
603
+ throw new Error(updatedMessage);
604
+ } else {
605
+ next(message, options);
606
+ }
607
+ });
608
+ _exports.missingOptionsDeprecation = missingOptionsDeprecation = 'When calling `deprecate` you ' + 'must provide an `options` hash as the third parameter. ' + '`options` should include `id` and `until` properties.';
609
+ _exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation = 'When calling `deprecate` you must provide `id` in options.';
610
+ _exports.missingOptionsUntilDeprecation = missingOptionsUntilDeprecation = 'When calling `deprecate` you must provide `until` in options.';
611
+
612
+ _exports.missingOptionsForDeprecation = missingOptionsForDeprecation = id => {
613
+ return `When calling \`deprecate\` you must provide \`for\` in options. Missing options.for in "${id}" deprecation`;
614
+ };
615
+
616
+ _exports.missingOptionsSinceDeprecation = missingOptionsSinceDeprecation = id => {
617
+ return `When calling \`deprecate\` you must provide \`since\` in options. Missing options.since in "${id}" deprecation`;
618
+ };
619
+ /**
620
+ @module @ember/debug
621
+ @public
622
+ */
623
+
624
+ /**
625
+ Display a deprecation warning with the provided message and a stack trace
626
+ (Chrome and Firefox only).
627
+ * In a production build, this method is defined as an empty function (NOP).
628
+ Uses of this method in Ember itself are stripped from the ember.prod.js build.
629
+ @method deprecate
630
+ @for @ember/debug
631
+ @param {String} message A description of the deprecation.
632
+ @param {Boolean} test A boolean. If falsy, the deprecation will be displayed.
633
+ @param {Object} options
634
+ @param {String} options.id A unique id for this deprecation. The id can be
635
+ used by Ember debugging tools to change the behavior (raise, log or silence)
636
+ for that specific deprecation. The id should be namespaced by dots, e.g.
637
+ "view.helper.select".
638
+ @param {string} options.until The version of Ember when this deprecation
639
+ warning will be removed.
640
+ @param {String} options.for A namespace for the deprecation, usually the package name
641
+ @param {Object} options.since Describes when the deprecation became available and enabled.
642
+ @param {String} [options.url] An optional url to the transition guide on the
643
+ emberjs.com website.
644
+ @static
645
+ @public
646
+ @since 1.0.0
647
+ */
648
+
649
+
650
+ deprecate = function deprecate(message, test, options) {
651
+ (0, _index.assert)(missingOptionsDeprecation, Boolean(options && (options.id || options.until)));
652
+ (0, _index.assert)(missingOptionsIdDeprecation, Boolean(options.id));
653
+ (0, _index.assert)(missingOptionsUntilDeprecation, Boolean(options.until));
654
+
655
+ if (!options.for && !FOR_MISSING_DEPRECATIONS.has(options.id)) {
656
+ FOR_MISSING_DEPRECATIONS.add(options.id);
657
+ deprecate(missingOptionsForDeprecation(options.id), Boolean(options.for), {
658
+ id: 'ember-source.deprecation-without-for',
659
+ until: '4.0.0',
660
+ for: 'ember-source',
661
+ since: {
662
+ enabled: '3.24.0'
663
+ }
664
+ });
665
+ }
666
+
667
+ if (!options.since && !SINCE_MISSING_DEPRECATIONS.has(options.id)) {
668
+ SINCE_MISSING_DEPRECATIONS.add(options.id);
669
+ deprecate(missingOptionsSinceDeprecation(options.id), Boolean(options.since), {
670
+ id: 'ember-source.deprecation-without-since',
671
+ until: '4.0.0',
672
+ for: 'ember-source',
673
+ since: {
674
+ enabled: '3.24.0'
675
+ }
676
+ });
677
+ }
678
+
679
+ (0, _handlers.invoke)('deprecate', message, test, options);
680
+ };
681
+ }
682
+
683
+ var _default = deprecate;
684
+ _exports.default = _default;
685
+ });
686
+ define("@ember/debug/lib/handlers", ["exports"], function (_exports) {
687
+ "use strict";
688
+
689
+ Object.defineProperty(_exports, "__esModule", {
690
+ value: true
691
+ });
692
+ _exports.invoke = _exports.registerHandler = _exports.HANDLERS = void 0;
693
+ var HANDLERS = {};
694
+ _exports.HANDLERS = HANDLERS;
695
+
696
+ var registerHandler = () => {};
697
+
698
+ _exports.registerHandler = registerHandler;
699
+
700
+ var invoke = () => {};
701
+
702
+ _exports.invoke = invoke;
703
+
704
+ if (true
705
+ /* DEBUG */
706
+ ) {
707
+ _exports.registerHandler = registerHandler = function registerHandler(type, callback) {
708
+ var nextHandler = HANDLERS[type] || (() => {});
709
+
710
+ HANDLERS[type] = (message, options) => {
711
+ callback(message, options, nextHandler);
712
+ };
713
+ };
714
+
715
+ _exports.invoke = invoke = function invoke(type, message, test, options) {
716
+ if (test) {
717
+ return;
718
+ }
719
+
720
+ var handlerForType = HANDLERS[type];
721
+
722
+ if (handlerForType) {
723
+ handlerForType(message, options);
724
+ }
725
+ };
726
+ }
727
+ });
728
+ define("@ember/debug/lib/testing", ["exports"], function (_exports) {
729
+ "use strict";
730
+
731
+ Object.defineProperty(_exports, "__esModule", {
732
+ value: true
733
+ });
734
+ _exports.isTesting = isTesting;
735
+ _exports.setTesting = setTesting;
736
+ var testing = false;
737
+
738
+ function isTesting() {
739
+ return testing;
740
+ }
741
+
742
+ function setTesting(value) {
743
+ testing = Boolean(value);
744
+ }
745
+ });
746
+ define("@ember/debug/lib/warn", ["exports", "@ember/debug/index", "@ember/debug/lib/handlers"], function (_exports, _index, _handlers) {
747
+ "use strict";
748
+
749
+ Object.defineProperty(_exports, "__esModule", {
750
+ value: true
751
+ });
752
+ _exports.missingOptionsDeprecation = _exports.missingOptionsIdDeprecation = _exports.registerHandler = _exports.default = void 0;
753
+
754
+ var registerHandler = () => {};
755
+
756
+ _exports.registerHandler = registerHandler;
757
+
758
+ var warn = () => {};
759
+
760
+ var missingOptionsDeprecation;
761
+ _exports.missingOptionsDeprecation = missingOptionsDeprecation;
762
+ var missingOptionsIdDeprecation;
763
+ /**
764
+ @module @ember/debug
765
+ */
766
+
767
+ _exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation;
768
+
769
+ if (true
770
+ /* DEBUG */
771
+ ) {
772
+ /**
773
+ Allows for runtime registration of handler functions that override the default warning behavior.
774
+ Warnings are invoked by calls made to [@ember/debug/warn](/ember/release/classes/@ember%2Fdebug/methods/warn?anchor=warn).
775
+ The following example demonstrates its usage by registering a handler that does nothing overriding Ember's
776
+ default warning behavior.
777
+ ```javascript
778
+ import { registerWarnHandler } from '@ember/debug';
779
+ // next is not called, so no warnings get the default behavior
780
+ registerWarnHandler(() => {});
781
+ ```
782
+ The handler function takes the following arguments:
783
+ <ul>
784
+ <li> <code>message</code> - The message received from the warn call. </li>
785
+ <li> <code>options</code> - An object passed in with the warn call containing additional information including:</li>
786
+ <ul>
787
+ <li> <code>id</code> - An id of the warning in the form of <code>package-name.specific-warning</code>.</li>
788
+ </ul>
789
+ <li> <code>next</code> - A function that calls into the previously registered handler.</li>
790
+ </ul>
791
+ @public
792
+ @static
793
+ @method registerWarnHandler
794
+ @for @ember/debug
795
+ @param handler {Function} A function to handle warnings.
796
+ @since 2.1.0
797
+ */
798
+ _exports.registerHandler = registerHandler = function registerHandler(handler) {
799
+ (0, _handlers.registerHandler)('warn', handler);
800
+ };
801
+
802
+ registerHandler(function logWarning(message) {
803
+ /* eslint-disable no-console */
804
+ console.warn(`WARNING: ${message}`);
805
+ /* eslint-enable no-console */
806
+ });
807
+ _exports.missingOptionsDeprecation = missingOptionsDeprecation = 'When calling `warn` you ' + 'must provide an `options` hash as the third parameter. ' + '`options` should include an `id` property.';
808
+ _exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation = 'When calling `warn` you must provide `id` in options.';
809
+ /**
810
+ Display a warning with the provided message.
811
+ * In a production build, this method is defined as an empty function (NOP).
812
+ Uses of this method in Ember itself are stripped from the ember.prod.js build.
813
+ ```javascript
814
+ import { warn } from '@ember/debug';
815
+ import tomsterCount from './tomster-counter'; // a module in my project
816
+ // Log a warning if we have more than 3 tomsters
817
+ warn('Too many tomsters!', tomsterCount <= 3, {
818
+ id: 'ember-debug.too-many-tomsters'
819
+ });
820
+ ```
821
+ @method warn
822
+ @for @ember/debug
823
+ @static
824
+ @param {String} message A warning to display.
825
+ @param {Boolean} test An optional boolean. If falsy, the warning
826
+ will be displayed.
827
+ @param {Object} options An object that can be used to pass a unique
828
+ `id` for this warning. The `id` can be used by Ember debugging tools
829
+ to change the behavior (raise, log, or silence) for that specific warning.
830
+ The `id` should be namespaced by dots, e.g. "ember-debug.feature-flag-with-features-stripped"
831
+ @public
832
+ @since 1.0.0
833
+ */
834
+
835
+ warn = function warn(message, test, options) {
836
+ if (arguments.length === 2 && typeof test === 'object') {
837
+ options = test;
838
+ test = false;
839
+ }
840
+
841
+ (0, _index.assert)(missingOptionsDeprecation, Boolean(options));
842
+ (0, _index.assert)(missingOptionsIdDeprecation, Boolean(options && options.id));
843
+ (0, _handlers.invoke)('warn', message, test, options);
844
+ };
845
+ }
846
+
847
+ var _default = warn;
848
+ _exports.default = _default;
849
+ });
850
+ define("ember-testing/index", ["exports", "ember-testing/lib/test", "ember-testing/lib/adapters/adapter", "ember-testing/lib/setup_for_testing", "ember-testing/lib/adapters/qunit", "ember-testing/lib/support", "ember-testing/lib/ext/application", "ember-testing/lib/ext/rsvp", "ember-testing/lib/helpers", "ember-testing/lib/initializers"], function (_exports, _test, _adapter, _setup_for_testing, _qunit, _support, _application, _rsvp, _helpers, _initializers) {
851
+ "use strict";
852
+
853
+ Object.defineProperty(_exports, "__esModule", {
854
+ value: true
855
+ });
856
+ Object.defineProperty(_exports, "Test", {
857
+ enumerable: true,
858
+ get: function () {
859
+ return _test.default;
860
+ }
861
+ });
862
+ Object.defineProperty(_exports, "Adapter", {
863
+ enumerable: true,
864
+ get: function () {
865
+ return _adapter.default;
866
+ }
867
+ });
868
+ Object.defineProperty(_exports, "setupForTesting", {
869
+ enumerable: true,
870
+ get: function () {
871
+ return _setup_for_testing.default;
872
+ }
873
+ });
874
+ Object.defineProperty(_exports, "QUnitAdapter", {
875
+ enumerable: true,
876
+ get: function () {
877
+ return _qunit.default;
878
+ }
879
+ });
880
+ });
881
+ define("ember-testing/lib/adapters/adapter", ["exports", "@ember/-internals/runtime"], function (_exports, _runtime) {
882
+ "use strict";
883
+
884
+ Object.defineProperty(_exports, "__esModule", {
885
+ value: true
886
+ });
887
+ _exports.default = void 0;
888
+
889
+ function K() {
890
+ return this;
891
+ }
892
+ /**
893
+ @module @ember/test
894
+ */
895
+
896
+ /**
897
+ The primary purpose of this class is to create hooks that can be implemented
898
+ by an adapter for various test frameworks.
899
+
900
+ @class TestAdapter
901
+ @public
902
+ */
903
+
904
+
905
+ var _default = _runtime.Object.extend({
906
+ /**
907
+ This callback will be called whenever an async operation is about to start.
908
+ Override this to call your framework's methods that handle async
909
+ operations.
910
+ @public
911
+ @method asyncStart
912
+ */
913
+ asyncStart: K,
914
+
915
+ /**
916
+ This callback will be called whenever an async operation has completed.
917
+ @public
918
+ @method asyncEnd
919
+ */
920
+ asyncEnd: K,
921
+
922
+ /**
923
+ Override this method with your testing framework's false assertion.
924
+ This function is called whenever an exception occurs causing the testing
925
+ promise to fail.
926
+ QUnit example:
927
+ ```javascript
928
+ exception: function(error) {
929
+ ok(false, error);
930
+ };
931
+ ```
932
+ @public
933
+ @method exception
934
+ @param {String} error The exception to be raised.
935
+ */
936
+ exception(error) {
937
+ throw error;
938
+ }
939
+
940
+ });
941
+
942
+ _exports.default = _default;
943
+ });
944
+ define("ember-testing/lib/adapters/qunit", ["exports", "@ember/-internals/utils", "ember-testing/lib/adapters/adapter"], function (_exports, _utils, _adapter) {
945
+ "use strict";
946
+
947
+ Object.defineProperty(_exports, "__esModule", {
948
+ value: true
949
+ });
950
+ _exports.default = void 0;
951
+
952
+ /* globals QUnit */
953
+
954
+ /**
955
+ @module ember
956
+ */
957
+
958
+ /**
959
+ This class implements the methods defined by TestAdapter for the
960
+ QUnit testing framework.
961
+
962
+ @class QUnitAdapter
963
+ @namespace Ember.Test
964
+ @extends TestAdapter
965
+ @public
966
+ */
967
+ var _default = _adapter.default.extend({
968
+ init() {
969
+ this.doneCallbacks = [];
970
+ },
971
+
972
+ asyncStart() {
973
+ if (typeof QUnit.stop === 'function') {
974
+ // very old QUnit version
975
+ QUnit.stop();
976
+ } else {
977
+ this.doneCallbacks.push(QUnit.config.current ? QUnit.config.current.assert.async() : null);
978
+ }
979
+ },
980
+
981
+ asyncEnd() {
982
+ // checking for QUnit.stop here (even though we _need_ QUnit.start) because
983
+ // QUnit.start() still exists in QUnit 2.x (it just throws an error when calling
984
+ // inside a test context)
985
+ if (typeof QUnit.stop === 'function') {
986
+ QUnit.start();
987
+ } else {
988
+ var done = this.doneCallbacks.pop(); // This can be null if asyncStart() was called outside of a test
989
+
990
+ if (done) {
991
+ done();
992
+ }
993
+ }
994
+ },
995
+
996
+ exception(error) {
997
+ QUnit.config.current.assert.ok(false, (0, _utils.inspect)(error));
998
+ }
999
+
1000
+ });
1001
+
1002
+ _exports.default = _default;
1003
+ });
1004
+ define("ember-testing/lib/events", ["exports", "@ember/runloop", "@ember/polyfills", "ember-testing/lib/helpers/-is-form-control"], function (_exports, _runloop, _polyfills, _isFormControl) {
1005
+ "use strict";
1006
+
1007
+ Object.defineProperty(_exports, "__esModule", {
1008
+ value: true
1009
+ });
1010
+ _exports.focus = focus;
1011
+ _exports.fireEvent = fireEvent;
1012
+ var DEFAULT_EVENT_OPTIONS = {
1013
+ canBubble: true,
1014
+ cancelable: true
1015
+ };
1016
+ var KEYBOARD_EVENT_TYPES = ['keydown', 'keypress', 'keyup'];
1017
+ var MOUSE_EVENT_TYPES = ['click', 'mousedown', 'mouseup', 'dblclick', 'mouseenter', 'mouseleave', 'mousemove', 'mouseout', 'mouseover'];
1018
+
1019
+ function focus(el) {
1020
+ if (!el) {
1021
+ return;
1022
+ }
1023
+
1024
+ if (el.isContentEditable || (0, _isFormControl.default)(el)) {
1025
+ var type = el.getAttribute('type');
1026
+
1027
+ if (type !== 'checkbox' && type !== 'radio' && type !== 'hidden') {
1028
+ (0, _runloop.run)(null, function () {
1029
+ var browserIsNotFocused = document.hasFocus && !document.hasFocus(); // makes `document.activeElement` be `element`. If the browser is focused, it also fires a focus event
1030
+
1031
+ el.focus(); // Firefox does not trigger the `focusin` event if the window
1032
+ // does not have focus. If the document does not have focus then
1033
+ // fire `focusin` event as well.
1034
+
1035
+ if (browserIsNotFocused) {
1036
+ // if the browser is not focused the previous `el.focus()` didn't fire an event, so we simulate it
1037
+ fireEvent(el, 'focus', {
1038
+ bubbles: false
1039
+ });
1040
+ fireEvent(el, 'focusin');
1041
+ }
1042
+ });
1043
+ }
1044
+ }
1045
+ }
1046
+
1047
+ function fireEvent(element, type, options = {}) {
1048
+ if (!element) {
1049
+ return;
1050
+ }
1051
+
1052
+ var event;
1053
+
1054
+ if (KEYBOARD_EVENT_TYPES.indexOf(type) > -1) {
1055
+ event = buildKeyboardEvent(type, options);
1056
+ } else if (MOUSE_EVENT_TYPES.indexOf(type) > -1) {
1057
+ var rect = element.getBoundingClientRect();
1058
+ var x = rect.left + 1;
1059
+ var y = rect.top + 1;
1060
+ var simulatedCoordinates = {
1061
+ screenX: x + 5,
1062
+ screenY: y + 95,
1063
+ clientX: x,
1064
+ clientY: y
1065
+ };
1066
+ event = buildMouseEvent(type, (0, _polyfills.assign)(simulatedCoordinates, options));
1067
+ } else {
1068
+ event = buildBasicEvent(type, options);
1069
+ }
1070
+
1071
+ element.dispatchEvent(event);
1072
+ }
1073
+
1074
+ function buildBasicEvent(type, options = {}) {
1075
+ var event = document.createEvent('Events'); // Event.bubbles is read only
1076
+
1077
+ var bubbles = options.bubbles !== undefined ? options.bubbles : true;
1078
+ var cancelable = options.cancelable !== undefined ? options.cancelable : true;
1079
+ delete options.bubbles;
1080
+ delete options.cancelable;
1081
+ event.initEvent(type, bubbles, cancelable);
1082
+ (0, _polyfills.assign)(event, options);
1083
+ return event;
1084
+ }
1085
+
1086
+ function buildMouseEvent(type, options = {}) {
1087
+ var event;
1088
+
1089
+ try {
1090
+ event = document.createEvent('MouseEvents');
1091
+ var eventOpts = (0, _polyfills.assign)({}, DEFAULT_EVENT_OPTIONS, options);
1092
+ event.initMouseEvent(type, eventOpts.canBubble, eventOpts.cancelable, window, eventOpts.detail, eventOpts.screenX, eventOpts.screenY, eventOpts.clientX, eventOpts.clientY, eventOpts.ctrlKey, eventOpts.altKey, eventOpts.shiftKey, eventOpts.metaKey, eventOpts.button, eventOpts.relatedTarget);
1093
+ } catch (e) {
1094
+ event = buildBasicEvent(type, options);
1095
+ }
1096
+
1097
+ return event;
1098
+ }
1099
+
1100
+ function buildKeyboardEvent(type, options = {}) {
1101
+ var event;
1102
+
1103
+ try {
1104
+ event = document.createEvent('KeyEvents');
1105
+ var eventOpts = (0, _polyfills.assign)({}, DEFAULT_EVENT_OPTIONS, options);
1106
+ event.initKeyEvent(type, eventOpts.canBubble, eventOpts.cancelable, window, eventOpts.ctrlKey, eventOpts.altKey, eventOpts.shiftKey, eventOpts.metaKey, eventOpts.keyCode, eventOpts.charCode);
1107
+ } catch (e) {
1108
+ event = buildBasicEvent(type, options);
1109
+ }
1110
+
1111
+ return event;
1112
+ }
1113
+ });
1114
+ define("ember-testing/lib/ext/application", ["@ember/application", "ember-testing/lib/setup_for_testing", "ember-testing/lib/test/helpers", "ember-testing/lib/test/promise", "ember-testing/lib/test/run", "ember-testing/lib/test/on_inject_helpers", "ember-testing/lib/test/adapter"], function (_application, _setup_for_testing, _helpers, _promise, _run, _on_inject_helpers, _adapter) {
1115
+ "use strict";
1116
+
1117
+ _application.default.reopen({
1118
+ /**
1119
+ This property contains the testing helpers for the current application. These
1120
+ are created once you call `injectTestHelpers` on your `Application`
1121
+ instance. The included helpers are also available on the `window` object by
1122
+ default, but can be used from this object on the individual application also.
1123
+ @property testHelpers
1124
+ @type {Object}
1125
+ @default {}
1126
+ @public
1127
+ */
1128
+ testHelpers: {},
1129
+
1130
+ /**
1131
+ This property will contain the original methods that were registered
1132
+ on the `helperContainer` before `injectTestHelpers` is called.
1133
+ When `removeTestHelpers` is called, these methods are restored to the
1134
+ `helperContainer`.
1135
+ @property originalMethods
1136
+ @type {Object}
1137
+ @default {}
1138
+ @private
1139
+ @since 1.3.0
1140
+ */
1141
+ originalMethods: {},
1142
+
1143
+ /**
1144
+ This property indicates whether or not this application is currently in
1145
+ testing mode. This is set when `setupForTesting` is called on the current
1146
+ application.
1147
+ @property testing
1148
+ @type {Boolean}
1149
+ @default false
1150
+ @since 1.3.0
1151
+ @public
1152
+ */
1153
+ testing: false,
1154
+
1155
+ /**
1156
+ This hook defers the readiness of the application, so that you can start
1157
+ the app when your tests are ready to run. It also sets the router's
1158
+ location to 'none', so that the window's location will not be modified
1159
+ (preventing both accidental leaking of state between tests and interference
1160
+ with your testing framework). `setupForTesting` should only be called after
1161
+ setting a custom `router` class (for example `App.Router = Router.extend(`).
1162
+ Example:
1163
+ ```
1164
+ App.setupForTesting();
1165
+ ```
1166
+ @method setupForTesting
1167
+ @public
1168
+ */
1169
+ setupForTesting() {
1170
+ (0, _setup_for_testing.default)();
1171
+ this.testing = true;
1172
+ this.resolveRegistration('router:main').reopen({
1173
+ location: 'none'
1174
+ });
1175
+ },
1176
+
1177
+ /**
1178
+ This will be used as the container to inject the test helpers into. By
1179
+ default the helpers are injected into `window`.
1180
+ @property helperContainer
1181
+ @type {Object} The object to be used for test helpers.
1182
+ @default window
1183
+ @since 1.2.0
1184
+ @private
1185
+ */
1186
+ helperContainer: null,
1187
+
1188
+ /**
1189
+ This injects the test helpers into the `helperContainer` object. If an object is provided
1190
+ it will be used as the helperContainer. If `helperContainer` is not set it will default
1191
+ to `window`. If a function of the same name has already been defined it will be cached
1192
+ (so that it can be reset if the helper is removed with `unregisterHelper` or
1193
+ `removeTestHelpers`).
1194
+ Any callbacks registered with `onInjectHelpers` will be called once the
1195
+ helpers have been injected.
1196
+ Example:
1197
+ ```
1198
+ App.injectTestHelpers();
1199
+ ```
1200
+ @method injectTestHelpers
1201
+ @public
1202
+ */
1203
+ injectTestHelpers(helperContainer) {
1204
+ if (helperContainer) {
1205
+ this.helperContainer = helperContainer;
1206
+ } else {
1207
+ this.helperContainer = window;
1208
+ }
1209
+
1210
+ this.reopen({
1211
+ willDestroy() {
1212
+ this._super(...arguments);
1213
+
1214
+ this.removeTestHelpers();
1215
+ }
1216
+
1217
+ });
1218
+ this.testHelpers = {};
1219
+
1220
+ for (var name in _helpers.helpers) {
1221
+ this.originalMethods[name] = this.helperContainer[name];
1222
+ this.testHelpers[name] = this.helperContainer[name] = helper(this, name);
1223
+ protoWrap(_promise.default.prototype, name, helper(this, name), _helpers.helpers[name].meta.wait);
1224
+ }
1225
+
1226
+ (0, _on_inject_helpers.invokeInjectHelpersCallbacks)(this);
1227
+ },
1228
+
1229
+ /**
1230
+ This removes all helpers that have been registered, and resets and functions
1231
+ that were overridden by the helpers.
1232
+ Example:
1233
+ ```javascript
1234
+ App.removeTestHelpers();
1235
+ ```
1236
+ @public
1237
+ @method removeTestHelpers
1238
+ */
1239
+ removeTestHelpers() {
1240
+ if (!this.helperContainer) {
1241
+ return;
1242
+ }
1243
+
1244
+ for (var name in _helpers.helpers) {
1245
+ this.helperContainer[name] = this.originalMethods[name];
1246
+ delete _promise.default.prototype[name];
1247
+ delete this.testHelpers[name];
1248
+ delete this.originalMethods[name];
1249
+ }
1250
+ }
1251
+
1252
+ }); // This method is no longer needed
1253
+ // But still here for backwards compatibility
1254
+ // of helper chaining
1255
+
1256
+
1257
+ function protoWrap(proto, name, callback, isAsync) {
1258
+ proto[name] = function (...args) {
1259
+ if (isAsync) {
1260
+ return callback.apply(this, args);
1261
+ } else {
1262
+ return this.then(function () {
1263
+ return callback.apply(this, args);
1264
+ });
1265
+ }
1266
+ };
1267
+ }
1268
+
1269
+ function helper(app, name) {
1270
+ var fn = _helpers.helpers[name].method;
1271
+ var meta = _helpers.helpers[name].meta;
1272
+
1273
+ if (!meta.wait) {
1274
+ return (...args) => fn.apply(app, [app, ...args]);
1275
+ }
1276
+
1277
+ return (...args) => {
1278
+ var lastPromise = (0, _run.default)(() => (0, _promise.resolve)((0, _promise.getLastPromise)())); // wait for last helper's promise to resolve and then
1279
+ // execute. To be safe, we need to tell the adapter we're going
1280
+ // asynchronous here, because fn may not be invoked before we
1281
+ // return.
1282
+
1283
+ (0, _adapter.asyncStart)();
1284
+ return lastPromise.then(() => fn.apply(app, [app, ...args])).finally(_adapter.asyncEnd);
1285
+ };
1286
+ }
1287
+ });
1288
+ define("ember-testing/lib/ext/rsvp", ["exports", "@ember/-internals/runtime", "@ember/runloop", "@ember/debug", "ember-testing/lib/test/adapter"], function (_exports, _runtime, _runloop, _debug, _adapter) {
1289
+ "use strict";
1290
+
1291
+ Object.defineProperty(_exports, "__esModule", {
1292
+ value: true
1293
+ });
1294
+ _exports.default = void 0;
1295
+
1296
+ _runtime.RSVP.configure('async', function (callback, promise) {
1297
+ // if schedule will cause autorun, we need to inform adapter
1298
+ if ((0, _debug.isTesting)() && !_runloop._backburner.currentInstance) {
1299
+ (0, _adapter.asyncStart)();
1300
+
1301
+ _runloop._backburner.schedule('actions', () => {
1302
+ (0, _adapter.asyncEnd)();
1303
+ callback(promise);
1304
+ });
1305
+ } else {
1306
+ _runloop._backburner.schedule('actions', () => callback(promise));
1307
+ }
1308
+ });
1309
+
1310
+ var _default = _runtime.RSVP;
1311
+ _exports.default = _default;
1312
+ });
1313
+ define("ember-testing/lib/helpers", ["ember-testing/lib/test/helpers", "ember-testing/lib/helpers/and_then", "ember-testing/lib/helpers/click", "ember-testing/lib/helpers/current_path", "ember-testing/lib/helpers/current_route_name", "ember-testing/lib/helpers/current_url", "ember-testing/lib/helpers/fill_in", "ember-testing/lib/helpers/find", "ember-testing/lib/helpers/find_with_assert", "ember-testing/lib/helpers/key_event", "ember-testing/lib/helpers/pause_test", "ember-testing/lib/helpers/trigger_event", "ember-testing/lib/helpers/visit", "ember-testing/lib/helpers/wait"], function (_helpers, _and_then, _click, _current_path, _current_route_name, _current_url, _fill_in, _find, _find_with_assert, _key_event, _pause_test, _trigger_event, _visit, _wait) {
1314
+ "use strict";
1315
+
1316
+ (0, _helpers.registerAsyncHelper)('visit', _visit.default);
1317
+ (0, _helpers.registerAsyncHelper)('click', _click.default);
1318
+ (0, _helpers.registerAsyncHelper)('keyEvent', _key_event.default);
1319
+ (0, _helpers.registerAsyncHelper)('fillIn', _fill_in.default);
1320
+ (0, _helpers.registerAsyncHelper)('wait', _wait.default);
1321
+ (0, _helpers.registerAsyncHelper)('andThen', _and_then.default);
1322
+ (0, _helpers.registerAsyncHelper)('pauseTest', _pause_test.pauseTest);
1323
+ (0, _helpers.registerAsyncHelper)('triggerEvent', _trigger_event.default);
1324
+ (0, _helpers.registerHelper)('find', _find.default);
1325
+ (0, _helpers.registerHelper)('findWithAssert', _find_with_assert.default);
1326
+ (0, _helpers.registerHelper)('currentRouteName', _current_route_name.default);
1327
+ (0, _helpers.registerHelper)('currentPath', _current_path.default);
1328
+ (0, _helpers.registerHelper)('currentURL', _current_url.default);
1329
+ (0, _helpers.registerHelper)('resumeTest', _pause_test.resumeTest);
1330
+ });
1331
+ define("ember-testing/lib/helpers/-is-form-control", ["exports"], function (_exports) {
1332
+ "use strict";
1333
+
1334
+ Object.defineProperty(_exports, "__esModule", {
1335
+ value: true
1336
+ });
1337
+ _exports.default = isFormControl;
1338
+ var FORM_CONTROL_TAGS = ['INPUT', 'BUTTON', 'SELECT', 'TEXTAREA'];
1339
+ /**
1340
+ @private
1341
+ @param {Element} element the element to check
1342
+ @returns {boolean} `true` when the element is a form control, `false` otherwise
1343
+ */
1344
+
1345
+ function isFormControl(element) {
1346
+ var {
1347
+ tagName,
1348
+ type
1349
+ } = element;
1350
+
1351
+ if (type === 'hidden') {
1352
+ return false;
1353
+ }
1354
+
1355
+ return FORM_CONTROL_TAGS.indexOf(tagName) > -1;
1356
+ }
1357
+ });
1358
+ define("ember-testing/lib/helpers/and_then", ["exports"], function (_exports) {
1359
+ "use strict";
1360
+
1361
+ Object.defineProperty(_exports, "__esModule", {
1362
+ value: true
1363
+ });
1364
+ _exports.default = andThen;
1365
+
1366
+ function andThen(app, callback) {
1367
+ return app.testHelpers.wait(callback(app));
1368
+ }
1369
+ });
1370
+ define("ember-testing/lib/helpers/click", ["exports", "ember-testing/lib/events"], function (_exports, _events) {
1371
+ "use strict";
1372
+
1373
+ Object.defineProperty(_exports, "__esModule", {
1374
+ value: true
1375
+ });
1376
+ _exports.default = click;
1377
+
1378
+ /**
1379
+ @module ember
1380
+ */
1381
+
1382
+ /**
1383
+ Clicks an element and triggers any actions triggered by the element's `click`
1384
+ event.
1385
+
1386
+ Example:
1387
+
1388
+ ```javascript
1389
+ click('.some-jQuery-selector').then(function() {
1390
+ // assert something
1391
+ });
1392
+ ```
1393
+
1394
+ @method click
1395
+ @param {String} selector jQuery selector for finding element on the DOM
1396
+ @param {Object} context A DOM Element, Document, or jQuery to use as context
1397
+ @return {RSVP.Promise<undefined>}
1398
+ @public
1399
+ */
1400
+ function click(app, selector, context) {
1401
+ var $el = app.testHelpers.findWithAssert(selector, context);
1402
+ var el = $el[0];
1403
+ (0, _events.fireEvent)(el, 'mousedown');
1404
+ (0, _events.focus)(el);
1405
+ (0, _events.fireEvent)(el, 'mouseup');
1406
+ (0, _events.fireEvent)(el, 'click');
1407
+ return app.testHelpers.wait();
1408
+ }
1409
+ });
1410
+ define("ember-testing/lib/helpers/current_path", ["exports", "@ember/-internals/metal"], function (_exports, _metal) {
1411
+ "use strict";
1412
+
1413
+ Object.defineProperty(_exports, "__esModule", {
1414
+ value: true
1415
+ });
1416
+ _exports.default = currentPath;
1417
+
1418
+ /**
1419
+ @module ember
1420
+ */
1421
+
1422
+ /**
1423
+ Returns the current path.
1424
+
1425
+ Example:
1426
+
1427
+ ```javascript
1428
+ function validateURL() {
1429
+ equal(currentPath(), 'some.path.index', "correct path was transitioned into.");
1430
+ }
1431
+
1432
+ click('#some-link-id').then(validateURL);
1433
+ ```
1434
+
1435
+ @method currentPath
1436
+ @return {Object} The currently active path.
1437
+ @since 1.5.0
1438
+ @public
1439
+ */
1440
+ function currentPath(app) {
1441
+ var routingService = app.__container__.lookup('service:-routing');
1442
+
1443
+ return (0, _metal.get)(routingService, 'currentPath');
1444
+ }
1445
+ });
1446
+ define("ember-testing/lib/helpers/current_route_name", ["exports", "@ember/-internals/metal"], function (_exports, _metal) {
1447
+ "use strict";
1448
+
1449
+ Object.defineProperty(_exports, "__esModule", {
1450
+ value: true
1451
+ });
1452
+ _exports.default = currentRouteName;
1453
+
1454
+ /**
1455
+ @module ember
1456
+ */
1457
+
1458
+ /**
1459
+ Returns the currently active route name.
1460
+
1461
+ Example:
1462
+
1463
+ ```javascript
1464
+ function validateRouteName() {
1465
+ equal(currentRouteName(), 'some.path', "correct route was transitioned into.");
1466
+ }
1467
+ visit('/some/path').then(validateRouteName)
1468
+ ```
1469
+
1470
+ @method currentRouteName
1471
+ @return {Object} The name of the currently active route.
1472
+ @since 1.5.0
1473
+ @public
1474
+ */
1475
+ function currentRouteName(app) {
1476
+ var routingService = app.__container__.lookup('service:-routing');
1477
+
1478
+ return (0, _metal.get)(routingService, 'currentRouteName');
1479
+ }
1480
+ });
1481
+ define("ember-testing/lib/helpers/current_url", ["exports", "@ember/-internals/metal"], function (_exports, _metal) {
1482
+ "use strict";
1483
+
1484
+ Object.defineProperty(_exports, "__esModule", {
1485
+ value: true
1486
+ });
1487
+ _exports.default = currentURL;
1488
+
1489
+ /**
1490
+ @module ember
1491
+ */
1492
+
1493
+ /**
1494
+ Returns the current URL.
1495
+
1496
+ Example:
1497
+
1498
+ ```javascript
1499
+ function validateURL() {
1500
+ equal(currentURL(), '/some/path', "correct URL was transitioned into.");
1501
+ }
1502
+
1503
+ click('#some-link-id').then(validateURL);
1504
+ ```
1505
+
1506
+ @method currentURL
1507
+ @return {Object} The currently active URL.
1508
+ @since 1.5.0
1509
+ @public
1510
+ */
1511
+ function currentURL(app) {
1512
+ var router = app.__container__.lookup('router:main');
1513
+
1514
+ return (0, _metal.get)(router, 'location').getURL();
1515
+ }
1516
+ });
1517
+ define("ember-testing/lib/helpers/fill_in", ["exports", "ember-testing/lib/events", "ember-testing/lib/helpers/-is-form-control"], function (_exports, _events, _isFormControl) {
1518
+ "use strict";
1519
+
1520
+ Object.defineProperty(_exports, "__esModule", {
1521
+ value: true
1522
+ });
1523
+ _exports.default = fillIn;
1524
+
1525
+ /**
1526
+ @module ember
1527
+ */
1528
+
1529
+ /**
1530
+ Fills in an input element with some text.
1531
+
1532
+ Example:
1533
+
1534
+ ```javascript
1535
+ fillIn('#email', 'you@example.com').then(function() {
1536
+ // assert something
1537
+ });
1538
+ ```
1539
+
1540
+ @method fillIn
1541
+ @param {String} selector jQuery selector finding an input element on the DOM
1542
+ to fill text with
1543
+ @param {String} text text to place inside the input element
1544
+ @return {RSVP.Promise<undefined>}
1545
+ @public
1546
+ */
1547
+ function fillIn(app, selector, contextOrText, text) {
1548
+ var $el, el, context;
1549
+
1550
+ if (text === undefined) {
1551
+ text = contextOrText;
1552
+ } else {
1553
+ context = contextOrText;
1554
+ }
1555
+
1556
+ $el = app.testHelpers.findWithAssert(selector, context);
1557
+ el = $el[0];
1558
+ (0, _events.focus)(el);
1559
+
1560
+ if ((0, _isFormControl.default)(el)) {
1561
+ el.value = text;
1562
+ } else {
1563
+ el.innerHTML = text;
1564
+ }
1565
+
1566
+ (0, _events.fireEvent)(el, 'input');
1567
+ (0, _events.fireEvent)(el, 'change');
1568
+ return app.testHelpers.wait();
1569
+ }
1570
+ });
1571
+ define("ember-testing/lib/helpers/find", ["exports", "@ember/-internals/metal", "@ember/debug", "@ember/-internals/views"], function (_exports, _metal, _debug, _views) {
1572
+ "use strict";
1573
+
1574
+ Object.defineProperty(_exports, "__esModule", {
1575
+ value: true
1576
+ });
1577
+ _exports.default = find;
1578
+
1579
+ /**
1580
+ @module ember
1581
+ */
1582
+
1583
+ /**
1584
+ Finds an element in the context of the app's container element. A simple alias
1585
+ for `app.$(selector)`.
1586
+
1587
+ Example:
1588
+
1589
+ ```javascript
1590
+ var $el = find('.my-selector');
1591
+ ```
1592
+
1593
+ With the `context` param:
1594
+
1595
+ ```javascript
1596
+ var $el = find('.my-selector', '.parent-element-class');
1597
+ ```
1598
+
1599
+ @method find
1600
+ @param {String} selector jQuery selector for element lookup
1601
+ @param {String} [context] (optional) jQuery selector that will limit the selector
1602
+ argument to find only within the context's children
1603
+ @return {Object} DOM element representing the results of the query
1604
+ @public
1605
+ */
1606
+ function find(app, selector, context) {
1607
+ if (_views.jQueryDisabled) {
1608
+ (true && !(false) && (0, _debug.assert)('If jQuery is disabled, please import and use helpers from @ember/test-helpers [https://github.com/emberjs/ember-test-helpers]. Note: `find` is not an available helper.'));
1609
+ }
1610
+
1611
+ var $el;
1612
+ context = context || (0, _metal.get)(app, 'rootElement');
1613
+ $el = app.$(selector, context);
1614
+ return $el;
1615
+ }
1616
+ });
1617
+ define("ember-testing/lib/helpers/find_with_assert", ["exports"], function (_exports) {
1618
+ "use strict";
1619
+
1620
+ Object.defineProperty(_exports, "__esModule", {
1621
+ value: true
1622
+ });
1623
+ _exports.default = findWithAssert;
1624
+
1625
+ /**
1626
+ @module ember
1627
+ */
1628
+
1629
+ /**
1630
+ Like `find`, but throws an error if the element selector returns no results.
1631
+
1632
+ Example:
1633
+
1634
+ ```javascript
1635
+ var $el = findWithAssert('.doesnt-exist'); // throws error
1636
+ ```
1637
+
1638
+ With the `context` param:
1639
+
1640
+ ```javascript
1641
+ var $el = findWithAssert('.selector-id', '.parent-element-class'); // assert will pass
1642
+ ```
1643
+
1644
+ @method findWithAssert
1645
+ @param {String} selector jQuery selector string for finding an element within
1646
+ the DOM
1647
+ @param {String} [context] (optional) jQuery selector that will limit the
1648
+ selector argument to find only within the context's children
1649
+ @return {Object} jQuery object representing the results of the query
1650
+ @throws {Error} throws error if object returned has a length of 0
1651
+ @public
1652
+ */
1653
+ function findWithAssert(app, selector, context) {
1654
+ var $el = app.testHelpers.find(selector, context);
1655
+
1656
+ if ($el.length === 0) {
1657
+ throw new Error('Element ' + selector + ' not found.');
1658
+ }
1659
+
1660
+ return $el;
1661
+ }
1662
+ });
1663
+ define("ember-testing/lib/helpers/key_event", ["exports"], function (_exports) {
1664
+ "use strict";
1665
+
1666
+ Object.defineProperty(_exports, "__esModule", {
1667
+ value: true
1668
+ });
1669
+ _exports.default = keyEvent;
1670
+
1671
+ /**
1672
+ @module ember
1673
+ */
1674
+
1675
+ /**
1676
+ Simulates a key event, e.g. `keypress`, `keydown`, `keyup` with the desired keyCode
1677
+ Example:
1678
+ ```javascript
1679
+ keyEvent('.some-jQuery-selector', 'keypress', 13).then(function() {
1680
+ // assert something
1681
+ });
1682
+ ```
1683
+ @method keyEvent
1684
+ @param {String} selector jQuery selector for finding element on the DOM
1685
+ @param {String} type the type of key event, e.g. `keypress`, `keydown`, `keyup`
1686
+ @param {Number} keyCode the keyCode of the simulated key event
1687
+ @return {RSVP.Promise<undefined>}
1688
+ @since 1.5.0
1689
+ @public
1690
+ */
1691
+ function keyEvent(app, selector, contextOrType, typeOrKeyCode, keyCode) {
1692
+ var context, type;
1693
+
1694
+ if (keyCode === undefined) {
1695
+ context = null;
1696
+ keyCode = typeOrKeyCode;
1697
+ type = contextOrType;
1698
+ } else {
1699
+ context = contextOrType;
1700
+ type = typeOrKeyCode;
1701
+ }
1702
+
1703
+ return app.testHelpers.triggerEvent(selector, context, type, {
1704
+ keyCode,
1705
+ which: keyCode
1706
+ });
1707
+ }
1708
+ });
1709
+ define("ember-testing/lib/helpers/pause_test", ["exports", "@ember/-internals/runtime", "@ember/debug"], function (_exports, _runtime, _debug) {
1710
+ "use strict";
1711
+
1712
+ Object.defineProperty(_exports, "__esModule", {
1713
+ value: true
1714
+ });
1715
+ _exports.resumeTest = resumeTest;
1716
+ _exports.pauseTest = pauseTest;
1717
+
1718
+ /**
1719
+ @module ember
1720
+ */
1721
+ var resume;
1722
+ /**
1723
+ Resumes a test paused by `pauseTest`.
1724
+
1725
+ @method resumeTest
1726
+ @return {void}
1727
+ @public
1728
+ */
1729
+
1730
+ function resumeTest() {
1731
+ (true && !(resume) && (0, _debug.assert)('Testing has not been paused. There is nothing to resume.', resume));
1732
+ resume();
1733
+ resume = undefined;
1734
+ }
1735
+ /**
1736
+ Pauses the current test - this is useful for debugging while testing or for test-driving.
1737
+ It allows you to inspect the state of your application at any point.
1738
+ Example (The test will pause before clicking the button):
1739
+
1740
+ ```javascript
1741
+ visit('/')
1742
+ return pauseTest();
1743
+ click('.btn');
1744
+ ```
1745
+
1746
+ You may want to turn off the timeout before pausing.
1747
+
1748
+ qunit (timeout available to use as of 2.4.0):
1749
+
1750
+ ```
1751
+ visit('/');
1752
+ assert.timeout(0);
1753
+ return pauseTest();
1754
+ click('.btn');
1755
+ ```
1756
+
1757
+ mocha (timeout happens automatically as of ember-mocha v0.14.0):
1758
+
1759
+ ```
1760
+ visit('/');
1761
+ this.timeout(0);
1762
+ return pauseTest();
1763
+ click('.btn');
1764
+ ```
1765
+
1766
+
1767
+ @since 1.9.0
1768
+ @method pauseTest
1769
+ @return {Object} A promise that will never resolve
1770
+ @public
1771
+ */
1772
+
1773
+
1774
+ function pauseTest() {
1775
+ (0, _debug.info)('Testing paused. Use `resumeTest()` to continue.');
1776
+ return new _runtime.RSVP.Promise(resolve => {
1777
+ resume = resolve;
1778
+ }, 'TestAdapter paused promise');
1779
+ }
1780
+ });
1781
+ define("ember-testing/lib/helpers/trigger_event", ["exports", "ember-testing/lib/events"], function (_exports, _events) {
1782
+ "use strict";
1783
+
1784
+ Object.defineProperty(_exports, "__esModule", {
1785
+ value: true
1786
+ });
1787
+ _exports.default = triggerEvent;
1788
+
1789
+ /**
1790
+ @module ember
1791
+ */
1792
+
1793
+ /**
1794
+ Triggers the given DOM event on the element identified by the provided selector.
1795
+ Example:
1796
+ ```javascript
1797
+ triggerEvent('#some-elem-id', 'blur');
1798
+ ```
1799
+ This is actually used internally by the `keyEvent` helper like so:
1800
+ ```javascript
1801
+ triggerEvent('#some-elem-id', 'keypress', { keyCode: 13 });
1802
+ ```
1803
+ @method triggerEvent
1804
+ @param {String} selector jQuery selector for finding element on the DOM
1805
+ @param {String} [context] jQuery selector that will limit the selector
1806
+ argument to find only within the context's children
1807
+ @param {String} type The event type to be triggered.
1808
+ @param {Object} [options] The options to be passed to jQuery.Event.
1809
+ @return {RSVP.Promise<undefined>}
1810
+ @since 1.5.0
1811
+ @public
1812
+ */
1813
+ function triggerEvent(app, selector, contextOrType, typeOrOptions, possibleOptions) {
1814
+ var arity = arguments.length;
1815
+ var context, type, options;
1816
+
1817
+ if (arity === 3) {
1818
+ // context and options are optional, so this is
1819
+ // app, selector, type
1820
+ context = null;
1821
+ type = contextOrType;
1822
+ options = {};
1823
+ } else if (arity === 4) {
1824
+ // context and options are optional, so this is
1825
+ if (typeof typeOrOptions === 'object') {
1826
+ // either
1827
+ // app, selector, type, options
1828
+ context = null;
1829
+ type = contextOrType;
1830
+ options = typeOrOptions;
1831
+ } else {
1832
+ // or
1833
+ // app, selector, context, type
1834
+ context = contextOrType;
1835
+ type = typeOrOptions;
1836
+ options = {};
1837
+ }
1838
+ } else {
1839
+ context = contextOrType;
1840
+ type = typeOrOptions;
1841
+ options = possibleOptions;
1842
+ }
1843
+
1844
+ var $el = app.testHelpers.findWithAssert(selector, context);
1845
+ var el = $el[0];
1846
+ (0, _events.fireEvent)(el, type, options);
1847
+ return app.testHelpers.wait();
1848
+ }
1849
+ });
1850
+ define("ember-testing/lib/helpers/visit", ["exports", "@ember/runloop"], function (_exports, _runloop) {
1851
+ "use strict";
1852
+
1853
+ Object.defineProperty(_exports, "__esModule", {
1854
+ value: true
1855
+ });
1856
+ _exports.default = visit;
1857
+
1858
+ /**
1859
+ Loads a route, sets up any controllers, and renders any templates associated
1860
+ with the route as though a real user had triggered the route change while
1861
+ using your app.
1862
+
1863
+ Example:
1864
+
1865
+ ```javascript
1866
+ visit('posts/index').then(function() {
1867
+ // assert something
1868
+ });
1869
+ ```
1870
+
1871
+ @method visit
1872
+ @param {String} url the name of the route
1873
+ @return {RSVP.Promise<undefined>}
1874
+ @public
1875
+ */
1876
+ function visit(app, url) {
1877
+ var router = app.__container__.lookup('router:main');
1878
+
1879
+ var shouldHandleURL = false;
1880
+ app.boot().then(() => {
1881
+ router.location.setURL(url);
1882
+
1883
+ if (shouldHandleURL) {
1884
+ (0, _runloop.run)(app.__deprecatedInstance__, 'handleURL', url);
1885
+ }
1886
+ });
1887
+
1888
+ if (app._readinessDeferrals > 0) {
1889
+ router.initialURL = url;
1890
+ (0, _runloop.run)(app, 'advanceReadiness');
1891
+ delete router.initialURL;
1892
+ } else {
1893
+ shouldHandleURL = true;
1894
+ }
1895
+
1896
+ return app.testHelpers.wait();
1897
+ }
1898
+ });
1899
+ define("ember-testing/lib/helpers/wait", ["exports", "ember-testing/lib/test/waiters", "@ember/-internals/runtime", "@ember/runloop", "ember-testing/lib/test/pending_requests"], function (_exports, _waiters, _runtime, _runloop, _pending_requests) {
1900
+ "use strict";
1901
+
1902
+ Object.defineProperty(_exports, "__esModule", {
1903
+ value: true
1904
+ });
1905
+ _exports.default = wait;
1906
+
1907
+ /**
1908
+ @module ember
1909
+ */
1910
+
1911
+ /**
1912
+ Causes the run loop to process any pending events. This is used to ensure that
1913
+ any async operations from other helpers (or your assertions) have been processed.
1914
+
1915
+ This is most often used as the return value for the helper functions (see 'click',
1916
+ 'fillIn','visit',etc). However, there is a method to register a test helper which
1917
+ utilizes this method without the need to actually call `wait()` in your helpers.
1918
+
1919
+ The `wait` helper is built into `registerAsyncHelper` by default. You will not need
1920
+ to `return app.testHelpers.wait();` - the wait behavior is provided for you.
1921
+
1922
+ Example:
1923
+
1924
+ ```javascript
1925
+ import { registerAsyncHelper } from '@ember/test';
1926
+
1927
+ registerAsyncHelper('loginUser', function(app, username, password) {
1928
+ visit('secured/path/here')
1929
+ .fillIn('#username', username)
1930
+ .fillIn('#password', password)
1931
+ .click('.submit');
1932
+ });
1933
+ ```
1934
+
1935
+ @method wait
1936
+ @param {Object} value The value to be returned.
1937
+ @return {RSVP.Promise<any>} Promise that resolves to the passed value.
1938
+ @public
1939
+ @since 1.0.0
1940
+ */
1941
+ function wait(app, value) {
1942
+ return new _runtime.RSVP.Promise(function (resolve) {
1943
+ var router = app.__container__.lookup('router:main'); // Every 10ms, poll for the async thing to have finished
1944
+
1945
+
1946
+ var watcher = setInterval(() => {
1947
+ // 1. If the router is loading, keep polling
1948
+ var routerIsLoading = router._routerMicrolib && Boolean(router._routerMicrolib.activeTransition);
1949
+
1950
+ if (routerIsLoading) {
1951
+ return;
1952
+ } // 2. If there are pending Ajax requests, keep polling
1953
+
1954
+
1955
+ if ((0, _pending_requests.pendingRequests)()) {
1956
+ return;
1957
+ } // 3. If there are scheduled timers or we are inside of a run loop, keep polling
1958
+
1959
+
1960
+ if ((0, _runloop._hasScheduledTimers)() || (0, _runloop._getCurrentRunLoop)()) {
1961
+ return;
1962
+ }
1963
+
1964
+ if ((0, _waiters.checkWaiters)()) {
1965
+ return;
1966
+ } // Stop polling
1967
+
1968
+
1969
+ clearInterval(watcher); // Synchronously resolve the promise
1970
+
1971
+ (0, _runloop.run)(null, resolve, value);
1972
+ }, 10);
1973
+ });
1974
+ }
1975
+ });
1976
+ define("ember-testing/lib/initializers", ["@ember/application"], function (_application) {
1977
+ "use strict";
1978
+
1979
+ var name = 'deferReadiness in `testing` mode';
1980
+ (0, _application.onLoad)('Ember.Application', function (Application) {
1981
+ if (!Application.initializers[name]) {
1982
+ Application.initializer({
1983
+ name: name,
1984
+
1985
+ initialize(application) {
1986
+ if (application.testing) {
1987
+ application.deferReadiness();
1988
+ }
1989
+ }
1990
+
1991
+ });
1992
+ }
1993
+ });
1994
+ });
1995
+ define("ember-testing/lib/setup_for_testing", ["exports", "@ember/debug", "@ember/-internals/views", "ember-testing/lib/test/adapter", "ember-testing/lib/test/pending_requests", "ember-testing/lib/adapters/adapter", "ember-testing/lib/adapters/qunit"], function (_exports, _debug, _views, _adapter, _pending_requests, _adapter2, _qunit) {
1996
+ "use strict";
1997
+
1998
+ Object.defineProperty(_exports, "__esModule", {
1999
+ value: true
2000
+ });
2001
+ _exports.default = setupForTesting;
2002
+
2003
+ /* global self */
2004
+
2005
+ /**
2006
+ Sets Ember up for testing. This is useful to perform
2007
+ basic setup steps in order to unit test.
2008
+
2009
+ Use `App.setupForTesting` to perform integration tests (full
2010
+ application testing).
2011
+
2012
+ @method setupForTesting
2013
+ @namespace Ember
2014
+ @since 1.5.0
2015
+ @private
2016
+ */
2017
+ function setupForTesting() {
2018
+ (0, _debug.setTesting)(true);
2019
+ var adapter = (0, _adapter.getAdapter)(); // if adapter is not manually set default to QUnit
2020
+
2021
+ if (!adapter) {
2022
+ (0, _adapter.setAdapter)(typeof self.QUnit === 'undefined' ? _adapter2.default.create() : _qunit.default.create());
2023
+ }
2024
+
2025
+ if (!_views.jQueryDisabled) {
2026
+ (0, _views.jQuery)(document).off('ajaxSend', _pending_requests.incrementPendingRequests);
2027
+ (0, _views.jQuery)(document).off('ajaxComplete', _pending_requests.decrementPendingRequests);
2028
+ (0, _pending_requests.clearPendingRequests)();
2029
+ (0, _views.jQuery)(document).on('ajaxSend', _pending_requests.incrementPendingRequests);
2030
+ (0, _views.jQuery)(document).on('ajaxComplete', _pending_requests.decrementPendingRequests);
2031
+ }
2032
+ }
2033
+ });
2034
+ define("ember-testing/lib/support", ["@ember/debug", "@ember/-internals/views", "@ember/-internals/browser-environment"], function (_debug, _views, _browserEnvironment) {
2035
+ "use strict";
2036
+
2037
+ /**
2038
+ @module ember
2039
+ */
2040
+ var $ = _views.jQuery;
2041
+ /**
2042
+ This method creates a checkbox and triggers the click event to fire the
2043
+ passed in handler. It is used to correct for a bug in older versions
2044
+ of jQuery (e.g 1.8.3).
2045
+
2046
+ @private
2047
+ @method testCheckboxClick
2048
+ */
2049
+
2050
+ function testCheckboxClick(handler) {
2051
+ var input = document.createElement('input');
2052
+ $(input).attr('type', 'checkbox').css({
2053
+ position: 'absolute',
2054
+ left: '-1000px',
2055
+ top: '-1000px'
2056
+ }).appendTo('body').on('click', handler).trigger('click').remove();
2057
+ }
2058
+
2059
+ if (_browserEnvironment.hasDOM && !_views.jQueryDisabled) {
2060
+ $(function () {
2061
+ /*
2062
+ Determine whether a checkbox checked using jQuery's "click" method will have
2063
+ the correct value for its checked property.
2064
+ If we determine that the current jQuery version exhibits this behavior,
2065
+ patch it to work correctly as in the commit for the actual fix:
2066
+ https://github.com/jquery/jquery/commit/1fb2f92.
2067
+ */
2068
+ testCheckboxClick(function () {
2069
+ if (!this.checked && !$.event.special.click) {
2070
+ $.event.special.click = {
2071
+ // For checkbox, fire native event so checked state will be right
2072
+ trigger() {
2073
+ if (this.nodeName === 'INPUT' && this.type === 'checkbox' && this.click) {
2074
+ this.click();
2075
+ return false;
2076
+ }
2077
+ }
2078
+
2079
+ };
2080
+ }
2081
+ }); // Try again to verify that the patch took effect or blow up.
2082
+
2083
+ testCheckboxClick(function () {
2084
+ (true && (0, _debug.warn)("clicked checkboxes should be checked! the jQuery patch didn't work", this.checked, {
2085
+ id: 'ember-testing.test-checkbox-click'
2086
+ }));
2087
+ });
2088
+ });
2089
+ }
2090
+ });
2091
+ define("ember-testing/lib/test", ["exports", "ember-testing/lib/test/helpers", "ember-testing/lib/test/on_inject_helpers", "ember-testing/lib/test/promise", "ember-testing/lib/test/waiters", "ember-testing/lib/test/adapter"], function (_exports, _helpers, _on_inject_helpers, _promise, _waiters, _adapter) {
2092
+ "use strict";
2093
+
2094
+ Object.defineProperty(_exports, "__esModule", {
2095
+ value: true
2096
+ });
2097
+ _exports.default = void 0;
2098
+
2099
+ /**
2100
+ @module ember
2101
+ */
2102
+
2103
+ /**
2104
+ This is a container for an assortment of testing related functionality:
2105
+
2106
+ * Choose your default test adapter (for your framework of choice).
2107
+ * Register/Unregister additional test helpers.
2108
+ * Setup callbacks to be fired when the test helpers are injected into
2109
+ your application.
2110
+
2111
+ @class Test
2112
+ @namespace Ember
2113
+ @public
2114
+ */
2115
+ var Test = {
2116
+ /**
2117
+ Hash containing all known test helpers.
2118
+ @property _helpers
2119
+ @private
2120
+ @since 1.7.0
2121
+ */
2122
+ _helpers: _helpers.helpers,
2123
+ registerHelper: _helpers.registerHelper,
2124
+ registerAsyncHelper: _helpers.registerAsyncHelper,
2125
+ unregisterHelper: _helpers.unregisterHelper,
2126
+ onInjectHelpers: _on_inject_helpers.onInjectHelpers,
2127
+ Promise: _promise.default,
2128
+ promise: _promise.promise,
2129
+ resolve: _promise.resolve,
2130
+ registerWaiter: _waiters.registerWaiter,
2131
+ unregisterWaiter: _waiters.unregisterWaiter,
2132
+ checkWaiters: _waiters.checkWaiters
2133
+ };
2134
+ /**
2135
+ Used to allow ember-testing to communicate with a specific testing
2136
+ framework.
2137
+
2138
+ You can manually set it before calling `App.setupForTesting()`.
2139
+
2140
+ Example:
2141
+
2142
+ ```javascript
2143
+ Ember.Test.adapter = MyCustomAdapter.create()
2144
+ ```
2145
+
2146
+ If you do not set it, ember-testing will default to `Ember.Test.QUnitAdapter`.
2147
+
2148
+ @public
2149
+ @for Ember.Test
2150
+ @property adapter
2151
+ @type {Class} The adapter to be used.
2152
+ @default Ember.Test.QUnitAdapter
2153
+ */
2154
+
2155
+ Object.defineProperty(Test, 'adapter', {
2156
+ get: _adapter.getAdapter,
2157
+ set: _adapter.setAdapter
2158
+ });
2159
+ var _default = Test;
2160
+ _exports.default = _default;
2161
+ });
2162
+ define("ember-testing/lib/test/adapter", ["exports", "@ember/-internals/error-handling"], function (_exports, _errorHandling) {
2163
+ "use strict";
2164
+
2165
+ Object.defineProperty(_exports, "__esModule", {
2166
+ value: true
2167
+ });
2168
+ _exports.getAdapter = getAdapter;
2169
+ _exports.setAdapter = setAdapter;
2170
+ _exports.asyncStart = asyncStart;
2171
+ _exports.asyncEnd = asyncEnd;
2172
+ var adapter;
2173
+
2174
+ function getAdapter() {
2175
+ return adapter;
2176
+ }
2177
+
2178
+ function setAdapter(value) {
2179
+ adapter = value;
2180
+
2181
+ if (value && typeof value.exception === 'function') {
2182
+ (0, _errorHandling.setDispatchOverride)(adapterDispatch);
2183
+ } else {
2184
+ (0, _errorHandling.setDispatchOverride)(null);
2185
+ }
2186
+ }
2187
+
2188
+ function asyncStart() {
2189
+ if (adapter) {
2190
+ adapter.asyncStart();
2191
+ }
2192
+ }
2193
+
2194
+ function asyncEnd() {
2195
+ if (adapter) {
2196
+ adapter.asyncEnd();
2197
+ }
2198
+ }
2199
+
2200
+ function adapterDispatch(error) {
2201
+ adapter.exception(error);
2202
+ console.error(error.stack); // eslint-disable-line no-console
2203
+ }
2204
+ });
2205
+ define("ember-testing/lib/test/helpers", ["exports", "ember-testing/lib/test/promise"], function (_exports, _promise) {
2206
+ "use strict";
2207
+
2208
+ Object.defineProperty(_exports, "__esModule", {
2209
+ value: true
2210
+ });
2211
+ _exports.registerHelper = registerHelper;
2212
+ _exports.registerAsyncHelper = registerAsyncHelper;
2213
+ _exports.unregisterHelper = unregisterHelper;
2214
+ _exports.helpers = void 0;
2215
+ var helpers = {};
2216
+ /**
2217
+ @module @ember/test
2218
+ */
2219
+
2220
+ /**
2221
+ `registerHelper` is used to register a test helper that will be injected
2222
+ when `App.injectTestHelpers` is called.
2223
+
2224
+ The helper method will always be called with the current Application as
2225
+ the first parameter.
2226
+
2227
+ For example:
2228
+
2229
+ ```javascript
2230
+ import { registerHelper } from '@ember/test';
2231
+ import { run } from '@ember/runloop';
2232
+
2233
+ registerHelper('boot', function(app) {
2234
+ run(app, app.advanceReadiness);
2235
+ });
2236
+ ```
2237
+
2238
+ This helper can later be called without arguments because it will be
2239
+ called with `app` as the first parameter.
2240
+
2241
+ ```javascript
2242
+ import Application from '@ember/application';
2243
+
2244
+ App = Application.create();
2245
+ App.injectTestHelpers();
2246
+ boot();
2247
+ ```
2248
+
2249
+ @public
2250
+ @for @ember/test
2251
+ @static
2252
+ @method registerHelper
2253
+ @param {String} name The name of the helper method to add.
2254
+ @param {Function} helperMethod
2255
+ @param options {Object}
2256
+ */
2257
+
2258
+ _exports.helpers = helpers;
2259
+
2260
+ function registerHelper(name, helperMethod) {
2261
+ helpers[name] = {
2262
+ method: helperMethod,
2263
+ meta: {
2264
+ wait: false
2265
+ }
2266
+ };
2267
+ }
2268
+ /**
2269
+ `registerAsyncHelper` is used to register an async test helper that will be injected
2270
+ when `App.injectTestHelpers` is called.
2271
+
2272
+ The helper method will always be called with the current Application as
2273
+ the first parameter.
2274
+
2275
+ For example:
2276
+
2277
+ ```javascript
2278
+ import { registerAsyncHelper } from '@ember/test';
2279
+ import { run } from '@ember/runloop';
2280
+
2281
+ registerAsyncHelper('boot', function(app) {
2282
+ run(app, app.advanceReadiness);
2283
+ });
2284
+ ```
2285
+
2286
+ The advantage of an async helper is that it will not run
2287
+ until the last async helper has completed. All async helpers
2288
+ after it will wait for it complete before running.
2289
+
2290
+
2291
+ For example:
2292
+
2293
+ ```javascript
2294
+ import { registerAsyncHelper } from '@ember/test';
2295
+
2296
+ registerAsyncHelper('deletePost', function(app, postId) {
2297
+ click('.delete-' + postId);
2298
+ });
2299
+
2300
+ // ... in your test
2301
+ visit('/post/2');
2302
+ deletePost(2);
2303
+ visit('/post/3');
2304
+ deletePost(3);
2305
+ ```
2306
+
2307
+ @public
2308
+ @for @ember/test
2309
+ @method registerAsyncHelper
2310
+ @param {String} name The name of the helper method to add.
2311
+ @param {Function} helperMethod
2312
+ @since 1.2.0
2313
+ */
2314
+
2315
+
2316
+ function registerAsyncHelper(name, helperMethod) {
2317
+ helpers[name] = {
2318
+ method: helperMethod,
2319
+ meta: {
2320
+ wait: true
2321
+ }
2322
+ };
2323
+ }
2324
+ /**
2325
+ Remove a previously added helper method.
2326
+
2327
+ Example:
2328
+
2329
+ ```javascript
2330
+ import { unregisterHelper } from '@ember/test';
2331
+
2332
+ unregisterHelper('wait');
2333
+ ```
2334
+
2335
+ @public
2336
+ @method unregisterHelper
2337
+ @static
2338
+ @for @ember/test
2339
+ @param {String} name The helper to remove.
2340
+ */
2341
+
2342
+
2343
+ function unregisterHelper(name) {
2344
+ delete helpers[name];
2345
+ delete _promise.default.prototype[name];
2346
+ }
2347
+ });
2348
+ define("ember-testing/lib/test/on_inject_helpers", ["exports"], function (_exports) {
2349
+ "use strict";
2350
+
2351
+ Object.defineProperty(_exports, "__esModule", {
2352
+ value: true
2353
+ });
2354
+ _exports.onInjectHelpers = onInjectHelpers;
2355
+ _exports.invokeInjectHelpersCallbacks = invokeInjectHelpersCallbacks;
2356
+ _exports.callbacks = void 0;
2357
+ var callbacks = [];
2358
+ /**
2359
+ Used to register callbacks to be fired whenever `App.injectTestHelpers`
2360
+ is called.
2361
+
2362
+ The callback will receive the current application as an argument.
2363
+
2364
+ Example:
2365
+
2366
+ ```javascript
2367
+ import $ from 'jquery';
2368
+
2369
+ Ember.Test.onInjectHelpers(function() {
2370
+ $(document).ajaxSend(function() {
2371
+ Test.pendingRequests++;
2372
+ });
2373
+
2374
+ $(document).ajaxComplete(function() {
2375
+ Test.pendingRequests--;
2376
+ });
2377
+ });
2378
+ ```
2379
+
2380
+ @public
2381
+ @for Ember.Test
2382
+ @method onInjectHelpers
2383
+ @param {Function} callback The function to be called.
2384
+ */
2385
+
2386
+ _exports.callbacks = callbacks;
2387
+
2388
+ function onInjectHelpers(callback) {
2389
+ callbacks.push(callback);
2390
+ }
2391
+
2392
+ function invokeInjectHelpersCallbacks(app) {
2393
+ for (var i = 0; i < callbacks.length; i++) {
2394
+ callbacks[i](app);
2395
+ }
2396
+ }
2397
+ });
2398
+ define("ember-testing/lib/test/pending_requests", ["exports"], function (_exports) {
2399
+ "use strict";
2400
+
2401
+ Object.defineProperty(_exports, "__esModule", {
2402
+ value: true
2403
+ });
2404
+ _exports.pendingRequests = pendingRequests;
2405
+ _exports.clearPendingRequests = clearPendingRequests;
2406
+ _exports.incrementPendingRequests = incrementPendingRequests;
2407
+ _exports.decrementPendingRequests = decrementPendingRequests;
2408
+ var requests = [];
2409
+
2410
+ function pendingRequests() {
2411
+ return requests.length;
2412
+ }
2413
+
2414
+ function clearPendingRequests() {
2415
+ requests.length = 0;
2416
+ }
2417
+
2418
+ function incrementPendingRequests(_, xhr) {
2419
+ requests.push(xhr);
2420
+ }
2421
+
2422
+ function decrementPendingRequests(_, xhr) {
2423
+ setTimeout(function () {
2424
+ for (var i = 0; i < requests.length; i++) {
2425
+ if (xhr === requests[i]) {
2426
+ requests.splice(i, 1);
2427
+ break;
2428
+ }
2429
+ }
2430
+ }, 0);
2431
+ }
2432
+ });
2433
+ define("ember-testing/lib/test/promise", ["exports", "@ember/-internals/runtime", "ember-testing/lib/test/run"], function (_exports, _runtime, _run) {
2434
+ "use strict";
2435
+
2436
+ Object.defineProperty(_exports, "__esModule", {
2437
+ value: true
2438
+ });
2439
+ _exports.promise = promise;
2440
+ _exports.resolve = resolve;
2441
+ _exports.getLastPromise = getLastPromise;
2442
+ _exports.default = void 0;
2443
+ var lastPromise;
2444
+
2445
+ class TestPromise extends _runtime.RSVP.Promise {
2446
+ constructor() {
2447
+ super(...arguments);
2448
+ lastPromise = this;
2449
+ }
2450
+
2451
+ then(_onFulfillment, ...args) {
2452
+ var onFulfillment = typeof _onFulfillment === 'function' ? result => isolate(_onFulfillment, result) : undefined;
2453
+ return super.then(onFulfillment, ...args);
2454
+ }
2455
+
2456
+ }
2457
+ /**
2458
+ This returns a thenable tailored for testing. It catches failed
2459
+ `onSuccess` callbacks and invokes the `Ember.Test.adapter.exception`
2460
+ callback in the last chained then.
2461
+
2462
+ This method should be returned by async helpers such as `wait`.
2463
+
2464
+ @public
2465
+ @for Ember.Test
2466
+ @method promise
2467
+ @param {Function} resolver The function used to resolve the promise.
2468
+ @param {String} label An optional string for identifying the promise.
2469
+ */
2470
+
2471
+
2472
+ _exports.default = TestPromise;
2473
+
2474
+ function promise(resolver, label) {
2475
+ var fullLabel = `Ember.Test.promise: ${label || '<Unknown Promise>'}`;
2476
+ return new TestPromise(resolver, fullLabel);
2477
+ }
2478
+ /**
2479
+ Replacement for `Ember.RSVP.resolve`
2480
+ The only difference is this uses
2481
+ an instance of `Ember.Test.Promise`
2482
+
2483
+ @public
2484
+ @for Ember.Test
2485
+ @method resolve
2486
+ @param {Mixed} The value to resolve
2487
+ @since 1.2.0
2488
+ */
2489
+
2490
+
2491
+ function resolve(result, label) {
2492
+ return TestPromise.resolve(result, label);
2493
+ }
2494
+
2495
+ function getLastPromise() {
2496
+ return lastPromise;
2497
+ } // This method isolates nested async methods
2498
+ // so that they don't conflict with other last promises.
2499
+ //
2500
+ // 1. Set `Ember.Test.lastPromise` to null
2501
+ // 2. Invoke method
2502
+ // 3. Return the last promise created during method
2503
+
2504
+
2505
+ function isolate(onFulfillment, result) {
2506
+ // Reset lastPromise for nested helpers
2507
+ lastPromise = null;
2508
+ var value = onFulfillment(result);
2509
+ var promise = lastPromise;
2510
+ lastPromise = null; // If the method returned a promise
2511
+ // return that promise. If not,
2512
+ // return the last async helper's promise
2513
+
2514
+ if (value && value instanceof TestPromise || !promise) {
2515
+ return value;
2516
+ } else {
2517
+ return (0, _run.default)(() => resolve(promise).then(() => value));
2518
+ }
2519
+ }
2520
+ });
2521
+ define("ember-testing/lib/test/run", ["exports", "@ember/runloop"], function (_exports, _runloop) {
2522
+ "use strict";
2523
+
2524
+ Object.defineProperty(_exports, "__esModule", {
2525
+ value: true
2526
+ });
2527
+ _exports.default = run;
2528
+
2529
+ function run(fn) {
2530
+ if (!(0, _runloop._getCurrentRunLoop)()) {
2531
+ return (0, _runloop.run)(fn);
2532
+ } else {
2533
+ return fn();
2534
+ }
2535
+ }
2536
+ });
2537
+ define("ember-testing/lib/test/waiters", ["exports"], function (_exports) {
2538
+ "use strict";
2539
+
2540
+ Object.defineProperty(_exports, "__esModule", {
2541
+ value: true
2542
+ });
2543
+ _exports.registerWaiter = registerWaiter;
2544
+ _exports.unregisterWaiter = unregisterWaiter;
2545
+ _exports.checkWaiters = checkWaiters;
2546
+
2547
+ /**
2548
+ @module @ember/test
2549
+ */
2550
+ var contexts = [];
2551
+ var callbacks = [];
2552
+ /**
2553
+ This allows ember-testing to play nicely with other asynchronous
2554
+ events, such as an application that is waiting for a CSS3
2555
+ transition or an IndexDB transaction. The waiter runs periodically
2556
+ after each async helper (i.e. `click`, `andThen`, `visit`, etc) has executed,
2557
+ until the returning result is truthy. After the waiters finish, the next async helper
2558
+ is executed and the process repeats.
2559
+
2560
+ For example:
2561
+
2562
+ ```javascript
2563
+ import { registerWaiter } from '@ember/test';
2564
+
2565
+ registerWaiter(function() {
2566
+ return myPendingTransactions() === 0;
2567
+ });
2568
+ ```
2569
+ The `context` argument allows you to optionally specify the `this`
2570
+ with which your callback will be invoked.
2571
+
2572
+ For example:
2573
+
2574
+ ```javascript
2575
+ import { registerWaiter } from '@ember/test';
2576
+
2577
+ registerWaiter(MyDB, MyDB.hasPendingTransactions);
2578
+ ```
2579
+
2580
+ @public
2581
+ @for @ember/test
2582
+ @static
2583
+ @method registerWaiter
2584
+ @param {Object} context (optional)
2585
+ @param {Function} callback
2586
+ @since 1.2.0
2587
+ */
2588
+
2589
+ function registerWaiter(context, callback) {
2590
+ if (arguments.length === 1) {
2591
+ callback = context;
2592
+ context = null;
2593
+ }
2594
+
2595
+ if (indexOf(context, callback) > -1) {
2596
+ return;
2597
+ }
2598
+
2599
+ contexts.push(context);
2600
+ callbacks.push(callback);
2601
+ }
2602
+ /**
2603
+ `unregisterWaiter` is used to unregister a callback that was
2604
+ registered with `registerWaiter`.
2605
+
2606
+ @public
2607
+ @for @ember/test
2608
+ @static
2609
+ @method unregisterWaiter
2610
+ @param {Object} context (optional)
2611
+ @param {Function} callback
2612
+ @since 1.2.0
2613
+ */
2614
+
2615
+
2616
+ function unregisterWaiter(context, callback) {
2617
+ if (!callbacks.length) {
2618
+ return;
2619
+ }
2620
+
2621
+ if (arguments.length === 1) {
2622
+ callback = context;
2623
+ context = null;
2624
+ }
2625
+
2626
+ var i = indexOf(context, callback);
2627
+
2628
+ if (i === -1) {
2629
+ return;
2630
+ }
2631
+
2632
+ contexts.splice(i, 1);
2633
+ callbacks.splice(i, 1);
2634
+ }
2635
+ /**
2636
+ Iterates through each registered test waiter, and invokes
2637
+ its callback. If any waiter returns false, this method will return
2638
+ true indicating that the waiters have not settled yet.
2639
+
2640
+ This is generally used internally from the acceptance/integration test
2641
+ infrastructure.
2642
+
2643
+ @public
2644
+ @for @ember/test
2645
+ @static
2646
+ @method checkWaiters
2647
+ */
2648
+
2649
+
2650
+ function checkWaiters() {
2651
+ if (!callbacks.length) {
2652
+ return false;
2653
+ }
2654
+
2655
+ for (var i = 0; i < callbacks.length; i++) {
2656
+ var context = contexts[i];
2657
+ var callback = callbacks[i];
2658
+
2659
+ if (!callback.call(context)) {
2660
+ return true;
2661
+ }
2662
+ }
2663
+
2664
+ return false;
2665
+ }
2666
+
2667
+ function indexOf(context, callback) {
2668
+ for (var i = 0; i < callbacks.length; i++) {
2669
+ if (callbacks[i] === callback && contexts[i] === context) {
2670
+ return i;
2671
+ }
2672
+ }
2673
+
2674
+ return -1;
2675
+ }
2676
+ });
2677
+ require('ember-testing');
2678
+ }());
2679
+ //# sourceMappingURL=ember-testing.map