"use strict";

const Renderable = require('./renderable');

class Collection extends Renderable {}

Collection.Instance = require('./collectionInstance');
/*
const Registry = require('../../../util/registry');

class Collection extends Renderable {
  addElement(data, element) {
    if (!data.elementRegistry) {
      data.elementRegistry = new Registry({useId: 'name'});
    }
    data.elementRegistry.set(element);
    element.parent = data;
    return this;
  }

  async init(context, data={}) {
    const FormApi = this.engine.pluginRegistry.get('FormApi');
    data = await super.init(context, data);
    let replacementRegistry = new Registry({useId: 'name'});
    if (data.elementRegistry) {
      for (let element of data.elementRegistry.getOrderedElements()) {
        const Element = context.theme.getRenderable(element.type)
          || FormApi.getElement(element.type);
        replacementRegistry.set(await Element.init(context, element));
      }
      data.elementRegistry = replacementRegistry;
    }
    return data;
  }

  async commit(data) {
    const FormApi = this.engine.pluginRegistry.get('FormApi');
    return data.elementRegistry
      ? (await Promise.all(data.elementRegistry.getOrderedElements()
        .map(async (item) => {
          const Element = data.context.theme.getRenderable(item.type)
            || FormApi.getElement(item.type);
          return await Element.commit(item)
        })))
        .join('')
      : '';
  }

  *getAllElementsRecursive(data) {
    // NOTE: Intentionally leaving this as a generator.
    if (data && data.elementRegistry) {
      for (let element of data.elementRegistry.getOrderedElements()) {
        yield element;
        yield* this.getAllElementsRecursive(element.data);
      }
    }
  }
}
*/

module.exports = Collection;

@@ -151,1626 +151,8 @@
 e');
-%0A/*%0Aconst Registry = require('../../../util/registry');%0A%0Aclass Collection extends Renderable %7B%0A  addElement(data, element) %7B%0A    if (!data.elementRegistry) %7B%0A      data.elementRegistry = new Registry(%7BuseId: 'name'%7D);%0A    %7D%0A    data.elementRegistry.set(element);%0A    element.parent = data;%0A    return this;%0A  %7D%0A%0A  async init(context, data=%7B%7D) %7B%0A    const FormApi = this.engine.pluginRegistry.get('FormApi');%0A    data = await super.init(context, data);%0A    let replacementRegistry = new Registry(%7BuseId: 'name'%7D);%0A    if (data.elementRegistry) %7B%0A      for (let element of data.elementRegistry.getOrderedElements()) %7B%0A        const Element = context.theme.getRenderable(element.type)%0A          %7C%7C FormApi.getElement(element.type);%0A        replacementRegistry.set(await Element.init(context, element));%0A      %7D%0A      data.elementRegistry = replacementRegistry;%0A    %7D%0A    return data;%0A  %7D%0A%0A  async commit(data) %7B%0A    const FormApi = this.engine.pluginRegistry.get('FormApi');%0A    return data.elementRegistry%0A      ? (await Promise.all(data.elementRegistry.getOrderedElements()%0A        .map(async (item) =%3E %7B%0A          const Element = data.context.theme.getRenderable(item.type)%0A            %7C%7C FormApi.getElement(item.type);%0A          return await Element.commit(item)%0A        %7D)))%0A        .join('')%0A      : '';%0A  %7D%0A%0A  *getAllElementsRecursive(data) %7B%0A    // NOTE: Intentionally leaving this as a generator.%0A    if (data && data.elementRegistry) %7B%0A      for (let element of data.elementRegistry.getOrderedElements()) %7B%0A        yield element;%0A        yield* this.getAllElementsRecursive(element.data);%0A      %7D%0A    %7D%0A  %7D%0A%7D%0A*/
 %0A%0Amo

Remove accidental inclusion of commented-out code