@powerhousedao/powerhouse-vetra-packages 6.0.0-dev.201 → 6.0.0-dev.203

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/browser/{actions-CAkdvsc4-gp29pPoz.d.ts → actions-CAH-hbfc-C8hUzx83.d.ts} +2 -2
  2. package/dist/browser/{actions-CAkdvsc4-gp29pPoz.d.ts.map → actions-CAH-hbfc-C8hUzx83.d.ts.map} +1 -1
  3. package/dist/browser/{connect-C_dcbzBz-_mmjRXjN.js → connect-C_dcbzBz--b70rB_n.js} +2 -2
  4. package/dist/browser/{connect-C_dcbzBz-_mmjRXjN.js.map → connect-C_dcbzBz--b70rB_n.js.map} +1 -1
  5. package/dist/browser/{document-drive--1eiReEv.js → document-drive-Xr-Oq4PL.js} +9 -1
  6. package/dist/browser/document-drive-Xr-Oq4PL.js.map +1 -0
  7. package/dist/browser/document-models/index.d.ts +2 -2
  8. package/dist/browser/document-models/index.d.ts.map +1 -1
  9. package/dist/browser/document-models/index.js +1 -1
  10. package/dist/browser/{editor-WMMn3zMX.js → editor-BcLRCzZi.js} +3 -3
  11. package/dist/browser/{editor-WMMn3zMX.js.map → editor-BcLRCzZi.js.map} +1 -1
  12. package/dist/browser/{editor-C6CqSfNd.js → editor-CHuFlXYk.js} +4 -4
  13. package/dist/browser/{editor-C6CqSfNd.js.map → editor-CHuFlXYk.js.map} +1 -1
  14. package/dist/browser/editors/document-model-editor/module.d.ts +1 -1
  15. package/dist/browser/editors/document-model-editor/module.js +1 -1
  16. package/dist/browser/editors/generic-drive-explorer/index.js +3 -3
  17. package/dist/browser/editors/generic-drive-explorer/module.d.ts +1 -1
  18. package/dist/browser/editors/generic-drive-explorer/module.js +1 -1
  19. package/dist/browser/{folder-view-D3QhCT-8.js → folder-view-B6aAiO2N.js} +2 -2
  20. package/dist/browser/{folder-view-D3QhCT-8.js.map → folder-view-B6aAiO2N.js.map} +1 -1
  21. package/dist/browser/index.d.ts +1 -1
  22. package/dist/browser/index.js +1 -1
  23. package/dist/node/{actions-CAkdvsc4-qMKmHrr0.d.mts → actions-CAH-hbfc-4Ddl_k7B.d.mts} +2 -2
  24. package/dist/node/{actions-CAkdvsc4-qMKmHrr0.d.mts.map → actions-CAH-hbfc-4Ddl_k7B.d.mts.map} +1 -1
  25. package/dist/node/{connect-C_dcbzBz-DUb3vyN_.mjs → connect-C_dcbzBz-BW2LdijR.mjs} +2 -2
  26. package/dist/node/{connect-C_dcbzBz-DUb3vyN_.mjs.map → connect-C_dcbzBz-BW2LdijR.mjs.map} +1 -1
  27. package/dist/node/{document-drive-CuVMw83g.mjs → document-drive-Ci5WxrAj.mjs} +9 -1
  28. package/dist/node/document-drive-Ci5WxrAj.mjs.map +1 -0
  29. package/dist/node/document-models/index.d.mts +2 -2
  30. package/dist/node/document-models/index.d.mts.map +1 -1
  31. package/dist/node/document-models/index.mjs +1 -1
  32. package/dist/node/{editor-DuK8Xe_9.mjs → editor-4Mu6nyRX.mjs} +3 -3
  33. package/dist/node/{editor-DuK8Xe_9.mjs.map → editor-4Mu6nyRX.mjs.map} +1 -1
  34. package/dist/node/{editor-CYjUuoto.mjs → editor-D0uoQ59U.mjs} +4 -4
  35. package/dist/node/{editor-CYjUuoto.mjs.map → editor-D0uoQ59U.mjs.map} +1 -1
  36. package/dist/node/editors/document-model-editor/module.d.mts +1 -1
  37. package/dist/node/editors/document-model-editor/module.mjs +1 -1
  38. package/dist/node/editors/generic-drive-explorer/index.mjs +3 -3
  39. package/dist/node/editors/generic-drive-explorer/module.d.mts +1 -1
  40. package/dist/node/editors/generic-drive-explorer/module.mjs +1 -1
  41. package/dist/node/{folder-view-CfEXe79b.mjs → folder-view-D_ar-eLP.mjs} +2 -2
  42. package/dist/node/{folder-view-CfEXe79b.mjs.map → folder-view-D_ar-eLP.mjs.map} +1 -1
  43. package/dist/node/index.d.mts +1 -1
  44. package/dist/node/index.mjs +1 -1
  45. package/package.json +5 -5
  46. package/dist/browser/document-drive--1eiReEv.js.map +0 -1
  47. package/dist/node/document-drive-CuVMw83g.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-drive-Xr-Oq4PL.js","names":["cjsModule","isDefinedNonNullAny","definedNonNullAnySchema","z.any","z.enum","z.string","z.union","z.object","z.lazy","z.number","z.unknown","z.literal","z.array","z.boolean","isStateOfType","assertIsStateOfType","isDocumentOfType","assertIsDocumentOfType","#tags","#tagString","#level","z.any","z.enum","z.object","z.string","z.literal","z.boolean","z.array","z.union","createState$1"],"sources":["../../../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js","../../../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/esm/wrapper.js","../../../../node_modules/.pnpm/sha1-uint8array@0.10.7/node_modules/sha1-uint8array/dist/sha1-uint8array.mjs","../../../shared/dist/utils-bCWnsmtD.js","../../../../node_modules/.pnpm/mutative@1.3.0/node_modules/mutative/dist/mutative.esm.mjs","../../../shared/dist/document-model/index.js","../../../document-model/dist/index.js","../../../shared/dist/document-drive/index.js"],"sourcesContent":["'use strict'\n\nconst { hasOwnProperty } = Object.prototype\n\nconst stringify = configure()\n\n// @ts-expect-error\nstringify.configure = configure\n// @ts-expect-error\nstringify.stringify = stringify\n\n// @ts-expect-error\nstringify.default = stringify\n\n// @ts-expect-error used for named export\nexports.stringify = stringify\n// @ts-expect-error used for named export\nexports.configure = configure\n\nmodule.exports = stringify\n\n// eslint-disable-next-line no-control-regex\nconst strEscapeSequencesRegExp = /[\\u0000-\\u001f\\u0022\\u005c\\ud800-\\udfff]/\n\n// Escape C0 control characters, double quotes, the backslash and every code\n// unit with a numeric value in the inclusive range 0xD800 to 0xDFFF.\nfunction strEscape (str) {\n // Some magic numbers that worked out fine while benchmarking with v8 8.0\n if (str.length < 5000 && !strEscapeSequencesRegExp.test(str)) {\n return `\"${str}\"`\n }\n return JSON.stringify(str)\n}\n\nfunction sort (array, comparator) {\n // Insertion sort is very efficient for small input sizes, but it has a bad\n // worst case complexity. Thus, use native array sort for bigger values.\n if (array.length > 2e2 || comparator) {\n return array.sort(comparator)\n }\n for (let i = 1; i < array.length; i++) {\n const currentValue = array[i]\n let position = i\n while (position !== 0 && array[position - 1] > currentValue) {\n array[position] = array[position - 1]\n position--\n }\n array[position] = currentValue\n }\n return array\n}\n\nconst typedArrayPrototypeGetSymbolToStringTag =\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(\n Object.getPrototypeOf(\n new Int8Array()\n )\n ),\n Symbol.toStringTag\n ).get\n\nfunction isTypedArrayWithEntries (value) {\n return typedArrayPrototypeGetSymbolToStringTag.call(value) !== undefined && value.length !== 0\n}\n\nfunction stringifyTypedArray (array, separator, maximumBreadth) {\n if (array.length < maximumBreadth) {\n maximumBreadth = array.length\n }\n const whitespace = separator === ',' ? '' : ' '\n let res = `\"0\":${whitespace}${array[0]}`\n for (let i = 1; i < maximumBreadth; i++) {\n res += `${separator}\"${i}\":${whitespace}${array[i]}`\n }\n return res\n}\n\nfunction getCircularValueOption (options) {\n if (hasOwnProperty.call(options, 'circularValue')) {\n const circularValue = options.circularValue\n if (typeof circularValue === 'string') {\n return `\"${circularValue}\"`\n }\n if (circularValue == null) {\n return circularValue\n }\n if (circularValue === Error || circularValue === TypeError) {\n return {\n toString () {\n throw new TypeError('Converting circular structure to JSON')\n }\n }\n }\n throw new TypeError('The \"circularValue\" argument must be of type string or the value null or undefined')\n }\n return '\"[Circular]\"'\n}\n\nfunction getDeterministicOption (options) {\n let value\n if (hasOwnProperty.call(options, 'deterministic')) {\n value = options.deterministic\n if (typeof value !== 'boolean' && typeof value !== 'function') {\n throw new TypeError('The \"deterministic\" argument must be of type boolean or comparator function')\n }\n }\n return value === undefined ? true : value\n}\n\nfunction getBooleanOption (options, key) {\n let value\n if (hasOwnProperty.call(options, key)) {\n value = options[key]\n if (typeof value !== 'boolean') {\n throw new TypeError(`The \"${key}\" argument must be of type boolean`)\n }\n }\n return value === undefined ? true : value\n}\n\nfunction getPositiveIntegerOption (options, key) {\n let value\n if (hasOwnProperty.call(options, key)) {\n value = options[key]\n if (typeof value !== 'number') {\n throw new TypeError(`The \"${key}\" argument must be of type number`)\n }\n if (!Number.isInteger(value)) {\n throw new TypeError(`The \"${key}\" argument must be an integer`)\n }\n if (value < 1) {\n throw new RangeError(`The \"${key}\" argument must be >= 1`)\n }\n }\n return value === undefined ? Infinity : value\n}\n\nfunction getItemCount (number) {\n if (number === 1) {\n return '1 item'\n }\n return `${number} items`\n}\n\nfunction getUniqueReplacerSet (replacerArray) {\n const replacerSet = new Set()\n for (const value of replacerArray) {\n if (typeof value === 'string' || typeof value === 'number') {\n replacerSet.add(String(value))\n }\n }\n return replacerSet\n}\n\nfunction getStrictOption (options) {\n if (hasOwnProperty.call(options, 'strict')) {\n const value = options.strict\n if (typeof value !== 'boolean') {\n throw new TypeError('The \"strict\" argument must be of type boolean')\n }\n if (value) {\n return (value) => {\n let message = `Object can not safely be stringified. Received type ${typeof value}`\n if (typeof value !== 'function') message += ` (${value.toString()})`\n throw new Error(message)\n }\n }\n }\n}\n\nfunction configure (options) {\n options = { ...options }\n const fail = getStrictOption(options)\n if (fail) {\n if (options.bigint === undefined) {\n options.bigint = false\n }\n if (!('circularValue' in options)) {\n options.circularValue = Error\n }\n }\n const circularValue = getCircularValueOption(options)\n const bigint = getBooleanOption(options, 'bigint')\n const deterministic = getDeterministicOption(options)\n const comparator = typeof deterministic === 'function' ? deterministic : undefined\n const maximumDepth = getPositiveIntegerOption(options, 'maximumDepth')\n const maximumBreadth = getPositiveIntegerOption(options, 'maximumBreadth')\n\n function stringifyFnReplacer (key, parent, stack, replacer, spacer, indentation) {\n let value = parent[key]\n\n if (typeof value === 'object' && value !== null && typeof value.toJSON === 'function') {\n value = value.toJSON(key)\n }\n value = replacer.call(parent, key, value)\n\n switch (typeof value) {\n case 'string':\n return strEscape(value)\n case 'object': {\n if (value === null) {\n return 'null'\n }\n if (stack.indexOf(value) !== -1) {\n return circularValue\n }\n\n let res = ''\n let join = ','\n const originalIndentation = indentation\n\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return '[]'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Array]\"'\n }\n stack.push(value)\n if (spacer !== '') {\n indentation += spacer\n res += `\\n${indentation}`\n join = `,\\n${indentation}`\n }\n const maximumValuesToStringify = Math.min(value.length, maximumBreadth)\n let i = 0\n for (; i < maximumValuesToStringify - 1; i++) {\n const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n res += join\n }\n const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n if (value.length - 1 > maximumBreadth) {\n const removedKeys = value.length - maximumBreadth - 1\n res += `${join}\"... ${getItemCount(removedKeys)} not stringified\"`\n }\n if (spacer !== '') {\n res += `\\n${originalIndentation}`\n }\n stack.pop()\n return `[${res}]`\n }\n\n let keys = Object.keys(value)\n const keyLength = keys.length\n if (keyLength === 0) {\n return '{}'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Object]\"'\n }\n let whitespace = ''\n let separator = ''\n if (spacer !== '') {\n indentation += spacer\n join = `,\\n${indentation}`\n whitespace = ' '\n }\n const maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth)\n if (deterministic && !isTypedArrayWithEntries(value)) {\n keys = sort(keys, comparator)\n }\n stack.push(value)\n for (let i = 0; i < maximumPropertiesToStringify; i++) {\n const key = keys[i]\n const tmp = stringifyFnReplacer(key, value, stack, replacer, spacer, indentation)\n if (tmp !== undefined) {\n res += `${separator}${strEscape(key)}:${whitespace}${tmp}`\n separator = join\n }\n }\n if (keyLength > maximumBreadth) {\n const removedKeys = keyLength - maximumBreadth\n res += `${separator}\"...\":${whitespace}\"${getItemCount(removedKeys)} not stringified\"`\n separator = join\n }\n if (spacer !== '' && separator.length > 1) {\n res = `\\n${indentation}${res}\\n${originalIndentation}`\n }\n stack.pop()\n return `{${res}}`\n }\n case 'number':\n return isFinite(value) ? String(value) : fail ? fail(value) : 'null'\n case 'boolean':\n return value === true ? 'true' : 'false'\n case 'undefined':\n return undefined\n case 'bigint':\n if (bigint) {\n return String(value)\n }\n // fallthrough\n default:\n return fail ? fail(value) : undefined\n }\n }\n\n function stringifyArrayReplacer (key, value, stack, replacer, spacer, indentation) {\n if (typeof value === 'object' && value !== null && typeof value.toJSON === 'function') {\n value = value.toJSON(key)\n }\n\n switch (typeof value) {\n case 'string':\n return strEscape(value)\n case 'object': {\n if (value === null) {\n return 'null'\n }\n if (stack.indexOf(value) !== -1) {\n return circularValue\n }\n\n const originalIndentation = indentation\n let res = ''\n let join = ','\n\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return '[]'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Array]\"'\n }\n stack.push(value)\n if (spacer !== '') {\n indentation += spacer\n res += `\\n${indentation}`\n join = `,\\n${indentation}`\n }\n const maximumValuesToStringify = Math.min(value.length, maximumBreadth)\n let i = 0\n for (; i < maximumValuesToStringify - 1; i++) {\n const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n res += join\n }\n const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n if (value.length - 1 > maximumBreadth) {\n const removedKeys = value.length - maximumBreadth - 1\n res += `${join}\"... ${getItemCount(removedKeys)} not stringified\"`\n }\n if (spacer !== '') {\n res += `\\n${originalIndentation}`\n }\n stack.pop()\n return `[${res}]`\n }\n stack.push(value)\n let whitespace = ''\n if (spacer !== '') {\n indentation += spacer\n join = `,\\n${indentation}`\n whitespace = ' '\n }\n let separator = ''\n for (const key of replacer) {\n const tmp = stringifyArrayReplacer(key, value[key], stack, replacer, spacer, indentation)\n if (tmp !== undefined) {\n res += `${separator}${strEscape(key)}:${whitespace}${tmp}`\n separator = join\n }\n }\n if (spacer !== '' && separator.length > 1) {\n res = `\\n${indentation}${res}\\n${originalIndentation}`\n }\n stack.pop()\n return `{${res}}`\n }\n case 'number':\n return isFinite(value) ? String(value) : fail ? fail(value) : 'null'\n case 'boolean':\n return value === true ? 'true' : 'false'\n case 'undefined':\n return undefined\n case 'bigint':\n if (bigint) {\n return String(value)\n }\n // fallthrough\n default:\n return fail ? fail(value) : undefined\n }\n }\n\n function stringifyIndent (key, value, stack, spacer, indentation) {\n switch (typeof value) {\n case 'string':\n return strEscape(value)\n case 'object': {\n if (value === null) {\n return 'null'\n }\n if (typeof value.toJSON === 'function') {\n value = value.toJSON(key)\n // Prevent calling `toJSON` again.\n if (typeof value !== 'object') {\n return stringifyIndent(key, value, stack, spacer, indentation)\n }\n if (value === null) {\n return 'null'\n }\n }\n if (stack.indexOf(value) !== -1) {\n return circularValue\n }\n const originalIndentation = indentation\n\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return '[]'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Array]\"'\n }\n stack.push(value)\n indentation += spacer\n let res = `\\n${indentation}`\n const join = `,\\n${indentation}`\n const maximumValuesToStringify = Math.min(value.length, maximumBreadth)\n let i = 0\n for (; i < maximumValuesToStringify - 1; i++) {\n const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n res += join\n }\n const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n if (value.length - 1 > maximumBreadth) {\n const removedKeys = value.length - maximumBreadth - 1\n res += `${join}\"... ${getItemCount(removedKeys)} not stringified\"`\n }\n res += `\\n${originalIndentation}`\n stack.pop()\n return `[${res}]`\n }\n\n let keys = Object.keys(value)\n const keyLength = keys.length\n if (keyLength === 0) {\n return '{}'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Object]\"'\n }\n indentation += spacer\n const join = `,\\n${indentation}`\n let res = ''\n let separator = ''\n let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth)\n if (isTypedArrayWithEntries(value)) {\n res += stringifyTypedArray(value, join, maximumBreadth)\n keys = keys.slice(value.length)\n maximumPropertiesToStringify -= value.length\n separator = join\n }\n if (deterministic) {\n keys = sort(keys, comparator)\n }\n stack.push(value)\n for (let i = 0; i < maximumPropertiesToStringify; i++) {\n const key = keys[i]\n const tmp = stringifyIndent(key, value[key], stack, spacer, indentation)\n if (tmp !== undefined) {\n res += `${separator}${strEscape(key)}: ${tmp}`\n separator = join\n }\n }\n if (keyLength > maximumBreadth) {\n const removedKeys = keyLength - maximumBreadth\n res += `${separator}\"...\": \"${getItemCount(removedKeys)} not stringified\"`\n separator = join\n }\n if (separator !== '') {\n res = `\\n${indentation}${res}\\n${originalIndentation}`\n }\n stack.pop()\n return `{${res}}`\n }\n case 'number':\n return isFinite(value) ? String(value) : fail ? fail(value) : 'null'\n case 'boolean':\n return value === true ? 'true' : 'false'\n case 'undefined':\n return undefined\n case 'bigint':\n if (bigint) {\n return String(value)\n }\n // fallthrough\n default:\n return fail ? fail(value) : undefined\n }\n }\n\n function stringifySimple (key, value, stack) {\n switch (typeof value) {\n case 'string':\n return strEscape(value)\n case 'object': {\n if (value === null) {\n return 'null'\n }\n if (typeof value.toJSON === 'function') {\n value = value.toJSON(key)\n // Prevent calling `toJSON` again\n if (typeof value !== 'object') {\n return stringifySimple(key, value, stack)\n }\n if (value === null) {\n return 'null'\n }\n }\n if (stack.indexOf(value) !== -1) {\n return circularValue\n }\n\n let res = ''\n\n const hasLength = value.length !== undefined\n if (hasLength && Array.isArray(value)) {\n if (value.length === 0) {\n return '[]'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Array]\"'\n }\n stack.push(value)\n const maximumValuesToStringify = Math.min(value.length, maximumBreadth)\n let i = 0\n for (; i < maximumValuesToStringify - 1; i++) {\n const tmp = stringifySimple(String(i), value[i], stack)\n res += tmp !== undefined ? tmp : 'null'\n res += ','\n }\n const tmp = stringifySimple(String(i), value[i], stack)\n res += tmp !== undefined ? tmp : 'null'\n if (value.length - 1 > maximumBreadth) {\n const removedKeys = value.length - maximumBreadth - 1\n res += `,\"... ${getItemCount(removedKeys)} not stringified\"`\n }\n stack.pop()\n return `[${res}]`\n }\n\n let keys = Object.keys(value)\n const keyLength = keys.length\n if (keyLength === 0) {\n return '{}'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Object]\"'\n }\n let separator = ''\n let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth)\n if (hasLength && isTypedArrayWithEntries(value)) {\n res += stringifyTypedArray(value, ',', maximumBreadth)\n keys = keys.slice(value.length)\n maximumPropertiesToStringify -= value.length\n separator = ','\n }\n if (deterministic) {\n keys = sort(keys, comparator)\n }\n stack.push(value)\n for (let i = 0; i < maximumPropertiesToStringify; i++) {\n const key = keys[i]\n const tmp = stringifySimple(key, value[key], stack)\n if (tmp !== undefined) {\n res += `${separator}${strEscape(key)}:${tmp}`\n separator = ','\n }\n }\n if (keyLength > maximumBreadth) {\n const removedKeys = keyLength - maximumBreadth\n res += `${separator}\"...\":\"${getItemCount(removedKeys)} not stringified\"`\n }\n stack.pop()\n return `{${res}}`\n }\n case 'number':\n return isFinite(value) ? String(value) : fail ? fail(value) : 'null'\n case 'boolean':\n return value === true ? 'true' : 'false'\n case 'undefined':\n return undefined\n case 'bigint':\n if (bigint) {\n return String(value)\n }\n // fallthrough\n default:\n return fail ? fail(value) : undefined\n }\n }\n\n function stringify (value, replacer, space) {\n if (arguments.length > 1) {\n let spacer = ''\n if (typeof space === 'number') {\n spacer = ' '.repeat(Math.min(space, 10))\n } else if (typeof space === 'string') {\n spacer = space.slice(0, 10)\n }\n if (replacer != null) {\n if (typeof replacer === 'function') {\n return stringifyFnReplacer('', { '': value }, [], replacer, spacer, '')\n }\n if (Array.isArray(replacer)) {\n return stringifyArrayReplacer('', value, [], getUniqueReplacerSet(replacer), spacer, '')\n }\n }\n if (spacer.length !== 0) {\n return stringifyIndent('', value, [], spacer, '')\n }\n }\n return stringifySimple('', value, [])\n }\n\n return stringify\n}\n","import cjsModule from '../index.js'\n\nexport const configure = cjsModule.configure\n\nexport const stringify = cjsModule\nexport default cjsModule\n","/**\n * sha1-uint8array.ts\n */\nconst K = [\n 0x5a827999 | 0,\n 0x6ed9eba1 | 0,\n 0x8f1bbcdc | 0,\n 0xca62c1d6 | 0,\n];\nconst algorithms = {\n sha1: 1,\n};\nexport function createHash(algorithm) {\n if (algorithm && !algorithms[algorithm] && !algorithms[algorithm.toLowerCase()]) {\n throw new Error(\"Digest method not supported\");\n }\n return new Hash();\n}\nclass Hash {\n constructor() {\n this.A = 0x67452301 | 0;\n this.B = 0xefcdab89 | 0;\n this.C = 0x98badcfe | 0;\n this.D = 0x10325476 | 0;\n this.E = 0xc3d2e1f0 | 0;\n this._size = 0;\n this._sp = 0; // surrogate pair\n if (!sharedBuffer || sharedOffset >= 8000 /* N.allocTotal */) {\n sharedBuffer = new ArrayBuffer(8000 /* N.allocTotal */);\n sharedOffset = 0;\n }\n this._byte = new Uint8Array(sharedBuffer, sharedOffset, 80 /* N.allocBytes */);\n this._word = new Int32Array(sharedBuffer, sharedOffset, 20 /* N.allocWords */);\n sharedOffset += 80 /* N.allocBytes */;\n }\n update(data) {\n // data: string\n if (\"string\" === typeof data) {\n return this._utf8(data);\n }\n // data: undefined\n if (data == null) {\n throw new TypeError(\"Invalid type: \" + typeof data);\n }\n const byteOffset = data.byteOffset;\n const length = data.byteLength;\n let blocks = (length / 64 /* N.inputBytes */) | 0;\n let offset = 0;\n // longer than 1 block\n if (blocks && !(byteOffset & 3) && !(this._size % 64 /* N.inputBytes */)) {\n const block = new Int32Array(data.buffer, byteOffset, blocks * 16 /* N.inputWords */);\n while (blocks--) {\n this._int32(block, offset >> 2);\n offset += 64 /* N.inputBytes */;\n }\n this._size += offset;\n }\n // data: TypedArray | DataView\n const BYTES_PER_ELEMENT = data.BYTES_PER_ELEMENT;\n if (BYTES_PER_ELEMENT !== 1 && data.buffer) {\n const rest = new Uint8Array(data.buffer, byteOffset + offset, length - offset);\n return this._uint8(rest);\n }\n // no more bytes\n if (offset === length)\n return this;\n // data: Uint8Array | Int8Array\n return this._uint8(data, offset);\n }\n _uint8(data, offset) {\n const { _byte, _word } = this;\n const length = data.length;\n offset = offset | 0;\n while (offset < length) {\n const start = this._size % 64 /* N.inputBytes */;\n let index = start;\n while (offset < length && index < 64 /* N.inputBytes */) {\n _byte[index++] = data[offset++];\n }\n if (index >= 64 /* N.inputBytes */) {\n this._int32(_word);\n }\n this._size += index - start;\n }\n return this;\n }\n _utf8(text) {\n const { _byte, _word } = this;\n const length = text.length;\n let surrogate = this._sp;\n for (let offset = 0; offset < length;) {\n const start = this._size % 64 /* N.inputBytes */;\n let index = start;\n while (offset < length && index < 64 /* N.inputBytes */) {\n let code = text.charCodeAt(offset++) | 0;\n if (code < 0x80) {\n // ASCII characters\n _byte[index++] = code;\n }\n else if (code < 0x800) {\n // 2 bytes\n _byte[index++] = 0xC0 | (code >>> 6);\n _byte[index++] = 0x80 | (code & 0x3F);\n }\n else if (code < 0xD800 || code > 0xDFFF) {\n // 3 bytes\n _byte[index++] = 0xE0 | (code >>> 12);\n _byte[index++] = 0x80 | ((code >>> 6) & 0x3F);\n _byte[index++] = 0x80 | (code & 0x3F);\n }\n else if (surrogate) {\n // 4 bytes - surrogate pair\n code = ((surrogate & 0x3FF) << 10) + (code & 0x3FF) + 0x10000;\n _byte[index++] = 0xF0 | (code >>> 18);\n _byte[index++] = 0x80 | ((code >>> 12) & 0x3F);\n _byte[index++] = 0x80 | ((code >>> 6) & 0x3F);\n _byte[index++] = 0x80 | (code & 0x3F);\n surrogate = 0;\n }\n else {\n surrogate = code;\n }\n }\n if (index >= 64 /* N.inputBytes */) {\n this._int32(_word);\n _word[0] = _word[16 /* N.inputWords */];\n }\n this._size += index - start;\n }\n this._sp = surrogate;\n return this;\n }\n _int32(data, offset) {\n let { A, B, C, D, E } = this;\n let i = 0;\n offset = offset | 0;\n while (i < 16 /* N.inputWords */) {\n W[i++] = swap32(data[offset++]);\n }\n for (i = 16 /* N.inputWords */; i < 80 /* N.workWords */; i++) {\n W[i] = rotate1(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]);\n }\n for (i = 0; i < 80 /* N.workWords */; i++) {\n const S = (i / 20) | 0;\n const T = (rotate5(A) + ft(S, B, C, D) + E + W[i] + K[S]) | 0;\n E = D;\n D = C;\n C = rotate30(B);\n B = A;\n A = T;\n }\n this.A = (A + this.A) | 0;\n this.B = (B + this.B) | 0;\n this.C = (C + this.C) | 0;\n this.D = (D + this.D) | 0;\n this.E = (E + this.E) | 0;\n }\n digest(encoding) {\n const { _byte, _word } = this;\n let i = (this._size % 64 /* N.inputBytes */) | 0;\n _byte[i++] = 0x80;\n // pad 0 for current word\n while (i & 3) {\n _byte[i++] = 0;\n }\n i >>= 2;\n if (i > 14 /* N.highIndex */) {\n while (i < 16 /* N.inputWords */) {\n _word[i++] = 0;\n }\n i = 0;\n this._int32(_word);\n }\n // pad 0 for rest words\n while (i < 16 /* N.inputWords */) {\n _word[i++] = 0;\n }\n // input size\n const bits64 = this._size * 8;\n const low32 = (bits64 & 0xffffffff) >>> 0;\n const high32 = (bits64 - low32) / 0x100000000;\n if (high32)\n _word[14 /* N.highIndex */] = swap32(high32);\n if (low32)\n _word[15 /* N.lowIndex */] = swap32(low32);\n this._int32(_word);\n return (encoding === \"hex\") ? this._hex() : this._bin();\n }\n _hex() {\n const { A, B, C, D, E } = this;\n return hex32(A) + hex32(B) + hex32(C) + hex32(D) + hex32(E);\n }\n _bin() {\n const { A, B, C, D, E, _byte, _word } = this;\n _word[0] = swap32(A);\n _word[1] = swap32(B);\n _word[2] = swap32(C);\n _word[3] = swap32(D);\n _word[4] = swap32(E);\n return _byte.slice(0, 20);\n }\n}\nconst W = new Int32Array(80 /* N.workWords */);\nlet sharedBuffer;\nlet sharedOffset = 0;\nconst hex32 = num => (num + 0x100000000).toString(16).substr(-8);\nconst swapLE = (c => (((c << 24) & 0xff000000) | ((c << 8) & 0xff0000) | ((c >> 8) & 0xff00) | ((c >> 24) & 0xff)));\nconst swapBE = (c => c);\nconst swap32 = isBE() ? swapBE : swapLE;\nconst rotate1 = num => (num << 1) | (num >>> 31);\nconst rotate5 = num => (num << 5) | (num >>> 27);\nconst rotate30 = num => (num << 30) | (num >>> 2);\nfunction ft(s, b, c, d) {\n if (s === 0)\n return (b & c) | ((~b) & d);\n if (s === 2)\n return (b & c) | (b & d) | (c & d);\n return b ^ c ^ d;\n}\nfunction isBE() {\n const buf = new Uint8Array(new Uint16Array([0xFEFF]).buffer); // BOM\n return (buf[0] === 0xFE);\n}\n","import { stringify } from \"safe-stable-stringify\";\nimport { createHash } from \"sha1-uint8array\";\n//#region document-model/crypto.ts\nconst hashBrowser = (data, algorithm = \"sha1\", encoding = \"base64\", _params) => {\n\tif (![\"sha1\"].includes(algorithm)) throw new Error(`Hashing algorithm not supported: \"${algorithm}\". Available: sha1`);\n\tif (![\"base64\", \"hex\"].includes(encoding)) throw new Error(`Hash encoding not supported: \"${encoding}\". Available: base64, hex`);\n\tconst hash = hashUIntArray(data, algorithm);\n\tif (encoding === \"hex\") return uint8ArrayToHex(hash);\n\treturn uint8ArrayToBase64(hash);\n};\nfunction uint8ArrayToBase64(uint8Array) {\n\tlet binaryString = \"\";\n\tfor (let i = 0; i < uint8Array.length; i++) binaryString += String.fromCharCode(uint8Array[i]);\n\treturn btoa(binaryString);\n}\nfunction uint8ArrayToHex(uint8Array) {\n\treturn Array.from(uint8Array).map((byte) => byte.toString(16).padStart(2, \"0\")).join(\"\");\n}\nfunction hashUIntArray(data, algorithm = \"sha1\") {\n\tif (![\"sha1\"].includes(algorithm)) throw new Error(\"Hashing algorithm not supported: Available: sha1\");\n\treturn createHash(\"sha1\").update(data).digest();\n}\nfunction getUnixTimestamp(date) {\n\treturn (new Date(date).getTime() / 1e3).toFixed(0);\n}\nfunction buildOperationSignatureParams({ documentId, signer, action, previousStateHash }) {\n\tconst { scope, type } = action;\n\treturn [\n\t\tgetUnixTimestamp(/* @__PURE__ */ new Date()),\n\t\tsigner.app.key,\n\t\thashBrowser([\n\t\t\tdocumentId,\n\t\t\tscope,\n\t\t\ttype,\n\t\t\tstringify(action.input)\n\t\t].join(\"\")),\n\t\tpreviousStateHash\n\t];\n}\nconst textEncode = new TextEncoder();\nfunction buildOperationSignatureMessage(params) {\n\tconst message = params.join(\"\");\n\tconst prefix = \"\u0019Signed Operation:\\n\" + message.length.toString();\n\treturn textEncode.encode(prefix + message);\n}\nfunction ab2hex(ab) {\n\tconst view = ArrayBuffer.isView(ab) ? ab : new Uint8Array(ab);\n\treturn Array.prototype.map.call(view, (x) => (\"00\" + x.toString(16)).slice(-2)).join(\"\");\n}\nfunction hex2ab(hex) {\n\treturn new Uint8Array(hex.match(/[\\da-f]{2}/gi)?.map(function(h) {\n\t\treturn parseInt(h, 16);\n\t}) ?? []);\n}\n//#endregion\n//#region document-model/utils.ts\nfunction generateId(method) {\n\tif (method && method.toString() !== \"UUIDv4\") throw new Error(`Id generation method not supported: \"${method.toString()}\"`);\n\treturn globalThis.crypto.randomUUID();\n}\n/**\n* Derives a deterministic operation ID from stable properties.\n*/\nfunction deriveOperationId(documentId, scope, branch, actionId) {\n\treturn hashBrowser(`${documentId}:${scope}:${branch}:${actionId}`, \"sha1\", \"hex\").slice(0, 32);\n}\n//#endregion\nexport { buildOperationSignatureParams as a, hex2ab as c, buildOperationSignatureMessage as i, generateId as n, getUnixTimestamp as o, ab2hex as r, hashBrowser as s, deriveOperationId as t };\n\n//# sourceMappingURL=utils-bCWnsmtD.js.map","const Operation = {\n Remove: 'remove',\n Replace: 'replace',\n Add: 'add',\n};\n\n// Don't use `Symbol()` just for 3rd party access the draft\nconst PROXY_DRAFT = Symbol.for('__MUTATIVE_PROXY_DRAFT__');\nconst RAW_RETURN_SYMBOL = Symbol('__MUTATIVE_RAW_RETURN_SYMBOL__');\nconst iteratorSymbol = Symbol.iterator;\nconst dataTypes = {\n mutable: 'mutable',\n immutable: 'immutable',\n};\n\nconst internal = {};\n\nfunction has(target, key) {\n return target instanceof Map\n ? target.has(key)\n : Object.prototype.hasOwnProperty.call(target, key);\n}\nfunction getDescriptor(target, key) {\n if (key in target) {\n let prototype = Reflect.getPrototypeOf(target);\n while (prototype) {\n const descriptor = Reflect.getOwnPropertyDescriptor(prototype, key);\n if (descriptor)\n return descriptor;\n prototype = Reflect.getPrototypeOf(prototype);\n }\n }\n return;\n}\nfunction isBaseSetInstance(obj) {\n return Object.getPrototypeOf(obj) === Set.prototype;\n}\nfunction isBaseMapInstance(obj) {\n return Object.getPrototypeOf(obj) === Map.prototype;\n}\n\nfunction latest(proxyDraft) {\n var _a;\n return (_a = proxyDraft.copy) !== null && _a !== void 0 ? _a : proxyDraft.original;\n}\n/**\n * Check if the value is a draft\n */\nfunction isDraft(target) {\n return !!getProxyDraft(target);\n}\nfunction getProxyDraft(value) {\n if (typeof value !== 'object')\n return null;\n return value === null || value === void 0 ? void 0 : value[PROXY_DRAFT];\n}\nfunction getValue(value) {\n var _a;\n const proxyDraft = getProxyDraft(value);\n return proxyDraft ? ((_a = proxyDraft.copy) !== null && _a !== void 0 ? _a : proxyDraft.original) : value;\n}\n/**\n * Check if a value is draftable\n */\nfunction isDraftable(value, options) {\n if (!value || typeof value !== 'object')\n return false;\n let markResult;\n return (Object.getPrototypeOf(value) === Object.prototype ||\n Array.isArray(value) ||\n value instanceof Map ||\n value instanceof Set ||\n (!!(options === null || options === void 0 ? void 0 : options.mark) &&\n ((markResult = options.mark(value, dataTypes)) === dataTypes.immutable ||\n typeof markResult === 'function')));\n}\nfunction getPath(target, path = []) {\n if (Object.hasOwnProperty.call(target, 'key')) {\n // check if the parent is a draft and the original value is not equal to the current value\n const parentCopy = target.parent.copy;\n const proxyDraft = getProxyDraft(get(parentCopy, target.key));\n if (proxyDraft !== null && (proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.original) !== target.original) {\n return null;\n }\n const isSet = target.parent.type === 3 /* DraftType.Set */;\n const key = isSet\n ? Array.from(target.parent.setMap.keys()).indexOf(target.key)\n : target.key;\n // check if the key is still in the next state parent\n if (!((isSet && parentCopy.size > key) || has(parentCopy, key)))\n return null;\n path.push(key);\n }\n if (target.parent) {\n return getPath(target.parent, path);\n }\n // `target` is root draft.\n path.reverse();\n try {\n // check if the path is valid\n resolvePath(target.copy, path);\n }\n catch (e) {\n return null;\n }\n return path;\n}\nfunction getType(target) {\n if (Array.isArray(target))\n return 1 /* DraftType.Array */;\n if (target instanceof Map)\n return 2 /* DraftType.Map */;\n if (target instanceof Set)\n return 3 /* DraftType.Set */;\n return 0 /* DraftType.Object */;\n}\nfunction get(target, key) {\n return getType(target) === 2 /* DraftType.Map */ ? target.get(key) : target[key];\n}\nfunction set(target, key, value) {\n const type = getType(target);\n if (type === 2 /* DraftType.Map */) {\n target.set(key, value);\n }\n else {\n target[key] = value;\n }\n}\nfunction peek(target, key) {\n const state = getProxyDraft(target);\n const source = state ? latest(state) : target;\n return source[key];\n}\nfunction isEqual(x, y) {\n if (x === y) {\n return x !== 0 || 1 / x === 1 / y;\n }\n else {\n return x !== x && y !== y;\n }\n}\nfunction revokeProxy(proxyDraft) {\n if (!proxyDraft)\n return;\n while (proxyDraft.finalities.revoke.length > 0) {\n const revoke = proxyDraft.finalities.revoke.pop();\n revoke();\n }\n}\n// handle JSON Pointer path with spec https://www.rfc-editor.org/rfc/rfc6901\nfunction escapePath(path, pathAsArray) {\n return pathAsArray\n ? path\n : ['']\n .concat(path)\n .map((_item) => {\n const item = `${_item}`;\n if (item.indexOf('/') === -1 && item.indexOf('~') === -1)\n return item;\n return item.replace(/~/g, '~0').replace(/\\//g, '~1');\n })\n .join('/');\n}\nfunction unescapePath(path) {\n if (Array.isArray(path))\n return path;\n return path\n .split('/')\n .map((_item) => _item.replace(/~1/g, '/').replace(/~0/g, '~'))\n .slice(1);\n}\nfunction resolvePath(base, path) {\n for (let index = 0; index < path.length - 1; index += 1) {\n const key = path[index];\n // use `index` in Set draft\n base = get(getType(base) === 3 /* DraftType.Set */ ? Array.from(base) : base, key);\n if (typeof base !== 'object') {\n throw new Error(`Cannot resolve patch at '${path.join('/')}'.`);\n }\n }\n return base;\n}\n\nfunction strictCopy(target) {\n const copy = Object.create(Object.getPrototypeOf(target));\n Reflect.ownKeys(target).forEach((key) => {\n let desc = Reflect.getOwnPropertyDescriptor(target, key);\n if (desc.enumerable && desc.configurable && desc.writable) {\n copy[key] = target[key];\n return;\n }\n // for freeze\n if (!desc.writable) {\n desc.writable = true;\n desc.configurable = true;\n }\n if (desc.get || desc.set)\n desc = {\n configurable: true,\n writable: true,\n enumerable: desc.enumerable,\n value: target[key],\n };\n Reflect.defineProperty(copy, key, desc);\n });\n return copy;\n}\nconst propIsEnum = Object.prototype.propertyIsEnumerable;\nfunction shallowCopy(original, options) {\n let markResult;\n if (Array.isArray(original)) {\n return Array.prototype.concat.call(original);\n }\n else if (original instanceof Set) {\n if (!isBaseSetInstance(original)) {\n const SubClass = Object.getPrototypeOf(original).constructor;\n return new SubClass(original.values());\n }\n return Set.prototype.difference\n ? Set.prototype.difference.call(original, new Set())\n : new Set(original.values());\n }\n else if (original instanceof Map) {\n if (!isBaseMapInstance(original)) {\n const SubClass = Object.getPrototypeOf(original).constructor;\n return new SubClass(original);\n }\n return new Map(original);\n }\n else if ((options === null || options === void 0 ? void 0 : options.mark) &&\n ((markResult = options.mark(original, dataTypes)),\n markResult !== undefined) &&\n markResult !== dataTypes.mutable) {\n if (markResult === dataTypes.immutable) {\n return strictCopy(original);\n }\n else if (typeof markResult === 'function') {\n if ((options.enablePatches || options.enableAutoFreeze)) {\n throw new Error(`You can't use mark and patches or auto freeze together.`);\n }\n return markResult();\n }\n throw new Error(`Unsupported mark result: ${markResult}`);\n }\n else if (typeof original === 'object' &&\n Object.getPrototypeOf(original) === Object.prototype) {\n // For best performance with shallow copies,\n // don't use `Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));` by default.\n const copy = {};\n Object.keys(original).forEach((key) => {\n copy[key] = original[key];\n });\n Object.getOwnPropertySymbols(original).forEach((key) => {\n if (propIsEnum.call(original, key)) {\n copy[key] = original[key];\n }\n });\n return copy;\n }\n else {\n throw new Error(`Please check mark() to ensure that it is a stable marker draftable function.`);\n }\n}\nfunction ensureShallowCopy(target) {\n if (target.copy)\n return;\n target.copy = shallowCopy(target.original, target.options);\n}\nfunction deepClone(target) {\n if (!isDraftable(target))\n return getValue(target);\n if (Array.isArray(target))\n return target.map(deepClone);\n if (target instanceof Map) {\n const iterable = Array.from(target.entries()).map(([k, v]) => [\n k,\n deepClone(v),\n ]);\n if (!isBaseMapInstance(target)) {\n const SubClass = Object.getPrototypeOf(target).constructor;\n return new SubClass(iterable);\n }\n return new Map(iterable);\n }\n if (target instanceof Set) {\n const iterable = Array.from(target).map(deepClone);\n if (!isBaseSetInstance(target)) {\n const SubClass = Object.getPrototypeOf(target).constructor;\n return new SubClass(iterable);\n }\n return new Set(iterable);\n }\n const copy = Object.create(Object.getPrototypeOf(target));\n for (const key in target)\n copy[key] = deepClone(target[key]);\n return copy;\n}\nfunction cloneIfNeeded(target) {\n return isDraft(target) ? deepClone(target) : target;\n}\n\nfunction markChanged(proxyDraft) {\n var _a;\n proxyDraft.assignedMap = (_a = proxyDraft.assignedMap) !== null && _a !== void 0 ? _a : new Map();\n if (!proxyDraft.operated) {\n proxyDraft.operated = true;\n if (proxyDraft.parent) {\n markChanged(proxyDraft.parent);\n }\n }\n}\n\nfunction throwFrozenError() {\n throw new Error('Cannot modify frozen object');\n}\nfunction deepFreeze(target, subKey, updatedValues, stack, keys) {\n {\n updatedValues = updatedValues !== null && updatedValues !== void 0 ? updatedValues : new WeakMap();\n stack = stack !== null && stack !== void 0 ? stack : [];\n keys = keys !== null && keys !== void 0 ? keys : [];\n const value = updatedValues.has(target)\n ? updatedValues.get(target)\n : target;\n if (stack.length > 0) {\n const index = stack.indexOf(value);\n if (value && typeof value === 'object' && index !== -1) {\n if (stack[0] === value) {\n throw new Error(`Forbids circular reference`);\n }\n throw new Error(`Forbids circular reference: ~/${keys\n .slice(0, index)\n .map((key, index) => {\n if (typeof key === 'symbol')\n return `[${key.toString()}]`;\n const parent = stack[index];\n if (typeof key === 'object' &&\n (parent instanceof Map || parent instanceof Set))\n return Array.from(parent.keys()).indexOf(key);\n return key;\n })\n .join('/')}`);\n }\n stack.push(value);\n keys.push(subKey);\n }\n else {\n stack.push(value);\n }\n }\n if (Object.isFrozen(target) || isDraft(target)) {\n {\n stack.pop();\n keys.pop();\n }\n return;\n }\n const type = getType(target);\n switch (type) {\n case 2 /* DraftType.Map */:\n for (const [key, value] of target) {\n deepFreeze(key, key, updatedValues, stack, keys);\n deepFreeze(value, key, updatedValues, stack, keys);\n }\n target.set = target.clear = target.delete = throwFrozenError;\n break;\n case 3 /* DraftType.Set */:\n for (const value of target) {\n deepFreeze(value, value, updatedValues, stack, keys);\n }\n target.add = target.clear = target.delete = throwFrozenError;\n break;\n case 1 /* DraftType.Array */:\n Object.freeze(target);\n let index = 0;\n for (const value of target) {\n deepFreeze(value, index, updatedValues, stack, keys);\n index += 1;\n }\n break;\n default:\n Object.freeze(target);\n // ignore non-enumerable or symbol properties\n Object.keys(target).forEach((name) => {\n const value = target[name];\n deepFreeze(value, name, updatedValues, stack, keys);\n });\n }\n {\n stack.pop();\n keys.pop();\n }\n}\n\nfunction forEach(target, iter) {\n const type = getType(target);\n if (type === 0 /* DraftType.Object */) {\n Reflect.ownKeys(target).forEach((key) => {\n iter(key, target[key], target);\n });\n }\n else if (type === 1 /* DraftType.Array */) {\n let index = 0;\n for (const entry of target) {\n iter(index, entry, target);\n index += 1;\n }\n }\n else {\n target.forEach((entry, index) => iter(index, entry, target));\n }\n}\n\nfunction handleValue(target, handledSet, options) {\n if (isDraft(target) ||\n !isDraftable(target, options) ||\n handledSet.has(target) ||\n Object.isFrozen(target))\n return;\n const isSet = target instanceof Set;\n const setMap = isSet ? new Map() : undefined;\n handledSet.add(target);\n forEach(target, (key, value) => {\n var _a;\n if (isDraft(value)) {\n const proxyDraft = getProxyDraft(value);\n ensureShallowCopy(proxyDraft);\n // A draft where a child node has been changed, or assigned a value\n const updatedValue = ((_a = proxyDraft.assignedMap) === null || _a === void 0 ? void 0 : _a.size) || proxyDraft.operated\n ? proxyDraft.copy\n : proxyDraft.original;\n // final update value\n set(isSet ? setMap : target, key, updatedValue);\n }\n else {\n handleValue(value, handledSet, options);\n }\n });\n if (setMap) {\n const set = target;\n const values = Array.from(set);\n set.clear();\n values.forEach((value) => {\n set.add(setMap.has(value) ? setMap.get(value) : value);\n });\n }\n}\nfunction finalizeAssigned(proxyDraft, key) {\n // handle the draftable assigned values, and the value is not a draft\n const copy = proxyDraft.type === 3 /* DraftType.Set */ ? proxyDraft.setMap : proxyDraft.copy;\n if (proxyDraft.finalities.revoke.length > 1 &&\n proxyDraft.assignedMap.get(key) &&\n copy) {\n handleValue(get(copy, key), proxyDraft.finalities.handledSet, proxyDraft.options);\n }\n}\nfunction finalizeSetValue(target) {\n if (target.type === 3 /* DraftType.Set */ && target.copy) {\n target.copy.clear();\n target.setMap.forEach((value) => {\n target.copy.add(getValue(value));\n });\n }\n}\nfunction finalizePatches(target, generatePatches, patches, inversePatches) {\n const shouldFinalize = target.operated &&\n target.assignedMap &&\n target.assignedMap.size > 0 &&\n !target.finalized;\n if (shouldFinalize) {\n if (patches && inversePatches) {\n const basePath = getPath(target);\n if (basePath) {\n generatePatches(target, basePath, patches, inversePatches);\n }\n }\n target.finalized = true;\n }\n}\nfunction markFinalization(target, key, value, generatePatches) {\n const proxyDraft = getProxyDraft(value);\n if (proxyDraft) {\n // !case: assign the draft value\n if (!proxyDraft.callbacks) {\n proxyDraft.callbacks = [];\n }\n proxyDraft.callbacks.push((patches, inversePatches) => {\n var _a;\n const copy = target.type === 3 /* DraftType.Set */ ? target.setMap : target.copy;\n if (isEqual(get(copy, key), value)) {\n let updatedValue = proxyDraft.original;\n if (proxyDraft.copy) {\n updatedValue = proxyDraft.copy;\n }\n finalizeSetValue(target);\n finalizePatches(target, generatePatches, patches, inversePatches);\n if (target.options.enableAutoFreeze) {\n target.options.updatedValues =\n (_a = target.options.updatedValues) !== null && _a !== void 0 ? _a : new WeakMap();\n target.options.updatedValues.set(updatedValue, proxyDraft.original);\n }\n // final update value\n set(copy, key, updatedValue);\n }\n });\n if (target.options.enableAutoFreeze) {\n // !case: assign the draft value in cross draft tree\n if (proxyDraft.finalities !== target.finalities) {\n target.options.enableAutoFreeze = false;\n }\n }\n }\n if (isDraftable(value, target.options)) {\n // !case: assign the non-draft value\n target.finalities.draft.push(() => {\n const copy = target.type === 3 /* DraftType.Set */ ? target.setMap : target.copy;\n if (isEqual(get(copy, key), value)) {\n finalizeAssigned(target, key);\n }\n });\n }\n}\n\nfunction generateArrayPatches(proxyState, basePath, patches, inversePatches, pathAsArray) {\n let { original, assignedMap, options } = proxyState;\n let copy = proxyState.copy;\n if (copy.length < original.length) {\n [original, copy] = [copy, original];\n [patches, inversePatches] = [inversePatches, patches];\n }\n for (let index = 0; index < original.length; index += 1) {\n if (assignedMap.get(index.toString()) && copy[index] !== original[index]) {\n const _path = basePath.concat([index]);\n const path = escapePath(_path, pathAsArray);\n patches.push({\n op: Operation.Replace,\n path,\n // If it is a draft, it needs to be deep cloned, and it may also be non-draft.\n value: cloneIfNeeded(copy[index]),\n });\n inversePatches.push({\n op: Operation.Replace,\n path,\n // If it is a draft, it needs to be deep cloned, and it may also be non-draft.\n value: cloneIfNeeded(original[index]),\n });\n }\n }\n for (let index = original.length; index < copy.length; index += 1) {\n const _path = basePath.concat([index]);\n const path = escapePath(_path, pathAsArray);\n patches.push({\n op: Operation.Add,\n path,\n // If it is a draft, it needs to be deep cloned, and it may also be non-draft.\n value: cloneIfNeeded(copy[index]),\n });\n }\n if (original.length < copy.length) {\n // https://www.rfc-editor.org/rfc/rfc6902#appendix-A.4\n // For performance, here we only generate an operation that replaces the length of the array,\n // which is inconsistent with JSON Patch specification\n const { arrayLengthAssignment = true } = options.enablePatches;\n if (arrayLengthAssignment) {\n const _path = basePath.concat(['length']);\n const path = escapePath(_path, pathAsArray);\n inversePatches.push({\n op: Operation.Replace,\n path,\n value: original.length,\n });\n }\n else {\n for (let index = copy.length; original.length < index; index -= 1) {\n const _path = basePath.concat([index - 1]);\n const path = escapePath(_path, pathAsArray);\n inversePatches.push({\n op: Operation.Remove,\n path,\n });\n }\n }\n }\n}\nfunction generatePatchesFromAssigned({ original, copy, assignedMap }, basePath, patches, inversePatches, pathAsArray) {\n assignedMap.forEach((assignedValue, key) => {\n const originalValue = get(original, key);\n const value = cloneIfNeeded(get(copy, key));\n const op = !assignedValue\n ? Operation.Remove\n : has(original, key)\n ? Operation.Replace\n : Operation.Add;\n if (isEqual(originalValue, value) && op === Operation.Replace)\n return;\n const _path = basePath.concat(key);\n const path = escapePath(_path, pathAsArray);\n patches.push(op === Operation.Remove ? { op, path } : { op, path, value });\n inversePatches.push(op === Operation.Add\n ? { op: Operation.Remove, path }\n : op === Operation.Remove\n ? { op: Operation.Add, path, value: originalValue }\n : { op: Operation.Replace, path, value: originalValue });\n });\n}\nfunction generateSetPatches({ original, copy }, basePath, patches, inversePatches, pathAsArray) {\n let index = 0;\n original.forEach((value) => {\n if (!copy.has(value)) {\n const _path = basePath.concat([index]);\n const path = escapePath(_path, pathAsArray);\n patches.push({\n op: Operation.Remove,\n path,\n value,\n });\n inversePatches.unshift({\n op: Operation.Add,\n path,\n value,\n });\n }\n index += 1;\n });\n index = 0;\n copy.forEach((value) => {\n if (!original.has(value)) {\n const _path = basePath.concat([index]);\n const path = escapePath(_path, pathAsArray);\n patches.push({\n op: Operation.Add,\n path,\n value,\n });\n inversePatches.unshift({\n op: Operation.Remove,\n path,\n value,\n });\n }\n index += 1;\n });\n}\nfunction generatePatches(proxyState, basePath, patches, inversePatches) {\n const { pathAsArray = true } = proxyState.options.enablePatches;\n switch (proxyState.type) {\n case 0 /* DraftType.Object */:\n case 2 /* DraftType.Map */:\n return generatePatchesFromAssigned(proxyState, basePath, patches, inversePatches, pathAsArray);\n case 1 /* DraftType.Array */:\n return generateArrayPatches(proxyState, basePath, patches, inversePatches, pathAsArray);\n case 3 /* DraftType.Set */:\n return generateSetPatches(proxyState, basePath, patches, inversePatches, pathAsArray);\n }\n}\n\nlet readable = false;\nconst checkReadable = (value, options, ignoreCheckDraftable = false) => {\n if (typeof value === 'object' &&\n value !== null &&\n (!isDraftable(value, options) || ignoreCheckDraftable) &&\n !readable) {\n throw new Error(`Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.`);\n }\n};\n/**\n * `unsafe(callback)` to access mutable data directly in strict mode.\n *\n * ## Example\n *\n * ```ts\n * import { create, unsafe } from '../index';\n *\n * class Foobar {\n * bar = 1;\n * }\n *\n * const baseState = { foobar: new Foobar() };\n * const state = create(\n * baseState,\n * (draft) => {\n * unsafe(() => {\n * draft.foobar.bar = 2;\n * });\n * },\n * {\n * strict: true,\n * }\n * );\n *\n * expect(state).toBe(baseState);\n * expect(state.foobar).toBe(baseState.foobar);\n * expect(state.foobar.bar).toBe(2);\n * ```\n */\nfunction unsafe(callback) {\n readable = true;\n let result;\n try {\n result = callback();\n }\n finally {\n readable = false;\n }\n return result;\n}\n\nconst mapHandler = {\n get size() {\n const current = latest(getProxyDraft(this));\n return current.size;\n },\n has(key) {\n return latest(getProxyDraft(this)).has(key);\n },\n set(key, value) {\n const target = getProxyDraft(this);\n const source = latest(target);\n if (!source.has(key) || !isEqual(source.get(key), value)) {\n ensureShallowCopy(target);\n markChanged(target);\n target.assignedMap.set(key, true);\n target.copy.set(key, value);\n markFinalization(target, key, value, generatePatches);\n }\n return this;\n },\n delete(key) {\n if (!this.has(key)) {\n return false;\n }\n const target = getProxyDraft(this);\n ensureShallowCopy(target);\n markChanged(target);\n if (target.original.has(key)) {\n target.assignedMap.set(key, false);\n }\n else {\n target.assignedMap.delete(key);\n }\n target.copy.delete(key);\n return true;\n },\n clear() {\n const target = getProxyDraft(this);\n if (!this.size)\n return;\n ensureShallowCopy(target);\n markChanged(target);\n target.assignedMap = new Map();\n for (const [key] of target.original) {\n target.assignedMap.set(key, false);\n }\n target.copy.clear();\n },\n forEach(callback, thisArg) {\n const target = getProxyDraft(this);\n latest(target).forEach((_value, _key) => {\n callback.call(thisArg, this.get(_key), _key, this);\n });\n },\n get(key) {\n var _a, _b;\n const target = getProxyDraft(this);\n const value = latest(target).get(key);\n const mutable = ((_b = (_a = target.options).mark) === null || _b === void 0 ? void 0 : _b.call(_a, value, dataTypes)) === dataTypes.mutable;\n if (target.options.strict) {\n checkReadable(value, target.options, mutable);\n }\n if (mutable) {\n return value;\n }\n if (target.finalized || !isDraftable(value, target.options)) {\n return value;\n }\n // drafted or reassigned\n if (value !== target.original.get(key)) {\n return value;\n }\n const draft = internal.createDraft({\n original: value,\n parentDraft: target,\n key,\n finalities: target.finalities,\n options: target.options,\n });\n ensureShallowCopy(target);\n target.copy.set(key, draft);\n return draft;\n },\n keys() {\n return latest(getProxyDraft(this)).keys();\n },\n values() {\n const iterator = this.keys();\n return {\n [iteratorSymbol]: () => this.values(),\n next: () => {\n const result = iterator.next();\n if (result.done)\n return result;\n const value = this.get(result.value);\n return {\n done: false,\n value,\n };\n },\n };\n },\n entries() {\n const iterator = this.keys();\n return {\n [iteratorSymbol]: () => this.entries(),\n next: () => {\n const result = iterator.next();\n if (result.done)\n return result;\n const value = this.get(result.value);\n return {\n done: false,\n value: [result.value, value],\n };\n },\n };\n },\n [iteratorSymbol]() {\n return this.entries();\n },\n};\nconst mapHandlerKeys = Reflect.ownKeys(mapHandler);\n\nconst getNextIterator = (target, iterator, { isValuesIterator }) => () => {\n var _a, _b;\n const result = iterator.next();\n if (result.done)\n return result;\n const key = result.value;\n let value = target.setMap.get(key);\n const currentDraft = getProxyDraft(value);\n const mutable = ((_b = (_a = target.options).mark) === null || _b === void 0 ? void 0 : _b.call(_a, value, dataTypes)) === dataTypes.mutable;\n if (target.options.strict) {\n checkReadable(key, target.options, mutable);\n }\n if (!mutable &&\n !currentDraft &&\n isDraftable(key, target.options) &&\n !target.finalized &&\n target.original.has(key)) {\n // draft a draftable original set item\n const proxy = internal.createDraft({\n original: key,\n parentDraft: target,\n key,\n finalities: target.finalities,\n options: target.options,\n });\n target.setMap.set(key, proxy);\n value = proxy;\n }\n else if (currentDraft) {\n // drafted\n value = currentDraft.proxy;\n }\n return {\n done: false,\n value: isValuesIterator ? value : [value, value],\n };\n};\nconst setHandler = {\n get size() {\n const target = getProxyDraft(this);\n return target.setMap.size;\n },\n has(value) {\n const target = getProxyDraft(this);\n // reassigned or non-draftable values\n if (target.setMap.has(value))\n return true;\n ensureShallowCopy(target);\n const valueProxyDraft = getProxyDraft(value);\n // drafted\n if (valueProxyDraft && target.setMap.has(valueProxyDraft.original))\n return true;\n return false;\n },\n add(value) {\n const target = getProxyDraft(this);\n if (!this.has(value)) {\n ensureShallowCopy(target);\n markChanged(target);\n target.assignedMap.set(value, true);\n target.setMap.set(value, value);\n markFinalization(target, value, value, generatePatches);\n }\n return this;\n },\n delete(value) {\n if (!this.has(value)) {\n return false;\n }\n const target = getProxyDraft(this);\n ensureShallowCopy(target);\n markChanged(target);\n const valueProxyDraft = getProxyDraft(value);\n if (valueProxyDraft && target.setMap.has(valueProxyDraft.original)) {\n // delete drafted\n target.assignedMap.set(valueProxyDraft.original, false);\n return target.setMap.delete(valueProxyDraft.original);\n }\n if (!valueProxyDraft && target.setMap.has(value)) {\n // non-draftable values\n target.assignedMap.set(value, false);\n }\n else {\n // reassigned\n target.assignedMap.delete(value);\n }\n // delete reassigned or non-draftable values\n return target.setMap.delete(value);\n },\n clear() {\n if (!this.size)\n return;\n const target = getProxyDraft(this);\n ensureShallowCopy(target);\n markChanged(target);\n for (const value of target.original) {\n target.assignedMap.set(value, false);\n }\n target.setMap.clear();\n },\n values() {\n const target = getProxyDraft(this);\n ensureShallowCopy(target);\n const iterator = target.setMap.keys();\n return {\n [Symbol.iterator]: () => this.values(),\n next: getNextIterator(target, iterator, { isValuesIterator: true }),\n };\n },\n entries() {\n const target = getProxyDraft(this);\n ensureShallowCopy(target);\n const iterator = target.setMap.keys();\n return {\n [Symbol.iterator]: () => this.entries(),\n next: getNextIterator(target, iterator, {\n isValuesIterator: false,\n }),\n };\n },\n keys() {\n return this.values();\n },\n [iteratorSymbol]() {\n return this.values();\n },\n forEach(callback, thisArg) {\n const iterator = this.values();\n let result = iterator.next();\n while (!result.done) {\n callback.call(thisArg, result.value, result.value, this);\n result = iterator.next();\n }\n },\n};\nif (Set.prototype.difference) {\n // for compatibility with new Set methods\n // https://github.com/tc39/proposal-set-methods\n // And `https://github.com/tc39/proposal-set-methods/blob/main/details.md#symbolspecies` has some details about the `@@species` symbol.\n // So we can't use SubSet instance constructor to get the constructor of the SubSet instance.\n Object.assign(setHandler, {\n intersection(other) {\n return Set.prototype.intersection.call(new Set(this.values()), other);\n },\n union(other) {\n return Set.prototype.union.call(new Set(this.values()), other);\n },\n difference(other) {\n return Set.prototype.difference.call(new Set(this.values()), other);\n },\n symmetricDifference(other) {\n return Set.prototype.symmetricDifference.call(new Set(this.values()), other);\n },\n isSubsetOf(other) {\n return Set.prototype.isSubsetOf.call(new Set(this.values()), other);\n },\n isSupersetOf(other) {\n return Set.prototype.isSupersetOf.call(new Set(this.values()), other);\n },\n isDisjointFrom(other) {\n return Set.prototype.isDisjointFrom.call(new Set(this.values()), other);\n },\n });\n}\nconst setHandlerKeys = Reflect.ownKeys(setHandler);\n\nconst proxyHandler = {\n get(target, key, receiver) {\n var _a, _b;\n const copy = (_a = target.copy) === null || _a === void 0 ? void 0 : _a[key];\n // Improve draft reading performance by caching the draft copy.\n if (copy && target.finalities.draftsCache.has(copy)) {\n return copy;\n }\n if (key === PROXY_DRAFT)\n return target;\n let markResult;\n if (target.options.mark) {\n // handle `Uncaught TypeError: Method get Map.prototype.size called on incompatible receiver #<Map>`\n // or `Uncaught TypeError: Method get Set.prototype.size called on incompatible receiver #<Set>`\n const value = key === 'size' &&\n (target.original instanceof Map || target.original instanceof Set)\n ? Reflect.get(target.original, key)\n : Reflect.get(target.original, key, receiver);\n markResult = target.options.mark(value, dataTypes);\n if (markResult === dataTypes.mutable) {\n if (target.options.strict) {\n checkReadable(value, target.options, true);\n }\n return value;\n }\n }\n const source = latest(target);\n if (source instanceof Map && mapHandlerKeys.includes(key)) {\n if (key === 'size') {\n return Object.getOwnPropertyDescriptor(mapHandler, 'size').get.call(target.proxy);\n }\n const handle = mapHandler[key];\n return handle.bind(target.proxy);\n }\n if (source instanceof Set && setHandlerKeys.includes(key)) {\n if (key === 'size') {\n return Object.getOwnPropertyDescriptor(setHandler, 'size').get.call(target.proxy);\n }\n const handle = setHandler[key];\n return handle.bind(target.proxy);\n }\n if (!has(source, key)) {\n const desc = getDescriptor(source, key);\n return desc\n ? `value` in desc\n ? desc.value\n : // !case: support for getter\n (_b = desc.get) === null || _b === void 0 ? void 0 : _b.call(target.proxy)\n : undefined;\n }\n const value = source[key];\n if (target.options.strict) {\n checkReadable(value, target.options);\n }\n if (target.finalized || !isDraftable(value, target.options)) {\n return value;\n }\n // Ensure that the assigned values are not drafted\n if (value === peek(target.original, key)) {\n ensureShallowCopy(target);\n target.copy[key] = createDraft({\n original: target.original[key],\n parentDraft: target,\n key: target.type === 1 /* DraftType.Array */ ? Number(key) : key,\n finalities: target.finalities,\n options: target.options,\n });\n // !case: support for custom shallow copy function\n if (typeof markResult === 'function') {\n const subProxyDraft = getProxyDraft(target.copy[key]);\n ensureShallowCopy(subProxyDraft);\n // Trigger a custom shallow copy to update to a new copy\n markChanged(subProxyDraft);\n return subProxyDraft.copy;\n }\n return target.copy[key];\n }\n if (isDraft(value)) {\n target.finalities.draftsCache.add(value);\n }\n return value;\n },\n set(target, key, value) {\n var _a;\n if (target.type === 3 /* DraftType.Set */ || target.type === 2 /* DraftType.Map */) {\n throw new Error(`Map/Set draft does not support any property assignment.`);\n }\n let _key;\n if (target.type === 1 /* DraftType.Array */ &&\n key !== 'length' &&\n !(Number.isInteger((_key = Number(key))) &&\n _key >= 0 &&\n (key === 0 || _key === 0 || String(_key) === String(key)))) {\n throw new Error(`Only supports setting array indices and the 'length' property.`);\n }\n const desc = getDescriptor(latest(target), key);\n if (desc === null || desc === void 0 ? void 0 : desc.set) {\n // !case: cover the case of setter\n desc.set.call(target.proxy, value);\n return true;\n }\n const current = peek(latest(target), key);\n const currentProxyDraft = getProxyDraft(current);\n if (currentProxyDraft && isEqual(currentProxyDraft.original, value)) {\n // !case: ignore the case of assigning the original draftable value to a draft\n target.copy[key] = value;\n target.assignedMap = (_a = target.assignedMap) !== null && _a !== void 0 ? _a : new Map();\n target.assignedMap.set(key, false);\n return true;\n }\n // !case: handle new props with value 'undefined'\n if (isEqual(value, current) &&\n (value !== undefined || has(target.original, key)))\n return true;\n ensureShallowCopy(target);\n markChanged(target);\n if (has(target.original, key) && isEqual(value, target.original[key])) {\n // !case: handle the case of assigning the original non-draftable value to a draft\n target.assignedMap.delete(key);\n }\n else {\n target.assignedMap.set(key, true);\n }\n target.copy[key] = value;\n markFinalization(target, key, value, generatePatches);\n return true;\n },\n has(target, key) {\n return key in latest(target);\n },\n ownKeys(target) {\n return Reflect.ownKeys(latest(target));\n },\n getOwnPropertyDescriptor(target, key) {\n const source = latest(target);\n const descriptor = Reflect.getOwnPropertyDescriptor(source, key);\n if (!descriptor)\n return descriptor;\n return {\n writable: true,\n configurable: target.type !== 1 /* DraftType.Array */ || key !== 'length',\n enumerable: descriptor.enumerable,\n value: source[key],\n };\n },\n getPrototypeOf(target) {\n return Reflect.getPrototypeOf(target.original);\n },\n setPrototypeOf() {\n throw new Error(`Cannot call 'setPrototypeOf()' on drafts`);\n },\n defineProperty() {\n throw new Error(`Cannot call 'defineProperty()' on drafts`);\n },\n deleteProperty(target, key) {\n var _a;\n if (target.type === 1 /* DraftType.Array */) {\n return proxyHandler.set.call(this, target, key, undefined, target.proxy);\n }\n if (peek(target.original, key) !== undefined || key in target.original) {\n // !case: delete an existing key\n ensureShallowCopy(target);\n markChanged(target);\n target.assignedMap.set(key, false);\n }\n else {\n target.assignedMap = (_a = target.assignedMap) !== null && _a !== void 0 ? _a : new Map();\n // The original non-existent key has been deleted\n target.assignedMap.delete(key);\n }\n if (target.copy)\n delete target.copy[key];\n return true;\n },\n};\nfunction createDraft(createDraftOptions) {\n const { original, parentDraft, key, finalities, options } = createDraftOptions;\n const type = getType(original);\n const proxyDraft = {\n type,\n finalized: false,\n parent: parentDraft,\n original,\n copy: null,\n proxy: null,\n finalities,\n options,\n // Mapping of draft Set items to their corresponding draft values.\n setMap: type === 3 /* DraftType.Set */\n ? new Map(original.entries())\n : undefined,\n };\n // !case: undefined as a draft map key\n if (key || 'key' in createDraftOptions) {\n proxyDraft.key = key;\n }\n const { proxy, revoke } = Proxy.revocable(type === 1 /* DraftType.Array */ ? Object.assign([], proxyDraft) : proxyDraft, proxyHandler);\n finalities.revoke.push(revoke);\n proxyDraft.proxy = proxy;\n if (parentDraft) {\n const target = parentDraft;\n target.finalities.draft.push((patches, inversePatches) => {\n var _a, _b;\n const oldProxyDraft = getProxyDraft(proxy);\n // if target is a Set draft, `setMap` is the real Set copies proxy mapping.\n let copy = target.type === 3 /* DraftType.Set */ ? target.setMap : target.copy;\n const draft = get(copy, key);\n const proxyDraft = getProxyDraft(draft);\n if (proxyDraft) {\n // assign the updated value to the copy object\n let updatedValue = proxyDraft.original;\n if (proxyDraft.operated) {\n updatedValue = getValue(draft);\n }\n finalizeSetValue(proxyDraft);\n finalizePatches(proxyDraft, generatePatches, patches, inversePatches);\n if (target.options.enableAutoFreeze) {\n target.options.updatedValues =\n (_a = target.options.updatedValues) !== null && _a !== void 0 ? _a : new WeakMap();\n target.options.updatedValues.set(updatedValue, proxyDraft.original);\n }\n // final update value\n set(copy, key, updatedValue);\n }\n // !case: handle the deleted key\n (_b = oldProxyDraft.callbacks) === null || _b === void 0 ? void 0 : _b.forEach((callback) => {\n callback(patches, inversePatches);\n });\n });\n }\n else {\n // !case: handle the root draft\n const target = getProxyDraft(proxy);\n target.finalities.draft.push((patches, inversePatches) => {\n finalizeSetValue(target);\n finalizePatches(target, generatePatches, patches, inversePatches);\n });\n }\n return proxy;\n}\ninternal.createDraft = createDraft;\nfunction finalizeDraft(result, returnedValue, patches, inversePatches, enableAutoFreeze) {\n var _a;\n const proxyDraft = getProxyDraft(result);\n const original = (_a = proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.original) !== null && _a !== void 0 ? _a : result;\n const hasReturnedValue = !!returnedValue.length;\n if (proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.operated) {\n while (proxyDraft.finalities.draft.length > 0) {\n const finalize = proxyDraft.finalities.draft.pop();\n finalize(patches, inversePatches);\n }\n }\n const state = hasReturnedValue\n ? returnedValue[0]\n : proxyDraft\n ? proxyDraft.operated\n ? proxyDraft.copy\n : proxyDraft.original\n : result;\n if (proxyDraft)\n revokeProxy(proxyDraft);\n if (enableAutoFreeze) {\n deepFreeze(state, state, proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.options.updatedValues);\n }\n return [\n state,\n patches && hasReturnedValue\n ? [{ op: Operation.Replace, path: [], value: returnedValue[0] }]\n : patches,\n inversePatches && hasReturnedValue\n ? [{ op: Operation.Replace, path: [], value: original }]\n : inversePatches,\n ];\n}\n\nfunction draftify(baseState, options) {\n var _a;\n const finalities = {\n draft: [],\n revoke: [],\n handledSet: new WeakSet(),\n draftsCache: new WeakSet(),\n };\n let patches;\n let inversePatches;\n if (options.enablePatches) {\n patches = [];\n inversePatches = [];\n }\n const isMutable = ((_a = options.mark) === null || _a === void 0 ? void 0 : _a.call(options, baseState, dataTypes)) === dataTypes.mutable ||\n !isDraftable(baseState, options);\n const draft = isMutable\n ? baseState\n : createDraft({\n original: baseState,\n parentDraft: null,\n finalities,\n options,\n });\n return [\n draft,\n (returnedValue = []) => {\n const [finalizedState, finalizedPatches, finalizedInversePatches] = finalizeDraft(draft, returnedValue, patches, inversePatches, options.enableAutoFreeze);\n return (options.enablePatches\n ? [finalizedState, finalizedPatches, finalizedInversePatches]\n : finalizedState);\n },\n ];\n}\n\nfunction handleReturnValue(options) {\n const { rootDraft, value, useRawReturn = false, isRoot = true } = options;\n forEach(value, (key, item, source) => {\n const proxyDraft = getProxyDraft(item);\n // just handle the draft which is created by the same rootDraft\n if (proxyDraft &&\n rootDraft &&\n proxyDraft.finalities === rootDraft.finalities) {\n options.isContainDraft = true;\n const currentValue = proxyDraft.original;\n // final update value, but just handle return value\n if (source instanceof Set) {\n const arr = Array.from(source);\n source.clear();\n arr.forEach((_item) => source.add(key === _item ? currentValue : _item));\n }\n else {\n set(source, key, currentValue);\n }\n }\n else if (typeof item === 'object' && item !== null) {\n options.value = item;\n options.isRoot = false;\n handleReturnValue(options);\n }\n });\n if (isRoot) {\n if (!options.isContainDraft)\n console.warn(`The return value does not contain any draft, please use 'rawReturn()' to wrap the return value to improve performance.`);\n if (useRawReturn) {\n console.warn(`The return value contains drafts, please don't use 'rawReturn()' to wrap the return value.`);\n }\n }\n}\nfunction getCurrent(target) {\n var _a;\n const proxyDraft = getProxyDraft(target);\n if (!isDraftable(target, proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.options))\n return target;\n const type = getType(target);\n if (proxyDraft && !proxyDraft.operated)\n return proxyDraft.original;\n let currentValue;\n function ensureShallowCopy() {\n currentValue =\n type === 2 /* DraftType.Map */\n ? !isBaseMapInstance(target)\n ? new (Object.getPrototypeOf(target).constructor)(target)\n : new Map(target)\n : type === 3 /* DraftType.Set */\n ? Array.from(proxyDraft.setMap.values())\n : shallowCopy(target, proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.options);\n }\n if (proxyDraft) {\n // It's a proxy draft, let's create a shallow copy eagerly\n proxyDraft.finalized = true;\n try {\n ensureShallowCopy();\n }\n finally {\n proxyDraft.finalized = false;\n }\n }\n else {\n // It's not a proxy draft, let's use the target directly and let's see\n // lazily if we need to create a shallow copy\n currentValue = target;\n }\n forEach(currentValue, (key, value) => {\n if (proxyDraft && isEqual(get(proxyDraft.original, key), value))\n return;\n const newValue = getCurrent(value);\n if (newValue !== value) {\n if (currentValue === target)\n ensureShallowCopy();\n set(currentValue, key, newValue);\n }\n });\n if (type === 3 /* DraftType.Set */) {\n const value = (_a = proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.original) !== null && _a !== void 0 ? _a : currentValue;\n return !isBaseSetInstance(value)\n ? new (Object.getPrototypeOf(value).constructor)(currentValue)\n : new Set(currentValue);\n }\n return currentValue;\n}\nfunction current(target) {\n if (!isDraft(target)) {\n throw new Error(`current() is only used for Draft, parameter: ${target}`);\n }\n return getCurrent(target);\n}\n\n/**\n * `makeCreator(options)` to make a creator function.\n *\n * ## Example\n *\n * ```ts\n * import { makeCreator } from '../index';\n *\n * const baseState = { foo: { bar: 'str' }, arr: [] };\n * const create = makeCreator({ enableAutoFreeze: true });\n * const state = create(\n * baseState,\n * (draft) => {\n * draft.foo.bar = 'str2';\n * },\n * );\n *\n * expect(state).toEqual({ foo: { bar: 'str2' }, arr: [] });\n * expect(state).not.toBe(baseState);\n * expect(state.foo).not.toBe(baseState.foo);\n * expect(state.arr).toBe(baseState.arr);\n * expect(Object.isFrozen(state)).toBeTruthy();\n * ```\n */\nconst makeCreator = (arg) => {\n if (arg !== undefined &&\n Object.prototype.toString.call(arg) !== '[object Object]') {\n throw new Error(`Invalid options: ${String(arg)}, 'options' should be an object.`);\n }\n return function create(arg0, arg1, arg2) {\n var _a, _b, _c;\n if (typeof arg0 === 'function' && typeof arg1 !== 'function') {\n return function (base, ...args) {\n return create(base, (draft) => arg0.call(this, draft, ...args), arg1);\n };\n }\n const base = arg0;\n const mutate = arg1;\n let options = arg2;\n if (typeof arg1 !== 'function') {\n options = arg1;\n }\n if (options !== undefined &&\n Object.prototype.toString.call(options) !== '[object Object]') {\n throw new Error(`Invalid options: ${options}, 'options' should be an object.`);\n }\n options = Object.assign(Object.assign({}, arg), options);\n const state = isDraft(base) ? current(base) : base;\n const mark = Array.isArray(options.mark)\n ? ((value, types) => {\n for (const mark of options.mark) {\n if (typeof mark !== 'function') {\n throw new Error(`Invalid mark: ${mark}, 'mark' should be a function.`);\n }\n const result = mark(value, types);\n if (result) {\n return result;\n }\n }\n return;\n })\n : options.mark;\n const enablePatches = (_a = options.enablePatches) !== null && _a !== void 0 ? _a : false;\n const strict = (_b = options.strict) !== null && _b !== void 0 ? _b : false;\n const enableAutoFreeze = (_c = options.enableAutoFreeze) !== null && _c !== void 0 ? _c : false;\n const _options = {\n enableAutoFreeze,\n mark,\n strict,\n enablePatches,\n };\n if (!isDraftable(state, _options) &&\n typeof state === 'object' &&\n state !== null) {\n throw new Error(`Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.`);\n }\n const [draft, finalize] = draftify(state, _options);\n if (typeof arg1 !== 'function') {\n if (!isDraftable(state, _options)) {\n throw new Error(`Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.`);\n }\n return [draft, finalize];\n }\n let result;\n try {\n result = mutate(draft);\n }\n catch (error) {\n revokeProxy(getProxyDraft(draft));\n throw error;\n }\n const returnValue = (value) => {\n const proxyDraft = getProxyDraft(draft);\n if (!isDraft(value)) {\n if (value !== undefined &&\n !isEqual(value, draft) &&\n (proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.operated)) {\n throw new Error(`Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.`);\n }\n const rawReturnValue = value === null || value === void 0 ? void 0 : value[RAW_RETURN_SYMBOL];\n if (rawReturnValue) {\n const _value = rawReturnValue[0];\n if (_options.strict && typeof value === 'object' && value !== null) {\n handleReturnValue({\n rootDraft: proxyDraft,\n value,\n useRawReturn: true,\n });\n }\n return finalize([_value]);\n }\n if (value !== undefined) {\n if (typeof value === 'object' && value !== null) {\n handleReturnValue({ rootDraft: proxyDraft, value });\n }\n return finalize([value]);\n }\n }\n if (value === draft || value === undefined) {\n return finalize([]);\n }\n const returnedProxyDraft = getProxyDraft(value);\n if (_options === returnedProxyDraft.options) {\n if (returnedProxyDraft.operated) {\n throw new Error(`Cannot return a modified child draft.`);\n }\n return finalize([current(value)]);\n }\n return finalize([value]);\n };\n if (result instanceof Promise) {\n return result.then(returnValue, (error) => {\n revokeProxy(getProxyDraft(draft));\n throw error;\n });\n }\n return returnValue(result);\n };\n};\n\n/**\n * `create(baseState, callback, options)` to create the next state\n *\n * ## Example\n *\n * ```ts\n * import { create } from '../index';\n *\n * const baseState = { foo: { bar: 'str' }, arr: [] };\n * const state = create(\n * baseState,\n * (draft) => {\n * draft.foo.bar = 'str2';\n * },\n * );\n *\n * expect(state).toEqual({ foo: { bar: 'str2' }, arr: [] });\n * expect(state).not.toBe(baseState);\n * expect(state.foo).not.toBe(baseState.foo);\n * expect(state.arr).toBe(baseState.arr);\n * ```\n */\nconst create = makeCreator();\n\n/**\n * `apply(state, patches)` to apply patches to state\n *\n * ## Example\n *\n * ```ts\n * import { create, apply } from '../index';\n *\n * const baseState = { foo: { bar: 'str' }, arr: [] };\n * const [state, patches] = create(\n * baseState,\n * (draft) => {\n * draft.foo.bar = 'str2';\n * },\n * { enablePatches: true }\n * );\n * expect(state).toEqual({ foo: { bar: 'str2' }, arr: [] });\n * expect(patches).toEqual([{ op: 'replace', path: ['foo', 'bar'], value: 'str2' }]);\n * expect(state).toEqual(apply(baseState, patches));\n * ```\n */\nfunction apply(state, patches, applyOptions) {\n let i;\n for (i = patches.length - 1; i >= 0; i -= 1) {\n const { value, op, path } = patches[i];\n if ((!path.length && op === Operation.Replace) ||\n (path === '' && op === Operation.Add)) {\n state = value;\n break;\n }\n }\n if (i > -1) {\n patches = patches.slice(i + 1);\n }\n const mutate = (draft) => {\n patches.forEach((patch) => {\n const { path: _path, op } = patch;\n const path = unescapePath(_path);\n let base = draft;\n for (let index = 0; index < path.length - 1; index += 1) {\n const parentType = getType(base);\n let key = path[index];\n if (typeof key !== 'string' && typeof key !== 'number') {\n key = String(key);\n }\n if (((parentType === 0 /* DraftType.Object */ ||\n parentType === 1 /* DraftType.Array */) &&\n (key === '__proto__' || key === 'constructor')) ||\n (typeof base === 'function' && key === 'prototype')) {\n throw new Error(`Patching reserved attributes like __proto__ and constructor is not allowed.`);\n }\n // use `index` in Set draft\n base = get(parentType === 3 /* DraftType.Set */ ? Array.from(base) : base, key);\n if (typeof base !== 'object') {\n throw new Error(`Cannot apply patch at '${path.join('/')}'.`);\n }\n }\n const type = getType(base);\n // ensure the original patch is not modified.\n const value = deepClone(patch.value);\n const key = path[path.length - 1];\n switch (op) {\n case Operation.Replace:\n switch (type) {\n case 2 /* DraftType.Map */:\n return base.set(key, value);\n case 3 /* DraftType.Set */:\n throw new Error(`Cannot apply replace patch to set.`);\n default:\n return (base[key] = value);\n }\n case Operation.Add:\n switch (type) {\n case 1 /* DraftType.Array */:\n // If the \"-\" character is used to\n // index the end of the array (see [RFC6901](https://datatracker.ietf.org/doc/html/rfc6902)),\n // this has the effect of appending the value to the array.\n return key === '-'\n ? base.push(value)\n : base.splice(key, 0, value);\n case 2 /* DraftType.Map */:\n return base.set(key, value);\n case 3 /* DraftType.Set */:\n return base.add(value);\n default:\n return (base[key] = value);\n }\n case Operation.Remove:\n switch (type) {\n case 1 /* DraftType.Array */:\n return base.splice(key, 1);\n case 2 /* DraftType.Map */:\n return base.delete(key);\n case 3 /* DraftType.Set */:\n return base.delete(patch.value);\n default:\n return delete base[key];\n }\n default:\n throw new Error(`Unsupported patch operation: ${op}.`);\n }\n });\n };\n if (applyOptions === null || applyOptions === void 0 ? void 0 : applyOptions.mutable) {\n {\n if (Object.keys(applyOptions).filter((key) => key !== 'mutable').length) {\n console.warn('The \"mutable\" option is not allowed to be used with other options.');\n }\n }\n mutate(state);\n return undefined;\n }\n if (isDraft(state)) {\n if (applyOptions !== undefined) {\n throw new Error(`Cannot apply patches with options to a draft.`);\n }\n mutate(state);\n return state;\n }\n return create(state, mutate, Object.assign(Object.assign({}, applyOptions), { enablePatches: false }));\n}\n\n/**\n * `original(draft)` to get original state in the draft mutation function.\n *\n * ## Example\n *\n * ```ts\n * import { create, original } from '../index';\n *\n * const baseState = { foo: { bar: 'str' }, arr: [] };\n * const state = create(\n * baseState,\n * (draft) => {\n * draft.foo.bar = 'str2';\n * expect(original(draft.foo)).toEqual({ bar: 'str' });\n * }\n * );\n * ```\n */\nfunction original(target) {\n const proxyDraft = getProxyDraft(target);\n if (!proxyDraft) {\n throw new Error(`original() is only used for a draft, parameter: ${target}`);\n }\n return proxyDraft.original;\n}\n\n/**\n * Use rawReturn() to wrap the return value to skip the draft check and thus improve performance.\n *\n * ## Example\n *\n * ```ts\n * import { create, rawReturn } from '../index';\n *\n * const baseState = { foo: { bar: 'str' }, arr: [] };\n * const state = create(\n * baseState,\n * (draft) => {\n * return rawReturn(baseState);\n * },\n * );\n * expect(state).toBe(baseState);\n * ```\n */\nfunction rawReturn(value) {\n if (arguments.length === 0) {\n throw new Error('rawReturn() must be called with a value.');\n }\n if (arguments.length > 1) {\n throw new Error('rawReturn() must be called with one argument.');\n }\n if (value !== undefined &&\n (typeof value !== 'object' || value === null)) {\n console.warn('rawReturn() must be called with an object(including plain object, arrays, Set, Map, etc.) or `undefined`, other types do not need to be returned via rawReturn().');\n }\n return {\n [RAW_RETURN_SYMBOL]: [value],\n };\n}\n\nconst constructorString = Object.prototype.constructor.toString();\n/**\n * Check if the value is a simple object(No prototype chain object or iframe same-origin object),\n * support case: https://github.com/unadlib/mutative/issues/17\n */\nconst isSimpleObject = (value) => {\n if (!value || typeof value !== 'object')\n return false;\n const prototype = Object.getPrototypeOf(value);\n if (prototype === null) {\n return true;\n }\n const constructor = Object.hasOwnProperty.call(prototype, 'constructor') &&\n prototype.constructor;\n if (constructor === Object)\n return true;\n return (typeof constructor === 'function' &&\n Function.toString.call(constructor) === constructorString);\n};\nconst markSimpleObject = (value) => {\n if (isSimpleObject(value)) {\n return dataTypes.immutable;\n }\n return;\n};\n\n/**\n * Cast a value to an Draft type value.\n */\nfunction castDraft(value) {\n return value;\n}\n/**\n * Cast a value to an Immutable type value.\n */\nfunction castImmutable(value) {\n return value;\n}\n/**\n * Cast a value to an Mutable type value.\n */\nfunction castMutable(draft) {\n return draft;\n}\n\nexport { apply, castDraft, castImmutable, castMutable, create, current, isDraft, isDraftable, makeCreator, markSimpleObject, original, rawReturn, unsafe };\n//# sourceMappingURL=mutative.esm.mjs.map\n","import { a as buildOperationSignatureParams, c as hex2ab, i as buildOperationSignatureMessage, n as generateId, o as getUnixTimestamp, r as ab2hex, s as hashBrowser, t as deriveOperationId } from \"../utils-bCWnsmtD.js\";\nimport { generateMock } from \"./mock.js\";\nimport { ZodError, z } from \"zod\";\nimport { stringify } from \"safe-stable-stringify\";\nimport { castDraft, create, unsafe } from \"mutative\";\nimport { pascalCase } from \"change-case\";\n//#region document-model/errors.ts\nconst FileSystemError = /* @__PURE__ */ new Error(\"File system not available.\");\nvar InvalidActionInputError = class extends Error {\n\tdata;\n\tconstructor(data) {\n\t\tsuper();\n\t\tthis.name = \"InvalidActionInputError\";\n\t\tthis.data = data;\n\t\tthis.message = this.message || `Invalid action input: ${JSON.stringify(data, null, 2)}`;\n\t}\n};\nvar InvalidActionInputZodError = class extends InvalidActionInputError {\n\tissues;\n\tconstructor(issues) {\n\t\tsuper(issues);\n\t\tthis.issues = issues;\n\t\tthis.name = \"InvalidActionInputZodError\";\n\t}\n};\nvar HashMismatchError = class extends Error {\n\t_scope;\n\t_document;\n\t_operation;\n\tconstructor(scope, document, operation) {\n\t\tsuper();\n\t\tthis.name = \"HashMismatchError\";\n\t\tthis._document = document;\n\t\tthis._scope = scope;\n\t\tthis._operation = operation;\n\t\tthis.message = JSON.stringify({\n\t\t\terror: `Hash mismatch on document ${document.header.id}, scope ${scope}, index ${operation.index}`,\n\t\t\tdocument,\n\t\t\toperation\n\t\t}, null, 1);\n\t}\n\tget document() {\n\t\treturn this._document;\n\t}\n\tget scope() {\n\t\treturn this._scope;\n\t}\n\tget operation() {\n\t\treturn this._operation;\n\t}\n};\n//#endregion\n//#region document-model/schemas.ts\nconst isDefinedNonNullAny = (v) => v !== void 0 && v !== null;\nconst definedNonNullAnySchema = z.any().refine((v) => isDefinedNonNullAny(v));\nconst Load_StateSchema = z.enum([\"LOAD_STATE\"]);\nconst PruneSchema = z.enum([\"PRUNE\"]);\nconst RedoSchema = z.enum([\"REDO\"]);\nconst Set_NameSchema = z.enum([\"SET_NAME\"]);\nconst UndoSchema = z.enum([\"UNDO\"]);\nfunction OperationScopeSchema() {\n\treturn z.string();\n}\nfunction DocumentActionSchema() {\n\treturn z.union([\n\t\tLoadStateActionSchema(),\n\t\tPruneActionSchema(),\n\t\tRedoActionSchema(),\n\t\tSetNameActionSchema(),\n\t\tUndoActionSchema()\n\t]);\n}\nfunction DocumentFileSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"DocumentFile\").optional(),\n\t\tdata: z.string(),\n\t\textension: z.string().nullable(),\n\t\tfileName: z.string().nullable(),\n\t\tmimeType: z.string()\n\t});\n}\nfunction LoadStateActionSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\ttimestampUtcMs: z.string(),\n\t\tinput: z.lazy(() => LoadStateActionInputSchema()),\n\t\ttype: Load_StateSchema,\n\t\tscope: OperationScopeSchema()\n\t});\n}\nfunction LoadStateActionInputSchema() {\n\treturn z.object({\n\t\toperations: z.number(),\n\t\tstate: z.lazy(() => LoadStateActionStateInputSchema())\n\t});\n}\nfunction LoadStateActionStateInputSchema() {\n\treturn z.object({\n\t\tdata: z.unknown().nullish(),\n\t\tname: z.string()\n\t});\n}\nfunction PruneActionSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\ttimestampUtcMs: z.string(),\n\t\tinput: z.lazy(() => PruneActionInputSchema()),\n\t\ttype: PruneSchema,\n\t\tscope: OperationScopeSchema()\n\t});\n}\nfunction PruneActionInputSchema() {\n\treturn z.object({\n\t\tend: z.number().nullish(),\n\t\tstart: z.number().nullish()\n\t});\n}\nfunction RedoActionInputSchema() {\n\treturn z.object({ count: z.number() });\n}\nfunction RedoActionSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\ttimestampUtcMs: z.string().datetime(),\n\t\tinput: RedoActionInputSchema(),\n\t\ttype: RedoSchema,\n\t\tscope: OperationScopeSchema()\n\t});\n}\nfunction SetNameActionInputSchema() {\n\treturn z.object({ name: z.string() });\n}\nfunction SetNameActionSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\ttimestampUtcMs: z.string().datetime(),\n\t\tinput: SetNameActionInputSchema(),\n\t\ttype: Set_NameSchema,\n\t\tscope: z.literal(\"global\")\n\t});\n}\nfunction UndoActionInputSchema() {\n\treturn z.object({ count: z.number() });\n}\nfunction UndoActionSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\ttimestampUtcMs: z.string().datetime(),\n\t\tinput: UndoActionInputSchema(),\n\t\ttype: UndoSchema,\n\t\tscope: OperationScopeSchema()\n\t});\n}\nfunction AddChangeLogItemInputSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"AddChangeLogItemInput\").optional(),\n\t\tcontent: z.string(),\n\t\tid: z.string(),\n\t\tinsertBefore: z.string().nullable()\n\t});\n}\nfunction AddModuleInputSchema() {\n\treturn z.object({\n\t\tdescription: z.string().nullish(),\n\t\tid: z.string(),\n\t\tname: z.string()\n\t});\n}\nfunction AddOperationErrorInputSchema() {\n\treturn z.object({\n\t\terrorCode: z.string().nullish(),\n\t\terrorDescription: z.string().nullish(),\n\t\terrorName: z.string().nullish(),\n\t\terrorTemplate: z.string().nullish(),\n\t\tid: z.string(),\n\t\toperationId: z.string()\n\t});\n}\nfunction AddOperationExampleInputSchema() {\n\treturn z.object({\n\t\texample: z.string(),\n\t\tid: z.string(),\n\t\toperationId: z.string()\n\t});\n}\nfunction AddOperationInputSchema() {\n\treturn z.object({\n\t\tdescription: z.string().nullish(),\n\t\tid: z.string(),\n\t\tmoduleId: z.string(),\n\t\tname: z.string(),\n\t\treducer: z.string().nullish(),\n\t\tschema: z.string().nullish(),\n\t\ttemplate: z.string().nullish(),\n\t\tscope: OperationScopeSchema().nullish()\n\t});\n}\nfunction AddStateExampleInputSchema() {\n\treturn z.object({\n\t\tscope: z.string(),\n\t\texample: z.string(),\n\t\tid: z.string(),\n\t\tinsertBefore: z.string().nullish()\n\t});\n}\nfunction AuthorSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"Author\").optional(),\n\t\tname: z.string(),\n\t\twebsite: z.string().nullable()\n\t});\n}\nfunction CodeExampleSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"CodeExample\").optional(),\n\t\tid: z.string(),\n\t\tvalue: z.string()\n\t});\n}\nfunction DeleteChangeLogItemInputSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"DeleteChangeLogItemInput\").optional(),\n\t\tid: z.string()\n\t});\n}\nfunction DeleteModuleInputSchema() {\n\treturn z.object({ id: z.string() });\n}\nfunction DeleteOperationErrorInputSchema() {\n\treturn z.object({ id: z.string() });\n}\nfunction DeleteOperationExampleInputSchema() {\n\treturn z.object({ id: z.string() });\n}\nfunction DeleteOperationInputSchema() {\n\treturn z.object({ id: z.string() });\n}\nfunction DeleteStateExampleInputSchema() {\n\treturn z.object({\n\t\tscope: z.string(),\n\t\tid: z.string()\n\t});\n}\nfunction DocumentModelInputSchema() {\n\treturn z.union([\n\t\tAddChangeLogItemInputSchema(),\n\t\tAddModuleInputSchema(),\n\t\tAddOperationErrorInputSchema(),\n\t\tAddOperationExampleInputSchema(),\n\t\tAddOperationInputSchema(),\n\t\tAddStateExampleInputSchema(),\n\t\tDeleteChangeLogItemInputSchema(),\n\t\tDeleteModuleInputSchema(),\n\t\tDeleteOperationErrorInputSchema(),\n\t\tDeleteOperationExampleInputSchema(),\n\t\tDeleteOperationInputSchema(),\n\t\tDeleteStateExampleInputSchema(),\n\t\tMoveOperationInputSchema(),\n\t\tReorderChangeLogItemsInputSchema(),\n\t\tReorderModuleOperationsInputSchema(),\n\t\tReorderModulesInputSchema(),\n\t\tReorderOperationErrorsInputSchema(),\n\t\tReorderOperationExamplesInputSchema(),\n\t\tReorderStateExamplesInputSchema(),\n\t\tSetAuthorNameInputSchema(),\n\t\tSetAuthorWebsiteInputSchema(),\n\t\tSetInitialStateInputSchema(),\n\t\tSetModelDescriptionInputSchema(),\n\t\tSetModelExtensionInputSchema(),\n\t\tSetModelIdInputSchema(),\n\t\tSetModelNameInputSchema(),\n\t\tSetModuleDescriptionInputSchema(),\n\t\tSetModuleNameInputSchema(),\n\t\tSetOperationDescriptionInputSchema(),\n\t\tSetOperationErrorCodeInputSchema(),\n\t\tSetOperationErrorDescriptionInputSchema(),\n\t\tSetOperationErrorNameInputSchema(),\n\t\tSetOperationErrorTemplateInputSchema(),\n\t\tSetOperationNameInputSchema(),\n\t\tSetOperationReducerInputSchema(),\n\t\tSetOperationSchemaInputSchema(),\n\t\tSetOperationTemplateInputSchema(),\n\t\tSetStateSchemaInputSchema(),\n\t\tUpdateChangeLogItemInputSchema(),\n\t\tUpdateOperationExampleInputSchema(),\n\t\tUpdateStateExampleInputSchema()\n\t]);\n}\nfunction DocumentModelGlobalStateSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"DocumentModelGlobalState\").optional(),\n\t\tauthor: AuthorSchema(),\n\t\tdescription: z.string(),\n\t\textension: z.string(),\n\t\tid: z.string(),\n\t\tname: z.string(),\n\t\tspecifications: z.array(DocumentSpecificationSchema())\n\t});\n}\nfunction DocumentSpecificationSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"DocumentSpecification\").optional(),\n\t\tchangeLog: z.array(z.string()),\n\t\tmodules: z.array(ModuleSchema()),\n\t\tstate: ScopeStateSchema(),\n\t\tversion: z.number().int()\n\t});\n}\nfunction ModuleSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"ModuleSpecification\").optional(),\n\t\tdescription: z.string().nullable(),\n\t\tid: z.string(),\n\t\tname: z.string(),\n\t\toperations: z.array(OperationSpecificationSchema())\n\t});\n}\nfunction MoveOperationInputSchema() {\n\treturn z.object({\n\t\tnewModuleId: z.string(),\n\t\toperationId: z.string()\n\t});\n}\nfunction OperationSpecificationSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"OperationSpecification\").optional(),\n\t\tdescription: z.string().nullable(),\n\t\terrors: z.array(OperationErrorSchema()),\n\t\texamples: z.array(CodeExampleSchema()),\n\t\tid: z.string(),\n\t\tname: z.string().nullable(),\n\t\treducer: z.string().nullable(),\n\t\tschema: z.string().nullable(),\n\t\ttemplate: z.string().nullable(),\n\t\tscope: OperationScopeSchema()\n\t});\n}\nfunction OperationErrorSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"OperationErrorSpecification\").optional(),\n\t\tcode: z.string().nullable(),\n\t\tdescription: z.string().nullable(),\n\t\tid: z.string(),\n\t\tname: z.string().nullable(),\n\t\ttemplate: z.string().nullable()\n\t});\n}\nfunction ReorderChangeLogItemsInputSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"ReorderChangeLogItemsInput\").optional(),\n\t\torder: z.array(z.string())\n\t});\n}\nfunction ReorderModuleOperationsInputSchema() {\n\treturn z.object({\n\t\tmoduleId: z.string(),\n\t\torder: z.array(z.string())\n\t});\n}\nfunction ReorderModulesInputSchema() {\n\treturn z.object({ order: z.array(z.string()) });\n}\nfunction ReorderOperationErrorsInputSchema() {\n\treturn z.object({\n\t\toperationId: z.string(),\n\t\torder: z.array(z.string())\n\t});\n}\nfunction ReorderOperationExamplesInputSchema() {\n\treturn z.object({\n\t\toperationId: z.string(),\n\t\torder: z.array(z.string())\n\t});\n}\nfunction ReorderStateExamplesInputSchema() {\n\treturn z.object({\n\t\tscope: z.string(),\n\t\torder: z.array(z.string())\n\t});\n}\nfunction SetAuthorNameInputSchema() {\n\treturn z.object({ authorName: z.string() });\n}\nfunction SetAuthorWebsiteInputSchema() {\n\treturn z.object({ authorWebsite: z.string() });\n}\nfunction SetInitialStateInputSchema() {\n\treturn z.object({\n\t\tscope: z.string(),\n\t\tinitialValue: z.string()\n\t});\n}\nfunction SetModelDescriptionInputSchema() {\n\treturn z.object({ description: z.string() });\n}\nfunction SetModelExtensionInputSchema() {\n\treturn z.object({ extension: z.string() });\n}\nfunction SetModelIdInputSchema() {\n\treturn z.object({ id: z.string() });\n}\nfunction SetModelNameInputSchema() {\n\treturn z.object({ name: z.string() });\n}\nfunction SetModuleDescriptionInputSchema() {\n\treturn z.object({\n\t\tdescription: z.string().nullish(),\n\t\tid: z.string()\n\t});\n}\nfunction SetModuleNameInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\tname: z.string().nullish()\n\t});\n}\nfunction SetOperationDescriptionInputSchema() {\n\treturn z.object({\n\t\tdescription: z.string().nullish(),\n\t\tid: z.string()\n\t});\n}\nfunction SetOperationErrorCodeInputSchema() {\n\treturn z.object({\n\t\terrorCode: z.string().nullish(),\n\t\tid: z.string()\n\t});\n}\nfunction SetOperationErrorDescriptionInputSchema() {\n\treturn z.object({\n\t\terrorDescription: z.string().nullish(),\n\t\tid: z.string()\n\t});\n}\nfunction SetOperationErrorNameInputSchema() {\n\treturn z.object({\n\t\terrorName: z.string().nullish(),\n\t\tid: z.string()\n\t});\n}\nfunction SetOperationErrorTemplateInputSchema() {\n\treturn z.object({\n\t\terrorTemplate: z.string().nullish(),\n\t\tid: z.string()\n\t});\n}\nfunction SetOperationNameInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\tname: z.string().nullish()\n\t});\n}\nfunction SetOperationScopeInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\tscope: OperationScopeSchema()\n\t});\n}\nfunction SetOperationReducerInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\treducer: z.string().nullish()\n\t});\n}\nfunction SetOperationSchemaInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\tschema: z.string().nullish()\n\t});\n}\nfunction SetOperationTemplateInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\ttemplate: z.string().nullish()\n\t});\n}\nfunction SetStateSchemaInputSchema() {\n\treturn z.object({\n\t\tscope: z.string(),\n\t\tschema: z.string()\n\t});\n}\nfunction StateSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"State\").optional(),\n\t\texamples: z.array(CodeExampleSchema()),\n\t\tinitialValue: z.string(),\n\t\tschema: z.string()\n\t});\n}\nfunction ScopeStateSchema() {\n\treturn z.object({\n\t\tglobal: StateSchema(),\n\t\tlocal: StateSchema()\n\t});\n}\nfunction UpdateChangeLogItemInputSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"UpdateChangeLogItemInput\").optional(),\n\t\tid: z.string(),\n\t\tnewContent: z.string()\n\t});\n}\nfunction UpdateOperationExampleInputSchema() {\n\treturn z.object({\n\t\texample: z.string(),\n\t\tid: z.string()\n\t});\n}\nfunction UpdateStateExampleInputSchema() {\n\treturn z.object({\n\t\tscope: z.string(),\n\t\tid: z.string(),\n\t\tnewExample: z.string()\n\t});\n}\nconst PowerhouseModuleSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tdocumentTypes: z.array(z.string()).optional()\n});\nconst PowerhouseModulesSchema = z.array(PowerhouseModuleSchema).optional();\nconst PublisherSchema = z.object({\n\tname: z.string().optional(),\n\turl: z.string().optional()\n});\nconst ConfigEntryTypeSchema = z.union([z.literal(\"var\"), z.literal(\"secret\")]);\nconst ConfigEntrySchema = z.object({\n\tname: z.string(),\n\ttype: ConfigEntryTypeSchema,\n\tdescription: z.string().optional(),\n\trequired: z.boolean().optional(),\n\tdefault: z.boolean().optional()\n});\nconst ManifestSchema = z.object({\n\tname: z.string(),\n\tdescription: z.string().optional(),\n\tcategory: z.string().optional(),\n\tpublisher: PublisherSchema.optional(),\n\tdocumentModels: PowerhouseModulesSchema,\n\tapps: PowerhouseModulesSchema,\n\teditors: PowerhouseModulesSchema,\n\tprocessors: PowerhouseModulesSchema,\n\tsubgraphs: PowerhouseModulesSchema,\n\tconfig: z.array(ConfigEntrySchema).optional()\n});\n//#endregion\n//#region document-model/actions.ts\n/**\n* Cancels the last `count` operations.\n*\n* @param count - Number of operations to cancel\n* @category Actions\n*/\nconst undo = (count = 1, scope = \"global\") => createAction(\"UNDO\", { count }, void 0, UndoActionInputSchema, scope);\n/**\n* Cancels the last `count` {@link undo | UNDO} operations.\n*\n* @param count - Number of UNDO operations to cancel\n* @category Actions\n*/\nconst redo = (count = 1, scope = \"global\") => createAction(\"REDO\", { count }, void 0, RedoActionInputSchema, scope);\n/**\n* Joins multiple operations into a single {@link loadState | LOAD_STATE} operation.\n*\n* @remarks\n* Useful to keep operations history smaller. Operations to prune are selected by index,\n* similar to the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice | slice} method in Arrays.\n*\n* @param start - Index of the first operation to prune\n* @param end - Index of the last operation to prune\n* @category Actions\n*/\nconst prune = (start, end, scope = \"global\") => createAction(\"PRUNE\", {\n\tstart,\n\tend\n}, void 0, PruneActionInputSchema, scope);\n/**\n* Replaces the state of the document.\n*\n* @remarks\n* This action shouldn't be used directly. It is dispatched by the {@link prune} action.\n*\n* @param state - State to be set in the document.\n* @param operations - Number of operations that were removed from the previous state.\n* @category Actions\n*/\nconst loadState = (state, operations) => createAction(\"LOAD_STATE\", {\n\tstate,\n\toperations\n}, void 0, LoadStateActionInputSchema);\nconst noop = (scope = \"global\") => createAction(\"NOOP\", {}, void 0, void 0, scope);\n/**\n* Helper function to be used by action creators.\n*\n* @remarks\n* Creates an action with the given type and input properties. The input\n* properties default to an empty object.\n*\n* @typeParam A - Type of the action to be returned.\n*\n* @param type - The type of the action.\n* @param input - The input properties of the action.\n* @param attachments - The attachments included in the action.\n* @param validator - The validator to use for the input properties.\n* @param scope - The scope of the action, can either be 'global' or 'local'.\n* @param skip - The number of operations to skip before this new action is applied.\n*\n* @throws Error if the type is empty or not a string.\n*\n* @returns The new action.\n*/\nfunction createAction(type, input, attachments, validator, scope = \"global\") {\n\tif (!type) throw new Error(\"Empty action type\");\n\tif (typeof type !== \"string\") throw new Error(`Invalid action type: ${JSON.stringify(type)}`);\n\tconst action = {\n\t\tid: generateId(),\n\t\ttimestampUtcMs: (/* @__PURE__ */ new Date()).toISOString(),\n\t\ttype,\n\t\tinput,\n\t\tscope\n\t};\n\tif (attachments) action.attachments = attachments;\n\ttry {\n\t\tvalidator?.().parse(action.input);\n\t} catch (error) {\n\t\tif (error instanceof ZodError) throw new InvalidActionInputZodError(error.issues);\n\t\tthrow new InvalidActionInputError(error);\n\t}\n\treturn action;\n}\n/**\n* This function should be used instead of { ...action } to ensure\n* that extra properties are not included in the action.\n*/\nconst actionFromAction = (action) => {\n\treturn {\n\t\tid: action.id,\n\t\ttimestampUtcMs: action.timestampUtcMs,\n\t\ttype: action.type,\n\t\tinput: action.input,\n\t\tscope: action.scope,\n\t\tcontext: action.context,\n\t\tattachments: action.attachments\n\t};\n};\nconst operationFromAction = (action, index, skip, context) => {\n\treturn {\n\t\t...action,\n\t\taction,\n\t\tid: deriveOperationId(context.documentId, context.scope, context.branch, action.id),\n\t\ttimestampUtcMs: action.timestampUtcMs,\n\t\thash: \"\",\n\t\terror: void 0,\n\t\tindex,\n\t\tskip\n\t};\n};\nconst operationFromOperation = (operation, index, skip, context) => {\n\tconst id = deriveOperationId(context.documentId, context.scope, context.branch, operation.action.id);\n\treturn {\n\t\t...operation,\n\t\thash: \"\",\n\t\terror: void 0,\n\t\tindex,\n\t\tskip,\n\t\tid\n\t};\n};\nconst operationWithContext = (operation, context) => {\n\tif (!operation.action) throw new Error(\"Operation has no action\");\n\treturn {\n\t\t...operation,\n\t\taction: {\n\t\t\t...operation.action,\n\t\t\tcontext\n\t\t}\n\t};\n};\nconst actionContext = () => ({});\nconst actionSigner = (user, app, signatures = []) => ({\n\tuser,\n\tapp,\n\tsignatures\n});\nasync function buildOperationSignature(context, signMethod) {\n\tconst params = buildOperationSignatureParams(context);\n\tconst signature = await signMethod(buildOperationSignatureMessage(params));\n\treturn [...params, `0x${ab2hex(signature)}`];\n}\nasync function buildSignedAction(action, reducer, document, signer, signHandler) {\n\tconst scopeOperations = reducer(document, action, void 0, { reuseOperationResultingState: true }).operations[action.scope];\n\tif (!scopeOperations) throw new Error(`No operations found for scope: ${action.scope}`);\n\tconst operation = scopeOperations.at(-1);\n\tif (!operation) throw new Error(\"Action was not applied\");\n\tconst previousStateHash = scopeOperations.at(-2)?.hash ?? \"\";\n\tconst signature = await buildOperationSignature({\n\t\tdocumentId: document.header.id,\n\t\tsigner,\n\t\taction,\n\t\tpreviousStateHash\n\t}, signHandler);\n\treturn operationWithContext(operation, { signer: actionSigner(signer.user, signer.app, [...signer.signatures, signature]) });\n}\nasync function verifyOperationSignature(signature, signer, verifyHandler) {\n\tconst publicKey = signer.app.key;\n\tconst params = signature.slice(0, 4);\n\treturn verifyHandler(publicKey, hex2ab(signature[4]), buildOperationSignatureMessage(params));\n}\n/**\n* Changes the name of the document.\n*\n* @param name - The name to be set in the document.\n* @category Actions\n*/\nconst setName = (name) => createAction(\"SET_NAME\", typeof name === \"string\" ? { name } : name, void 0, SetNameActionInputSchema, \"global\");\nconst setModelName = (input) => createAction(\"SET_MODEL_NAME\", { ...input }, void 0, SetModelNameInputSchema, \"global\");\nconst setModelId = (input) => createAction(\"SET_MODEL_ID\", { ...input }, void 0, SetModelIdInputSchema, \"global\");\nconst setModelExtension = (input) => createAction(\"SET_MODEL_EXTENSION\", { ...input }, void 0, SetModelExtensionInputSchema, \"global\");\nconst setModelDescription = (input) => createAction(\"SET_MODEL_DESCRIPTION\", { ...input }, void 0, SetModelDescriptionInputSchema, \"global\");\nconst setAuthorName = (input) => createAction(\"SET_AUTHOR_NAME\", { ...input }, void 0, SetAuthorNameInputSchema, \"global\");\nconst setAuthorWebsite = (input) => createAction(\"SET_AUTHOR_WEBSITE\", { ...input }, void 0, SetAuthorWebsiteInputSchema, \"global\");\nconst addModule = (input) => createAction(\"ADD_MODULE\", { ...input }, void 0, AddModuleInputSchema, \"global\");\nconst setModuleName = (input) => createAction(\"SET_MODULE_NAME\", { ...input }, void 0, SetModuleNameInputSchema, \"global\");\nconst setModuleDescription = (input) => createAction(\"SET_MODULE_DESCRIPTION\", { ...input }, void 0, SetModuleDescriptionInputSchema, \"global\");\nconst deleteModule = (input) => createAction(\"DELETE_MODULE\", { ...input }, void 0, DeleteModuleInputSchema, \"global\");\nconst reorderModules = (input) => createAction(\"REORDER_MODULES\", { ...input }, void 0, ReorderModulesInputSchema, \"global\");\nconst addOperation = (input) => createAction(\"ADD_OPERATION\", { ...input }, void 0, AddOperationInputSchema, \"global\");\nconst setOperationName = (input) => createAction(\"SET_OPERATION_NAME\", { ...input }, void 0, SetOperationNameInputSchema, \"global\");\nconst setOperationScope = (input) => createAction(\"SET_OPERATION_SCOPE\", { ...input }, void 0, SetOperationScopeInputSchema, \"global\");\nconst setOperationSchema = (input) => createAction(\"SET_OPERATION_SCHEMA\", { ...input }, void 0, SetOperationSchemaInputSchema, \"global\");\nconst setOperationDescription = (input) => createAction(\"SET_OPERATION_DESCRIPTION\", { ...input }, void 0, SetOperationDescriptionInputSchema, \"global\");\nconst setOperationTemplate = (input) => createAction(\"SET_OPERATION_TEMPLATE\", { ...input }, void 0, SetOperationTemplateInputSchema, \"global\");\nconst setOperationReducer = (input) => createAction(\"SET_OPERATION_REDUCER\", { ...input }, void 0, SetOperationReducerInputSchema, \"global\");\nconst moveOperation = (input) => createAction(\"MOVE_OPERATION\", { ...input }, void 0, MoveOperationInputSchema, \"global\");\nconst deleteOperation = (input) => createAction(\"DELETE_OPERATION\", { ...input }, void 0, DeleteOperationInputSchema, \"global\");\nconst reorderModuleOperations = (input) => createAction(\"REORDER_MODULE_OPERATIONS\", { ...input }, void 0, ReorderModuleOperationsInputSchema, \"global\");\nconst addOperationError = (input) => createAction(\"ADD_OPERATION_ERROR\", { ...input }, void 0, AddOperationErrorInputSchema, \"global\");\nconst setOperationErrorCode = (input) => createAction(\"SET_OPERATION_ERROR_CODE\", { ...input }, void 0, SetOperationErrorCodeInputSchema, \"global\");\nconst setOperationErrorName = (input) => createAction(\"SET_OPERATION_ERROR_NAME\", { ...input }, void 0, SetOperationErrorNameInputSchema, \"global\");\nconst setOperationErrorDescription = (input) => createAction(\"SET_OPERATION_ERROR_DESCRIPTION\", { ...input }, void 0, SetOperationErrorDescriptionInputSchema, \"global\");\nconst setOperationErrorTemplate = (input) => createAction(\"SET_OPERATION_ERROR_TEMPLATE\", { ...input }, void 0, SetOperationErrorTemplateInputSchema, \"global\");\nconst deleteOperationError = (input) => createAction(\"DELETE_OPERATION_ERROR\", { ...input }, void 0, DeleteOperationErrorInputSchema, \"global\");\nconst reorderOperationErrors = (input) => createAction(\"REORDER_OPERATION_ERRORS\", { ...input }, void 0, ReorderOperationErrorsInputSchema, \"global\");\nconst addOperationExample = (input) => createAction(\"ADD_OPERATION_EXAMPLE\", { ...input }, void 0, AddOperationExampleInputSchema, \"global\");\nconst updateOperationExample = (input) => createAction(\"UPDATE_OPERATION_EXAMPLE\", { ...input }, void 0, UpdateOperationExampleInputSchema, \"global\");\nconst deleteOperationExample = (input) => createAction(\"DELETE_OPERATION_EXAMPLE\", { ...input }, void 0, DeleteOperationExampleInputSchema, \"global\");\nconst reorderOperationExamples = (input) => createAction(\"REORDER_OPERATION_EXAMPLES\", { ...input }, void 0, ReorderOperationExamplesInputSchema, \"global\");\nconst operationExampleCreators = {\n\taddOperationExample,\n\tupdateOperationExample,\n\tdeleteOperationExample,\n\treorderOperationExamples\n};\nconst setStateSchema = (input) => createAction(\"SET_STATE_SCHEMA\", { ...input }, void 0, SetStateSchemaInputSchema, \"global\");\nconst setInitialState = (input) => createAction(\"SET_INITIAL_STATE\", { ...input }, void 0, SetInitialStateInputSchema, \"global\");\nconst addStateExample = (input) => createAction(\"ADD_STATE_EXAMPLE\", { ...input }, void 0, AddStateExampleInputSchema, \"global\");\nconst updateStateExample = (input) => createAction(\"UPDATE_STATE_EXAMPLE\", { ...input }, void 0, UpdateStateExampleInputSchema, \"global\");\nconst deleteStateExample = (input) => createAction(\"DELETE_STATE_EXAMPLE\", { ...input }, void 0, DeleteStateExampleInputSchema, \"global\");\nconst reorderStateExamples = (input) => createAction(\"REORDER_STATE_EXAMPLES\", { ...input }, void 0, ReorderStateExamplesInputSchema, \"global\");\nconst addChangeLogItem = (input) => createAction(\"ADD_CHANGE_LOG_ITEM\", { ...input }, void 0, AddChangeLogItemInputSchema, \"global\");\nconst updateChangeLogItem = (input) => createAction(\"UPDATE_CHANGE_LOG_ITEM\", { ...input }, void 0, UpdateChangeLogItemInputSchema, \"global\");\nconst deleteChangeLogItem = (input) => createAction(\"DELETE_CHANGE_LOG_ITEM\", { ...input }, void 0, DeleteChangeLogItemInputSchema, \"global\");\nconst reorderChangeLogItems = (input) => createAction(\"REORDER_CHANGE_LOG_ITEMS\", { ...input }, void 0, ReorderChangeLogItemsInputSchema, \"global\");\nconst releaseNewVersion = () => createAction(\"RELEASE_NEW_VERSION\", {}, void 0, void 0, \"global\");\nconst baseActions = {\n\tsetName,\n\tundo,\n\tredo,\n\tprune,\n\tloadState,\n\tnoop\n};\nconst documentModelActions = {\n\tsetModelName,\n\tsetModelId,\n\tsetModelExtension,\n\tsetModelDescription,\n\tsetAuthorName,\n\tsetAuthorWebsite,\n\taddModule,\n\tsetModuleName,\n\tsetModuleDescription,\n\tdeleteModule,\n\treorderModules,\n\taddOperation,\n\tsetOperationName,\n\tsetOperationScope,\n\tsetOperationSchema,\n\tsetOperationDescription,\n\tsetOperationTemplate,\n\tsetOperationReducer,\n\tmoveOperation,\n\tdeleteOperation,\n\treorderModuleOperations,\n\taddOperationError,\n\tsetOperationErrorCode,\n\tsetOperationErrorName,\n\tsetOperationErrorDescription,\n\tsetOperationErrorTemplate,\n\tdeleteOperationError,\n\treorderOperationErrors,\n\taddOperationExample,\n\tupdateOperationExample,\n\tdeleteOperationExample,\n\treorderOperationExamples,\n\tsetStateSchema,\n\tsetInitialState,\n\taddStateExample,\n\tupdateStateExample,\n\tdeleteStateExample,\n\treorderStateExamples,\n\taddChangeLogItem,\n\tupdateChangeLogItem,\n\tdeleteChangeLogItem,\n\treorderChangeLogItems,\n\treleaseNewVersion\n};\nconst actions = {\n\t...baseActions,\n\t...documentModelActions\n};\n//#endregion\n//#region document-model/constants.ts\nconst documentModelFileExtension = \"phdm\";\nconst documentModelInitialLocalState = {};\nconst documentModelInitialGlobalState = {\n\tid: \"\",\n\tname: \"\",\n\textension: \"\",\n\tdescription: \"\",\n\tauthor: {\n\t\tname: \"\",\n\t\twebsite: \"\"\n\t},\n\tspecifications: [{\n\t\tversion: 1,\n\t\tchangeLog: [],\n\t\tstate: {\n\t\t\tglobal: {\n\t\t\t\tschema: \"\",\n\t\t\t\tinitialValue: \"\",\n\t\t\t\texamples: []\n\t\t\t},\n\t\t\tlocal: {\n\t\t\t\tschema: \"\",\n\t\t\t\tinitialValue: \"\",\n\t\t\t\texamples: []\n\t\t\t}\n\t\t},\n\t\tmodules: []\n\t}]\n};\nconst documentModelGlobalState = {\n\tid: \"powerhouse/document-model\",\n\tname: \"DocumentModel\",\n\textension: \"phdm\",\n\tdescription: \"The Powerhouse Document Model describes the state and operations of a document type.\",\n\tauthor: {\n\t\tname: \"Powerhouse\",\n\t\twebsite: \"https://www.powerhouse.inc/\"\n\t},\n\tspecifications: [{\n\t\tversion: 1,\n\t\tchangeLog: [],\n\t\tstate: {\n\t\t\tglobal: {\n\t\t\t\tschema: \"type CodeExample {\\n id: ID!\\n value: String!\\n}\\n\\ntype OperationError {\\n id: ID!\\n code: String\\n name: String\\n description: String\\n template: String\\n}\\n\\ntype Operation {\\n id: ID!\\n name: String\\n schema: String\\n description: String\\n template: String\\n errors: [OperationError!]!\\n examples: [CodeExample!]!\\n reducer: String\\n scope: String\\n}\\n\\ntype Module {\\n id: ID!\\n name: String!\\n description: String\\n operations: [Operation!]!\\n}\\n\\ntype State {\\n schema: String!\\n initialValue: String!\\n examples: [CodeExample!]!\\n}\\n\\ntype ScopeState {\\n global: State!\\n local: State!\\n}\\n\\ntype Author {\\n name: String!\\n website: String\\n}\\n\\ntype DocumentSpecification {\\n version: Int!\\n state: ScopeState!\\n modules: [Module!]!\\n changeLog: [String!]!\\n}\\n\\ntype DocumentModelGlobalState {\\n name: String!\\n id: String!\\n extension: String!\\n description: String!\\n author: Author!\\n specifications: [DocumentSpecification!]!\\n}\",\n\t\t\t\tinitialValue: \"{\\n \\\"id\\\": \\\"\\\",\\n \\\"name\\\": \\\"\\\",\\n \\\"extension\\\": \\\"\\\",\\n \\\"description\\\": \\\"\\\",\\n \\\"author\\\": {\\n \\\"name\\\": \\\"\\\",\\n \\\"website\\\": \\\"\\\"\\n },\\n \\\"specifications\\\": [\\n {\\n \\\"version\\\": 1,\\n \\\"changeLog\\\": [],\\n \\\"state\\\": {\\n \\\"global\\\": {\\n \\\"schema\\\": \\\"\\\",\\n \\\"initialValue\\\": \\\"\\\",\\n \\\"examples\\\": []\\n },\\n \\\"local\\\": {\\n \\\"schema\\\": \\\"\\\",\\n \\\"initialValue\\\": \\\"\\\",\\n \\\"examples\\\": []\\n }\\n },\\n \\\"modules\\\": []\\n }\\n ]\\n}\",\n\t\t\t\texamples: []\n\t\t\t},\n\t\t\tlocal: {\n\t\t\t\tschema: \"\",\n\t\t\t\tinitialValue: \"\",\n\t\t\t\texamples: []\n\t\t\t}\n\t\t},\n\t\tmodules: [\n\t\t\t{\n\t\t\t\tname: \"header\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_MODEL_NAME\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the name of the document model\",\n\t\t\t\t\t\tschema: \"input SetModelNameInput {\\n name: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_MODEL_ID\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the unique identifier for the document model\",\n\t\t\t\t\t\tschema: \"input SetModelIdInput {\\n id: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_MODEL_EXTENSION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the file extension associated with this document model\",\n\t\t\t\t\t\tschema: \"input SetModelExtensionInput {\\n extension: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_MODEL_DESCRIPTION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the description text for the document model\",\n\t\t\t\t\t\tschema: \"input SetModelDescriptionInput {\\n description: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_AUTHOR_NAME\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the name of the document model author\",\n\t\t\t\t\t\tschema: \"input SetAuthorNameInput {\\n authorName: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_AUTHOR_WEBSITE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the website URL of the document model author\",\n\t\t\t\t\t\tschema: \"input SetAuthorWebsiteInput {\\n authorWebsite: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"versioning\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"ADD_CHANGE_LOG_ITEM\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Adds a new item to the document model changelog\",\n\t\t\t\t\t\tschema: \"input AddChangeLogItemInput {\\n id: ID!\\n insertBefore: ID\\n content: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"UPDATE_CHANGE_LOG_ITEM\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Updates an existing changelog item\",\n\t\t\t\t\t\tschema: \"input UpdateChangeLogItemInput {\\n id: ID!\\n newContent: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"DELETE_CHANGE_LOG_ITEM\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Removes an item from the document model changelog\",\n\t\t\t\t\t\tschema: \"input DeleteChangeLogItemInput {\\n id: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"REORDER_CHANGE_LOG_ITEMS\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Changes the order of changelog items\",\n\t\t\t\t\t\tschema: \"input ReorderChangeLogItemsInput {\\n order: [ID!]!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"RELEASE_NEW_VERSION\",\n\t\t\t\t\t\tschema: null,\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Creates a new version of the document model specification\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"module\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"ADD_MODULE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Adds a new module to the document model specification\",\n\t\t\t\t\t\tschema: \"input AddModuleInput {\\n id: ID!\\n name: String!\\n description: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_MODULE_NAME\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the name of an existing module\",\n\t\t\t\t\t\tschema: \"input SetModuleNameInput {\\n id: ID!\\n name: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_MODULE_DESCRIPTION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the description of an existing module\",\n\t\t\t\t\t\tschema: \"input SetModuleDescriptionInput {\\n id: ID!\\n description: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"DELETE_MODULE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Removes a module from the document model specification\",\n\t\t\t\t\t\tschema: \"input DeleteModuleInput {\\n id: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"REORDER_MODULES\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Changes the order of modules in the document model specification\",\n\t\t\t\t\t\tschema: \"input ReorderModulesInput {\\n order: [ID!]!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"operation-error\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"ADD_OPERATION_ERROR\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Adds a new error definition to an operation\",\n\t\t\t\t\t\tschema: \"input AddOperationErrorInput {\\n operationId: ID!\\n id: ID!\\n errorCode: String\\n errorName: String\\n errorDescription: String\\n errorTemplate: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_ERROR_CODE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the error code for an operation error\",\n\t\t\t\t\t\tschema: \"input SetOperationErrorCodeInput {\\n id: ID!\\n errorCode: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_ERROR_NAME\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the name of an operation error\",\n\t\t\t\t\t\tschema: \"input SetOperationErrorNameInput {\\n id: ID!\\n errorName: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_ERROR_DESCRIPTION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the description of an operation error\",\n\t\t\t\t\t\tschema: \"input SetOperationErrorDescriptionInput {\\n id: ID!\\n errorDescription: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_ERROR_TEMPLATE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the template for an operation error\",\n\t\t\t\t\t\tschema: \"input SetOperationErrorTemplateInput {\\n id: ID!\\n errorTemplate: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"DELETE_OPERATION_ERROR\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Removes an error definition from an operation\",\n\t\t\t\t\t\tschema: \"input DeleteOperationErrorInput {\\n id: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"REORDER_OPERATION_ERRORS\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Changes the order of error definitions for an operation\",\n\t\t\t\t\t\tschema: \"input ReorderOperationErrorsInput {\\n operationId: ID!\\n order: [ID!]!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"operation-example\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"ADD_OPERATION_EXAMPLE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Adds a new code example to an operation\",\n\t\t\t\t\t\tschema: \"input AddOperationExampleInput {\\n operationId: ID!\\n id: ID!\\n example: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"UPDATE_OPERATION_EXAMPLE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Updates an existing code example for an operation\",\n\t\t\t\t\t\tschema: \"input UpdateOperationExampleInput {\\n id: ID!\\n example: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"DELETE_OPERATION_EXAMPLE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Removes a code example from an operation\",\n\t\t\t\t\t\tschema: \"input DeleteOperationExampleInput {\\n id: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"REORDER_OPERATION_EXAMPLES\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Changes the order of code examples for an operation\",\n\t\t\t\t\t\tschema: \"input ReorderOperationExamplesInput {\\n operationId: ID!\\n order: [ID!]!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"operation\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"ADD_OPERATION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Adds a new operation to a module\",\n\t\t\t\t\t\tschema: \"input AddOperationInput {\\n moduleId: ID!\\n id: ID!\\n name: String!\\n schema: String\\n description: String\\n template: String\\n reducer: String\\n scope: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_NAME\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the name of an operation\",\n\t\t\t\t\t\tschema: \"input SetOperationNameInput {\\n id: ID!\\n name: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_SCHEMA\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the GraphQL schema definition for an operation's input\",\n\t\t\t\t\t\tschema: \"input SetOperationSchemaInput {\\n id: ID!\\n schema: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_DESCRIPTION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the description of an operation\",\n\t\t\t\t\t\tschema: \"input SetOperationDescriptionInput {\\n id: ID!\\n description: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_TEMPLATE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the template code for an operation\",\n\t\t\t\t\t\tschema: \"input SetOperationTemplateInput {\\n id: ID!\\n template: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_REDUCER\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the reducer function code for an operation\",\n\t\t\t\t\t\tschema: \"input SetOperationReducerInput {\\n id: ID!\\n reducer: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_SCOPE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the scope of an operation (global or local)\",\n\t\t\t\t\t\tschema: \"input SetOperationScopeInput {\\n id: ID!\\n scope: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"MOVE_OPERATION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Moves an operation from one module to another\",\n\t\t\t\t\t\tschema: \"input MoveOperationInput {\\n operationId: ID!\\n newModuleId: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"DELETE_OPERATION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Removes an operation from a module\",\n\t\t\t\t\t\tschema: \"input DeleteOperationInput {\\n id: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"REORDER_MODULE_OPERATIONS\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Changes the order of operations within a module\",\n\t\t\t\t\t\tschema: \"input ReorderModuleOperationsInput {\\n moduleId: ID!\\n order: [ID!]!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"state\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_STATE_SCHEMA\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the GraphQL schema definition for document state\",\n\t\t\t\t\t\tschema: \"input SetStateSchemaInput {\\n scope: String!\\n schema: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_INITIAL_STATE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the initial state value for a document scope\",\n\t\t\t\t\t\tschema: \"input SetInitialStateInput {\\n scope: String!\\n initialValue: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"ADD_STATE_EXAMPLE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Adds a new state example to a document scope\",\n\t\t\t\t\t\tschema: \"input AddStateExampleInput {\\n scope: String!\\n id: ID!\\n insertBefore: ID\\n example: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"UPDATE_STATE_EXAMPLE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Updates an existing state example for a document scope\",\n\t\t\t\t\t\tschema: \"input UpdateStateExampleInput {\\n scope: String!\\n id: ID!\\n newExample: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"DELETE_STATE_EXAMPLE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Removes a state example from a document scope\",\n\t\t\t\t\t\tschema: \"input DeleteStateExampleInput {\\n scope: String!\\n id: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"REORDER_STATE_EXAMPLES\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Changes the order of state examples for a document scope\",\n\t\t\t\t\t\tschema: \"input ReorderStateExamplesInput {\\n scope: String!\\n order: [ID!]!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t}\n\t\t]\n\t}]\n};\nconst HASH_ALGORITHM_SHA1 = \"sha1\";\nconst HASH_ALGORITHM_SHA256 = \"sha256\";\nconst HASH_ALGORITHM_SHA512 = \"sha512\";\nconst HASH_ENCODING_BASE64 = \"base64\";\nconst HASH_ENCODING_HEX = \"hex\";\n//#endregion\n//#region document-model/document-type.ts\nconst documentModelDocumentType = \"powerhouse/document-model\";\n//#endregion\n//#region document-model/document-schema.ts\nconst BaseDocumentHeaderSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tcreatedAtUtcIso: z.string(),\n\tlastModifiedAtUtcIso: z.string(),\n\tdocumentType: z.string()\n});\nconst BaseDocumentStateSchema = z.object({ global: z.unknown() });\n/** Schema for validating the header object of a DocumentModel document */\nconst DocumentModelHeaderSchema = BaseDocumentHeaderSchema.extend({ documentType: z.literal(documentModelDocumentType) });\n/** Schema for validating the state object of a DocumentModel document */\nconst DocumentModelPHStateSchema = BaseDocumentStateSchema.extend({ global: DocumentModelGlobalStateSchema() });\nconst DocumentModelSchema = z.object({\n\theader: DocumentModelHeaderSchema,\n\tstate: DocumentModelPHStateSchema,\n\tinitialState: DocumentModelPHStateSchema\n});\n/** Simple helper function to check if a state object is a DocumentModel document state object */\nfunction isDocumentModelState(state) {\n\treturn DocumentModelPHStateSchema.safeParse(state).success;\n}\n/** Simple helper function to assert that a document state object is a DocumentModel document state object */\nfunction assertIsDocumentModelState(state) {\n\tDocumentModelPHStateSchema.parse(state);\n}\n/** Simple helper function to check if a document is a DocumentModel document */\nfunction isDocumentModelDocument(document) {\n\treturn DocumentModelSchema.safeParse(document).success;\n}\n/** Simple helper function to assert that a document is a DocumentModel document */\nfunction assertIsDocumentModelDocument(document) {\n\tDocumentModelSchema.parse(document);\n}\n//#endregion\n//#region document-model/header.ts\n/**\n* Generates a deterministic payload from signing parameters\n*/\nconst generateStablePayload = (parameters) => `${parameters.documentType}:${parameters.createdAtUtcIso}:${parameters.nonce}`;\n/**\n* Creates a verification-only signer from a public key.\n* This signer can only verify signatures, not sign data.\n*\n* @param pubKey - The public key to use for verification.\n* @returns An ISigner that can only verify signatures.\n*/\nasync function createVerificationSigner(pubKey) {\n\tconst cryptoKey = await crypto.subtle.importKey(\"jwk\", pubKey, {\n\t\tname: \"ECDSA\",\n\t\tnamedCurve: \"P-256\"\n\t}, true, [\"verify\"]);\n\treturn {\n\t\tpublicKey: cryptoKey,\n\t\tasync sign(_data) {\n\t\t\tthrow new Error(\"verification-only signer cannot sign data\");\n\t\t},\n\t\tasync signAction(_action, _abortSignal) {\n\t\t\tthrow new Error(\"verification-only signer cannot sign actions\");\n\t\t},\n\t\tasync verify(data, signature) {\n\t\t\tlet isValid;\n\t\t\ttry {\n\t\t\t\tisValid = await crypto.subtle.verify({\n\t\t\t\t\tname: \"ECDSA\",\n\t\t\t\t\thash: \"SHA-256\"\n\t\t\t\t}, cryptoKey, new Uint8Array(signature), new Uint8Array(data));\n\t\t\t} catch {\n\t\t\t\tthrow new Error(\"invalid signature\");\n\t\t\t}\n\t\t\tif (!isValid) throw new Error(\"invalid signature\");\n\t\t}\n\t};\n}\n/**\n* Creates a verification-only signer from a header.\n*\n* @param header - The header to create a signer from.\n* @returns A signer that can verify the header's signature.\n*/\nconst createSignerFromHeader = async (header) => {\n\treturn createVerificationSigner(header.sig.publicKey);\n};\n/**\n* Signs a header. Generally, this is not called directly, but rather through\n* {@link createSignedHeader}.\n*\n* @param parameters - The parameters used to sign the header.\n* @param signer - The signer of the document.\n*\n* @returns The signature of the header.\n*/\nconst sign = async (parameters, signer) => {\n\tconst payload = generateStablePayload(parameters);\n\tconst data = new TextEncoder().encode(payload);\n\tconst signature = await signer.sign(data);\n\tconst signatureArray = new Uint8Array(signature);\n\treturn btoa(String.fromCharCode(...signatureArray));\n};\n/**\n* Verifies a header signature. Generally, this is not called directly, but\n* rather through {@link validateHeader}.\n*\n* @param parameters - The parameters used to sign the header.\n* @param signature - The signature to verify.\n* @param signer - The signer of the document.\n*/\nconst verify = async (parameters, signature, signer) => {\n\tconst payload = generateStablePayload(parameters);\n\tconst data = new TextEncoder().encode(payload);\n\tconst signatureBytes = Uint8Array.from(atob(signature), (c) => c.charCodeAt(0));\n\tawait signer.verify(data, signatureBytes);\n};\n/**\n* Validates a header signature.\n*/\nconst validateHeader = async (header) => {\n\tconst signer = await createSignerFromHeader(header);\n\treturn verify({\n\t\tdocumentType: header.documentType,\n\t\tcreatedAtUtcIso: header.createdAtUtcIso,\n\t\tnonce: header.sig.nonce\n\t}, header.id, signer);\n};\n/**\n* Creates a header that has yet to be signed. This header is not valid, but\n* can be input into {@link createSignedHeader} to create a signed header.\n*\n* @returns An unsigned header for a document.\n*/\nconst createPresignedHeader = (id = generateId(), documentType = \"\") => {\n\treturn {\n\t\tid,\n\t\tsig: {\n\t\t\tpublicKey: {},\n\t\t\tnonce: \"\"\n\t\t},\n\t\tdocumentType,\n\t\tcreatedAtUtcIso: (/* @__PURE__ */ new Date()).toISOString(),\n\t\tslug: \"\",\n\t\tname: \"\",\n\t\tbranch: \"main\",\n\t\trevision: { document: 0 },\n\t\tlastModifiedAtUtcIso: (/* @__PURE__ */ new Date()).toISOString(),\n\t\tmeta: {}\n\t};\n};\n/**\n* Creates a new, signed header for a document. This will replace the id of the\n* document.\n*\n* @param unsignedHeader - The unsigned header to created the signed header from.\n* @param signer - The signer of the document.\n*\n* @returns A new signed header for a document. Some fields are mutable and\n* some are not. See the PHDocumentHeader type for more information.\n*/\nconst createSignedHeader = async (unsignedHeader, documentType, signer) => {\n\tconst parameters = {\n\t\tdocumentType,\n\t\tcreatedAtUtcIso: unsignedHeader.createdAtUtcIso,\n\t\tnonce: generateId()\n\t};\n\treturn {\n\t\tid: await sign(parameters, signer),\n\t\tsig: {\n\t\t\tpublicKey: await crypto.subtle.exportKey(\"jwk\", signer.publicKey),\n\t\t\tnonce: parameters.nonce\n\t\t},\n\t\tdocumentType,\n\t\tcreatedAtUtcIso: unsignedHeader.createdAtUtcIso,\n\t\tslug: unsignedHeader.slug,\n\t\tname: unsignedHeader.name,\n\t\tbranch: unsignedHeader.branch,\n\t\trevision: unsignedHeader.revision,\n\t\tlastModifiedAtUtcIso: unsignedHeader.lastModifiedAtUtcIso,\n\t\tmeta: unsignedHeader.meta\n\t};\n};\n/**\n* Creates a signed header for a document. The document header requires a signer\n* as the document id is a cryptographic signature.\n*\n* @param documentType - The type of the document.\n* @param signer - The signer of the document.\n*\n* @returns The signed header for a document. Some fields are mutable and\n* some are not. See the PHDocumentHeader type for more information.\n*/\nconst createSignedHeaderForSigner = async (documentType, signer) => {\n\treturn await createSignedHeader(createPresignedHeader(), documentType, signer);\n};\n//#endregion\n//#region document-model/documents.ts\nfunction isNoopOperation(op) {\n\treturn op.type === \"NOOP\" && op.skip !== void 0 && op.skip > 0 && op.hash !== void 0;\n}\nfunction isUndoRedo(action) {\n\treturn [\"UNDO\", \"REDO\"].includes(action.type);\n}\nfunction isUndo(action) {\n\treturn action.type === \"UNDO\";\n}\nfunction isDocumentAction(action) {\n\treturn [\n\t\t\"SET_NAME\",\n\t\t\"UNDO\",\n\t\t\"REDO\",\n\t\t\"PRUNE\",\n\t\t\"LOAD_STATE\"\n\t].includes(action.type);\n}\n/**\n* Important note: it is the responsibility of the caller to set the document type\n* on the header.\n*/\nfunction baseCreateDocument(createState, initialState) {\n\tconst state = createState(initialState);\n\treturn {\n\t\theader: createPresignedHeader(),\n\t\tstate,\n\t\tinitialState: state,\n\t\toperations: {\n\t\t\tglobal: [],\n\t\t\tlocal: []\n\t\t},\n\t\tclipboard: []\n\t};\n}\nfunction hashDocumentStateForScope(document, scope = \"global\") {\n\treturn hashBrowser(stringify(document.state[scope] || \"\"));\n}\nfunction readOnly(value) {\n\treturn Object.freeze(value);\n}\n/**\n* Maps skipped operations in an array of operations.\n* Skipped operations are operations that are ignored during processing.\n* @param operations - The array of operations to map.\n* @param skippedHeadOperations - The number of operations to skip at the head of the array of operations.\n* @returns An array of mapped operations with ignore flag indicating if the operation is skipped.\n* @throws Error if the operation index is invalid and there are missing operations.\n*/\nfunction mapSkippedOperations(operations, skippedHeadOperations) {\n\tconst ops = [...operations];\n\tlet skipped = skippedHeadOperations || 0;\n\tlet latestOpIndex = ops.length > 0 ? ops[ops.length - 1].index : 0;\n\tconst scopeOpsWithIgnore = [];\n\tfor (const operation of ops.reverse()) {\n\t\tif (skipped > 0) {\n\t\t\tconst operationsDiff = latestOpIndex - operation.index;\n\t\t\tskipped -= operationsDiff;\n\t\t}\n\t\tif (skipped < 0) throw new Error(\"Invalid operation index, missing operations\");\n\t\tconst mappedOp = {\n\t\t\tignore: skipped > 0,\n\t\t\toperation\n\t\t};\n\t\tconst operationSkip = operation.skip > 0 ? operation.skip + 1 : 0;\n\t\tif (operationSkip > 0 && operationSkip > skipped) {\n\t\t\tconst skipDiff = operationSkip - skipped;\n\t\t\tskipped = skipped + skipDiff;\n\t\t}\n\t\tlatestOpIndex = operation.index;\n\t\tscopeOpsWithIgnore.push(mappedOp);\n\t}\n\treturn scopeOpsWithIgnore.reverse();\n}\n/**\n* V2 version of mapSkippedOperations for protocol version 2+.\n* In V2, all NOOPs have skip=1 and consecutive NOOPs form chains.\n* N consecutive NOOPs at any point skip N preceding content operations.\n*\n* Algorithm: Process from end to start\n* - When hitting a NOOP: increment chain length, mark as ignored\n* - When hitting a non-NOOP:\n* - If chain > 0: decrement chain, mark as ignored (this op was undone)\n* - If chain == 0: mark as not ignored (apply this op)\n*/\nfunction mapSkippedOperationsV2(operations) {\n\tconst ops = [...operations];\n\tconst result = [];\n\tlet noopChainLength = 0;\n\tfor (let i = ops.length - 1; i >= 0; i--) {\n\t\tconst operation = ops[i];\n\t\tif (operation.action.type === \"NOOP\") {\n\t\t\tnoopChainLength++;\n\t\t\tresult.unshift({\n\t\t\t\tignore: true,\n\t\t\t\toperation\n\t\t\t});\n\t\t} else if (noopChainLength > 0) {\n\t\t\tnoopChainLength--;\n\t\t\tresult.unshift({\n\t\t\t\tignore: true,\n\t\t\t\toperation\n\t\t\t});\n\t\t} else result.unshift({\n\t\t\tignore: false,\n\t\t\toperation\n\t\t});\n\t}\n\treturn result;\n}\n/**\n* V2 garbage collect that returns only operations that should be applied for state.\n* Uses the V2 model where consecutive NOOPs form chains.\n* Unlike V1 garbageCollect, this preserves ALL operations but marks which to apply.\n*/\nfunction garbageCollectV2(sortedOperations) {\n\tconst result = [];\n\tlet noopChainLength = 0;\n\tfor (let i = sortedOperations.length - 1; i >= 0; i--) {\n\t\tconst op = sortedOperations[i];\n\t\tif (\"action\" in op && op.action.type === \"NOOP\" && op.skip > 0) {\n\t\t\tnoopChainLength++;\n\t\t\tresult.unshift(op);\n\t\t} else if (noopChainLength > 0) noopChainLength--;\n\t\telse result.unshift(op);\n\t}\n\treturn result;\n}\nfunction sortMappedOperations(operations) {\n\treturn Object.values(operations).flatMap((array) => array).sort((a, b) => new Date(a.operation.timestampUtcMs).getTime() - new Date(b.operation.timestampUtcMs).getTime());\n}\nconst defaultCreateState = (state) => {\n\treturn state;\n};\nfunction replayDocument(initialState, operations, reducer, header, dispatch, skipHeaderOperations = {}, options) {\n\tconst { checkHashes = true, reuseOperationResultingState, operationResultingStateParser = parseResultingState, skipIndexValidation } = options || {};\n\tlet documentState = initialState;\n\tconst operationsToReplay = [];\n\tconst allScopes = new Set([\n\t\t...Object.keys(operations),\n\t\t\"global\",\n\t\t\"local\"\n\t]);\n\tconst initialOperations = {};\n\tfor (const scope of allScopes) initialOperations[scope] = [];\n\tif (reuseOperationResultingState) for (const [scope, scopeOperations] of Object.entries(operations)) {\n\t\tif (!scopeOperations) continue;\n\t\tconst index = scopeOperations.findLastIndex((s) => !!s.resultingState);\n\t\tif (index < 0) {\n\t\t\toperationsToReplay.push(...scopeOperations);\n\t\t\tcontinue;\n\t\t}\n\t\tconst opWithState = scopeOperations[index];\n\t\tif (!opWithState || !opWithState.resultingState) continue;\n\t\ttry {\n\t\t\tconst scopeState = operationResultingStateParser(opWithState.resultingState);\n\t\t\tdocumentState = {\n\t\t\t\t...documentState,\n\t\t\t\t[scope]: scopeState\n\t\t\t};\n\t\t\tconst scopeInitialOps = initialOperations[scope];\n\t\t\tif (scopeInitialOps) scopeInitialOps.push(...scopeOperations.slice(0, index + 1));\n\t\t\toperationsToReplay.push(...scopeOperations.slice(index + 1));\n\t\t} catch {\n\t\t\toperationsToReplay.push(...scopeOperations);\n\t\t}\n\t}\n\telse operationsToReplay.push(...Object.values(operations).flatMap((ops) => ops || []));\n\tconst document = {\n\t\theader,\n\t\tstate: defaultCreateState(documentState),\n\t\tinitialState,\n\t\toperations: initialOperations,\n\t\tclipboard: []\n\t};\n\tlet result = document;\n\tif (operationsToReplay.length) result = operationsToReplay.reduce((document, operation) => {\n\t\treturn reducer(document, operation.action, dispatch, {\n\t\t\tignoreSkipOperations: true,\n\t\t\tcheckHashes,\n\t\t\tskipIndexValidation,\n\t\t\treplayOptions: { operation }\n\t\t});\n\t}, document);\n\telse for (const scopeOperations of Object.values(initialOperations)) {\n\t\tif (!scopeOperations) continue;\n\t\tconst lastOperation = scopeOperations.at(-1);\n\t\tif (lastOperation) result = updateHeaderRevision(result, lastOperation.action.scope, lastOperation.timestampUtcMs);\n\t}\n\tif (!checkHashes) for (const scope of Object.keys(result.state)) for (let i = operationsToReplay.length - 1; i >= 0; i--) {\n\t\tconst operation = operationsToReplay[i];\n\t\tif (operation.action.scope !== scope) continue;\n\t\tif (operation.hash !== hashDocumentStateForScope(result, scope)) throw new HashMismatchError(scope, result, operation);\n\t\telse break;\n\t}\n\tconst allResultScopes = new Set([\n\t\t...Object.keys(result.operations),\n\t\t...Object.keys(operations),\n\t\t\"global\",\n\t\t\"local\"\n\t]);\n\tconst initialResultOperations = {};\n\tfor (const scope of allResultScopes) initialResultOperations[scope] = [];\n\tconst resultOperations = Array.from(allResultScopes).reduce((acc, scope) => {\n\t\tconst scopeOps = result.operations[scope] || [];\n\t\treturn {\n\t\t\t...acc,\n\t\t\t[scope]: [...scopeOps.map((operation, index) => {\n\t\t\t\treturn {\n\t\t\t\t\t...operation,\n\t\t\t\t\ttimestamp: operations[scope]?.[index]?.timestampUtcMs ?? operation.timestampUtcMs\n\t\t\t\t};\n\t\t\t})]\n\t\t};\n\t}, initialResultOperations);\n\tconst lastModified = header ? header.lastModifiedAtUtcIso : Object.values(resultOperations).reduce((acc, curr) => {\n\t\tif (!curr) return acc;\n\t\tconst operation = curr.at(-1);\n\t\tif (operation) {\n\t\t\tif (operation.timestampUtcMs > acc) return operation.timestampUtcMs;\n\t\t}\n\t\treturn acc;\n\t}, document.header.lastModifiedAtUtcIso);\n\tif (header) result.header = {\n\t\t...header,\n\t\trevision: result.header.revision,\n\t\tlastModifiedAtUtcIso: lastModified\n\t};\n\treturn {\n\t\t...result,\n\t\toperations: resultOperations\n\t};\n}\nfunction parseResultingState(state) {\n\tconst stateType = typeof state;\n\tif (stateType === \"string\") return JSON.parse(state);\n\telse if (stateType === \"object\") return state;\n\telse throw new Error(`Providing resulting state is of type: ${stateType}`);\n}\nlet IntegrityIssueType = /* @__PURE__ */ function(IntegrityIssueType) {\n\tIntegrityIssueType[\"UNEXPECTED_INDEX\"] = \"UNEXPECTED_INDEX\";\n\treturn IntegrityIssueType;\n}({});\nlet IntegrityIssueSubType = /* @__PURE__ */ function(IntegrityIssueSubType) {\n\tIntegrityIssueSubType[\"DUPLICATED_INDEX\"] = \"DUPLICATED_INDEX\";\n\tIntegrityIssueSubType[\"MISSING_INDEX\"] = \"MISSING_INDEX\";\n\treturn IntegrityIssueSubType;\n}({});\nfunction checkCleanedOperationsIntegrity(sortedOperations) {\n\tconst result = [];\n\tlet currentIndex = -1;\n\tfor (const nextOperation of sortedOperations) {\n\t\tconst nextIndex = nextOperation.index - nextOperation.skip;\n\t\tif (nextIndex !== currentIndex + 1) result.push({\n\t\t\toperation: {\n\t\t\t\tindex: nextOperation.index,\n\t\t\t\tskip: nextOperation.skip\n\t\t\t},\n\t\t\tissue: IntegrityIssueType.UNEXPECTED_INDEX,\n\t\t\tcategory: nextIndex > currentIndex + 1 ? IntegrityIssueSubType.MISSING_INDEX : IntegrityIssueSubType.DUPLICATED_INDEX,\n\t\t\tmessage: `Expected index ${currentIndex + 1} with skip 0 or equivalent, got index ${nextOperation.index} with skip ${nextOperation.skip}`\n\t\t});\n\t\tcurrentIndex = nextOperation.index;\n\t}\n\treturn result;\n}\nfunction garbageCollect(sortedOperations) {\n\tconst result = [];\n\tlet i = sortedOperations.length - 1;\n\twhile (i > -1) {\n\t\tresult.unshift(sortedOperations[i]);\n\t\tconst skipUntil = (sortedOperations[i]?.index || 0) - (sortedOperations[i]?.skip || 0) - 1;\n\t\tlet j = i - 1;\n\t\twhile (j > -1 && (sortedOperations[j]?.index || 0) > skipUntil) j--;\n\t\ti = j;\n\t}\n\treturn result;\n}\nfunction addUndo(sortedOperations) {\n\tconst operationsCopy = [...sortedOperations];\n\tconst latestOperation = operationsCopy[operationsCopy.length - 1];\n\tif (!latestOperation) return operationsCopy;\n\tif (latestOperation.action.type === \"NOOP\") operationsCopy.push({\n\t\t...latestOperation,\n\t\tindex: latestOperation.index,\n\t\tskip: nextSkipNumber(sortedOperations),\n\t\taction: {\n\t\t\t...latestOperation.action,\n\t\t\tid: generateId(),\n\t\t\ttimestampUtcMs: (/* @__PURE__ */ new Date()).toISOString(),\n\t\t\ttype: \"NOOP\"\n\t\t}\n\t});\n\telse operationsCopy.push({\n\t\tid: generateId(),\n\t\ttimestampUtcMs: (/* @__PURE__ */ new Date()).toISOString(),\n\t\tindex: latestOperation.index + 1,\n\t\tskip: 1,\n\t\thash: latestOperation.hash,\n\t\taction: {\n\t\t\tid: generateId(),\n\t\t\ttimestampUtcMs: (/* @__PURE__ */ new Date()).toISOString(),\n\t\t\ttype: \"NOOP\",\n\t\t\tinput: {},\n\t\t\tscope: latestOperation.action.scope\n\t\t}\n\t});\n\treturn operationsCopy;\n}\nfunction sortOperations(operations) {\n\treturn operations.slice().sort((a, b) => a.skip - b.skip).sort((a, b) => a.index - b.index);\n}\nfunction reshuffleByTimestamp(startIndex, opsA, opsB) {\n\treturn [...opsA, ...opsB].sort((a, b) => {\n\t\tconst timestampDiff = new Date(a.timestampUtcMs || \"\").getTime() - new Date(b.timestampUtcMs || \"\").getTime();\n\t\tif (timestampDiff !== 0) return timestampDiff;\n\t\treturn (a.id || \"\").localeCompare(b.id || \"\");\n\t}).map((op, i) => ({\n\t\t...op,\n\t\tindex: startIndex.index + i,\n\t\tskip: i === 0 ? startIndex.skip : 0\n\t}));\n}\nfunction reshuffleByTimestampAndIndex(startIndex, opsA, opsB) {\n\treturn [...opsA, ...opsB].sort((a, b) => {\n\t\tconst indexDiff = a.index - b.index;\n\t\tif (indexDiff !== 0) return indexDiff;\n\t\tconst timestampDiff = new Date(a.timestampUtcMs || \"\").getTime() - new Date(b.timestampUtcMs || \"\").getTime();\n\t\tif (timestampDiff !== 0) return timestampDiff;\n\t\treturn (a.id || \"\").localeCompare(b.id || \"\");\n\t}).map((op, i) => ({\n\t\t...op,\n\t\tindex: startIndex.index + i,\n\t\tskip: i === 0 ? startIndex.skip : 0\n\t}));\n}\nfunction operationsAreEqual(op1, op2) {\n\tconst a = op1;\n\tconst b = op2;\n\tconst aComparable = {\n\t\tindex: a.index,\n\t\tskip: a.skip,\n\t\ttype: a.type ?? null,\n\t\tscope: a.scope ?? null,\n\t\tinput: a.input ?? null\n\t};\n\tconst bComparable = {\n\t\tindex: b.index,\n\t\tskip: b.skip,\n\t\ttype: b.type ?? null,\n\t\tscope: b.scope ?? null,\n\t\tinput: b.input ?? null\n\t};\n\treturn stringify(aComparable) === stringify(bComparable);\n}\nfunction attachBranch(trunk, newBranch) {\n\tconst trunkCopy = garbageCollect(sortOperations(trunk.slice()));\n\tconst newOperations = garbageCollect(sortOperations(newBranch.slice()));\n\tif (trunkCopy.length < 1) return [newOperations, []];\n\tconst result = [];\n\tlet enteredBranch = false;\n\twhile (newOperations.length > 0) {\n\t\tconst newOperationCandidate = newOperations[0];\n\t\tlet nextTrunkOperation = trunkCopy.shift();\n\t\twhile (nextTrunkOperation && precedes(nextTrunkOperation, newOperationCandidate)) {\n\t\t\tresult.push(nextTrunkOperation);\n\t\t\tnextTrunkOperation = trunkCopy.shift();\n\t\t}\n\t\tif (!nextTrunkOperation) enteredBranch = true;\n\t\telse if (!enteredBranch) if (operationsAreEqual(nextTrunkOperation, newOperationCandidate)) {\n\t\t\tnewOperations.shift();\n\t\t\tresult.push(nextTrunkOperation);\n\t\t} else {\n\t\t\ttrunkCopy.unshift(nextTrunkOperation);\n\t\t\tenteredBranch = true;\n\t\t}\n\t\tif (enteredBranch) {\n\t\t\tlet nextAppend = newOperations.shift();\n\t\t\twhile (nextAppend) {\n\t\t\t\tresult.push(nextAppend);\n\t\t\t\tnextAppend = newOperations.shift();\n\t\t\t}\n\t\t}\n\t}\n\tif (!enteredBranch) {\n\t\tlet nextAppend = trunkCopy.shift();\n\t\twhile (nextAppend) {\n\t\t\tresult.push(nextAppend);\n\t\t\tnextAppend = trunkCopy.shift();\n\t\t}\n\t}\n\treturn [garbageCollect(result), trunkCopy];\n}\nfunction precedes(op1, op2) {\n\treturn op1.index < op2.index || op1.index === op2.index && op1.id === op2.id && op1.skip < op2.skip;\n}\nfunction split(sortedTargetOperations, sortedMergeOperations) {\n\tconst commonOperations = [];\n\tconst targetDiffOperations = [];\n\tconst mergeDiffOperations = [];\n\tconst maxLength = Math.max(sortedTargetOperations.length, sortedMergeOperations.length);\n\tlet splitHappened = false;\n\tfor (let i = 0; i < maxLength; i++) {\n\t\tconst targetOperation = sortedTargetOperations[i];\n\t\tconst mergeOperation = sortedMergeOperations[i];\n\t\tif (targetOperation && mergeOperation) if (!splitHappened && operationsAreEqual(targetOperation, mergeOperation)) commonOperations.push(targetOperation);\n\t\telse {\n\t\t\tsplitHappened = true;\n\t\t\ttargetDiffOperations.push(targetOperation);\n\t\t\tmergeDiffOperations.push(mergeOperation);\n\t\t}\n\t\telse if (targetOperation) targetDiffOperations.push(targetOperation);\n\t\telse if (mergeOperation) mergeDiffOperations.push(mergeOperation);\n\t}\n\treturn [\n\t\tcommonOperations,\n\t\ttargetDiffOperations,\n\t\tmergeDiffOperations\n\t];\n}\nfunction merge(sortedTargetOperations, sortedMergeOperations, reshuffle) {\n\tconst [_commonOperations, _targetOperations, _mergeOperations] = split(garbageCollect(sortedTargetOperations), garbageCollect(sortedMergeOperations));\n\tconst maxCommonIndex = getMaxIndex(_commonOperations);\n\tconst nextIndex = 1 + Math.max(maxCommonIndex, getMaxIndex(_targetOperations), getMaxIndex(_mergeOperations));\n\tconst filteredMergeOperations = filterDuplicatedOperations(_mergeOperations, _targetOperations);\n\tconst newOperationHistory = reshuffle({\n\t\tindex: nextIndex,\n\t\tskip: nextIndex - (maxCommonIndex + 1)\n\t}, _targetOperations, filteredMergeOperations);\n\treturn _commonOperations.concat(newOperationHistory);\n}\nfunction getMaxIndex(sortedOperations) {\n\tconst lastElement = sortedOperations[sortedOperations.length - 1];\n\tif (!lastElement) return -1;\n\treturn lastElement.index;\n}\nfunction nextSkipNumber(sortedOperations) {\n\tif (sortedOperations.length < 1) return -1;\n\tconst cleanedOperations = garbageCollect(sortedOperations);\n\tlet nextSkip = (cleanedOperations[cleanedOperations.length - 1]?.skip || 0) + 1;\n\tif (cleanedOperations.length > 1) nextSkip += cleanedOperations[cleanedOperations.length - 2]?.skip || 0;\n\treturn (cleanedOperations[cleanedOperations.length - 1]?.index || -1) < nextSkip ? -1 : nextSkip;\n}\nfunction checkOperationsIntegrity(operations) {\n\treturn checkCleanedOperationsIntegrity(garbageCollect(sortOperations(operations)));\n}\nfunction groupOperationsByScope(operations) {\n\treturn operations.reduce((acc, operation) => {\n\t\tif (!acc[operation.action.scope]) acc[operation.action.scope] = [];\n\t\tacc[operation.action.scope]?.push(operation);\n\t\treturn acc;\n\t}, {});\n}\nfunction prepareOperations(operationsHistory, newOperations) {\n\tconst result = {\n\t\tintegrityIssues: [],\n\t\tvalidOperations: [],\n\t\tinvalidOperations: [],\n\t\tduplicatedOperations: []\n\t};\n\tconst sortedOperationsHistory = sortOperations(operationsHistory);\n\tconst sortedOperations = sortOperations(newOperations);\n\tconst integrityErrors = checkCleanedOperationsIntegrity([...sortedOperationsHistory, ...sortedOperations]);\n\tconst firstMissingIndexOperation = [...integrityErrors.filter((integrityIssue) => integrityIssue.category === IntegrityIssueSubType.MISSING_INDEX)].sort((a, b) => b.operation.index - a.operation.index).pop()?.operation;\n\tfor (const newOperation of sortedOperations) {\n\t\tif (firstMissingIndexOperation && newOperation.index >= firstMissingIndexOperation.index) {\n\t\t\tresult.invalidOperations.push(newOperation);\n\t\t\tcontinue;\n\t\t}\n\t\tif (integrityErrors.some((integrityError) => {\n\t\t\treturn integrityError.operation.index === newOperation.index && integrityError.operation.skip === newOperation.skip && integrityError.category === IntegrityIssueSubType.DUPLICATED_INDEX;\n\t\t})) {\n\t\t\tresult.duplicatedOperations.push(newOperation);\n\t\t\tcontinue;\n\t\t}\n\t\tresult.validOperations.push(newOperation);\n\t}\n\tresult.integrityIssues.push(...integrityErrors);\n\treturn result;\n}\nfunction removeExistingOperations(newOperations, operationsHistory) {\n\treturn newOperations.filter((newOperation) => {\n\t\treturn !operationsHistory.some((historyOperation) => {\n\t\t\treturn newOperation.action.type === \"NOOP\" && newOperation.skip === 0 && newOperation.index === historyOperation.index || newOperation.index === historyOperation.index && newOperation.skip === historyOperation.skip && newOperation.action.scope === historyOperation.action.scope && newOperation.hash === historyOperation.hash && newOperation.action.type === historyOperation.action.type;\n\t\t});\n\t});\n}\n/**\n* Skips header operations and returns the remaining operations.\n*\n* @param operations - The array of operations.\n* @param skipHeaderOperation - The skip header operation index.\n* @returns The remaining operations after skipping header operations.\n*/\nfunction skipHeaderOperations(operations, skipHeaderOperation) {\n\tconst lastIndex = sortOperations(operations).at(-1)?.index ?? -1;\n\tconst nextIndex = lastIndex + 1;\n\tconst skipOperationIndex = {\n\t\t...skipHeaderOperation,\n\t\tindex: skipHeaderOperation.index ?? nextIndex\n\t};\n\tif (skipOperationIndex.index < lastIndex) throw new Error(`The skip header operation index must be greater than or equal to ${lastIndex}`);\n\treturn garbageCollect(sortOperations([...operations, skipOperationIndex])).slice(0, -1);\n}\nfunction garbageCollectDocumentOperations(documentOperations) {\n\treturn Object.entries(documentOperations).reduce((acc, entry) => {\n\t\tconst [scope, ops] = entry;\n\t\tif (!ops) return acc;\n\t\treturn {\n\t\t\t...acc,\n\t\t\t[scope]: garbageCollect(sortOperations(ops))\n\t\t};\n\t}, {});\n}\n/**\n* Filters out duplicated operations from the target operations array based on their IDs.\n* If an operation has an ID, it is considered duplicated if there is another operation in the source operations array with the same ID.\n* If an operation does not have an ID, it is considered unique and will not be filtered out.\n* @param targetOperations - The array of target operations to filter.\n* @param sourceOperations - The array of source operations to compare against.\n* @returns An array of operations with duplicates filtered out.\n*/\nfunction filterDuplicatedOperations(targetOperations, sourceOperations) {\n\treturn targetOperations.filter((op) => {\n\t\tif (op.id) return !sourceOperations.some((targetOp) => targetOp.id === op.id);\n\t\treturn true;\n\t});\n}\nfunction filterDocumentOperationsResultingState(documentOperations) {\n\tif (!documentOperations) return {};\n\treturn Object.entries(documentOperations).reduce((acc, [scope, operations]) => {\n\t\tif (!operations) return acc;\n\t\treturn {\n\t\t\t...acc,\n\t\t\t[scope]: operations.map((op) => {\n\t\t\t\tconst { resultingState, ...restProps } = op;\n\t\t\t\treturn restProps;\n\t\t\t})\n\t\t};\n\t}, {});\n}\n/**\n* Calculates the difference between two arrays of operations.\n* Returns an array of operations that are present in `clearedOperationsA` but not in `clearedOperationsB`.\n*\n* @template TOp - The type of the operations.\n* @param {TOp[]} clearedOperationsA - The first array of operations.\n* @param {TOp[]} clearedOperationsB - The second array of operations.\n* @returns {TOp[]} - The difference between the two arrays of operations.\n*/\nfunction diffOperations(clearedOperationsA, clearedOperationsB) {\n\treturn clearedOperationsA.filter((operationA) => !clearedOperationsB.some((operationB) => operationA.index === operationB.index));\n}\nfunction getDocumentLastModified(document) {\n\tlet latest;\n\tfor (const ops of Object.values(document.operations)) {\n\t\tif (!ops) continue;\n\t\tfor (const op of ops) if (!latest || op.index > latest.index || op.index === latest.index && op.skip > latest.skip) latest = op;\n\t}\n\treturn latest?.timestampUtcMs || document.header.lastModifiedAtUtcIso;\n}\n/**\n* Gets the next revision number based on the provided scope.\n*\n* @param state The current state of the document.\n* @param scope The scope of the operation.\n* @returns The next revision number.\n*/\nfunction getNextRevision(document, scope) {\n\treturn (document.operations[scope]?.at(-1)?.index ?? -1) + 1;\n}\n/**\n* Updates the document header with the latest revision number and\n* date of last modification.\n*\n* @param document The current state of the document.\n* @param scope The scope of the operation.\n* @param lastModifiedTimestamp Optional timestamp to use directly, avoiding a scan of all operations.\n* @returns The updated document state.\n*/\nfunction updateHeaderRevision(document, scope, lastModifiedTimestamp) {\n\tconst newTimestamp = lastModifiedTimestamp ?? getDocumentLastModified(document);\n\tconst currentTimestamp = document.header.lastModifiedAtUtcIso;\n\tconst header = {\n\t\t...document.header,\n\t\trevision: {\n\t\t\t...document.header.revision,\n\t\t\t[scope]: getNextRevision(document, scope)\n\t\t},\n\t\tlastModifiedAtUtcIso: !currentTimestamp || newTimestamp > currentTimestamp ? newTimestamp : currentTimestamp\n\t};\n\treturn {\n\t\t...document,\n\t\theader\n\t};\n}\n//#endregion\n//#region document-model/operations.ts\nfunction setNameOperation(document, input) {\n\treturn {\n\t\t...document,\n\t\theader: {\n\t\t\t...document.header,\n\t\t\tname: input.name\n\t\t}\n\t};\n}\nfunction undoOperation(document, action, skip) {\n\tconst { scope } = action;\n\treturn create({\n\t\tdocument,\n\t\taction,\n\t\tskip,\n\t\treuseLastOperationIndex: false\n\t}, (draft) => {\n\t\tconst sortedOperations = sortOperations([...document.operations[scope]]);\n\t\tdraft.action = noop(scope);\n\t\tconst lastOperation = sortedOperations.at(-1);\n\t\tlet nextIndex = lastOperation?.index ?? -1;\n\t\tconst isNewNoop = lastOperation?.action.type !== \"NOOP\";\n\t\tif (isNewNoop) nextIndex = nextIndex + 1;\n\t\telse draft.reuseLastOperationIndex = true;\n\t\tdraft.skip = nextSkipNumber(isNewNoop ? [...sortedOperations, {\n\t\t\tindex: nextIndex,\n\t\t\tskip: 0\n\t\t}] : sortedOperations);\n\t\tif (lastOperation && draft.skip > lastOperation.skip + 1) draft.skip = draft.skip + 1;\n\t\tif (draft.skip < 0) throw new Error(`Cannot undo: you can't undo more operations than the ones in the scope history`);\n\t});\n}\n/**\n* V2 of undoOperation for protocol version 2+.\n* Key differences from undoOperation:\n* - Never reuses operation index (always increments)\n* - Always sets skip=1 (consecutive NOOPs are handled during rebuild/GC)\n* - No complex skip calculation - simpler model where each UNDO is independent\n*/\nfunction undoOperationV2(document, action, skip) {\n\tconst { scope } = action;\n\treturn create({\n\t\tdocument,\n\t\taction,\n\t\tskip,\n\t\treuseLastOperationIndex: false\n\t}, (draft) => {\n\t\tconst sortedOperations = sortOperations([...document.operations[scope] || []]);\n\t\tconst nonNoopOps = sortedOperations.filter((op) => op.action.type !== \"NOOP\");\n\t\tlet noopChainLength = 0;\n\t\tfor (let i = sortedOperations.length - 1; i >= 0; i--) if (sortedOperations[i].action.type === \"NOOP\") noopChainLength++;\n\t\telse break;\n\t\tif (nonNoopOps.length <= noopChainLength) throw new Error(`Cannot undo: no more operations to undo in scope history`);\n\t\tdraft.action = noop(scope);\n\t\tdraft.skip = 1;\n\t});\n}\nfunction redoOperation(document, action, skip) {\n\tconst { scope, input } = action;\n\treturn create({\n\t\tdocument,\n\t\taction,\n\t\tskip,\n\t\treuseLastOperationIndex: false\n\t}, (draft) => {\n\t\tif (draft.skip > 0) throw new Error(`Cannot redo: skip value from reducer cannot be used with REDO action`);\n\t\tconst count = typeof input === \"object\" && input !== null && \"count\" in input ? input.count : input;\n\t\tif (typeof count !== \"number\" || count > 1) throw new Error(`Cannot redo: you can only redo one operation at a time`);\n\t\tif (typeof count !== \"number\" || count < 1) throw new Error(`Invalid REDO action: invalid redo input value`);\n\t\tif (draft.document.clipboard.length < 1) throw new Error(`Cannot redo: no operations in the clipboard`);\n\t\tconst operationIndex = draft.document.clipboard.findLastIndex((op) => op.action.scope === scope);\n\t\tif (operationIndex < 0) throw new Error(`Cannot redo: no operations in clipboard for scope \"${scope}\"`);\n\t\tconst operation = draft.document.clipboard.splice(operationIndex, 1)[0];\n\t\tdraft.action = castDraft({\n\t\t\ttype: operation.action.type,\n\t\t\tscope: operation.action.scope,\n\t\t\tinput: operation.action.input\n\t\t});\n\t});\n}\nfunction loadStateOperation(document, action) {\n\treturn {\n\t\t...document,\n\t\theader: {\n\t\t\t...document.header,\n\t\t\tname: action.state.name\n\t\t},\n\t\tstate: action.state.data\n\t};\n}\n//#endregion\n//#region document-model/reducer.ts\nfunction replayOperations(initialState, clearedOperations, stateReducer, header, dispatch, documentReducer = baseReducer, skipHeaderOperations = {}, options) {\n\treturn replayDocument(initialState, clearedOperations, createReducer(stateReducer, documentReducer), header, dispatch, skipHeaderOperations, options);\n}\n/**\n* Updates the operations history of the document based on the provided action.\n*\n* @param state The current state of the document.\n* @param action The action being applied to the document.\n* @param index The index of the operation to update.\n* @param skip The number of operations to skip before applying the action.\n* @param reuseLastOperationIndex Whether to reuse the last operation index (used when a an UNDO operation is performed after an existing one).\n* @param context The operation context for deterministic ID generation.\n* @returns The updated document state.\n*/\nfunction updateOperationsForAction(document, action, reuseLastOperationIndex, skip, context) {\n\tif ([\n\t\t\"UNDO\",\n\t\t\"REDO\",\n\t\t\"PRUNE\"\n\t].includes(action.type)) return document;\n\tconst scope = action.scope;\n\tconst existing = document.operations[scope];\n\tconst lastOperationIndex = existing?.at(-1)?.index ?? -1;\n\tconst newOperation = operationFromAction(action, reuseLastOperationIndex ? lastOperationIndex : lastOperationIndex + 1, skip, context);\n\tconst operations = [...existing ?? [], newOperation];\n\treturn {\n\t\t...document,\n\t\toperations: {\n\t\t\t...document.operations,\n\t\t\t[scope]: operations\n\t\t}\n\t};\n}\nfunction updateOperationsForOperation(document, operation, reuseLastOperationIndex, skip, context, skipIndexValidation) {\n\tconst scope = operation.action.scope;\n\tconst existing = document.operations[scope];\n\tconst lastOperationIndex = existing?.at(-1)?.index ?? -1;\n\tconst nextIndex = reuseLastOperationIndex ? lastOperationIndex : lastOperationIndex + 1;\n\tif (!skipIndexValidation && operation.index - skip > nextIndex) throw new Error(`Missing operations: expected ${nextIndex} with skip 0 or equivalent, got index ${operation.index} with skip ${skip}`);\n\tconst newOperation = operationFromOperation(operation, operation.index, skip, context);\n\tconst operations = [...existing ?? [], newOperation];\n\treturn {\n\t\t...document,\n\t\toperations: {\n\t\t\t...document.operations,\n\t\t\t[scope]: operations\n\t\t}\n\t};\n}\n/**\n* Updates the document state based on the provided action.\n*\n* @param state The current state of the document.\n* @param action The action being applied to the document.\n* @param skip The number of operations to skip before applying the action.\n* @param reuseLastOperationIndex Whether to reuse the last operation index (used when a an UNDO operation is performed after an existing one).\n* @param context The operation context for deterministic ID generation.\n* @returns The updated document state.\n*/\nfunction updateDocument(document, action, reuseLastOperationIndex, skip, context, operation, skipIndexValidation) {\n\tlet newDocument;\n\tif (operation) newDocument = updateOperationsForOperation(document, operation, reuseLastOperationIndex, skip, context, skipIndexValidation);\n\telse newDocument = updateOperationsForAction(document, action, reuseLastOperationIndex, skip, context);\n\tnewDocument = updateHeaderRevision(newDocument, action.scope, action.timestampUtcMs);\n\treturn newDocument;\n}\n/**\n* The base document reducer function that wraps a custom reducer function.\n*\n* @param state The current state of the document.\n* @param action The action being applied to the document.\n* @param wrappedReducer The custom reducer function being wrapped by the base reducer.\n* @returns The updated document state.\n*/\nfunction _baseReducer(document, action, wrappedReducer) {\n\tconst parsedAction = DocumentActionSchema().parse(action);\n\tswitch (parsedAction.type) {\n\t\tcase \"SET_NAME\": return setNameOperation(document, parsedAction.input);\n\t\tcase \"PRUNE\": return pruneOperation(document, parsedAction.input, wrappedReducer);\n\t\tcase \"LOAD_STATE\": return loadStateOperation(document, parsedAction.input);\n\t\tdefault: return document;\n\t}\n}\n/**\n* Processes an UNDO or REDO action.\n*\n* @param document The current state of the document.\n* @param action The action being applied to the document.\n* @param skip The number of operations to skip before applying the action.\n* @returns The updated document, calculated skip value and transformed action (if applied).\n*/\nfunction processUndoRedo(document, action, skip, protocolVersion = 1) {\n\tswitch (action.type) {\n\t\tcase \"UNDO\":\n\t\t\tif (protocolVersion >= 2) return undoOperationV2(document, action, skip);\n\t\t\treturn undoOperation(document, action, skip);\n\t\tcase \"REDO\": return redoOperation(document, action, skip);\n\t\tdefault: return {\n\t\t\tdocument,\n\t\t\taction,\n\t\t\tskip,\n\t\t\treuseLastOperationIndex: false\n\t\t};\n\t}\n}\nfunction processSkipOperation(document, action, customReducer, skipValue, reuseOperationResultingState = false, resultingStateParser = parseResultingState) {\n\tconst scope = action.scope;\n\tconst scopeOperations = document.operations[scope];\n\tif (!scopeOperations) return document;\n\tconst latestOperation = scopeOperations.at(-1);\n\tif (!latestOperation) return document;\n\tconst documentOperations = garbageCollectDocumentOperations({\n\t\t...document.operations,\n\t\t[scope]: skipHeaderOperations(scopeOperations, latestOperation)\n\t});\n\tlet scopeState = void 0;\n\tconst lastRemainingOperation = documentOperations[scope]?.at(-1);\n\tif (reuseOperationResultingState && lastRemainingOperation?.resultingState) scopeState = resultingStateParser(lastRemainingOperation.resultingState);\n\telse {\n\t\tconst { state } = replayOperations(document.initialState, documentOperations, customReducer, document.header, void 0, void 0, void 0, {\n\t\t\treuseOperationResultingState,\n\t\t\toperationResultingStateParser: resultingStateParser,\n\t\t\tskipIndexValidation: true\n\t\t});\n\t\tscopeState = state[scope];\n\t}\n\treturn {\n\t\t...document,\n\t\tstate: {\n\t\t\t...document.state,\n\t\t\t[scope]: scopeState\n\t\t},\n\t\toperations: garbageCollectDocumentOperations({ ...document.operations })\n\t};\n}\nfunction processUndoOperation(document, scope, customReducer, reuseOperationResultingState = false, resultingStateParser = parseResultingState) {\n\tconst scopeOperations = document.operations[scope];\n\tif (!scopeOperations) return document;\n\tconst sortedOperations = sortOperations([...scopeOperations]);\n\tsortedOperations.pop();\n\tconst documentOperations = garbageCollectDocumentOperations({ ...document.operations });\n\tconst documentScopeOps = documentOperations[scope];\n\tif (!documentScopeOps) return document;\n\tconst clearedOperations = [...documentScopeOps];\n\tconst diff = diffOperations(garbageCollect(sortedOperations), clearedOperations);\n\tconst doc = replayOperations(document.initialState, documentOperations, customReducer, document.header, void 0, void 0, void 0, {\n\t\treuseOperationResultingState,\n\t\toperationResultingStateParser: resultingStateParser\n\t});\n\tconst clipboard = sortOperations([...document.clipboard, ...diff].filter((op) => op.action.type !== \"NOOP\")).reverse();\n\treturn {\n\t\t...doc,\n\t\tclipboard\n\t};\n}\n/**\n* Base document reducer that wraps a custom document reducer and handles\n* document-level actions such as undo, redo, prune, and set name.\n*\n* @template TGlobalState - The type of the state of the custom reducer.\n* @template TAction - The type of the actions of the custom reducer.\n* @param state - The current state of the document.\n* @param action - The action object to apply to the state.\n* @param customReducer - The custom reducer that implements the application logic\n* specific to the document's state.\n* @returns The new state of the document.\n*/\nfunction baseReducer(document, action, customReducer, dispatch, options = {}) {\n\tconst { skip, ignoreSkipOperations = false, reuseOperationResultingState = false, operationResultingStateParser, pruneOnSkip = true, branch = \"main\" } = options;\n\tlet _action = actionFromAction(action);\n\tlet skipValue = skip ?? options.replayOptions?.operation.skip ?? 0;\n\tlet newDocument = { ...document };\n\tlet reuseLastOperationIndex = false;\n\tconst shouldProcessSkipOperation = !ignoreSkipOperations && skipValue > 0;\n\tif (isUndoRedo(_action)) {\n\t\tconst { skip: calculatedSkip, action: transformedAction, document: processedDocument, reuseLastOperationIndex: reuseIndex } = processUndoRedo(document, _action, skipValue, options.protocolVersion ?? 1);\n\t\t_action = transformedAction;\n\t\tskipValue = calculatedSkip;\n\t\tnewDocument = processedDocument;\n\t\treuseLastOperationIndex = reuseIndex;\n\t} else newDocument = {\n\t\t...newDocument,\n\t\tclipboard: []\n\t};\n\tif (isDocumentAction(_action)) newDocument = _baseReducer(newDocument, _action, customReducer);\n\tconst operationContext = {\n\t\tdocumentId: document.header.id,\n\t\tscope: _action.scope,\n\t\tbranch\n\t};\n\tnewDocument = updateDocument(newDocument, _action, reuseLastOperationIndex, skipValue, operationContext, options.replayOptions?.operation, options.skipIndexValidation);\n\tconst protocolVersion = options.protocolVersion ?? 1;\n\tif (isUndo(action) && protocolVersion < 2) return processUndoOperation(newDocument, action.scope, customReducer);\n\tconst isNoopWithSkip = _action.type === \"NOOP\" && skipValue > 0;\n\tif ((isUndo(action) || isNoopWithSkip) && protocolVersion >= 2) {\n\t\tconst scope = _action.scope;\n\t\tconst opsToReplay = garbageCollectV2(sortOperations([...newDocument.operations[scope] || []])).filter((op) => op.action.type !== \"NOOP\");\n\t\tconst replayOps = {\n\t\t\t...newDocument.operations,\n\t\t\t[scope]: opsToReplay\n\t\t};\n\t\treturn {\n\t\t\t...replayOperations(newDocument.initialState, replayOps, customReducer, newDocument.header, dispatch, baseReducer, {}, { skipIndexValidation: true }),\n\t\t\toperations: newDocument.operations,\n\t\t\tclipboard: []\n\t\t};\n\t}\n\tif (shouldProcessSkipOperation) {\n\t\tconst processed = processSkipOperation(newDocument, _action, customReducer, skipValue, reuseOperationResultingState, operationResultingStateParser);\n\t\tif (!pruneOnSkip) newDocument = {\n\t\t\t...processed,\n\t\t\toperations: newDocument.operations\n\t\t};\n\t\telse newDocument = processed;\n\t}\n\tnewDocument = create(newDocument, (draft) => {\n\t\ttry {\n\t\t\tconst newState = customReducer(draft.state, _action, dispatch);\n\t\t\tif (newState) unsafe(() => {\n\t\t\t\tdraft.state = castDraft(newState);\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconst actionScopeOps = newDocument.operations[_action.scope];\n\t\t\tif (!actionScopeOps) throw new Error(`No operations found for scope: ${_action.scope}`);\n\t\t\tconst lastOperationIndex = actionScopeOps.length - 1;\n\t\t\tconst draftScopeOps = draft.operations[_action.scope];\n\t\t\tif (!draftScopeOps) throw new Error(`No operations found in draft for scope: ${_action.scope}`);\n\t\t\tdraftScopeOps[lastOperationIndex].error = error.message;\n\t\t\tdraftScopeOps[lastOperationIndex].skip = 0;\n\t\t\tif (shouldProcessSkipOperation) {\n\t\t\t\tdraft.state = castDraft({ ...document.state });\n\t\t\t\tconst documentScopeOps = document.operations[_action.scope];\n\t\t\t\tif (!documentScopeOps) throw new Error(`No operations found for scope: ${_action.scope}`);\n\t\t\t\tdraft.operations = castDraft({\n\t\t\t\t\t...document.operations,\n\t\t\t\t\t[_action.scope]: [...documentScopeOps, { ...draftScopeOps[lastOperationIndex] }]\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t});\n\tif ([\n\t\t\"UNDO\",\n\t\t\"REDO\",\n\t\t\"PRUNE\"\n\t].includes(_action.type)) return newDocument;\n\tconst scope = _action.scope || \"global\";\n\tlet hash = hashDocumentStateForScope(newDocument, scope);\n\tif (options.replayOptions?.operation.hash && options.replayOptions.operation.hash !== \"\") hash = options.replayOptions.operation.hash;\n\tconst lastOperation = newDocument.operations[scope]?.at(-1);\n\tif (lastOperation) {\n\t\tlastOperation.hash = hash;\n\t\tif (reuseOperationResultingState) lastOperation.resultingState = JSON.stringify(newDocument.state[scope]);\n\t}\n\treturn newDocument;\n}\n/**\n* Helper function to create a document model reducer.\n*\n* @remarks\n* This function creates a new reducer that wraps the provided `reducer` with\n* `documentReducer`, adding support for document actions:\n* - `SET_NAME`\n* - `UNDO`\n* - `REDO`\n* - `PRUNE`\n*\n* It also updates the document-related attributes on every operation.\n*\n* @param reducer - The custom reducer to wrap.\n* @param documentReducer - The document reducer to use.\n*\n* @returns The new reducer.\n*/\nfunction createReducer(stateReducer, documentReducer = baseReducer) {\n\tconst reducer = (document, action, dispatch, options) => {\n\t\treturn documentReducer(document, action, stateReducer, dispatch, options);\n\t};\n\treturn reducer;\n}\nfunction pruneOperation(document, input, wrappedReducer) {\n\tconst operations = document.operations.global;\n\tif (!operations) throw new Error(\"No global operations found\");\n\tlet { start, end } = input;\n\tstart = start || 0;\n\tend = end || operations.length;\n\tconst actionsToPrune = operations.slice(start, end);\n\tconst actionsToKeepStart = operations.slice(0, start);\n\tconst actionsToKeepEnd = operations.slice(end);\n\tconst newDocument = replayOperations(document.initialState, {\n\t\t...document.operations,\n\t\tglobal: actionsToKeepStart.concat(actionsToPrune)\n\t}, wrappedReducer, document.header);\n\tconst newState = newDocument.state;\n\tconst name = newDocument.header.name;\n\tconst loadStateIndex = actionsToKeepStart.length;\n\tconst loadStateTimestamp = actionsToKeepStart.length ? actionsToKeepStart[actionsToKeepStart.length - 1].timestampUtcMs : actionsToKeepEnd.length ? actionsToKeepEnd[0].timestampUtcMs : (/* @__PURE__ */ new Date()).toISOString();\n\tconst action = loadState({\n\t\tname,\n\t\t...newState\n\t}, actionsToPrune.length);\n\treturn replayOperations(document.initialState, {\n\t\t...document.operations,\n\t\tglobal: [\n\t\t\t...actionsToKeepStart,\n\t\t\t{\n\t\t\t\tskip: 0,\n\t\t\t\t...action,\n\t\t\t\taction,\n\t\t\t\ttimestampUtcMs: loadStateTimestamp,\n\t\t\t\tindex: loadStateIndex,\n\t\t\t\thash: hashDocumentStateForScope({ state: newState }, \"global\")\n\t\t\t},\n\t\t\t...actionsToKeepEnd.map((action, index) => ({\n\t\t\t\t...action,\n\t\t\t\tindex: loadStateIndex + index + 1\n\t\t\t}))\n\t\t]\n\t}, wrappedReducer, document.header);\n}\n//#endregion\n//#region document-model/validation.ts\n/**\n* Reserved operation names from base reducer (core/actions.ts).\n* These names cannot be used for custom operations.\n*/\nconst RESERVED_OPERATION_NAMES = [\n\t\"UNDO\",\n\t\"REDO\",\n\t\"PRUNE\",\n\t\"LOAD_STATE\",\n\t\"SET_NAME\",\n\t\"NOOP\"\n];\n/**\n* Check if name conflicts with base reducer actions (case-insensitive).\n*/\nfunction isReservedOperationName(name) {\n\treturn RESERVED_OPERATION_NAMES.includes(name.toUpperCase());\n}\n/**\n* Get all operation names from all modules in the latest specification.\n* Returns names in uppercase for case-insensitive comparison.\n*/\nfunction getAllOperationNames(state, excludeOperationId) {\n\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\tif (!latestSpec) return [];\n\tconst names = [];\n\tfor (const module of latestSpec.modules) for (const operation of module.operations) {\n\t\tif (excludeOperationId && operation.id === excludeOperationId) continue;\n\t\tif (operation.name) names.push(operation.name.toUpperCase());\n\t}\n\treturn names;\n}\n/**\n* Validate operation name is not reserved or duplicate. Throws on failure.\n*\n* @param name - The operation name to validate\n* @param state - The document model global state\n* @param excludeOperationId - Optional operation ID to exclude (for rename validation)\n* @throws Error if the name is reserved or a duplicate\n*/\nfunction validateOperationName(name, state, excludeOperationId) {\n\tif (!name) return;\n\tconst upperName = name.toUpperCase();\n\tif (isReservedOperationName(name)) throw new Error(`Operation name \"${name}\" is reserved. Please use a different name.`);\n\tif (getAllOperationNames(state, excludeOperationId).includes(upperName)) throw new Error(`Operation name \"${name}\" is already used by another operation. Operation names must be unique across all modules.`);\n}\nfunction validateInitialState(initialState, allowEmptyState = false) {\n\tconst errors = [];\n\tif (allowEmptyState && initialState === \"\") return errors;\n\ttry {\n\t\tconst state = JSON.parse(initialState);\n\t\tif (!allowEmptyState && !Object.keys(state).length) errors.push({\n\t\t\tmessage: \"Initial state cannot be empty\",\n\t\t\tdetails: { initialState }\n\t\t});\n\t} catch {\n\t\terrors.push({\n\t\t\tmessage: \"Invalid initial state\",\n\t\t\tdetails: { initialState }\n\t\t});\n\t}\n\treturn errors;\n}\nfunction validateStateSchemaName(schema, documentName, scope = \"\", allowEmptySchema = true) {\n\tconst errors = [];\n\tif (!allowEmptySchema && !schema) {\n\t\terrors.push({\n\t\t\tmessage: \"State schema is required\",\n\t\t\tdetails: { schema }\n\t\t});\n\t\treturn errors;\n\t}\n\tif (allowEmptySchema && !schema) return errors;\n\tconst expectedTypeName = `${pascalCase(documentName)}${pascalCase(scope)}State`;\n\tif (!new RegExp(`\\\\btype\\\\s+${expectedTypeName}(?:\\\\s|\\\\{|@|$)`).test(schema)) errors.push({\n\t\tmessage: `Invalid state schema name. Expected type ${expectedTypeName}`,\n\t\tdetails: { schema }\n\t});\n\treturn errors;\n}\nfunction validateModules(modules) {\n\tconst errors = [];\n\tif (!modules.length) errors.push({\n\t\tmessage: \"Modules are required\",\n\t\tdetails: { modules }\n\t});\n\tconst modulesError = modules.reduce((acc, mod) => [...acc, ...validateModule(mod)], []);\n\treturn [...errors, ...modulesError];\n}\nfunction validateModule(mod) {\n\tconst errors = [];\n\tif (!mod.name) errors.push({\n\t\tmessage: \"Module name is required\",\n\t\tdetails: { module: mod }\n\t});\n\tif (!mod.operations.length) errors.push({\n\t\tmessage: \"Module operations are required\",\n\t\tdetails: { module: mod }\n\t});\n\tconst operationErrors = mod.operations.reduce((acc, operation) => [...acc, ...validateModuleOperation(operation)], []);\n\treturn [...errors, ...operationErrors];\n}\nfunction validateModuleOperation(operation) {\n\tconst errors = [];\n\tif (!operation.name) errors.push({\n\t\tmessage: \"Operation name is required\",\n\t\tdetails: { operation }\n\t});\n\tif (!operation.schema) errors.push({\n\t\tmessage: \"Operation schema is required\",\n\t\tdetails: { operation }\n\t});\n\treturn errors;\n}\nfunction validateOperations(operations) {\n\tconst errors = [];\n\tconst scopes = Object.keys(operations);\n\tfor (const scope of scopes) {\n\t\tconst scopeOperations = operations[scope];\n\t\tif (!scopeOperations) continue;\n\t\tconst ops = scopeOperations.sort((a, b) => a.index - b.index);\n\t\tlet opIndex = -1;\n\t\tfor (let i = 0; i < ops.length; i++) {\n\t\t\topIndex = opIndex + 1 + ops[i].skip;\n\t\t\tif (ops[i].index !== opIndex) errors.push({\n\t\t\t\tmessage: `Invalid operation index ${ops[i].index} at position ${i}`,\n\t\t\t\tdetails: {\n\t\t\t\t\tposition: i,\n\t\t\t\t\toperation: ops[i],\n\t\t\t\t\tscope: ops[i].action.scope\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\treturn errors;\n}\n//#endregion\n//#region document-model/reducers.ts\nfunction sorter(order) {\n\tconst mapping = {};\n\torder.forEach((key, index) => mapping[key] = index);\n\treturn (a, b) => (mapping[b.id] || 999999) - (mapping[a.id] || 999999);\n}\nconst documentModelHeaderReducer = {\n\tsetModelNameOperation(state, action) {\n\t\tstate.name = action.input.name;\n\t},\n\tsetModelIdOperation(state, action) {\n\t\tstate.id = action.input.id;\n\t},\n\tsetModelExtensionOperation(state, action) {\n\t\tstate.extension = action.input.extension;\n\t},\n\tsetModelDescriptionOperation(state, action) {\n\t\tstate.description = action.input.description;\n\t},\n\tsetAuthorNameOperation(state, action) {\n\t\tstate.author = state.author || {\n\t\t\tname: \"\",\n\t\t\twebsite: null\n\t\t};\n\t\tstate.author.name = action.input.authorName;\n\t},\n\tsetAuthorWebsiteOperation(state, action) {\n\t\tstate.author = state.author || {\n\t\t\tname: \"\",\n\t\t\twebsite: null\n\t\t};\n\t\tstate.author.website = action.input.authorWebsite;\n\t}\n};\nconst documentModelModuleReducer = {\n\taddModuleOperation(state, action) {\n\t\tstate.specifications[state.specifications.length - 1].modules.push({\n\t\t\tid: action.input.id,\n\t\t\tname: action.input.name,\n\t\t\tdescription: action.input.description || \"\",\n\t\t\toperations: []\n\t\t});\n\t},\n\tsetModuleNameOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) if (latestSpec.modules[i].id === action.input.id) latestSpec.modules[i].name = action.input.name || \"\";\n\t},\n\tsetModuleDescriptionOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) if (latestSpec.modules[i].id === action.input.id) latestSpec.modules[i].description = action.input.description || \"\";\n\t},\n\tdeleteModuleOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tlatestSpec.modules = latestSpec.modules.filter((m) => m.id != action.input.id);\n\t},\n\treorderModulesOperation(state, action) {\n\t\tstate.specifications[state.specifications.length - 1].modules.sort(sorter(action.input.order));\n\t}\n};\nconst documentModelOperationErrorReducer = {\n\taddOperationErrorOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) if (latestSpec.modules[i].operations[j].id == action.input.operationId) latestSpec.modules[i].operations[j].errors.push({\n\t\t\tid: action.input.id,\n\t\t\tname: action.input.errorName || \"\",\n\t\t\tcode: action.input.errorCode || \"\",\n\t\t\tdescription: action.input.errorDescription || \"\",\n\t\t\ttemplate: action.input.errorTemplate || \"\"\n\t\t});\n\t},\n\tsetOperationErrorCodeOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) for (let k = 0; k < latestSpec.modules[i].operations[j].errors.length; k++) if (latestSpec.modules[i].operations[j].errors[k].id == action.input.id) latestSpec.modules[i].operations[j].errors[k].code = action.input.errorCode || \"\";\n\t},\n\tsetOperationErrorNameOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) for (let k = 0; k < latestSpec.modules[i].operations[j].errors.length; k++) if (latestSpec.modules[i].operations[j].errors[k].id == action.input.id) latestSpec.modules[i].operations[j].errors[k].name = action.input.errorName || \"\";\n\t},\n\tsetOperationErrorDescriptionOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) for (let k = 0; k < latestSpec.modules[i].operations[j].errors.length; k++) if (latestSpec.modules[i].operations[j].errors[k].id == action.input.id) latestSpec.modules[i].operations[j].errors[k].description = action.input.errorDescription || \"\";\n\t},\n\tsetOperationErrorTemplateOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) for (let k = 0; k < latestSpec.modules[i].operations[j].errors.length; k++) if (latestSpec.modules[i].operations[j].errors[k].id == action.input.id) latestSpec.modules[i].operations[j].errors[k].template = action.input.errorTemplate || \"\";\n\t},\n\tdeleteOperationErrorOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) latestSpec.modules[i].operations[j].errors = latestSpec.modules[i].operations[j].errors.filter((e) => e.id != action.input.id);\n\t},\n\treorderOperationErrorsOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) if (latestSpec.modules[i].operations[j].id == action.input.operationId) latestSpec.modules[i].operations[j].errors.sort(sorter(action.input.order));\n\t}\n};\nconst documentModelOperationExampleReducer = {\n\taddOperationExampleOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) if (latestSpec.modules[i].operations[j].id == action.input.operationId) latestSpec.modules[i].operations[j].examples.push({\n\t\t\tid: action.input.id,\n\t\t\tvalue: action.input.example\n\t\t});\n\t},\n\tupdateOperationExampleOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) for (let k = 0; k < latestSpec.modules[i].operations[j].examples.length; k++) if (latestSpec.modules[i].operations[j].examples[k].id == action.input.id) latestSpec.modules[i].operations[j].examples[k].value = action.input.example;\n\t},\n\tdeleteOperationExampleOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) latestSpec.modules[i].operations[j].examples = latestSpec.modules[i].operations[j].examples.filter((e) => e.id != action.input.id);\n\t},\n\treorderOperationExamplesOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) if (latestSpec.modules[i].operations[j].id == action.input.operationId) latestSpec.modules[i].operations[j].examples.sort(sorter(action.input.order));\n\t}\n};\nconst documentModelOperationReducer = {\n\taddOperationOperation(state, action) {\n\t\tvalidateOperationName(action.input.name, state);\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) if (latestSpec.modules[i].id == action.input.moduleId) latestSpec.modules[i].operations.push({\n\t\t\tid: action.input.id,\n\t\t\tname: action.input.name,\n\t\t\tdescription: action.input.description || \"\",\n\t\t\tschema: action.input.schema || \"\",\n\t\t\ttemplate: action.input.template || action.input.description || \"\",\n\t\t\treducer: action.input.reducer || \"\",\n\t\t\terrors: [],\n\t\t\texamples: [],\n\t\t\tscope: action.input.scope || \"global\"\n\t\t});\n\t},\n\tsetOperationNameOperation(state, action) {\n\t\tif (action.input.name) validateOperationName(action.input.name, state, action.input.id);\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) if (latestSpec.modules[i].operations[j].id == action.input.id) latestSpec.modules[i].operations[j].name = action.input.name || \"\";\n\t},\n\tsetOperationScopeOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) if (latestSpec.modules[i].operations[j].id == action.input.id) latestSpec.modules[i].operations[j].scope = action.input.scope || \"global\";\n\t},\n\tsetOperationSchemaOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) if (latestSpec.modules[i].operations[j].id == action.input.id) latestSpec.modules[i].operations[j].schema = action.input.schema || \"\";\n\t},\n\tsetOperationDescriptionOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) if (latestSpec.modules[i].operations[j].id == action.input.id) latestSpec.modules[i].operations[j].description = action.input.description || \"\";\n\t},\n\tsetOperationTemplateOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) if (latestSpec.modules[i].operations[j].id == action.input.id) latestSpec.modules[i].operations[j].template = action.input.template || \"\";\n\t},\n\tsetOperationReducerOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) if (latestSpec.modules[i].operations[j].id == action.input.id) latestSpec.modules[i].operations[j].reducer = action.input.reducer || \"\";\n\t},\n\tmoveOperationOperation(state, action) {\n\t\tconst moveOperations = [];\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) latestSpec.modules[i].operations = latestSpec.modules[i].operations.filter((operation) => {\n\t\t\tif (operation.id == action.input.operationId) {\n\t\t\t\tmoveOperations.push(operation);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t});\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) if (latestSpec.modules[i].id == action.input.newModuleId) latestSpec.modules[i].operations.push(...moveOperations);\n\t},\n\tdeleteOperationOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) latestSpec.modules[i].operations = latestSpec.modules[i].operations.filter((operation) => operation.id != action.input.id);\n\t},\n\treorderModuleOperationsOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) if (latestSpec.modules[i].id == action.input.moduleId) latestSpec.modules[i].operations.sort(sorter(action.input.order));\n\t}\n};\nconst documentModelStateSchemaReducer = {\n\tsetStateSchemaOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (Object.keys(latestSpec.state).includes(action.input.scope)) latestSpec.state[action.input.scope].schema = action.input.schema;\n\t\telse throw new Error(`Invalid scope: ${action.input.scope}`);\n\t},\n\tsetInitialStateOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (Object.keys(latestSpec.state).includes(action.input.scope)) latestSpec.state[action.input.scope].initialValue = action.input.initialValue;\n\t\telse throw new Error(`Invalid scope: ${action.input.scope}`);\n\t},\n\taddStateExampleOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (Object.keys(latestSpec.state).includes(action.input.scope)) latestSpec.state[action.input.scope].examples.push({\n\t\t\tid: action.input.id,\n\t\t\tvalue: action.input.example\n\t\t});\n\t\telse throw new Error(`Invalid scope: ${action.input.scope}`);\n\t},\n\tupdateStateExampleOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (!Object.keys(latestSpec.state).includes(action.input.scope)) throw new Error(`Invalid scope: ${action.input.scope}`);\n\t\tconst examples = latestSpec.state[action.input.scope].examples;\n\t\tfor (let i = 0; i < examples.length; i++) if (examples[i].id == action.input.id) examples[i].value = action.input.newExample;\n\t},\n\tdeleteStateExampleOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (Object.keys(latestSpec.state).includes(action.input.scope)) latestSpec.state[action.input.scope].examples = latestSpec.state[action.input.scope].examples.filter((e) => e.id != action.input.id);\n\t\telse throw new Error(`Invalid scope: ${action.input.scope}`);\n\t},\n\treorderStateExamplesOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (Object.keys(latestSpec.state).includes(action.input.scope)) latestSpec.state[action.input.scope].examples.sort(sorter(action.input.order));\n\t\telse throw new Error(`Invalid scope: ${action.input.scope}`);\n\t}\n};\nconst documentModelVersioningReducer = {\n\taddChangeLogItemOperation(state, action) {\n\t\tthrow new Error(\"Reducer \\\"addChangeLogItemOperation\\\" not yet implemented\");\n\t},\n\tupdateChangeLogItemOperation(state, action) {\n\t\tthrow new Error(\"Reducer \\\"updateChangeLogItemOperation\\\" not yet implemented\");\n\t},\n\tdeleteChangeLogItemOperation(state, action) {\n\t\tthrow new Error(\"Reducer \\\"deleteChangeLogItemOperation\\\" not yet implemented\");\n\t},\n\treorderChangeLogItemsOperation(state, action) {\n\t\tthrow new Error(\"Reducer \\\"reorderChangeLogItemsOperation\\\" not yet implemented\");\n\t},\n\treleaseNewVersionOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tconst copiedModules = latestSpec.modules.map((module) => ({\n\t\t\t...module,\n\t\t\toperations: module.operations.map((op) => ({\n\t\t\t\t...op,\n\t\t\t\terrors: op.errors.map((err) => ({ ...err })),\n\t\t\t\texamples: op.examples.map((ex) => ({ ...ex }))\n\t\t\t}))\n\t\t}));\n\t\tconst copiedState = {\n\t\t\tglobal: {\n\t\t\t\t...latestSpec.state.global,\n\t\t\t\texamples: latestSpec.state.global.examples.map((ex) => ({ ...ex }))\n\t\t\t},\n\t\t\tlocal: {\n\t\t\t\t...latestSpec.state.local,\n\t\t\t\texamples: latestSpec.state.local.examples.map((ex) => ({ ...ex }))\n\t\t\t}\n\t\t};\n\t\tconst newSpec = {\n\t\t\tversion: latestSpec.version + 1,\n\t\t\tchangeLog: [],\n\t\t\tstate: copiedState,\n\t\t\tmodules: copiedModules\n\t\t};\n\t\tstate.specifications.push(newSpec);\n\t}\n};\nconst documentModelStateReducer = (state, action) => {\n\tif (isDocumentAction(action)) return state;\n\tswitch (action.type) {\n\t\tcase \"SET_MODEL_NAME\":\n\t\t\tSetModelNameInputSchema().parse(action.input);\n\t\t\tdocumentModelHeaderReducer.setModelNameOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_MODEL_ID\":\n\t\t\tSetModelIdInputSchema().parse(action.input);\n\t\t\tdocumentModelHeaderReducer.setModelIdOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_MODEL_EXTENSION\":\n\t\t\tSetModelExtensionInputSchema().parse(action.input);\n\t\t\tdocumentModelHeaderReducer.setModelExtensionOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_MODEL_DESCRIPTION\":\n\t\t\tSetModelDescriptionInputSchema().parse(action.input);\n\t\t\tdocumentModelHeaderReducer.setModelDescriptionOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_AUTHOR_NAME\":\n\t\t\tSetAuthorNameInputSchema().parse(action.input);\n\t\t\tdocumentModelHeaderReducer.setAuthorNameOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_AUTHOR_WEBSITE\":\n\t\t\tSetAuthorWebsiteInputSchema().parse(action.input);\n\t\t\tdocumentModelHeaderReducer.setAuthorWebsiteOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"ADD_CHANGE_LOG_ITEM\":\n\t\t\tAddChangeLogItemInputSchema().parse(action.input);\n\t\t\tdocumentModelVersioningReducer.addChangeLogItemOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"UPDATE_CHANGE_LOG_ITEM\":\n\t\t\tUpdateChangeLogItemInputSchema().parse(action.input);\n\t\t\tdocumentModelVersioningReducer.updateChangeLogItemOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"DELETE_CHANGE_LOG_ITEM\":\n\t\t\tDeleteChangeLogItemInputSchema().parse(action.input);\n\t\t\tdocumentModelVersioningReducer.deleteChangeLogItemOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"REORDER_CHANGE_LOG_ITEMS\":\n\t\t\tReorderChangeLogItemsInputSchema().parse(action.input);\n\t\t\tdocumentModelVersioningReducer.reorderChangeLogItemsOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"RELEASE_NEW_VERSION\":\n\t\t\tif (Object.keys(action.input).length > 0) throw new Error(\"Expected empty input for action RELEASE_NEW_VERSION\");\n\t\t\tdocumentModelVersioningReducer.releaseNewVersionOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"ADD_MODULE\":\n\t\t\tAddModuleInputSchema().parse(action.input);\n\t\t\tdocumentModelModuleReducer.addModuleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_MODULE_NAME\":\n\t\t\tSetModuleNameInputSchema().parse(action.input);\n\t\t\tdocumentModelModuleReducer.setModuleNameOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_MODULE_DESCRIPTION\":\n\t\t\tSetModuleDescriptionInputSchema().parse(action.input);\n\t\t\tdocumentModelModuleReducer.setModuleDescriptionOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"DELETE_MODULE\":\n\t\t\tDeleteModuleInputSchema().parse(action.input);\n\t\t\tdocumentModelModuleReducer.deleteModuleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"REORDER_MODULES\":\n\t\t\tReorderModulesInputSchema().parse(action.input);\n\t\t\tdocumentModelModuleReducer.reorderModulesOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"ADD_OPERATION_ERROR\":\n\t\t\tAddOperationErrorInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.addOperationErrorOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_ERROR_CODE\":\n\t\t\tSetOperationErrorCodeInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.setOperationErrorCodeOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_ERROR_NAME\":\n\t\t\tSetOperationErrorNameInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.setOperationErrorNameOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_ERROR_DESCRIPTION\":\n\t\t\tSetOperationErrorDescriptionInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.setOperationErrorDescriptionOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_ERROR_TEMPLATE\":\n\t\t\tSetOperationErrorTemplateInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.setOperationErrorTemplateOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"DELETE_OPERATION_ERROR\":\n\t\t\tDeleteOperationErrorInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.deleteOperationErrorOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"REORDER_OPERATION_ERRORS\":\n\t\t\tReorderOperationErrorsInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.reorderOperationErrorsOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"ADD_OPERATION_EXAMPLE\":\n\t\t\tAddOperationExampleInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationExampleReducer.addOperationExampleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"UPDATE_OPERATION_EXAMPLE\":\n\t\t\tUpdateOperationExampleInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationExampleReducer.updateOperationExampleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"DELETE_OPERATION_EXAMPLE\":\n\t\t\tDeleteOperationExampleInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationExampleReducer.deleteOperationExampleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"REORDER_OPERATION_EXAMPLES\":\n\t\t\tReorderOperationExamplesInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationExampleReducer.reorderOperationExamplesOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"ADD_OPERATION\":\n\t\t\tAddOperationInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.addOperationOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_NAME\":\n\t\t\tSetOperationNameInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.setOperationNameOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_SCOPE\":\n\t\t\tSetOperationScopeInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.setOperationScopeOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_SCHEMA\":\n\t\t\tSetOperationSchemaInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.setOperationSchemaOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_DESCRIPTION\":\n\t\t\tSetOperationDescriptionInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.setOperationDescriptionOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_TEMPLATE\":\n\t\t\tSetOperationTemplateInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.setOperationTemplateOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_REDUCER\":\n\t\t\tSetOperationReducerInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.setOperationReducerOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"MOVE_OPERATION\":\n\t\t\tMoveOperationInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.moveOperationOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"DELETE_OPERATION\":\n\t\t\tDeleteOperationInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.deleteOperationOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"REORDER_MODULE_OPERATIONS\":\n\t\t\tReorderModuleOperationsInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.reorderModuleOperationsOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_STATE_SCHEMA\":\n\t\t\tSetStateSchemaInputSchema().parse(action.input);\n\t\t\tdocumentModelStateSchemaReducer.setStateSchemaOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_INITIAL_STATE\":\n\t\t\tSetInitialStateInputSchema().parse(action.input);\n\t\t\tdocumentModelStateSchemaReducer.setInitialStateOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"ADD_STATE_EXAMPLE\":\n\t\t\tAddStateExampleInputSchema().parse(action.input);\n\t\t\tdocumentModelStateSchemaReducer.addStateExampleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"UPDATE_STATE_EXAMPLE\":\n\t\t\tUpdateStateExampleInputSchema().parse(action.input);\n\t\t\tdocumentModelStateSchemaReducer.updateStateExampleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"DELETE_STATE_EXAMPLE\":\n\t\t\tDeleteStateExampleInputSchema().parse(action.input);\n\t\t\tdocumentModelStateSchemaReducer.deleteStateExampleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"REORDER_STATE_EXAMPLES\":\n\t\t\tReorderStateExamplesInputSchema().parse(action.input);\n\t\t\tdocumentModelStateSchemaReducer.reorderStateExamplesOperation(state.global, action);\n\t\t\tbreak;\n\t\tdefault: return state;\n\t}\n};\nconst documentModelReducer = createReducer(documentModelStateReducer);\n//#endregion\n//#region document-model/files.ts\nconst NON_DOMAIN_SCOPES = new Set([\"auth\", \"document\"]);\nasync function loadJSZip() {\n\tconst { default: JSZip } = await import(\"jszip\");\n\treturn JSZip;\n}\nasync function createZip(document) {\n\tconst zip = new (await (loadJSZip()))();\n\tconst header = document.header;\n\tzip.file(\"header.json\", JSON.stringify(header, null, 2));\n\tzip.file(\"state.json\", JSON.stringify(document.initialState || {}, null, 2));\n\tzip.file(\"current-state.json\", JSON.stringify(document.state || {}, null, 2));\n\tzip.file(\"operations.json\", JSON.stringify(filterDocumentOperationsResultingState(document.operations), null, 2));\n\treturn zip;\n}\n/**\n* Creates a minimal ZIP backup from strand data.\n* Used when the full document is not available (e.g., in onOperations handler).\n* Creates a ZIP with minimal header and empty operations.\n*/\nasync function createMinimalZip(data) {\n\tconst JSZip = await loadJSZip();\n\tconst now = (/* @__PURE__ */ new Date()).toISOString();\n\tconst header = {\n\t\tid: data.documentId,\n\t\tsig: {\n\t\t\tpublicKey: {},\n\t\t\tnonce: \"\"\n\t\t},\n\t\tdocumentType: data.documentType,\n\t\tcreatedAtUtcIso: now,\n\t\tslug: data.name,\n\t\tname: data.name,\n\t\tbranch: data.branch,\n\t\trevision: {},\n\t\tlastModifiedAtUtcIso: now\n\t};\n\tconst zip = new JSZip();\n\tzip.file(\"header.json\", JSON.stringify(header, null, 2));\n\tzip.file(\"state.json\", JSON.stringify(data.state, null, 2));\n\tzip.file(\"current-state.json\", JSON.stringify(data.state, null, 2));\n\tzip.file(\"operations.json\", JSON.stringify({}, null, 2));\n\treturn zip;\n}\nasync function baseSaveToFileHandle(document, input) {\n\tconst blob = await (await createZip(document)).generateAsync({ type: \"blob\" });\n\tconst writable = await input.createWritable();\n\tawait writable.write(blob);\n\tawait writable.close();\n}\nasync function loadFromZip(zip, reducer, options) {\n\tconst initialStateZip = zip.file(\"state.json\");\n\tif (!initialStateZip) throw new Error(\"Initial state not found\");\n\tconst initialStateStr = await initialStateZip.async(\"string\");\n\tconst initialState = JSON.parse(initialStateStr);\n\tconst headerZip = zip.file(\"header.json\");\n\tif (!headerZip) throw new Error(\"Document header not found - file format may be outdated\");\n\tconst header = JSON.parse(await headerZip.async(\"string\"));\n\tconst operationsZip = zip.file(\"operations.json\");\n\tif (!operationsZip) throw new Error(\"Operations history not found\");\n\tconst clearedOperations = garbageCollectDocumentOperations(JSON.parse(await operationsZip.async(\"string\")));\n\tconst operationsError = validateOperations(clearedOperations);\n\tif (operationsError.length) {\n\t\tconst errorMessages = operationsError.map((err) => err.message);\n\t\tthrow new Error(errorMessages.join(\"\\n\"));\n\t}\n\treturn {\n\t\t...replayDocument(initialState, Object.fromEntries(Object.entries(clearedOperations).filter(([scope]) => !NON_DOMAIN_SCOPES.has(scope))), reducer, header, void 0, {}, options),\n\t\toperations: clearedOperations\n\t};\n}\nasync function baseLoadFromInput(input, reducer, options) {\n\tconst zip = new (await (loadJSZip()))();\n\tawait zip.loadAsync(input);\n\treturn loadFromZip(zip, reducer, options);\n}\nconst documentModelLoadFromInput = (input) => {\n\treturn baseLoadFromInput(input, documentModelReducer);\n};\nconst documentModelSaveToFileHandle = (document, input) => {\n\treturn baseSaveToFileHandle(document, input);\n};\nfunction writeFileBrowser(path, name, stream) {\n\tthrow FileSystemError;\n}\nfunction readFileBrowser(path) {\n\tthrow FileSystemError;\n}\nfunction fetchFileBrowser(url) {\n\tthrow FileSystemError;\n}\nconst getFileBrowser = async (file) => {\n\treturn readFileBrowser(file);\n};\n//#endregion\n//#region document-model/state.ts\n/**\n* Creates a default PHAuthState\n*/\nfunction defaultAuthState() {\n\treturn {};\n}\n/**\n* Creates a default PHDocumentState\n*/\nfunction defaultDocumentState() {\n\treturn {\n\t\tversion: 0,\n\t\thash: {\n\t\t\talgorithm: HASH_ALGORITHM_SHA1,\n\t\t\tencoding: HASH_ENCODING_BASE64\n\t\t}\n\t};\n}\n/**\n* Creates a default PHBaseState with auth and document properties\n*/\nfunction defaultBaseState() {\n\treturn {\n\t\tauth: defaultAuthState(),\n\t\tdocument: defaultDocumentState()\n\t};\n}\n/**\n* Creates a PHAuthState with the given properties\n*/\nfunction createAuthState(auth) {\n\treturn {\n\t\t...defaultAuthState(),\n\t\t...auth\n\t};\n}\n/**\n* Creates a PHDocumentState with the given properties\n*/\nfunction createDocumentState(document) {\n\treturn {\n\t\t...defaultDocumentState(),\n\t\t...document\n\t};\n}\n/**\n* Creates a PHBaseState with the given auth and document properties\n*/\nfunction createBaseState(auth, document) {\n\treturn {\n\t\tauth: createAuthState(auth),\n\t\tdocument: createDocumentState(document)\n\t};\n}\nfunction defaultGlobalState() {\n\treturn {\n\t\t...defaultBaseState(),\n\t\tauthor: {\n\t\t\tname: \"\",\n\t\t\twebsite: \"\"\n\t\t},\n\t\tdescription: \"\",\n\t\textension: \"\",\n\t\tid: \"\",\n\t\tname: \"\",\n\t\tspecifications: []\n\t};\n}\nfunction defaultLocalState() {\n\treturn {};\n}\nfunction defaultPHState() {\n\treturn {\n\t\t...defaultBaseState(),\n\t\tglobal: defaultGlobalState(),\n\t\tlocal: defaultLocalState()\n\t};\n}\nfunction createGlobalState(state) {\n\treturn {\n\t\t...defaultGlobalState(),\n\t\t...state || {}\n\t};\n}\nfunction createLocalState(state) {\n\treturn {\n\t\t...defaultLocalState(),\n\t\t...state || {}\n\t};\n}\nfunction createState(baseState, globalState, localState) {\n\treturn {\n\t\t...createBaseState(baseState?.auth, baseState?.document),\n\t\tglobal: createGlobalState(globalState),\n\t\tlocal: createLocalState(localState)\n\t};\n}\n//#endregion\nexport { AddChangeLogItemInputSchema, AddModuleInputSchema, AddOperationErrorInputSchema, AddOperationExampleInputSchema, AddOperationInputSchema, AddStateExampleInputSchema, AuthorSchema, BaseDocumentHeaderSchema, BaseDocumentStateSchema, CodeExampleSchema, ConfigEntrySchema, ConfigEntryTypeSchema, DeleteChangeLogItemInputSchema, DeleteModuleInputSchema, DeleteOperationErrorInputSchema, DeleteOperationExampleInputSchema, DeleteOperationInputSchema, DeleteStateExampleInputSchema, DocumentActionSchema, DocumentFileSchema, DocumentModelGlobalStateSchema, DocumentModelHeaderSchema, DocumentModelInputSchema, DocumentModelPHStateSchema, DocumentModelSchema, DocumentSpecificationSchema, FileSystemError, HASH_ALGORITHM_SHA1, HASH_ALGORITHM_SHA256, HASH_ALGORITHM_SHA512, HASH_ENCODING_BASE64, HASH_ENCODING_HEX, HashMismatchError, IntegrityIssueSubType, IntegrityIssueType, InvalidActionInputError, InvalidActionInputZodError, LoadStateActionInputSchema, LoadStateActionSchema, LoadStateActionStateInputSchema, Load_StateSchema, ManifestSchema, ModuleSchema, MoveOperationInputSchema, OperationErrorSchema, OperationScopeSchema, OperationSpecificationSchema, PowerhouseModuleSchema, PowerhouseModulesSchema, PruneActionInputSchema, PruneActionSchema, PruneSchema, PublisherSchema, RESERVED_OPERATION_NAMES, RedoActionInputSchema, RedoActionSchema, RedoSchema, ReorderChangeLogItemsInputSchema, ReorderModuleOperationsInputSchema, ReorderModulesInputSchema, ReorderOperationErrorsInputSchema, ReorderOperationExamplesInputSchema, ReorderStateExamplesInputSchema, ScopeStateSchema, SetAuthorNameInputSchema, SetAuthorWebsiteInputSchema, SetInitialStateInputSchema, SetModelDescriptionInputSchema, SetModelExtensionInputSchema, SetModelIdInputSchema, SetModelNameInputSchema, SetModuleDescriptionInputSchema, SetModuleNameInputSchema, SetNameActionInputSchema, SetNameActionSchema, SetOperationDescriptionInputSchema, SetOperationErrorCodeInputSchema, SetOperationErrorDescriptionInputSchema, SetOperationErrorNameInputSchema, SetOperationErrorTemplateInputSchema, SetOperationNameInputSchema, SetOperationReducerInputSchema, SetOperationSchemaInputSchema, SetOperationScopeInputSchema, SetOperationTemplateInputSchema, SetStateSchemaInputSchema, Set_NameSchema, StateSchema, UndoActionInputSchema, UndoActionSchema, UndoSchema, UpdateChangeLogItemInputSchema, UpdateOperationExampleInputSchema, UpdateStateExampleInputSchema, ab2hex, actionContext, actionFromAction, actionSigner, actions, addChangeLogItem, addModule, addOperation, addOperationError, addOperationExample, addStateExample, addUndo, assertIsDocumentModelDocument, assertIsDocumentModelState, attachBranch, baseActions, baseCreateDocument, baseLoadFromInput, baseReducer, baseSaveToFileHandle, buildOperationSignature, buildOperationSignatureMessage, buildOperationSignatureParams, buildSignedAction, checkCleanedOperationsIntegrity, checkOperationsIntegrity, createAction, createAuthState, createBaseState, createDocumentState, createGlobalState, createLocalState, createMinimalZip, createPresignedHeader, createReducer, createSignedHeader, createSignedHeaderForSigner, createState, createVerificationSigner, createZip, defaultAuthState, defaultBaseState, defaultDocumentState, defaultGlobalState, defaultLocalState, defaultPHState, definedNonNullAnySchema, deleteChangeLogItem, deleteModule, deleteOperation, deleteOperationError, deleteOperationExample, deleteStateExample, deriveOperationId, diffOperations, documentModelActions, documentModelDocumentType, documentModelFileExtension, documentModelGlobalState, documentModelHeaderReducer, documentModelInitialGlobalState, documentModelInitialLocalState, documentModelLoadFromInput, documentModelModuleReducer, documentModelOperationErrorReducer, documentModelOperationExampleReducer, documentModelOperationReducer, documentModelReducer, documentModelSaveToFileHandle, documentModelStateReducer, documentModelStateSchemaReducer, documentModelVersioningReducer, fetchFileBrowser, filterDocumentOperationsResultingState, filterDuplicatedOperations, garbageCollect, garbageCollectDocumentOperations, garbageCollectV2, generateId, generateMock, getAllOperationNames, getDocumentLastModified, getFileBrowser, getUnixTimestamp, groupOperationsByScope, hashBrowser, hashDocumentStateForScope, hex2ab, isDefinedNonNullAny, isDocumentAction, isDocumentModelDocument, isDocumentModelState, isNoopOperation, isReservedOperationName, isUndo, isUndoRedo, loadState, loadStateOperation, mapSkippedOperations, mapSkippedOperationsV2, merge, moveOperation, nextSkipNumber, noop, operationExampleCreators, operationFromAction, operationFromOperation, operationWithContext, operationsAreEqual, parseResultingState, precedes, prepareOperations, processUndoRedo, prune, pruneOperation, readFileBrowser, readOnly, redo, redoOperation, releaseNewVersion, removeExistingOperations, reorderChangeLogItems, reorderModuleOperations, reorderModules, reorderOperationErrors, reorderOperationExamples, reorderStateExamples, replayDocument, replayOperations, reshuffleByTimestamp, reshuffleByTimestampAndIndex, setAuthorName, setAuthorWebsite, setInitialState, setModelDescription, setModelExtension, setModelId, setModelName, setModuleDescription, setModuleName, setName, setNameOperation, setOperationDescription, setOperationErrorCode, setOperationErrorDescription, setOperationErrorName, setOperationErrorTemplate, setOperationName, setOperationReducer, setOperationSchema, setOperationScope, setOperationTemplate, setStateSchema, sign, skipHeaderOperations, sortMappedOperations, sortOperations, split, undo, undoOperation, undoOperationV2, updateChangeLogItem, updateDocument, updateHeaderRevision, updateOperationExample, updateStateExample, validateHeader, validateInitialState, validateModule, validateModuleOperation, validateModules, validateOperationName, validateOperations, validateStateSchemaName, verify, verifyOperationSignature, writeFileBrowser };\n\n//# sourceMappingURL=index.js.map","import { actions, assertIsDocumentModelDocument, assertIsDocumentModelState, baseCreateDocument, createState, defaultBaseState, documentModelDocumentType, documentModelFileExtension, documentModelGlobalState, documentModelInitialGlobalState, documentModelInitialLocalState, documentModelLoadFromInput, documentModelReducer, documentModelSaveToFileHandle, isDocumentModelDocument, isDocumentModelState } from \"@powerhousedao/shared/document-model\";\nexport * from \"@powerhousedao/shared/document-model\";\n//#region src/state.ts\nconst isStateOfType = (state) => {\n\treturn isDocumentModelState(state);\n};\nconst assertIsStateOfType = (state) => {\n\tassertIsDocumentModelState(state);\n};\nconst isDocumentOfType = (document) => {\n\treturn isDocumentModelDocument(document);\n};\nconst assertIsDocumentOfType = (document) => {\n\tassertIsDocumentModelDocument(document);\n};\nconst documentModelCreateState = (state) => {\n\treturn {\n\t\t...defaultBaseState(),\n\t\tglobal: {\n\t\t\t...documentModelInitialGlobalState,\n\t\t\t...state?.global ?? {}\n\t\t},\n\t\tlocal: {\n\t\t\t...documentModelInitialLocalState,\n\t\t\t...state?.local ?? {}\n\t\t}\n\t};\n};\nfunction documentModelCreateDocument(state) {\n\tconst document = baseCreateDocument(documentModelCreateState, state);\n\tdocument.header.documentType = documentModelDocumentType;\n\treturn document;\n}\n//#endregion\n//#region src/module.ts\nconst utils = {\n\tfileExtension: documentModelFileExtension,\n\tcreateState: documentModelCreateState,\n\tcreateDocument: documentModelCreateDocument,\n\tloadFromInput: documentModelLoadFromInput,\n\tsaveToFileHandle: documentModelSaveToFileHandle,\n\tisStateOfType,\n\tassertIsStateOfType,\n\tisDocumentOfType,\n\tassertIsDocumentOfType\n};\nconst documentModelDocumentModelModule = {\n\treducer: documentModelReducer,\n\tdocumentModel: createState(defaultBaseState(), documentModelGlobalState),\n\tactions,\n\tutils\n};\n//#endregion\n//#region src/controller.ts\nvar PHDocumentController = class PHDocumentController {\n\tmodule;\n\t_document;\n\tlisteners = [];\n\tconstructor(module, initialDocument) {\n\t\tthis.module = module;\n\t\tthis._document = initialDocument ?? module.utils.createDocument();\n\t\tfor (const actionType in this.module.actions) Object.defineProperty(this, actionType, { value: (input) => {\n\t\t\tconst action = this.module.actions[actionType](input);\n\t\t\tthis._document = this.module.reducer(this._document, action);\n\t\t\tthis.notifyListeners();\n\t\t\treturn this;\n\t\t} });\n\t}\n\tget document() {\n\t\treturn this._document;\n\t}\n\tget header() {\n\t\treturn this.document.header;\n\t}\n\tget state() {\n\t\treturn this.document.state;\n\t}\n\tget initialState() {\n\t\treturn this.document.initialState;\n\t}\n\tget operations() {\n\t\treturn this.document.operations;\n\t}\n\tget clipboard() {\n\t\treturn this.document.clipboard;\n\t}\n\tonChange(listener) {\n\t\tthis.listeners.push(listener);\n\t\treturn () => {\n\t\t\tthis.listeners = this.listeners.filter((l) => l !== listener);\n\t\t};\n\t}\n\tnotifyListeners() {\n\t\tif (this.listeners.length === 0) return;\n\t\tconst event = { document: this._document };\n\t\tfor (const listener of this.listeners) listener(event);\n\t}\n\tstatic forDocumentModel(module) {\n\t\treturn class extends PHDocumentController {\n\t\t\tconstructor(initialDocument) {\n\t\t\t\tsuper(module, initialDocument);\n\t\t\t}\n\t\t};\n\t}\n};\nconst DocumentModelController = PHDocumentController.forDocumentModel(documentModelDocumentModelModule);\n//#endregion\n//#region src/logger.ts\nconst tokenSub = /@([a-zA-Z0-9_]+)/g;\nconst dtf = new Intl.DateTimeFormat(void 0, {\n\thour12: false,\n\thour: \"2-digit\",\n\tminute: \"2-digit\",\n\tsecond: \"2-digit\",\n\tfractionalSecondDigits: 2\n});\nconst formatMessage = (tagString, message, replacements) => {\n\tconst meta = {};\n\tconst uniqueTokens = [];\n\tlet results;\n\twhile ((results = tokenSub.exec(message)) !== null) {\n\t\tconst tokenName = results[1];\n\t\tif (uniqueTokens.indexOf(tokenName) === -1) {\n\t\t\tuniqueTokens.push(tokenName);\n\t\t\tmeta[tokenName] = replacements[uniqueTokens.length - 1];\n\t\t}\n\t}\n\tfor (const [key, value] of Object.entries(meta)) {\n\t\tlet stringValue;\n\t\tif (!value) stringValue = \"null\";\n\t\telse if (typeof value === \"string\") stringValue = value;\n\t\telse if (typeof value === \"object\") stringValue = JSON.stringify(value);\n\t\telse if (typeof value === \"function\") {\n\t\t\tconst name = value.name;\n\t\t\tstringValue = name ? `${name}()` : \"anonymous()\";\n\t\t} else stringValue = String(value);\n\t\tmessage = message.replaceAll(`@${key}`, stringValue);\n\t}\n\tif (tagString.length > 0) message = `${tagString} ${message}`;\n\tconst now = /* @__PURE__ */ new Date();\n\tmeta[\"timestamp\"] = dtf.format(now);\n\treturn [message, meta];\n};\nconst LOG_LEVELS = {\n\tverbose: 0,\n\tdebug: 1,\n\tinfo: 2,\n\twarn: 3,\n\terror: 4\n};\nvar ConsoleLogger = class ConsoleLogger {\n\t#tags;\n\t#tagString;\n\t#level = LOG_LEVELS.info;\n\terrorHandler;\n\tconstructor(tags, handler) {\n\t\tthis.#tags = tags || [];\n\t\tthis.#tagString = this.#tags.map((tag) => `[${tag}]`).join(\"\");\n\t\tthis.errorHandler = handler ?? (() => {});\n\t}\n\tget level() {\n\t\treturn Object.keys(LOG_LEVELS).find((key) => LOG_LEVELS[key] === this.#level);\n\t}\n\tset level(value) {\n\t\tthis.#level = LOG_LEVELS[value];\n\t}\n\tchild(tags) {\n\t\tconst logger = new ConsoleLogger([...this.#tags, ...tags], this.errorHandler);\n\t\tlogger.level = this.level;\n\t\treturn logger;\n\t}\n\tverbose(message, ...replacements) {\n\t\tif (this.#level <= LOG_LEVELS.verbose) {\n\t\t\tconst [formattedMessage, meta] = formatMessage(this.#tagString, message, replacements);\n\t\t\tconsole.debug(`[${meta[\"timestamp\"]}] ${formattedMessage}`);\n\t\t}\n\t}\n\tdebug(message, ...replacements) {\n\t\tif (this.#level <= LOG_LEVELS.debug) {\n\t\t\tconst [formattedMessage, meta] = formatMessage(this.#tagString, message, replacements);\n\t\t\tconsole.debug(`[${meta[\"timestamp\"]}] ${formattedMessage}`);\n\t\t}\n\t}\n\tinfo(message, ...replacements) {\n\t\tif (this.#level <= LOG_LEVELS.info) {\n\t\t\tconst [formattedMessage, meta] = formatMessage(this.#tagString, message, replacements);\n\t\t\tconsole.info(`[${meta[\"timestamp\"]}] ${formattedMessage}`);\n\t\t}\n\t}\n\twarn(message, ...replacements) {\n\t\tif (this.#level <= LOG_LEVELS.warn) {\n\t\t\tconst [formattedMessage, meta] = formatMessage(this.#tagString, message, replacements);\n\t\t\tconsole.warn(`[${meta[\"timestamp\"]}] ${formattedMessage}`);\n\t\t}\n\t}\n\terror(message, ...replacements) {\n\t\tif (this.#level <= LOG_LEVELS.error) {\n\t\t\tconst [formattedMessage, meta] = formatMessage(this.#tagString, message, replacements);\n\t\t\tconsole.error(`[${meta[\"timestamp\"]}] ${formattedMessage}`);\n\t\t}\n\t}\n};\nconst logger = new ConsoleLogger();\nconst setLogLevel = (level) => {\n\tlogger.level = level;\n};\nconst setErrorHandler = (handler) => {\n\tlogger.errorHandler = handler;\n};\nconst childLogger = (tags) => {\n\treturn logger.child(tags);\n};\n//#endregion\nexport { ConsoleLogger, DocumentModelController, PHDocumentController, assertIsDocumentOfType, assertIsStateOfType, childLogger, documentModelCreateDocument, documentModelCreateState, documentModelDocumentModelModule, isDocumentOfType, isStateOfType, logger, setErrorHandler, setLogLevel };\n\n//# sourceMappingURL=index.js.map","import { n as generateId } from \"../utils-bCWnsmtD.js\";\nimport { BaseDocumentHeaderSchema, BaseDocumentStateSchema, baseCreateDocument, baseLoadFromInput, baseSaveToFileHandle, createAction, createBaseState, createReducer, createState as createState$1, defaultBaseState, isDocumentAction } from \"../document-model/index.js\";\nimport { z } from \"zod\";\n//#region \\0rolldown/runtime.js\nvar __defProp = Object.defineProperty;\nvar __exportAll = (all, no_symbols) => {\n\tlet target = {};\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n\tif (!no_symbols) __defProp(target, Symbol.toStringTag, { value: \"Module\" });\n\treturn target;\n};\n//#endregion\n//#region document-drive/constants.ts\nconst driveDocumentFileExtension = \"phdd\";\n//#endregion\n//#region document-drive/gen/schema/zod.ts\nconst isDefinedNonNullAny = (v) => v !== void 0 && v !== null;\nconst definedNonNullAnySchema = z.any().refine((v) => isDefinedNonNullAny(v));\nconst TransmitterTypeSchema = z.enum([\n\t\"Internal\",\n\t\"MatrixConnect\",\n\t\"PullResponder\",\n\t\"RESTWebhook\",\n\t\"SecureConnect\",\n\t\"SwitchboardPush\"\n]);\nconst TriggerTypeSchema = z.enum([\"PullResponder\"]);\nfunction AddFileInputSchema() {\n\treturn z.object({\n\t\tdocumentType: z.string(),\n\t\tid: z.string(),\n\t\tname: z.string(),\n\t\tparentFolder: z.string().nullish()\n\t});\n}\nfunction AddFolderInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\tname: z.string(),\n\t\tparentFolder: z.string().nullish()\n\t});\n}\nfunction AddListenerInputSchema() {\n\treturn z.object({ listener: ListenerInputSchema() });\n}\nfunction AddTriggerInputSchema() {\n\treturn z.object({ trigger: TriggerInputSchema() });\n}\nfunction CopyNodeInputSchema() {\n\treturn z.object({\n\t\tsrcId: z.string(),\n\t\ttargetId: z.string(),\n\t\ttargetName: z.string().nullish(),\n\t\ttargetParentFolder: z.string().nullish()\n\t});\n}\nfunction DeleteNodeInputSchema() {\n\treturn z.object({ id: z.string() });\n}\nfunction DocumentDriveLocalStateSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"DocumentDriveLocalState\").optional(),\n\t\tavailableOffline: z.boolean(),\n\t\tlisteners: z.array(ListenerSchema()),\n\t\tsharingType: z.string().nullable(),\n\t\ttriggers: z.array(TriggerSchema())\n\t});\n}\nfunction DocumentDriveStateSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"DocumentDriveState\").optional(),\n\t\ticon: z.string().nullable(),\n\t\tname: z.string(),\n\t\tnodes: z.array(NodeSchema())\n\t});\n}\nfunction FileNodeSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"FileNode\").optional(),\n\t\tdocumentType: z.string(),\n\t\tid: z.string(),\n\t\tkind: z.string(),\n\t\tname: z.string(),\n\t\tparentFolder: z.string().nullable()\n\t});\n}\nfunction FolderNodeSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"FolderNode\").optional(),\n\t\tid: z.string(),\n\t\tkind: z.string(),\n\t\tname: z.string(),\n\t\tparentFolder: z.string().nullable()\n\t});\n}\nfunction ListenerSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"Listener\").optional(),\n\t\tblock: z.boolean(),\n\t\tcallInfo: ListenerCallInfoSchema().nullable(),\n\t\tfilter: ListenerFilterSchema(),\n\t\tlabel: z.string().nullable(),\n\t\tlistenerId: z.string(),\n\t\tsystem: z.boolean()\n\t});\n}\nfunction ListenerInputSchema() {\n\treturn z.object({\n\t\tblock: z.boolean(),\n\t\tcallInfo: ListenerCallInfoInputSchema().nullish(),\n\t\tfilter: ListenerFilterInputSchema(),\n\t\tlabel: z.string().nullish(),\n\t\tlistenerId: z.string(),\n\t\tsystem: z.boolean()\n\t});\n}\nfunction ListenerCallInfoSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"ListenerCallInfo\").optional(),\n\t\tdata: z.string().nullable(),\n\t\tname: z.string().nullable(),\n\t\ttransmitterType: TransmitterTypeSchema.nullable()\n\t});\n}\nfunction ListenerCallInfoInputSchema() {\n\treturn z.object({\n\t\tdata: z.string().nullish(),\n\t\tname: z.string().nullish(),\n\t\ttransmitterType: TransmitterTypeSchema.nullish()\n\t});\n}\nfunction ListenerFilterSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"ListenerFilter\").optional(),\n\t\tbranch: z.array(z.string()).nullable(),\n\t\tdocumentId: z.array(z.string()).nullable(),\n\t\tdocumentType: z.array(z.string()),\n\t\tscope: z.array(z.string()).nullable()\n\t});\n}\nfunction ListenerFilterInputSchema() {\n\treturn z.object({\n\t\tbranch: z.array(z.string()).nullish(),\n\t\tdocumentId: z.array(z.string()).nullish(),\n\t\tdocumentType: z.array(z.string()).nullish(),\n\t\tscope: z.array(z.string()).nullish()\n\t});\n}\nfunction MoveNodeInputSchema() {\n\treturn z.object({\n\t\tsrcFolder: z.string(),\n\t\ttargetParentFolder: z.string().nullish()\n\t});\n}\nfunction NodeSchema() {\n\treturn z.union([FileNodeSchema(), FolderNodeSchema()]);\n}\nfunction PullResponderTriggerDataSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"PullResponderTriggerData\").optional(),\n\t\tinterval: z.string(),\n\t\tlistenerId: z.string(),\n\t\turl: z.string()\n\t});\n}\nfunction PullResponderTriggerDataInputSchema() {\n\treturn z.object({\n\t\tinterval: z.string(),\n\t\tlistenerId: z.string(),\n\t\turl: z.string()\n\t});\n}\nfunction RemoveListenerInputSchema() {\n\treturn z.object({ listenerId: z.string() });\n}\nfunction RemoveTriggerInputSchema() {\n\treturn z.object({ triggerId: z.string() });\n}\nfunction SetAvailableOfflineInputSchema() {\n\treturn z.object({ availableOffline: z.boolean() });\n}\nfunction SetDriveIconInputSchema() {\n\treturn z.object({ icon: z.string() });\n}\nfunction SetDriveNameInputSchema() {\n\treturn z.object({ name: z.string() });\n}\nfunction SetSharingTypeInputSchema() {\n\treturn z.object({ type: z.string() });\n}\nfunction TriggerSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"Trigger\").optional(),\n\t\tdata: TriggerDataSchema().nullable(),\n\t\tid: z.string(),\n\t\ttype: TriggerTypeSchema\n\t});\n}\nfunction TriggerInputSchema() {\n\treturn z.object({\n\t\tdata: PullResponderTriggerDataInputSchema().nullish(),\n\t\tid: z.string(),\n\t\ttype: TriggerTypeSchema\n\t});\n}\nfunction TriggerDataSchema() {\n\treturn PullResponderTriggerDataSchema();\n}\nfunction UpdateFileInputSchema() {\n\treturn z.object({\n\t\tdocumentType: z.string().nullish(),\n\t\tid: z.string(),\n\t\tname: z.string().nullish(),\n\t\tparentFolder: z.string().nullish()\n\t});\n}\nfunction UpdateNodeInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\tname: z.string().nullish(),\n\t\tparentFolder: z.string().nullish()\n\t});\n}\n//#endregion\n//#region document-drive/gen/node/creators.ts\nfunction addFile(input) {\n\tif (input && typeof input === \"object\" && \"synchronizationUnits\" in input) return createAction(\"ADD_FILE\", { ...input }, void 0, void 0, \"global\");\n\treturn createAction(\"ADD_FILE\", { ...input }, void 0, AddFileInputSchema, \"global\");\n}\nconst addFolder = (input) => createAction(\"ADD_FOLDER\", { ...input }, void 0, AddFolderInputSchema, \"global\");\nconst deleteNode = (input) => createAction(\"DELETE_NODE\", { ...input }, void 0, DeleteNodeInputSchema, \"global\");\nconst updateFile = (input) => createAction(\"UPDATE_FILE\", { ...input }, void 0, UpdateFileInputSchema, \"global\");\nconst updateNode = (input) => createAction(\"UPDATE_NODE\", { ...input }, void 0, UpdateNodeInputSchema, \"global\");\nconst copyNode = (input) => createAction(\"COPY_NODE\", { ...input }, void 0, CopyNodeInputSchema, \"global\");\nconst moveNode = (input) => createAction(\"MOVE_NODE\", { ...input }, void 0, MoveNodeInputSchema, \"global\");\n//#endregion\n//#region document-drive/gen/drive/creators.ts\nconst setDriveName = (input) => createAction(\"SET_DRIVE_NAME\", { ...input }, void 0, SetDriveNameInputSchema, \"global\");\nconst setDriveIcon = (input) => createAction(\"SET_DRIVE_ICON\", { ...input }, void 0, SetDriveIconInputSchema, \"global\");\nconst setSharingType = (input) => createAction(\"SET_SHARING_TYPE\", { ...input }, void 0, SetSharingTypeInputSchema, \"local\");\nconst setAvailableOffline = (input) => createAction(\"SET_AVAILABLE_OFFLINE\", { ...input }, void 0, SetAvailableOfflineInputSchema, \"local\");\nconst addListener = (input) => createAction(\"ADD_LISTENER\", { ...input }, void 0, AddListenerInputSchema, \"local\");\nconst removeListener = (input) => createAction(\"REMOVE_LISTENER\", { ...input }, void 0, RemoveListenerInputSchema, \"local\");\nconst addTrigger = (input) => createAction(\"ADD_TRIGGER\", { ...input }, void 0, AddTriggerInputSchema, \"local\");\nconst removeTrigger = (input) => createAction(\"REMOVE_TRIGGER\", { ...input }, void 0, RemoveTriggerInputSchema, \"local\");\n//#endregion\n//#region document-drive/gen/creators.ts\nvar creators_exports = /* @__PURE__ */ __exportAll({\n\taddFile: () => addFile,\n\taddFolder: () => addFolder,\n\taddListener: () => addListener,\n\taddTrigger: () => addTrigger,\n\tcopyNode: () => copyNode,\n\tdeleteNode: () => deleteNode,\n\tmoveNode: () => moveNode,\n\tremoveListener: () => removeListener,\n\tremoveTrigger: () => removeTrigger,\n\tsetAvailableOffline: () => setAvailableOffline,\n\tsetDriveIcon: () => setDriveIcon,\n\tsetDriveName: () => setDriveName,\n\tsetSharingType: () => setSharingType,\n\tupdateFile: () => updateFile,\n\tupdateNode: () => updateNode\n});\n//#endregion\n//#region document-drive/gen/document-model.ts\nconst driveDocumentModel = {\n\tid: \"powerhouse/document-drive\",\n\tname: \"DocumentDrive\",\n\textension: \"phdd\",\n\tdescription: \"\",\n\tauthor: {\n\t\tname: \"Powerhouse Inc\",\n\t\twebsite: \"https://www.powerhouse.inc/\"\n\t},\n\tspecifications: [{\n\t\tversion: 1,\n\t\tchangeLog: [],\n\t\tstate: {\n\t\t\tglobal: {\n\t\t\t\tschema: \"type FolderNode {\\n id: String!\\n name: String!\\n kind: String!\\n parentFolder: String\\n}\\n\\ntype FileNode {\\n id: String!\\n name: String!\\n kind: String!\\n documentType: String!\\n parentFolder: String\\n}\\n\\nunion Node = FolderNode | FileNode\\n\\ntype DocumentDriveState {\\n name: String!\\n nodes: [Node!]!\\n icon: String\\n}\",\n\t\t\t\tinitialValue: \"\\\"{\\\\\\\"name\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"nodes\\\\\\\":[],\\\\\\\"icon\\\\\\\":null}\\\"\",\n\t\t\t\texamples: []\n\t\t\t},\n\t\t\tlocal: {\n\t\t\t\tschema: \"type ListenerFilter {\\n documentType: [String!]!\\n documentId: [ID!]\\n scope: [String!]\\n branch: [String!]\\n}\\n\\nenum TransmitterType {\\n Internal,\\n SwitchboardPush,\\n PullResponder,\\n SecureConnect, \\n MatrixConnect,\\n RESTWebhook\\n}\\n\\ntype ListenerCallInfo {\\n transmitterType: TransmitterType\\n name: String\\n data: String\\n}\\n\\ntype Listener {\\n listenerId: ID!\\n label: String\\n block: Boolean!\\n system: Boolean!\\n filter: ListenerFilter!\\n callInfo: ListenerCallInfo\\n}\\n\\nenum TriggerType {\\n PullResponder\\n}\\n\\ntype PullResponderTriggerData {\\n listenerId: ID!\\n url: String!\\n interval: String!\\n}\\n\\nunion TriggerData = PullResponderTriggerData\\n\\ntype Trigger {\\n id: ID!\\n type: TriggerType!\\n data: TriggerData\\n}\\n\\ntype DocumentDriveLocalState{\\n sharingType: String\\n listeners: [Listener!]!\\n triggers: [Trigger!]!\\n availableOffline: Boolean!\\n}\",\n\t\t\t\tinitialValue: \"\\\"{ \\\\\\\"listeners\\\\\\\": [], \\\\\\\"triggers\\\\\\\": [], \\\\\\\"sharingType\\\\\\\": \\\\\\\"private\\\\\\\", \\\\\\\"availableOffline\\\\\\\": false}\\\"\",\n\t\t\t\texamples: []\n\t\t\t}\n\t\t},\n\t\tmodules: [{\n\t\t\tid: \"GRzuvv78tBvmB6ciitokLfonNHA=\",\n\t\t\tname: \"Node\",\n\t\t\tdescription: \"\",\n\t\t\toperations: [\n\t\t\t\t{\n\t\t\t\t\tid: \"7xiTdxonc9yEASR8sfV/KnbSV10=\",\n\t\t\t\t\tname: \"ADD_FILE\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input AddFileInput {\\n id: ID!\\n name: String!\\n documentType: String!\\n parentFolder: ID\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"global\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"4lzNMMKKdIAtEU6i12xLgi9hp+U=\",\n\t\t\t\t\tname: \"ADD_FOLDER\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input AddFolderInput {\\n id: ID!\\n name: String!\\n parentFolder: ID\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"global\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"53jH2/3TWTTcgCJiv2C+BmuC6i0=\",\n\t\t\t\t\tname: \"DELETE_NODE\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input DeleteNodeInput {\\n id: ID!\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"global\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"pNn+Y1/HVq/GNMk7t0u3g3gtMLE=\",\n\t\t\t\t\tname: \"UPDATE_FILE\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input UpdateFileInput {\\n id: ID!\\n parentFolder: ID\\n name: String\\n documentType: String\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"global\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"P0x1M8Mnt+Q/+9nggkwgVbfybsc=\",\n\t\t\t\t\tname: \"UPDATE_NODE\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input UpdateNodeInput {\\n id: ID!\\n parentFolder: ID\\n name: String\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"global\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"vnQ7OB5b3wGLgjhbgJqAIpA+JLE=\",\n\t\t\t\t\tname: \"COPY_NODE\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input CopyNodeInput {\\n srcId: ID!\\n targetId: ID!\\n targetName: String\\n targetParentFolder: ID\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"global\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"VNyiD/sNGzk6k9A1Qe7s8dmrJxA=\",\n\t\t\t\t\tname: \"MOVE_NODE\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input MoveNodeInput {\\n srcFolder: ID!\\n targetParentFolder: ID\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"global\"\n\t\t\t\t}\n\t\t\t]\n\t\t}, {\n\t\t\tid: \"0dHwHlxOM9x0vMZ+gLnKxf2qTEo=\",\n\t\t\tname: \"Drive\",\n\t\t\tdescription: \"\",\n\t\t\toperations: [\n\t\t\t\t{\n\t\t\t\t\tid: \"qGCiPGpTt/cyz3HzyrBn92z1dsU=\",\n\t\t\t\t\tname: \"SET_DRIVE_NAME\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input SetDriveNameInput {\\n name: String!\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"global\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"qGCiPGpTt/cyz3HzyrBn92z30dsU=\",\n\t\t\t\t\tname: \"SET_DRIVE_ICON\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input SetDriveIconInput {\\n icon: String!\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"global\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"qGCiPGpTt/cyz3HzyrBn92z2dsU=\",\n\t\t\t\t\tname: \"SET_SHARING_TYPE\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input SetSharingTypeInput {\\n type: String!\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"local\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"qGCiPGpTt/cyz3HzyrBn92z3dsU=\",\n\t\t\t\t\tname: \"SET_AVAILABLE_OFFLINE\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input SetAvailableOfflineInput {\\n availableOffline: Boolean!\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"local\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"qGCiPGpTt/cyz3HzyrBn92z9dsU=\",\n\t\t\t\t\tname: \"ADD_LISTENER\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input ListenerFilterInput {\\n documentType: [String!]\\n documentId: [ID!]\\n scope: [String!]\\n branch: [String!]\\n}\\n\\ninput ListenerCallInfoInput {\\n transmitterType: TransmitterType\\n name: String\\n data: String\\n}\\n\\ninput ListenerInput {\\n listenerId: ID!\\n label: String\\n block: Boolean!\\n system: Boolean!\\n filter: ListenerFilterInput!\\n callInfo: ListenerCallInfoInput\\n}\\n\\ninput AddListenerInput {\\n listener: ListenerInput!\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"local\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"qGCiPGpTt/cyz3HzyrBn92z10dsU=\",\n\t\t\t\t\tname: \"REMOVE_LISTENER\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input RemoveListenerInput {\\n listenerId: String!\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"local\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"qGCiPGpTt/cyz3HzyrBn92z20dsU=\",\n\t\t\t\t\tname: \"ADD_TRIGGER\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input PullResponderTriggerDataInput {\\n listenerId: ID!\\n url: String!\\n interval: String!\\n}\\n\\ninput TriggerInput {\\n id: ID!\\n type: TriggerType!\\n data: PullResponderTriggerDataInput\\n}\\n\\ninput AddTriggerInput {\\n trigger: TriggerInput!\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"local\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"qGCiPGpTt/cyz3HzyrBn92z30dsU=\",\n\t\t\t\t\tname: \"REMOVE_TRIGGER\",\n\t\t\t\t\tdescription: \"\",\n\t\t\t\t\tschema: \"input RemoveTriggerInput {\\n triggerId: String!\\n}\",\n\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\treducer: \"\",\n\t\t\t\t\terrors: [],\n\t\t\t\t\texamples: [],\n\t\t\t\t\tscope: \"local\"\n\t\t\t\t}\n\t\t\t]\n\t\t}]\n\t}]\n};\n//#endregion\n//#region document-drive/gen/document-type.ts\nconst driveDocumentType = \"powerhouse/document-drive\";\n//#endregion\n//#region document-drive/gen/ph-factories.ts\n/**\n* Factory methods for creating DocumentDriveDocument instances\n*/\nfunction defaultGlobalState() {\n\treturn {\n\t\ticon: null,\n\t\tname: \"\",\n\t\tnodes: []\n\t};\n}\nfunction defaultLocalState() {\n\treturn {\n\t\tavailableOffline: false,\n\t\tlisteners: [],\n\t\tsharingType: null,\n\t\ttriggers: []\n\t};\n}\nfunction defaultPHState() {\n\treturn {\n\t\t...defaultBaseState(),\n\t\tglobal: defaultGlobalState(),\n\t\tlocal: defaultLocalState()\n\t};\n}\nfunction createGlobalState(state) {\n\treturn {\n\t\t...defaultGlobalState(),\n\t\t...state || {}\n\t};\n}\nfunction createLocalState(state) {\n\treturn {\n\t\t...defaultLocalState(),\n\t\t...state || {}\n\t};\n}\nfunction createState(baseState, globalState, localState) {\n\treturn {\n\t\t...createBaseState(baseState?.auth, baseState?.document),\n\t\tglobal: createGlobalState(globalState),\n\t\tlocal: createLocalState(localState)\n\t};\n}\n//#endregion\n//#region document-drive/src/reducers/drive.ts\nconst driveReducer = {\n\tsetDriveNameOperation(state, action, dispatch) {\n\t\tstate.name = action.input.name;\n\t},\n\tsetDriveIconOperation(state, action, dispatch) {\n\t\tstate.icon = action.input.icon;\n\t},\n\tsetSharingTypeOperation(state, action, dispatch) {\n\t\tstate.sharingType = action.input.type;\n\t},\n\tsetAvailableOfflineOperation(state, action, dispatch) {\n\t\tstate.availableOffline = action.input.availableOffline;\n\t},\n\taddListenerOperation(state, action, dispatch) {\n\t\tconst { listener: input } = action.input;\n\t\tif (state.listeners.find((l) => l.listenerId === input.listenerId)) throw new Error(`A listener with Id: ${input.listenerId} already exists`);\n\t\tconst listener = {\n\t\t\tlistenerId: input.listenerId,\n\t\t\tlabel: input.label ?? null,\n\t\t\tblock: input.block,\n\t\t\tsystem: input.system,\n\t\t\tfilter: {\n\t\t\t\tdocumentType: input.filter.documentType ?? null,\n\t\t\t\tdocumentId: input.filter.documentId ?? null,\n\t\t\t\tscope: input.filter.scope ?? null,\n\t\t\t\tbranch: input.filter.branch ?? null\n\t\t\t},\n\t\t\tcallInfo: input.callInfo ? {\n\t\t\t\ttransmitterType: input.callInfo.transmitterType ?? null,\n\t\t\t\tname: input.callInfo.name ?? null,\n\t\t\t\tdata: input.callInfo.data ?? null\n\t\t\t} : null\n\t\t};\n\t\tstate.listeners.push(listener);\n\t},\n\tremoveListenerOperation(state, action, dispatch) {\n\t\tstate.listeners = state.listeners.filter((listener) => listener.listenerId !== action.input.listenerId);\n\t},\n\taddTriggerOperation(state, action, dispatch) {\n\t\tconst { trigger: input } = action.input;\n\t\tif (state.triggers.find((t) => t.id === input.id)) throw new Error(`A trigger with Id: ${input.id} already exists`);\n\t\tconst trigger = {\n\t\t\tid: input.id,\n\t\t\ttype: input.type,\n\t\t\tdata: input.data ? { ...input.data } : null\n\t\t};\n\t\tstate.triggers.push(trigger);\n\t},\n\tremoveTriggerOperation(state, action, dispatch) {\n\t\tstate.triggers = state.triggers.filter((trigger) => trigger.id !== action.input.triggerId);\n\t}\n};\n//#endregion\n//#region document-drive/src/utils.ts\nfunction isFileNode(node) {\n\treturn node.kind === \"file\";\n}\nfunction isFolderNode(node) {\n\treturn node.kind === \"folder\";\n}\nfunction getAncestors(node, allNodes) {\n\tif (!node.parentFolder) return [];\n\telse {\n\t\tconst parentNode = allNodes.find((_node) => _node.id === node.parentFolder);\n\t\tif (!parentNode) throw new Error(`Parent node with id ${node.parentFolder} not found`);\n\t\treturn [parentNode, ...getAncestors(parentNode, allNodes)];\n\t}\n}\nfunction getDescendants(node, allNodes) {\n\tconst children = allNodes.filter((_node) => _node.parentFolder === node.id);\n\tconst descendants = children.map((child) => getDescendants(child, allNodes));\n\treturn [...children, ...descendants.flat()];\n}\n/**\n* Generates a copy of nodes based on the provided source and target information.\n* @param src - The source information for generating the copy.\n* @param idGenerator - The function used to generate new IDs for the copied nodes.\n* @param nodes - The array of nodes to copy from.\n* @returns An array of copied nodes with updated IDs and parent folders.\n* @throws Error if the root node with the specified ID is not found.\n*/\nfunction generateNodesCopy(src, idGenerator, nodes) {\n\tconst rootNode = nodes.find((node) => node.id === src.srcId);\n\tif (!rootNode) throw new Error(`Node with id ${src.srcId} not found`);\n\tconst nodesToCopy = [{\n\t\t...rootNode,\n\t\tname: src.targetName || rootNode.name,\n\t\tparentFolder: src.targetParentFolder || null\n\t}, ...getDescendants(rootNode, nodes)];\n\tconst ids = {};\n\tif (src.targetParentFolder) ids[src.targetParentFolder] = src.targetParentFolder;\n\tconst getNewNodeId = (node) => {\n\t\tlet newId = ids[node.id];\n\t\tif (!newId) {\n\t\t\tconst oldId = node.id;\n\t\t\tnewId = idGenerator(node);\n\t\t\tids[oldId] = newId;\n\t\t}\n\t\treturn newId;\n\t};\n\treturn nodesToCopy.map((node) => ({\n\t\tsrcId: node.id,\n\t\ttargetId: getNewNodeId(node),\n\t\ttargetName: node.name,\n\t\ttargetParentFolder: node.parentFolder ? ids[node.parentFolder] : null\n\t}));\n}\nfunction getNextCopyNumber(files, baseFilename) {\n\tlet maxNumber = 0;\n\tconst regex = new RegExp(`^${escapeRegExp(baseFilename)} \\\\(copy\\\\)(?: (\\\\d+))?$`);\n\tfor (const file of files) {\n\t\tconst match = file.match(regex);\n\t\tif (match) {\n\t\t\tconst number = match[1] ? parseInt(match[1], 10) : 1;\n\t\t\tif (number > maxNumber) maxNumber = number;\n\t\t}\n\t}\n\treturn maxNumber + 1;\n}\nfunction escapeRegExp(string) {\n\treturn string.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\nfunction handleTargetNameCollisions(params) {\n\tconst { nodes, targetParentFolder, srcName, srcKind } = params;\n\tconst targetNodeChildrenNames = nodes.filter((node) => targetParentFolder === \"\" ? node.parentFolder === null : node.parentFolder === targetParentFolder).filter((node) => node.kind === srcKind).map((node) => node.name);\n\treturn targetNodeChildrenNames.includes(srcName) ? `${srcName} (copy) ${getNextCopyNumber(targetNodeChildrenNames, srcName)}` : srcName;\n}\nconst isValidName = (name) => {\n\treturn /^[a-zA-Z0-9-_.\\s()]+$/.test(name);\n};\n//#endregion\n//#region document-drive/src/reducers/node.ts\nconst nodeReducer = {\n\taddFileOperation(state, action, dispatch) {\n\t\tif (state.nodes.find((node) => node.id === action.input.id)) throw new Error(`Node with id ${action.input.id} already exists!`);\n\t\tif (!isValidName(action.input.name)) throw new Error(`Invalid name: '${action.input.name}'. Names must be valid URL characters.`);\n\t\tconst name = handleTargetNameCollisions({\n\t\t\tnodes: state.nodes,\n\t\t\tsrcName: action.input.name,\n\t\t\tsrcKind: \"file\",\n\t\t\ttargetParentFolder: action.input.parentFolder || null\n\t\t});\n\t\tconst fileNode = {\n\t\t\tid: action.input.id,\n\t\t\tname,\n\t\t\tkind: \"file\",\n\t\t\tparentFolder: action.input.parentFolder ?? null,\n\t\t\tdocumentType: action.input.documentType\n\t\t};\n\t\tstate.nodes.push(fileNode);\n\t\tstate.nodes.sort((a, b) => a.id.localeCompare(b.id));\n\t\tdispatch?.({\n\t\t\ttype: \"CREATE_CHILD_DOCUMENT\",\n\t\t\tinput: {\n\t\t\t\tid: action.input.id,\n\t\t\t\tdocumentType: action.input.documentType\n\t\t\t}\n\t\t});\n\t},\n\taddFolderOperation(state, action) {\n\t\tif (state.nodes.find((node) => node.id === action.input.id)) throw new Error(`Node with id ${action.input.id} already exists!`);\n\t\tif (!isValidName(action.input.name)) throw new Error(`Invalid name: '${action.input.name}'. Names must be valid URL characters.`);\n\t\tconst name = handleTargetNameCollisions({\n\t\t\tnodes: state.nodes,\n\t\t\tsrcName: action.input.name,\n\t\t\tsrcKind: \"folder\",\n\t\t\ttargetParentFolder: action.input.parentFolder || null\n\t\t});\n\t\tstate.nodes.push({\n\t\t\t...action.input,\n\t\t\tname,\n\t\t\tkind: \"folder\",\n\t\t\tparentFolder: action.input.parentFolder ?? null\n\t\t});\n\t\tstate.nodes.sort((a, b) => a.id.localeCompare(b.id));\n\t},\n\tdeleteNodeOperation(state, action, dispatch) {\n\t\tconst node = state.nodes.find((node) => node.id === action.input.id);\n\t\tif (!node) throw new Error(`Node with id ${action.input.id} not found`);\n\t\tconst descendants = getDescendants(node, state.nodes);\n\t\tstate.nodes = state.nodes.filter((node) => node.id !== action.input.id && !descendants.find((descendant) => descendant.id === node.id));\n\t\t[node, ...descendants].filter((node) => isFileNode(node)).forEach((node) => {\n\t\t\tdispatch?.({\n\t\t\t\ttype: \"DELETE_CHILD_DOCUMENT\",\n\t\t\t\tinput: { id: node.id }\n\t\t\t});\n\t\t});\n\t},\n\tupdateFileOperation(state, action) {\n\t\tif (action.input.name && !isValidName(action.input.name)) throw new Error(`Invalid name: '${action.input.name}'. Names must be valid URL characters.`);\n\t\tstate.nodes = state.nodes.map((node) => node.id === action.input.id ? {\n\t\t\t...node,\n\t\t\tname: handleTargetNameCollisions({\n\t\t\t\tnodes: state.nodes.filter((n) => n.id !== action.input.id),\n\t\t\t\tsrcName: action.input.name ?? node.name,\n\t\t\t\tsrcKind: \"file\",\n\t\t\t\ttargetParentFolder: action.input.parentFolder ?? node.parentFolder\n\t\t\t}),\n\t\t\tdocumentType: action.input.documentType ?? node.documentType\n\t\t} : node);\n\t\tstate.nodes.sort((a, b) => a.id.localeCompare(b.id));\n\t},\n\tupdateNodeOperation(state, action) {\n\t\tif (action.input.name && !isValidName(action.input.name)) throw new Error(`Invalid name: '${action.input.name}'. Names must be valid URL characters.`);\n\t\tstate.nodes = state.nodes.map((node) => node.id === action.input.id ? {\n\t\t\t...node,\n\t\t\tname: handleTargetNameCollisions({\n\t\t\t\tnodes: state.nodes.filter((n) => n.id !== action.input.id),\n\t\t\t\tsrcName: action.input.name ?? node.name,\n\t\t\t\tsrcKind: node.kind === \"file\" ? \"file\" : \"folder\",\n\t\t\t\ttargetParentFolder: action.input.parentFolder ?? node.parentFolder\n\t\t\t}),\n\t\t\tparentFolder: action.input.parentFolder === null ? null : node.parentFolder\n\t\t} : node);\n\t\tstate.nodes.sort((a, b) => a.id.localeCompare(b.id));\n\t},\n\tcopyNodeOperation(state, action, dispatch) {\n\t\tconst node = state.nodes.find((node) => node.id === action.input.srcId);\n\t\tif (!node) throw new Error(`Node with id ${action.input.srcId} not found`);\n\t\tif (state.nodes.find((node) => node.id === action.input.targetId)) throw new Error(`Node with id ${action.input.targetId} already exists`);\n\t\tconst name = handleTargetNameCollisions({\n\t\t\tnodes: state.nodes,\n\t\t\tsrcName: action.input.targetName || node.name,\n\t\t\tsrcKind: node.kind === \"file\" ? \"file\" : \"folder\",\n\t\t\ttargetParentFolder: action.input.targetParentFolder || null\n\t\t});\n\t\tconst newNode = {\n\t\t\t...node,\n\t\t\tid: action.input.targetId,\n\t\t\tslug: action.input.targetId,\n\t\t\tname,\n\t\t\tparentFolder: action.input.targetParentFolder || null\n\t\t};\n\t\tstate.nodes.push(newNode);\n\t\tstate.nodes.sort((a, b) => a.id.localeCompare(b.id));\n\t\tif (isFileNode(newNode)) dispatch?.({\n\t\t\ttype: \"COPY_CHILD_DOCUMENT\",\n\t\t\tinput: {\n\t\t\t\tid: action.input.srcId,\n\t\t\t\tnewId: action.input.targetId\n\t\t\t}\n\t\t});\n\t},\n\tmoveNodeOperation(state, action) {\n\t\tif (action.input.srcFolder === action.input.targetParentFolder) throw new Error(\"Circular Reference Error: Attempting to move a node to its current parent folder\");\n\t\tconst node = state.nodes.find((node) => node.id === action.input.srcFolder);\n\t\tif (!node) throw new Error(`Node with id ${action.input.srcFolder} not found`);\n\t\tconst name = handleTargetNameCollisions({\n\t\t\tnodes: state.nodes,\n\t\t\tsrcName: node.name,\n\t\t\tsrcKind: node.kind === \"file\" ? \"file\" : \"folder\",\n\t\t\ttargetParentFolder: action.input.targetParentFolder || null\n\t\t});\n\t\tif (isFolderNode(node)) {\n\t\t\tif (getDescendants(node, state.nodes).find((descendant) => descendant.id === action.input.targetParentFolder)) throw new Error(\"Circular Reference Error: Cannot move a folder to one of its descendants\");\n\t\t}\n\t\tstate.nodes = state.nodes.map((node) => {\n\t\t\tif (node.id === action.input.srcFolder) return {\n\t\t\t\t...node,\n\t\t\t\tname,\n\t\t\t\tparentFolder: action.input.targetParentFolder || null\n\t\t\t};\n\t\t\treturn node;\n\t\t});\n\t\tstate.nodes.sort((a, b) => a.id.localeCompare(b.id));\n\t}\n};\n//#endregion\n//#region document-drive/gen/reducer.ts\nconst driveStateReducer = (state, action, dispatch) => {\n\tif (isDocumentAction(action)) return state;\n\tconst typedAction = action;\n\tswitch (typedAction.type) {\n\t\tcase \"ADD_FILE\":\n\t\t\tAddFileInputSchema().parse(typedAction.input);\n\t\t\tnodeReducer.addFileOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"ADD_FOLDER\":\n\t\t\tAddFolderInputSchema().parse(typedAction.input);\n\t\t\tnodeReducer.addFolderOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"DELETE_NODE\":\n\t\t\tDeleteNodeInputSchema().parse(typedAction.input);\n\t\t\tnodeReducer.deleteNodeOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"UPDATE_FILE\":\n\t\t\tUpdateFileInputSchema().parse(typedAction.input);\n\t\t\tnodeReducer.updateFileOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"UPDATE_NODE\":\n\t\t\tUpdateNodeInputSchema().parse(typedAction.input);\n\t\t\tnodeReducer.updateNodeOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"COPY_NODE\":\n\t\t\tCopyNodeInputSchema().parse(typedAction.input);\n\t\t\tnodeReducer.copyNodeOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"MOVE_NODE\":\n\t\t\tMoveNodeInputSchema().parse(typedAction.input);\n\t\t\tnodeReducer.moveNodeOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"SET_DRIVE_NAME\":\n\t\t\tSetDriveNameInputSchema().parse(typedAction.input);\n\t\t\tdriveReducer.setDriveNameOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"SET_DRIVE_ICON\":\n\t\t\tSetDriveIconInputSchema().parse(typedAction.input);\n\t\t\tdriveReducer.setDriveIconOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"SET_SHARING_TYPE\":\n\t\t\tSetSharingTypeInputSchema().parse(typedAction.input);\n\t\t\tdriveReducer.setSharingTypeOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"SET_AVAILABLE_OFFLINE\":\n\t\t\tSetAvailableOfflineInputSchema().parse(typedAction.input);\n\t\t\tdriveReducer.setAvailableOfflineOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"ADD_LISTENER\":\n\t\t\tAddListenerInputSchema().parse(typedAction.input);\n\t\t\tdriveReducer.addListenerOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"REMOVE_LISTENER\":\n\t\t\tRemoveListenerInputSchema().parse(typedAction.input);\n\t\t\tdriveReducer.removeListenerOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"ADD_TRIGGER\":\n\t\t\tAddTriggerInputSchema().parse(typedAction.input);\n\t\t\tdriveReducer.addTriggerOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tcase \"REMOVE_TRIGGER\":\n\t\t\tRemoveTriggerInputSchema().parse(typedAction.input);\n\t\t\tdriveReducer.removeTriggerOperation(state[typedAction.scope], action, dispatch);\n\t\t\tbreak;\n\t\tdefault: return state;\n\t}\n};\nconst driveDocumentReducer = createReducer(driveStateReducer);\n//#endregion\n//#region document-drive/gen/document-schema.ts\n/** Schema for validating the header object of a Drive document */\nconst DriveDocumentHeaderSchema = BaseDocumentHeaderSchema.extend({ documentType: z.literal(driveDocumentType) });\n/** Schema for validating the state object of a Drive document */\nconst DrivePHStateSchema = BaseDocumentStateSchema.extend({\n\tglobal: DocumentDriveStateSchema(),\n\tlocal: DocumentDriveLocalStateSchema()\n});\nconst DriveDocumentSchema = z.object({\n\theader: DriveDocumentHeaderSchema,\n\tstate: DrivePHStateSchema,\n\tinitialState: DrivePHStateSchema\n});\n/** Simple helper function to check if a state object is a Drive document state object */\nfunction isDriveState(state) {\n\treturn DrivePHStateSchema.safeParse(state).success;\n}\n/** Simple helper function to assert that a document state object is a Drive document state object */\nfunction assertIsDriveState(state) {\n\tDrivePHStateSchema.parse(state);\n}\n/** Simple helper function to check if a document is a Drive document */\nfunction isDriveDocument(document) {\n\treturn DriveDocumentSchema.safeParse(document).success;\n}\n/** Simple helper function to assert that a document is a Drive document */\nfunction assertIsDriveDocument(document) {\n\tDriveDocumentSchema.parse(document);\n}\n//#endregion\n//#region document-drive/gen/utils.ts\nconst initialGlobalState = {\n\tname: \"\",\n\tnodes: [],\n\ticon: null\n};\nconst initialLocalState = {\n\tlisteners: [],\n\ttriggers: [],\n\tsharingType: \"private\",\n\tavailableOffline: false\n};\nconst driveCreateState = (state) => {\n\treturn {\n\t\t...defaultBaseState(),\n\t\tglobal: {\n\t\t\t...initialGlobalState,\n\t\t\t...state?.global\n\t\t},\n\t\tlocal: {\n\t\t\t...initialLocalState,\n\t\t\t...state?.local\n\t\t}\n\t};\n};\nconst driveCreateDocument = (state) => {\n\tconst document = baseCreateDocument(driveCreateState, state);\n\tdocument.header.documentType = driveDocumentType;\n\tdocument.header.id = generateId();\n\treturn document;\n};\nconst driveSaveToFileHandle = (document, input) => {\n\treturn baseSaveToFileHandle(document, input);\n};\nconst driveLoadFromInput = (input) => {\n\treturn baseLoadFromInput(input, driveDocumentReducer);\n};\nconst isStateOfType = (state) => {\n\treturn isDriveState(state);\n};\nconst assertIsStateOfType = (state) => {\n\tassertIsDriveState(state);\n};\nconst isDocumentOfType = (document) => {\n\treturn isDriveDocument(document);\n};\nconst assertIsDocumentOfType = (document) => {\n\tassertIsDriveDocument(document);\n};\n//#endregion\n//#region document-drive/module.ts\nconst driveDocumentModelModule = {\n\tactions: creators_exports,\n\treducer: driveDocumentReducer,\n\tdocumentModel: createState$1(defaultBaseState(), driveDocumentModel),\n\tutils: {\n\t\tfileExtension: driveDocumentFileExtension,\n\t\tcreateState: driveCreateState,\n\t\tcreateDocument: driveCreateDocument,\n\t\tloadFromInput: driveLoadFromInput,\n\t\tsaveToFileHandle: driveSaveToFileHandle,\n\t\tisStateOfType,\n\t\tassertIsStateOfType,\n\t\tisDocumentOfType,\n\t\tassertIsDocumentOfType\n\t}\n};\n//#endregion\nexport { AddFileInputSchema, AddFolderInputSchema, AddListenerInputSchema, AddTriggerInputSchema, CopyNodeInputSchema, DeleteNodeInputSchema, DocumentDriveLocalStateSchema, DocumentDriveStateSchema, FileNodeSchema, FolderNodeSchema, ListenerCallInfoInputSchema, ListenerCallInfoSchema, ListenerFilterInputSchema, ListenerFilterSchema, ListenerInputSchema, ListenerSchema, MoveNodeInputSchema, NodeSchema, PullResponderTriggerDataInputSchema, PullResponderTriggerDataSchema, RemoveListenerInputSchema, RemoveTriggerInputSchema, SetAvailableOfflineInputSchema, SetDriveIconInputSchema, SetDriveNameInputSchema, SetSharingTypeInputSchema, TransmitterTypeSchema, TriggerDataSchema, TriggerInputSchema, TriggerSchema, TriggerTypeSchema, UpdateFileInputSchema, UpdateNodeInputSchema, addFile, addFolder, addListener, addTrigger, assertIsDocumentOfType, assertIsStateOfType, copyNode, createGlobalState, createLocalState, createState, defaultGlobalState, defaultLocalState, defaultPHState, definedNonNullAnySchema, deleteNode, driveCreateDocument, driveCreateState, driveDocumentFileExtension, driveDocumentModel, driveDocumentModelModule, driveDocumentReducer, driveDocumentType, driveLoadFromInput, driveReducer, driveSaveToFileHandle, escapeRegExp, generateNodesCopy, getAncestors, getDescendants, getNextCopyNumber, handleTargetNameCollisions, initialGlobalState, initialLocalState, isDefinedNonNullAny, isDocumentOfType, isFileNode, isFolderNode, isStateOfType, isValidName, moveNode, nodeReducer, removeListener, removeTrigger, setAvailableOffline, setDriveIcon, setDriveName, setSharingType, updateFile, updateNode };\n\n//# sourceMappingURL=index.js.map"],"x_google_ignoreList":[0,1,2,4],"mappings":";;;;;;CAEA,MAAM,EAAE,mBAAmB,OAAO;CAElC,MAAM,YAAY,WAAW;AAG7B,WAAU,YAAY;AAEtB,WAAU,YAAY;AAGtB,WAAU,UAAU;AAGpB,SAAQ,YAAY;AAEpB,SAAQ,YAAY;AAEpB,QAAO,UAAU;CAGjB,MAAM,2BAA2B;CAIjC,SAAS,UAAW,KAAK;AAEvB,MAAI,IAAI,SAAS,OAAQ,CAAC,yBAAyB,KAAK,IAAI,CAC1D,QAAO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