{"version":3,"sources":["jsdelivr-header.js","/npm/@agile-ts/multieditor@0.0.25/src/logCodeManager.ts","/npm/@agile-ts/multieditor@0.0.25/src/validator/validator.ts","/npm/@agile-ts/multieditor@0.0.25/src/validator/resolvers/agile/index.ts","/npm/@agile-ts/multieditor@0.0.25/src/validator/resolvers/yup/index.ts","/npm/@agile-ts/multieditor@0.0.25/src/validator/validationMethods/general.ts","/npm/@agile-ts/multieditor@0.0.25/src/validator/validationMethods/number.ts","/npm/@agile-ts/multieditor@0.0.25/src/validator/validationMethods/string.ts","/npm/@agile-ts/multieditor@0.0.25/src/status/status.tracker.ts","/npm/@agile-ts/multieditor@0.0.25/src/status/status.ts","/npm/@agile-ts/multieditor@0.0.25/src/item.ts","/npm/@agile-ts/multieditor@0.0.25/src/utils.ts","/npm/@agile-ts/multieditor@0.0.25/src/multieditor/multieditor.ts","/npm/@agile-ts/multieditor@0.0.25/src/multieditor/index.ts","/npm/@agile-ts/multieditor@0.0.25/src/index.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,6oBCDA,IAAM,eAAiB,CAErB,WAAY,0DACZ,WAAY,kDASD,eAAiB,0BAI5B,oBACyB,eAAzB,QAAQ,IAAI,SAA4B,eAAiB,I,MCjB9C,UAgBX,cAAiD,IAArC,EAAqC,UAAA,OAAA,QAAA,IAAA,UAAA,GAAA,UAAA,GAAF,GAAE,gBAAA,KAAA,SAfP,IAeO,gBAAA,KAAA,eAAA,gBAAA,KAAA,oBAR/C,IASA,EAAS,mBAAa,EAAQ,CAC5B,IAAK,qBAEP,KAAK,KAAO,EAAO,GACpB,CAQa,OAAH,CAAI,GACb,KAAK,KAAO,CACb,CAOa,OAAH,GACT,OAAO,KAAK,IACb,CAUY,SACX,EACA,GAAgB,IAAA,EAAA,KAAA,OAAA,mBAAA,YAEhB,IAAI,GAAU,EACd,GAAY,MAAR,GAA6B,MAAb,EAAK,KAAc,OAAO,EAC9C,IAAM,EAAS,EAAK,SAGpB,EAAK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ACkC,aAA/B,KAAK,OAAO,gBACqB,qBAA/B,KAAK,OAAO,gBACX,KAAK,aACmB,QAA3B,KAAK,OAAO,YACiB,aAA3B,KAAK,OAAO,YAA6B,EAAK,OAAO,cACtD,EAEL,CASM,8BAA8B,GACnC,OACkC,aAA/B,KAAK,OAAO,gBACqB,qBAA/B,KAAK,OAAO,iBACV,KAAK,WACwB,aAA/B,KAAK,OAAO,iBACV,EAAK,OAAO,OAAO,WACI,QAA3B,KAAK,OAAO,YACiB,aAA3B,KAAK,OAAO,YAA6B,EAAK,OAAO,cACtD,EAEL,CASM,4BAA4B,GACjC,MACiC,WAA/B,KAAK,OAAO,iBACgB,QAA3B,KAAK,OAAO,YACiB,aAA3B,KAAK,OAAO,YAA6B,EAAK,OAAO,cACtD,EAEL,E,SC5gBa,kBACd,GAC6B,IAA7B,EAA6B,UAAA,OAAA,QAAA,IAAA,UAAA,GAAA,UAAA,GAAN,YAEvB,OAAO,IAAI,cAAwB,EAAQ,EAC5C,CCdD,IAAA,YAAe,c","file":"/npm/@agile-ts/multieditor@0.0.25/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@agile-ts/multieditor@0.0.25/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import {\n  logCodeManager as coreLogCodeManager,\n  assignAdditionalLogs,\n} from '@agile-ts/core';\n\nconst additionalLogs = {\n  // Validator\n  '41:03:00': \"A validation method needs to be of the type 'function'!\",\n  '41:03:01': \"Appending a Validator to itself isn't allowed!\",\n};\n\n/**\n * The Log Code Manager keeps track\n * and manages all important Logs for the '@agile-ts/multieditor' package.\n *\n * @internal\n */\nexport const logCodeManager = assignAdditionalLogs<\n  typeof coreLogCodeManager.logCodeMessages & typeof additionalLogs,\n  typeof coreLogCodeManager.logCodeMessages\n>(\n  coreLogCodeManager,\n  process.env.NODE_ENV !== 'production' ? additionalLogs : {}\n);\n","import { generateId, isFunction, defineConfig, copy } from '@agile-ts/utils';\nimport { Multieditor } from '../multieditor';\nimport { Item, ItemKey } from '../item';\nimport { logCodeManager } from '../logCodeManager';\n\nexport class Validator<ValueType = any> {\n  public config: ValidatorConfigInterface = {};\n\n  // Key/Name identifier of the Validator\n  public _key?: ValidatorKey;\n\n  // Methods that a value must pass in order to be 'valid'\n  public validationMethods: ValidationMethodContainerInterface<ValueType>[] =\n    [];\n\n  /**\n   * Handles the validation of Items.\n   *\n   * @public\n   * @param config - Configuration object\n   */\n  constructor(config: ValidatorConfigInterface = {}) {\n    config = defineConfig(config, {\n      key: generateId(),\n    });\n    this._key = config.key;\n  }\n\n  /**\n   * Updates the key/name identifier of the Validator.\n   *\n   * @public\n   * @param value - New key/name identifier.\n   */\n  public set key(value: ValidatorKey | undefined) {\n    this._key = value;\n  }\n\n  /**\n   * Returns the key/name identifier of the Validator.\n   *\n   * @public\n   */\n  public get key(): ValidatorKey | undefined {\n    return this._key;\n  }\n\n  /**\n   * Validates the specified value\n   * and updates the Status of the provided Item.\n   *\n   * @public\n   * @param item - Item to apply the computed status to.\n   * @param value - Value to be validated.\n   */\n  public async validate(\n    item: Item<ValueType>,\n    value: ValueType\n  ): Promise<boolean> {\n    let isValid = true;\n    if (item == null || item._key == null) return false;\n    const editor = item.editor();\n\n    // Track updated Statuses during the validation time\n    item.status.statusTracker.track();\n\n    // Call validation methods with the specified value\n    for (let i = 0; i < this.validationMethods.length; i++)\n      isValid =\n        (await this.validationMethods[i].method(item._key, value, editor)) &&\n        isValid;\n\n    // Handle tracked Statuses\n    const trackedStatuses = item.status.statusTracker.getTrackedStatuses();\n    if (trackedStatuses.length > 0) {\n      item.status.set(trackedStatuses[0]); // The first tracked Status is the most recent validation Status and thus should be displayed\n      item.status.lastTrackedValues = copy(trackedStatuses);\n    } else editor.resetStatus(item._key);\n\n    return isValid;\n  }\n\n  /**\n   * Assigns a new validation method to the Validator.\n   *\n   * @public\n   * @param method - Validation method to be added.\n   * @param config = Configuration object\n   */\n  public addValidationMethod(\n    method: ValidationMethodInterface<ValueType>,\n    config: AddValidationMethodConfigInterface = {}\n  ): this {\n    if (!isFunction(method)) {\n      logCodeManager.log('41:03:00');\n      return this;\n    }\n    this.validationMethods.push({ key: config.key, method });\n    return this;\n  }\n\n  /**\n   * Appends the specified Validator to this Validator.\n   *\n   * @public\n   * @param validator - Validator to be appended to this Validator.\n   */\n  public append(validator: Validator) {\n    if (validator === this) {\n      logCodeManager.log('41:03:01');\n      return this;\n    }\n\n    // Append validation methods to this Validator\n    this.validationMethods = this.validationMethods.concat(\n      validator.validationMethods\n    );\n\n    return this;\n  }\n\n  /**\n   * Returns a fresh reference free copy of this Validator.\n   *\n   * @public\n   */\n  public copy(): Validator<ValueType> {\n    const newValidator = new Validator<ValueType>({ key: this._key });\n    newValidator.validationMethods = copy(this.validationMethods);\n    newValidator.config = copy(this.config);\n    return newValidator;\n  }\n}\n\nexport type ValidatorKey = string | number;\n\nexport interface ValidatorConfigInterface {\n  /**\n   * Key/Name identifier of the Validator.\n   * @default undefined\n   */\n  key?: ValidatorKey;\n}\n\nexport type ValidationMethodInterface<ValueType = any> = (\n  /**\n   * Key/Name identifier of the Item whose value to be validated.\n   */\n  toValidateItemKey: ItemKey,\n  /**\n   * Value to be validated.\n   */\n  value: ValueType,\n  /**\n   * Multieditor the to validate Item belongs to.\n   */\n  editor: Multieditor\n) => Promise<boolean> | boolean;\n\nexport interface ValidationMethodContainerInterface<DataType = any> {\n  /**\n   * Key/Name identifier of the validation method.\n   * @default undefined\n   */\n  key?: ValidationMethodKey;\n  /**\n   * Validation method\n   */\n  method: ValidationMethodInterface<DataType>;\n}\n\nexport interface AddValidationMethodConfigInterface {\n  /**\n   * Key/Name identifier of the validation method.\n   * @default undefined\n   */\n  key?: string;\n}\n\nexport type ValidationMethodKey = string | number;\n","import { generateId, normalizeArray, isFunction } from '@agile-ts/utils';\nimport { ValidationMethodInterface, Validator } from '../../validator';\n\n/**\n * Returns a Validator created based on the specified Agile validation methods.\n *\n * @param validationSchemaParts - Agile Validation methods\n */\nexport function agileResolver(\n  ...validationSchemaParts: (\n    | ValidationMethodObjectInterface\n    // Why supporting such a weired method form?\n    // To also support passing the Agile validation method without calling it.\n    // Example: agileResolver(isRequired, isString, max(10))\n    | (() => ValidationMethodObjectInterface)\n  )[]\n): Validator {\n  const _validationSchemaParts = normalizeArray(validationSchemaParts);\n  const validator = new Validator();\n\n  _validationSchemaParts.forEach((validationSchemaPart) => {\n    if (typeof validationSchemaPart === 'function')\n      validationSchemaPart = validationSchemaPart();\n\n    // Add validation method to the created Validator\n    if (\n      validationSchemaPart != null &&\n      isFunction(validationSchemaPart.method)\n    ) {\n      validator.addValidationMethod(validationSchemaPart.method, {\n        key: `${validationSchemaPart.key ?? generateId()}_${generateId()}`,\n      });\n    }\n  });\n\n  return validator;\n}\n\nexport interface ValidationMethodObjectInterface<DataType = any> {\n  /**\n   * Key/name identifier of the specified validation method.\n   * @default randomly generated key\n   */\n  key?: string;\n  /**\n   * Validation method.\n   */\n  method: ValidationMethodInterface<DataType>;\n}\n","import { generateId } from '@agile-ts/utils';\nimport type { BaseSchema } from 'yup';\nimport { Validator } from '../../validator';\n\n/**\n * Returns a Validator created based on the specified Yup schema.\n *\n * @param schema - Yup schema\n */\nexport function yupResolver(schema: BaseSchema): Validator {\n  const validator = new Validator();\n\n  // Add validation method to the created Validator\n  validator.addValidationMethod(\n    async (toValidateItemKey, value, editor) => {\n      let isValid = true;\n\n      try {\n        // Validate Yup schema\n        await schema.validate(value);\n      } catch (e: any) {\n        isValid = false;\n\n        // Resolve Yup Error\n        if (e.name === 'ValidationError' && e.inner != null) {\n          if (e.inner.length === 0) {\n            editor.setStatus(\n              toValidateItemKey,\n              'error',\n              e.message.replace('this', toValidateItemKey)\n            );\n          }\n          for (const innerErr of e.inner) {\n            editor.setStatus(\n              toValidateItemKey,\n              'error',\n              innerErr.message.replace('this', toValidateItemKey)\n            );\n          }\n        }\n      }\n\n      return isValid;\n    },\n    { key: `yup_${generateId()}` }\n  );\n\n  return validator;\n}\n","import { ValidationMethodObjectInterface } from '../resolvers/agile';\n\nexport function isRequired(\n  errorMessage?: string\n): ValidationMethodObjectInterface {\n  return {\n    key: 'isRequired',\n    method: (toValidateItemKey, value, editor): boolean => {\n      const isValid = !!value;\n      if (!isValid) {\n        editor.setStatus(\n          toValidateItemKey as any,\n          'error',\n          errorMessage || `${toValidateItemKey} is a required field`\n        );\n      }\n      return isValid;\n    },\n  };\n}\n","import { ValidationMethodObjectInterface } from '../resolvers/agile';\n\nexport function isNumber(\n  errorMessage?: string\n): ValidationMethodObjectInterface {\n  return {\n    key: 'isNumber',\n    method: (toValidateItemKey, value, editor): boolean => {\n      const isValid = typeof value === 'number';\n      if (!isValid) {\n        editor.setStatus(\n          toValidateItemKey,\n          'error',\n          errorMessage || `${toValidateItemKey} must be a valid number`\n        );\n      }\n      return isValid;\n    },\n  };\n}\n\nexport function maxNumber(\n  maxNumber: number,\n  errorMessage?: string\n): ValidationMethodObjectInterface {\n  return {\n    key: 'maxNumber',\n    method: (toValidateItemKey, value, editor): boolean => {\n      if (value == null || typeof value !== 'number') return false;\n      const isValid = value <= maxNumber;\n      if (!isValid) {\n        editor.setStatus(\n          toValidateItemKey,\n          'error',\n          errorMessage ||\n            `${toValidateItemKey} must be smaller than ${maxNumber}`\n        );\n      }\n      return isValid;\n    },\n  };\n}\n\nexport function minNumber(\n  minNumber: number,\n  errorMessage?: string\n): ValidationMethodObjectInterface {\n  return {\n    key: 'minNumber',\n    method: (toValidateItemKey, value, editor): boolean => {\n      if (value == null || typeof value !== 'number') return false;\n      const isValid = value >= minNumber;\n      if (!isValid) {\n        editor.setStatus(\n          toValidateItemKey,\n          'error',\n          errorMessage ||\n            `${toValidateItemKey} must be larger than ${minNumber}`\n        );\n      }\n      return isValid;\n    },\n  };\n}\n\nexport function isPositiveNumber(\n  errorMessage?: string\n): ValidationMethodObjectInterface {\n  return {\n    key: 'positiveNumber',\n    method: (toValidateItemKey, value, editor): boolean => {\n      if (value == null || typeof value !== 'number') return false;\n      const isValid = value >= 0;\n      if (!isValid) {\n        editor.setStatus(\n          toValidateItemKey,\n          'error',\n          errorMessage || `${toValidateItemKey} must be a positive number`\n        );\n      }\n      return isValid;\n    },\n  };\n}\n\nexport function isNegativeNumber(\n  errorMessage?: string\n): ValidationMethodObjectInterface {\n  return {\n    key: 'negativeNumber',\n    method: (toValidateItemKey, value, editor): boolean => {\n      if (value == null || typeof value !== 'number') return false;\n      const isValid = value < 0;\n      if (!isValid) {\n        editor.setStatus(\n          toValidateItemKey,\n          'error',\n          errorMessage || `${toValidateItemKey} must be a negative number`\n        );\n      }\n      return isValid;\n    },\n  };\n}\n","import { ValidationMethodObjectInterface } from '../resolvers/agile';\n\nexport function isString(\n  errorMessage?: string\n): ValidationMethodObjectInterface {\n  return {\n    key: 'isString',\n    method: (toValidateItemKey, value, editor): boolean => {\n      const isValid = typeof value === 'string';\n      if (!isValid) {\n        editor.setStatus(\n          toValidateItemKey,\n          'error',\n          errorMessage || `${toValidateItemKey} must be a valid string`\n        );\n      }\n      return isValid;\n    },\n  };\n}\n\nexport function maxLength(\n  maxLength: number,\n  errorMessage?: string\n): ValidationMethodObjectInterface {\n  return {\n    key: 'maxLength',\n    method: (toValidateItemKey, value, editor): boolean => {\n      if (value == null || typeof value !== 'string') return false;\n      const isValid = value.length <= maxLength;\n      if (!isValid) {\n        editor.setStatus(\n          toValidateItemKey,\n          'error',\n          errorMessage ||\n            `${toValidateItemKey} must be at most ${maxLength} characters`\n        );\n      }\n      return isValid;\n    },\n  };\n}\n\nexport function minLength(\n  minLength: number,\n  errorMessage?: string\n): ValidationMethodObjectInterface {\n  return {\n    key: 'minLength',\n    method: (toValidateItemKey, value, editor): boolean => {\n      if (value == null || typeof value !== 'string') return false;\n      const isValid = value.length >= minLength;\n      if (!isValid) {\n        editor.setStatus(\n          toValidateItemKey,\n          'error',\n          errorMessage ||\n            `${toValidateItemKey} must be at least ${minLength} characters`\n        );\n      }\n      return isValid;\n    },\n  };\n}\n\nexport function isEmail(\n  errorMessage?: string\n): ValidationMethodObjectInterface {\n  return {\n    key: 'isEmail',\n    method: (toValidateItemKey, value, editor): boolean => {\n      if (value == null || typeof value !== 'string') return false;\n      const emailRegex =\n        /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n      const isValid = emailRegex.test(value.toLowerCase());\n      if (!isValid) {\n        editor.setStatus(\n          toValidateItemKey,\n          'error',\n          errorMessage || `${toValidateItemKey} must be a valid email`\n        );\n      }\n      return isValid;\n    },\n  };\n}\n\nexport function isUrl(errorMessage?: string): ValidationMethodObjectInterface {\n  return {\n    key: 'isUrl',\n    method: (toValidateItemKey, value, editor): boolean => {\n      if (value == null || typeof value !== 'string') return false;\n      const urlRegex =\n        /[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)?/gi;\n      const isValid = urlRegex.test(value.toLowerCase());\n      if (!isValid) {\n        editor.setStatus(\n          toValidateItemKey,\n          'error',\n          errorMessage || `${toValidateItemKey} must be a valid url`\n        );\n      }\n      return isValid;\n    },\n  };\n}\n\nexport function matchesRegex(\n  regex: RegExp,\n  errorMessage?: string\n): ValidationMethodObjectInterface {\n  return {\n    key: 'matchesRegex',\n    method: (toValidateItemKey, value, editor): boolean => {\n      if (value == null || typeof value !== 'string') return false;\n      const isValid = regex.test(value.toLowerCase());\n      if (!isValid) {\n        editor.setStatus(\n          toValidateItemKey,\n          'error',\n          errorMessage || `${toValidateItemKey} must follow the defined regex`\n        );\n      }\n      return isValid;\n    },\n  };\n}\n","import { StatusInterface } from './status';\n\nexport class StatusTracker {\n  isTracking = false;\n  trackedStatuses: Set<StatusInterface> = new Set();\n\n  /**\n   * Helper Class for automatic tracking set Statuses in validation methods.\n   *\n   * @internal\n   */\n  constructor() {\n    // empty\n  }\n\n  /**\n   * Activates the Status Tracker to globally track used Statuses.\n   *\n   * @internal\n   */\n  track(): void {\n    this.isTracking = true;\n  }\n\n  /**\n   * Tracks the specified Status and caches it\n   * if the Status Tracker is actively tracking.\n   *\n   * @internal\n   * @param status - Status\n   */\n  tracked(status: StatusInterface) {\n    if (this.isTracking) this.trackedStatuses.add(status);\n  }\n\n  /**\n   * Returns the latest tracked Statuses\n   * and stops the Status Tracker from tracking any more Statuses.\n   *\n   * @internal\n   */\n  getTrackedStatuses(): Array<StatusInterface> {\n    const trackedStatuses = Array.from(this.trackedStatuses);\n\n    // Reset Status Tracker\n    this.isTracking = false;\n    this.trackedStatuses = new Set();\n\n    return trackedStatuses;\n  }\n}\n","import { State, StateIngestConfigInterface } from '@agile-ts/core';\nimport { copy, defineConfig } from '@agile-ts/utils';\nimport { Item } from '../item';\nimport { StatusTracker } from './status.tracker';\n\nexport class Status<ValueType = any> extends State<StatusValueType> {\n  config: StatusConfigInterface;\n\n  // Item the Status belongs to\n  public item: Item<ValueType>;\n\n  // Helper Class for automatic tracking set Statuses in validation methods\n  public statusTracker: StatusTracker;\n\n  // Represents all tracked Status values of the last validation\n  public lastTrackedValues: StatusValueType[] = [];\n\n  /**\n   * Represents the current status of the specified Item.\n   *\n   * @public\n   * @param item - Item the Status belongs to.\n   * @param config - Configuration object\n   */\n  constructor(item: Item<ValueType>, config: CreateStatusConfigInterface = {}) {\n    super(item.agileInstance(), null, { key: `status_${item._key}` });\n    config = defineConfig(config, {\n      display: false,\n    });\n    this.item = item;\n    this.statusTracker = new StatusTracker();\n    this.config = {\n      display: config.display as any,\n    };\n  }\n\n  /**\n   * Returns a reference-free version of the current Status value\n   * if the Status should be displayed.\n   *\n   * @public\n   */\n  public get value(): StatusValueType {\n    return this.config.display ? copy(this._value) : null;\n  }\n\n  /**\n   * Assigns a new value to the Status\n   * and re-renders all subscribed UI-Components.\n   *\n   * @public\n   * @param value - New Status value\n   * @param config - Configuration object\n   */\n  public set(value: StatusValueType, config: StatusSetInterface = {}): this {\n    config = defineConfig(config, {\n      waitForTracking: false,\n      background:\n        this.config != null // Because on the initial set (when calling '.super') the Config isn't set\n          ? !this.config.display\n          : undefined,\n    });\n    if (value != null) this.statusTracker.tracked(value);\n\n    // Return when waiting for end of tracking to apply the last tracked change to the Status, if applicable\n    if (config.waitForTracking && this.statusTracker.isTracking) return this;\n\n    // Ingest the Status with the new value into the runtime\n    this.observers['value'].ingestValue(value, config);\n\n    return this;\n  }\n}\n\nexport type StatusType = 'error' | 'success' | 'warn' | string;\nexport type StatusValueType = StatusInterface | null;\n\nexport interface StatusInterface {\n  /**\n   * Type of Status ('error', 'success', ..)\n   */\n  type: StatusType;\n  /**\n   * Message of Status\n   */\n  message: string;\n}\n\nexport interface StatusSetInterface extends StateIngestConfigInterface {\n  /**\n   * If tracking of the particular Status is active,\n   * the value is only tracked (not applied).\n   * If the tracking has been finished the last tracked Status value should be applied to the Status.\n   * (See: https://github.com/agile-ts/agile/pull/204#issuecomment-925934647)\n   * @default false\n   */\n  waitForTracking?: boolean;\n}\n\nexport interface StatusConfigInterface {\n  /**\n   * Whether the Status should be displayed or stay hidden (in the UI).\n   * @default false\n   */\n  display: boolean;\n}\n\nexport interface CreateStatusConfigInterface {\n  /**\n   * Whether the Status should be displayed or stay hidden (in the UI).\n   * @default false\n   */\n  display?: boolean;\n}\n","import { StateRuntimeJobConfigInterface, State } from '@agile-ts/core';\nimport { isFunction, defineConfig } from '@agile-ts/utils';\nimport { Multieditor } from './multieditor';\nimport { Status } from './status';\nimport { Validator } from './validator';\nimport { logCodeManager } from './logCodeManager';\n\nexport class Item<ValueType = any> extends State<ValueType> {\n  // Multieditor the Item belongs to\n  public editor: () => Multieditor;\n\n  public config: ItemConfigInterface;\n\n  // Whether the Item value is valid\n  public isValid = false;\n  // Handles the validation of the Item\n  public validator: Validator<ValueType>;\n  // Handles and represents the validation Status of the Item\n  public status: Status<ValueType>;\n\n  // Whether the Item has been touched\n  public touched = false;\n\n  // Method for dynamically computing the Item value\n  public computeValueMethod?: ComputeValueMethod<ValueType>;\n\n  /**\n   * An Item represents a piece of information from the Multieditor.\n   *\n   * @public\n   * @param editor - Multieditor to which the Item belongs.\n   * @param initialValue - Initial value of the Item.\n   * @param config - Configuration object\n   */\n  constructor(\n    editor: Multieditor,\n    initialValue: ValueType,\n    config: ItemConfigInterface<ValueType>\n  ) {\n    super(editor.agileInstance(), initialValue, {\n      key: config.key,\n    });\n    config = defineConfig(config, {\n      canBeEdited: true,\n      validator: new Validator(),\n    });\n    this.editor = () => editor;\n    this.validator = config.validator as any;\n    this.config = config;\n    this.status = new Status(this);\n\n    // Add side effect to revalidate the Item on every Item value change\n    this.addSideEffect('validateItem', async () => {\n      if (this.editor().canAssignStatusToItemOnChange(this))\n        this.status.config.display = true;\n\n      await this.validate();\n\n      // Recompute Multieditor states\n      this.editor().recomputeValidatedState({ validate: false });\n      this.editor().recomputeModifiedState();\n    });\n  }\n\n  /**\n   * Revalidates the Item via the Validator\n   * and updates the 'isValid' state.\n   *\n   * @public\n   */\n  public async validate(): Promise<boolean> {\n    const isValid = await this.validator.validate(this, this.value);\n    this.isValid = isValid;\n    return isValid;\n  }\n\n  /**\n   * Resets the Item value to its initial value.\n   *\n   * @public\n   * @param config - Configuration object\n   */\n  public reset(config: StateRuntimeJobConfigInterface = {}): this {\n    this.set(this.initialStateValue, config);\n    this.status.config.display = false;\n    this.touched = false;\n    return this;\n  }\n\n  /**\n   * Defines the method used to compute the value of the Item.\n   *\n   * It is retrieved on each Item value change,\n   * in order to compute the new Item value\n   * based on the specified compute method.\n   *\n   * @public\n   * @param method - Method to compute the value of the Item.\n   */\n  public computeValue(method: ComputeValueMethod<ValueType>): this {\n    if (!isFunction(method)) {\n      logCodeManager.log('00:03:01', {\n        replacers: ['Compute Value Method', 'function'],\n      });\n      return this;\n    }\n    this.computeValueMethod = method;\n\n    // Initial compute\n    // (not directly computing it here since it is computed once in the runtime!)\n    this.set(this.nextStateValue);\n\n    return this;\n  }\n\n  public blur(): this {\n    this.touched = true;\n\n    // Assign Status to Item\n    if (this.editor().canAssignStatusToItemOnBlur(this)) {\n      this.status.config.display = true;\n      this.status.ingest({\n        force: true, // Force because the value hasn't changed\n      });\n    }\n\n    return this;\n  }\n}\n\nexport interface ItemConfigInterface<ValueType = any> {\n  /**\n   * Key/Name identifier of the Item.\n   */\n  key: ItemKey;\n  /**\n   * Whether the Item value can be edited\n   * and thus should be represented in the 'preparedData' object when submitting.\n   * @default true\n   */\n  canBeEdited?: boolean;\n  /**\n   * Validator to handle validating the Item.\n   * @default newly create Validator\n   */\n  validator?: Validator<ValueType>;\n}\n\nexport type ComputeValueMethod<T = any> = (value: T) => T;\n\nexport type ItemKey = string | number;\n","import { copy } from '@agile-ts/utils';\n\n/**\n * Updates a nested property at the specified path with the provided new value.\n *\n * Inspired by:\n * https://stackoverflow.com/questions/18936915/dynamically-set-property-of-nested-object\n *\n * @param obj - Object in which the property is to be updated at the path.\n * @param path - Path to the property to be updated in the specified object.\n * @param value - New value\n */\nexport function updateNestedProperty(\n  obj: Object,\n  path: string | string[],\n  value: any\n) {\n  const updatedObject = copy(obj);\n\n  let schema = updatedObject; // A moving reference to internal objects within 'newObject'\n  const pathParts = Array.isArray(path) ? path : path.split('.');\n  const pathPartsLength = pathParts.length;\n\n  if (pathPartsLength <= 0) return obj;\n\n  // Go to the corresponding object part where the value should be updated\n  for (let i = 0; i < pathPartsLength - 1; i++) {\n    const pathPart = pathParts[i];\n    if (!schema[pathPart]) schema[pathPart] = {};\n    schema = schema[pathPart];\n  }\n\n  // Update the value in the schema (corresponding object part)\n  // and thus automatically update the to change part in the 'newObject' by reference\n  schema[pathParts[pathPartsLength - 1]] = value;\n\n  return updatedObject;\n}\n","import { Agile, Observer, StateIngestConfigInterface } from '@agile-ts/core';\nimport { defineConfig } from '@agile-ts/utils';\nimport { Validator } from '../validator';\nimport { Item, ItemKey } from '../item';\nimport { StatusInterface, StatusType } from '../status';\nimport {\n  DeepFieldPaths,\n  DeepFieldPathValues,\n  CreateEditorConfig,\n  EditorConfigInterface,\n  EditorKey,\n  EditorValidationSchemaType,\n  FieldData,\n  FieldPaths,\n  RecomputeValidatedStateMethodConfigInterface,\n  SubmitConfigInterface,\n  UpdateInitialValueConfigInterface,\n} from './types';\nimport { updateNestedProperty } from '../utils';\n\nexport class Multieditor<TFieldData extends FieldData = FieldData> {\n  // Agile Instance the Multieditor belongs to\n  public agileInstance: () => Agile;\n\n  public config: EditorConfigInterface;\n\n  // Key/Name identifier of the Multieditor\n  public _key?: EditorKey;\n\n  public isModified = false;\n  public isValid = false;\n  public submitted = false;\n\n  // Item keys of Items to be added to the submit data all the time\n  public fixedProperties: ItemKey[] = [];\n  // Item keys of Items that can be edited\n  public editableProperties: ItemKey[] = [];\n\n  public onSubmit: (\n    preparedData: { [key: string]: any },\n    config?: Object\n  ) => Promise<any>;\n\n  // Items the Multieditor works with\n  public data: { [key: string]: Item } = {};\n\n  /**\n   * Simple Form Handler.\n   *\n   * @public\n   * @param agileInstance - Instance of Agile the Multieditor belongs to.\n   * @param config - Configuration object\n   */\n  constructor(config: CreateEditorConfig<TFieldData>, agileInstance: Agile) {\n    this.agileInstance = () => agileInstance;\n    let _config = typeof config === 'function' ? config(this) : config;\n    _config = defineConfig(_config, {\n      key: undefined,\n      fixedProperties: [],\n      editableProperties: Object.keys(_config.initialData),\n      validationSchema: {},\n      computeMethods: {},\n      reValidateMode: 'onSubmit',\n      toValidate: 'editable',\n    });\n    this._key = _config.key;\n    this.onSubmit = _config.onSubmit as any;\n    this.fixedProperties = _config.fixedProperties as any;\n    this.editableProperties = _config.editableProperties as any;\n    this.config = {\n      reValidateMode: _config.reValidateMode as any,\n      toValidate: _config.toValidate as any,\n    };\n\n    // Format specified validation instances to valid Validators\n    const formattedValidators: {\n      [key: string]: Validator;\n    } = {};\n    Object.keys(_config.validationSchema as EditorValidationSchemaType).forEach(\n      (key) => {\n        const validationMethod = (\n          _config.validationSchema as EditorValidationSchemaType\n        )[key];\n\n        // If validation schema item is a Validator\n        if (validationMethod instanceof Validator) {\n          if (validationMethod.key == null) validationMethod.key = key;\n          formattedValidators[key] = validationMethod;\n        }\n\n        // If validation schema item is a method\n        else {\n          formattedValidators[key] = new Validator({\n            key,\n          }).addValidationMethod(validationMethod);\n        }\n      }\n    );\n\n    // Instantiate Multieditor Items based on the 'initialData'\n    for (const key in _config.initialData) {\n      const data = _config.initialData[key];\n      const item = new Item<typeof data>(this as any, data, {\n        key,\n        canBeEdited: this.editableProperties.includes(key),\n        validator: formattedValidators[key],\n      });\n      if (Object.prototype.hasOwnProperty.call(_config.computeMethods, key))\n        item.computeValue((_config.computeMethods as any)[key]);\n      this.data[key] = item;\n      item.validate(); // Initial validate\n    }\n  }\n\n  /**\n   * Updates the key/name identifier of the Multieditor.\n   *\n   * @public\n   * @param value - New key/name identifier.\n   */\n  public set key(value: EditorKey | undefined) {\n    this._key = value;\n  }\n\n  /**\n   * Returns the key/name identifier of the Multieditor.\n   *\n   * @public\n   */\n  public get key(): EditorKey | undefined {\n    return this._key;\n  }\n\n  /**\n   * Returns an array of dependencies the Multieditor depends on.\n   *\n   * These returned dependencies can be bound to a UI-Component\n   * the Mutlieditor is used in, to make the Form reactive.\n   *\n   * @public\n   */\n  public get deps(): Array<Observer> {\n    const deps: Array<Observer> = [];\n    for (const key in this.data) {\n      const item = this.data[key];\n      deps.push(item.observers['value']);\n      deps.push(item.status.observers['value']);\n    }\n    return deps;\n  }\n\n  /**\n   * Returns an array of dependencies the Item\n   * with the specified key/name identifier depends on.\n   *\n   * @public\n   * @param itemKey - Key/Name identifier of the Item.\n   */\n  public itemDeps(itemKey: FieldPaths<TFieldData>): Array<Observer> {\n    const deps: Array<Observer> = [];\n    const item = this.getItem(itemKey);\n    if (item) {\n      deps.push(item.observers['value']);\n      deps.push(item.status.observers['value']);\n    }\n    return deps;\n  }\n\n  /**\n   * Assigns a new value to the Item with the specified key/name identifier.\n   *\n   * @public\n   * @param itemKey - Key/Name identifier of the Item.\n   * @param value - New Item value\n   * @param config - Configuration object\n   */\n  public setValue<\n    TItemName extends DeepFieldPaths<TFieldData> = DeepFieldPaths<TFieldData>\n  >(\n    itemKey: TItemName,\n    value: DeepFieldPathValues<TFieldData, TItemName>,\n    config: StateIngestConfigInterface = {}\n  ): this {\n    config = defineConfig(config, {\n      background: true, // Because by default the Form should only be re-rendered when the Status updates\n    });\n    const path = itemKey.toString().split('.');\n\n    // Fetch Item\n    const item = this.getItem(path.shift() as any);\n    if (item == null) return this;\n\n    // Update current value\n    if (path.length > 0) {\n      item.set(\n        updateNestedProperty(item.nextStateValue, path, value) as any,\n        config\n      );\n    } else {\n      item.set(value, config);\n    }\n\n    return this;\n  }\n\n  /**\n   * Assigns a new initial value to the Item with the specified key/name identifier.\n   *\n   * @public\n   * @param itemKey - Key/Name identifier of the Item.\n   * @param value - New Item initial value\n   * @param config - Configuration object\n   */\n  public setInitialValue<\n    TItemName extends DeepFieldPaths<TFieldData> = DeepFieldPaths<TFieldData>\n  >(\n    itemKey: TItemName,\n    value: DeepFieldPathValues<TFieldData, TItemName>,\n    config: UpdateInitialValueConfigInterface = {}\n  ): this {\n    config = defineConfig(config, {\n      background: true, // Because by default the Form should only be re-rendered when the Status updates\n      reset: true,\n    });\n    const path = itemKey.toString().split('.');\n\n    // Fetch Item\n    const item = this.getItem(path.shift() as any);\n    if (item == null) return this;\n\n    // Update initial value\n    if (path.length > 0) {\n      item.initialStateValue = updateNestedProperty(\n        item.initialStateValue,\n        path,\n        value\n      ) as any;\n    } else {\n      item.initialStateValue = value;\n    }\n\n    // Reset Item (-> assign initial value to the current value)\n    if (config.reset) {\n      item.reset(config);\n    }\n\n    return this;\n  }\n\n  /**\n   * Submits the Multieditor.\n   *\n   * @public\n   * @param config - Configuration object\n   */\n  public async submit(\n    config: SubmitConfigInterface = {}\n  ): Promise<any | false> {\n    config = defineConfig(config, {\n      assignToInitial: true,\n      onSubmitConfig: undefined,\n    });\n\n    // Assign Statuses to Items\n    for (const key in this.data) {\n      const item = this.data[key];\n      if (this.canAssignStatusToItemOnSubmit(item)) {\n        item.status.config.display = true;\n        item.status.ingest({\n          force: true, // Force because the value hasn't changed\n        });\n      }\n    }\n\n    this.submitted = true;\n\n    // Check whether the Multieditor is valid and thus can be submitted\n    if (!this.isValid) return false;\n\n    // Data to be passed to the 'onSubmit()' method\n    const preparedData = {};\n\n    // Add Items whose value has been updated to the prepared data\n    for (const key in this.data) {\n      const item = this.data[key];\n      if (item.isSet && item.config.canBeEdited) {\n        preparedData[key] = item.value;\n\n        // Assign 'submitted' Item value as initial Item value\n        if (config.assignToInitial) this.setInitialValue(key, item.value);\n      }\n    }\n\n    // Add fixed properties (Items) to the prepared data\n    for (const key of this.fixedProperties) {\n      const item = this.getItem(key);\n      if (!item) continue;\n      preparedData[key] = item.value;\n    }\n\n    return await this.onSubmit(preparedData, config.onSubmitConfig);\n  }\n\n  /**\n   * Resets the Multieditor and all its Items.\n   *\n   * @public\n   */\n  public reset(): this {\n    // Reset Items\n    for (const key in this.data) this.data[key].reset();\n\n    // Reset Editor\n    this.isModified = false;\n    this.submitted = false;\n    // this.recomputeValidatedState(); // already recomputed during the reset of the Items\n\n    return this;\n  }\n\n  /**\n   * Assigns the specified new Status to the Item with the specified key/name identifier.\n   *\n   * However, if tracking of the particular Status is active,\n   * the value is only tracked (not applied).\n   * If the tracking has been finished the last tracked Status value should be applied to the Status.\n   *\n   * @public\n   * @param itemKey - Key/Name identifier of the Item.\n   * @param type - Status type\n   * @param message - Status message\n   */\n  public setStatus(\n    itemKey: FieldPaths<TFieldData>,\n    type: StatusType,\n    message: string\n  ): this {\n    const item = this.getItem(itemKey);\n    if (item == null) return this;\n    item.status.set(\n      {\n        type,\n        message,\n      },\n      { waitForTracking: true }\n    );\n    return this;\n  }\n\n  /**\n   * Resets the Status of the Item with the specified key/name identifier.\n   *\n   * @public\n   * @param itemKey - Key/Name identifier of the Item.\n   */\n  public resetStatus(itemKey: FieldPaths<TFieldData>): this {\n    const item = this.getItem(itemKey);\n    if (item == null || item.status == null) return this;\n    item.status.set(null);\n    return this;\n  }\n\n  /**\n   * Retrieves the Status of the Item with the specified key/name identifier.\n   *\n   * If the to retrieve Status doesn't exist, `null` is returned.\n   *\n   * @public\n   * @param itemKey - Key/Name identifier of the Item.\n   */\n  public getStatus(itemKey: FieldPaths<TFieldData>): StatusInterface | null {\n    return this.getItem(itemKey)?.status.value || null;\n  }\n\n  /**\n   * Retrieves a single Item with the specified key/name identifier from the Multieditor.\n   *\n   * If the to retrieve Item doesn't exist, `null` is returned.\n   *\n   * @public\n   * @param itemKey - Key/Name identifier of the Item.\n   */\n  public getItem<\n    TItemName extends FieldPaths<TFieldData> = FieldPaths<TFieldData>\n  >(\n    itemKey: TItemName\n  ): Item<DeepFieldPathValues<TFieldData, TItemName>> | null {\n    return this.data[itemKey as string];\n  }\n\n  /**\n   * Retrieves the initial value of a single Item\n   * with the specified key/name identifier from the Multieditor.\n   *\n   * If the to retrieve Item containing the initial value doesn't exist, `undefined` is returned.\n   *\n   * @public\n   * @param itemKey - Key/Name identifier of the Item.\n   */\n  public getItemValue<\n    TItemName extends FieldPaths<TFieldData> = FieldPaths<TFieldData>\n  >(\n    itemKey: TItemName\n  ): DeepFieldPathValues<TFieldData, TItemName> | undefined {\n    return this.getItem(itemKey)?.value;\n  }\n\n  /**\n   * Retrieves the value of a single Item\n   * with the specified key/name identifier from the Multieditor.\n   *\n   * If the to retrieve Item containing the initial value doesn't exist, `undefined` is returned.\n   *\n   * @public\n   * @param itemKey - Key/Name identifier of the Item.\n   */\n  public getItemInitialValue<\n    TItemName extends FieldPaths<TFieldData> = FieldPaths<TFieldData>\n  >(\n    itemKey: TItemName\n  ): DeepFieldPathValues<TFieldData, TItemName> | undefined {\n    return this.getItem(itemKey)?.initialStateValue;\n  }\n\n  /**\n   * Returns a boolean indicating whether at least one Item\n   * of the Items with the specified key/name identifiers is modified.\n   *\n   * @public\n   * @param itemKeys - Key/Name identifiers of the Items.\n   */\n  public areModified(itemKeys: ItemKey[]): boolean {\n    let _isModified = false;\n    for (const key of itemKeys) {\n      const item = this.getItem(key);\n      if (item == null) continue;\n      _isModified = _isModified || item.isSet;\n    }\n    return _isModified;\n  }\n\n  /**\n   * Recomputes the modified state of the Multieditor\n   * based on its Items modified status.\n   *\n   * @public\n   */\n  public recomputeModifiedState(): this {\n    this.isModified = this.areModified(this.editableProperties);\n    return this;\n  }\n\n  /**\n   * Recomputes the validated state of the Multieditor\n   * based on its Items validation status.\n   *\n   * @public\n   */\n  public recomputeValidatedState(\n    config: RecomputeValidatedStateMethodConfigInterface = {}\n  ): boolean {\n    config = defineConfig(config, {\n      validate: true,\n    });\n    let isValid = true;\n\n    // Check whether all Items are valid\n    for (const key in this.data) {\n      const item = this.data[key];\n      if (config.validate) item.validate();\n      if (!item.config.canBeEdited && this.config.toValidate === 'editable')\n        continue;\n      isValid = item.isValid && isValid;\n    }\n\n    this.isValid = isValid;\n    return isValid;\n  }\n\n  /**\n   * Revalidates the Multieditor.\n   *\n   * @public\n   */\n  public validate(): boolean {\n    return this.recomputeValidatedState({ validate: true });\n  }\n\n  /**\n   * Returns a boolean indication whether the Status of the specified Item\n   * can be updated during a value change of the Item.\n   *\n   * @internal\n   * @param item - Item\n   */\n  public canAssignStatusToItemOnChange(item: Item): boolean {\n    return (\n      (this.config.reValidateMode === 'onChange' ||\n        (this.config.reValidateMode === 'afterFirstSubmit' &&\n          this.submitted)) &&\n      (this.config.toValidate === 'all' ||\n        (this.config.toValidate === 'editable' && item.config.canBeEdited) ||\n        false)\n    );\n  }\n\n  /**\n   * Returns a boolean indication whether the Status of the specified Item\n   * can be updated during the submission of the Multieditor.\n   *\n   * @internal\n   * @param item - Item\n   */\n  public canAssignStatusToItemOnSubmit(item: Item): boolean {\n    return (\n      (this.config.reValidateMode === 'onSubmit' ||\n        (this.config.reValidateMode === 'afterFirstSubmit' &&\n          !this.submitted) ||\n        (this.config.reValidateMode === 'onChange' &&\n          !item.status.config.display)) &&\n      (this.config.toValidate === 'all' ||\n        (this.config.toValidate === 'editable' && item.config.canBeEdited) ||\n        false)\n    );\n  }\n\n  /**\n   * Returns a boolean indication whether the Status of the specified Item\n   * can be updated during the blur of the Item.\n   *\n   * @internal\n   * @param item - Item\n   */\n  public canAssignStatusToItemOnBlur(item: Item): boolean {\n    return (\n      this.config.reValidateMode === 'onBlur' &&\n      (this.config.toValidate === 'all' ||\n        (this.config.toValidate === 'editable' && item.config.canBeEdited) ||\n        false)\n    );\n  }\n}\n","import { Agile, shared } from '@agile-ts/core';\nimport { Multieditor } from './multieditor';\nimport { CreateEditorConfig, FieldData } from './types';\n\nexport * from './multieditor';\nexport * from './types';\n\n/**\n * Returns a newly created Multieditor.\n *\n * A Multieditor is a simple Form Handler.\n *\n * @public\n * @param config - Configuration object\n * @param agileInstance - Instance of Agile the Multieditor belongs to.\n */\nexport function createMultieditor<TFieldData extends FieldData = FieldData>(\n  config: CreateEditorConfig<TFieldData>,\n  agileInstance: Agile = shared\n): Multieditor<TFieldData> {\n  return new Multieditor<TFieldData>(config, agileInstance);\n}\n","import { Multieditor } from './multieditor';\n\nexport * from './multieditor';\nexport * from './item';\nexport * from './validator';\nexport * from './status';\n\nexport default Multieditor;\n"]}