{
  "version": 3,
  "sources": ["../index.ts", "../src/registry.ts", "../src/ComponentABC.ts", "../src/loaders.ts", "../src/index.ts"],
  "sourcesContent": ["export * from './src'\nexport { default } from './src'\n", "import { subscribable, dependencyDetection } from '@tko/observable'\nimport { getObjectOwnProperty, tasks } from '@tko/utils'\nimport type { Loader } from './loaders'\n\nconst loadingSubscribablesCache = {}, // Tracks component loads that are currently in flight\n  loadedDefinitionsCache = {} // Tracks component loads that have already completed\n\nfunction loadComponentAndNotify(componentName: string, callback: any): void {\n  let _subscribable = getObjectOwnProperty(loadingSubscribablesCache, componentName),\n    completedAsync\n  if (!_subscribable) {\n    // It's not started loading yet. Start loading, and when it's done, move it to loadedDefinitionsCache.\n    _subscribable = loadingSubscribablesCache[componentName] = new subscribable()\n    _subscribable.subscribe(callback)\n\n    beginLoadingComponent(componentName, function (definition, config) {\n      const isSynchronousComponent = !!(config && config.synchronous)\n      loadedDefinitionsCache[componentName] = { definition: definition, isSynchronousComponent: isSynchronousComponent }\n      delete loadingSubscribablesCache[componentName]\n\n      // For API consistency, all loads complete asynchronously. However we want to avoid\n      // adding an extra task schedule if it's unnecessary (i.e., the completion is already\n      // async).\n      //\n      // You can bypass the 'always asynchronous' feature by putting the synchronous:true\n      // flag on your component configuration when you register it.\n      if (completedAsync || isSynchronousComponent) {\n        // Note that notifySubscribers ignores any dependencies read within the callback.\n        // See comment in loaderRegistryBehaviors.js for reasoning\n        _subscribable.notifySubscribers(definition)\n      } else {\n        tasks.schedule(function () {\n          _subscribable.notifySubscribers(definition)\n        })\n      }\n    })\n    completedAsync = true\n  } else {\n    _subscribable.subscribe(callback)\n  }\n}\n\nfunction beginLoadingComponent(componentName, callback) {\n  getFirstResultFromLoaders('getConfig', [componentName], function (config) {\n    if (config) {\n      // We have a config, so now load its definition\n      getFirstResultFromLoaders('loadComponent', [componentName, config], function (definition) {\n        callback(definition, config)\n      })\n    } else {\n      // The component has no config - it's unknown to all the loaders.\n      // Note that this is not an error (e.g., a module loading error) - that would abort the\n      // process and this callback would not run. For this callback to run, all loaders must\n      // have confirmed they don't know about this component.\n      callback(null, null)\n    }\n  })\n}\n\nfunction getFirstResultFromLoaders(methodName, argsExceptCallback, callback, candidateLoaders?) {\n  // On the first call in the stack, start with the full set of loaders\n  if (!candidateLoaders) {\n    candidateLoaders = registry.loaders.slice(0) // Use a copy, because we'll be mutating this array\n  }\n\n  // Try the next candidate\n  const currentCandidateLoader = candidateLoaders.shift()\n  if (currentCandidateLoader) {\n    const methodInstance = currentCandidateLoader[methodName]\n    if (methodInstance) {\n      let wasAborted = false,\n        synchronousReturnValue = methodInstance.apply(\n          currentCandidateLoader,\n          argsExceptCallback.concat(function (result) {\n            if (wasAborted) {\n              callback(null)\n            } else if (result !== null) {\n              // This candidate returned a value. Use it.\n              callback(result)\n            } else {\n              // Try the next candidate\n              getFirstResultFromLoaders(methodName, argsExceptCallback, callback, candidateLoaders)\n            }\n          })\n        )\n\n      // Currently, loaders may not return anything synchronously. This leaves open the possibility\n      // that we'll extend the API to support synchronous return values in the future. It won't be\n      // a breaking change, because currently no loader is allowed to return anything except undefined.\n      if (synchronousReturnValue !== undefined) {\n        wasAborted = true\n\n        // Method to suppress exceptions will remain undocumented. This is only to keep\n        // KO's specs running tidily, since we can observe the loading got aborted without\n        // having exceptions cluttering up the console too.\n        if (!currentCandidateLoader.suppressLoaderExceptions) {\n          throw new Error(\n            'Component loaders must supply values by invoking the callback, not by returning values synchronously.'\n          )\n        }\n      }\n    } else {\n      // This candidate doesn't have the relevant handler. Synchronously move on to the next one.\n      getFirstResultFromLoaders(methodName, argsExceptCallback, callback, candidateLoaders)\n    }\n  } else {\n    // No candidates returned a value\n    callback(null)\n  }\n}\n\nexport const registry = {\n  get(componentName: string, callback: any) {\n    const cachedDefinition = getObjectOwnProperty(loadedDefinitionsCache, componentName)\n    if (cachedDefinition) {\n      // It's already loaded and cached. Reuse the same definition object.\n      // Note that for API consistency, even cache hits complete asynchronously by default.\n      // You can bypass this by putting synchronous:true on your component config.\n      if (cachedDefinition.isSynchronousComponent) {\n        dependencyDetection.ignore(function () {\n          // See comment in loaderRegistryBehaviors.js for reasoning\n          callback(cachedDefinition.definition)\n        })\n      } else {\n        tasks.schedule(function () {\n          callback(cachedDefinition.definition)\n        })\n      }\n    } else {\n      // Join the loading process that is already underway, or start a new one.\n      loadComponentAndNotify(componentName, callback)\n    }\n  },\n\n  clearCachedDefinition(componentName: string) {\n    delete loadedDefinitionsCache[componentName]\n  },\n\n  _getFirstResultFromLoaders: getFirstResultFromLoaders,\n\n  loaders: new Array<Loader>()\n}\n", "/**\n * Component --- Abstract Base Class\n *\n * This simplifies and compartmentalizes Components.  Use this:\n *\n *    class CompX extends ComponentABC {\n *    \tstatic get element () { return 'comp-x-id' }\n *    \tstatic get sync () { return false }\n *    \tstatic get elementName () { return 'comp-x' }\n *    }\n *    CompX.register()\n *\n * instead of:\n *\n *   class CompX {}\n *\n *   ko.components.register('comp-x', {\n *     viewModel: CompX,\n *     synchronous: false,\n *     template: { element: 'comp-x' }\n *   })\n *\n * As well, gain all the benefits of a LifeCycle, namely automated\n * event and subscription addition/removal.\n *\n * NOTE: A Component created this way can add events to the component node\n * with `this.addEventListener(type, action)`.\n */\nimport { LifeCycle } from '@tko/lifecycle'\nimport { register, VIEW_MODEL_FACTORY } from './loaders'\n\nexport class ComponentABC extends LifeCycle {\n  /**\n   * The tag name of the custom element.  For example 'my-component'.\n   * By default converts the class name from camel case to kebab case.\n   * @return {string} The custom node name of this component.\n   */\n  static get customElementName() {\n    return this.name.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase()\n  }\n\n  /**\n   * Overload this to return:\n   * 1. A string of markup\n   * 2. An array of DOM nodes\n   * 3. A document fragment\n   * 4. An AMD module (with `{require: 'some/template'}`)\n   * If neither this nor `element` is overloaded, the component's own\n   * children serve as its template (children-as-template mode).\n   * @return {mixed} One of the accepted template types for the ComponentBinding.\n   */\n  static get template(): any {\n    if ('template' in this.prototype) {\n      return undefined\n    }\n    const element = this.element\n    return element ? { element } : undefined\n  }\n\n  /**\n   * Overload this to return:\n   * 1. The element ID\n   * 2. A DOM node itself\n   * Leave unset to use children-as-template mode \u2014 the component's own\n   * instance children become its template.\n   * @return {string|HTMLElement|undefined} the element ID, actual element,\n   *   or undefined to opt into children-as-template.\n   */\n  static get element(): string | HTMLElement | undefined {\n    return undefined\n  }\n\n  /**\n   * @return {bool} True if the component shall load synchronously\n   */\n  static get sync() {\n    return true\n  }\n\n  /**\n   * Construct a new instance of the model.  When using ComponentABC as a\n   * base class, we do pass in the $element and $componentTemplateNodes.\n   * @param {Object} params\n   * @param {{element: HTMLElement, templateNodes: [HTMLElement]}} componentInfo\n   */\n  static [VIEW_MODEL_FACTORY](params: object, componentInfo: ComponentInfo): ComponentABC {\n    return new (this as any)(params, componentInfo)\n  }\n\n  static register(name = this.customElementName) {\n    // biome-ignore lint/complexity/noUselessThisAlias: viewModel captures the subclass for register()\n    const viewModel = this\n    const { template } = this\n    const synchronous = this.sync\n    register(name, { viewModel, template, synchronous })\n  }\n}\ninterface ComponentInfo {\n  element: HTMLElement\n  templateNodes: HTMLElement[]\n}\n", "import {\n  isDomElement,\n  isDocumentFragment,\n  tagNameLower,\n  parseHtmlFragment,\n  makeArray,\n  cloneNodes,\n  hasOwnProperty\n} from '@tko/utils'\n\nimport { registry } from './registry'\n\n// The default loader is responsible for two things:\n// 1. Maintaining the default in-memory registry of component configuration objects\n//    (i.e., the thing you're writing to when you call ko.components.register(someName, ...))\n// 2. Answering requests for components by fetching configuration objects\n//    from that default in-memory registry and resolving them into standard\n//    component definition objects (of the form { createViewModel: ..., template: ... })\n// Custom loaders may override either of these facilities, i.e.,\n// 1. To supply configuration objects from some other source (e.g., conventions)\n// 2. Or, to resolve configuration objects by loading viewmodels/templates via arbitrary logic.\n\nexport const defaultConfigRegistry: Record<string, Config> = {}\nexport const VIEW_MODEL_FACTORY = Symbol('Knockout View Model ViewModel factory')\n\nexport interface Component {\n  template: Node[]\n  createViewModel?: CreateViewModel\n}\nexport type CreateViewModel = (params: ViewModelParams, componentInfo: ComponentInfo) => ViewModel\n\nexport interface ViewModelParams {\n  [name: string]: any\n}\n\nexport interface ComponentInfo {\n  element: Node\n  templateNodes: Node[]\n}\n\nexport interface ViewModel {\n  dispose?: () => void\n  koDescendantsComplete?: (node: Node) => void\n}\n\nexport interface Config {\n  require?: string\n  viewModel?: RequireConfig | ViewModelConfig | any\n  template?: RequireConfig | TemplateConfig | any\n  synchronous?: boolean\n  ignoreCustomElementWarning?: boolean\n}\n\nexport interface ViewModelConstructor {\n  new (params?: ViewModelParams): ViewModel\n}\n\nexport interface ViewModelStatic {\n  instance: any\n}\nexport interface ViewModelFactory {\n  createViewModel: CreateViewModel\n}\nexport interface TemplateElement {\n  element: string | Node\n}\n\nexport type ViewModelConfig = ViewModelConstructor | ViewModelStatic | ViewModelFactory\nexport type TemplateConfig = string | Node[] | DocumentFragment | TemplateElement\n\nexport interface RequireConfig {\n  require: string\n}\n\nexport function register(componentName: string, config: Config) {\n  if (!config) {\n    throw new Error('Invalid configuration for ' + componentName)\n  }\n\n  if (isRegistered(componentName)) {\n    throw new Error('Component ' + componentName + ' is already registered')\n  }\n\n  const ceok = componentName.includes('-') && componentName.toLowerCase() === componentName\n\n  if (!config.ignoreCustomElementWarning && !ceok) {\n    console.log(`\n\uD83E\uDD4A  Knockout warning: components for custom elements must be lowercase and contain a dash.  To ignore this warning, add to the 'config' of .register(componentName, config):\n\n          ignoreCustomElementWarning: true\n    `)\n  }\n\n  defaultConfigRegistry[componentName] = config\n}\n\nexport function isRegistered(componentName: string): boolean {\n  return hasOwnProperty(defaultConfigRegistry, componentName)\n}\n\nexport function unregister(componentName: string): void {\n  delete defaultConfigRegistry[componentName]\n  registry.clearCachedDefinition(componentName)\n}\n\nexport interface Loader {\n  getConfig?(componentName: string, callback: (config: Config | null) => void): void\n  loadComponent?(componentName: string, config: Config | object, callback: (component: Component | null) => void): void\n  loadTemplate?(\n    componentName: string,\n    config: TemplateConfig | any,\n    callback: (resolvedTemplate: Node[] | null) => void\n  ): void\n  loadViewModel?(\n    componentName: string,\n    config: ViewModelConfig | any,\n    callback: (resolvedViewModel: CreateViewModel | null) => void\n  ): void\n}\n\nexport const defaultLoader: Loader = {\n  getConfig(componentName: string, callback: (config: Config | null) => void): void {\n    const result = hasOwnProperty(defaultConfigRegistry, componentName) ? defaultConfigRegistry[componentName] : null\n    callback(result)\n  },\n\n  loadComponent(componentName: string, config: Config, callback: (component: Component) => void): void {\n    const errorCallback = makeErrorCallback(componentName)\n    possiblyGetConfigFromAmd(errorCallback, config, function (loadedConfig) {\n      resolveConfig(componentName, errorCallback, loadedConfig, callback)\n    })\n  },\n\n  loadTemplate(\n    componentName: string,\n    templateConfig: TemplateConfig,\n    callback: (resolvedTemplate: Node[]) => void\n  ): void {\n    resolveTemplate(makeErrorCallback(componentName), templateConfig, callback)\n  },\n\n  loadViewModel(\n    componentName: string,\n    viewModelConfig: ViewModelConfig,\n    callback: (resolvedViewModel: CreateViewModel) => void\n  ): void {\n    resolveViewModel(makeErrorCallback(componentName), viewModelConfig, callback)\n  }\n}\n\nconst createViewModelKey = 'createViewModel'\n\n// Takes a config object of the form { template: ..., viewModel: ... }, and asynchronously convert it\n// into the standard component definition format:\n//    { template: <ArrayOfDomNodes>, createViewModel: function(params, componentInfo) { ... } }.\n// Since both template and viewModel may need to be resolved asynchronously, both tasks are performed\n// in parallel, and the results joined when both are ready. We don't depend on any promises infrastructure,\n// so this is implemented manually below.\nfunction resolveConfig(componentName, errorCallback, config, callback) {\n  const result = {},\n    tryIssueCallback = function () {\n      if (--makeCallBackWhenZero === 0) {\n        callback(result)\n      }\n    },\n    templateConfig = config['template'],\n    viewModelConfig = config['viewModel']\n\n  let makeCallBackWhenZero = 2\n  if (templateConfig) {\n    possiblyGetConfigFromAmd(errorCallback, templateConfig, function (loadedConfig) {\n      registry._getFirstResultFromLoaders('loadTemplate', [componentName, loadedConfig], function (resolvedTemplate) {\n        result['template'] = resolvedTemplate\n        tryIssueCallback()\n      })\n    })\n  } else {\n    tryIssueCallback()\n  }\n\n  if (viewModelConfig) {\n    possiblyGetConfigFromAmd(errorCallback, viewModelConfig, function (loadedConfig) {\n      registry._getFirstResultFromLoaders('loadViewModel', [componentName, loadedConfig], function (resolvedViewModel) {\n        result[createViewModelKey] = resolvedViewModel\n        tryIssueCallback()\n      })\n    })\n  } else {\n    tryIssueCallback()\n  }\n}\n\nfunction resolveTemplate(errorCallback, templateConfig, callback) {\n  if (typeof templateConfig === 'string') {\n    // Markup - parse it\n    callback(parseHtmlFragment(templateConfig))\n  } else if (templateConfig instanceof Array) {\n    // Assume already an array of DOM nodes - pass through unchanged\n    callback(templateConfig)\n  } else if (isDocumentFragment(templateConfig)) {\n    // Document fragment - use its child nodes\n    callback(makeArray(templateConfig.childNodes))\n  } else if (templateConfig.element) {\n    const element = templateConfig.element\n    if (isDomElement(element)) {\n      // Element instance - copy its child nodes\n      callback(cloneNodesFromTemplateSourceElement(element))\n    } else if (typeof element === 'string') {\n      // Element ID - find it, then copy its child nodes\n      const elemInstance = document.getElementById(element)\n      if (elemInstance) {\n        callback(cloneNodesFromTemplateSourceElement(elemInstance))\n      } else {\n        errorCallback('Cannot find element with ID ' + element)\n      }\n    } else {\n      errorCallback('Unknown element type: ' + element)\n    }\n  } else if (templateConfig.elementName) {\n    // JSX in the style of babel-plugin-transform-jsx\n    callback(templateConfig)\n  } else {\n    errorCallback('Unknown template value: ' + templateConfig)\n  }\n}\n\nfunction resolveViewModel(errorCallback, viewModelConfig, callback) {\n  if (viewModelConfig[VIEW_MODEL_FACTORY]) {\n    callback((...args) => viewModelConfig[VIEW_MODEL_FACTORY](...args))\n  } else if (typeof viewModelConfig === 'function') {\n    // Constructor - convert to standard factory function format\n    // By design, this does *not* supply componentInfo to the constructor, as the intent is that\n    // componentInfo contains non-viewmodel data (e.g., the component's element) that should only\n    // be used in factory functions, not viewmodel constructors.\n    callback(function (params /*, componentInfo */) {\n      return new viewModelConfig(params)\n    })\n  } else if (typeof viewModelConfig[createViewModelKey] === 'function') {\n    // Already a factory function - use it as-is\n    callback(viewModelConfig[createViewModelKey])\n  } else if ('instance' in viewModelConfig) {\n    // Fixed object instance - promote to createViewModel format for API consistency\n    const fixedInstance = viewModelConfig['instance']\n    callback(function (/* params, componentInfo */) {\n      return fixedInstance\n    })\n  } else if ('viewModel' in viewModelConfig) {\n    // Resolved AMD module whose value is of the form { viewModel: ... }\n    resolveViewModel(errorCallback, viewModelConfig['viewModel'], callback)\n  } else {\n    errorCallback('Unknown viewModel value: ' + viewModelConfig)\n  }\n}\n\nfunction cloneNodesFromTemplateSourceElement(elemInstance) {\n  switch (tagNameLower(elemInstance)) {\n    case 'script':\n      return parseHtmlFragment(elemInstance.text)\n    case 'textarea':\n      return parseHtmlFragment(elemInstance.value)\n    case 'template':\n      // For browsers with proper <template> element support (i.e., where the .content property\n      // gives a document fragment), use that document fragment.\n      if (isDocumentFragment(elemInstance.content)) {\n        return cloneNodes(elemInstance.content.childNodes)\n      }\n  }\n\n  // Regular elements such as <div>, and <template> elements on old browsers that don't really\n  // understand <template> and just treat it as a regular container\n  return cloneNodes(elemInstance.childNodes)\n}\n\nfunction possiblyGetConfigFromAmd(errorCallback, config, callback) {\n  if (typeof config.require === 'string') {\n    // The config is the value of an AMD module\n    if (window.amdRequire || window.require) {\n      const amdRequire = window.amdRequire || window.require\n      amdRequire([config.require], callback, function (err) {\n        const details = err?.message ?? String(err || '')\n        errorCallback('Failed to load AMD module: ' + config.require + (details ? ' \u2014 ' + details : ''))\n      })\n    } else {\n      errorCallback('Uses require, but no AMD loader is present')\n    }\n  } else {\n    callback(config)\n  }\n}\n\nfunction makeErrorCallback(componentName) {\n  return function (message) {\n    throw new Error(\"Component '\" + componentName + \"': \" + message)\n  }\n}\n\n// By default, the default loader is the only registered component loader\nregistry.loaders.push(defaultLoader)\n", "import { registry } from './registry'\n\nimport { ComponentABC } from './ComponentABC'\n\nimport { register, isRegistered, unregister, defaultLoader, defaultConfigRegistry } from './loaders'\n\nexport { ComponentABC }\n\nexport default {\n  ComponentABC,\n  // -- Registry --\n  get: registry.get,\n  clearCachedDefinition: registry.clearCachedDefinition,\n\n  // -- Loader --\n  register,\n  isRegistered,\n  unregister,\n  defaultLoader,\n  // \"Privately\" expose the underlying config registry for use in old-IE shim\n  _allRegisteredComponents: defaultConfigRegistry,\n\n  get loaders() {\n    return registry.loaders\n  },\n  set loaders(loaders) {\n    registry.loaders = loaders\n  }\n}\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,wBAAkD;AAClD,mBAA4C;AAG5C,IAAM,4BAA4B,CAAC;AAAnC,IACE,yBAAyB,CAAC;AAE5B,SAAS,uBAAuB,eAAuB,UAAqB;AAC1E,MAAI,oBAAgB,mCAAqB,2BAA2B,aAAa,GAC/E;AACF,MAAI,CAAC,eAAe;AAElB,oBAAgB,0BAA0B,aAAa,IAAI,IAAI,+BAAa;AAC5E,kBAAc,UAAU,QAAQ;AAEhC,0BAAsB,eAAe,SAAU,YAAY,QAAQ;AACjE,YAAM,yBAAyB,CAAC,EAAE,UAAU,OAAO;AACnD,6BAAuB,aAAa,IAAI,EAAE,YAAwB,uBAA+C;AACjH,aAAO,0BAA0B,aAAa;AAQ9C,UAAI,kBAAkB,wBAAwB;AAG5C,sBAAc,kBAAkB,UAAU;AAAA,MAC5C,OAAO;AACL,2BAAM,SAAS,WAAY;AACzB,wBAAc,kBAAkB,UAAU;AAAA,QAC5C,CAAC;AAAA,MACH;AAAA,IACF,CAAC;AACD,qBAAiB;AAAA,EACnB,OAAO;AACL,kBAAc,UAAU,QAAQ;AAAA,EAClC;AACF;AAEA,SAAS,sBAAsB,eAAe,UAAU;AACtD,4BAA0B,aAAa,CAAC,aAAa,GAAG,SAAU,QAAQ;AACxE,QAAI,QAAQ;AAEV,gCAA0B,iBAAiB,CAAC,eAAe,MAAM,GAAG,SAAU,YAAY;AACxF,iBA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