{"version":3,"file":"chunk.7539.cf27c0a80edfee2e4361.js","names":["Set","isElement","target","Reflect","get","Node","ELEMENT_NODE","isDocument","DOCUMENT_NODE","getRootElement","context","getContext","isTestContext","owner","Error","rootElement","undefined","_emberTestHelpersMockOwner","Window","document","_rootElement","querySelector","Map","maybeContext","pauseTest","resumeTest","check","it","Math","hasEmberVersion","WeakMap","Test","checkWaiters","registerDeprecationHandler","message","options","next","getDeprecationsForContext","push","apply","registerWarnHandler","getWarningsForContext","globalObject","globalThis","window","self","global","__test_context__","symbolName","symbol","Symbol","for","waiters","NoopTestWaiter","constructor","name","this","beginAsync","endAsync","waitUntil","debugInfo","reset","buildWaiter","waitForPromise","promise","label","OWNER","getOwner","object","setOwner","registerTestImplementation","EmberTesting","Adapter","EmberObject","extend","asyncStart","asyncEnd","exception","error","isVeryOldQunit","obj","stop","QUnitAdapter","args","super","QUnit","doneCallbacks","config","current","assert","async","start","done","pop","ok","inspect","protoWrap","proto","callback","isAsync","then","helper","app","helpers","fn","method","meta","wait","lastPromise","run","resolve","getLastPromise","finally","Application","reopen","testHelpers","originalMethods","testing","setupForTesting","resolveRegistration","location","helperContainer","injectTestHelpers","willDestroy","_super","arguments","removeTestHelpers","TestPromise","prototype","invokeInjectHelpersCallbacks","RSVP","configure","_backburner","schedule","registerAsyncHelper","visit","andThen","registerHelper","currentRouteName","currentPath","currentURL","routingService","__container__","lookup","router","getURL","resume","info","Promise","url","shouldHandleURL","boot","setURL","__deprecatedInstance__","_readinessDeferrals","initialURL","value","watcher","setInterval","_routerMicrolib","Boolean","activeTransition","pendingRequests","_hasScheduledTimers","_getCurrentRunLoop","clearInterval","onLoad","ApplicationClass","initializers","initializer","initialize","application","deferReadiness","setTesting","getAdapter","setAdapter","create","_helpers","_test_helpers_js__WEBPACK_IMPORTED_MODULE_0__","unregisterHelper","onInjectHelpers","_test_on_inject_helpers_js__WEBPACK_IMPORTED_MODULE_1__","_test_promise_js__WEBPACK_IMPORTED_MODULE_2__","registerWaiter","_test_waiters_js__WEBPACK_IMPORTED_MODULE_3__","unregisterWaiter","Object","defineProperty","set","adapter","setDispatchOverride","adapterDispatch","console","stack","helperMethod","callbacks","requests","length","executor","onFulfilled","onRejected","normalizedOnFulfilled","result","resolver","run$1","contexts","checkedCallback","checkedContext","indexOf","i","splice","call","helperCapabilities","managerAPI","debugAssert","buildCapabilities","hasValue","hasDestroyable","hasScheduledEffect","manager","capabilities","CustomHelperManager","factory","_defineProperty","getDelegateForOwner","delegate","helperManagerDelegates","getDelegateFor","undefinedDelegate","getHelper","definition","capturedArgs","argsProxyFor","bucket","createHelper","cache","createComputeRef","getValue","associateDestroyableChild","getDestroyable","ref","createConstRef","UNDEFINED_REFERENCE","FunctionHelperManager","keys","named","positional","getDebugName","COMPONENT_MANAGERS","MODIFIER_MANAGERS","HELPER_MANAGERS","getPrototypeOf","setManager","map","getManager","pointer","setInternalModifierManager","getInternalModifierManager","isOptional","setInternalHelperManager","DEFAULT_MANAGER","getInternalHelperManager","setInternalComponentManager","getInternalComponentManager","debugToString","hasInternalComponentManager","hasInternalHelperManager","hasInternalModifierManager","EMPTY_ARRAY","freeze","emptyArray","EMPTY_STRING_ARRAY","EMPTY_NUMBER_ARRAY","isEmptyArray","input","reverse","enumerate","item","zipTuples","left","right","zipArrays","perform","TEMPLATES","setComponentTemplate","getComponentTemplate","template"],"sources":["webpack://__ember_auto_import__/src/-internal/debug-info-helpers.ts","webpack://__ember_auto_import__/src/dom/-target.ts","webpack://__ember_auto_import__/src/dom/get-root-element.ts","webpack://__ember_auto_import__/src/helper-hooks.ts","webpack://__ember_auto_import__/src/setup-context.ts","webpack://__ember_auto_import__/src/setup-application-context.ts","webpack://__ember_auto_import__/src/settled.ts","webpack://__ember_auto_import__/src/setup-onerror.ts","webpack://__ember_auto_import__/src/test-metadata.ts","webpack://__ember_auto_import__/src/waiter-manager.ts","webpack://__ember_auto_import__/src/build-waiter.ts","webpack://__ember_auto_import__/src/wait-for-promise.ts","webpack://__ember_auto_import__/src/wait-for.ts","webpack://__ember_auto_import__/node_modules/ember-source/dist/packages/@glimmer/owner/index.js","webpack://__ember_auto_import__/node_modules/ember-source/dist/packages/ember-testing/index.js","webpack://__ember_auto_import__/node_modules/ember-source/dist/packages/ember-testing/lib/adapters/adapter.js","webpack://__ember_auto_import__/node_modules/ember-source/dist/packages/ember-testing/lib/adapters/qunit.js","webpack://__ember_auto_import__/node_modules/ember-source/dist/packages/ember-testing/lib/ext/application.js","webpack://__ember_auto_import__/node_modules/ember-source/dist/packages/ember-testing/lib/ext/rsvp.js","webpack://__ember_auto_import__/node_modules/ember-source/dist/packages/ember-testing/lib/helpers.js","webpack://__ember_auto_import__/node_modules/ember-source/dist/packages/ember-testing/lib/helpers/and_then.js","webpack://__ember_auto_import__/node_modules/ember-source/dist/packages/ember-testing/lib/helpers/current_path.js","webpack://__ember_auto_import__/node_modules/ember-source/dist/packages/ember-testing/lib/helpers/current_route_name.js","webpack://__ember_auto_import__/node_modules/ember-source/dist/packages/ember-testing/lib/helpers/current_url.js","webpack://__ember_auto_import__/node_modules/ember-source/dist/packages/ember-testing/lib/helpers/pause_test.js","webpack://__ember_auto_import__/node_modules/ember-source/dist/packages/ember-testing/lib/helpers/visit.js","webpack://__ember_auto_import__/node_modules/ember-source/dist/packages/ember-testing/lib/helpers/wait.js","webpack://__ember_auto_import__/node_modules/ember-source/dist/packages/ember-testing/lib/initializers.js","webpack://__ember_auto_import__/node_modules/ember-source/dist/packages/ember-testing/lib/setup_for_testing.js","webpack://__ember_auto_import__/node_modules/ember-source/dist/packages/ember-testing/lib/test.js","webpack://__ember_auto_import__/node_modules/ember-source/dist/packages/ember-testing/lib/test/adapter.js","webpack://__ember_auto_import__/node_modules/ember-source/dist/packages/ember-testing/lib/test/helpers.js","webpack://__ember_auto_import__/node_modules/ember-source/dist/packages/ember-testing/lib/test/on_inject_helpers.js","webpack://__ember_auto_import__/node_modules/ember-source/dist/packages/ember-testing/lib/test/pending_requests.js","webpack://__ember_auto_import__/node_modules/ember-source/dist/packages/ember-testing/lib/test/promise.js","webpack://__ember_auto_import__/node_modules/ember-source/dist/packages/ember-testing/lib/test/run.js","webpack://__ember_auto_import__/node_modules/ember-source/dist/packages/ember-testing/lib/test/waiters.js","webpack://__ember_auto_import__/node_modules/ember-source/dist/packages/shared-chunks/api-CkUl6KyJ.js","webpack://__ember_auto_import__/node_modules/ember-source/dist/packages/shared-chunks/array-utils-CZQxrdD3.js","webpack://__ember_auto_import__/node_modules/ember-source/dist/packages/shared-chunks/template-CMHIG4cn.js"],"sourcesContent":["export interface DebugInfoHelper {\n  name: string;\n  log: () => void;\n}\n\nexport const debugInfoHelpers = new Set<DebugInfoHelper>();\n\n/**\n * Registers a custom debug info helper to augment the output for test isolation validation.\n *\n * @public\n * @param {DebugInfoHelper} debugHelper a custom debug info helper\n * @example\n *\n * import { registerDebugInfoHelper } from '@ember/test-helpers';\n *\n * registerDebugInfoHelper({\n *   name: 'Date override detection',\n *   log() {\n *     if (dateIsOverridden()) {\n *       console.log(this.name);\n *       console.log('The date object has been overridden');\n *     }\n *   }\n * })\n */\nexport default function registerDebugInfoHelper(debugHelper: DebugInfoHelper) {\n  debugInfoHelpers.add(debugHelper);\n}\n","import type { IDOMElementDescriptor } from 'dom-element-descriptors';\n\nexport type Target =\n  | string\n  | Element\n  | IDOMElementDescriptor\n  | Document\n  | Window;\n\nexport interface HTMLElementContentEditable extends HTMLElement {\n  isContentEditable: true;\n}\n\n// eslint-disable-next-line require-jsdoc\nexport function isElement(target: unknown): target is Element {\n  return (\n    target !== null &&\n    typeof target === 'object' &&\n    Reflect.get(target, 'nodeType') === Node.ELEMENT_NODE\n  );\n}\n\n// eslint-disable-next-line require-jsdoc\nexport function isWindow(target: Target): target is Window {\n  return target instanceof Window;\n}\n\n// eslint-disable-next-line require-jsdoc\nexport function isDocument(target: unknown): target is Document {\n  return (\n    target !== null &&\n    typeof target === 'object' &&\n    Reflect.get(target, 'nodeType') === Node.DOCUMENT_NODE\n  );\n}\n\n// eslint-disable-next-line require-jsdoc\nexport function isContentEditable(\n  element: Element,\n): element is HTMLElementContentEditable {\n  return (\n    'isContentEditable' in element && (element as HTMLElement).isContentEditable\n  );\n}\n","import { getContext, isTestContext } from '../setup-context.ts';\nimport { isDocument, isElement } from './-target.ts';\n\n/**\n  Get the root element of the application under test (usually `#ember-testing`)\n\n  @public\n  @returns {Element} the root element\n\n  @example\n  <caption>\n    Getting the root element of the application and checking that it is equal\n    to the element with id 'ember-testing'.\n  </caption>\n  assert.equal(getRootElement(), document.querySelector('#ember-testing'));\n*/\nexport default function getRootElement(): Element | Document {\n  const context = getContext();\n\n  if (!context || !isTestContext(context) || !context.owner) {\n    throw new Error(\n      'Must setup rendering context before attempting to interact with elements.',\n    );\n  }\n\n  const owner = context.owner;\n\n  let rootElement;\n  // When the host app uses `setApplication` (instead of `setResolver`) the owner has\n  // a `rootElement` set on it with the element or id to be used\n  if (owner && owner._emberTestHelpersMockOwner === undefined) {\n    rootElement = owner.rootElement;\n  } else {\n    rootElement = '#ember-testing';\n  }\n\n  if (rootElement instanceof Window) {\n    rootElement = rootElement.document;\n  }\n\n  if (isElement(rootElement) || isDocument(rootElement)) {\n    return rootElement;\n  } else if (typeof rootElement === 'string') {\n    const _rootElement = document.querySelector(rootElement);\n    if (_rootElement) {\n      return _rootElement;\n    }\n\n    throw new Error(`Application.rootElement (${rootElement}) not found`);\n  } else {\n    throw new Error(\n      'Application.rootElement must be an element or a selector string',\n    );\n  }\n}\n","export type Hook = (...args: any[]) => void | Promise<void>;\nexport type HookLabel = 'start' | 'end' | 'targetFound';\nexport type HookUnregister = {\n  unregister: () => void;\n};\n\nconst registeredHooks = new Map<string, Set<Hook>>();\n\n/**\n * @private\n * @param {string} helperName The name of the test helper in which to run the hook.\n * @param {string} label A label to help identify the hook.\n * @returns {string} The compound key for the helper.\n */\nfunction getHelperKey(helperName: string, label: string): string {\n  return `${helperName}:${label}`;\n}\n\n/**\n * Registers a function to be run during the invocation of a test helper.\n *\n * @param {string} helperName The name of the test helper in which to run the hook.\n *                            Test helper names include `blur`, `click`, `doubleClick`, `fillIn`,\n *                            `fireEvent`, `focus`, `render`, `scrollTo`, `select`, `tab`, `tap`, `triggerEvent`,\n *                            `triggerKeyEvent`, `typeIn`, and `visit`.\n * @param {string} label A label to help identify the hook. Built-in labels include `start`, `end`,\n *                       and `targetFound`, the former designating either the start or end of\n *                       the helper invocation.\n * @param {Function} hook The hook function to run when the test helper is invoked.\n * @returns {HookUnregister} An object containing an `unregister` function that unregisters\n *                           the specific hook initially registered to the helper.\n * @example\n * <caption>\n *   Registering a hook for the `end` point of the `click` test helper invocation\n * </caption>\n *\n * const hook = registerHook('click', 'end', () => {\n *   console.log('Running `click:end` test helper hook');\n * });\n *\n * // Unregister the hook at some later point in time\n * hook.unregister();\n */\nexport function registerHook(\n  helperName: string,\n  label: HookLabel,\n  hook: Hook,\n): HookUnregister {\n  const helperKey = getHelperKey(helperName, label);\n  let hooksForHelper = registeredHooks.get(helperKey);\n\n  if (hooksForHelper === undefined) {\n    hooksForHelper = new Set<Hook>();\n    registeredHooks.set(helperKey, hooksForHelper);\n  }\n\n  hooksForHelper.add(hook);\n\n  return {\n    unregister() {\n      hooksForHelper!.delete(hook);\n    },\n  };\n}\n\n/**\n * Runs all hooks registered for a specific test helper.\n *\n * @param {string} helperName The name of the test helper in which to run the hook.\n *                            Test helper names include `blur`, `click`, `doubleClick`, `fillIn`,\n *                            `fireEvent`, `focus`, `render`, `scrollTo`, `select`, `tab`, `tap`, `triggerEvent`,\n *                            `triggerKeyEvent`, `typeIn`, and `visit`.\n * @param {string} label A label to help identify the hook. Built-in labels include `start`, `end`,\n *                       and `targetFound`, the former designating either the start or end of\n *                       the helper invocation.\n * @param {unknown[]} args Any arguments originally passed to the test helper.\n * @returns {Promise<void>} A promise representing the serial invocation of the hooks.\n */\nexport function runHooks(\n  helperName: string,\n  label: HookLabel,\n  ...args: unknown[]\n): Promise<void> {\n  const hooks =\n    registeredHooks.get(getHelperKey(helperName, label)) || new Set<Hook>();\n  const promises: Array<void | Promise<void>> = [];\n\n  hooks.forEach((hook) => {\n    const hookResult = hook(...args);\n\n    promises.push(hookResult);\n  });\n\n  return Promise.all(promises).then(() => {});\n}\n","// @ts-ignore: this is private API. This import will work Ember 5.1+ since it\n// \"provides\" this public API, but does not for earlier versions. As a result,\n// this type will be `any`.\nimport { _backburner, run } from '@ember/runloop';\nimport { set, setProperties, get, getProperties } from '@ember/object';\nimport type { Resolver } from '@ember/owner';\nimport { setOwner } from '@ember/application';\n\nimport buildOwner, { type Owner } from './build-owner.ts';\nimport { _setupAJAXHooks } from './settled.ts';\nimport { _prepareOnerror } from './setup-onerror.ts';\nimport { setTesting } from '@ember/debug';\nimport {\n  assert,\n  registerDeprecationHandler,\n  registerWarnHandler,\n} from '@ember/debug';\nimport global from './global.ts';\nimport { getResolver } from './resolver.ts';\nimport { getApplication } from './application.ts';\nimport getTestMetadata from './test-metadata.ts';\nimport {\n  getDeprecationsForContext,\n  getDeprecationsDuringCallbackForContext,\n  type DeprecationFailure,\n} from './-internal/deprecations.ts';\nimport {\n  getWarningsForContext,\n  getWarningsDuringCallbackForContext,\n  type Warning,\n} from './-internal/warnings.ts';\n\nexport interface SetupContextOptions {\n  resolver?: Resolver | undefined;\n}\n\n// This handler exists to provide the underlying data to enable the following methods:\n// * getDeprecations()\n// * getDeprecationsDuringCallback()\n// * getDeprecationsDuringCallbackForContext()\nregisterDeprecationHandler((message, options, next) => {\n  const context = getContext();\n  if (context === undefined) {\n    next.apply(null, [message, options]);\n    return;\n  }\n\n  getDeprecationsForContext(context).push({ message, options });\n  next.apply(null, [message, options]);\n});\n\n// This handler exists to provide the underlying data to enable the following methods:\n// * getWarnings()\n// * getWarningsDuringCallback()\n// * getWarningsDuringCallbackForContext()\nregisterWarnHandler((message, options, next) => {\n  const context = getContext();\n  if (context === undefined) {\n    next.apply(null, [message, options]);\n    return;\n  }\n\n  getWarningsForContext(context).push({ message, options });\n  next.apply(null, [message, options]);\n});\n\nexport type BaseContext = object;\n\n/**\n * The public API for the test context, which test authors can depend on being\n * available.\n *\n * Note: this is *not* user-constructible; it becomes available by calling\n * `setupContext()` with a base context object.\n */\nexport interface TestContext extends BaseContext {\n  owner: Owner;\n\n  set<T>(key: string, value: T): T;\n  setProperties<T extends Record<string, unknown>>(hash: T): T;\n  get(key: string): unknown;\n  getProperties(...args: string[]): Record<string, unknown>;\n\n  pauseTest(): Promise<void>;\n  resumeTest(): void;\n}\n\n// eslint-disable-next-line require-jsdoc\nexport function isTestContext(context: BaseContext): context is TestContext {\n  const maybeContext = context as Record<string, unknown>;\n  return (\n    typeof maybeContext['pauseTest'] === 'function' &&\n    typeof maybeContext['resumeTest'] === 'function'\n  );\n}\n\n/**\n  @private\n  @param {Object} it the global object to test\n  @returns {Boolean} it exists\n*/\nfunction check(it: any) {\n  // Math is known to exist as a global in every environment.\n  return it && it.Math === Math && it;\n}\n\nconst globalObject =\n  check(typeof globalThis == 'object' && globalThis) ||\n  check(typeof window === 'object' && window) ||\n  check(typeof self === 'object' && self) ||\n  // @ts-ignore -- global does not exist\n  check(typeof global === 'object' && global);\n\n/**\n  Stores the provided context as the \"global testing context\".\n\n  Generally setup automatically by `setupContext`.\n\n  @public\n  @param {Object} context the context to use\n*/\nexport function setContext(context: BaseContext): void {\n  globalObject.__test_context__ = context;\n}\n\n/**\n  Retrieve the \"global testing context\" as stored by `setContext`.\n\n  @public\n  @returns {Object} the previously stored testing context\n*/\nexport function getContext(): BaseContext | undefined {\n  return globalObject.__test_context__;\n}\n\n/**\n  Clear the \"global testing context\".\n\n  Generally invoked from `teardownContext`.\n\n  @public\n*/\nexport function unsetContext(): void {\n  globalObject.__test_context__ = undefined;\n}\n\n/**\n * Returns a promise to be used to pauses the current test (due to being\n * returned from the test itself).  This is useful for debugging while testing\n * or for test-driving.  It allows you to inspect the state of your application\n * at any point.\n *\n * The test framework wrapper (e.g. `ember-qunit` or `ember-mocha`) should\n * ensure that when `pauseTest()` is used, any framework specific test timeouts\n * are disabled.\n *\n * @public\n * @returns {Promise<void>} resolves _only_ when `resumeTest()` is invoked\n * @example <caption>Usage via ember-qunit</caption>\n *\n * import { setupRenderingTest } from 'ember-qunit';\n * import { render, click, pauseTest } from '@ember/test-helpers';\n *\n *\n * module('awesome-sauce', function(hooks) {\n *   setupRenderingTest(hooks);\n *\n *   test('does something awesome', async function(assert) {\n *     await render(hbs`{{awesome-sauce}}`);\n *\n *     // added here to visualize / interact with the DOM prior\n *     // to the interaction below\n *     await pauseTest();\n *\n *     click('.some-selector');\n *\n *     assert.equal(this.element.textContent, 'this sauce is awesome!');\n *   });\n * });\n */\nexport function pauseTest(): Promise<void> {\n  const context = getContext();\n\n  if (!context || !isTestContext(context)) {\n    throw new Error(\n      'Cannot call `pauseTest` without having first called `setupTest` or `setupRenderingTest`.',\n    );\n  }\n\n  return context.pauseTest();\n}\n\n/**\n  Resumes a test previously paused by `await pauseTest()`.\n\n  @public\n*/\nexport function resumeTest(): void {\n  const context = getContext();\n\n  if (!context || !isTestContext(context)) {\n    throw new Error(\n      'Cannot call `resumeTest` without having first called `setupTest` or `setupRenderingTest`.',\n    );\n  }\n\n  context.resumeTest();\n}\n\n/**\n * Returns deprecations which have occurred so far for a the current test context\n *\n * @public\n * @returns {Array<DeprecationFailure>} An array of deprecation messages\n * @example <caption>Usage via ember-qunit</caption>\n *\n * import { getDeprecations } from '@ember/test-helpers';\n *\n * module('awesome-sauce', function(hooks) {\n *   setupRenderingTest(hooks);\n *\n *   test('does something awesome', function(assert) {\n       const deprecations = getDeprecations() // => returns deprecations which have occurred so far in this test\n *   });\n * });\n */\nexport function getDeprecations(): Array<DeprecationFailure> {\n  const context = getContext();\n\n  if (!context) {\n    throw new Error(\n      '[@ember/test-helpers] could not get deprecations if no test context is currently active',\n    );\n  }\n\n  return getDeprecationsForContext(context);\n}\n\nexport type { DeprecationFailure };\n\n/**\n * Returns deprecations which have occurred so far for a the current test context\n *\n * @public\n * @param {Function} [callback] The callback that when executed will have its DeprecationFailure recorded\n * @returns {Array<DeprecationFailure> | Promise<Array<DeprecationFailure>>} An array of deprecation messages\n * @example <caption>Usage via ember-qunit</caption>\n *\n * import { getDeprecationsDuringCallback } from '@ember/test-helpers';\n *\n * module('awesome-sauce', function(hooks) {\n *   setupRenderingTest(hooks);\n *\n *   test('does something awesome', function(assert) {\n *     const deprecations = getDeprecationsDuringCallback(() => {\n *       // code that might emit some deprecations\n *\n *     }); // => returns deprecations which occurred while the callback was invoked\n *   });\n *\n *\n *   test('does something awesome', async function(assert) {\n *     const deprecations = await getDeprecationsDuringCallback(async () => {\n *       // awaited code that might emit some deprecations\n *     }); // => returns deprecations which occurred while the callback was invoked\n *   });\n * });\n */\nexport function getDeprecationsDuringCallback(\n  callback: () => void,\n): Array<DeprecationFailure> | Promise<Array<DeprecationFailure>> {\n  const context = getContext();\n\n  if (!context) {\n    throw new Error(\n      '[@ember/test-helpers] could not get deprecations if no test context is currently active',\n    );\n  }\n\n  return getDeprecationsDuringCallbackForContext(context, callback);\n}\n\n/**\n * Returns warnings which have occurred so far for a the current test context\n *\n * @public\n * @returns {Array<Warning>} An array of warnings\n * @example <caption>Usage via ember-qunit</caption>\n *\n * import { getWarnings } from '@ember/test-helpers';\n *\n * module('awesome-sauce', function(hooks) {\n *   setupRenderingTest(hooks);\n *\n *   test('does something awesome', function(assert) {\n       const warnings = getWarnings() // => returns warnings which have occurred so far in this test\n *   });\n * });\n */\nexport function getWarnings(): Array<Warning> {\n  const context = getContext();\n\n  if (!context) {\n    throw new Error(\n      '[@ember/test-helpers] could not get warnings if no test context is currently active',\n    );\n  }\n\n  return getWarningsForContext(context);\n}\n\nexport type { Warning };\n\n/**\n * Returns warnings which have occurred so far for a the current test context\n *\n * @public\n * @param {Function} [callback] The callback that when executed will have its warnings recorded\n * @returns {Array<Warning> | Promise<Array<Warning>>} An array of warnings information\n * @example <caption>Usage via ember-qunit</caption>\n *\n * import { getWarningsDuringCallback } from '@ember/test-helpers';\n * import { warn } from '@ember/debug';\n *\n * module('awesome-sauce', function(hooks) {\n *   setupRenderingTest(hooks);\n *\n *   test('does something awesome', function(assert) {\n *     const warnings = getWarningsDuringCallback(() => {\n *     warn('some warning');\n *\n *     }); // => returns warnings which occurred while the callback was invoked\n *   });\n *\n *   test('does something awesome', async function(assert) {\n *     warn('some warning');\n *\n *     const warnings = await getWarningsDuringCallback(async () => {\n *       warn('some other warning');\n *     }); // => returns warnings which occurred while the callback was invoked\n *   });\n * });\n */\nexport function getWarningsDuringCallback(\n  callback: () => void,\n): Array<Warning> | Promise<Array<Warning>> {\n  const context = getContext();\n\n  if (!context) {\n    throw new Error(\n      '[@ember/test-helpers] could not get warnings if no test context is currently active',\n    );\n  }\n\n  return getWarningsDuringCallbackForContext(context, callback);\n}\n\n/**\n  Used by test framework addons to setup the provided context for testing.\n\n  Responsible for:\n\n  - sets the \"global testing context\" to the provided context (`setContext`)\n  - create an owner object and set it on the provided context (e.g. `this.owner`)\n  - setup `this.set`, `this.setProperties`, `this.get`, and `this.getProperties` to the provided context\n  - setting up AJAX listeners\n  - setting up `pauseTest` (also available as `this.pauseTest()`) and `resumeTest` helpers\n\n  @public\n  @param {Object} base the context to setup\n  @param {Object} [options] options used to override defaults\n  @param {Resolver} [options.resolver] a resolver to use for customizing normal resolution\n  @returns {Promise<Object>} resolves with the context that was setup\n*/\nexport default function setupContext<T extends object>(\n  base: T,\n  options: SetupContextOptions = {},\n): Promise<T & TestContext> {\n  const context = base as T & TestContext;\n\n  // SAFETY: this is intimate API *designed* for us to override.\n  setTesting(true);\n  setContext(context);\n\n  const testMetadata = getTestMetadata(context);\n  testMetadata.setupTypes.push('setupContext');\n\n  _backburner.DEBUG = true;\n\n  _prepareOnerror(context);\n\n  return Promise.resolve()\n    .then(() => {\n      const application = getApplication();\n      if (application) {\n        return application.boot().then(() => {});\n      }\n      return;\n    })\n    .then(() => {\n      const { resolver } = options;\n\n      // This handles precedence, specifying a specific option of\n      // resolver always trumps whatever is auto-detected, then we fallback to\n      // the suite-wide registrations\n      //\n      // At some later time this can be extended to support specifying a custom\n      // engine or application...\n      if (resolver) {\n        return buildOwner(null, resolver);\n      }\n\n      return buildOwner(getApplication(), getResolver());\n    })\n    .then((owner) => {\n      Object.defineProperty(context, 'owner', {\n        configurable: true,\n        enumerable: true,\n        value: owner,\n        writable: false,\n      });\n      setOwner(context, owner);\n\n      Object.defineProperty(context, 'set', {\n        configurable: true,\n        enumerable: true,\n        // SAFETY: in all of these `defineProperty` calls, we can't actually guarantee any safety w.r.t. the corresponding field's type in `TestContext`\n        value(key: any, value: any): unknown {\n          const ret = run(function () {\n            return set(context, key, value);\n          });\n          return ret;\n        },\n        writable: false,\n      });\n\n      Object.defineProperty(context, 'setProperties', {\n        configurable: true,\n        enumerable: true,\n        // SAFETY: in all of these `defineProperty` calls, we can't actually guarantee any safety w.r.t. the corresponding field's type in `TestContext`\n        value(hash: any): unknown {\n          const ret = run(function () {\n            return setProperties(context, hash);\n          });\n\n          return ret;\n        },\n        writable: false,\n      });\n\n      Object.defineProperty(context, 'get', {\n        configurable: true,\n        enumerable: true,\n        value(key: string): any {\n          return get(context, key);\n        },\n        writable: false,\n      });\n\n      Object.defineProperty(context, 'getProperties', {\n        configurable: true,\n        enumerable: true,\n        // SAFETY: in all of these `defineProperty` calls, we can't actually guarantee any safety w.r.t. the corresponding field's type in `TestContext`\n        value(...args: any[]): Record<string, unknown> {\n          return getProperties(context, args);\n        },\n        writable: false,\n      });\n\n      let resume: ((value?: void | PromiseLike<void>) => void) | undefined;\n      context['resumeTest'] = function resumeTest() {\n        assert(\n          'Testing has not been paused. There is nothing to resume.',\n          !!resume,\n        );\n        resume();\n        global.resumeTest = resume = undefined;\n      };\n\n      context['pauseTest'] = function pauseTest() {\n        console.info('Testing paused. Use `resumeTest()` to continue.'); // eslint-disable-line no-console\n\n        return new Promise((resolve) => {\n          resume = resolve;\n          global.resumeTest = resumeTest;\n        });\n      };\n\n      _setupAJAXHooks();\n\n      return context;\n    });\n}\n","import {\n  type BaseContext,\n  getContext,\n  isTestContext,\n  type TestContext,\n} from './setup-context.ts';\nimport hasEmberVersion from './has-ember-version.ts';\nimport settled from './settled.ts';\nimport getTestMetadata from './test-metadata.ts';\nimport { runHooks } from './helper-hooks.ts';\nimport type Router from '@ember/routing/router';\nimport type RouterService from '@ember/routing/router-service';\nimport { assert } from '@ember/debug';\n\nexport interface ApplicationTestContext extends TestContext {\n  element?: Element | null;\n}\n\nconst CAN_USE_ROUTER_EVENTS = hasEmberVersion(3, 6);\nlet routerTransitionsPending: boolean | null = null;\nconst ROUTER = new WeakMap();\nconst HAS_SETUP_ROUTER = new WeakMap();\n\n// eslint-disable-next-line require-jsdoc\nexport function isApplicationTestContext(\n  context: BaseContext,\n): context is ApplicationTestContext {\n  return isTestContext(context);\n}\n\n/**\n  Determines if we have any pending router transitions (used to determine `settled` state)\n\n  @public\n  @returns {(boolean|null)} if there are pending transitions\n*/\nexport function hasPendingTransitions(): boolean | null {\n  if (CAN_USE_ROUTER_EVENTS) {\n    return routerTransitionsPending;\n  }\n\n  const context = getContext();\n\n  // there is no current context, we cannot check\n  if (context === undefined) {\n    return null;\n  }\n\n  const router = ROUTER.get(context);\n\n  if (router === undefined) {\n    // if there is no router (e.g. no `visit` calls made yet), we cannot\n    // check for pending transitions but this is explicitly not an error\n    // condition\n    return null;\n  }\n\n  const routerMicrolib = router._routerMicrolib || router.router;\n\n  if (routerMicrolib === undefined) {\n    return null;\n  }\n\n  return !!routerMicrolib.activeTransition;\n}\n\n/**\n  Setup the current router instance with settledness tracking. Generally speaking this\n  is done automatically (during a `visit('/some-url')` invocation), but under some\n  circumstances (e.g. a non-application test where you manually call `this.owner.setupRouter()`)\n  you may want to call it yourself.\n\n  @public\n */\nexport function setupRouterSettlednessTracking() {\n  const context = getContext();\n  if (context === undefined || !isTestContext(context)) {\n    throw new Error(\n      'Cannot setupRouterSettlednessTracking outside of a test context',\n    );\n  }\n\n  // avoid setting up many times for the same context\n  if (HAS_SETUP_ROUTER.get(context)) {\n    return;\n  }\n  HAS_SETUP_ROUTER.set(context, true);\n\n  const { owner } = context;\n  let router: Router | RouterService;\n  if (CAN_USE_ROUTER_EVENTS) {\n    // SAFETY: unfortunately we cannot `assert` here at present because the\n    // class is not exported, only the type, since it is not designed to be\n    // sub-classed. The most we can do at present is assert that it at least\n    // *exists* and assume that if it does exist, it is bound correctly.\n    const routerService = owner.lookup('service:router');\n    assert('router service is not set up correctly', !!routerService);\n    router = routerService as RouterService;\n\n    // track pending transitions via the public routeWillChange / routeDidChange APIs\n    // routeWillChange can fire many times and is only useful to know when we have _started_\n    // transitioning, we can then use routeDidChange to signal that the transition has settled\n    router.on('routeWillChange', () => (routerTransitionsPending = true));\n    router.on('routeDidChange', () => (routerTransitionsPending = false));\n  } else {\n    // SAFETY: similarly, this cast cannot be made safer because on the versions\n    // where we fall into this path, this is *also* not an exported class.\n    const mainRouter = owner.lookup('router:main');\n    assert('router:main is not available', !!mainRouter);\n    router = mainRouter as Router;\n    ROUTER.set(context, router);\n  }\n\n  // hook into teardown to reset local settledness state\n  const ORIGINAL_WILL_DESTROY = router.willDestroy;\n  router.willDestroy = function () {\n    routerTransitionsPending = null;\n\n    return ORIGINAL_WILL_DESTROY.call(this);\n  };\n}\n\n/**\n  Navigate the application to the provided URL.\n\n  @public\n  @param {string} url The URL to visit (e.g. `/posts`)\n  @param {object} options app boot options\n  @returns {Promise<void>} resolves when settled\n\n  @example\n  <caption>\n    Visiting the route for post 1.\n  </caption>\n  await visit('/posts/1');\n\n  @example\n  <caption>\n    Visiting the route for post 1 while also providing the `rootElement` app boot option.\n  </caption>\n  await visit('/', { rootElement: '#container' });\n*/\nexport function visit(\n  url: string,\n  options?: Record<string, unknown>,\n): Promise<void> {\n  const context = getContext();\n  if (!context || !isApplicationTestContext(context)) {\n    throw new Error(\n      'Cannot call `visit` without having first called `setupApplicationContext`.',\n    );\n  }\n\n  const { owner } = context;\n  const testMetadata = getTestMetadata(context);\n  testMetadata.usedHelpers.push('visit');\n\n  return Promise.resolve()\n    .then(() => {\n      return runHooks('visit', 'start', url, options);\n    })\n    .then(() => {\n      const visitResult = owner.visit(url, options);\n\n      setupRouterSettlednessTracking();\n\n      return visitResult;\n    })\n    .then(() => {\n      context.element = document.querySelector('#ember-testing');\n    })\n    .then(settled)\n    .then(() => {\n      return runHooks('visit', 'end', url, options);\n    });\n}\n\n/**\n  @public\n  @returns {string} the currently active route name\n*/\nexport function currentRouteName(): string {\n  const context = getContext();\n  if (!context || !isApplicationTestContext(context)) {\n    throw new Error(\n      'Cannot call `currentRouteName` without having first called `setupApplicationContext`.',\n    );\n  }\n\n  const router = context.owner.lookup('router:main') as any;\n  const currentRouteName = router.currentRouteName;\n  assert(\n    'currentRouteName should be a string',\n    typeof currentRouteName === 'string',\n  );\n  return currentRouteName;\n}\n\nconst HAS_CURRENT_URL_ON_ROUTER = hasEmberVersion(2, 13);\n\n/**\n  @public\n  @returns {string} the applications current url\n*/\nexport function currentURL(): string {\n  const context = getContext();\n  if (!context || !isApplicationTestContext(context)) {\n    throw new Error(\n      'Cannot call `currentURL` without having first called `setupApplicationContext`.',\n    );\n  }\n\n  const router = context.owner.lookup('router:main') as any;\n\n  if (HAS_CURRENT_URL_ON_ROUTER) {\n    const routerCurrentURL = router.currentURL;\n\n    // SAFETY: this path is a lie for the sake of the public-facing types. The\n    // framework itself sees this path, but users never do. A user who calls the\n    // API without calling `visit()` will see an `UnrecognizedURLError`, rather\n    // than getting back `null`.\n    if (routerCurrentURL === null) {\n      return routerCurrentURL as never as string;\n    }\n\n    assert(\n      `currentUrl should be a string, but was ${typeof routerCurrentURL}`,\n      typeof routerCurrentURL === 'string',\n    );\n\n    return routerCurrentURL;\n  } else {\n    // SAFETY: this is *positively ancient* and should probably be removed at\n    // some point; old routers which don't have `currentURL` *should* have a\n    // `location` with `getURL()` per the docs for 2.12.\n    return (router.location as any).getURL();\n  }\n}\n\n/**\n  Used by test framework addons to setup the provided context for working with\n  an application (e.g. routing).\n\n  `setupContext` must have been run on the provided context prior to calling\n  `setupApplicationContext`.\n\n  Sets up the basic framework used by application tests.\n\n  @public\n  @param {Object} context the context to setup\n  @returns {Promise<void>} resolves when the context is set up\n*/\nexport default function setupApplicationContext(\n  context: TestContext,\n): Promise<void> {\n  const testMetadata = getTestMetadata(context);\n  testMetadata.setupTypes.push('setupApplicationContext');\n\n  return Promise.resolve();\n}\n","// @ts-ignore: this is private API. This import will work Ember 5.1+ since it\n// \"provides\" this public API, but does not for earlier versions. As a result,\n// this type will be `any`.\nimport { _backburner } from '@ember/runloop';\nimport { Test } from 'ember-testing';\n\nimport { nextTick } from './-utils.ts';\nimport waitUntil from './wait-until.ts';\nimport { hasPendingTransitions } from './setup-application-context.ts';\nimport { hasPendingWaiters } from '@ember/test-waiters';\nimport type DebugInfo from './-internal/debug-info.ts';\nimport { TestDebugInfo } from './-internal/debug-info.ts';\n\nlet requests: XMLHttpRequest[];\nconst checkWaiters = Test.checkWaiters;\n\n/**\n  @private\n  @returns {number} the count of pending requests\n*/\nfunction pendingRequests() {\n  return requests !== undefined ? requests.length : 0;\n}\n\n/**\n  @private\n  @param {Event} event (unused)\n  @param {XMLHTTPRequest} xhr the XHR that has initiated a request\n*/\nfunction incrementAjaxPendingRequests(event: any, xhr: XMLHttpRequest): void {\n  requests.push(xhr);\n}\n\n/**\n  @private\n  @param {Event} event (unused)\n  @param {XMLHTTPRequest} xhr the XHR that has initiated a request\n*/\nfunction decrementAjaxPendingRequests(event: any, xhr: XMLHttpRequest): void {\n  // In most Ember versions to date (current version is 2.16) RSVP promises are\n  // configured to flush in the actions queue of the Ember run loop, however it\n  // is possible that in the future this changes to use \"true\" micro-task\n  // queues.\n  //\n  // The entire point here, is that _whenever_ promises are resolved will be\n  // before the next run of the JS event loop. Then in the next event loop this\n  // counter will decrement. In the specific case of AJAX, this means that any\n  // promises chained off of `$.ajax` will properly have their `.then` called\n  // _before_ this is decremented (and testing continues)\n  nextTick(() => {\n    for (let i = 0; i < requests.length; i++) {\n      if (xhr === requests[i]) {\n        requests.splice(i, 1);\n      }\n    }\n  });\n}\n\n/**\n  Clears listeners that were previously setup for `ajaxSend` and `ajaxComplete`.\n\n  @private\n*/\nexport function _teardownAJAXHooks() {\n  // jQuery will not invoke `ajaxComplete` if\n  //    1. `transport.send` throws synchronously and\n  //    2. it has an `error` option which also throws synchronously\n\n  // We can no longer handle any remaining requests\n  requests = [];\n\n  if (typeof (globalThis as any).jQuery === 'undefined') {\n    return;\n  }\n\n  (globalThis as any)\n    .jQuery(document)\n    .off('ajaxSend', incrementAjaxPendingRequests);\n  (globalThis as any)\n    .jQuery(document)\n    .off('ajaxComplete', decrementAjaxPendingRequests);\n}\n\n/**\n  Sets up listeners for `ajaxSend` and `ajaxComplete`.\n\n  @private\n*/\nexport function _setupAJAXHooks() {\n  requests = [];\n\n  if (typeof (globalThis as any).jQuery === 'undefined') {\n    return;\n  }\n\n  (globalThis as any)\n    .jQuery(document)\n    .on('ajaxSend', incrementAjaxPendingRequests);\n  (globalThis as any)\n    .jQuery(document)\n    .on('ajaxComplete', decrementAjaxPendingRequests);\n}\n\nexport interface SettledState {\n  hasRunLoop: boolean;\n  hasPendingTimers: boolean;\n  hasPendingWaiters: boolean;\n  hasPendingRequests: boolean;\n  hasPendingTransitions: boolean | null;\n  isRenderPending: boolean;\n  pendingRequestCount: number;\n  debugInfo: DebugInfo;\n}\n\n/**\n  Check various settledness metrics, and return an object with the following properties:\n\n  - `hasRunLoop` - Checks if a run-loop has been started. If it has, this will\n    be `true` otherwise it will be `false`.\n  - `hasPendingTimers` - Checks if there are scheduled timers in the run-loop.\n    These pending timers are primarily registered by `Ember.run.schedule`. If\n    there are pending timers, this will be `true`, otherwise `false`.\n  - `hasPendingWaiters` - Checks if any registered test waiters are still\n    pending (e.g. the waiter returns `true`). If there are pending waiters,\n    this will be `true`, otherwise `false`.\n  - `hasPendingRequests` - Checks if there are pending AJAX requests (based on\n    `ajaxSend` / `ajaxComplete` events triggered by `jQuery.ajax`). If there\n    are pending requests, this will be `true`, otherwise `false`.\n  - `hasPendingTransitions` - Checks if there are pending route transitions. If the\n    router has not been instantiated / setup for the test yet this will return `null`,\n    if there are pending transitions, this will be `true`, otherwise `false`.\n  - `pendingRequestCount` - The count of pending AJAX requests.\n  - `debugInfo` - Debug information that's combined with info return from backburner's\n    getDebugInfo method.\n  - `isRenderPending` - Checks if there are any pending render operations. This will be true as long\n    as there are tracked values in the template that have not been rerendered yet.\n\n  @public\n  @returns {Object} object with properties for each of the metrics used to determine settledness\n*/\nexport function getSettledState(): SettledState {\n  const hasPendingTimers = _backburner.hasTimers();\n  const hasRunLoop = Boolean(_backburner.currentInstance);\n  const hasPendingLegacyWaiters = checkWaiters();\n  const hasPendingTestWaiters = hasPendingWaiters();\n  const pendingRequestCount = pendingRequests();\n  const hasPendingRequests = pendingRequestCount > 0;\n  // TODO: Ideally we'd have a function in Ember itself that can synchronously identify whether\n  // or not there are any pending render operations, but this will have to suffice for now\n  const isRenderPending = !!hasRunLoop;\n\n  return {\n    hasPendingTimers,\n    hasRunLoop,\n    hasPendingWaiters: hasPendingLegacyWaiters || hasPendingTestWaiters,\n    hasPendingRequests,\n    hasPendingTransitions: hasPendingTransitions(),\n    isRenderPending,\n    pendingRequestCount,\n    debugInfo: new TestDebugInfo({\n      hasPendingTimers,\n      hasRunLoop,\n      hasPendingLegacyWaiters,\n      hasPendingTestWaiters,\n      hasPendingRequests,\n      isRenderPending,\n    }),\n  };\n}\n\n/**\n  Checks various settledness metrics (via `getSettledState()`) to determine if things are settled or not.\n\n  Settled generally means that there are no pending timers, no pending waiters,\n  no pending AJAX requests, and no current run loop. However, new settledness\n  metrics may be added and used as they become available.\n\n  @public\n  @returns {boolean} `true` if settled, `false` otherwise\n*/\nexport function isSettled(): boolean {\n  const {\n    hasPendingTimers,\n    hasRunLoop,\n    hasPendingRequests,\n    hasPendingWaiters,\n    hasPendingTransitions,\n    isRenderPending,\n  } = getSettledState();\n\n  if (\n    hasPendingTimers ||\n    hasRunLoop ||\n    hasPendingRequests ||\n    hasPendingWaiters ||\n    hasPendingTransitions ||\n    isRenderPending\n  ) {\n    return false;\n  }\n\n  return true;\n}\n\n/**\n  Returns a promise that resolves when in a settled state (see `isSettled` for\n  a definition of \"settled state\").\n\n  @public\n  @returns {Promise<void>} resolves when settled\n*/\nexport default function settled(): Promise<void> {\n  return waitUntil(isSettled, { timeout: Infinity }).then(() => {});\n}\n","import { getOnerror, setOnerror } from '@ember/-internals/error-handling';\nimport { type BaseContext, getContext } from './setup-context.ts';\n\nconst cachedOnerror: Map<BaseContext, ((error: Error) => void) | undefined> =\n  new Map();\n\n/**\n * Sets the `Ember.onerror` function for tests. This value is intended to be reset after\n * each test to ensure correct test isolation. To reset, you should simply call `setupOnerror`\n * without an `onError` argument.\n *\n * @public\n * @param {Function} onError the onError function to be set on Ember.onerror\n *\n * @example <caption>Example implementation for `ember-qunit` or `ember-mocha`</caption>\n *\n * import { setupOnerror } from '@ember/test-helpers';\n *\n * test('Ember.onerror is stubbed properly', function(assert) {\n *   setupOnerror(function(err) {\n *     assert.ok(err);\n *   });\n * });\n */\nexport default function setupOnerror(onError?: (error: Error) => void): void {\n  const context = getContext();\n\n  if (!context) {\n    throw new Error('Must setup test context before calling setupOnerror');\n  }\n\n  if (!cachedOnerror.has(context)) {\n    throw new Error(\n      '_cacheOriginalOnerror must be called before setupOnerror. Normally, this will happen as part of your test harness.',\n    );\n  }\n\n  if (typeof onError !== 'function') {\n    onError = cachedOnerror.get(context);\n  }\n\n  setOnerror(onError);\n}\n\n/**\n * Resets `Ember.onerror` to the value it originally was at the start of the test run.\n * If there is no context or cached value this is a no-op.\n *\n * @public\n *\n * @example\n *\n * import { resetOnerror } from '@ember/test-helpers';\n *\n * QUnit.testDone(function() {\n *   resetOnerror();\n * })\n */\nexport function resetOnerror(): void {\n  const context = getContext();\n\n  if (context && cachedOnerror.has(context)) {\n    setOnerror(cachedOnerror.get(context));\n  }\n}\n\n/**\n * Caches the current value of Ember.onerror. When `setupOnerror` is called without a value\n * or when `resetOnerror` is called the value will be set to what was cached here.\n *\n * @private\n * @param {BaseContext} context the text context\n */\nexport function _prepareOnerror(context: BaseContext) {\n  if (cachedOnerror.has(context)) {\n    throw new Error('_prepareOnerror should only be called once per-context');\n  }\n\n  // SAFETY: getOnerror doesn't have correct types\n  cachedOnerror.set(context, getOnerror() as any);\n}\n\n/**\n * Removes the cached value of Ember.onerror.\n *\n * @private\n * @param {BaseContext} context the text context\n */\nexport function _cleanupOnerror(context: BaseContext) {\n  resetOnerror();\n  cachedOnerror.delete(context);\n}\n","import type { BaseContext } from './setup-context';\n\nclass TestMetadata {\n  [key: string]: any;\n  testName?: string;\n  setupTypes: string[];\n  usedHelpers: string[];\n\n  constructor() {\n    this.setupTypes = [];\n    this.usedHelpers = [];\n  }\n\n  get isRendering() {\n    return (\n      this.setupTypes.indexOf('setupRenderingContext') > -1 &&\n      this.usedHelpers.indexOf('render') > -1\n    );\n  }\n\n  get isApplication() {\n    return this.setupTypes.indexOf('setupApplicationContext') > -1;\n  }\n}\n\nexport {\n  // Exported only for testing purposes.\n  TestMetadata as __TestMetadata,\n};\n\n// Only export the type side of the item: this way the only way (it is legal) to\n// construct it is here, but users can still reference the type.\nexport type {\n  /**\n   * A non-user-constructible interface representing the metadata associated\n   * with a test, designed for test frameworks to use e.g. with their reporters.\n   */\n  TestMetadata,\n};\n\nconst TEST_METADATA = new WeakMap<BaseContext, TestMetadata>();\n\n/**\n * Gets the test metadata associated with the provided test context. Will create\n * a new test metadata object if one does not exist.\n *\n * @param {BaseContext} context the context to use\n * @returns {TestMetadata} the test metadata for the provided context\n */\nexport default function getTestMetadata(context: BaseContext): TestMetadata {\n  if (!TEST_METADATA.has(context)) {\n    TEST_METADATA.set(context, new TestMetadata());\n  }\n\n  return TEST_METADATA.get(context)!;\n}\n","import type { PendingWaiterState, Waiter, WaiterName } from './types/index.ts';\n\ntype Indexable = Record<any, unknown>;\n\n// this ensures that if @ember/test-waiters exists in multiple places in the\n// build output we will still use a single map of waiters (there really should\n// only be one of them, or else `settled` will not work at all)\nconst WAITERS: Map<WaiterName, Waiter> = (function () {\n  const HAS_SYMBOL = typeof Symbol !== 'undefined';\n\n  const symbolName = 'TEST_WAITERS';\n  const symbol = HAS_SYMBOL ? (Symbol.for(symbolName) as any) : symbolName;\n\n  const global = getGlobal();\n\n  let waiters = global[symbol];\n  if (waiters === undefined) {\n    waiters = global[symbol] = new Map<WaiterName, Waiter>();\n  }\n\n  return waiters as Map<WaiterName, Waiter>;\n})();\n\nfunction indexable<T extends object>(input: T): T & Indexable {\n  return input as T & Indexable;\n}\n\nfunction getGlobal(): Indexable {\n  if (typeof globalThis !== 'undefined') return indexable(globalThis);\n  if (typeof self !== 'undefined') return indexable(self);\n  if (typeof window !== 'undefined') return indexable(window);\n\n  throw new Error('unable to locate global object');\n}\n\n/**\n * Registers a waiter.\n *\n * @public\n * @param waiter {Waiter} A test waiter instance\n */\nexport function register(waiter: Waiter): void {\n  WAITERS.set(waiter.name, waiter);\n}\n\n/**\n * Un-registers a waiter.\n *\n * @public\n * @param waiter {Waiter} A test waiter instance\n */\nexport function unregister(waiter: Waiter): void {\n  WAITERS.delete(waiter.name);\n}\n\n/**\n * Gets an array of all waiters current registered.\n *\n * @public\n * @returns {Waiter[]}\n */\nexport function getWaiters(): Waiter[] {\n  const result: Waiter[] = [];\n\n  WAITERS.forEach((value) => {\n    result.push(value);\n  });\n\n  return result;\n}\n\n/**\n * Clears all waiters.\n *\n * @private\n */\nexport function _reset(): void {\n  for (const waiter of getWaiters()) {\n    (waiter as any).isRegistered = false;\n  }\n\n  WAITERS.clear();\n}\n\n/**\n * Gets the current state of all waiters. Any waiters whose\n * `waitUntil` method returns false will be considered `pending`.\n *\n * @returns {PendingWaiterState} An object containing a count of all waiters\n * pending and a `waiters` object containing the name of all pending waiters\n * and their debug info.\n */\nexport function getPendingWaiterState(): PendingWaiterState {\n  const result: PendingWaiterState = {\n    pending: 0,\n    waiters: {},\n  };\n\n  WAITERS.forEach((waiter) => {\n    if (!waiter.waitUntil()) {\n      result.pending++;\n\n      const debugInfo = waiter.debugInfo();\n      result.waiters[waiter.name] = debugInfo || true;\n    }\n  });\n\n  return result;\n}\n\n/**\n * Determines if there are any pending waiters.\n *\n * @returns {boolean} `true` if there are pending waiters, otherwise `false`.\n */\nexport function hasPendingWaiters(): boolean {\n  const state = getPendingWaiterState();\n\n  return state.pending > 0;\n}\n","import type { Primitive, TestWaiter, TestWaiterDebugInfo, WaiterName } from './types/index.ts';\nimport { macroCondition, isDevelopingApp } from '@embroider/macros';\nimport { warn } from '@ember/debug';\nimport Token from './token.ts';\nimport { register } from './waiter-manager.ts';\n\nconst WAITER_NAME_PATTERN = /^[^:]*:?.*/;\nlet WAITER_NAMES = macroCondition(isDevelopingApp()) ? new Set() : undefined;\n\nexport function _resetWaiterNames() {\n  WAITER_NAMES = new Set();\n}\n\nfunction getNextToken(): Token {\n  return new Token();\n}\n\nclass TestWaiterImpl<T extends object | Primitive = Token> implements TestWaiter<T> {\n  public name: WaiterName;\n  private nextToken: () => T;\n  private isRegistered = false;\n\n  items = new Map<T, TestWaiterDebugInfo>();\n  completedOperationsForTokens = new WeakMap<Token, boolean>();\n  completedOperationsForPrimitives = new Map<Primitive, boolean>();\n\n  constructor(name: WaiterName, nextToken?: () => T) {\n    this.name = name;\n    // @ts-ignore\n    this.nextToken = nextToken || getNextToken;\n  }\n\n  beginAsync(token: T = this.nextToken(), label?: string): T {\n    this._register();\n\n    if (this.items.has(token)) {\n      // SAFETY: force stringification of a potential symbol\n      throw new Error(`beginAsync called for ${token as string} but it is already pending.`);\n    }\n\n    const error = new Error();\n\n    this.items.set(token, {\n      get stack() {\n        return error.stack;\n      },\n      label,\n    });\n\n    return token;\n  }\n\n  endAsync(token: T): void {\n    if (!this.items.has(token) && !this._getCompletedOperations(token).has(token)) {\n      throw new Error(\n        `testWaiter.endAsync called with no preceding testWaiter.beginAsync call.\n        Test waiter calls should always be paired. This can occur when a test waiter's paired calls are invoked in a non-deterministic order.\n\n        See https://github.com/emberjs/ember-test-waiters#keep-beginasyncendasync-in-same-block-scope for more information.`\n      );\n    }\n\n    this.items.delete(token);\n    // Mark when a waiter operation has completed so we can distinguish\n    // whether endAsync is being called before a prior beginAsync call above.\n    this._getCompletedOperations(token).set(token, true);\n  }\n\n  waitUntil(): boolean {\n    return this.items.size === 0;\n  }\n\n  debugInfo(): TestWaiterDebugInfo[] {\n    const result: TestWaiterDebugInfo[] = [];\n\n    this.items.forEach((value) => {\n      result.push(value);\n    });\n\n    return result;\n  }\n\n  reset(): void {\n    this.items.clear();\n  }\n\n  private _register(): void {\n    if (!this.isRegistered) {\n      register(this);\n      this.isRegistered = true;\n    }\n  }\n\n  private _getCompletedOperations(token: T) {\n    const type = typeof token;\n\n    const isFunction = type === 'function';\n    const isObject = token !== null && type === 'object';\n    const isPrimitive = !isFunction && !isObject;\n\n    return isPrimitive ? this.completedOperationsForPrimitives : this.completedOperationsForTokens;\n  }\n}\n\nclass NoopTestWaiter implements TestWaiter {\n  name: string;\n  constructor(name: string) {\n    this.name = name;\n  }\n\n  beginAsync(): Token {\n    return this;\n  }\n\n  endAsync(): void {}\n\n  waitUntil(): boolean {\n    return true;\n  }\n\n  debugInfo(): TestWaiterDebugInfo[] {\n    return [];\n  }\n\n  reset(): void {}\n}\n\n/**\n * Builds and returns a test waiter. The type of the\n * returned waiter is dependent on whether the app or\n * addon is in `isDevelopingApp()` mode or not.\n *\n * @public\n *\n * @param name {string} The name of the test waiter\n * @returns {TestWaiter}\n *\n * @example\n *\n * import Component from '@ember/component';\n * import { buildWaiter } from '@ember/test-waiters';\n *\n * if (macroCondition(isDevelopingApp())) {\n *   let waiter = buildWaiter('friend-waiter');\n * }\n *\n * export default class Friendz extends Component {\n *   didInsertElement() {\n *     let token = waiter.beginAsync(this);\n *\n *     someAsyncWork().then(() => {\n *       waiter.endAsync(token);\n *     });\n *   }\n * }\n */\nexport default function buildWaiter(name: string): TestWaiter {\n  if (macroCondition(isDevelopingApp())) {\n    warn(`The waiter name '${name}' is already in use`, !WAITER_NAMES!.has(name), {\n      id: '@ember/test-waiters.duplicate-waiter-name',\n    });\n    WAITER_NAMES!.add(name);\n  }\n\n  if (macroCondition(!isDevelopingApp())) {\n    return new NoopTestWaiter(name);\n  } else {\n    warn(\n      `You must provide a name that contains a descriptive prefix separated by a colon.\n\n        Example: ember-fictitious-addon:some-file\n\n        You passed: ${name}`,\n      WAITER_NAME_PATTERN.test(name),\n      { id: '@ember/test-waiters.invalid-waiter-name' }\n    );\n\n    return new TestWaiterImpl(name);\n  }\n}\n","import { macroCondition, isDevelopingApp } from '@embroider/macros';\nimport buildWaiter from './build-waiter.ts';\n\nimport type { PromiseType, Thenable } from './types/index.ts';\n\nconst PROMISE_WAITER = buildWaiter('@ember/test-waiters:promise-waiter');\n\n/**\n * A convenient utility function to simplify waiting for a promise.\n *\n * @public\n * @param promise {Promise<T> | RSVP.Promise<T>} The promise to track async operations for\n * @param label {string} An optional string to identify the promise\n *\n * @example\n *\n * import Component from '@ember/component';\n * import { waitForPromise } from '@ember/test-waiters';\n *\n * export default class Friendz extends Component {\n *   didInsertElement() {\n *     waitForPromise(new Promise(resolve => {\n *       doSomeWork();\n *       resolve();\n *     }));\n *   }\n * }\n */\nexport default function waitForPromise<T, KindOfPromise extends PromiseType<T>>(\n  promise: KindOfPromise,\n  label?: string\n): KindOfPromise {\n  let result = promise;\n\n  if (macroCondition(isDevelopingApp())) {\n    PROMISE_WAITER.beginAsync(promise, label);\n\n    result = (promise as unknown as Thenable<T, KindOfPromise>).then(\n      (value: T) => {\n        PROMISE_WAITER.endAsync(promise);\n        return value;\n      },\n      (error: Error) => {\n        PROMISE_WAITER.endAsync(promise);\n        throw error;\n      }\n    );\n  }\n\n  return result;\n}\n","import { macroCondition, isDevelopingApp } from '@embroider/macros';\nimport waitForPromise from './wait-for-promise.ts';\nimport buildWaiter from './build-waiter.ts';\nimport type { PromiseType } from './types/index.ts';\n\ntype AsyncFunction<A extends Array<any>, PromiseReturn> = (...args: A) => Promise<PromiseReturn>;\ntype AsyncFunctionArguments = [AsyncFunction<any[], any>, string?];\n\ntype CoroutineGenerator<T> = Generator<any, T, any>;\ntype CoroutineFunction<A extends Array<any>, T> = (...args: A) => CoroutineGenerator<T>;\ntype CoroutineFunctionArguments = [CoroutineFunction<any[], any>, string?];\n\ntype DecoratorArguments = [object, string, PropertyDescriptor, string?];\n\n/**\n * A convenient utility function to simplify waiting for async. Can be used\n * in both decorator and function form. When applied to an async function, it\n * will cause tests to wait until the returned promise has resolves. When\n * applied to a generator function, it will cause tests to wait until the\n * returned iterator has run to completion, which is useful for wrapping\n * ember-concurrency task functions.\n *\n *\n * @public\n * @param promise {Function} An async function or a generator function\n * @param label {string} An optional string to identify the promise\n *\n * @example\n *\n * import Component from '@ember/component';\n * import { waitFor } from '@ember/test-waiters';\n *\n * export default Component.extend({\n *   doAsyncStuff: waitFor(async function doAsyncStuff() {\n *     await somethingAsync();\n *   }\n * });\n *\n * @example\n *\n * import Component from '@ember/component';\n * import { waitFor } from '@ember/test-waiters';\n *\n * export default class Friendz extends Component {\n *   @waitFor\n *   async doAsyncStuff() {\n *     await somethingAsync();\n *   }\n * }\n *\n */\nexport default function waitFor<A extends Array<any>, PromiseReturn>(\n  fn: AsyncFunction<A, PromiseReturn>,\n  label?: string\n): AsyncFunction<A, PromiseReturn>;\nexport default function waitFor<A extends Array<any>, T>(\n  fn: CoroutineFunction<A, T>,\n  label?: string\n): CoroutineFunction<A, T>;\nexport default function waitFor(\n  target: object,\n  _key: string,\n  descriptor: PropertyDescriptor,\n  label?: string\n): PropertyDescriptor;\nexport default function waitFor(\n  ...args: AsyncFunctionArguments | CoroutineFunctionArguments | DecoratorArguments\n): PropertyDescriptor | Function | CoroutineFunction<any[], any> {\n  const isFunction = args.length < 3;\n\n  if (isFunction) {\n    const [fn, label] = args as AsyncFunctionArguments | CoroutineFunctionArguments;\n\n    return wrapFunction(fn, label);\n  } else {\n    const [, , descriptor, label] = args as DecoratorArguments;\n\n    if (macroCondition(!isDevelopingApp())) {\n      return descriptor;\n    }\n\n    const fn = descriptor.value;\n\n    descriptor.value = wrapFunction(fn, label);\n\n    return descriptor;\n  }\n}\n\nfunction wrapFunction(fn: Function, label?: string) {\n  if (macroCondition(!isDevelopingApp())) {\n    return fn;\n  }\n\n  return function (this: any, ...args: any[]) {\n    const result = fn.call(this, ...args);\n\n    if (isThenable(result)) {\n      return waitForPromise(result, label);\n    } else if (isGenerator(result)) {\n      return waitForGenerator(result, label);\n    } else {\n      return result;\n    }\n  };\n}\n\nfunction isThenable(\n  maybePromise: any | PromiseType<unknown>\n): maybePromise is PromiseType<unknown> {\n  const type = typeof maybePromise;\n\n  return (\n    ((maybePromise !== null && type === 'object') || type === 'function') &&\n    typeof maybePromise.then === 'function'\n  );\n}\n\nfunction isGenerator(\n  maybeGenerator: any | CoroutineGenerator<unknown>\n): maybeGenerator is CoroutineGenerator<unknown> {\n  // Because we don't have Symbol.iterator in IE11\n  return (\n    typeof maybeGenerator.next === 'function' &&\n    typeof maybeGenerator.return === 'function' &&\n    typeof maybeGenerator.throw === 'function'\n  );\n}\n\nconst GENERATOR_WAITER = buildWaiter('@ember/test-waiters:generator-waiter');\n\nfunction waitForGenerator<T>(\n  generator: CoroutineGenerator<T>,\n  label?: string\n): CoroutineGenerator<T> {\n  GENERATOR_WAITER.beginAsync(generator, label);\n\n  let isWaiting = true;\n  function stopWaiting() {\n    if (isWaiting) {\n      GENERATOR_WAITER.endAsync(generator);\n      isWaiting = false;\n    }\n  }\n\n  return {\n    next(...args) {\n      let hasErrored = true;\n      try {\n        const val = generator.next(...args);\n        hasErrored = false;\n\n        if (val.done) {\n          stopWaiting();\n        }\n        return val;\n      } finally {\n        // If generator.next() throws, we need to stop waiting. But if we catch\n        // and re-throw exceptions, it could move the location from which the\n        // uncaught exception is thrown, interfering with the developer\n        // debugging experience if they have break-on-exceptions enabled. So we\n        // use a boolean flag and a finally block to emulate a catch block.\n        if (hasErrored) {\n          stopWaiting();\n        }\n      }\n    },\n    return(...args) {\n      stopWaiting();\n      return generator.return(...args);\n    },\n    throw(...args) {\n      stopWaiting();\n      return generator.throw(...args);\n    },\n  } as CoroutineGenerator<T>;\n}\n","// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment\nconst OWNER = Symbol('OWNER');\n/**\n  Framework objects in a Glimmer application may receive an owner object.\n  Glimmer is unopinionated about this owner, but will forward it through its\n  internal resolution system, and through its managers if it is provided.\n*/\nfunction getOwner(object) {\n  return object[OWNER];\n}\n\n/**\n  `setOwner` set's an object's owner\n*/\nfunction setOwner(object, owner) {\n  object[OWNER] = owner;\n}\n\nexport { OWNER, getOwner, setOwner };\n","import { E as EmberTesting } from '../shared-chunks/public-api-BQsJemZG.js';\nimport { registerTestImplementation } from '../@ember/test/index.js';\nexport { default as Adapter } from './lib/adapters/adapter.js';\nexport { default as QUnitAdapter } from './lib/adapters/qunit.js';\nexport { default as Test } from './lib/test.js';\nexport { default as setupForTesting } from './lib/setup_for_testing.js';\n\nregisterTestImplementation(EmberTesting);\n","import EmberObject from '../../../@ember/object/index.js';\n\n/**\n @module @ember/test\n*/\n\n/**\n  The primary purpose of this class is to create hooks that can be implemented\n  by an adapter for various test frameworks.\n\n  @class TestAdapter\n  @public\n*/\n\nconst Adapter = EmberObject.extend({\n  /**\n    This callback will be called whenever an async operation is about to start.\n     Override this to call your framework's methods that handle async\n    operations.\n     @public\n    @method asyncStart\n  */\n  asyncStart() {},\n  /**\n    This callback will be called whenever an async operation has completed.\n     @public\n    @method asyncEnd\n  */\n  asyncEnd() {},\n  /**\n    Override this method with your testing framework's false assertion.\n    This function is called whenever an exception occurs causing the testing\n    promise to fail.\n     QUnit example:\n     ```javascript\n      exception: function(error) {\n        ok(false, error);\n      };\n    ```\n     @public\n    @method exception\n    @param {String} error The exception to be raised.\n  */\n  exception(error) {\n    throw error;\n  }\n});\n\nexport { Adapter as default };\n","import '../../../@ember/debug/index.js';\nimport Adapter from './adapter.js';\nimport inspect from '../../../@ember/debug/lib/inspect.js';\n\n/* globals QUnit */\n\nfunction isVeryOldQunit(obj) {\n  return obj != null && typeof obj.stop === 'function';\n}\n\n/**\n   @module ember\n*/\n/**\n  This class implements the methods defined by TestAdapter for the\n  QUnit testing framework.\n\n  @class QUnitAdapter\n  @namespace Ember.Test\n  @extends TestAdapter\n  @public\n*/\nclass QUnitAdapter extends Adapter {\n  doneCallbacks = [];\n  asyncStart() {\n    if (isVeryOldQunit(QUnit)) {\n      // very old QUnit version\n      // eslint-disable-next-line qunit/no-qunit-stop\n      QUnit.stop();\n    } else {\n      this.doneCallbacks.push(QUnit.config.current ? QUnit.config.current.assert.async() : null);\n    }\n  }\n  asyncEnd() {\n    // checking for QUnit.stop here (even though we _need_ QUnit.start) because\n    // QUnit.start() still exists in QUnit 2.x (it just throws an error when calling\n    // inside a test context)\n    if (isVeryOldQunit(QUnit)) {\n      QUnit.start();\n    } else {\n      let done = this.doneCallbacks.pop();\n      // This can be null if asyncStart() was called outside of a test\n      if (done) {\n        done();\n      }\n    }\n  }\n  exception(error) {\n    QUnit.config.current.assert.ok(false, inspect(error));\n  }\n}\n\nexport { QUnitAdapter as default };\n","import Application from '../../../@ember/application/index.js';\nimport setupForTesting from '../setup_for_testing.js';\nimport { helpers } from '../test/helpers.js';\nimport TestPromise, { resolve, getLastPromise } from '../test/promise.js';\nimport run from '../test/run.js';\nimport { invokeInjectHelpersCallbacks } from '../test/on_inject_helpers.js';\nimport { asyncEnd, asyncStart } from '../test/adapter.js';\nimport '../../../@ember/debug/index.js';\nimport { isDevelopingApp } from '@embroider/macros';\nimport { assert } from '../../../@ember/debug/lib/assert.js';\n\nApplication.reopen({\n  /**\n   This property contains the testing helpers for the current application. These\n   are created once you call `injectTestHelpers` on your `Application`\n   instance. The included helpers are also available on the `window` object by\n   default, but can be used from this object on the individual application also.\n     @property testHelpers\n    @type {Object}\n    @default {}\n    @public\n  */\n  testHelpers: {},\n  /**\n   This property will contain the original methods that were registered\n   on the `helperContainer` before `injectTestHelpers` is called.\n    When `removeTestHelpers` is called, these methods are restored to the\n   `helperContainer`.\n     @property originalMethods\n    @type {Object}\n    @default {}\n    @private\n    @since 1.3.0\n  */\n  originalMethods: {},\n  /**\n  This property indicates whether or not this application is currently in\n  testing mode. This is set when `setupForTesting` is called on the current\n  application.\n   @property testing\n  @type {Boolean}\n  @default false\n  @since 1.3.0\n  @public\n  */\n  testing: false,\n  /**\n    This hook defers the readiness of the application, so that you can start\n    the app when your tests are ready to run. It also sets the router's\n    location to 'none', so that the window's location will not be modified\n    (preventing both accidental leaking of state between tests and interference\n    with your testing framework). `setupForTesting` should only be called after\n    setting a custom `router` class (for example `App.Router = Router.extend(`).\n     Example:\n     ```\n    App.setupForTesting();\n    ```\n     @method setupForTesting\n    @public\n  */\n  setupForTesting() {\n    setupForTesting();\n    this.testing = true;\n    this.resolveRegistration('router:main').reopen({\n      location: 'none'\n    });\n  },\n  /**\n    This will be used as the container to inject the test helpers into. By\n    default the helpers are injected into `window`.\n     @property helperContainer\n    @type {Object} The object to be used for test helpers.\n    @default window\n    @since 1.2.0\n    @private\n  */\n  helperContainer: null,\n  /**\n    This injects the test helpers into the `helperContainer` object. If an object is provided\n    it will be used as the helperContainer. If `helperContainer` is not set it will default\n    to `window`. If a function of the same name has already been defined it will be cached\n    (so that it can be reset if the helper is removed with `unregisterHelper` or\n    `removeTestHelpers`).\n     Any callbacks registered with `onInjectHelpers` will be called once the\n    helpers have been injected.\n     Example:\n    ```\n    App.injectTestHelpers();\n    ```\n     @method injectTestHelpers\n    @public\n  */\n  injectTestHelpers(helperContainer) {\n    if (helperContainer) {\n      this.helperContainer = helperContainer;\n    } else {\n      this.helperContainer = window;\n    }\n    this.reopen({\n      willDestroy() {\n        this._super(...arguments);\n        this.removeTestHelpers();\n      }\n    });\n    this.testHelpers = {};\n    for (let name in helpers) {\n      // SAFETY: It is safe to access a property on an object\n      this.originalMethods[name] = this.helperContainer[name];\n      // SAFETY: It is not quite as safe to do this, but it _seems_ to be ok.\n      this.testHelpers[name] = this.helperContainer[name] = helper(this, name);\n      // SAFETY: We checked that it exists\n      protoWrap(TestPromise.prototype, name, helper(this, name), helpers[name].meta.wait);\n    }\n    invokeInjectHelpersCallbacks(this);\n  },\n  /**\n    This removes all helpers that have been registered, and resets and functions\n    that were overridden by the helpers.\n     Example:\n     ```javascript\n    App.removeTestHelpers();\n    ```\n     @public\n    @method removeTestHelpers\n  */\n  removeTestHelpers() {\n    if (!this.helperContainer) {\n      return;\n    }\n    for (let name in helpers) {\n      this.helperContainer[name] = this.originalMethods[name];\n      // SAFETY: This is a weird thing, but it's not technically unsafe here.\n      delete TestPromise.prototype[name];\n      delete this.testHelpers[name];\n      delete this.originalMethods[name];\n    }\n  }\n});\n\n// This method is no longer needed\n// But still here for backwards compatibility\n// of helper chaining\nfunction protoWrap(proto, name, callback, isAsync) {\n  // SAFETY: This isn't entirely safe, but it _seems_ to be ok.\n  proto[name] = function (...args) {\n    if (isAsync) {\n      return callback.apply(this, args);\n    } else {\n      // SAFETY: This is not actually safe.\n      return this.then(function () {\n        return callback.apply(this, args);\n      });\n    }\n  };\n}\nfunction helper(app, name) {\n  let helper = helpers[name];\n  (isDevelopingApp() && !(helper) && assert(`[BUG] Missing helper: ${name}`, helper));\n  let fn = helper.method;\n  let meta = helper.meta;\n  if (!meta.wait) {\n    return (...args) => fn.apply(app, [app, ...args]);\n  }\n  return (...args) => {\n    let lastPromise = run(() => resolve(getLastPromise()));\n\n    // wait for last helper's promise to resolve and then\n    // execute. To be safe, we need to tell the adapter we're going\n    // asynchronous here, because fn may not be invoked before we\n    // return.\n    asyncStart();\n    return lastPromise.then(() => fn.apply(app, [app, ...args])).finally(asyncEnd);\n  };\n}\n","import '../../../@ember/-internals/runtime/lib/mixins/registry_proxy.js';\nimport '../../../@ember/-internals/runtime/lib/mixins/container_proxy.js';\nimport '../../../@ember/-internals/runtime/lib/mixins/comparable.js';\nimport '../../../@ember/-internals/runtime/lib/mixins/action_handler.js';\nimport '../../../@ember/-internals/runtime/lib/mixins/-proxy.js';\nimport '../../../@ember/enumerable/mutable.js';\nimport '../../../@ember/-internals/runtime/lib/mixins/target_action_support.js';\nimport '../../../@ember/-internals/runtime/lib/ext/rsvp.js';\nimport { _backburner } from '../../../@ember/runloop/index.js';\nimport { R as RSVP } from '../../../shared-chunks/rsvp-CnCSY930.js';\n\nRSVP.configure('async', function (callback, promise) {\n  // if schedule will cause autorun, we need to inform adapter\n  _backburner.schedule('actions', () => callback(promise));\n});\n\nexport { RSVP as default };\n","import { registerAsyncHelper, registerHelper } from './test/helpers.js';\nimport andThen from './helpers/and_then.js';\nimport currentPath from './helpers/current_path.js';\nimport currentRouteName from './helpers/current_route_name.js';\nimport currentURL from './helpers/current_url.js';\nimport { pauseTest, resumeTest } from './helpers/pause_test.js';\nimport visit from './helpers/visit.js';\nimport wait from './helpers/wait.js';\n\nregisterAsyncHelper('visit', visit);\nregisterAsyncHelper('wait', wait);\nregisterAsyncHelper('andThen', andThen);\nregisterAsyncHelper('pauseTest', pauseTest);\nregisterHelper('currentRouteName', currentRouteName);\nregisterHelper('currentPath', currentPath);\nregisterHelper('currentURL', currentURL);\nregisterHelper('resumeTest', resumeTest);\n","import '../../../@ember/debug/index.js';\nimport { isDevelopingApp } from '@embroider/macros';\nimport { assert } from '../../../@ember/debug/lib/assert.js';\n\nfunction andThen(app, callback) {\n  let wait = app.testHelpers['wait'];\n  (isDevelopingApp() && !(wait) && assert('[BUG] Missing wait helper', wait));\n  return wait(callback(app));\n}\n\nexport { andThen as default };\n","import '../../../@ember/object/index.js';\nimport '../../../@ember/-internals/meta/lib/meta.js';\nimport '../../../shared-chunks/mandatory-setter-DLKyVs4Q.js';\nimport { isDevelopingApp } from '@embroider/macros';\nimport '../../../@ember/debug/index.js';\nimport '../../../@glimmer/destroyable/index.js';\nimport '../../../@glimmer/validator/index.js';\nimport '../../../shared-chunks/debug-to-string-BsFOvUtQ.js';\nimport '../../../@glimmer/global-context/index.js';\nimport '../../../shared-chunks/reference-B6HMX4y0.js';\nimport '../../../shared-chunks/capabilities-DHiXCCuB.js';\nimport { g as get } from '../../../shared-chunks/observers-DhgQ6ba5.js';\nimport '../../../shared-chunks/env-DEd6hPbj.js';\nimport '../../../@ember/engine/instance.js';\nimport '../../../route-recognizer/index.js';\nimport '../../../shared-chunks/rsvp-CnCSY930.js';\nimport '../../../shared-chunks/unrecognized-url-error-BBMMZhBN.js';\nimport RoutingService from '../../../@ember/routing/lib/routing-service.js';\nimport '../../../@ember/controller/index.js';\nimport { assert } from '../../../@ember/debug/lib/assert.js';\n\n/**\n@module ember\n*/\nfunction currentPath(app) {\n  (isDevelopingApp() && !(app.__container__) && assert('[BUG] app.__container__ is not set', app.__container__));\n  let routingService = app.__container__.lookup('service:-routing');\n  (isDevelopingApp() && !(routingService instanceof RoutingService) && assert('[BUG] service:-routing is not a RoutingService', routingService instanceof RoutingService));\n  return get(routingService, 'currentPath');\n}\n\nexport { currentPath as default };\n","import '../../../@ember/object/index.js';\nimport '../../../@ember/-internals/meta/lib/meta.js';\nimport '../../../shared-chunks/mandatory-setter-DLKyVs4Q.js';\nimport { isDevelopingApp } from '@embroider/macros';\nimport '../../../@ember/debug/index.js';\nimport '../../../@glimmer/destroyable/index.js';\nimport '../../../@glimmer/validator/index.js';\nimport '../../../shared-chunks/debug-to-string-BsFOvUtQ.js';\nimport '../../../@glimmer/global-context/index.js';\nimport '../../../shared-chunks/reference-B6HMX4y0.js';\nimport '../../../shared-chunks/capabilities-DHiXCCuB.js';\nimport { g as get } from '../../../shared-chunks/observers-DhgQ6ba5.js';\nimport '../../../shared-chunks/env-DEd6hPbj.js';\nimport '../../../@ember/engine/instance.js';\nimport '../../../route-recognizer/index.js';\nimport '../../../shared-chunks/rsvp-CnCSY930.js';\nimport '../../../shared-chunks/unrecognized-url-error-BBMMZhBN.js';\nimport RoutingService from '../../../@ember/routing/lib/routing-service.js';\nimport '../../../@ember/controller/index.js';\nimport { assert } from '../../../@ember/debug/lib/assert.js';\n\n/**\n@module ember\n*/\nfunction currentRouteName(app) {\n  (isDevelopingApp() && !(app.__container__) && assert('[BUG] app.__container__ is not set', app.__container__));\n  let routingService = app.__container__.lookup('service:-routing');\n  (isDevelopingApp() && !(routingService instanceof RoutingService) && assert('[BUG] service:-routing is not a RoutingService', routingService instanceof RoutingService));\n  return get(routingService, 'currentRouteName');\n}\n\nexport { currentRouteName as default };\n","import '../../../@ember/object/index.js';\nimport '../../../@ember/debug/index.js';\nimport EmberRouter from '../../../@ember/routing/router.js';\nimport { isDevelopingApp } from '@embroider/macros';\nimport { assert } from '../../../@ember/debug/lib/assert.js';\nimport { g as get } from '../../../shared-chunks/observers-DhgQ6ba5.js';\nimport '../../../@ember/-internals/meta/lib/meta.js';\nimport '../../../shared-chunks/mandatory-setter-DLKyVs4Q.js';\nimport '../../../@glimmer/destroyable/index.js';\nimport '../../../@glimmer/validator/index.js';\nimport '../../../shared-chunks/debug-to-string-BsFOvUtQ.js';\nimport '../../../@glimmer/global-context/index.js';\nimport '../../../shared-chunks/reference-B6HMX4y0.js';\nimport '../../../shared-chunks/capabilities-DHiXCCuB.js';\nimport '../../../shared-chunks/env-DEd6hPbj.js';\n\n/**\n@module ember\n*/\nfunction currentURL(app) {\n  (isDevelopingApp() && !(app.__container__) && assert('[BUG] app.__container__ is not set', app.__container__));\n  let router = app.__container__.lookup('router:main');\n  (isDevelopingApp() && !(router instanceof EmberRouter) && assert('[BUG] router:main is not a Router', router instanceof EmberRouter));\n  let location = get(router, 'location');\n  (isDevelopingApp() && !(typeof location !== 'string') && assert('[BUG] location is still a string', typeof location !== 'string'));\n  return location.getURL();\n}\n\nexport { currentURL as default };\n","import '../../../@ember/-internals/runtime/lib/mixins/registry_proxy.js';\nimport '../../../@ember/-internals/runtime/lib/mixins/container_proxy.js';\nimport '../../../@ember/-internals/runtime/lib/mixins/comparable.js';\nimport '../../../@ember/-internals/runtime/lib/mixins/action_handler.js';\nimport '../../../@ember/-internals/runtime/lib/mixins/-proxy.js';\nimport '../../../@ember/enumerable/mutable.js';\nimport '../../../@ember/-internals/runtime/lib/mixins/target_action_support.js';\nimport '../../../@ember/-internals/runtime/lib/ext/rsvp.js';\nimport { info } from '../../../@ember/debug/index.js';\nimport { isDevelopingApp } from '@embroider/macros';\nimport { assert } from '../../../@ember/debug/lib/assert.js';\nimport { R as RSVP } from '../../../shared-chunks/rsvp-CnCSY930.js';\n\n/**\n@module ember\n*/\nlet resume;\n\n/**\n Resumes a test paused by `pauseTest`.\n\n @method resumeTest\n @return {void}\n @public\n*/\nfunction resumeTest() {\n  (isDevelopingApp() && !(resume) && assert('Testing has not been paused. There is nothing to resume.', resume));\n  resume();\n  resume = undefined;\n}\n\n/**\n Pauses the current test - this is useful for debugging while testing or for test-driving.\n It allows you to inspect the state of your application at any point.\n Example (The test will pause before clicking the button):\n\n ```javascript\n visit('/')\n return pauseTest();\n click('.btn');\n ```\n\n You may want to turn off the timeout before pausing.\n\n qunit (timeout available to use as of 2.4.0):\n\n ```\n visit('/');\n assert.timeout(0);\n return pauseTest();\n click('.btn');\n ```\n\n mocha (timeout happens automatically as of ember-mocha v0.14.0):\n\n ```\n visit('/');\n this.timeout(0);\n return pauseTest();\n click('.btn');\n ```\n\n\n @since 1.9.0\n @method pauseTest\n @return {Object} A promise that will never resolve\n @public\n*/\nfunction pauseTest() {\n  info('Testing paused. Use `resumeTest()` to continue.');\n  return new RSVP.Promise(resolve => {\n    resume = resolve;\n  }, 'TestAdapter paused promise');\n}\n\nexport { pauseTest, resumeTest };\n","import '../../../@ember/debug/index.js';\nimport EmberRouter from '../../../@ember/routing/router.js';\nimport { run } from '../../../@ember/runloop/index.js';\nimport { isDevelopingApp } from '@embroider/macros';\nimport { assert } from '../../../@ember/debug/lib/assert.js';\n\n/**\n  Loads a route, sets up any controllers, and renders any templates associated\n  with the route as though a real user had triggered the route change while\n  using your app.\n\n  Example:\n\n  ```javascript\n  visit('posts/index').then(function() {\n    // assert something\n  });\n  ```\n\n  @method visit\n  @param {String} url the name of the route\n  @return {RSVP.Promise<undefined>}\n  @public\n*/\nfunction visit(app, url) {\n  (isDevelopingApp() && !(app.__container__) && assert('[BUG] Missing container', app.__container__));\n  const router = app.__container__.lookup('router:main');\n  (isDevelopingApp() && !(router instanceof EmberRouter) && assert('[BUG] router:main is not a Router', router instanceof EmberRouter));\n  let shouldHandleURL = false;\n  app.boot().then(() => {\n    (isDevelopingApp() && !(typeof router.location !== 'string') && assert('[BUG] router.location is still a string', typeof router.location !== 'string'));\n    router.location.setURL(url);\n    if (shouldHandleURL) {\n      (isDevelopingApp() && !(app.__deprecatedInstance__) && assert(\"[BUG] __deprecatedInstance__ isn't set\", app.__deprecatedInstance__));\n      run(app.__deprecatedInstance__, 'handleURL', url);\n    }\n  });\n  if (app._readinessDeferrals > 0) {\n    // SAFETY: This should be safe, though it is odd.\n    router.initialURL = url;\n    run(app, 'advanceReadiness');\n    delete router.initialURL;\n  } else {\n    shouldHandleURL = true;\n  }\n  let wait = app.testHelpers['wait'];\n  (isDevelopingApp() && !(wait) && assert('[BUG] missing wait helper', wait));\n  return wait();\n}\n\nexport { visit as default };\n","import { checkWaiters } from '../test/waiters.js';\nimport '../../../@ember/-internals/runtime/lib/mixins/registry_proxy.js';\nimport '../../../@ember/-internals/runtime/lib/mixins/container_proxy.js';\nimport '../../../@ember/-internals/runtime/lib/mixins/comparable.js';\nimport '../../../@ember/-internals/runtime/lib/mixins/action_handler.js';\nimport '../../../@ember/-internals/runtime/lib/mixins/-proxy.js';\nimport '../../../@ember/enumerable/mutable.js';\nimport '../../../@ember/-internals/runtime/lib/mixins/target_action_support.js';\nimport '../../../@ember/-internals/runtime/lib/ext/rsvp.js';\nimport { _hasScheduledTimers, _getCurrentRunLoop, run } from '../../../@ember/runloop/index.js';\nimport { pendingRequests } from '../test/pending_requests.js';\nimport '../../../@ember/debug/index.js';\nimport EmberRouter from '../../../@ember/routing/router.js';\nimport { isDevelopingApp } from '@embroider/macros';\nimport { assert } from '../../../@ember/debug/lib/assert.js';\nimport { R as RSVP } from '../../../shared-chunks/rsvp-CnCSY930.js';\n\n/**\n@module ember\n*/\nfunction wait(app, value) {\n  return new RSVP.Promise(function (resolve) {\n    (isDevelopingApp() && !(app.__container__) && assert('[BUG] Missing container', app.__container__));\n    const router = app.__container__.lookup('router:main');\n    (isDevelopingApp() && !(router instanceof EmberRouter) && assert('[BUG] Expected router:main to be a subclass of Ember Router', router instanceof EmberRouter)); // Every 10ms, poll for the async thing to have finished\n    let watcher = setInterval(() => {\n      // 1. If the router is loading, keep polling\n      let routerIsLoading = router._routerMicrolib && Boolean(router._routerMicrolib.activeTransition);\n      if (routerIsLoading) {\n        return;\n      }\n\n      // 2. If there are pending Ajax requests, keep polling\n      if (pendingRequests()) {\n        return;\n      }\n\n      // 3. If there are scheduled timers or we are inside of a run loop, keep polling\n      if (_hasScheduledTimers() || _getCurrentRunLoop()) {\n        return;\n      }\n      if (checkWaiters()) {\n        return;\n      }\n\n      // Stop polling\n      clearInterval(watcher);\n\n      // Synchronously resolve the promise\n      run(null, resolve, value);\n    }, 10);\n  });\n}\n\nexport { wait as default };\n","import '../../shared-chunks/mandatory-setter-DLKyVs4Q.js';\nimport '@embroider/macros';\nimport '../../shared-chunks/env-DEd6hPbj.js';\nimport '../../@ember/debug/index.js';\nimport '../../@ember/runloop/index.js';\nimport '../../@ember/-internals/meta/lib/meta.js';\nimport '../../@glimmer/destroyable/index.js';\nimport '../../@glimmer/validator/index.js';\nimport '../../shared-chunks/debug-to-string-BsFOvUtQ.js';\nimport '../../@glimmer/global-context/index.js';\nimport '../../shared-chunks/reference-B6HMX4y0.js';\nimport '../../shared-chunks/capabilities-DHiXCCuB.js';\nimport '../../shared-chunks/observers-DhgQ6ba5.js';\nimport { onLoad } from '../../@ember/application/lib/lazy_load.js';\nimport '../../@ember/-internals/runtime/lib/mixins/registry_proxy.js';\nimport '../../@ember/-internals/runtime/lib/mixins/container_proxy.js';\nimport '../../@ember/-internals/runtime/lib/mixins/comparable.js';\nimport '../../@ember/-internals/runtime/lib/mixins/action_handler.js';\nimport '../../@ember/-internals/runtime/lib/mixins/-proxy.js';\nimport '../../@ember/enumerable/mutable.js';\nimport '../../@ember/-internals/runtime/lib/mixins/target_action_support.js';\nimport '../../@ember/-internals/runtime/lib/ext/rsvp.js';\nimport '../../@ember/object/index.js';\nimport '../../@ember/-internals/views/lib/views/core_view.js';\nimport '../../@ember/-internals/views/lib/mixins/action_support.js';\nimport '../../@ember/-internals/views/lib/views/states.js';\nimport '../../@ember/routing/route.js';\nimport '../../@ember/routing/router.js';\nimport '../../@ember/routing/none-location.js';\nimport '../../@ember/engine/instance.js';\nimport '../../route-recognizer/index.js';\nimport '../../shared-chunks/rsvp-CnCSY930.js';\nimport '../../shared-chunks/unrecognized-url-error-BBMMZhBN.js';\nimport '../../@ember/routing/lib/routing-service.js';\nimport '../../@ember/controller/index.js';\nimport '../../shared-chunks/index-CQkjwqTv.js';\nimport '../../shared-chunks/index-ByyoGpfz.js';\nimport '../../shared-chunks/registry-XY5cfmbH.js';\nimport '../../shared-chunks/dynamic-CuBsUXX8.js';\nimport '../../shared-chunks/constants-oDhF27qL.js';\nimport '../../@ember/engine/index.js';\nimport '../../@ember/routing/router-service.js';\n\nlet name = 'deferReadiness in `testing` mode';\nonLoad('Ember.Application', function (ApplicationClass) {\n  if (!ApplicationClass.initializers[name]) {\n    ApplicationClass.initializer({\n      name: name,\n      initialize(application) {\n        if (application.testing) {\n          application.deferReadiness();\n        }\n      }\n    });\n  }\n});\n","import '../../@ember/debug/index.js';\nimport { setAdapter, getAdapter } from './test/adapter.js';\nimport Adapter from './adapters/adapter.js';\nimport QUnitAdapter from './adapters/qunit.js';\nimport { setTesting } from '../../@ember/debug/lib/testing.js';\n\n/* global self */\n\n\n/**\n  Sets Ember up for testing. This is useful to perform\n  basic setup steps in order to unit test.\n\n  Use `App.setupForTesting` to perform integration tests (full\n  application testing).\n\n  @method setupForTesting\n  @namespace Ember\n  @since 1.5.0\n  @private\n*/\nfunction setupForTesting() {\n  setTesting(true);\n  let adapter = getAdapter();\n  // if adapter is not manually set default to QUnit\n  if (!adapter) {\n    setAdapter(typeof self.QUnit === 'undefined' ? Adapter.create() : QUnitAdapter.create());\n  }\n}\n\nexport { setupForTesting as default };\n","import { unregisterHelper, registerAsyncHelper, registerHelper, helpers } from './test/helpers.js';\nimport { onInjectHelpers } from './test/on_inject_helpers.js';\nimport TestPromise, { resolve, promise } from './test/promise.js';\nimport { checkWaiters, unregisterWaiter, registerWaiter } from './test/waiters.js';\nimport { setAdapter, getAdapter } from './test/adapter.js';\n\n/**\n  @module ember\n*/\n\n/**\n  This is a container for an assortment of testing related functionality:\n\n  * Choose your default test adapter (for your framework of choice).\n  * Register/Unregister additional test helpers.\n  * Setup callbacks to be fired when the test helpers are injected into\n    your application.\n\n  @class Test\n  @namespace Ember\n  @public\n*/\nconst Test = {\n  /**\n    Hash containing all known test helpers.\n     @property _helpers\n    @private\n    @since 1.7.0\n  */\n  _helpers: helpers,\n  registerHelper,\n  registerAsyncHelper,\n  unregisterHelper,\n  onInjectHelpers,\n  Promise: TestPromise,\n  promise,\n  resolve,\n  registerWaiter,\n  unregisterWaiter,\n  checkWaiters\n};\n\n/**\n Used to allow ember-testing to communicate with a specific testing\n framework.\n\n You can manually set it before calling `App.setupForTesting()`.\n\n Example:\n\n ```javascript\n Ember.Test.adapter = MyCustomAdapter.create()\n ```\n\n If you do not set it, ember-testing will default to `Ember.Test.QUnitAdapter`.\n\n @public\n @for Ember.Test\n @property adapter\n @type {Class} The adapter to be used.\n @default Ember.Test.QUnitAdapter\n*/\nObject.defineProperty(Test, 'adapter', {\n  get: getAdapter,\n  set: setAdapter\n});\n\nexport { Test as default };\n","import { setDispatchOverride } from '../../../@ember/-internals/error-handling/index.js';\n\nlet adapter;\nfunction getAdapter() {\n  return adapter;\n}\nfunction setAdapter(value) {\n  adapter = value;\n  if (value && typeof value.exception === 'function') {\n    setDispatchOverride(adapterDispatch);\n  } else {\n    setDispatchOverride(null);\n  }\n}\nfunction asyncStart() {\n  if (adapter) {\n    adapter.asyncStart();\n  }\n}\nfunction asyncEnd() {\n  if (adapter) {\n    adapter.asyncEnd();\n  }\n}\nfunction adapterDispatch(error) {\n  adapter.exception(error);\n\n  // @ts-expect-error Normally unreachable\n  console.error(error.stack); // eslint-disable-line no-console\n}\n\nexport { asyncEnd, asyncStart, getAdapter, setAdapter };\n","import TestPromise from './promise.js';\n\nconst helpers = {};\n/**\n @module @ember/test\n*/\n\n/**\n  `registerHelper` is used to register a test helper that will be injected\n  when `App.injectTestHelpers` is called.\n\n  The helper method will always be called with the current Application as\n  the first parameter.\n\n  For example:\n\n  ```javascript\n  import { registerHelper } from '@ember/test';\n  import { run } from '@ember/runloop';\n\n  registerHelper('boot', function(app) {\n    run(app, app.advanceReadiness);\n  });\n  ```\n\n  This helper can later be called without arguments because it will be\n  called with `app` as the first parameter.\n\n  ```javascript\n  import Application from '@ember/application';\n\n  App = Application.create();\n  App.injectTestHelpers();\n  boot();\n  ```\n\n  @public\n  @for @ember/test\n  @static\n  @method registerHelper\n  @param {String} name The name of the helper method to add.\n  @param {Function} helperMethod\n  @param options {Object}\n*/\nfunction registerHelper(name, helperMethod) {\n  helpers[name] = {\n    method: helperMethod,\n    meta: {\n      wait: false\n    }\n  };\n}\n\n/**\n  `registerAsyncHelper` is used to register an async test helper that will be injected\n  when `App.injectTestHelpers` is called.\n\n  The helper method will always be called with the current Application as\n  the first parameter.\n\n  For example:\n\n  ```javascript\n  import { registerAsyncHelper } from '@ember/test';\n  import { run } from '@ember/runloop';\n\n  registerAsyncHelper('boot', function(app) {\n    run(app, app.advanceReadiness);\n  });\n  ```\n\n  The advantage of an async helper is that it will not run\n  until the last async helper has completed.  All async helpers\n  after it will wait for it complete before running.\n\n\n  For example:\n\n  ```javascript\n  import { registerAsyncHelper } from '@ember/test';\n\n  registerAsyncHelper('deletePost', function(app, postId) {\n    click('.delete-' + postId);\n  });\n\n  // ... in your test\n  visit('/post/2');\n  deletePost(2);\n  visit('/post/3');\n  deletePost(3);\n  ```\n\n  @public\n  @for @ember/test\n  @method registerAsyncHelper\n  @param {String} name The name of the helper method to add.\n  @param {Function} helperMethod\n  @since 1.2.0\n*/\nfunction registerAsyncHelper(name, helperMethod) {\n  helpers[name] = {\n    method: helperMethod,\n    meta: {\n      wait: true\n    }\n  };\n}\n\n/**\n  Remove a previously added helper method.\n\n  Example:\n\n  ```javascript\n  import { unregisterHelper } from '@ember/test';\n\n  unregisterHelper('wait');\n  ```\n\n  @public\n  @method unregisterHelper\n  @static\n  @for @ember/test\n  @param {String} name The helper to remove.\n*/\nfunction unregisterHelper(name) {\n  delete helpers[name];\n  // SAFETY: This isn't necessarily a safe thing to do, but in terms of the immediate types here\n  // it won't error.\n  delete TestPromise.prototype[name];\n}\n\nexport { helpers, registerAsyncHelper, registerHelper, unregisterHelper };\n","const callbacks = [];\n\n/**\n  Used to register callbacks to be fired whenever `App.injectTestHelpers`\n  is called.\n\n  The callback will receive the current application as an argument.\n\n  Example:\n\n  ```javascript\n  import $ from 'jquery';\n\n  Ember.Test.onInjectHelpers(function() {\n    $(document).ajaxSend(function() {\n      Test.pendingRequests++;\n    });\n\n    $(document).ajaxComplete(function() {\n      Test.pendingRequests--;\n    });\n  });\n  ```\n\n  @public\n  @for Ember.Test\n  @method onInjectHelpers\n  @param {Function} callback The function to be called.\n*/\nfunction onInjectHelpers(callback) {\n  callbacks.push(callback);\n}\nfunction invokeInjectHelpersCallbacks(app) {\n  for (let callback of callbacks) {\n    callback(app);\n  }\n}\n\nexport { callbacks, invokeInjectHelpersCallbacks, onInjectHelpers };\n","let requests = [];\nfunction pendingRequests() {\n  return requests.length;\n}\nfunction clearPendingRequests() {\n  requests.length = 0;\n}\nfunction incrementPendingRequests(_, xhr) {\n  requests.push(xhr);\n}\nfunction decrementPendingRequests(_, xhr) {\n  setTimeout(function () {\n    for (let i = 0; i < requests.length; i++) {\n      if (xhr === requests[i]) {\n        requests.splice(i, 1);\n        break;\n      }\n    }\n  }, 0);\n}\n\nexport { clearPendingRequests, decrementPendingRequests, incrementPendingRequests, pendingRequests };\n","import '../../../@ember/-internals/runtime/lib/mixins/registry_proxy.js';\nimport '../../../@ember/-internals/runtime/lib/mixins/container_proxy.js';\nimport '../../../@ember/-internals/runtime/lib/mixins/comparable.js';\nimport '../../../@ember/-internals/runtime/lib/mixins/action_handler.js';\nimport '../../../@ember/-internals/runtime/lib/mixins/-proxy.js';\nimport '../../../@ember/enumerable/mutable.js';\nimport '../../../@ember/-internals/runtime/lib/mixins/target_action_support.js';\nimport '../../../@ember/-internals/runtime/lib/ext/rsvp.js';\nimport run from './run.js';\nimport { R as RSVP } from '../../../shared-chunks/rsvp-CnCSY930.js';\n\nlet lastPromise = null;\nclass TestPromise extends RSVP.Promise {\n  constructor(executor, label) {\n    super(executor, label);\n    lastPromise = this;\n  }\n  then(onFulfilled, onRejected, label) {\n    let normalizedOnFulfilled = typeof onFulfilled === 'function' ? result => isolate(onFulfilled, result) : undefined;\n    return super.then(normalizedOnFulfilled, onRejected, label);\n  }\n}\n\n/**\n  This returns a thenable tailored for testing.  It catches failed\n  `onSuccess` callbacks and invokes the `Ember.Test.adapter.exception`\n  callback in the last chained then.\n\n  This method should be returned by async helpers such as `wait`.\n\n  @public\n  @for Ember.Test\n  @method promise\n  @param {Function} resolver The function used to resolve the promise.\n  @param {String} label An optional string for identifying the promise.\n*/\nfunction promise(resolver, label) {\n  let fullLabel = `Ember.Test.promise: ${label || '<Unknown Promise>'}`;\n  return new TestPromise(resolver, fullLabel);\n}\n\n/**\n  Replacement for `Ember.RSVP.resolve`\n  The only difference is this uses\n  an instance of `Ember.Test.Promise`\n\n  @public\n  @for Ember.Test\n  @method resolve\n  @param {Mixed} The value to resolve\n  @since 1.2.0\n*/\nfunction resolve(result, label) {\n  return TestPromise.resolve(result, label);\n}\nfunction getLastPromise() {\n  return lastPromise;\n}\n\n// This method isolates nested async methods\n// so that they don't conflict with other last promises.\n//\n// 1. Set `Ember.Test.lastPromise` to null\n// 2. Invoke method\n// 3. Return the last promise created during method\nfunction isolate(onFulfilled, result) {\n  // Reset lastPromise for nested helpers\n  lastPromise = null;\n  let value = onFulfilled(result);\n  let promise = lastPromise;\n  lastPromise = null;\n\n  // If the method returned a promise\n  // return that promise. If not,\n  // return the last async helper's promise\n  if (value && value instanceof TestPromise || !promise) {\n    return value;\n  } else {\n    return run(() => resolve(promise).then(() => value));\n  }\n}\n\nexport { TestPromise as default, getLastPromise, promise, resolve };\n","import { _getCurrentRunLoop, run as run$1 } from '../../../@ember/runloop/index.js';\n\nfunction run(fn) {\n  if (!_getCurrentRunLoop()) {\n    return run$1(fn);\n  } else {\n    return fn();\n  }\n}\n\nexport { run as default };\n","/**\n @module @ember/test\n*/\nconst contexts = [];\nconst callbacks = [];\n\n/**\n   This allows ember-testing to play nicely with other asynchronous\n   events, such as an application that is waiting for a CSS3\n   transition or an IndexDB transaction. The waiter runs periodically\n   after each async helper (i.e. `click`, `andThen`, `visit`, etc) has executed,\n   until the returning result is truthy. After the waiters finish, the next async helper\n   is executed and the process repeats.\n\n   For example:\n\n   ```javascript\n   import { registerWaiter } from '@ember/test';\n\n   registerWaiter(function() {\n     return myPendingTransactions() === 0;\n   });\n   ```\n   The `context` argument allows you to optionally specify the `this`\n   with which your callback will be invoked.\n\n   For example:\n\n   ```javascript\n   import { registerWaiter } from '@ember/test';\n\n   registerWaiter(MyDB, MyDB.hasPendingTransactions);\n   ```\n\n   @public\n   @for @ember/test\n   @static\n   @method registerWaiter\n   @param {Object} context (optional)\n   @param {Function} callback\n   @since 1.2.0\n*/\n\nfunction registerWaiter(\n// Formatting makes a pretty big difference in how readable this is.\n// prettier-ignore\n...args) {\n  let checkedCallback;\n  let checkedContext;\n  if (args.length === 1) {\n    checkedContext = null;\n    checkedCallback = args[0];\n  } else {\n    checkedContext = args[0];\n    checkedCallback = args[1];\n  }\n  if (indexOf(checkedContext, checkedCallback) > -1) {\n    return;\n  }\n  contexts.push(checkedContext);\n  callbacks.push(checkedCallback);\n}\n\n/**\n   `unregisterWaiter` is used to unregister a callback that was\n   registered with `registerWaiter`.\n\n   @public\n   @for @ember/test\n   @static\n   @method unregisterWaiter\n   @param {Object} context (optional)\n   @param {Function} callback\n   @since 1.2.0\n*/\nfunction unregisterWaiter(context, callback) {\n  if (!callbacks.length) {\n    return;\n  }\n  if (arguments.length === 1) {\n    callback = context;\n    context = null;\n  }\n  let i = indexOf(context, callback);\n  if (i === -1) {\n    return;\n  }\n  contexts.splice(i, 1);\n  callbacks.splice(i, 1);\n}\n\n/**\n  Iterates through each registered test waiter, and invokes\n  its callback. If any waiter returns false, this method will return\n  true indicating that the waiters have not settled yet.\n\n  This is generally used internally from the acceptance/integration test\n  infrastructure.\n\n  @public\n  @for @ember/test\n  @static\n  @method checkWaiters\n*/\nfunction checkWaiters() {\n  if (!callbacks.length) {\n    return false;\n  }\n  for (let i = 0; i < callbacks.length; i++) {\n    let context = contexts[i];\n    let callback = callbacks[i];\n    // SAFETY: The loop ensures that this exists\n    if (!callback.call(context)) {\n      return true;\n    }\n  }\n  return false;\n}\nfunction indexOf(context, callback) {\n  for (let i = 0; i < callbacks.length; i++) {\n    if (callbacks[i] === callback && contexts[i] === context) {\n      return i;\n    }\n  }\n  return -1;\n}\n\nexport { checkWaiters, registerWaiter, unregisterWaiter };\n","import { d as debugToString } from './debug-to-string-BsFOvUtQ.js';\nimport { isDevelopingApp } from '@embroider/macros';\nimport { debugAssert } from '../@glimmer/global-context/index.js';\nimport { associateDestroyableChild } from '../@glimmer/destroyable/index.js';\nimport '../@glimmer/validator/index.js';\nimport { b as createComputeRef, d as createConstRef, U as UNDEFINED_REFERENCE } from './reference-B6HMX4y0.js';\nimport { a as argsProxyFor } from './args-proxy-B91L3LRK.js';\nimport { F as FROM_CAPABILITIES, b as buildCapabilities } from './capabilities-DHiXCCuB.js';\n\nfunction helperCapabilities(managerAPI, options = {}) {\n  debugAssert(managerAPI === '3.23', () => `Invalid helper manager compatibility specified; you specified ${managerAPI}, but only '3.23' is supported.`);\n  if (isDevelopingApp() && (!(options.hasValue || options.hasScheduledEffect) || options.hasValue && options.hasScheduledEffect)) {\n    throw new Error('You must pass either the `hasValue` OR the `hasScheduledEffect` capability when defining a helper manager. Passing neither, or both, is not permitted.');\n  }\n  if (isDevelopingApp() && options.hasScheduledEffect) {\n    throw new Error('The `hasScheduledEffect` capability has not yet been implemented for helper managers. Please pass `hasValue` instead');\n  }\n  return buildCapabilities({\n    hasValue: Boolean(options.hasValue),\n    hasDestroyable: Boolean(options.hasDestroyable),\n    hasScheduledEffect: Boolean(options.hasScheduledEffect)\n  });\n}\n\n////////////\n\nfunction hasValue(manager) {\n  return manager.capabilities.hasValue;\n}\nfunction hasDestroyable(manager) {\n  return manager.capabilities.hasDestroyable;\n}\n\n////////////\n\nclass CustomHelperManager {\n  constructor(factory) {\n    this.factory = factory;\n  }\n  helperManagerDelegates = new WeakMap();\n  undefinedDelegate = null;\n  getDelegateForOwner(owner) {\n    let delegate = this.helperManagerDelegates.get(owner);\n    if (delegate === undefined) {\n      let {\n        factory\n      } = this;\n      delegate = factory(owner);\n\n      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme\n      if (isDevelopingApp() && !FROM_CAPABILITIES.has(delegate.capabilities)) {\n        // TODO: This error message should make sense in both Ember and Glimmer https://github.com/glimmerjs/glimmer-vm/issues/1200\n        throw new Error(`Custom helper managers must have a \\`capabilities\\` property that is the result of calling the \\`capabilities('3.23')\\` (imported via \\`import { capabilities } from '@ember/helper';\\`). Received: \\`${JSON.stringify(delegate.capabilities\n        // eslint-disable-next-line @typescript-eslint/no-base-to-string\n        )}\\` for: \\`${delegate}\\``);\n      }\n      this.helperManagerDelegates.set(owner, delegate);\n    }\n    return delegate;\n  }\n  getDelegateFor(owner) {\n    if (owner === undefined) {\n      let {\n        undefinedDelegate\n      } = this;\n      if (undefinedDelegate === null) {\n        let {\n          factory\n        } = this;\n        this.undefinedDelegate = undefinedDelegate = factory(undefined);\n      }\n      return undefinedDelegate;\n    } else {\n      return this.getDelegateForOwner(owner);\n    }\n  }\n  getHelper(definition) {\n    return (capturedArgs, owner) => {\n      let manager = this.getDelegateFor(owner);\n      const args = argsProxyFor(capturedArgs, 'helper');\n      const bucket = manager.createHelper(definition, args);\n      if (hasValue(manager)) {\n        let cache = createComputeRef(() => manager.getValue(bucket), null, isDevelopingApp() && manager.getDebugName && manager.getDebugName(definition));\n        if (hasDestroyable(manager)) {\n          associateDestroyableChild(cache, manager.getDestroyable(bucket));\n        }\n        return cache;\n      } else if (hasDestroyable(manager)) {\n        let ref = createConstRef(undefined, isDevelopingApp() && (manager.getDebugName?.(definition) ?? 'unknown helper'));\n        associateDestroyableChild(ref, manager.getDestroyable(bucket));\n        return ref;\n      } else {\n        return UNDEFINED_REFERENCE;\n      }\n    };\n  }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\nclass FunctionHelperManager {\n  capabilities = buildCapabilities({\n    hasValue: true,\n    hasDestroyable: false,\n    hasScheduledEffect: false\n  });\n  createHelper(fn, args) {\n    return {\n      fn,\n      args\n    };\n  }\n  getValue({\n    fn,\n    args\n  }) {\n    if (Object.keys(args.named).length > 0) {\n      let argsForFn = [...args.positional, args.named];\n      return fn(...argsForFn);\n    }\n    return fn(...args.positional);\n  }\n  getDebugName(fn) {\n    if (fn.name) {\n      return `(helper function ${fn.name})`;\n    }\n    return '(anonymous helper function)';\n  }\n}\n\nconst COMPONENT_MANAGERS = new WeakMap();\nconst MODIFIER_MANAGERS = new WeakMap();\nconst HELPER_MANAGERS = new WeakMap();\n\n///////////\n\n/**\n * There is also Reflect.getPrototypeOf,\n * which errors when non-objects are passed.\n *\n * Since our conditional for figuring out whether to render primitives or not\n * may contain non-object values, we don't want to throw errors when we call this.\n */\nconst getPrototypeOf = Object.getPrototypeOf;\nfunction setManager(map, manager, obj) {\n  if (isDevelopingApp()) {\n    debugAssert(obj !== null && (typeof obj === 'object' || typeof obj === 'function'),\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme\n    `Attempted to set a manager on a non-object value. Managers can only be associated with objects or functions. Value was ${debugToString(obj)}`);\n    debugAssert(!map.has(obj),\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme\n    `Attempted to set the same type of manager multiple times on a value. You can only associate one manager of each type with a given value. Value was ${debugToString(obj)}`);\n  }\n  map.set(obj, manager);\n  return obj;\n}\nfunction getManager(map, obj) {\n  let pointer = obj;\n  while (pointer !== null) {\n    const manager = map.get(pointer);\n    if (manager !== undefined) {\n      return manager;\n    }\n    pointer = getPrototypeOf(pointer);\n  }\n  return undefined;\n}\n\n///////////\n\nfunction setInternalModifierManager(manager, definition) {\n  return setManager(MODIFIER_MANAGERS, manager, definition);\n}\nfunction getInternalModifierManager(definition, isOptional) {\n  if (isDevelopingApp()) {\n    debugAssert(typeof definition === 'object' && definition !== null || typeof definition === 'function', () =>\n    // eslint-disable-next-line @typescript-eslint/no-base-to-string -- @fixme\n    `Attempted to use a value as a modifier, but it was not an object or function. Modifier definitions must be objects or functions with an associated modifier manager. The value was: ${definition}`);\n  }\n  const manager = getManager(MODIFIER_MANAGERS, definition);\n  if (manager === undefined) {\n    if (isDevelopingApp()) {\n      debugAssert(isOptional,\n      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme\n      `Attempted to load a modifier, but there wasn't a modifier manager associated with the definition. The definition was: ${debugToString(definition)}`);\n    }\n    return null;\n  }\n  return manager;\n}\nfunction setInternalHelperManager(manager, definition) {\n  return setManager(HELPER_MANAGERS, manager, definition);\n}\nconst DEFAULT_MANAGER = new CustomHelperManager(() => new FunctionHelperManager());\nfunction getInternalHelperManager(definition, isOptional) {\n  debugAssert(typeof definition === 'object' && definition !== null || typeof definition === 'function', () =>\n  // eslint-disable-next-line @typescript-eslint/no-base-to-string -- @fixme\n  `Attempted to use a value as a helper, but it was not an object or function. Helper definitions must be objects or functions with an associated helper manager. The value was: ${definition}`);\n  let manager = getManager(HELPER_MANAGERS, definition);\n\n  // Functions are special-cased because functions are defined\n  // as the \"default\" helper, per: https://github.com/emberjs/rfcs/pull/756\n  if (manager === undefined && typeof definition === 'function') {\n    manager = DEFAULT_MANAGER;\n  }\n  if (manager) {\n    return manager;\n  } else if (isOptional === true) {\n    return null;\n  } else if (isDevelopingApp()) {\n    throw new Error(\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme\n    `Attempted to load a helper, but there wasn't a helper manager associated with the definition. The definition was: ${debugToString(definition)}`);\n  }\n  return null;\n}\nfunction setInternalComponentManager(factory, obj) {\n  return setManager(COMPONENT_MANAGERS, factory, obj);\n}\nfunction getInternalComponentManager(definition, isOptional) {\n  debugAssert(typeof definition === 'object' && definition !== null || typeof definition === 'function', () =>\n  // eslint-disable-next-line @typescript-eslint/no-base-to-string -- @fixme\n  `Attempted to use a value as a component, but it was not an object or function. Component definitions must be objects or functions with an associated component manager. The value was: ${definition}`);\n  const manager = getManager(COMPONENT_MANAGERS, definition);\n  if (manager === undefined) {\n    debugAssert(isOptional, () =>\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme\n    `Attempted to load a component, but there wasn't a component manager associated with the definition. The definition was: ${debugToString(definition)}`);\n    return null;\n  }\n  return manager;\n}\n\n///////////\n\nfunction hasInternalComponentManager(definition) {\n  return getManager(COMPONENT_MANAGERS, definition) !== undefined;\n}\nfunction hasInternalHelperManager(definition) {\n  return hasDefaultHelperManager(definition) || getManager(HELPER_MANAGERS, definition) !== undefined;\n}\nfunction hasInternalModifierManager(definition) {\n  return getManager(MODIFIER_MANAGERS, definition) !== undefined;\n}\nfunction hasDefaultHelperManager(definition) {\n  return typeof definition === 'function';\n}\n\nexport { CustomHelperManager as C, getInternalHelperManager as a, getInternalModifierManager as b, hasInternalComponentManager as c, hasInternalHelperManager as d, hasInternalModifierManager as e, hasValue as f, getInternalComponentManager as g, hasDestroyable as h, helperCapabilities as i, setInternalHelperManager as j, setInternalModifierManager as k, setInternalComponentManager as s };\n","const EMPTY_ARRAY = Object.freeze([]);\nfunction emptyArray() {\n  return EMPTY_ARRAY;\n}\nconst EMPTY_STRING_ARRAY = emptyArray();\nconst EMPTY_NUMBER_ARRAY = emptyArray();\n\n/**\n * This function returns `true` if the input array is the special empty array sentinel,\n * which is sometimes used for optimizations.\n */\nfunction isEmptyArray(input) {\n  return input === EMPTY_ARRAY;\n}\nfunction* reverse(input) {\n  for (let i = input.length - 1; i >= 0; i--) {\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme\n    yield input[i];\n  }\n}\nfunction* enumerate(input) {\n  let i = 0;\n  for (const item of input) {\n    yield [i++, item];\n  }\n}\n/**\n * Zip two tuples with the same type and number of elements.\n */\nfunction* zipTuples(left, right) {\n  for (let i = 0; i < left.length; i++) {\n    yield [i, left[i], right[i]];\n  }\n}\nfunction* zipArrays(left, right) {\n  for (let i = 0; i < left.length; i++) {\n    const perform = i < right.length ? 'retain' : 'pop';\n    yield [perform, i, left[i], right[i]];\n  }\n  for (let i = left.length; i < right.length; i++) {\n    yield ['push', i, undefined, right[i]];\n  }\n}\n\nexport { EMPTY_ARRAY as E, EMPTY_NUMBER_ARRAY as a, EMPTY_STRING_ARRAY as b, emptyArray as c, zipTuples as d, enumerate as e, isEmptyArray as i, reverse as r, zipArrays as z };\n","import { d as debugToString } from './debug-to-string-BsFOvUtQ.js';\nimport { isDevelopingApp } from '@embroider/macros';\n\nconst TEMPLATES = new WeakMap();\nconst getPrototypeOf = Reflect.getPrototypeOf;\nfunction setComponentTemplate(factory, obj) {\n  if (isDevelopingApp() && !(obj !== null && (typeof obj === 'object' || typeof obj === 'function'))) {\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme\n    throw new Error(`Cannot call \\`setComponentTemplate\\` on \\`${debugToString(obj)}\\``);\n  }\n  if (isDevelopingApp() && TEMPLATES.has(obj)) {\n    throw new Error(\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme\n    `Cannot call \\`setComponentTemplate\\` multiple times on the same class (\\`${debugToString(obj)}\\`)`);\n  }\n  TEMPLATES.set(obj, factory);\n  return obj;\n}\nfunction getComponentTemplate(obj) {\n  let pointer = obj;\n  while (pointer !== null) {\n    let template = TEMPLATES.get(pointer);\n    if (template !== undefined) {\n      return template;\n    }\n    pointer = getPrototypeOf(pointer);\n  }\n  return undefined;\n}\n\nexport { getComponentTemplate as g, setComponentTemplate as s };\n"],"mappings":"qFAKgC,IAAIA,G,uDCS7B,SAASC,EAAUC,GACxB,OACa,OAAXA,GACkB,iBAAXA,GACPC,QAAQC,IAAIF,EAAQ,cAAgBG,KAAKC,YAE7C,CAQO,SAASC,EAAWL,GACzB,OACa,OAAXA,GACkB,iBAAXA,GACPC,QAAQC,IAAIF,EAAQ,cAAgBG,KAAKG,aAE7C,C;;AClBe,SAASC,IACtB,MAAMC,KAAUC;AAEhB,IAAKD,OAAYE,KAAcF,KAAaA,EAAQG,MAClD,MAAM,IAAIC,MACR;AAIJ,MAAMD,EAAQH,EAAQG;AAEtB,IAAIE;AAaJ,GATEA,EADEF,QAA8CG,IAArCH,EAAMI,2BACHJ,EAAME,YAEN,iBAGZA,aAAuBG,SACzBH,EAAcA,EAAYI,aAGxBlB,MAAUc,OAAgBR,MAAWQ,GACvC,OAAOA;AACF,GAA2B,iBAAhBA,EAA0B,CAC1C,MAAMK,EAAeD,SAASE,cAAcN;AAC5C,GAAIK,EACF,OAAOA;AAGT,MAAM,IAAIN,MAAM,4BAA4BC,eAC9C,CACE,MAAM,IAAID,MACR,kEAGN,C,UChDwB,IAAIQ,G;;ACkFrB,SAASV,EAAcF,GAC5B,MAAMa,EAAeb;AACrB,MACuC,mBAA9Ba,EAAwBC,WACO,mBAA/BD,EAAyBE,UAEpC,CAOA,SAASC,EAAMC,GAEb,OAAOA,GAAMA,EAAGC,OAASA,MAAQD,CACnC,C,6BCtF8BE,KAAgB,EAAG,GAElC,IAAIC,QACM,IAAIA,WAiLKD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