ember-source 4.3.0-alpha.4 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/CHANGELOG.md +8 -2
  2. package/build-metadata.json +3 -3
  3. package/dist/dependencies/router_js.js +66 -31
  4. package/dist/ember-template-compiler.js +16 -13
  5. package/dist/ember-template-compiler.map +1 -1
  6. package/dist/ember-testing.js +1 -1
  7. package/dist/ember-testing.map +1 -1
  8. package/dist/ember.debug.js +685 -1223
  9. package/dist/ember.debug.map +1 -1
  10. package/dist/header/license.js +1 -1
  11. package/dist/packages/@ember/-internals/container/index.js +15 -20
  12. package/dist/packages/@ember/-internals/glimmer/index.js +60 -45
  13. package/dist/packages/@ember/-internals/meta/lib/meta.js +8 -9
  14. package/dist/packages/@ember/-internals/metal/index.js +44 -45
  15. package/dist/packages/@ember/-internals/routing/lib/ext/controller.js +10 -8
  16. package/dist/packages/@ember/-internals/routing/lib/services/router.js +165 -197
  17. package/dist/packages/@ember/-internals/routing/lib/system/route-info.js +2 -2
  18. package/dist/packages/@ember/-internals/routing/lib/system/route.js +96 -375
  19. package/dist/packages/@ember/-internals/routing/lib/system/router.js +62 -35
  20. package/dist/packages/@ember/-internals/routing/lib/utils.js +31 -20
  21. package/dist/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +32 -32
  22. package/dist/packages/@ember/-internals/utils/index.js +2 -0
  23. package/dist/packages/@ember/-internals/views/lib/system/utils.js +1 -0
  24. package/dist/packages/@ember/canary-features/index.js +2 -2
  25. package/dist/packages/@ember/controller/index.js +3 -54
  26. package/dist/packages/@ember/instrumentation/index.js +9 -13
  27. package/dist/packages/@ember/routing/router-service.js +1 -0
  28. package/dist/packages/@ember/service/index.js +6 -73
  29. package/dist/packages/ember/version.js +1 -1
  30. package/docs/data.json +411 -343
  31. package/package.json +5 -8
@@ -6,7 +6,7 @@
6
6
  * Portions Copyright 2008-2011 Apple Inc. All rights reserved.
7
7
  * @license Licensed under MIT license
8
8
  * See https://raw.github.com/emberjs/ember.js/master/LICENSE
9
- * @version 4.3.0-alpha.4
9
+ * @version 4.3.0
10
10
  */
11
11
  /* eslint-disable no-var */
12
12
 
@@ -272,7 +272,7 @@ define("@ember/-internals/container/index", ["exports", "@ember/-internals/owner
272
272
 
273
273
  lookup(fullName, options) {
274
274
  if (this.isDestroyed) {
275
- throw new Error(`Can not call \`.lookup\` after the owner has been destroyed`);
275
+ throw new Error(`Cannot call \`.lookup\` after the owner has been destroyed`);
276
276
  }
277
277
 
278
278
  (true && !(this.registry.isValidFullName(fullName)) && (0, _debug.assert)('fullName must be a proper full name', this.registry.isValidFullName(fullName)));
@@ -343,7 +343,7 @@ define("@ember/-internals/container/index", ["exports", "@ember/-internals/owner
343
343
 
344
344
  factoryFor(fullName) {
345
345
  if (this.isDestroyed) {
346
- throw new Error(`Can not call \`.factoryFor\` after the owner has been destroyed`);
346
+ throw new Error(`Cannot call \`.factoryFor\` after the owner has been destroyed`);
347
347
  }
348
348
 
349
349
  var normalizedName = this.registry.normalize(fullName);
@@ -516,9 +516,9 @@ define("@ember/-internals/container/index", ["exports", "@ember/-internals/owner
516
516
  var cache = container.cache;
517
517
  var keys = Object.keys(cache);
518
518
 
519
- for (var i = 0; i < keys.length; i++) {
520
- var key = keys[i];
519
+ for (var key of keys) {
521
520
  var value = cache[key];
521
+ (true && !(value) && (0, _debug.assert)('has cached value', value));
522
522
 
523
523
  if (value.destroy) {
524
524
  value.destroy();
@@ -564,11 +564,6 @@ define("@ember/-internals/container/index", ["exports", "@ember/-internals/owner
564
564
  this.normalizedName = normalizedName;
565
565
  this.madeToString = undefined;
566
566
  this.injections = undefined;
567
- setFactoryFor(this, this);
568
-
569
- if (isInstantiatable(container, fullName)) {
570
- setFactoryFor(factory, this);
571
- }
572
567
  }
573
568
 
574
569
  toString() {
@@ -585,17 +580,13 @@ define("@ember/-internals/container/index", ["exports", "@ember/-internals/owner
585
580
  } = this;
586
581
 
587
582
  if (container.isDestroyed) {
588
- throw new Error(`Can not create new instances after the owner has been destroyed (you attempted to create ${this.fullName})`);
583
+ throw new Error(`Cannot create new instances after the owner has been destroyed (you attempted to create ${this.fullName})`);
589
584
  }
590
585
 
591
- var props = {};
586
+ var props = options ? Object.assign({}, options) : {};
592
587
  (0, _owner.setOwner)(props, container.owner);
593
588
  setFactoryFor(props, this);
594
589
 
595
- if (options !== undefined) {
596
- props = Object.assign({}, props, options);
597
- }
598
-
599
590
  if (true
600
591
  /* DEBUG */
601
592
  ) {
@@ -959,6 +950,8 @@ define("@ember/-internals/container/index", ["exports", "@ember/-internals/owner
959
950
  }
960
951
 
961
952
  var type = fullName.split(':')[0];
953
+ (true && !(type) && (0, _debug.assert)('has type', type)); // split always will have at least one value
954
+
962
955
  options = this._typeOptions[type];
963
956
 
964
957
  if (options && options[optionName] !== undefined) {
@@ -1005,8 +998,7 @@ define("@ember/-internals/container/index", ["exports", "@ember/-internals/owner
1005
998
  var localKnown = (0, _utils.dictionary)(null);
1006
999
  var registeredNames = Object.keys(this.registrations);
1007
1000
 
1008
- for (var index = 0; index < registeredNames.length; index++) {
1009
- var fullName = registeredNames[index];
1001
+ for (var fullName of registeredNames) {
1010
1002
  var itemType = fullName.split(':')[0];
1011
1003
 
1012
1004
  if (itemType === type) {
@@ -1045,9 +1037,11 @@ define("@ember/-internals/container/index", ["exports", "@ember/-internals/owner
1045
1037
 
1046
1038
  for (var key in hash) {
1047
1039
  if (Object.prototype.hasOwnProperty.call(hash, key)) {
1040
+ var value = hash[key];
1041
+ (true && !(value) && (0, _debug.assert)('has value', value));
1048
1042
  var {
1049
1043
  specifier
1050
- } = hash[key];
1044
+ } = value;
1051
1045
  (true && !(this.isValidFullName(specifier)) && (0, _debug.assert)(`Expected a proper full name, given '${specifier}'`, this.isValidFullName(specifier)));
1052
1046
  injections.push({
1053
1047
  property: key,
@@ -1064,10 +1058,10 @@ define("@ember/-internals/container/index", ["exports", "@ember/-internals/owner
1064
1058
  return;
1065
1059
  }
1066
1060
 
1067
- for (var i = 0; i < injections.length; i++) {
1061
+ for (var injection of injections) {
1068
1062
  var {
1069
1063
  specifier
1070
- } = injections[i];
1064
+ } = injection;
1071
1065
  (true && !(this.has(specifier)) && (0, _debug.assert)(`Attempting to inject an unknown injection: '${specifier}'`, this.has(specifier)));
1072
1066
  }
1073
1067
  };
@@ -1113,6 +1107,7 @@ define("@ember/-internals/container/index", ["exports", "@ember/-internals/owner
1113
1107
 
1114
1108
  function privatize(_ref5) {
1115
1109
  var [fullName] = _ref5;
1110
+ (true && !(arguments.length === 1 && fullName) && (0, _debug.assert)('has a single string argument', arguments.length === 1 && fullName));
1116
1111
  var name = privateNames[fullName];
1117
1112
 
1118
1113
  if (name) {
@@ -3692,19 +3687,25 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
3692
3687
  }
3693
3688
 
3694
3689
  function createClassNameBindingRef(rootRef, microsyntax, operations) {
3695
- var [prop, truthy, falsy] = microsyntax.split(':');
3690
+ var parts = microsyntax.split(':');
3691
+ var [prop, truthy, falsy] = parts; // NOTE: This could be an empty string
3692
+
3693
+ (true && !(prop !== undefined) && (0, _debug.assert)('has prop', prop !== undefined)); // Will always have at least one part
3694
+
3696
3695
  var isStatic = prop === '';
3697
3696
 
3698
3697
  if (isStatic) {
3699
3698
  operations.setAttribute('class', (0, _reference.createPrimitiveRef)(truthy), true, null);
3700
3699
  } else {
3701
3700
  var isPath = prop.indexOf('.') > -1;
3702
- var parts = isPath ? prop.split('.') : [];
3703
- var value = isPath ? referenceForParts(rootRef, parts) : (0, _reference.childRefFor)(rootRef, prop);
3701
+
3702
+ var _parts = isPath ? prop.split('.') : [];
3703
+
3704
+ var value = isPath ? referenceForParts(rootRef, _parts) : (0, _reference.childRefFor)(rootRef, prop);
3704
3705
  var ref;
3705
3706
 
3706
3707
  if (truthy === undefined) {
3707
- ref = createSimpleClassNameBindingRef(value, isPath ? parts[parts.length - 1] : prop);
3708
+ ref = createSimpleClassNameBindingRef(value, isPath ? _parts[_parts.length - 1] : prop);
3708
3709
  } else {
3709
3710
  ref = createColonClassNameBindingRef(value, truthy, falsy);
3710
3711
  }
@@ -4079,9 +4080,10 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
4079
4080
  // Anything else is an action argument.
4080
4081
 
4081
4082
  var [context, action$$1, ...restArgs] = positional;
4083
+ (true && !(context && action$$1) && (0, _debug.assert)('hash position arguments', context && action$$1));
4082
4084
  var debugKey = action$$1.debugLabel;
4083
- var target = 'target' in named ? named.target : context;
4084
- var processArgs = makeArgsProcessor('value' in named && named.value, restArgs);
4085
+ var target = 'target' in named && named.target ? named.target : context;
4086
+ var processArgs = makeArgsProcessor('value' in named && named.value || false, restArgs);
4085
4087
  var fn$$1;
4086
4088
 
4087
4089
  if ((0, _reference.isInvokableRef)(action$$1)) {
@@ -4196,6 +4198,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
4196
4198
 
4197
4199
  for (var name in namedArgs) {
4198
4200
  var ref = namedArgs[name];
4201
+ (true && !(ref) && (0, _debug.assert)('expected ref', ref));
4199
4202
  var value = (0, _reference.valueForRef)(ref);
4200
4203
  var isAction = typeof value === 'function' && ACTIONS.has(value);
4201
4204
 
@@ -4263,6 +4266,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
4263
4266
 
4264
4267
  while (i !== -1) {
4265
4268
  var binding = attributeBindings[i];
4269
+ (true && !(binding) && (0, _debug.assert)('has binding', binding));
4266
4270
  var parsed = parseAttributeBinding(binding);
4267
4271
  var attribute = parsed[1];
4268
4272
 
@@ -4343,8 +4347,9 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
4343
4347
  {
4344
4348
  __ARGS__
4345
4349
  } = _b,
4346
- rest = __rest(_b, ["__ARGS__"]); // does this need to be untracked?
4350
+ rest = __rest(_b, ["__ARGS__"]);
4347
4351
 
4352
+ (true && !(__ARGS__) && (0, _debug.assert)('[BUG] unexpectedly missing __ARGS__ after check', __ARGS__)); // does this need to be untracked?
4348
4353
 
4349
4354
  var __args__ = (0, _reference.valueForRef)(__ARGS__);
4350
4355
 
@@ -4378,14 +4383,8 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
4378
4383
  Object.assign(named, args.named.capture());
4379
4384
 
4380
4385
  for (var i = 0; i < count; i++) {
4381
- // As of TS 3.7, tsc is giving us the following error on this line without the type annotation
4382
- //
4383
- // TS7022: 'name' implicitly has type 'any' because it does not have a type annotation and is
4384
- // referenced directly or indirectly in its own initializer.
4385
- //
4386
- // This is almost certainly a TypeScript bug, feel free to try and remove the annotation after
4387
- // upgrading if it is not needed anymore.
4388
4386
  var name = positionalParams[i];
4387
+ (true && !(name) && (0, _debug.assert)('Expected at least one positional param', name));
4389
4388
  (true && !(!args.named.has(name)) && (0, _debug.assert)(`You cannot specify both a positional param (at position ${i}) and the hash argument \`${name}\`.`, !args.named.has(name)));
4390
4389
  named[name] = args.positional.at(i);
4391
4390
  }
@@ -4667,9 +4666,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
4667
4666
  classNameBindings
4668
4667
  } = component;
4669
4668
 
4670
- for (var i = 0; i < classNameBindings.length; i++) {
4671
- var binding = classNameBindings[i];
4672
-
4669
+ for (var binding of classNameBindings) {
4673
4670
  if (binding.split(' ').length > 1) {
4674
4671
  return false;
4675
4672
  }
@@ -4681,9 +4678,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
4681
4678
  classNameBindings
4682
4679
  } = component;
4683
4680
 
4684
- for (var i = 0; i < classNameBindings.length; i++) {
4685
- var binding = classNameBindings[i];
4686
-
4681
+ for (var binding of classNameBindings) {
4687
4682
  if (binding.split(' ').length > 1) {
4688
4683
  return false;
4689
4684
  }
@@ -6416,6 +6411,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
6416
6411
  positional
6417
6412
  } = _ref11;
6418
6413
  var inner = positional[0];
6414
+ (true && !(inner) && (0, _debug.assert)('expected at least one positional arg', inner));
6419
6415
  return (0, _reference.createComputeRef)(() => {
6420
6416
  var iterable = (0, _reference.valueForRef)(inner);
6421
6417
  (0, _validator.consumeTag)((0, _metal.tagForObject)(iterable));
@@ -6554,18 +6550,14 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
6554
6550
 
6555
6551
  static fromIndexable(obj) {
6556
6552
  var keys = Object.keys(obj);
6557
- var {
6558
- length
6559
- } = keys;
6560
6553
 
6561
- if (length === 0) {
6554
+ if (keys.length === 0) {
6562
6555
  return null;
6563
6556
  } else {
6564
6557
  var values = [];
6565
6558
 
6566
- for (var i = 0; i < length; i++) {
6559
+ for (var key of keys) {
6567
6560
  var value = void 0;
6568
- var key = keys[i];
6569
6561
  value = obj[key]; // Add the tag of the returned value if it is an array, since arrays
6570
6562
  // should always cause updates if they are consumed and then changed
6571
6563
 
@@ -6832,14 +6824,14 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
6832
6824
  positional,
6833
6825
  named
6834
6826
  } = _ref12;
6835
- (true && !(positional.length === 1) && (0, _debug.assert)(`[BUG] wrong number of positional arguments, expecting 1, got ${positional.length}`, positional.length === 1));
6836
6827
  var nameOrValueRef = positional[0];
6837
- (true && !('type' in named) && (0, _debug.assert)(`[BUG] expecting \`type\` named argument`, 'type' in named));
6838
- (true && !('loc' in named) && (0, _debug.assert)(`[BUG] expecting \`loc\` named argument`, 'loc' in named));
6839
- (true && !('original' in named) && (0, _debug.assert)(`[BUG] expecting \`original\` named argument`, 'original' in named));
6828
+ (true && !(positional.length === 1 && nameOrValueRef) && (0, _debug.assert)(`[BUG] wrong number of positional arguments, expecting 1, got ${positional.length}`, positional.length === 1 && nameOrValueRef));
6840
6829
  var typeRef = named.type;
6841
6830
  var locRef = named.loc;
6842
- var originalRef = named.original; // Bug: why do these fail?
6831
+ var originalRef = named.original;
6832
+ (true && !(typeRef) && (0, _debug.assert)(`[BUG] expecting \`type\` named argument`, typeRef));
6833
+ (true && !(locRef) && (0, _debug.assert)(`[BUG] expecting \`loc\` named argument`, locRef));
6834
+ (true && !(originalRef) && (0, _debug.assert)(`[BUG] expecting \`original\` named argument`, originalRef)); // Bug: why do these fail?
6843
6835
  // assert('[BUG] expecting a string literal for the `type` argument', isConstRef(typeRef));
6844
6836
  // assert('[BUG] expecting a string literal for the `loc` argument', isConstRef(locRef));
6845
6837
  // assert('[BUG] expecting a string literal for the `original` argument', isConstRef(originalRef));
@@ -6863,6 +6855,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
6863
6855
  ) {
6864
6856
  helper$1 = args => {
6865
6857
  var inner = args.positional[0];
6858
+ (true && !(inner) && (0, _debug.assert)('expected at least one positional arg', inner));
6866
6859
  return (0, _reference.createComputeRef)(() => {
6867
6860
  var value = (0, _reference.valueForRef)(inner);
6868
6861
  (true && !(value !== null && value !== undefined) && (0, _debug.assert)('You cannot pass a null or undefined destination element to in-element', value !== null && value !== undefined));
@@ -6870,7 +6863,11 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
6870
6863
  });
6871
6864
  };
6872
6865
  } else {
6873
- helper$1 = args => args.positional[0];
6866
+ helper$1 = args => {
6867
+ var arg = args.positional[0];
6868
+ (true && !(arg) && (0, _debug.assert)('expected at least one positional arg', arg));
6869
+ return arg;
6870
+ };
6874
6871
  }
6875
6872
 
6876
6873
  var inElementNullCheckHelper = internalHelper(helper$1);
@@ -6879,9 +6876,14 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
6879
6876
  positional
6880
6877
  } = _ref13;
6881
6878
  return (0, _reference.createComputeRef)(() => {
6882
- var classNameParts = (0, _reference.valueForRef)(positional[0]).split('.');
6879
+ var classNameArg = positional[0];
6880
+ var valueArg = positional[1];
6881
+ (true && !(classNameArg && valueArg) && (0, _debug.assert)('expected at least two positional args', classNameArg && valueArg));
6882
+ var classNameParts = (0, _reference.valueForRef)(classNameArg).split('.');
6883
6883
  var className = classNameParts[classNameParts.length - 1];
6884
- var value = (0, _reference.valueForRef)(positional[1]);
6884
+ (true && !(className) && (0, _debug.assert)('has className', className)); // Always at least one split result
6885
+
6886
+ var value = (0, _reference.valueForRef)(valueArg);
6885
6887
 
6886
6888
  if (value === true) {
6887
6889
  return (0, _string.dasherize)(className);
@@ -6903,7 +6905,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
6903
6905
  (true && !(owner) && (0, _debug.assert)('[BUG] missing owner', owner));
6904
6906
  (true && !(positional.length === 1) && (0, _debug.assert)(`[BUG] wrong number of positional arguments, expecting 1, got ${positional.length}`, positional.length === 1));
6905
6907
  var fullNameRef = positional[0];
6906
- (true && !((0, _reference.isConstRef)(fullNameRef)) && (0, _debug.assert)('[BUG] expecting a string literal as argument', (0, _reference.isConstRef)(fullNameRef)));
6908
+ (true && !(fullNameRef && (0, _reference.isConstRef)(fullNameRef)) && (0, _debug.assert)('[BUG] expecting a string literal as argument', fullNameRef && (0, _reference.isConstRef)(fullNameRef)));
6907
6909
  var fullName = (0, _reference.valueForRef)(fullNameRef);
6908
6910
  (true && !(typeof fullName === 'string') && (0, _debug.assert)('[BUG] expecting a string literal as argument', typeof fullName === 'string'));
6909
6911
  (true && !(fullName.split(':').length === 2) && (0, _debug.assert)('[BUG] expecting a valid full name', fullName.split(':').length === 2));
@@ -6932,6 +6934,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
6932
6934
  positional
6933
6935
  } = _ref15;
6934
6936
  var inner = positional[0];
6937
+ (true && !(inner) && (0, _debug.assert)('expected at least one positional arg', inner));
6935
6938
  return (0, _reference.createComputeRef)(() => {
6936
6939
  var iterable = (0, _reference.valueForRef)(inner);
6937
6940
 
@@ -7024,7 +7027,8 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
7024
7027
  var {
7025
7028
  positional
7026
7029
  } = _ref16;
7027
- var ref = positional[0]; // TODO: Improve this error message. This covers at least two distinct
7030
+ var ref = positional[0];
7031
+ (true && !(ref) && (0, _debug.assert)('expected at least one positional arg', ref)); // TODO: Improve this error message. This covers at least two distinct
7028
7032
  // cases:
7029
7033
  //
7030
7034
  // 1. (mut "not a path") – passing a literal, result from a helper
@@ -7160,7 +7164,9 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
7160
7164
  var {
7161
7165
  positional
7162
7166
  } = _ref17;
7163
- return (0, _reference.createReadOnlyRef)(positional[0]);
7167
+ var firstArg = positional[0];
7168
+ (true && !(firstArg) && (0, _debug.assert)('has first arg', firstArg));
7169
+ return (0, _reference.createReadOnlyRef)(firstArg);
7164
7170
  });
7165
7171
  /**
7166
7172
  @module ember
@@ -7200,7 +7206,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
7200
7206
  named
7201
7207
  } = _ref18;
7202
7208
  (true && !(positional.length === 1 && Object.keys(named).length === 0) && (0, _debug.assert)('unbound helper cannot be called with multiple params or hash params', positional.length === 1 && Object.keys(named).length === 0));
7203
- return (0, _reference.createUnboundRef)((0, _reference.valueForRef)(positional[0]), '(resurt of an `unbound` helper)');
7209
+ return (0, _reference.createUnboundRef)((0, _reference.valueForRef)(positional[0]), '(result of an `unbound` helper)');
7204
7210
  });
7205
7211
  var MODIFIERS = ['alt', 'shift', 'meta', 'ctrl'];
7206
7212
  var POINTER_EVENT_TYPE_REGEX = /^click|mouse|touch/;
@@ -7422,6 +7428,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
7422
7428
  positional
7423
7429
  } = actionState;
7424
7430
  var actionNameRef = positional[1];
7431
+ (true && !(actionNameRef) && (0, _debug.assert)('Expected at least one positional arg', actionNameRef));
7425
7432
 
7426
7433
  if (!(0, _reference.isInvokableRef)(actionNameRef)) {
7427
7434
  actionState.actionName = (0, _reference.valueForRef)(actionNameRef);
@@ -7719,7 +7726,9 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
7719
7726
  if (args.positional.length === 0) {
7720
7727
  nameRef = (0, _reference.createPrimitiveRef)('main');
7721
7728
  } else {
7722
- nameRef = args.positional[0];
7729
+ var maybeNameRef = args.positional[0];
7730
+ (true && !(maybeNameRef) && (0, _debug.assert)('Expected at least one positional arg', maybeNameRef));
7731
+ nameRef = maybeNameRef;
7723
7732
  }
7724
7733
 
7725
7734
  var outletRef = (0, _reference.createComputeRef)(() => {
@@ -8172,8 +8181,8 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
8172
8181
  }
8173
8182
 
8174
8183
  function loopBegin() {
8175
- for (var i = 0; i < renderers.length; i++) {
8176
- renderers[i]._scheduleRevalidate();
8184
+ for (var renderer of renderers) {
8185
+ renderer._scheduleRevalidate();
8177
8186
  }
8178
8187
  }
8179
8188
 
@@ -8218,12 +8227,12 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
8218
8227
  var loops = 0;
8219
8228
 
8220
8229
  function loopEnd() {
8221
- for (var i = 0; i < renderers.length; i++) {
8222
- if (!renderers[i]._isValid()) {
8230
+ for (var renderer of renderers) {
8231
+ if (!renderer._isValid()) {
8223
8232
  if (loops > _environment2.ENV._RERENDER_LOOP_LIMIT) {
8224
8233
  loops = 0; // TODO: do something better
8225
8234
 
8226
- renderers[i].destroy();
8235
+ renderer.destroy();
8227
8236
  throw new Error('infinite rendering invalidation detected');
8228
8237
  }
8229
8238
 
@@ -8350,6 +8359,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
8350
8359
 
8351
8360
  while (i--) {
8352
8361
  var root = roots[i];
8362
+ (true && !(root) && (0, _debug.assert)('has root', root));
8353
8363
 
8354
8364
  if (root.isFor(view)) {
8355
8365
  root.destroy();
@@ -8421,6 +8431,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
8421
8431
  // each root is processed
8422
8432
  for (var i = 0; i < roots.length; i++) {
8423
8433
  var root = roots[i];
8434
+ (true && !(root) && (0, _debug.assert)('has root', root));
8424
8435
 
8425
8436
  if (root.destroyed) {
8426
8437
  // add to the list of roots to be removed
@@ -8483,8 +8494,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
8483
8494
  _clearAllRoots() {
8484
8495
  var roots = this._roots;
8485
8496
 
8486
- for (var i = 0; i < roots.length; i++) {
8487
- var root = roots[i];
8497
+ for (var root of roots) {
8488
8498
  root.destroy();
8489
8499
  }
8490
8500
 
@@ -9205,7 +9215,8 @@ define("@ember/-internals/meta/lib/meta", ["exports", "@ember/-internals/utils",
9205
9215
  sync
9206
9216
  });
9207
9217
  } else {
9208
- var listener = listeners[i]; // If the listener is our own listener and we are trying to remove it, we
9218
+ var listener = listeners[i];
9219
+ (true && !(listener) && (0, _debug.assert)('has listener', listener)); // If the listener is our own listener and we are trying to remove it, we
9209
9220
  // want to splice it out entirely so we don't hold onto a reference.
9210
9221
 
9211
9222
  if (kind === 2
@@ -9304,8 +9315,7 @@ define("@ember/-internals/meta/lib/meta", ["exports", "@ember/-internals/utils",
9304
9315
  this._inheritedEnd = 0;
9305
9316
  }
9306
9317
 
9307
- for (var i = 0; i < parentListeners.length; i++) {
9308
- var listener = parentListeners[i];
9318
+ for (var listener of parentListeners) {
9309
9319
  var index = indexOfListener(listeners, listener.event, listener.target, listener.method);
9310
9320
 
9311
9321
  if (index === -1) {
@@ -9342,10 +9352,9 @@ define("@ember/-internals/meta/lib/meta", ["exports", "@ember/-internals/utils",
9342
9352
  }
9343
9353
 
9344
9354
  if (listeners !== undefined) {
9345
- for (var index = 0; index < listeners.length; index++) {
9346
- var listener = listeners[index]; // REMOVE listeners are placeholders that tell us not to
9355
+ for (var listener of listeners) {
9356
+ // REMOVE listeners are placeholders that tell us not to
9347
9357
  // inherit, so they never match. Only ADD and ONCE can match.
9348
-
9349
9358
  if (listener.event === eventName && (listener.kind === 0
9350
9359
  /* ADD */
9351
9360
  || listener.kind === 1
@@ -9380,10 +9389,9 @@ define("@ember/-internals/meta/lib/meta", ["exports", "@ember/-internals/utils",
9380
9389
  }
9381
9390
 
9382
9391
  if (listeners !== undefined) {
9383
- for (var index = 0; index < listeners.length; index++) {
9384
- var listener = listeners[index]; // REMOVE listeners are placeholders that tell us not to
9392
+ for (var listener of listeners) {
9393
+ // REMOVE listeners are placeholders that tell us not to
9385
9394
  // inherit, so they never match. Only ADD and ONCE can match.
9386
-
9387
9395
  if ((listener.kind === 0
9388
9396
  /* ADD */
9389
9397
  || listener.kind === 1
@@ -9520,6 +9528,7 @@ define("@ember/-internals/meta/lib/meta", ["exports", "@ember/-internals/utils",
9520
9528
  function indexOfListener(listeners, event, target, method) {
9521
9529
  for (var i = listeners.length - 1; i >= 0; i--) {
9522
9530
  var listener = listeners[i];
9531
+ (true && !(listener) && (0, _debug.assert)('has listener', listener));
9523
9532
 
9524
9533
  if (listener.event === event && listener.target === target && listener.method === method) {
9525
9534
  return i;
@@ -10366,8 +10375,7 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
10366
10375
  }
10367
10376
 
10368
10377
  if ((0, _utils.isObject)(value)) {
10369
- for (var i = 0; i < lazyTags.length; i++) {
10370
- var [tag, deps] = lazyTags[i];
10378
+ for (var [tag, deps] of lazyTags) {
10371
10379
  (0, _validator.updateTag)(tag, getChainTagsForKey(value, deps, (0, _validator.tagMetaFor)(value), (0, _meta2.peekMeta)(value)));
10372
10380
  }
10373
10381
  }
@@ -10378,8 +10386,8 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
10378
10386
  function getChainTagsForKeys(obj, keys, tagMeta, meta$$1) {
10379
10387
  var tags = [];
10380
10388
 
10381
- for (var i = 0; i < keys.length; i++) {
10382
- getChainTags(tags, obj, keys[i], tagMeta, meta$$1);
10389
+ for (var key of keys) {
10390
+ getChainTags(tags, obj, key, tagMeta, meta$$1);
10383
10391
  }
10384
10392
 
10385
10393
  return (0, _validator.combine)(tags);
@@ -11012,8 +11020,12 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
11012
11020
  args.push(property);
11013
11021
  }
11014
11022
 
11015
- for (var i = 0; i < arguments.length; i++) {
11016
- expandProperties(i < 0 || arguments.length <= i ? undefined : arguments[i], addArg);
11023
+ for (var _len2 = arguments.length, passedArgs = new Array(_len2), _key3 = 0; _key3 < _len2; _key3++) {
11024
+ passedArgs[_key3] = arguments[_key3];
11025
+ }
11026
+
11027
+ for (var arg of passedArgs) {
11028
+ expandProperties(arg, addArg);
11017
11029
  }
11018
11030
 
11019
11031
  this._dependentKeys = args;
@@ -11305,25 +11317,28 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
11305
11317
  }
11306
11318
 
11307
11319
  function computed() {
11308
- for (var _len2 = arguments.length, args = new Array(_len2), _key3 = 0; _key3 < _len2; _key3++) {
11309
- args[_key3] = arguments[_key3];
11320
+ for (var _len3 = arguments.length, args = new Array(_len3), _key4 = 0; _key4 < _len3; _key4++) {
11321
+ args[_key4] = arguments[_key4];
11310
11322
  }
11311
11323
 
11312
11324
  (true && !(!(isElementDescriptor(args.slice(0, 3)) && args.length === 5 && args[4] === true)) && (0, _debug.assert)(`@computed can only be used directly as a native decorator. If you're using tracked in classic classes, add parenthesis to call it like a function: computed()`, !(isElementDescriptor(args.slice(0, 3)) && args.length === 5 && args[4] === true)));
11313
11325
 
11314
11326
  if (isElementDescriptor(args)) {
11327
+ // SAFETY: We passed in the impl for this class
11315
11328
  var decorator = makeComputedDecorator(new ComputedProperty([]), ComputedDecoratorImpl);
11316
11329
  return decorator(args[0], args[1], args[2]);
11317
- }
11330
+ } // SAFETY: We passed in the impl for this class
11331
+
11318
11332
 
11319
11333
  return makeComputedDecorator(new ComputedProperty(args), ComputedDecoratorImpl);
11320
11334
  }
11321
11335
 
11322
11336
  function autoComputed() {
11323
- for (var _len3 = arguments.length, config = new Array(_len3), _key4 = 0; _key4 < _len3; _key4++) {
11324
- config[_key4] = arguments[_key4];
11337
+ for (var _len4 = arguments.length, config = new Array(_len4), _key5 = 0; _key5 < _len4; _key5++) {
11338
+ config[_key5] = arguments[_key5];
11325
11339
  }
11326
11340
 
11341
+ // SAFETY: We passed in the impl for this class
11327
11342
  return makeComputedDecorator(new AutoComputedProperty(config), ComputedDecoratorImpl);
11328
11343
  }
11329
11344
  /**
@@ -11551,12 +11566,12 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
11551
11566
  var obj = root;
11552
11567
  var parts = typeof path === 'string' ? path.split('.') : path;
11553
11568
 
11554
- for (var i = 0; i < parts.length; i++) {
11569
+ for (var part of parts) {
11555
11570
  if (obj === undefined || obj === null || obj.isDestroyed) {
11556
11571
  return undefined;
11557
11572
  }
11558
11573
 
11559
- obj = _getProp(obj, parts[i]);
11574
+ obj = _getProp(obj, part);
11560
11575
  }
11561
11576
 
11562
11577
  return obj;
@@ -11713,7 +11728,8 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
11713
11728
  }
11714
11729
 
11715
11730
  function alias(altKey) {
11716
- (true && !(!isElementDescriptor(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @alias as a decorator directly, but it requires a `altKey` parameter', !isElementDescriptor(Array.prototype.slice.call(arguments))));
11731
+ (true && !(!isElementDescriptor(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @alias as a decorator directly, but it requires a `altKey` parameter', !isElementDescriptor(Array.prototype.slice.call(arguments)))); // SAFETY: We passed in the impl for this class
11732
+
11717
11733
  return makeComputedDecorator(new AliasedProperty(altKey), AliasDecoratorImpl);
11718
11734
  } // TODO: This class can be svelted once `meta` has been deprecated
11719
11735
 
@@ -12057,11 +12073,10 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12057
12073
 
12058
12074
  _getLibraryByName(name) {
12059
12075
  var libs = this._registry;
12060
- var count = libs.length;
12061
12076
 
12062
- for (var i = 0; i < count; i++) {
12063
- if (libs[i].name === name) {
12064
- return libs[i];
12077
+ for (var lib of libs) {
12078
+ if (lib.name === name) {
12079
+ return lib;
12065
12080
  }
12066
12081
  }
12067
12082
 
@@ -12117,8 +12132,7 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12117
12132
  var maxNameLength = Math.max.apply(null, nameLengths);
12118
12133
  (0, _debug.debug)('-------------------------------');
12119
12134
 
12120
- for (var i = 0; i < libs.length; i++) {
12121
- var lib = libs[i];
12135
+ for (var lib of libs) {
12122
12136
  var spaces = new Array(maxNameLength - lib.name.length + 1).join(' ');
12123
12137
  (0, _debug.debug)([lib.name, spaces, ' : ', lib.version].join(''));
12124
12138
  }
@@ -12184,10 +12198,8 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12184
12198
 
12185
12199
  changeProperties(() => {
12186
12200
  var props = Object.keys(properties);
12187
- var propertyName;
12188
12201
 
12189
- for (var i = 0; i < props.length; i++) {
12190
- propertyName = props[i];
12202
+ for (var propertyName of props) {
12191
12203
  set(obj, propertyName, properties[propertyName]);
12192
12204
  }
12193
12205
  });
@@ -12239,9 +12251,8 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12239
12251
  var lookup = _environment.context.lookup;
12240
12252
  var keys = Object.keys(lookup);
12241
12253
 
12242
- for (var i = 0; i < keys.length; i++) {
12243
- var key = keys[i]; // Only process entities that start with uppercase A-Z
12244
-
12254
+ for (var key of keys) {
12255
+ // Only process entities that start with uppercase A-Z
12245
12256
  if (!isUppercase(key.charCodeAt(0))) {
12246
12257
  continue;
12247
12258
  }
@@ -12277,8 +12288,8 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12277
12288
  if (unprocessedNamespaces || unprocessedMixins) {
12278
12289
  var namespaces = NAMESPACES;
12279
12290
 
12280
- for (var i = 0; i < namespaces.length; i++) {
12281
- processNamespace(namespaces[i]);
12291
+ for (var namespace of namespaces) {
12292
+ processNamespace(namespace);
12282
12293
  }
12283
12294
 
12284
12295
  unprocessedMixins = false;
@@ -12358,10 +12369,7 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12358
12369
 
12359
12370
  function extractAccessors(properties) {
12360
12371
  if (properties !== undefined) {
12361
- var keys = Object.keys(properties);
12362
-
12363
- for (var i = 0; i < keys.length; i++) {
12364
- var key = keys[i];
12372
+ for (var key of Object.keys(properties)) {
12365
12373
  var desc = Object.getOwnPropertyDescriptor(properties, key);
12366
12374
 
12367
12375
  if (desc.get !== undefined || desc.set !== undefined) {
@@ -12443,7 +12451,8 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12443
12451
  }]);
12444
12452
  newProperty._readOnly = property._readOnly;
12445
12453
  newProperty._meta = property._meta;
12446
- newProperty.enumerable = property.enumerable;
12454
+ newProperty.enumerable = property.enumerable; // SAFETY: We passed in the impl for this class
12455
+
12447
12456
  return makeComputedDecorator(newProperty, ComputedProperty);
12448
12457
  }
12449
12458
 
@@ -12496,8 +12505,7 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12496
12505
  var hasFunction = false;
12497
12506
  var props = Object.keys(value);
12498
12507
 
12499
- for (var i = 0; i < props.length; i++) {
12500
- var prop = props[i];
12508
+ for (var prop of props) {
12501
12509
  var propValue = value[prop];
12502
12510
 
12503
12511
  if (typeof propValue === 'function') {
@@ -12560,8 +12568,7 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12560
12568
  var mergings = concatenatedMixinProperties('mergedProperties', props, values, base);
12561
12569
  var propKeys = Object.keys(props);
12562
12570
 
12563
- for (var i = 0; i < propKeys.length; i++) {
12564
- var key = propKeys[i];
12571
+ for (var key of propKeys) {
12565
12572
  var value = props[key];
12566
12573
  if (value === undefined) continue;
12567
12574
 
@@ -12624,16 +12631,16 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12624
12631
  if (observers !== undefined) {
12625
12632
  var updateObserver = add ? addObserver : removeObserver;
12626
12633
 
12627
- for (var i = 0; i < observers.paths.length; i++) {
12628
- updateObserver(obj, observers.paths[i], null, key, observers.sync);
12634
+ for (var path of observers.paths) {
12635
+ updateObserver(obj, path, null, key, observers.sync);
12629
12636
  }
12630
12637
  }
12631
12638
 
12632
12639
  if (listeners !== undefined) {
12633
12640
  var updateListener = add ? addListener : removeListener;
12634
12641
 
12635
- for (var _i = 0; _i < listeners.length; _i++) {
12636
- updateListener(obj, listeners[_i], null, key);
12642
+ for (var listener of listeners) {
12643
+ updateListener(obj, listener, null, key);
12637
12644
  }
12638
12645
  }
12639
12646
  }
@@ -12658,8 +12665,7 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12658
12665
 
12659
12666
  mergeMixins(mixins, meta$$1, descs, values, obj, keys, keysWithSuper);
12660
12667
 
12661
- for (var i = 0; i < keys.length; i++) {
12662
- var key = keys[i];
12668
+ for (var key of keys) {
12663
12669
  var value = values[key];
12664
12670
  var desc = descs[key];
12665
12671
 
@@ -12690,8 +12696,8 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12690
12696
 
12691
12697
 
12692
12698
  function mixin(obj) {
12693
- for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key5 = 1; _key5 < _len4; _key5++) {
12694
- args[_key5 - 1] = arguments[_key5];
12699
+ for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key6 = 1; _key6 < _len5; _key6++) {
12700
+ args[_key6 - 1] = arguments[_key6];
12695
12701
  }
12696
12702
 
12697
12703
  applyMixin(obj, args);
@@ -12823,8 +12829,8 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12823
12829
  setUnprocessedMixins();
12824
12830
  var M = this;
12825
12831
 
12826
- for (var _len5 = arguments.length, args = new Array(_len5), _key6 = 0; _key6 < _len5; _key6++) {
12827
- args[_key6] = arguments[_key6];
12832
+ for (var _len6 = arguments.length, args = new Array(_len6), _key7 = 0; _key7 < _len6; _key7++) {
12833
+ args[_key7] = arguments[_key7];
12828
12834
  }
12829
12835
 
12830
12836
  return new M(args, undefined);
@@ -12859,8 +12865,8 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12859
12865
 
12860
12866
 
12861
12867
  reopen() {
12862
- for (var _len6 = arguments.length, args = new Array(_len6), _key7 = 0; _key7 < _len6; _key7++) {
12863
- args[_key7] = arguments[_key7];
12868
+ for (var _len7 = arguments.length, args = new Array(_len7), _key8 = 0; _key8 < _len7; _key8++) {
12869
+ args[_key8] = arguments[_key8];
12864
12870
  }
12865
12871
 
12866
12872
  if (args.length === 0) {
@@ -12937,8 +12943,8 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
12937
12943
  without() {
12938
12944
  var ret = new Mixin([this]);
12939
12945
 
12940
- for (var _len7 = arguments.length, args = new Array(_len7), _key8 = 0; _key8 < _len7; _key8++) {
12941
- args[_key8] = arguments[_key8];
12946
+ for (var _len8 = arguments.length, args = new Array(_len8), _key9 = 0; _key9 < _len8; _key9++) {
12947
+ args[_key9] = arguments[_key9];
12942
12948
  }
12943
12949
 
12944
12950
  ret._without = args;
@@ -13079,8 +13085,8 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
13079
13085
 
13080
13086
 
13081
13087
  function observer() {
13082
- for (var _len8 = arguments.length, args = new Array(_len8), _key9 = 0; _key9 < _len8; _key9++) {
13083
- args[_key9] = arguments[_key9];
13088
+ for (var _len9 = arguments.length, args = new Array(_len9), _key10 = 0; _key10 < _len9; _key10++) {
13089
+ args[_key10] = arguments[_key10];
13084
13090
  }
13085
13091
 
13086
13092
  var funcOrDef = args.pop();
@@ -13104,8 +13110,8 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
13104
13110
  (true && !(typeof sync === 'boolean') && (0, _debug.assert)('observer called without sync', typeof sync === 'boolean'));
13105
13111
  var paths = [];
13106
13112
 
13107
- for (var i = 0; i < dependentKeys.length; ++i) {
13108
- expandProperties(dependentKeys[i], path => paths.push(path));
13113
+ for (var dependentKey of dependentKeys) {
13114
+ expandProperties(dependentKey, path => paths.push(path));
13109
13115
  }
13110
13116
 
13111
13117
  (0, _utils.setObservers)(func, {
@@ -13126,13 +13132,18 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
13126
13132
 
13127
13133
  function inject(type) {
13128
13134
  (true && !(typeof type === 'string') && (0, _debug.assert)('a string type must be provided to inject', typeof type === 'string'));
13135
+ var elementDescriptor;
13136
+ var name;
13129
13137
 
13130
- for (var _len9 = arguments.length, args = new Array(_len9 > 1 ? _len9 - 1 : 0), _key10 = 1; _key10 < _len9; _key10++) {
13131
- args[_key10 - 1] = arguments[_key10];
13138
+ for (var _len10 = arguments.length, args = new Array(_len10 > 1 ? _len10 - 1 : 0), _key11 = 1; _key11 < _len10; _key11++) {
13139
+ args[_key11 - 1] = arguments[_key11];
13132
13140
  }
13133
13141
 
13134
- var calledAsDecorator = isElementDescriptor(args);
13135
- var name = calledAsDecorator ? undefined : args[0];
13142
+ if (isElementDescriptor(args)) {
13143
+ elementDescriptor = args;
13144
+ } else if (typeof args[0] === 'string') {
13145
+ name = args[0];
13146
+ }
13136
13147
 
13137
13148
  var getInjection = function (propertyName) {
13138
13149
  var owner = (0, _owner.getOwner)(this) || this.container; // fallback to `container` for backwards compat
@@ -13159,16 +13170,16 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
13159
13170
 
13160
13171
  });
13161
13172
 
13162
- if (calledAsDecorator) {
13163
- return decorator(args[0], args[1], args[2]);
13173
+ if (elementDescriptor) {
13174
+ return decorator(elementDescriptor[0], elementDescriptor[1], elementDescriptor[2]);
13164
13175
  } else {
13165
13176
  return decorator;
13166
13177
  }
13167
13178
  }
13168
13179
 
13169
13180
  function tracked() {
13170
- for (var _len10 = arguments.length, args = new Array(_len10), _key11 = 0; _key11 < _len10; _key11++) {
13171
- args[_key11] = arguments[_key11];
13181
+ for (var _len11 = arguments.length, args = new Array(_len11), _key12 = 0; _key12 < _len11; _key12++) {
13182
+ args[_key12] = arguments[_key12];
13172
13183
  }
13173
13184
 
13174
13185
  (true && !(!(isElementDescriptor(args.slice(0, 3)) && args.length === 5 && args[4] === true)) && (0, _debug.assert)(`@tracked can only be used directly as a native decorator. If you're using tracked in classic classes, add parenthesis to call it like a function: tracked()`, !(isElementDescriptor(args.slice(0, 3)) && args.length === 5 && args[4] === true)));
@@ -13269,8 +13280,8 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
13269
13280
 
13270
13281
  var cached = function () {
13271
13282
  {
13272
- for (var _len11 = arguments.length, args = new Array(_len11), _key12 = 0; _key12 < _len11; _key12++) {
13273
- args[_key12] = arguments[_key12];
13283
+ for (var _len12 = arguments.length, args = new Array(_len12), _key13 = 0; _key13 < _len12; _key13++) {
13284
+ args[_key13] = arguments[_key13];
13274
13285
  }
13275
13286
 
13276
13287
  var [target, key, descriptor] = args; // Error on `@cached()`, `@cached(...args)`, and `@cached propName = value;`
@@ -13767,16 +13778,16 @@ define("@ember/-internals/routing/lib/ext/controller", ["exports", "@ember/-inte
13767
13778
  aController.transitionToRoute({ queryParams: { sort: 'date' } });
13768
13779
  ```
13769
13780
  See also [replaceRoute](/ember/release/classes/Ember.ControllerMixin/methods/replaceRoute?anchor=replaceRoute).
13770
- @param {String} name the name of the route or a URL
13781
+ @for Ember.ControllerMixin
13782
+ @method transitionToRoute
13783
+ @deprecated Use transitionTo from the Router service instead.
13784
+ @param {String} [name] the name of the route or a URL
13771
13785
  @param {...Object} models the model(s) or identifier(s) to be used
13772
13786
  while transitioning to the route.
13773
13787
  @param {Object} [options] optional hash with a queryParams property
13774
13788
  containing a mapping of query parameters
13775
- @for Ember.ControllerMixin
13776
- @method transitionToRoute
13777
13789
  @return {Transition} the transition object associated with this
13778
13790
  attempted transition
13779
- @deprecated Use transitionTo from the Router service instead.
13780
13791
  @public
13781
13792
  */
13782
13793
  transitionToRoute() {
@@ -13836,14 +13847,16 @@ define("@ember/-internals/routing/lib/ext/controller", ["exports", "@ember/-inte
13836
13847
  aController.replaceRoute('/');
13837
13848
  aController.replaceRoute('/blog/post/1/comment/13');
13838
13849
  ```
13839
- @param {String} name the name of the route or a URL
13850
+ @for Ember.ControllerMixin
13851
+ @method replaceRoute
13852
+ @deprecated Use replaceWith from the Router service instead.
13853
+ @param {String} [name] the name of the route or a URL
13840
13854
  @param {...Object} models the model(s) or identifier(s) to be used
13841
13855
  while transitioning to the route.
13842
- @for Ember.ControllerMixin
13843
- @method replaceRoute
13856
+ @param {Object} [options] optional hash with a queryParams property
13857
+ containing a mapping of query parameters
13844
13858
  @return {Transition} the transition object associated with this
13845
13859
  attempted transition
13846
- @deprecated Use replaceWith from the Router service instead.
13847
13860
  @public
13848
13861
  */
13849
13862
  replaceRoute() {
@@ -14970,6 +14983,17 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
14970
14983
  value: true
14971
14984
  });
14972
14985
  _exports.default = void 0;
14986
+
14987
+ var __decorate = void 0 && (void 0).__decorate || function (decorators, target, key, desc) {
14988
+ var c = arguments.length,
14989
+ r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
14990
+ d;
14991
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
14992
+ if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
14993
+ }
14994
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
14995
+ };
14996
+
14973
14997
  var ROUTER = (0, _utils.symbol)('ROUTER');
14974
14998
 
14975
14999
  function cleanURL(url, rootURL) {
@@ -14979,40 +15003,106 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
14979
15003
 
14980
15004
  return url.substr(rootURL.length, url.length);
14981
15005
  }
14982
- /**
14983
- The Router service is the public API that provides access to the router.
14984
-
14985
- The immediate benefit of the Router service is that you can inject it into components,
14986
- giving them a friendly way to initiate transitions and ask questions about the current
14987
- global router state.
14988
-
14989
- In this example, the Router service is injected into a component to initiate a transition
14990
- to a dedicated route:
14991
-
14992
- ```app/components/example.js
14993
- import Component from '@glimmer/component';
14994
- import { action } from '@ember/object';
14995
- import { service } from '@ember/service';
14996
-
14997
- export default class ExampleComponent extends Component {
14998
- @service router;
14999
-
15000
- @action
15001
- next() {
15002
- this.router.transitionTo('other.route');
15003
- }
15004
- }
15005
- ```
15006
-
15007
- Like any service, it can also be injected into helpers, routes, etc.
15008
-
15009
- @public
15010
- @extends Service
15011
- @class RouterService
15012
- */
15013
15006
 
15007
+ class RouterService extends _service.default.extend(_runtime.Evented) {
15008
+ constructor() {
15009
+ super(...arguments);
15010
+ /**
15011
+ The `routeWillChange` event is fired at the beginning of any
15012
+ attempted transition with a `Transition` object as the sole
15013
+ argument. This action can be used for aborting, redirecting,
15014
+ or decorating the transition from the currently active routes.
15015
+ A good example is preventing navigation when a form is
15016
+ half-filled out:
15017
+ ```app/routes/contact-form.js
15018
+ import Route from '@ember/routing';
15019
+ import { service } from '@ember/service';
15020
+ export default class extends Route {
15021
+ @service router;
15022
+ constructor() {
15023
+ super(...arguments);
15024
+ this.router.on('routeWillChange', (transition) => {
15025
+ if (!transition.to.find(route => route.name === this.routeName)) {
15026
+ alert("Please save or cancel your changes.");
15027
+ transition.abort();
15028
+ }
15029
+ })
15030
+ }
15031
+ }
15032
+ ```
15033
+ The `routeWillChange` event fires whenever a new route is chosen as the desired target of a transition. This includes `transitionTo`, `replaceWith`, all redirection for any reason including error handling, and abort. Aborting implies changing the desired target back to where you already were. Once a transition has completed, `routeDidChange` fires.
15034
+ @event routeWillChange
15035
+ @param {Transition} transition
15036
+ @public
15037
+ */
15038
+
15039
+ /**
15040
+ The `routeDidChange` event only fires once a transition has settled.
15041
+ This includes aborts and error substates. Like the `routeWillChange` event
15042
+ it receives a Transition as the sole argument.
15043
+ A good example is sending some analytics when the route has transitioned:
15044
+ ```app/routes/contact-form.js
15045
+ import Route from '@ember/routing';
15046
+ import { service } from '@ember/service';
15047
+ export default class extends Route {
15048
+ @service router;
15049
+ constructor() {
15050
+ super(...arguments);
15051
+ this.router.on('routeDidChange', (transition) => {
15052
+ ga.send('pageView', {
15053
+ current: transition.to.name,
15054
+ from: transition.from.name
15055
+ });
15056
+ })
15057
+ }
15058
+ }
15059
+ ```
15060
+ `routeDidChange` will be called after any `Route`'s
15061
+ [didTransition](/ember/release/classes/Route/events/didTransition?anchor=didTransition)
15062
+ action has been fired.
15063
+ The updates of properties
15064
+ [currentURL](/ember/release/classes/RouterService/properties/currentURL?anchor=currentURL),
15065
+ [currentRouteName](/ember/release/classes/RouterService/properties/currentURL?anchor=currentRouteName)
15066
+ and
15067
+ [currentRoute](/ember/release/classes/RouterService/properties/currentURL?anchor=currentRoute)
15068
+ are completed at the time `routeDidChange` is called.
15069
+ @event routeDidChange
15070
+ @param {Transition} transition
15071
+ @public
15072
+ */
15073
+ // Canary features
15074
+
15075
+ /**
15076
+ * Refreshes all currently active routes, doing a full transition.
15077
+ * If a route name is provided and refers to a currently active route,
15078
+ * it will refresh only that route and its descendents.
15079
+ * Returns a promise that will be resolved once the refresh is complete.
15080
+ * All resetController, beforeModel, model, afterModel, redirect, and setupController
15081
+ * hooks will be called again. You will get new data from the model hook.
15082
+ *
15083
+ * @method refresh
15084
+ * @param {String} [routeName] the route to refresh (along with all child routes)
15085
+ * @return Transition
15086
+ * @category EMBER_ROUTING_ROUTER_SERVICE_REFRESH
15087
+ * @public
15088
+ */
15089
+
15090
+ this.refresh = true
15091
+ /* EMBER_ROUTING_ROUTER_SERVICE_REFRESH */
15092
+ ? function (pivotRouteName) {
15093
+ if (!pivotRouteName) {
15094
+ return this._router._routerMicrolib.refresh();
15095
+ }
15096
+
15097
+ (true && !(this._router.hasRoute(pivotRouteName)) && (0, _debug.assert)(`The route "${pivotRouteName}" was not found`, this._router.hasRoute(pivotRouteName)));
15098
+ (true && !(this.isActive(pivotRouteName)) && (0, _debug.assert)(`The route "${pivotRouteName}" is currently not active`, this.isActive(pivotRouteName)));
15099
+ var owner = (0, _owner.getOwner)(this);
15100
+ (true && !(owner) && (0, _debug.assert)('RouterService is unexpectedly missing an owner', owner));
15101
+ var pivotRoute = owner.lookup(`route:${pivotRouteName}`);
15102
+ return this._router._routerMicrolib.refresh(pivotRoute);
15103
+ } : undefined;
15104
+ }
15014
15105
 
15015
- class RouterService extends _service.default {
15016
15106
  get _router() {
15017
15107
  var router = this[ROUTER];
15018
15108
 
@@ -15027,9 +15117,48 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
15027
15117
  }
15028
15118
 
15029
15119
  willDestroy() {
15030
- super.willDestroy(...arguments);
15120
+ super.willDestroy();
15031
15121
  this[ROUTER] = null;
15032
15122
  }
15123
+ /**
15124
+ Transition the application into another route. The route may
15125
+ be either a single route or route path:
15126
+ Calling `transitionTo` from the Router service will cause default query parameter values to be included in the URL.
15127
+ This behavior is different from calling `transitionTo` on a route or `transitionToRoute` on a controller.
15128
+ See the [Router Service RFC](https://github.com/emberjs/rfcs/blob/master/text/0095-router-service.md#query-parameter-semantics) for more info.
15129
+ In the following example we use the Router service to navigate to a route with a
15130
+ specific model from a Component in the first action, and in the second we trigger
15131
+ a query-params only transition.
15132
+ ```app/components/example.js
15133
+ import Component from '@glimmer/component';
15134
+ import { action } from '@ember/object';
15135
+ import { service } from '@ember/service';
15136
+ export default class extends Component {
15137
+ @service router;
15138
+ @action
15139
+ goToComments(post) {
15140
+ this.router.transitionTo('comments', post);
15141
+ }
15142
+ @action
15143
+ fetchMoreComments(latestComment) {
15144
+ this.router.transitionTo({
15145
+ queryParams: { commentsAfter: latestComment }
15146
+ });
15147
+ }
15148
+ }
15149
+ ```
15150
+ @method transitionTo
15151
+ @param {String} [routeNameOrUrl] the name of the route or a URL
15152
+ @param {...Object} [models] the model(s) or identifier(s) to be used while
15153
+ transitioning to the route.
15154
+ @param {Object} [options] optional hash with a queryParams property
15155
+ containing a mapping of query parameters. May be supplied as the only
15156
+ parameter to trigger a query-parameter-only transition.
15157
+ @return {Transition} the transition object associated with this
15158
+ attempted transition
15159
+ @public
15160
+ */
15161
+
15033
15162
 
15034
15163
  transitionTo() {
15035
15164
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
@@ -15050,7 +15179,6 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
15050
15179
 
15051
15180
  var transition = this._router._doTransition(routeName, models, queryParams, true);
15052
15181
 
15053
- transition['_keepDefaultQueryParamValues'] = true;
15054
15182
  return transition;
15055
15183
  }
15056
15184
  /**
@@ -15059,7 +15187,6 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
15059
15187
  When the user clicks the "back" button in the browser, there will be fewer steps.
15060
15188
  This is most commonly used to manage redirects in a way that does not cause confusing additions
15061
15189
  to the user's browsing history.
15062
- See [replaceWith](/ember/release/classes/Route/methods/replaceWith?anchor=replaceWith) for more info.
15063
15190
  Calling `replaceWith` from the Router service will cause default query parameter values to be included in the URL.
15064
15191
  This behavior is different from calling `replaceWith` on a route.
15065
15192
  See the [Router Service RFC](https://github.com/emberjs/rfcs/blob/master/text/0095-router-service.md#query-parameter-semantics) for more info.
@@ -15140,8 +15267,7 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
15140
15267
  ```
15141
15268
  @method urlFor
15142
15269
  @param {String} routeName the name of the route
15143
- @param {...Object} models the model(s) or identifier(s) to be used while
15144
- transitioning to the route.
15270
+ @param {...Object} models the model(s) for the route.
15145
15271
  @param {Object} [options] optional hash with a queryParams property
15146
15272
  containing a mapping of query parameters
15147
15273
  @return {String} the string representing the generated URL
@@ -15231,19 +15357,26 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
15231
15357
  var hasQueryParams = Object.keys(queryParams).length > 0;
15232
15358
 
15233
15359
  if (hasQueryParams) {
15234
- queryParams = Object.assign({}, queryParams);
15235
-
15236
- this._router._prepareQueryParams( // UNSAFE: casting `routeName as string` here encodes the existing
15360
+ // UNSAFE: casting `routeName as string` here encodes the existing
15237
15361
  // assumption but may be wrong: `extractRouteArgs` correctly returns it
15238
15362
  // as `string | undefined`. There may be bugs if `_prepareQueryParams`
15239
15363
  // does not correctly account for `undefined` values for `routeName`.
15240
15364
  // Spoilers: under the hood this currently uses router.js APIs which
15241
15365
  // *do not* account for this being `undefined`.
15242
- routeName, models, queryParams, true
15366
+ var targetRouteName = routeName;
15367
+ queryParams = Object.assign({}, queryParams);
15368
+
15369
+ this._router._prepareQueryParams(targetRouteName, models, queryParams, true
15243
15370
  /* fromRouterService */
15244
15371
  );
15245
15372
 
15246
- return (0, _utils2.shallowEqual)(queryParams, routerMicrolib.state.queryParams);
15373
+ var currentQueryParams = Object.assign({}, routerMicrolib.state.queryParams);
15374
+
15375
+ this._router._prepareQueryParams(targetRouteName, models, currentQueryParams, true
15376
+ /* fromRouterService */
15377
+ );
15378
+
15379
+ return (0, _utils2.shallowEqual)(queryParams, currentQueryParams);
15247
15380
  }
15248
15381
 
15249
15382
  return true;
@@ -15270,6 +15403,7 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
15270
15403
  ```
15271
15404
  @method recognize
15272
15405
  @param {String} url
15406
+ @return {RouteInfo | null}
15273
15407
  @public
15274
15408
  */
15275
15409
 
@@ -15290,6 +15424,7 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
15290
15424
  the browser including the app's `rootURL`.
15291
15425
  @method recognizeAndLoad
15292
15426
  @param {String} url
15427
+ @return {RouteInfo}
15293
15428
  @public
15294
15429
  */
15295
15430
 
@@ -15307,168 +15442,15 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
15307
15442
 
15308
15443
  _exports.default = RouterService;
15309
15444
 
15310
- if (true
15311
- /* EMBER_ROUTING_ROUTER_SERVICE_REFRESH */
15312
- ) {
15313
- RouterService.reopen({
15314
- /**
15315
- * Refreshes all currently active routes, doing a full transition.
15316
- * If a route name is provided and refers to a currently active route,
15317
- * it will refresh only that route and its descendents.
15318
- * Returns a promise that will be resolved once the refresh is complete.
15319
- * All resetController, beforeModel, model, afterModel, redirect, and setupController
15320
- * hooks will be called again. You will get new data from the model hook.
15321
- *
15322
- * @method refresh
15323
- * @param {String} [routeName] the route to refresh (along with all child routes)
15324
- * @return Transition
15325
- * @category EMBER_ROUTING_ROUTER_SERVICE_REFRESH
15326
- * @public
15327
- */
15328
- refresh(pivotRouteName) {
15329
- if (!pivotRouteName) {
15330
- return this._router._routerMicrolib.refresh();
15331
- }
15332
-
15333
- (true && !(this._router.hasRoute(pivotRouteName)) && (0, _debug.assert)(`The route "${pivotRouteName}" was not found`, this._router.hasRoute(pivotRouteName)));
15334
- (true && !(this.isActive(pivotRouteName)) && (0, _debug.assert)(`The route "${pivotRouteName}" is currently not active`, this.isActive(pivotRouteName)));
15335
- var owner = (0, _owner.getOwner)(this);
15336
- (true && !(owner) && (0, _debug.assert)('RouterService is unexpectedly missing an owner', owner));
15337
- var pivotRoute = owner.lookup(`route:${pivotRouteName}`);
15338
- return this._router._routerMicrolib.refresh(pivotRoute);
15339
- }
15445
+ __decorate([(0, _computed.readOnly)('_router.currentRouteName')], RouterService.prototype, "currentRouteName", void 0);
15340
15446
 
15341
- });
15342
- }
15447
+ __decorate([(0, _computed.readOnly)('_router.currentURL')], RouterService.prototype, "currentURL", void 0);
15343
15448
 
15344
- RouterService.reopen(_runtime.Evented, {
15345
- /**
15346
- Name of the current route.
15347
- This property represents the logical name of the route,
15348
- which is comma separated.
15349
- For the following router:
15350
- ```app/router.js
15351
- Router.map(function() {
15352
- this.route('about');
15353
- this.route('blog', function () {
15354
- this.route('post', { path: ':post_id' });
15355
- });
15356
- });
15357
- ```
15358
- It will return:
15359
- * `index` when you visit `/`
15360
- * `about` when you visit `/about`
15361
- * `blog.index` when you visit `/blog`
15362
- * `blog.post` when you visit `/blog/some-post-id`
15363
- @property currentRouteName
15364
- @type String
15365
- @public
15366
- */
15367
- currentRouteName: (0, _computed.readOnly)('_router.currentRouteName'),
15368
-
15369
- /**
15370
- Current URL for the application.
15371
- This property represents the URL path for this route.
15372
- For the following router:
15373
- ```app/router.js
15374
- Router.map(function() {
15375
- this.route('about');
15376
- this.route('blog', function () {
15377
- this.route('post', { path: ':post_id' });
15378
- });
15379
- });
15380
- ```
15381
- It will return:
15382
- * `/` when you visit `/`
15383
- * `/about` when you visit `/about`
15384
- * `/blog` when you visit `/blog`
15385
- * `/blog/some-post-id` when you visit `/blog/some-post-id`
15386
- @property currentURL
15387
- @type String
15388
- @public
15389
- */
15390
- currentURL: (0, _computed.readOnly)('_router.currentURL'),
15391
-
15392
- /**
15393
- The `location` property returns what implementation of the `location` API
15394
- your application is using, which determines what type of URL is being used.
15395
- See [Location](/ember/release/classes/Location) for more information.
15396
- To force a particular `location` API implementation to be used in your
15397
- application you can set a location type on your `config/environment`.
15398
- For example, to set the `history` type:
15399
- ```config/environment.js
15400
- 'use strict';
15401
- module.exports = function(environment) {
15402
- let ENV = {
15403
- modulePrefix: 'router-service',
15404
- environment,
15405
- rootURL: '/',
15406
- locationType: 'history',
15407
- ...
15408
- }
15409
- }
15410
- ```
15411
- The following location types are available by default:
15412
- `auto`, `hash`, `history`, `none`.
15413
- See [HashLocation](/ember/release/classes/HashLocation).
15414
- See [HistoryLocation](/ember/release/classes/HistoryLocation).
15415
- See [NoneLocation](/ember/release/classes/NoneLocation).
15416
- See [AutoLocation](/ember/release/classes/AutoLocation).
15417
- @property location
15418
- @default 'hash'
15419
- @see {Location}
15420
- @public
15421
- */
15422
- location: (0, _computed.readOnly)('_router.location'),
15449
+ __decorate([(0, _computed.readOnly)('_router.location')], RouterService.prototype, "location", void 0);
15423
15450
 
15424
- /**
15425
- The `rootURL` property represents the URL of the root of
15426
- the application, '/' by default.
15427
- This prefix is assumed on all routes defined on this app.
15428
- If you change the `rootURL` in your environment configuration
15429
- like so:
15430
- ```config/environment.js
15431
- 'use strict';
15432
- module.exports = function(environment) {
15433
- let ENV = {
15434
- modulePrefix: 'router-service',
15435
- environment,
15436
- rootURL: '/my-root',
15437
-
15438
- }
15439
- ]
15440
- ```
15441
- This property will return `/my-root`.
15442
- @property rootURL
15443
- @default '/'
15444
- @public
15445
- */
15446
- rootURL: (0, _computed.readOnly)('_router.rootURL'),
15451
+ __decorate([(0, _computed.readOnly)('_router.rootURL')], RouterService.prototype, "rootURL", void 0);
15447
15452
 
15448
- /**
15449
- The `currentRoute` property contains metadata about the current leaf route.
15450
- It returns a `RouteInfo` object that has information like the route name,
15451
- params, query params and more.
15452
- See [RouteInfo](/ember/release/classes/RouteInfo) for more info.
15453
- This property is guaranteed to change whenever a route transition
15454
- happens (even when that transition only changes parameters
15455
- and doesn't change the active route).
15456
- Usage example:
15457
- ```app/components/header.js
15458
- import Component from '@glimmer/component';
15459
- import { service } from '@ember/service';
15460
- import { notEmpty } from '@ember/object/computed';
15461
- export default class extends Component {
15462
- @service router;
15463
- @notEmpty('router.currentRoute.child') isChildRoute;
15464
- });
15465
- ```
15466
- @property currentRoute
15467
- @type RouteInfo
15468
- @public
15469
- */
15470
- currentRoute: (0, _computed.readOnly)('_router.currentRoute')
15471
- });
15453
+ __decorate([(0, _computed.readOnly)('_router.currentRoute')], RouterService.prototype, "currentRoute", void 0);
15472
15454
  });
15473
15455
  define("@ember/-internals/routing/lib/services/routing", ["exports", "@ember/-internals/owner", "@ember/-internals/utils", "@ember/debug", "@ember/object/computed", "@ember/service"], function (_exports, _owner, _utils, _debug, _computed, _service) {
15474
15456
  "use strict";
@@ -16010,232 +15992,12 @@ define("@ember/-internals/routing/lib/system/query_params", ["exports"], functio
16010
15992
 
16011
15993
  _exports.default = QueryParams;
16012
15994
  });
16013
- define("@ember/-internals/routing/lib/system/route-info", [], function () {
15995
+ define("@ember/-internals/routing/lib/system/route-info", ["exports"], function (_exports) {
16014
15996
  "use strict";
16015
- /**
16016
- A `RouteInfoWithAttributes` is an object that contains
16017
- metadata, including the resolved value from the routes
16018
- `model` hook. Like `RouteInfo`, a `RouteInfoWithAttributes`
16019
- represents a specific route within a Transition.
16020
- It is read-only and internally immutable. It is also not
16021
- observable, because a Transition instance is never
16022
- changed after creation.
16023
-
16024
- @class RouteInfoWithAttributes
16025
- @public
16026
- */
16027
15997
 
16028
- /**
16029
- The dot-separated, fully-qualified name of the
16030
- route, like "people.index".
16031
- @property {String} name
16032
- @public
16033
- */
16034
-
16035
- /**
16036
- The final segment of the fully-qualified name of
16037
- the route, like "index"
16038
- @property {String} localName
16039
- @public
16040
- */
16041
-
16042
- /**
16043
- The values of the route's parameters. These are the
16044
- same params that are received as arguments to the
16045
- route's model hook. Contains only the parameters
16046
- valid for this route, if any (params for parent or
16047
- child routes are not merged).
16048
- @property {Object} params
16049
- @public
16050
- */
16051
-
16052
- /**
16053
- The ordered list of the names of the params
16054
- required for this route. It will contain the same
16055
- strings as `Object.keys(params)`, but here the order
16056
- is significant. This allows users to correctly pass
16057
- params into routes programmatically.
16058
- @property {Array} paramNames
16059
- @public
16060
- */
16061
-
16062
- /**
16063
- The values of any queryParams on this route.
16064
- @property {Object} queryParams
16065
- @public
16066
- */
16067
-
16068
- /**
16069
- This is the resolved return value from the
16070
- route's model hook.
16071
- @property {Object|Array|String} attributes
16072
- @public
16073
- */
16074
-
16075
- /**
16076
- Will contain the result `Route#buildRouteInfoMetadata`
16077
- for the corresponding Route.
16078
- @property {Any} metadata
16079
- @public
16080
- */
16081
-
16082
- /**
16083
- A reference to the parent route's RouteInfo.
16084
- This can be used to traverse upward to the topmost
16085
- `RouteInfo`.
16086
- @property {RouteInfo|null} parent
16087
- @public
16088
- */
16089
-
16090
- /**
16091
- A reference to the child route's RouteInfo.
16092
- This can be used to traverse downward to the
16093
- leafmost `RouteInfo`.
16094
- @property {RouteInfo|null} child
16095
- @public
16096
- */
16097
-
16098
- /**
16099
- Allows you to traverse through the linked list
16100
- of `RouteInfo`s from the topmost to leafmost.
16101
- Returns the first `RouteInfo` in the linked list
16102
- for which the callback returns true.
16103
-
16104
- This method is similar to the `find()` method
16105
- defined in ECMAScript 2015.
16106
-
16107
- The callback method you provide should have the
16108
- following signature (all parameters are optional):
16109
-
16110
- ```javascript
16111
- function(item, index, array);
16112
- ```
16113
-
16114
- - `item` is the current item in the iteration.
16115
- - `index` is the current index in the iteration.
16116
- - `array` is the array itself.
16117
-
16118
- It should return the `true` to include the item in
16119
- the results, `false` otherwise.
16120
-
16121
- Note that in addition to a callback, you can also
16122
- pass an optional target object that will be set as
16123
- `this` on the context.
16124
-
16125
- @method find
16126
- @param {Function} callback the callback to execute
16127
- @param {Object} [target*] optional target to use
16128
- @returns {Object} Found item or undefined
16129
- @public
16130
- */
16131
-
16132
- /**
16133
- A RouteInfo is an object that contains metadata
16134
- about a specific route within a Transition. It is
16135
- read-only and internally immutable. It is also not
16136
- observable, because a Transition instance is never
16137
- changed after creation.
16138
-
16139
- @class RouteInfo
16140
- @public
16141
- */
16142
-
16143
- /**
16144
- The dot-separated, fully-qualified name of the
16145
- route, like "people.index".
16146
- @property {String} name
16147
- @public
16148
- */
16149
-
16150
- /**
16151
- The final segment of the fully-qualified name of
16152
- the route, like "index"
16153
- @property {String} localName
16154
- @public
16155
- */
16156
-
16157
- /**
16158
- The values of the route's parameters. These are the
16159
- same params that are received as arguments to the
16160
- route's `model` hook. Contains only the parameters
16161
- valid for this route, if any (params for parent or
16162
- child routes are not merged).
16163
- @property {Object} params
16164
- @public
16165
- */
16166
-
16167
- /**
16168
- The ordered list of the names of the params
16169
- required for this route. It will contain the same
16170
- strings as Object.keys(params), but here the order
16171
- is significant. This allows users to correctly pass
16172
- params into routes programmatically.
16173
- @property {Array} paramNames
16174
- @public
16175
- */
16176
-
16177
- /**
16178
- The values of any queryParams on this route.
16179
- @property {Object} queryParams
16180
- @public
16181
- */
16182
-
16183
- /**
16184
- Will contain the result `Route#buildRouteInfoMetadata`
16185
- for the corresponding Route.
16186
- @property {Any} metadata
16187
- @public
16188
- */
16189
-
16190
- /**
16191
- A reference to the parent route's `RouteInfo`.
16192
- This can be used to traverse upward to the topmost
16193
- `RouteInfo`.
16194
- @property {RouteInfo|null} parent
16195
- @public
16196
- */
16197
-
16198
- /**
16199
- A reference to the child route's `RouteInfo`.
16200
- This can be used to traverse downward to the
16201
- leafmost `RouteInfo`.
16202
- @property {RouteInfo|null} child
16203
- @public
16204
- */
16205
-
16206
- /**
16207
- Allows you to traverse through the linked list
16208
- of `RouteInfo`s from the topmost to leafmost.
16209
- Returns the first `RouteInfo` in the linked list
16210
- for which the callback returns true.
16211
-
16212
- This method is similar to the `find()` method
16213
- defined in ECMAScript 2015.
16214
-
16215
- The callback method you provide should have the
16216
- following signature (all parameters are optional):
16217
-
16218
- ```javascript
16219
- function(item, index, array);
16220
- ```
16221
-
16222
- - `item` is the current item in the iteration.
16223
- - `index` is the current index in the iteration.
16224
- - `array` is the array itself.
16225
-
16226
- It should return the `true` to include the item in
16227
- the results, `false` otherwise.
16228
-
16229
- Note that in addition to a callback, you can also
16230
- pass an optional target object that will be set as
16231
- `this` on the context.
16232
-
16233
- @method find
16234
- @param {Function} callback the callback to execute
16235
- @param {Object} [target*] optional target to use
16236
- @returns {Object} Found item or undefined
16237
- @public
16238
- */
15998
+ Object.defineProperty(_exports, "__esModule", {
15999
+ value: true
16000
+ });
16239
16001
  });
16240
16002
  define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-internals/container", "@ember/-internals/metal", "@ember/-internals/owner", "@ember/-internals/runtime", "@ember/-internals/utils", "@ember/debug", "@ember/object/compat", "@ember/runloop", "router_js", "@ember/-internals/routing/lib/utils", "@ember/-internals/routing/lib/system/generate_controller"], function (_exports, _container, _metal, _owner, _runtime, _utils, _debug, _compat, _runloop, _router_js, _utils2, _generate_controller) {
16241
16003
  "use strict";
@@ -16243,8 +16005,7 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
16243
16005
  Object.defineProperty(_exports, "__esModule", {
16244
16006
  value: true
16245
16007
  });
16246
- _exports.default = _exports.ROUTE_CONNECTIONS = void 0;
16247
- _exports.defaultSerialize = defaultSerialize;
16008
+ _exports.defaultSerialize = _exports.default = _exports.ROUTE_CONNECTIONS = void 0;
16248
16009
  _exports.getFullQueryParams = getFullQueryParams;
16249
16010
  _exports.hasDefaultSerialize = hasDefaultSerialize;
16250
16011
 
@@ -16262,50 +16023,6 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
16262
16023
  _exports.ROUTE_CONNECTIONS = ROUTE_CONNECTIONS;
16263
16024
  var RENDER = (0, _utils.symbol)('render');
16264
16025
 
16265
- function defaultSerialize(model, params) {
16266
- if (params.length < 1 || !model) {
16267
- return;
16268
- }
16269
-
16270
- var object = {};
16271
-
16272
- if (params.length === 1) {
16273
- var [name] = params;
16274
-
16275
- if (name in model) {
16276
- object[name] = (0, _metal.get)(model, name);
16277
- } else if (/_id$/.test(name)) {
16278
- object[name] = (0, _metal.get)(model, 'id');
16279
- } else if ((0, _utils.isProxy)(model)) {
16280
- object[name] = (0, _metal.get)(model, name);
16281
- }
16282
- } else {
16283
- object = (0, _metal.getProperties)(model, params);
16284
- }
16285
-
16286
- return object;
16287
- }
16288
-
16289
- function hasDefaultSerialize(route) {
16290
- return route.serialize === defaultSerialize;
16291
- }
16292
- /**
16293
- @module @ember/routing
16294
- */
16295
-
16296
- /**
16297
- The `Route` class is used to define individual routes. Refer to
16298
- the [routing guide](https://guides.emberjs.com/release/routing/) for documentation.
16299
-
16300
- @class Route
16301
- @extends EmberObject
16302
- @uses ActionHandler
16303
- @uses Evented
16304
- @since 1.0.0
16305
- @public
16306
- */
16307
-
16308
-
16309
16026
  class Route extends _runtime.Object.extend(_runtime.ActionHandler, _runtime.Evented) {
16310
16027
  constructor(owner) {
16311
16028
  super(...arguments);
@@ -16321,6 +16038,68 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
16321
16038
  this._environment = owner.lookup('-environment:main');
16322
16039
  }
16323
16040
  }
16041
+ /**
16042
+ A hook you can implement to convert the route's model into parameters
16043
+ for the URL.
16044
+ ```app/router.js
16045
+ // ...
16046
+ Router.map(function() {
16047
+ this.route('post', { path: '/posts/:post_id' });
16048
+ });
16049
+ ```
16050
+ ```app/routes/post.js
16051
+ import Route from '@ember/routing/route';
16052
+ export default class PostRoute extends Route {
16053
+ model({ post_id }) {
16054
+ // the server returns `{ id: 12 }`
16055
+ return fetch(`/posts/${post_id}`;
16056
+ }
16057
+ serialize(model) {
16058
+ // this will make the URL `/posts/12`
16059
+ return { post_id: model.id };
16060
+ }
16061
+ }
16062
+ ```
16063
+ The default `serialize` method will insert the model's `id` into the
16064
+ route's dynamic segment (in this case, `:post_id`) if the segment contains '_id'.
16065
+ If the route has multiple dynamic segments or does not contain '_id', `serialize`
16066
+ will return `getProperties(model, params)`
16067
+ This method is called when `transitionTo` is called with a context
16068
+ in order to populate the URL.
16069
+ @method serialize
16070
+ @param {Object} model the routes model
16071
+ @param {Array} params an Array of parameter names for the current
16072
+ route (in the example, `['post_id']`.
16073
+ @return {Object} the serialized parameters
16074
+ @since 1.0.0
16075
+ @public
16076
+ */
16077
+
16078
+
16079
+ serialize(model, params) {
16080
+ if (params.length < 1 || !model) {
16081
+ return;
16082
+ }
16083
+
16084
+ var object = {};
16085
+
16086
+ if (params.length === 1) {
16087
+ var [name] = params;
16088
+ (true && !(name) && (0, _debug.assert)('has name', name));
16089
+
16090
+ if (name in model) {
16091
+ object[name] = (0, _metal.get)(model, name);
16092
+ } else if (/_id$/.test(name)) {
16093
+ object[name] = (0, _metal.get)(model, 'id');
16094
+ } else if ((0, _utils.isProxy)(model)) {
16095
+ object[name] = (0, _metal.get)(model, name);
16096
+ }
16097
+ } else {
16098
+ object = (0, _metal.getProperties)(model, params);
16099
+ }
16100
+
16101
+ return object;
16102
+ }
16324
16103
  /**
16325
16104
  Sets the name for this route, including a fully resolved name for routes
16326
16105
  inside engines.
@@ -16362,9 +16141,7 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
16362
16141
  namePaths[a] = `${routeInfo.name}.${names[a]}`;
16363
16142
  }
16364
16143
 
16365
- for (var i = 0; i < qps.length; ++i) {
16366
- var qp = qps[i];
16367
-
16144
+ for (var qp of qps) {
16368
16145
  if (qp.scope === 'model') {
16369
16146
  qp.parts = namePaths;
16370
16147
  }
@@ -16447,9 +16224,10 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
16447
16224
  var fullName = route.fullRouteName;
16448
16225
  var params = Object.assign({}, state.params[fullName]);
16449
16226
  var queryParams = getQueryParamsFor(route, state);
16450
- return Object.keys(queryParams).reduce((params, key) => {
16227
+ return Object.entries(queryParams).reduce((params, _ref) => {
16228
+ var [key, value] = _ref;
16451
16229
  (true && !(!params[key]) && (0, _debug.assert)(`The route '${this.routeName}' has both a dynamic segment and query param with name '${key}'. Please rename one to avoid collisions.`, !params[key]));
16452
- params[key] = queryParams[key];
16230
+ params[key] = value;
16453
16231
  return params;
16454
16232
  }, params);
16455
16233
  }
@@ -16566,148 +16344,6 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
16566
16344
  this.activate(transition);
16567
16345
  this.trigger('activate', transition);
16568
16346
  }
16569
- /**
16570
- The `willTransition` action is fired at the beginning of any
16571
- attempted transition with a `Transition` object as the sole
16572
- argument. This action can be used for aborting, redirecting,
16573
- or decorating the transition from the currently active routes.
16574
- A good example is preventing navigation when a form is
16575
- half-filled out:
16576
- ```app/routes/contact-form.js
16577
- import Route from '@ember/routing/route';
16578
- import { action } from '@ember/object';
16579
- export default class ContactFormRoute extends Route {
16580
- @action
16581
- willTransition(transition) {
16582
- if (this.controller.get('userHasEnteredData')) {
16583
- this.controller.displayNavigationConfirm();
16584
- transition.abort();
16585
- }
16586
- }
16587
- }
16588
- ```
16589
- You can also redirect elsewhere by calling
16590
- `this.transitionTo('elsewhere')` from within `willTransition`.
16591
- Note that `willTransition` will not be fired for the
16592
- redirecting `transitionTo`, since `willTransition` doesn't
16593
- fire when there is already a transition underway. If you want
16594
- subsequent `willTransition` actions to fire for the redirecting
16595
- transition, you must first explicitly call
16596
- `transition.abort()`.
16597
- To allow the `willTransition` event to continue bubbling to the parent
16598
- route, use `return true;`. When the `willTransition` method has a
16599
- return value of `true` then the parent route's `willTransition` method
16600
- will be fired, enabling "bubbling" behavior for the event.
16601
- @event willTransition
16602
- @param {Transition} transition
16603
- @since 1.0.0
16604
- @public
16605
- */
16606
-
16607
- /**
16608
- The `didTransition` action is fired after a transition has
16609
- successfully been completed. This occurs after the normal model
16610
- hooks (`beforeModel`, `model`, `afterModel`, `setupController`)
16611
- have resolved. The `didTransition` action has no arguments,
16612
- however, it can be useful for tracking page views or resetting
16613
- state on the controller.
16614
- ```app/routes/login.js
16615
- import Route from '@ember/routing/route';
16616
- import { action } from '@ember/object';
16617
- export default class LoginRoute extends Route {
16618
- @action
16619
- didTransition() {
16620
- this.controller.get('errors.base').clear();
16621
- return true; // Bubble the didTransition event
16622
- }
16623
- }
16624
- ```
16625
- @event didTransition
16626
- @since 1.2.0
16627
- @public
16628
- */
16629
-
16630
- /**
16631
- The `loading` action is fired on the route when a route's `model`
16632
- hook returns a promise that is not already resolved. The current
16633
- `Transition` object is the first parameter and the route that
16634
- triggered the loading event is the second parameter.
16635
- ```app/routes/application.js
16636
- import Route from '@ember/routing/route';
16637
- import { action } from '@ember/object';
16638
- export default class ApplicationRoute extends Route {
16639
- @action
16640
- loading(transition, route) {
16641
- let controller = this.controllerFor('foo');
16642
- // The controller may not be instantiated when initially loading
16643
- if (controller) {
16644
- controller.currentlyLoading = true;
16645
- transition.finally(function() {
16646
- controller.currentlyLoading = false;
16647
- });
16648
- }
16649
- }
16650
- }
16651
- ```
16652
- @event loading
16653
- @param {Transition} transition
16654
- @param {Route} route The route that triggered the loading event
16655
- @since 1.2.0
16656
- @public
16657
- */
16658
-
16659
- /**
16660
- When attempting to transition into a route, any of the hooks
16661
- may return a promise that rejects, at which point an `error`
16662
- action will be fired on the partially-entered routes, allowing
16663
- for per-route error handling logic, or shared error handling
16664
- logic defined on a parent route.
16665
- Here is an example of an error handler that will be invoked
16666
- for rejected promises from the various hooks on the route,
16667
- as well as any unhandled errors from child routes:
16668
- ```app/routes/admin.js
16669
- import { reject } from 'rsvp';
16670
- import Route from '@ember/routing/route';
16671
- import { action } from '@ember/object';
16672
- export default class AdminRoute extends Route {
16673
- beforeModel() {
16674
- return reject('bad things!');
16675
- }
16676
- @action
16677
- error(error, transition) {
16678
- // Assuming we got here due to the error in `beforeModel`,
16679
- // we can expect that error === "bad things!",
16680
- // but a promise model rejecting would also
16681
- // call this hook, as would any errors encountered
16682
- // in `afterModel`.
16683
- // The `error` hook is also provided the failed
16684
- // `transition`, which can be stored and later
16685
- // `.retry()`d if desired.
16686
- this.transitionTo('login');
16687
- }
16688
- }
16689
- ```
16690
- `error` actions that bubble up all the way to `ApplicationRoute`
16691
- will fire a default error handler that logs the error. You can
16692
- specify your own global default error handler by overriding the
16693
- `error` handler on `ApplicationRoute`:
16694
- ```app/routes/application.js
16695
- import Route from '@ember/routing/route';
16696
- import { action } from '@ember/object';
16697
- export default class ApplicationRoute extends Route {
16698
- @action
16699
- error(error, transition) {
16700
- this.controllerFor('banner').displayError(error.message);
16701
- }
16702
- }
16703
- ```
16704
- @event error
16705
- @param {Error} error
16706
- @param {Transition} transition
16707
- @since 1.0.0
16708
- @public
16709
- */
16710
-
16711
16347
  /**
16712
16348
  This event is triggered when the router enters the route. It is
16713
16349
  not executed when the model for the route changes.
@@ -17032,14 +16668,7 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17032
16668
  setup(context, transition) {
17033
16669
  var controllerName = this.controllerName || this.routeName;
17034
16670
  var definedController = this.controllerFor(controllerName, true);
17035
- var controller;
17036
-
17037
- if (definedController) {
17038
- controller = definedController;
17039
- } else {
17040
- controller = this.generateController(controllerName);
17041
- } // SAFETY: Since `_qp` is protected we can't infer the type
17042
-
16671
+ var controller = definedController !== null && definedController !== void 0 ? definedController : this.generateController(controllerName); // SAFETY: Since `_qp` is protected we can't infer the type
17043
16672
 
17044
16673
  var queryParams = (0, _metal.get)(this, '_qp'); // Assign the route's controller so that it can more easily be
17045
16674
  // referenced in action handlers. Side effects. Side effects everywhere.
@@ -17061,6 +16690,7 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17061
16690
  var allParams = queryParams.propertyNames;
17062
16691
  allParams.forEach(prop => {
17063
16692
  var aQp = queryParams.map[prop];
16693
+ (true && !(aQp) && (0, _debug.assert)('expected aQp', aQp));
17064
16694
  aQp.values = params;
17065
16695
  var cacheKey = (0, _utils2.calculateCacheKey)(aQp.route.fullRouteName, aQp.parts, aQp.values);
17066
16696
  var value = cache.lookup(cacheKey, prop, aQp.undecoratedDefaultValue);
@@ -17097,71 +16727,10 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17097
16727
  var cacheKey = (0, _utils2.calculateCacheKey)(qp.route.fullRouteName, qp.parts, qp.values);
17098
16728
  cache.stash(cacheKey, prop, value);
17099
16729
  }
17100
- /**
17101
- This hook is the first of the route entry validation hooks
17102
- called when an attempt is made to transition into a route
17103
- or one of its children. It is called before `model` and
17104
- `afterModel`, and is appropriate for cases when:
17105
- 1) A decision can be made to redirect elsewhere without
17106
- needing to resolve the model first.
17107
- 2) Any async operations need to occur first before the
17108
- model is attempted to be resolved.
17109
- This hook is provided the current `transition` attempt
17110
- as a parameter, which can be used to `.abort()` the transition,
17111
- save it for a later `.retry()`, or retrieve values set
17112
- on it from a previous hook. You can also just call
17113
- `this.transitionTo` to another route to implicitly
17114
- abort the `transition`.
17115
- You can return a promise from this hook to pause the
17116
- transition until the promise resolves (or rejects). This could
17117
- be useful, for instance, for retrieving async code from
17118
- the server that is required to enter a route.
17119
- @method beforeModel
17120
- @param {Transition} transition
17121
- @return {any | Promise<any>} if the value returned from this hook is
17122
- a promise, the transition will pause until the transition
17123
- resolves. Otherwise, non-promise return values are not
17124
- utilized in any way.
17125
- @since 1.0.0
17126
- @public
17127
- */
17128
16730
 
16731
+ beforeModel(_transition) {}
17129
16732
 
17130
- beforeModel() {}
17131
- /**
17132
- This hook is called after this route's model has resolved.
17133
- It follows identical async/promise semantics to `beforeModel`
17134
- but is provided the route's resolved model in addition to
17135
- the `transition`, and is therefore suited to performing
17136
- logic that can only take place after the model has already
17137
- resolved.
17138
- ```app/routes/posts.js
17139
- import Route from '@ember/routing/route';
17140
- export default class PostsRoute extends Route {
17141
- afterModel(posts, transition) {
17142
- if (posts.get('length') === 1) {
17143
- this.transitionTo('post.show', posts.get('firstObject'));
17144
- }
17145
- }
17146
- }
17147
- ```
17148
- Refer to documentation for `beforeModel` for a description
17149
- of transition-pausing semantics when a promise is returned
17150
- from this hook.
17151
- @method afterModel
17152
- @param {Object} resolvedModel the value returned from `model`,
17153
- or its resolved value if it was a promise
17154
- @param {Transition} transition
17155
- @return {any | Promise<any>} if the value returned from this hook is
17156
- a promise, the transition will pause until the transition
17157
- resolves. Otherwise, non-promise return values are not
17158
- utilized in any way.
17159
- @since 1.0.0
17160
- @public
17161
- */
17162
-
17163
-
17164
- afterModel() {}
16733
+ afterModel(_resolvedModel, _transition) {}
17165
16734
  /**
17166
16735
  A hook you can implement to optionally redirect to another route.
17167
16736
  Calling `this.transitionTo` from inside of the `redirect` hook will
@@ -17184,7 +16753,7 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17184
16753
  */
17185
16754
 
17186
16755
 
17187
- redirect() {}
16756
+ redirect(_model, _transition) {}
17188
16757
  /**
17189
16758
  Called when the context is changed by router.js.
17190
16759
  @private
@@ -17279,11 +16848,14 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17279
16848
 
17280
16849
  if (!name) {
17281
16850
  if (sawParams) {
16851
+ // SAFETY: This should be equivalent
17282
16852
  return Object.assign({}, params);
17283
16853
  } else {
17284
16854
  if (transition.resolveIndex < 1) {
17285
16855
  return;
17286
- }
16856
+ } // SAFETY: These return types should be equivalent but router.js doesn't have enough
16857
+ // generics to infer it.
16858
+
17287
16859
 
17288
16860
  return transition[_router_js.STATE_SYMBOL].routeInfos[transition.resolveIndex - 1].context;
17289
16861
  }
@@ -17374,29 +16946,12 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17374
16946
  (0, _metal.set)(controller, 'model', context);
17375
16947
  }
17376
16948
  }
17377
- /**
17378
- Returns the controller of the current route, or a parent (or any ancestor)
17379
- route in a route hierarchy.
17380
- The controller instance must already have been created, either through entering the
17381
- associated route or using `generateController`.
17382
- ```app/routes/post.js
17383
- import Route from '@ember/routing/route';
17384
- export default class PostRoute extends Route {
17385
- setupController(controller, post) {
17386
- super.setupController(controller, post);
17387
- this.controllerFor('posts').set('currentPost', post);
17388
- }
17389
- }
17390
- ```
17391
- @method controllerFor
17392
- @param {String} name the name of the route or controller
17393
- @return {Controller}
17394
- @since 1.0.0
17395
- @public
17396
- */
17397
-
17398
16949
 
17399
16950
  controllerFor(name, _skipAssert) {
16951
+ if (_skipAssert === void 0) {
16952
+ _skipAssert = false;
16953
+ }
16954
+
17400
16955
  var owner = (0, _owner.getOwner)(this);
17401
16956
  (true && !(owner) && (0, _debug.assert)('Route is unexpectedly missing an owner', owner));
17402
16957
  var route = owner.lookup(`route:${name}`);
@@ -17495,7 +17050,7 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17495
17050
  }
17496
17051
  }
17497
17052
 
17498
- return route && route.currentModel;
17053
+ return route === null || route === void 0 ? void 0 : route.currentModel;
17499
17054
  }
17500
17055
  /**
17501
17056
  `this[RENDER]` is used to render a template into a region of another template
@@ -17538,39 +17093,6 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17538
17093
  (0, _runloop.once)(this._router, '_setOutlets');
17539
17094
  }
17540
17095
  }
17541
- /**
17542
- Allows you to produce custom metadata for the route.
17543
- The return value of this method will be attached to
17544
- its corresponding RouteInfoWithAttributes object.
17545
- Example
17546
- ```app/routes/posts/index.js
17547
- import Route from '@ember/routing/route';
17548
- export default class PostsIndexRoute extends Route {
17549
- buildRouteInfoMetadata() {
17550
- return { title: 'Posts Page' }
17551
- }
17552
- }
17553
- ```
17554
- ```app/routes/application.js
17555
- import Route from '@ember/routing/route';
17556
- import { service } from '@ember/service';
17557
- export default class ApplicationRoute extends Route {
17558
- @service router
17559
- constructor() {
17560
- super(...arguments);
17561
- this.router.on('routeDidChange', transition => {
17562
- document.title = transition.to.metadata.title;
17563
- // would update document's title to "Posts Page"
17564
- });
17565
- }
17566
- }
17567
- ```
17568
- @method buildRouteInfoMetadata
17569
- @return any
17570
- @since 3.10.0
17571
- @public
17572
- */
17573
-
17574
17096
 
17575
17097
  buildRouteInfoMetadata() {}
17576
17098
 
@@ -17639,7 +17161,7 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17639
17161
  // this route find its query params and normalize their object shape them
17640
17162
  // merge in the query params for the route. As a mergedProperty,
17641
17163
  // Route#queryParams is always at least `{}`
17642
- var controllerDefinedQueryParameterConfiguration = (0, _metal.get)(controller, 'queryParams') || {};
17164
+ var controllerDefinedQueryParameterConfiguration = (0, _metal.get)(controller, 'queryParams') || [];
17643
17165
  var normalizedControllerQueryParameterConfiguration = (0, _utils2.normalizeControllerQueryParams)(controllerDefinedQueryParameterConfiguration);
17644
17166
  combinedQueryParameterConfiguration = mergeEachQueryParams(normalizedControllerQueryParameterConfiguration, queryParameterConfiguraton);
17645
17167
  } else if (hasRouterDefinedQueryParams) {
@@ -17711,6 +17233,7 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17711
17233
  */
17712
17234
  inactive: (prop, value) => {
17713
17235
  var qp = map[prop];
17236
+ (true && !(qp) && (0, _debug.assert)('expected inactive callback to only be called for registered qps', qp));
17714
17237
 
17715
17238
  this._qpChanged(prop, value, qp);
17716
17239
  },
@@ -17722,6 +17245,7 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17722
17245
  */
17723
17246
  active: (prop, value) => {
17724
17247
  var qp = map[prop];
17248
+ (true && !(qp) && (0, _debug.assert)('expected active callback to only be called for registered qps', qp));
17725
17249
 
17726
17250
  this._qpChanged(prop, value, qp);
17727
17251
 
@@ -17734,6 +17258,7 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17734
17258
  */
17735
17259
  allowOverrides: (prop, value) => {
17736
17260
  var qp = map[prop];
17261
+ (true && !(qp) && (0, _debug.assert)('expected allowOverrides callback to only be called for registered qps', qp));
17737
17262
 
17738
17263
  this._qpChanged(prop, value, qp);
17739
17264
 
@@ -17768,7 +17293,9 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17768
17293
  var current;
17769
17294
 
17770
17295
  for (var i = 0; i < routeInfos.length; i++) {
17771
- current = routeInfos[i].route;
17296
+ var routeInfo = routeInfos[i];
17297
+ (true && !(routeInfo) && (0, _debug.assert)('has current routeInfo', routeInfo));
17298
+ current = routeInfo.route;
17772
17299
 
17773
17300
  if (current === route) {
17774
17301
  return routeInfos[i + offset];
@@ -17892,9 +17419,10 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17892
17419
  function getQueryParamsFor(route, state) {
17893
17420
  state.queryParamsFor = state.queryParamsFor || {};
17894
17421
  var name = route.fullRouteName;
17422
+ var existing = state.queryParamsFor[name];
17895
17423
 
17896
- if (state.queryParamsFor[name]) {
17897
- return state.queryParamsFor[name];
17424
+ if (existing) {
17425
+ return existing;
17898
17426
  }
17899
17427
 
17900
17428
  var fullQueryParams = getFullQueryParams(route._router, state);
@@ -17903,9 +17431,8 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17903
17431
 
17904
17432
  var qps = (0, _metal.get)(route, '_qp').qps;
17905
17433
 
17906
- for (var i = 0; i < qps.length; ++i) {
17434
+ for (var qp of qps) {
17907
17435
  // Put deserialized qp on params hash.
17908
- var qp = qps[i];
17909
17436
  var qpValueWasPassedIn = (qp.prop in fullQueryParams);
17910
17437
  params[qp.prop] = qpValueWasPassedIn ? fullQueryParams[qp.prop] : copyDefaultValue(qp.defaultValue);
17911
17438
  }
@@ -17996,54 +17523,14 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
17996
17523
 
17997
17524
  return routeName;
17998
17525
  }
17999
- /**
18000
- A hook you can implement to convert the route's model into parameters
18001
- for the URL.
18002
-
18003
- ```app/router.js
18004
- // ...
18005
-
18006
- Router.map(function() {
18007
- this.route('post', { path: '/posts/:post_id' });
18008
- });
18009
-
18010
- ```
18011
-
18012
- ```app/routes/post.js
18013
- import Route from '@ember/routing/route';
18014
-
18015
- export default class PostRoute extends Route {
18016
- model({ post_id }) {
18017
- // the server returns `{ id: 12 }`
18018
- return fetch(`/posts/${post_id}`;
18019
- }
18020
-
18021
- serialize(model) {
18022
- // this will make the URL `/posts/12`
18023
- return { post_id: model.id };
18024
- }
18025
- }
18026
- ```
18027
-
18028
- The default `serialize` method will insert the model's `id` into the
18029
- route's dynamic segment (in this case, `:post_id`) if the segment contains '_id'.
18030
- If the route has multiple dynamic segments or does not contain '_id', `serialize`
18031
- will return `getProperties(model, params)`
18032
-
18033
- This method is called when `transitionTo` is called with a context
18034
- in order to populate the URL.
18035
-
18036
- @method serialize
18037
- @param {Object} model the routes model
18038
- @param {Array} params an Array of parameter names for the current
18039
- route (in the example, `['post_id']`.
18040
- @return {Object} the serialized parameters
18041
- @since 1.0.0
18042
- @public
18043
- */
18044
17526
 
17527
+ var defaultSerialize = Route.prototype.serialize;
17528
+ _exports.defaultSerialize = defaultSerialize;
17529
+
17530
+ function hasDefaultSerialize(route) {
17531
+ return route.serialize === defaultSerialize;
17532
+ } // Set these here so they can be overridden with extend
18045
17533
 
18046
- Route.prototype.serialize = defaultSerialize; // Set these here so they can be overridden with extend
18047
17534
 
18048
17535
  Route.reopen({
18049
17536
  mergedProperties: ['queryParams'],
@@ -18110,8 +17597,8 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
18110
17597
  var qpMap = (0, _metal.get)(this, '_qp').map;
18111
17598
  var totalChanged = Object.keys(changed).concat(Object.keys(removed));
18112
17599
 
18113
- for (var i = 0; i < totalChanged.length; ++i) {
18114
- var qp = qpMap[totalChanged[i]];
17600
+ for (var change of totalChanged) {
17601
+ var qp = qpMap[change];
18115
17602
 
18116
17603
  if (qp) {
18117
17604
  var options = this._optionsForQueryParam(qp);
@@ -18148,8 +17635,7 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
18148
17635
  var replaceUrl;
18149
17636
  (0, _utils2.stashParamNames)(router, routeInfos);
18150
17637
 
18151
- for (var i = 0; i < qpMeta.qps.length; ++i) {
18152
- var qp = qpMeta.qps[i];
17638
+ for (var qp of qpMeta.qps) {
18153
17639
  var route = qp.route;
18154
17640
  var controller = route.controller;
18155
17641
  var presentKey = qp.urlKey in params && qp.urlKey; // Do a reverse lookup to see if the changed query
@@ -18203,7 +17689,7 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
18203
17689
  qp.serializedValue = svalue;
18204
17690
  var thisQueryParamHasDefaultValue = qp.serializedDefaultValue === svalue;
18205
17691
 
18206
- if (!thisQueryParamHasDefaultValue || transition._keepDefaultQueryParamValues) {
17692
+ if (!thisQueryParamHasDefaultValue) {
18207
17693
  finalParams.push({
18208
17694
  value: svalue,
18209
17695
  visible: true,
@@ -18248,6 +17734,9 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
18248
17734
  _exports.default = void 0;
18249
17735
  _exports.triggerEvent = triggerEvent;
18250
17736
 
17737
+ /**
17738
+ @module @ember/routing
17739
+ */
18251
17740
  function defaultDidTransition(infos) {
18252
17741
  updatePaths(this);
18253
17742
 
@@ -18407,7 +17896,9 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
18407
17896
  var name, nameParts, oldNameParts;
18408
17897
 
18409
17898
  for (var i = 1; i < routeInfos.length; i++) {
18410
- name = routeInfos[i].name;
17899
+ var routeInfo = routeInfos[i];
17900
+ (true && !(routeInfo) && (0, _debug.assert)('has routeInfo', routeInfo));
17901
+ name = routeInfo.name;
18411
17902
  nameParts = name.split('.');
18412
17903
  oldNameParts = slice.call(path);
18413
17904
 
@@ -18721,8 +18212,8 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
18721
18212
  var defaultParentState;
18722
18213
  var liveRoutes = null;
18723
18214
 
18724
- for (var i = 0; i < routeInfos.length; i++) {
18725
- var route = routeInfos[i].route;
18215
+ for (var routeInfo of routeInfos) {
18216
+ var route = routeInfo.route;
18726
18217
 
18727
18218
  var connections = _route.ROUTE_CONNECTIONS.get(route);
18728
18219
 
@@ -18800,9 +18291,8 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
18800
18291
  /**
18801
18292
  Transition the application into another route. The route may
18802
18293
  be either a single route or route path:
18803
- See [transitionTo](/ember/release/classes/Route/methods/transitionTo?anchor=transitionTo) for more info.
18804
18294
  @method transitionTo
18805
- @param {String} name the name of the route or a URL
18295
+ @param {String} [name] the name of the route or a URL
18806
18296
  @param {...Object} models the model(s) or identifier(s) to be used while
18807
18297
  transitioning to the route.
18808
18298
  @param {Object} [options] optional hash with a queryParams property
@@ -18853,6 +18343,23 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
18853
18343
  }
18854
18344
  }
18855
18345
  }
18346
+ /**
18347
+ Similar to `transitionTo`, but instead of adding the destination to the browser's URL history,
18348
+ it replaces the entry for the current route.
18349
+ When the user clicks the "back" button in the browser, there will be fewer steps.
18350
+ This is most commonly used to manage redirects in a way that does not cause confusing additions
18351
+ to the user's browsing history.
18352
+ @method replaceWith
18353
+ @param {String} [name] the name of the route or a URL
18354
+ @param {...Object} models the model(s) or identifier(s) to be used while
18355
+ transitioning to the route.
18356
+ @param {Object} [options] optional hash with a queryParams property
18357
+ containing a mapping of query parameters
18358
+ @return {Transition} the transition object associated with this
18359
+ attempted transition
18360
+ @public
18361
+ */
18362
+
18856
18363
 
18857
18364
  replaceWith() {
18858
18365
  return this.transitionTo(...arguments).method('replace');
@@ -18946,8 +18453,11 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
18946
18453
  var instances = this._engineInstances;
18947
18454
 
18948
18455
  for (var name in instances) {
18949
- for (var id in instances[name]) {
18950
- (0, _runloop.run)(instances[name][id], 'destroy');
18456
+ var instance = instances[name];
18457
+ (true && !(instance) && (0, _debug.assert)('has instance', instance));
18458
+
18459
+ for (var id in instance) {
18460
+ (0, _runloop.run)(instance[id], 'destroy');
18951
18461
  }
18952
18462
  }
18953
18463
  }
@@ -19160,7 +18670,7 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
19160
18670
  }
19161
18671
  }
19162
18672
 
19163
- _doTransition(_targetRouteName, models, _queryParams, _keepDefaultQueryParamValues) {
18673
+ _doTransition(_targetRouteName, models, _queryParams, _fromRouterService) {
19164
18674
  var targetRouteName = _targetRouteName || (0, _utils.getActiveTargetName)(this._routerMicrolib);
19165
18675
 
19166
18676
  (true && !(Boolean(targetRouteName) && this._routerMicrolib.hasRoute(targetRouteName)) && (0, _debug.assert)(`The route ${targetRouteName} was not found`, Boolean(targetRouteName) && this._routerMicrolib.hasRoute(targetRouteName)));
@@ -19171,7 +18681,7 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
19171
18681
 
19172
18682
  Object.assign(queryParams, _queryParams);
19173
18683
 
19174
- this._prepareQueryParams(targetRouteName, models, queryParams, Boolean(_keepDefaultQueryParamValues));
18684
+ this._prepareQueryParams(targetRouteName, models, queryParams, Boolean(_fromRouterService));
19175
18685
 
19176
18686
  var transition = this._routerMicrolib.transitionTo(targetRouteName, ...models, {
19177
18687
  queryParams
@@ -19271,12 +18781,11 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
19271
18781
  /* DEBUG */
19272
18782
  ? {} : null;
19273
18783
  var qpMeta;
19274
- var qp;
19275
18784
  var urlKey;
19276
18785
  var qpOther;
19277
18786
 
19278
- for (var i = 0; i < routeInfoLength; ++i) {
19279
- qpMeta = this._getQPMeta(routeInfos[i]);
18787
+ for (var routeInfo of routeInfos) {
18788
+ qpMeta = this._getQPMeta(routeInfo);
19280
18789
 
19281
18790
  if (!qpMeta) {
19282
18791
  shouldCache = false;
@@ -19284,9 +18793,7 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
19284
18793
  } // Loop over each QP to make sure we don't have any collisions by urlKey
19285
18794
 
19286
18795
 
19287
- for (var _i = 0; _i < qpMeta.qps.length; _i++) {
19288
- qp = qpMeta.qps[_i];
19289
-
18796
+ for (var qp of qpMeta.qps) {
19290
18797
  if (true
19291
18798
  /* DEBUG */
19292
18799
  ) {
@@ -19334,19 +18841,15 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
19334
18841
  var routeInfos = state.routeInfos;
19335
18842
  var qpMeta;
19336
18843
 
19337
- for (var i = 0, len = routeInfos.length; i < len; ++i) {
19338
- qpMeta = this._getQPMeta(routeInfos[i]);
18844
+ for (var routeInfo of routeInfos) {
18845
+ qpMeta = this._getQPMeta(routeInfo);
19339
18846
 
19340
18847
  if (!qpMeta) {
19341
18848
  continue;
19342
18849
  }
19343
18850
 
19344
- var qp = void 0;
19345
- var presentProp = void 0;
19346
-
19347
- for (var j = 0, qpLen = qpMeta.qps.length; j < qpLen; ++j) {
19348
- qp = qpMeta.qps[j];
19349
- presentProp = qp.prop in queryParams && qp.prop || qp.scopedPropertyName in queryParams && qp.scopedPropertyName || qp.urlKey in queryParams && qp.urlKey;
18851
+ for (var qp of qpMeta.qps) {
18852
+ var presentProp = qp.prop in queryParams && qp.prop || qp.scopedPropertyName in queryParams && qp.scopedPropertyName || qp.urlKey in queryParams && qp.urlKey;
19350
18853
 
19351
18854
  if (presentProp) {
19352
18855
  if (presentProp !== qp.scopedPropertyName) {
@@ -19376,15 +18879,17 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
19376
18879
  var qp;
19377
18880
  var presentProp;
19378
18881
 
19379
- for (var i = 0; i < routeInfos.length; ++i) {
19380
- qpMeta = this._getQPMeta(routeInfos[i]);
18882
+ for (var routeInfo of routeInfos) {
18883
+ qpMeta = this._getQPMeta(routeInfo);
19381
18884
 
19382
18885
  if (!qpMeta) {
19383
18886
  continue;
19384
- }
18887
+ } // Needs to stay for index loop to avoid throwIfClosureRequired
18888
+
19385
18889
 
19386
18890
  for (var j = 0, qpLen = qpMeta.qps.length; j < qpLen; ++j) {
19387
18891
  qp = qpMeta.qps[j];
18892
+ (true && !(qp) && (0, _debug.assert)('expected qp', qp));
19388
18893
  presentProp = qp.prop in queryParams && qp.prop || qp.scopedPropertyName in queryParams && qp.scopedPropertyName || qp.urlKey in queryParams && qp.urlKey;
19389
18894
  (true && !(function () {
19390
18895
  if (qp.urlKey === presentProp || qp.scopedPropertyName === presentProp) {
@@ -19472,12 +18977,16 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
19472
18977
  mountPoint
19473
18978
  } = _ref;
19474
18979
  var engineInstances = this._engineInstances;
18980
+ var namedInstances = engineInstances[name];
18981
+
18982
+ if (!namedInstances) {
18983
+ namedInstances = Object.create(null);
18984
+ engineInstances[name] = namedInstances;
18985
+ } // We just set these!
19475
18986
 
19476
- if (!engineInstances[name]) {
19477
- engineInstances[name] = Object.create(null);
19478
- }
19479
18987
 
19480
- var engineInstance = engineInstances[name][instanceId];
18988
+ (true && !(namedInstances) && (0, _debug.assert)('has namedInstances', namedInstances));
18989
+ var engineInstance = namedInstances[instanceId];
19481
18990
 
19482
18991
  if (!engineInstance) {
19483
18992
  var owner = (0, _owner.getOwner)(this);
@@ -19488,7 +18997,7 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
19488
18997
  mountPoint
19489
18998
  });
19490
18999
  engineInstance.boot();
19491
- engineInstances[name][instanceId] = engineInstance;
19000
+ namedInstances[instanceId] = engineInstance;
19492
19001
  }
19493
19002
 
19494
19003
  return engineInstance;
@@ -19515,6 +19024,7 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
19515
19024
  function forEachRouteAbove(routeInfos, callback) {
19516
19025
  for (var i = routeInfos.length - 1; i >= 0; --i) {
19517
19026
  var routeInfo = routeInfos[i];
19027
+ (true && !(routeInfo) && (0, _debug.assert)('has routeInfo', routeInfo));
19518
19028
  var route = routeInfo.route; // routeInfo.handler being `undefined` generally means either:
19519
19029
  //
19520
19030
  // 1. an error occurred during creation of the route in question
@@ -19717,6 +19227,7 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
19717
19227
 
19718
19228
  for (var i = routeInfos.length - 1; i >= 0; i--) {
19719
19229
  routeInfo = routeInfos[i];
19230
+ (true && !(routeInfo) && (0, _debug.assert)('has routeInfo', routeInfo));
19720
19231
  handler = routeInfo.route;
19721
19232
  actionHandler = handler && handler.actions && handler.actions[name];
19722
19233
 
@@ -19754,9 +19265,8 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
19754
19265
  params
19755
19266
  } = state;
19756
19267
 
19757
- for (var i = 0; i < routeInfos.length; ++i) {
19758
- var routeInfo = routeInfos[i]; // If the routeInfo is not resolved, we serialize the context into params
19759
-
19268
+ for (var routeInfo of routeInfos) {
19269
+ // If the routeInfo is not resolved, we serialize the context into params
19760
19270
  if (!routeInfo.isResolved) {
19761
19271
  params[routeInfo.name] = routeInfo.serialize(routeInfo.context);
19762
19272
  } else {
@@ -19776,7 +19286,9 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
19776
19286
 
19777
19287
  var path = EmberRouter._routePath(infos);
19778
19288
 
19779
- var currentRouteName = infos[infos.length - 1].name;
19289
+ var info = infos[infos.length - 1];
19290
+ (true && !(info) && (0, _debug.assert)('expected info', info));
19291
+ var currentRouteName = info.name;
19780
19292
  var location = router.location;
19781
19293
  (true && !(typeof location !== 'string') && (0, _debug.assert)('expected location to not be a string', typeof location !== 'string'));
19782
19294
  var currentURL = location.getURL();
@@ -20174,22 +19686,28 @@ define("@ember/-internals/routing/lib/utils", ["exports", "@ember/-internals/met
20174
19686
  var ALL_PERIODS_REGEX = /\./g;
20175
19687
 
20176
19688
  function extractRouteArgs(args) {
19689
+ // SAFETY: This should just be the same thing
20177
19690
  args = args.slice();
20178
- var possibleQueryParams = args.pop();
19691
+ var possibleOptions = args[args.length - 1];
20179
19692
  var queryParams;
20180
19693
 
20181
- if (hasQueryParams(possibleQueryParams)) {
20182
- queryParams = possibleQueryParams.queryParams;
19694
+ if (isRouteOptions(possibleOptions)) {
19695
+ args.pop(); // Remove options
19696
+
19697
+ queryParams = possibleOptions.queryParams;
20183
19698
  } else {
20184
- // Not query params so return to the array
20185
- args.push(possibleQueryParams);
20186
19699
  queryParams = {};
20187
- } // UNSAFE: these are simply assumed as the existing behavior of the system.
20188
- // However, this could break if upstream refactors change it, and the types
20189
- // here would not be able to tell us; we would lie to everything downstream.
19700
+ }
19701
+
19702
+ var routeName;
19703
+
19704
+ if (typeof args[0] === 'string') {
19705
+ routeName = args.shift(); // We just checked this!
19706
+
19707
+ (true && !(typeof routeName === 'string') && (0, _debug.assert)('routeName is a string', typeof routeName === 'string'));
19708
+ } // SAFTEY: We removed the name and options if they existed, only models left.
20190
19709
 
20191
19710
 
20192
- var routeName = args.shift();
20193
19711
  var models = args;
20194
19712
  return {
20195
19713
  routeName,
@@ -20200,7 +19718,9 @@ define("@ember/-internals/routing/lib/utils", ["exports", "@ember/-internals/met
20200
19718
 
20201
19719
  function getActiveTargetName(router) {
20202
19720
  var routeInfos = router.activeTransition ? router.activeTransition[_router_js.STATE_SYMBOL].routeInfos : router.state.routeInfos;
20203
- return routeInfos[routeInfos.length - 1].name;
19721
+ var lastRouteInfo = routeInfos[routeInfos.length - 1];
19722
+ (true && !(lastRouteInfo) && (0, _debug.assert)('has last route info', lastRouteInfo));
19723
+ return lastRouteInfo.name;
20204
19724
  }
20205
19725
 
20206
19726
  function stashParamNames(router, routeInfos) {
@@ -20212,24 +19732,27 @@ define("@ember/-internals/routing/lib/utils", ["exports", "@ember/-internals/met
20212
19732
  // Hopefully we can remove this in the future.
20213
19733
 
20214
19734
 
20215
- var targetRouteName = routeInfos[routeInfos.length - 1].name;
19735
+ var routeInfo = routeInfos[routeInfos.length - 1];
19736
+ (true && !(routeInfo) && (0, _debug.assert)('has route info', routeInfo));
19737
+ var targetRouteName = routeInfo.name;
20216
19738
 
20217
19739
  var recogHandlers = router._routerMicrolib.recognizer.handlersFor(targetRouteName);
20218
19740
 
20219
19741
  var dynamicParent;
20220
19742
 
20221
19743
  for (var i = 0; i < routeInfos.length; ++i) {
20222
- var routeInfo = routeInfos[i];
19744
+ var _routeInfo = routeInfos[i];
19745
+ (true && !(_routeInfo) && (0, _debug.assert)('has route info', _routeInfo));
20223
19746
  var names = recogHandlers[i].names;
20224
19747
 
20225
19748
  if (names.length) {
20226
- dynamicParent = routeInfo;
19749
+ dynamicParent = _routeInfo;
20227
19750
  }
20228
19751
 
20229
- routeInfo['_names'] = names;
20230
- var route = routeInfo.route;
19752
+ _routeInfo['_names'] = names;
19753
+ var route = _routeInfo.route; // SAFETY: This cast should be idential. I don't understand why it is needed.
20231
19754
 
20232
- route._stashNames(routeInfo, dynamicParent);
19755
+ route._stashNames(_routeInfo, dynamicParent);
20233
19756
  }
20234
19757
 
20235
19758
  routeInfos['_namesStashed'] = true;
@@ -20269,9 +19792,7 @@ define("@ember/-internals/routing/lib/utils", ["exports", "@ember/-internals/met
20269
19792
 
20270
19793
  var suffixes = '';
20271
19794
 
20272
- for (var i = 0; i < parts.length; ++i) {
20273
- var part = parts[i];
20274
-
19795
+ for (var part of parts) {
20275
19796
  var cacheValuePrefix = _calculateCacheValuePrefix(prefix, part);
20276
19797
 
20277
19798
  var value = void 0;
@@ -20327,8 +19848,8 @@ define("@ember/-internals/routing/lib/utils", ["exports", "@ember/-internals/met
20327
19848
  function normalizeControllerQueryParams(queryParams) {
20328
19849
  var qpMap = {};
20329
19850
 
20330
- for (var i = 0; i < queryParams.length; ++i) {
20331
- accumulateQueryParamDescriptors(queryParams[i], qpMap);
19851
+ for (var queryParam of queryParams) {
19852
+ accumulateQueryParamDescriptors(queryParam, qpMap);
20332
19853
  }
20333
19854
 
20334
19855
  return qpMap;
@@ -20385,12 +19906,14 @@ define("@ember/-internals/routing/lib/utils", ["exports", "@ember/-internals/met
20385
19906
 
20386
19907
 
20387
19908
  function prefixRouteNameArg(route, args) {
20388
- var routeName = args[0];
19909
+ var routeName;
20389
19910
  var owner = (0, _owner.getOwner)(route);
20390
19911
  (true && !(owner) && (0, _debug.assert)('Route is unexpectedly missing an owner', owner));
20391
19912
  var prefix = owner.mountPoint; // only alter the routeName if it's actually referencing a route.
20392
19913
 
20393
- if (owner.routable && typeof routeName === 'string') {
19914
+ if (owner.routable && typeof args[0] === 'string') {
19915
+ routeName = args[0];
19916
+
20394
19917
  if (resemblesURL(routeName)) {
20395
19918
  throw new _error.default('Programmatic transitions by URL cannot be used within an Engine. Please use the route name instead.');
20396
19919
  } else {
@@ -20439,7 +19962,7 @@ define("@ember/-internals/routing/lib/utils", ["exports", "@ember/-internals/met
20439
19962
  }));
20440
19963
  }
20441
19964
 
20442
- function hasQueryParams(value) {
19965
+ function isRouteOptions(value) {
20443
19966
  if (value && typeof value === 'object') {
20444
19967
  var qps = value.queryParams;
20445
19968
 
@@ -21074,16 +20597,16 @@ define("@ember/-internals/runtime/lib/mixins/action_handler", ["exports", "@embe
21074
20597
  /**
21075
20598
  The collection of functions, keyed by name, available on this
21076
20599
  `ActionHandler` as action targets.
21077
- These functions will be invoked when a matching `{{action}}` is triggered
20600
+ These functions will be invoked when a matching `{{action}}` is triggered
21078
20601
  from within a template and the application's current route is this route.
21079
- Actions can also be invoked from other parts of your application
20602
+ Actions can also be invoked from other parts of your application
21080
20603
  via `ActionHandler#send`.
21081
- The `actions` hash will inherit action handlers from
20604
+ The `actions` hash will inherit action handlers from
21082
20605
  the `actions` hash defined on extended parent classes
21083
20606
  or mixins rather than just replace the entire hash, e.g.:
21084
- ```app/mixins/can-display-banner.js
20607
+ ```app/mixins/can-display-banner.js
21085
20608
  import Mixin from '@ember/mixin';
21086
- export default Mixin.create({
20609
+ export default Mixin.create({
21087
20610
  actions: {
21088
20611
  displayBanner(msg) {
21089
20612
  // ...
@@ -21091,28 +20614,28 @@ define("@ember/-internals/runtime/lib/mixins/action_handler", ["exports", "@embe
21091
20614
  }
21092
20615
  });
21093
20616
  ```
21094
- ```app/routes/welcome.js
20617
+ ```app/routes/welcome.js
21095
20618
  import Route from '@ember/routing/route';
21096
20619
  import CanDisplayBanner from '../mixins/can-display-banner';
21097
- export default Route.extend(CanDisplayBanner, {
20620
+ export default Route.extend(CanDisplayBanner, {
21098
20621
  actions: {
21099
20622
  playMusic() {
21100
20623
  // ...
21101
20624
  }
21102
20625
  }
21103
20626
  });
21104
- // `WelcomeRoute`, when active, will be able to respond
20627
+ // `WelcomeRoute`, when active, will be able to respond
21105
20628
  // to both actions, since the actions hash is merged rather
21106
20629
  // then replaced when extending mixins / parent classes.
21107
20630
  this.send('displayBanner');
21108
20631
  this.send('playMusic');
21109
20632
  ```
21110
- Within a Controller, Route or Component's action handler,
20633
+ Within a Controller, Route or Component's action handler,
21111
20634
  the value of the `this` context is the Controller, Route or
21112
20635
  Component object:
21113
- ```app/routes/song.js
20636
+ ```app/routes/song.js
21114
20637
  import Route from '@ember/routing/route';
21115
- export default Route.extend({
20638
+ export default Route.extend({
21116
20639
  actions: {
21117
20640
  myAction() {
21118
20641
  this.controllerFor("song");
@@ -21122,13 +20645,13 @@ define("@ember/-internals/runtime/lib/mixins/action_handler", ["exports", "@embe
21122
20645
  }
21123
20646
  });
21124
20647
  ```
21125
- It is also possible to call `this._super(...arguments)` from within an
20648
+ It is also possible to call `this._super(...arguments)` from within an
21126
20649
  action handler if it overrides a handler defined on a parent
21127
20650
  class or mixin:
21128
- Take for example the following routes:
21129
- ```app/mixins/debug-route.js
20651
+ Take for example the following routes:
20652
+ ```app/mixins/debug-route.js
21130
20653
  import Mixin from '@ember/mixin';
21131
- export default Mixin.create({
20654
+ export default Mixin.create({
21132
20655
  actions: {
21133
20656
  debugRouteInformation() {
21134
20657
  console.debug("It's a-me, console.debug!");
@@ -21136,54 +20659,54 @@ define("@ember/-internals/runtime/lib/mixins/action_handler", ["exports", "@embe
21136
20659
  }
21137
20660
  });
21138
20661
  ```
21139
- ```app/routes/annoying-debug.js
20662
+ ```app/routes/annoying-debug.js
21140
20663
  import Route from '@ember/routing/route';
21141
20664
  import DebugRoute from '../mixins/debug-route';
21142
- export default Route.extend(DebugRoute, {
20665
+ export default Route.extend(DebugRoute, {
21143
20666
  actions: {
21144
20667
  debugRouteInformation() {
21145
20668
  // also call the debugRouteInformation of mixed in DebugRoute
21146
20669
  this._super(...arguments);
21147
- // show additional annoyance
20670
+ // show additional annoyance
21148
20671
  window.alert(...);
21149
20672
  }
21150
20673
  }
21151
20674
  });
21152
20675
  ```
21153
- ## Bubbling
21154
- By default, an action will stop bubbling once a handler defined
20676
+ ## Bubbling
20677
+ By default, an action will stop bubbling once a handler defined
21155
20678
  on the `actions` hash handles it. To continue bubbling the action,
21156
20679
  you must return `true` from the handler:
21157
- ```app/router.js
20680
+ ```app/router.js
21158
20681
  Router.map(function() {
21159
20682
  this.route("album", function() {
21160
20683
  this.route("song");
21161
20684
  });
21162
20685
  });
21163
20686
  ```
21164
- ```app/routes/album.js
20687
+ ```app/routes/album.js
21165
20688
  import Route from '@ember/routing/route';
21166
- export default Route.extend({
20689
+ export default Route.extend({
21167
20690
  actions: {
21168
20691
  startPlaying: function() {
21169
20692
  }
21170
20693
  }
21171
20694
  });
21172
20695
  ```
21173
- ```app/routes/album-song.js
20696
+ ```app/routes/album-song.js
21174
20697
  import Route from '@ember/routing/route';
21175
- export default Route.extend({
20698
+ export default Route.extend({
21176
20699
  actions: {
21177
20700
  startPlaying() {
21178
20701
  // ...
21179
- if (actionShouldAlsoBeTriggeredOnParentRoute) {
20702
+ if (actionShouldAlsoBeTriggeredOnParentRoute) {
21180
20703
  return true;
21181
20704
  }
21182
20705
  }
21183
20706
  }
21184
20707
  });
21185
20708
  ```
21186
- @property actions
20709
+ @property actions
21187
20710
  @type Object
21188
20711
  @default null
21189
20712
  @public
@@ -21193,14 +20716,14 @@ define("@ember/-internals/runtime/lib/mixins/action_handler", ["exports", "@embe
21193
20716
  Triggers a named action on the `ActionHandler`. Any parameters
21194
20717
  supplied after the `actionName` string will be passed as arguments
21195
20718
  to the action target function.
21196
- If the `ActionHandler` has its `target` property set, actions may
20719
+ If the `ActionHandler` has its `target` property set, actions may
21197
20720
  bubble to the `target`. Bubbling happens when an `actionName` can
21198
20721
  not be found in the `ActionHandler`'s `actions` hash or if the
21199
20722
  action target function returns `true`.
21200
- Example
21201
- ```app/routes/welcome.js
20723
+ Example
20724
+ ```app/routes/welcome.js
21202
20725
  import Route from '@ember/routing/route';
21203
- export default Route.extend({
20726
+ export default Route.extend({
21204
20727
  actions: {
21205
20728
  playTheme() {
21206
20729
  this.send('playMusic', 'theme.mp3');
@@ -21211,7 +20734,7 @@ define("@ember/-internals/runtime/lib/mixins/action_handler", ["exports", "@embe
21211
20734
  }
21212
20735
  });
21213
20736
  ```
21214
- @method send
20737
+ @method send
21215
20738
  @param {String} actionName The action to trigger
21216
20739
  @param {*} context a context to send with the action
21217
20740
  @public
@@ -26486,6 +26009,8 @@ define("@ember/-internals/utils/index", ["exports", "@glimmer/util", "@ember/deb
26486
26009
  }
26487
26010
 
26488
26011
  var key = keys[i];
26012
+ (true && !(key) && (0, _debug.assert)('has key', key)); // Looping over array
26013
+
26489
26014
  s += `${inspectKey(key)}: ${inspectValue(obj[key], depth, seen)}`;
26490
26015
  }
26491
26016
 
@@ -28020,6 +27545,7 @@ define("@ember/-internals/views/lib/system/utils", ["exports", "@ember/-internal
28020
27545
  var rootViews = [];
28021
27546
  Object.keys(registry).forEach(id => {
28022
27547
  var view = registry[id];
27548
+ (true && !(view) && (0, _debug.assert)('expected view', view));
28023
27549
 
28024
27550
  if (view.parentView === null) {
28025
27551
  rootViews.push(view);
@@ -30132,8 +29658,8 @@ define("@ember/canary-features/index", ["exports", "@ember/-internals/environmen
30132
29658
  @public
30133
29659
  */
30134
29660
  var DEFAULT_FEATURES = {
30135
- EMBER_LIBRARIES_ISREGISTERED: null,
30136
- EMBER_IMPROVED_INSTRUMENTATION: null,
29661
+ EMBER_LIBRARIES_ISREGISTERED: false,
29662
+ EMBER_IMPROVED_INSTRUMENTATION: false,
30137
29663
  EMBER_NAMED_BLOCKS: true,
30138
29664
  EMBER_GLIMMER_HELPER_MANAGER: true,
30139
29665
  EMBER_GLIMMER_INVOKE_HELPER: true,
@@ -30301,62 +29827,14 @@ define("@ember/controller/index", ["exports", "@ember/-internals/runtime", "@emb
30301
29827
  _exports.default = void 0;
30302
29828
  _exports.inject = inject;
30303
29829
 
30304
- /**
30305
- @module @ember/controller
30306
- */
29830
+ class Controller extends _runtime.FrameworkObject.extend(_controller_mixin.default) {}
30307
29831
 
30308
- /**
30309
- @class Controller
30310
- @extends EmberObject
30311
- @uses Ember.ControllerMixin
30312
- @public
30313
- */
30314
- var Controller = _runtime.FrameworkObject.extend(_controller_mixin.default);
30315
- /**
30316
- Creates a property that lazily looks up another controller in the container.
30317
- Can only be used when defining another controller.
30318
-
30319
- Example:
30320
-
30321
- ```app/controllers/post.js
30322
- import Controller, {
30323
- inject as controller
30324
- } from '@ember/controller';
30325
-
30326
- export default class PostController extends Controller {
30327
- @controller posts;
29832
+ function inject() {
29833
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
29834
+ args[_key] = arguments[_key];
30328
29835
  }
30329
- ```
30330
-
30331
- Classic Class Example:
30332
-
30333
- ```app/controllers/post.js
30334
- import Controller, {
30335
- inject as controller
30336
- } from '@ember/controller';
30337
-
30338
- export default Controller.extend({
30339
- posts: controller()
30340
- });
30341
- ```
30342
-
30343
- This example will create a `posts` property on the `post` controller that
30344
- looks up the `posts` controller in the container, making it easy to reference
30345
- other controllers.
30346
-
30347
- @method inject
30348
- @static
30349
- @for @ember/controller
30350
- @since 1.10.0
30351
- @param {String} name (optional) name of the controller to inject, defaults to
30352
- the property's name
30353
- @return {ComputedDecorator} injection decorator instance
30354
- @public
30355
- */
30356
-
30357
29836
 
30358
- function inject() {
30359
- return (0, _metal.inject)('controller', ...arguments);
29837
+ return (0, _metal.inject)('controller', ...args);
30360
29838
  }
30361
29839
 
30362
29840
  var _default = Controller;
@@ -32245,7 +31723,7 @@ define("@ember/helper/index", ["exports", "@glimmer/manager", "@glimmer/runtime"
32245
31723
  }
32246
31724
  });
32247
31725
  });
32248
- define("@ember/instrumentation/index", ["exports", "@ember/-internals/environment"], function (_exports, _environment) {
31726
+ define("@ember/instrumentation/index", ["exports", "@ember/-internals/environment", "@ember/debug"], function (_exports, _environment, _debug) {
32249
31727
  "use strict";
32250
31728
 
32251
31729
  Object.defineProperty(_exports, "__esModule", {
@@ -32324,11 +31802,8 @@ define("@ember/instrumentation/index", ["exports", "@ember/-internals/environmen
32324
31802
 
32325
31803
  function populateListeners(name) {
32326
31804
  var listeners = [];
32327
- var subscriber;
32328
-
32329
- for (var i = 0; i < subscribers.length; i++) {
32330
- subscriber = subscribers[i];
32331
31805
 
31806
+ for (var subscriber of subscribers) {
32332
31807
  if (subscriber.regex.test(name)) {
32333
31808
  listeners.push(subscriber.object);
32334
31809
  }
@@ -32433,19 +31908,20 @@ define("@ember/instrumentation/index", ["exports", "@ember/-internals/environmen
32433
31908
  var beforeValues = [];
32434
31909
  var timestamp = time();
32435
31910
 
32436
- for (var i = 0; i < listeners.length; i++) {
32437
- var listener = listeners[i];
31911
+ for (var listener of listeners) {
32438
31912
  beforeValues.push(listener.before(name, timestamp, payload));
32439
31913
  }
32440
31914
 
31915
+ var constListeners = listeners;
32441
31916
  return function _instrumentEnd() {
32442
31917
  var timestamp = time();
32443
31918
 
32444
- for (var _i = 0; _i < listeners.length; _i++) {
32445
- var _listener = listeners[_i];
31919
+ for (var i = 0; i < constListeners.length; i++) {
31920
+ var _listener = constListeners[i];
31921
+ (true && !(_listener) && (0, _debug.assert)('has listener', _listener)); // Iterating over values
32446
31922
 
32447
31923
  if (typeof _listener.after === 'function') {
32448
- _listener.after(name, timestamp, payload, beforeValues[_i]);
31924
+ _listener.after(name, timestamp, payload, beforeValues[i]);
32449
31925
  }
32450
31926
  }
32451
31927
 
@@ -32471,12 +31947,9 @@ define("@ember/instrumentation/index", ["exports", "@ember/-internals/environmen
32471
31947
 
32472
31948
  function subscribe(pattern, object) {
32473
31949
  var paths = pattern.split('.');
32474
- var path;
32475
31950
  var regexes = [];
32476
31951
 
32477
- for (var i = 0; i < paths.length; i++) {
32478
- path = paths[i];
32479
-
31952
+ for (var path of paths) {
32480
31953
  if (path === '*') {
32481
31954
  regexes.push('[^\\.]*');
32482
31955
  } else {
@@ -35305,6 +34778,19 @@ define("@ember/routing/route", ["exports", "@ember/-internals/routing"], functio
35305
34778
  }
35306
34779
  });
35307
34780
  });
34781
+ define("@ember/routing/router-service", ["exports", "@ember/-internals/routing"], function (_exports, _routing) {
34782
+ "use strict";
34783
+
34784
+ Object.defineProperty(_exports, "__esModule", {
34785
+ value: true
34786
+ });
34787
+ Object.defineProperty(_exports, "default", {
34788
+ enumerable: true,
34789
+ get: function () {
34790
+ return _routing.RouterService;
34791
+ }
34792
+ });
34793
+ });
35308
34794
  define("@ember/routing/router", ["exports", "@ember/-internals/routing"], function (_exports, _routing) {
35309
34795
  "use strict";
35310
34796
 
@@ -36130,75 +35616,20 @@ define("@ember/service/index", ["exports", "@ember/-internals/runtime", "@ember/
36130
35616
  _exports.inject = inject;
36131
35617
  _exports.service = service;
36132
35618
 
36133
- /**
36134
- @module @ember/service
36135
- @public
36136
- */
36137
-
36138
- /**
36139
- @method inject
36140
- @static
36141
- @since 1.10.0
36142
- @for @ember/service
36143
- @param {String} name (optional) name of the service to inject, defaults to
36144
- the property's name
36145
- @return {ComputedDecorator} injection decorator instance
36146
- @public
36147
- */
36148
35619
  function inject() {
36149
- return (0, _metal.inject)('service', ...arguments);
36150
- }
36151
- /**
36152
- Creates a property that lazily looks up a service in the container. There are
36153
- no restrictions as to what objects a service can be injected into.
36154
-
36155
- Example:
36156
-
36157
- ```app/routes/application.js
36158
- import Route from '@ember/routing/route';
36159
- import { service } from '@ember/service';
36160
-
36161
- export default class ApplicationRoute extends Route {
36162
- @service('auth') authManager;
36163
-
36164
- model() {
36165
- return this.authManager.findCurrentUser();
36166
- }
35620
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
35621
+ args[_key] = arguments[_key];
36167
35622
  }
36168
- ```
36169
-
36170
- Classic Class Example:
36171
-
36172
- ```app/routes/application.js
36173
- import Route from '@ember/routing/route';
36174
- import { service } from '@ember/service';
36175
-
36176
- export default Route.extend({
36177
- authManager: service('auth'),
36178
-
36179
- model() {
36180
- return this.get('authManager').findCurrentUser();
36181
- }
36182
- });
36183
- ```
36184
-
36185
- This example will create an `authManager` property on the application route
36186
- that looks up the `auth` service in the container, making it easily accessible
36187
- in the `model` hook.
36188
-
36189
- @method service
36190
- @static
36191
- @since 4.1.0
36192
- @for @ember/service
36193
- @param {String} name (optional) name of the service to inject, defaults to
36194
- the property's name
36195
- @return {ComputedDecorator} injection decorator instance
36196
- @public
36197
- */
36198
35623
 
35624
+ return (0, _metal.inject)('service', ...args);
35625
+ }
36199
35626
 
36200
35627
  function service() {
36201
- return (0, _metal.inject)('service', ...arguments);
35628
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
35629
+ args[_key2] = arguments[_key2];
35630
+ }
35631
+
35632
+ return (0, _metal.inject)('service', ...args);
36202
35633
  }
36203
35634
  /**
36204
35635
  @class Service
@@ -36208,13 +35639,10 @@ define("@ember/service/index", ["exports", "@ember/-internals/runtime", "@ember/
36208
35639
  */
36209
35640
 
36210
35641
 
36211
- var Service = _runtime.FrameworkObject.extend();
35642
+ class Service extends _runtime.FrameworkObject {}
36212
35643
 
36213
- Service.reopenClass({
36214
- isServiceFactory: true
36215
- });
36216
- var _default = Service;
36217
- _exports.default = _default;
35644
+ _exports.default = Service;
35645
+ Service.isServiceFactory = true;
36218
35646
  });
36219
35647
  define("@ember/string/index", ["exports", "@ember/string/lib/string_registry", "@ember/-internals/utils", "@ember/debug", "@ember/-internals/glimmer"], function (_exports, _string_registry, _utils, _debug, _glimmer) {
36220
35648
  "use strict";
@@ -56220,7 +55648,7 @@ define("ember/version", ["exports"], function (_exports) {
56220
55648
  value: true
56221
55649
  });
56222
55650
  _exports.default = void 0;
56223
- var _default = "4.3.0-alpha.4";
55651
+ var _default = "4.3.0";
56224
55652
  _exports.default = _default;
56225
55653
  });
56226
55654
  define("route-recognizer", ["exports"], function (_exports) {
@@ -57187,18 +56615,25 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
57187
56615
  if (len && len > 0) {
57188
56616
  var obj = array[len - 1];
57189
56617
 
57190
- if (isQueryParams(obj)) {
56618
+ if (isQueryParamsContainer(obj)) {
57191
56619
  queryParams = obj.queryParams;
57192
56620
  head = slice.call(array, 0, len - 1);
57193
56621
  return [head, queryParams];
57194
56622
  }
57195
- }
56623
+ } // SAFETY: We confirmed that the last item isn't a QP container
56624
+
57196
56625
 
57197
56626
  return [array, null];
57198
- }
56627
+ } // TODO: Actually check that Dict is QueryParams
56628
+
57199
56629
 
57200
- function isQueryParams(obj) {
57201
- return obj && hasOwnProperty.call(obj, 'queryParams');
56630
+ function isQueryParamsContainer(obj) {
56631
+ if (obj && typeof obj === 'object') {
56632
+ var cast = obj;
56633
+ return 'queryParams' in cast && Object.keys(cast.queryParams).every(k => typeof k === 'string');
56634
+ }
56635
+
56636
+ return false;
57202
56637
  }
57203
56638
  /**
57204
56639
  @private
@@ -57717,14 +57152,16 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
57717
57152
  paramNames,
57718
57153
  context,
57719
57154
  route
57720
- } = info;
57155
+ } = info; // SAFETY: This should be safe since it is just for use as a key
57156
+
57157
+ var key = info;
57721
57158
 
57722
- if (ROUTE_INFOS.has(info) && includeAttributes) {
57723
- var _routeInfo = ROUTE_INFOS.get(info);
57159
+ if (ROUTE_INFOS.has(key) && includeAttributes) {
57160
+ var _routeInfo = ROUTE_INFOS.get(key);
57724
57161
 
57725
57162
  _routeInfo = attachMetadata(route, _routeInfo);
57726
57163
  var routeInfoWithAttribute = createRouteInfoWithAttributes(_routeInfo, context);
57727
- ROUTE_INFOS.set(info, routeInfoWithAttribute);
57164
+ ROUTE_INFOS.set(key, routeInfoWithAttribute);
57728
57165
  return routeInfoWithAttribute;
57729
57166
  }
57730
57167
 
@@ -57734,10 +57171,12 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
57734
57171
  var arr = [];
57735
57172
 
57736
57173
  if (predicate.length === 3) {
57737
- arr = routeInfos.map(info => ROUTE_INFOS.get(info));
57174
+ arr = routeInfos.map( // SAFETY: This should be safe since it is just for use as a key
57175
+ info => ROUTE_INFOS.get(info));
57738
57176
  }
57739
57177
 
57740
57178
  for (var _i = 0; routeInfos.length > _i; _i++) {
57179
+ // SAFETY: This should be safe since it is just for use as a key
57741
57180
  publicInfo = ROUTE_INFOS.get(routeInfos[_i]);
57742
57181
 
57743
57182
  if (predicate.call(thisArg, publicInfo, _i, arr)) {
@@ -57765,7 +57204,8 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
57765
57204
 
57766
57205
  if (parent === undefined) {
57767
57206
  return null;
57768
- }
57207
+ } // SAFETY: This should be safe since it is just for use as a key
57208
+
57769
57209
 
57770
57210
  return ROUTE_INFOS.get(parent);
57771
57211
  },
@@ -57775,7 +57215,8 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
57775
57215
 
57776
57216
  if (child === undefined) {
57777
57217
  return null;
57778
- }
57218
+ } // SAFETY: This should be safe since it is just for use as a key
57219
+
57779
57220
 
57780
57221
  return ROUTE_INFOS.get(child);
57781
57222
  },
@@ -57797,7 +57238,8 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
57797
57238
 
57798
57239
  if (includeAttributes) {
57799
57240
  routeInfo = createRouteInfoWithAttributes(routeInfo, context);
57800
- }
57241
+ } // SAFETY: This should be safe since it is just for use as a key
57242
+
57801
57243
 
57802
57244
  ROUTE_INFOS.set(info, routeInfo);
57803
57245
  return routeInfo;
@@ -57889,13 +57331,15 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
57889
57331
 
57890
57332
  if ('context' in this || !contextsMatch) {
57891
57333
  context = resolvedContext;
57892
- }
57334
+ } // SAFETY: Since this is just for lookup, it should be safe
57335
+
57893
57336
 
57894
57337
  var cached = ROUTE_INFOS.get(this);
57895
57338
  var resolved = new ResolvedRouteInfo(this.router, this.name, this.paramNames, params, this.route, context);
57896
57339
 
57897
57340
  if (cached !== undefined) {
57898
- ROUTE_INFOS.set(resolved, cached);
57341
+ // SAFETY: This is potentially a bit risker, but for what we're doing, it should be ok.
57342
+ ROUTE_INFOS.set(this, cached);
57899
57343
  }
57900
57344
 
57901
57345
  return resolved;
@@ -57993,12 +57437,14 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
57993
57437
  // Ignore the fulfilled value returned from afterModel.
57994
57438
  // Return the value stashed in resolvedModels, which
57995
57439
  // might have been swapped out in afterModel.
57440
+ // SAFTEY: We expect this to be of type T, though typing it as such is challenging.
57996
57441
  return transition.resolvedModels[name];
57997
57442
  });
57998
57443
  }
57999
57444
 
58000
57445
  stashResolvedModel(transition, resolvedModel) {
58001
- transition.resolvedModels = transition.resolvedModels || {};
57446
+ transition.resolvedModels = transition.resolvedModels || {}; // SAFETY: It's unfortunate that we have to do this cast. It should be safe though.
57447
+
58002
57448
  transition.resolvedModels[this.name] = resolvedModel;
58003
57449
  }
58004
57450
 
@@ -58052,7 +57498,10 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58052
57498
  constructor(router, name, paramNames, params, route) {
58053
57499
  super(router, name, paramNames, route);
58054
57500
  this.params = {};
58055
- this.params = params;
57501
+
57502
+ if (params) {
57503
+ this.params = params;
57504
+ }
58056
57505
  }
58057
57506
 
58058
57507
  getModel(transition) {
@@ -58065,7 +57514,7 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58065
57514
  }
58066
57515
 
58067
57516
  var route = this.route;
58068
- var result;
57517
+ var result; // FIXME: Review these casts
58069
57518
 
58070
57519
  if (route.deserialize) {
58071
57520
  result = route.deserialize(fullParams, transition);
@@ -58112,6 +57561,8 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58112
57561
  } = this;
58113
57562
 
58114
57563
  if (!model) {
57564
+ // SAFETY: By the time we serialize, we expect to be resolved.
57565
+ // This may not be an entirely safe assumption though no tests fail.
58115
57566
  model = context;
58116
57567
  }
58117
57568
 
@@ -58139,6 +57590,7 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58139
57590
  var name = paramNames[0];
58140
57591
 
58141
57592
  if (/_id$/.test(name)) {
57593
+ // SAFETY: Model is supposed to extend IModel already
58142
57594
  object[name] = model.id;
58143
57595
  } else {
58144
57596
  object[name] = model;
@@ -58150,14 +57602,14 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58150
57602
  }
58151
57603
 
58152
57604
  function paramsMatch(a, b) {
58153
- if (!a !== !b) {
58154
- // Only one is null.
58155
- return false;
57605
+ if (a === b) {
57606
+ // Both are identical, may both be undefined
57607
+ return true;
58156
57608
  }
58157
57609
 
58158
- if (!a) {
58159
- // Both must be null.
58160
- return true;
57610
+ if (!a || !b) {
57611
+ // Only one is undefined, already checked they aren't identical
57612
+ return false;
58161
57613
  } // Note: this assumes that both params have the same
58162
57614
  // number of keys, but since we're comparing the
58163
57615
  // same routes, they should.
@@ -58201,7 +57653,8 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58201
57653
  }
58202
57654
 
58203
57655
  var routeInfo = currentState.routeInfos[transition.resolveIndex];
58204
- return routeInfo.resolve(transition).then(proceed.bind(null, currentState, transition), null, currentState.promiseLabel('Proceed'));
57656
+ var callback = proceed.bind(null, currentState, transition);
57657
+ return routeInfo.resolve(transition).then(callback, null, currentState.promiseLabel('Proceed'));
58205
57658
  }
58206
57659
 
58207
57660
  function proceed(currentState, transition, resolvedRouteInfo) {
@@ -58260,9 +57713,11 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58260
57713
  params[routeInfo.name] = routeInfo.params || {};
58261
57714
  return true;
58262
57715
  });
58263
- transition.resolveIndex = 0; // The prelude RSVP.resolve() async moves us into the promise land.
57716
+ transition.resolveIndex = 0;
57717
+ var callback = resolveOneRouteInfo.bind(null, this, transition);
57718
+ var errorHandler = handleError.bind(null, this, transition); // The prelude RSVP.resolve() async moves us into the promise land.
58264
57719
 
58265
- return _rsvp.Promise.resolve(null, this.promiseLabel('Start transition')).then(resolveOneRouteInfo.bind(null, this, transition), null, this.promiseLabel('Resolve route')).catch(handleError.bind(null, this, transition), this.promiseLabel('Handle error')).then(() => this);
57720
+ return _rsvp.Promise.resolve(null, this.promiseLabel('Start transition')).then(callback, null, this.promiseLabel('Resolve route')).catch(errorHandler, this.promiseLabel('Handle error')).then(() => this);
58266
57721
  }
58267
57722
 
58268
57723
  }
@@ -58300,10 +57755,7 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58300
57755
  }
58301
57756
 
58302
57757
  applyToState(oldState, isIntermediate) {
58303
- // TODO: WTF fix me
58304
- var partitionedArgs = extractQueryParams([this.name].concat(this.contexts)),
58305
- pureArgs = partitionedArgs[0],
58306
- handlers = this.router.recognizer.handlersFor(pureArgs[0]);
57758
+ var handlers = this.router.recognizer.handlersFor(this.name);
58307
57759
  var targetRouteName = handlers[handlers.length - 1].handler;
58308
57760
  return this.applyToHandlers(oldState, handlers, targetRouteName, isIntermediate, false);
58309
57761
  }
@@ -58347,7 +57799,8 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58347
57799
  // If we're performing an isActive check, we want to
58348
57800
  // serialize URL params with the provided context, but
58349
57801
  // ignore mismatches between old and new context.
58350
- newHandlerInfo = newHandlerInfo.becomeResolved(null, newHandlerInfo.context);
57802
+ newHandlerInfo = newHandlerInfo.becomeResolved(null, // SAFETY: This seems to imply that it would be resolved, but it's unclear if that's actually the case.
57803
+ newHandlerInfo.context);
58351
57804
  var oldContext = oldHandlerInfo && oldHandlerInfo.context;
58352
57805
 
58353
57806
  if (result.names.length > 0 && oldHandlerInfo.context !== undefined && newHandlerInfo.context === oldContext) {
@@ -58368,7 +57821,8 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58368
57821
  }
58369
57822
 
58370
57823
  if (isIntermediate && !checkingIfActive) {
58371
- handlerToUse = handlerToUse.becomeResolved(null, handlerToUse.context);
57824
+ handlerToUse = handlerToUse.becomeResolved(null, // SAFETY: This seems to imply that it would be resolved, but it's unclear if that's actually the case.
57825
+ handlerToUse.context);
58372
57826
  }
58373
57827
 
58374
57828
  newState.routeInfos.unshift(handlerToUse);
@@ -58425,7 +57879,7 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58425
57879
  } else {
58426
57880
  if (this.preTransitionState) {
58427
57881
  var preTransitionHandlerInfo = this.preTransitionState.routeInfos[i];
58428
- objectToUse = preTransitionHandlerInfo && preTransitionHandlerInfo.context;
57882
+ objectToUse = preTransitionHandlerInfo === null || preTransitionHandlerInfo === void 0 ? void 0 : preTransitionHandlerInfo.context;
58429
57883
  } else {
58430
57884
  // Ideally we should throw this error to provide maximal
58431
57885
  // information to the user that not enough context objects
@@ -58690,7 +58144,8 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58690
58144
  if (queryParamChangelist) {
58691
58145
  var _newTransition = this.queryParamsTransition(queryParamChangelist, wasTransitioning, oldState, newState);
58692
58146
 
58693
- _newTransition.queryParamsOnly = true;
58147
+ _newTransition.queryParamsOnly = true; // SAFETY: The returned OpaqueTransition should actually be this.
58148
+
58694
58149
  return _newTransition;
58695
58150
  } // No-op. No need to create a new transition.
58696
58151
 
@@ -58760,6 +58215,8 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58760
58215
  var queryParams = {};
58761
58216
 
58762
58217
  if (lastArg !== undefined && lastArg.hasOwnProperty('queryParams')) {
58218
+ // We just checked this.
58219
+ // TODO: Use an assertion?
58763
58220
  queryParams = modelsArray.pop().queryParams;
58764
58221
  }
58765
58222
 
@@ -58778,7 +58235,8 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
58778
58235
  intent = new URLTransitionIntent(this, name);
58779
58236
  } else {
58780
58237
  log(this, 'Attempting transition to ' + name);
58781
- intent = new NamedTransitionIntent(this, name, undefined, modelsArray, queryParams);
58238
+ intent = new NamedTransitionIntent(this, name, undefined, // SAFETY: We know this to be the case since we removed the last item if it was QPs
58239
+ modelsArray, queryParams);
58782
58240
  }
58783
58241
 
58784
58242
  return this.transitionByIntent(intent, isIntermediate);
@@ -59400,8 +58858,8 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
59400
58858
  args[_key6 - 1] = arguments[_key6];
59401
58859
  }
59402
58860
 
59403
- var partitionedArgs = extractQueryParams(args);
59404
- return this.isActiveIntent(routeName, partitionedArgs[0], partitionedArgs[1]);
58861
+ var [contexts, queryParams] = extractQueryParams(args);
58862
+ return this.isActiveIntent(routeName, contexts, queryParams);
59405
58863
  }
59406
58864
 
59407
58865
  trigger(name) {
@@ -59420,6 +58878,7 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
59420
58878
  }
59421
58879
 
59422
58880
  for (var i = 0, len = routeInfos.length; i < len; ++i) {
58881
+ // SAFETY: Just casting for comparison
59423
58882
  if (routeInfos[i] !== otherRouteInfos[i]) {
59424
58883
  return false;
59425
58884
  }
@@ -59447,10 +58906,13 @@ define("router_js", ["exports", "rsvp", "route-recognizer"], function (_exports,
59447
58906
  }
59448
58907
 
59449
58908
  function paramsEqual(params, otherParams) {
59450
- if (!params && !otherParams) {
58909
+ if (params === otherParams) {
58910
+ // Both identical or both undefined
59451
58911
  return true;
59452
- } else if (!params && !!otherParams || !!params && !otherParams) {
59453
- // one is falsy but other is not;
58912
+ }
58913
+
58914
+ if (!params || !otherParams) {
58915
+ // One is falsy but other is not
59454
58916
  return false;
59455
58917
  }
59456
58918