document-model 1.0.55 → 1.1.0-debug.2

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 (74) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/browser/cjs/document-model.js +21 -1
  3. package/dist/browser/cjs/document-model.js.map +1 -0
  4. package/dist/browser/cjs/document.js +15 -1
  5. package/dist/browser/cjs/document.js.map +1 -0
  6. package/dist/browser/cjs/index.js +18 -1
  7. package/dist/browser/cjs/index.js.map +1 -0
  8. package/dist/browser/cjs/internal/index-CaJbS06G.js +2339 -0
  9. package/dist/browser/cjs/internal/index-CaJbS06G.js.map +1 -0
  10. package/dist/browser/cjs/internal/index-kKIg6qNB.js +44 -0
  11. package/dist/browser/cjs/internal/index-kKIg6qNB.js.map +1 -0
  12. package/dist/browser/cjs/internal/object-B6dSDhtS.js +4109 -0
  13. package/dist/browser/cjs/internal/object-B6dSDhtS.js.map +1 -0
  14. package/dist/browser/es/document-model.js +16 -15
  15. package/dist/browser/es/document-model.js.map +1 -0
  16. package/dist/browser/es/document.js +10 -9
  17. package/dist/browser/es/document.js.map +1 -0
  18. package/dist/browser/es/index.js +13 -11
  19. package/dist/browser/es/index.js.map +1 -0
  20. package/dist/browser/es/internal/index-B1lQN59e.js +2340 -0
  21. package/dist/browser/es/internal/index-B1lQN59e.js.map +1 -0
  22. package/dist/browser/es/internal/index-Bu0CkmrW.js +45 -0
  23. package/dist/browser/es/internal/index-Bu0CkmrW.js.map +1 -0
  24. package/dist/browser/es/internal/object-9mR1JlXD.js +4110 -0
  25. package/dist/browser/es/internal/object-9mR1JlXD.js.map +1 -0
  26. package/dist/browser/src/document/reducer.d.ts +13 -2
  27. package/dist/browser/src/document/utils/base.d.ts +1 -1
  28. package/dist/browser/src/document/utils/document-helpers.d.ts +53 -0
  29. package/dist/browser/src/document/utils/index.d.ts +1 -0
  30. package/dist/node/cjs/document-model.js +25 -1
  31. package/dist/node/cjs/document-model.js.map +1 -0
  32. package/dist/node/cjs/document.js +19 -1
  33. package/dist/node/cjs/document.js.map +1 -0
  34. package/dist/node/cjs/index.js +22 -1
  35. package/dist/node/cjs/index.js.map +1 -0
  36. package/dist/node/cjs/internal/index-AqiVmL0w.js +44 -0
  37. package/dist/node/cjs/internal/index-AqiVmL0w.js.map +1 -0
  38. package/dist/node/cjs/internal/index-ajqhOWQ1.js +2343 -0
  39. package/dist/node/cjs/internal/index-ajqhOWQ1.js.map +1 -0
  40. package/dist/node/cjs/internal/object-D_9h7jBN.js +2111 -0
  41. package/dist/node/cjs/internal/object-D_9h7jBN.js.map +1 -0
  42. package/dist/node/es/document-model.js +16 -15
  43. package/dist/node/es/document-model.js.map +1 -0
  44. package/dist/node/es/document.js +11 -10
  45. package/dist/node/es/document.js.map +1 -0
  46. package/dist/node/es/index.js +14 -12
  47. package/dist/node/es/index.js.map +1 -0
  48. package/dist/node/es/internal/index-Bh_09edy.js +2344 -0
  49. package/dist/node/es/internal/index-Bh_09edy.js.map +1 -0
  50. package/dist/node/es/internal/index-s6NFw7Kq.js +45 -0
  51. package/dist/node/es/internal/index-s6NFw7Kq.js.map +1 -0
  52. package/dist/node/es/internal/object-CbITi4iq.js +2112 -0
  53. package/dist/node/es/internal/object-CbITi4iq.js.map +1 -0
  54. package/dist/node/src/document/reducer.d.ts +13 -2
  55. package/dist/node/src/document/utils/base.d.ts +1 -1
  56. package/dist/node/src/document/utils/document-helpers.d.ts +53 -0
  57. package/dist/node/src/document/utils/index.d.ts +1 -0
  58. package/dist/src/document/reducer.d.ts +13 -2
  59. package/dist/src/document/utils/base.d.ts +1 -1
  60. package/dist/src/document/utils/document-helpers.d.ts +53 -0
  61. package/dist/src/document/utils/index.d.ts +1 -0
  62. package/package.json +7 -2
  63. package/dist/browser/cjs/internal/index-C_OFq7P5.js +0 -22
  64. package/dist/browser/cjs/internal/index-Dwhv4k_6.js +0 -1
  65. package/dist/browser/cjs/internal/object-CeLE3akL.js +0 -25
  66. package/dist/browser/es/internal/index-DvHnaqeu.js +0 -2104
  67. package/dist/browser/es/internal/index-Xcvn-MUq.js +0 -42
  68. package/dist/browser/es/internal/object-BDWVt0Zy.js +0 -2504
  69. package/dist/node/cjs/internal/index-Bi9yeV3W.js +0 -1
  70. package/dist/node/cjs/internal/index-GZsLKtHl.js +0 -22
  71. package/dist/node/cjs/internal/object-CnhDksx1.js +0 -20
  72. package/dist/node/es/internal/index-B6iEYnbQ.js +0 -42
  73. package/dist/node/es/internal/index-Chx4C-Xl.js +0 -2108
  74. package/dist/node/es/internal/object-CnV5hY_A.js +0 -1402
@@ -1 +0,0 @@
1
- "use strict";const e=require("./object-CnhDksx1.js"),t=Object.freeze(Object.defineProperty({__proto__:null,calculateSkipsLeft:e.calculateSkipsLeft,createAction:e.createAction,createDocument:e.createDocument,createExtendedState:e.createExtendedState,createReducer:e.createReducer,createZip:e.createZip,getLocalFile:e.getLocalFile,getRemoteFile:e.getRemoteFile,hashDocument:e.hashDocument,hashKey:e.hashKey,isBaseAction:e.isBaseAction,isNoopOperation:e.isNoopOperation,isSameDocument:e.isSameDocument,isUndoRedo:e.isUndoRedo,loadFromFile:e.loadFromFile,loadFromInput:e.loadFromInput,mapSkippedOperations:e.mapSkippedOperations,readOnly:e.readOnly,replayDocument:e.replayDocument,replayOperations:e.replayOperations,saveToFile:e.saveToFile,saveToFileHandle:e.saveToFileHandle,sortMappedOperations:e.sortMappedOperations,sortOperations:e.sortOperations,validateOperations:e.validateOperations},Symbol.toStringTag,{value:"Module"})),o=Object.freeze(Object.defineProperty({__proto__:null,BaseDocument:e.BaseDocument,actions:e.BaseActions,applyMixins:e.applyMixins,baseReducer:e.baseReducer,processUndoRedo:e.processUndoRedo,utils:t,z:e.zod},Symbol.toStringTag,{value:"Module"}));exports.Document=o;exports.index=t;
@@ -1,22 +0,0 @@
1
- "use strict";var Tt=Object.defineProperty;var Rt=(t,e,r)=>e in t?Tt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var be=(t,e,r)=>(Rt(t,typeof e!="symbol"?e+"":e,r),r);const s=require("./object-CnhDksx1.js");require("immer");require("crypto");require("fs");require("https");require("path");require("jszip");const o=require("zod"),xt=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),Mt=new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])","gu"),Dt=new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d","u"),Nt=/[^\p{L}\d]+/giu,_e="$1\0$2",Ae="";function ze(t){let e=t.trim();e=e.replace(xt,_e).replace(Mt,_e),e=e.replace(Nt,"\0");let r=0,n=e.length;for(;e.charAt(r)==="\0";)r++;if(r===n)return[];for(;e.charAt(n-1)==="\0";)n--;return e.slice(r,n).split(/\0/g)}function Lt(t){const e=ze(t);for(let r=0;r<e.length;r++){const n=e[r],i=Dt.exec(n);if(i){const a=i.index+(i[1]??i[2]).length;e.splice(r,1,n.slice(0,a),n.slice(a))}}return e}function Ie(t,e){const[r,n,i]=wt(t,e),a=Pt(e==null?void 0:e.locale),l=jt(e==null?void 0:e.locale),d=e!=null&&e.mergeAmbiguousCharacters?Ct(a,l):yt(a,l);return r+n.map(d).join((e==null?void 0:e.delimiter)??"")+i}function Pt(t){return t===!1?e=>e.toLowerCase():e=>e.toLocaleLowerCase(t)}function jt(t){return t===!1?e=>e.toUpperCase():e=>e.toLocaleUpperCase(t)}function Ct(t,e){return r=>`${e(r[0])}${t(r.slice(1))}`}function yt(t,e){return(r,n)=>{const i=r[0];return(n>0&&i>="0"&&i<="9"?"_"+i:e(i))+t(r.slice(1))}}function wt(t,e={}){const r=e.split??(e.separateNumbers?Lt:ze),n=e.prefixCharacters??Ae,i=e.suffixCharacters??Ae;let a=0,l=t.length;for(;a<t.length;){const d=t.charAt(a);if(!n.includes(d))break;a++}for(;l>a;){const d=l-1,zt=t.charAt(d);if(!i.includes(zt))break;l=d}return[t.slice(0,a),r(t.slice(a,l)),t.slice(l)]}function T(t,e=!1){const r=[];if(e&&t==="")return r;try{const n=JSON.parse(t);!e&&!Object.keys(n).length&&r.push({message:"Initial state cannot be empty",details:{initialState:t}})}catch{r.push({message:"Invalid initial state",details:{initialState:t}})}return r}function R(t,e,r="",n=!0){const i=[];if(!n&&!t)return i.push({message:"State schema is required",details:{schema:t}}),i;if(n&&!t)return i;const a=`type ${Ie(e)}${Ie(r)}State`;return t.includes(a)||i.push({message:`Invalid state schema name. Expected ${a}`,details:{schema:t}}),i}function x(t){const e=[];t.length||e.push({message:"Modules are required",details:{modules:t}});const r=t.reduce((n,i)=>[...n,...b(i)],[]);return[...e,...r]}function b(t){const e=[];t.name||e.push({message:"Module name is required",details:{module:t}}),t.operations.length||e.push({message:"Module operations are required",details:{module:t}});const r=t.operations.reduce((n,i)=>[...n,..._(i)],[]);return[...e,...r]}function _(t){const e=[];return t.name||e.push({message:"Operation name is required",details:{operation:t}}),t.schema||e.push({message:"Operation schema is required",details:{operation:t}}),e}const kt=Object.freeze(Object.defineProperty({__proto__:null,validateInitialState:T,validateModule:b,validateModuleOperation:_,validateModules:x,validateStateSchemaName:R},Symbol.toStringTag,{value:"Module"})),M={id:"powerhouse/document-model",name:"DocumentModel",extension:"phdm",description:"The Powerhouse Document Model describes the state and operations of a document type.",author:{name:"Powerhouse",website:"https://www.powerhouse.inc/"},specifications:[{version:1,changeLog:[],modules:[{name:"header",operations:[{name:"SetModelName",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetModelId",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetModelExtension",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetModelDescription",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetAuthorName",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetAuthorWebsite",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""},{name:"versioning",operations:[{name:"AddChangeLogItem",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"UpdateChangeLogItem",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"DeleteChangeLogItem",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReorderChangeLogItems",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReleaseNewVersion",schema:null,id:"",description:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""},{name:"module",operations:[{name:"AddModule",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetModuleName",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetModuleDescription",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"DeleteModule",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReorderModules",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""},{name:"operation-error",operations:[{name:"AddOperationError",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationErrorCode",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationErrorName",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationErrorDescription",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationErrorTemplate",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"DeleteOperationError",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReorderOperationErrors",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""},{name:"operation-example",operations:[{name:"AddOperationExample",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"UpdateOperationExample",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"DeleteOperationExample",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReorderOperationExamples",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""},{name:"operation",operations:[{name:"AddOperation",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationName",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationSchema",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationDescription",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationTemplate",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationReducer",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"MoveOperation",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"DeleteOperation",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReorderModuleOperations",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""},{name:"state",operations:[{name:"SetStateSchema",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetInitialState",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"AddStateExample",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"UpdateStateExample",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"DeleteStateExample",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReorderStateExamples",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""}],state:{global:{schema:"",initialValue:`{
2
- "id": "",
3
- "name": "",
4
- "extension": "",
5
- "description": "",
6
- "author": {
7
- "name": "",
8
- "website": ""
9
- },
10
- "specifications": [
11
- {
12
- "version": 1,
13
- "changeLog": [],
14
- "state": {
15
- "schema": "",
16
- "initialValue": "",
17
- "examples": []
18
- },
19
- "modules": []
20
- }
21
- ]
22
- }`,examples:[]},local:{schema:"",initialValue:"{}",examples:[]}}}]},Te=t=>t!=null,vt=o.z.any().refine(t=>Te(t));function D(){return o.z.object({__typename:o.z.literal("AddChangeLogItemInput").optional(),content:o.z.string(),id:o.z.string(),insertBefore:o.z.string().nullable()})}function N(){return o.z.object({description:o.z.string().nullish(),id:o.z.string(),name:o.z.string()})}function L(){return o.z.object({errorCode:o.z.string().nullish(),errorDescription:o.z.string().nullish(),errorName:o.z.string().nullish(),errorTemplate:o.z.string().nullish(),id:o.z.string(),operationId:o.z.string()})}function P(){return o.z.object({example:o.z.string(),id:o.z.string(),operationId:o.z.string()})}function j(){return o.z.object({description:o.z.string().nullish(),id:o.z.string(),moduleId:o.z.string(),name:o.z.string(),reducer:o.z.string().nullish(),schema:o.z.string().nullish(),template:o.z.string().nullish(),scope:A().nullish()})}function C(){return o.z.object({scope:o.z.string(),example:o.z.string(),id:o.z.string(),insertBefore:o.z.string().nullish()})}function Re(){return o.z.object({__typename:o.z.literal("Author").optional(),name:o.z.string(),website:o.z.string().nullable()})}function y(){return o.z.object({__typename:o.z.literal("CodeExample").optional(),id:o.z.string(),value:o.z.string()})}function w(){return o.z.object({__typename:o.z.literal("DeleteChangeLogItemInput").optional(),id:o.z.string()})}function k(){return o.z.object({id:o.z.string()})}function v(){return o.z.object({id:o.z.string()})}function U(){return o.z.object({id:o.z.string()})}function F(){return o.z.object({id:o.z.string()})}function $(){return o.z.object({scope:o.z.string(),id:o.z.string()})}function A(){return o.z.literal("global").or(o.z.literal("local"))}function Ut(){return o.z.union([D(),N(),L(),P(),j(),C(),w(),k(),v(),U(),F(),$(),V(),X(),H(),G(),B(),q(),W(),J(),K(),Q(),Y(),Z(),ee(),te(),re(),oe(),ne(),ie(),se(),ae(),pe(),le(),ce(),de(),ue(),me(),Ee(),he(),Oe()])}function Ft(){return o.z.object({__typename:o.z.literal("DocumentModelState").optional(),author:Re(),description:o.z.string(),extension:o.z.string(),id:o.z.string(),name:o.z.string(),specifications:o.z.array(xe())})}function xe(){return o.z.object({__typename:o.z.literal("DocumentSpecification").optional(),changeLog:o.z.array(o.z.string()),modules:o.z.array(Me()),state:Pe(),version:o.z.number()})}function Me(){return o.z.object({__typename:o.z.literal("Module").optional(),description:o.z.string().nullable(),id:o.z.string(),name:o.z.string(),operations:o.z.array(De())})}function V(){return o.z.object({newModuleId:o.z.string(),operationId:o.z.string()})}function De(){return o.z.object({__typename:o.z.literal("Operation").optional(),description:o.z.string().nullable(),errors:o.z.array(Ne()),examples:o.z.array(y()),id:o.z.string(),name:o.z.string().nullable(),reducer:o.z.string().nullable(),schema:o.z.string().nullable(),template:o.z.string().nullable(),scope:A()})}function Ne(){return o.z.object({__typename:o.z.literal("OperationError").optional(),code:o.z.string().nullable(),description:o.z.string().nullable(),id:o.z.string(),name:o.z.string().nullable(),template:o.z.string().nullable()})}function X(){return o.z.object({__typename:o.z.literal("ReorderChangeLogItemsInput").optional(),order:o.z.array(o.z.string())})}function H(){return o.z.object({moduleId:o.z.string(),order:o.z.array(o.z.string())})}function G(){return o.z.object({order:o.z.array(o.z.string())})}function B(){return o.z.object({operationId:o.z.string(),order:o.z.array(o.z.string())})}function q(){return o.z.object({operationId:o.z.string(),order:o.z.array(o.z.string())})}function W(){return o.z.object({scope:o.z.string(),order:o.z.array(o.z.string())})}function J(){return o.z.object({authorName:o.z.string()})}function K(){return o.z.object({authorWebsite:o.z.string()})}function Q(){return o.z.object({scope:o.z.string(),initialValue:o.z.string()})}function Y(){return o.z.object({description:o.z.string()})}function Z(){return o.z.object({extension:o.z.string()})}function ee(){return o.z.object({id:o.z.string()})}function te(){return o.z.object({name:o.z.string()})}function re(){return o.z.object({description:o.z.string().nullish(),id:o.z.string()})}function oe(){return o.z.object({id:o.z.string(),name:o.z.string().nullish()})}function ne(){return o.z.object({description:o.z.string().nullish(),id:o.z.string()})}function ie(){return o.z.object({errorCode:o.z.string().nullish(),id:o.z.string()})}function se(){return o.z.object({errorDescription:o.z.string().nullish(),id:o.z.string()})}function ae(){return o.z.object({errorName:o.z.string().nullish(),id:o.z.string()})}function pe(){return o.z.object({errorTemplate:o.z.string().nullish(),id:o.z.string()})}function le(){return o.z.object({id:o.z.string(),name:o.z.string().nullish()})}function Le(){return o.z.object({id:o.z.string(),scope:A()})}function ce(){return o.z.object({id:o.z.string(),reducer:o.z.string().nullish()})}function de(){return o.z.object({id:o.z.string(),schema:o.z.string().nullish()})}function ue(){return o.z.object({id:o.z.string(),template:o.z.string().nullish()})}function me(){return o.z.object({scope:o.z.string(),schema:o.z.string()})}function z(){return o.z.object({__typename:o.z.literal("State").optional(),examples:o.z.array(y()),initialValue:o.z.string(),schema:o.z.string()})}function Pe(){return o.z.object({global:z(),local:z()})}function Ee(){return o.z.object({__typename:o.z.literal("UpdateChangeLogItemInput").optional(),id:o.z.string(),newContent:o.z.string()})}function he(){return o.z.object({example:o.z.string(),id:o.z.string()})}function Oe(){return o.z.object({scope:o.z.string(),id:o.z.string(),newExample:o.z.string()})}const je=Object.freeze(Object.defineProperty({__proto__:null,AddChangeLogItemInputSchema:D,AddModuleInputSchema:N,AddOperationErrorInputSchema:L,AddOperationExampleInputSchema:P,AddOperationInputSchema:j,AddStateExampleInputSchema:C,AuthorSchema:Re,CodeExampleSchema:y,DeleteChangeLogItemInputSchema:w,DeleteModuleInputSchema:k,DeleteOperationErrorInputSchema:v,DeleteOperationExampleInputSchema:U,DeleteOperationInputSchema:F,DeleteStateExampleInputSchema:$,DocumentModelInputSchema:Ut,DocumentModelStateSchema:Ft,DocumentSpecificationSchema:xe,ModuleSchema:Me,MoveOperationInputSchema:V,OperationErrorSchema:Ne,OperationSchema:De,OperationScopeSchema:A,ReorderChangeLogItemsInputSchema:X,ReorderModuleOperationsInputSchema:H,ReorderModulesInputSchema:G,ReorderOperationErrorsInputSchema:B,ReorderOperationExamplesInputSchema:q,ReorderStateExamplesInputSchema:W,ScopeStateSchema:Pe,SetAuthorNameInputSchema:J,SetAuthorWebsiteInputSchema:K,SetInitialStateInputSchema:Q,SetModelDescriptionInputSchema:Y,SetModelExtensionInputSchema:Z,SetModelIdInputSchema:ee,SetModelNameInputSchema:te,SetModuleDescriptionInputSchema:re,SetModuleNameInputSchema:oe,SetOperationDescriptionInputSchema:ne,SetOperationErrorCodeInputSchema:ie,SetOperationErrorDescriptionInputSchema:se,SetOperationErrorNameInputSchema:ae,SetOperationErrorTemplateInputSchema:pe,SetOperationNameInputSchema:le,SetOperationReducerInputSchema:ce,SetOperationSchemaInputSchema:de,SetOperationScopeInputSchema:Le,SetOperationTemplateInputSchema:ue,SetStateSchemaInputSchema:me,StateSchema:z,UpdateChangeLogItemInputSchema:Ee,UpdateOperationExampleInputSchema:he,UpdateStateExampleInputSchema:Oe,definedNonNullAnySchema:vt,isDefinedNonNullAny:Te},Symbol.toStringTag,{value:"Module"})),u={setModelNameOperation(t,e){t.name=e.input.name},setModelIdOperation(t,e){t.id=e.input.id},setModelExtensionOperation(t,e){t.extension=e.input.extension},setModelDescriptionOperation(t,e){t.description=e.input.description},setAuthorNameOperation(t,e){t.author=t.author||{name:"",website:null},t.author.name=e.input.authorName},setAuthorWebsiteOperation(t,e){t.author=t.author||{name:"",website:null},t.author.website=e.input.authorWebsite}},O={addChangeLogItemOperation(t,e){throw new Error('Reducer "addChangeLogItemOperation" not yet implemented')},updateChangeLogItemOperation(t,e){throw new Error('Reducer "updateChangeLogItemOperation" not yet implemented')},deleteChangeLogItemOperation(t,e){throw new Error('Reducer "deleteChangeLogItemOperation" not yet implemented')},reorderChangeLogItemsOperation(t,e){throw new Error('Reducer "reorderChangeLogItemsOperation" not yet implemented')},releaseNewVersionOperation(t,e){throw new Error('Reducer "releaseNewVersionOperation" not yet implemented')}},$t=t=>{const e={};return t.forEach((r,n)=>e[r]=n),(r,n)=>(e[n.id]||999999)-(e[r.id]||999999)},g={addModuleOperation(t,e){t.specifications[t.specifications.length-1].modules.push({id:e.input.id,name:e.input.name,description:e.input.description||"",operations:[]})},setModuleNameOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)r.modules[n].id===e.input.id&&(r.modules[n].name=e.input.name||"")},setModuleDescriptionOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)r.modules[n].id===e.input.id&&(r.modules[n].description=e.input.description||"")},deleteModuleOperation(t,e){const r=t.specifications[t.specifications.length-1];r.modules=r.modules.filter(n=>n.id!=e.input.id)},reorderModulesOperation(t,e){t.specifications[t.specifications.length-1].modules.sort($t(e.input.order))}},Vt=t=>{const e={};return t.forEach((r,n)=>e[r]=n),(r,n)=>(e[n.id]||999999)-(e[r.id]||999999)},c={addOperationErrorOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)r.modules[n].operations[i].id==e.input.operationId&&r.modules[n].operations[i].errors.push({id:e.input.id,name:e.input.errorName||"",code:e.input.errorCode||"",description:e.input.errorDescription||"",template:e.input.errorTemplate||""})},setOperationErrorCodeOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)for(let a=0;a<r.modules[n].operations[i].errors.length;a++)r.modules[n].operations[i].errors[a].id==e.input.id&&(r.modules[n].operations[i].errors[a].code=e.input.errorCode||"")},setOperationErrorNameOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)for(let a=0;a<r.modules[n].operations[i].errors.length;a++)r.modules[n].operations[i].errors[a].id==e.input.id&&(r.modules[n].operations[i].errors[a].name=e.input.errorName||"")},setOperationErrorDescriptionOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)for(let a=0;a<r.modules[n].operations[i].errors.length;a++)r.modules[n].operations[i].errors[a].id==e.input.id&&(r.modules[n].operations[i].errors[a].description=e.input.errorDescription||"")},setOperationErrorTemplateOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)for(let a=0;a<r.modules[n].operations[i].errors.length;a++)r.modules[n].operations[i].errors[a].id==e.input.id&&(r.modules[n].operations[i].errors[a].template=e.input.errorTemplate||"")},deleteOperationErrorOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)r.modules[n].operations[i].errors=r.modules[n].operations[i].errors.filter(a=>a.id!=e.input.id)},reorderOperationErrorsOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)r.modules[n].operations[i].id==e.input.operationId&&r.modules[n].operations[i].errors.sort(Vt(e.input.order))}},Xt=t=>{const e={};return t.forEach((r,n)=>e[r]=n),(r,n)=>(e[n.id]||999999)-(e[r.id]||999999)},f={addOperationExampleOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)r.modules[n].operations[i].id==e.input.operationId&&r.modules[n].operations[i].examples.push({id:e.input.id,value:e.input.example})},updateOperationExampleOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)for(let a=0;a<r.modules[n].operations[i].examples.length;a++)r.modules[n].operations[i].examples[a].id==e.input.id&&(r.modules[n].operations[i].examples[a].value=e.input.example)},deleteOperationExampleOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)r.modules[n].operations[i].examples=r.modules[n].operations[i].examples.filter(a=>a.id!=e.input.id)},reorderOperationExamplesOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)r.modules[n].operations[i].id==e.input.operationId&&r.modules[n].operations[i].examples.sort(Xt(e.input.order))}},Ht=t=>{const e={};return t.forEach((r,n)=>e[r]=n),(r,n)=>(e[n.id]||999999)-(e[r.id]||999999)},p={addOperationOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)r.modules[n].id==e.input.moduleId&&r.modules[n].operations.push({id:e.input.id,name:e.input.name,description:e.input.description||"",schema:e.input.schema||"",template:e.input.template||e.input.description||"",reducer:e.input.reducer||"",errors:[],examples:[],scope:e.input.scope||"global"})},setOperationNameOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)r.modules[n].operations[i].id==e.input.id&&(r.modules[n].operations[i].name=e.input.name||"")},setOperationScopeOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)r.modules[n].operations[i].id==e.input.id&&(r.modules[n].operations[i].scope=e.input.scope||"global")},setOperationSchemaOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)r.modules[n].operations[i].id==e.input.id&&(r.modules[n].operations[i].schema=e.input.schema||"")},setOperationDescriptionOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)r.modules[n].operations[i].id==e.input.id&&(r.modules[n].operations[i].description=e.input.description||"")},setOperationTemplateOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)r.modules[n].operations[i].id==e.input.id&&(r.modules[n].operations[i].template=e.input.template||"")},setOperationReducerOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)r.modules[n].operations[i].id==e.input.id&&(r.modules[n].operations[i].reducer=e.input.reducer||"")},moveOperationOperation(t,e){const r=[],n=t.specifications[t.specifications.length-1];for(let i=0;i<n.modules.length;i++)n.modules[i].operations=n.modules[i].operations.filter(a=>a.id==e.input.operationId?(r.push(a),!1):!0);for(let i=0;i<n.modules.length;i++)n.modules[i].id==e.input.newModuleId&&n.modules[i].operations.push(...r)},deleteOperationOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)r.modules[n].operations=r.modules[n].operations.filter(i=>i.id!=e.input.id)},reorderModuleOperationsOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)r.modules[n].id==e.input.moduleId&&r.modules[n].operations.sort(Ht(e.input.order))}},Gt=t=>{const e={};return t.forEach((r,n)=>e[r]=n),(r,n)=>(e[n.id]||999999)-(e[r.id]||999999)},m={setStateSchemaOperation(t,e){const r=t.specifications[t.specifications.length-1];if(Object.keys(r.state).includes(e.input.scope))r.state[e.input.scope].schema=e.input.schema;else throw new Error(`Invalid scope: ${e.input.scope}`)},setInitialStateOperation(t,e){const r=t.specifications[t.specifications.length-1];if(Object.keys(r.state).includes(e.input.scope))r.state[e.input.scope].initialValue=e.input.initialValue;else throw new Error(`Invalid scope: ${e.input.scope}`)},addStateExampleOperation(t,e){const r=t.specifications[t.specifications.length-1];if(Object.keys(r.state).includes(e.input.scope))r.state[e.input.scope].examples.push({id:e.input.id,value:e.input.example});else throw new Error(`Invalid scope: ${e.input.scope}`)},updateStateExampleOperation(t,e){const r=t.specifications[t.specifications.length-1];if(!Object.keys(r.state).includes(e.input.scope))throw new Error(`Invalid scope: ${e.input.scope}`);const n=r.state[e.input.scope].examples;for(let i=0;i<n.length;i++)n[i].id==e.input.id&&(n[i].value=e.input.newExample)},deleteStateExampleOperation(t,e){const r=t.specifications[t.specifications.length-1];if(Object.keys(r.state).includes(e.input.scope))r.state[e.input.scope].examples=r.state[e.input.scope].examples.filter(n=>n.id!=e.input.id);else throw new Error(`Invalid scope: ${e.input.scope}`)},reorderStateExamplesOperation(t,e){const r=t.specifications[t.specifications.length-1];if(Object.keys(r.state).includes(e.input.scope))r.state[e.input.scope].examples.sort(Gt(e.input.order));else throw new Error(`Invalid scope: ${e.input.scope}`)}},Bt=(t,e)=>{if(s.isBaseAction(e))return t;switch(e.type){case"SET_MODEL_NAME":te().parse(e.input),u.setModelNameOperation(t.global,e);break;case"SET_MODEL_ID":ee().parse(e.input),u.setModelIdOperation(t.global,e);break;case"SET_MODEL_EXTENSION":Z().parse(e.input),u.setModelExtensionOperation(t.global,e);break;case"SET_MODEL_DESCRIPTION":Y().parse(e.input),u.setModelDescriptionOperation(t.global,e);break;case"SET_AUTHOR_NAME":J().parse(e.input),u.setAuthorNameOperation(t.global,e);break;case"SET_AUTHOR_WEBSITE":K().parse(e.input),u.setAuthorWebsiteOperation(t.global,e);break;case"ADD_CHANGE_LOG_ITEM":D().parse(e.input),O.addChangeLogItemOperation(t.global,e);break;case"UPDATE_CHANGE_LOG_ITEM":Ee().parse(e.input),O.updateChangeLogItemOperation(t.global,e);break;case"DELETE_CHANGE_LOG_ITEM":w().parse(e.input),O.deleteChangeLogItemOperation(t.global,e);break;case"REORDER_CHANGE_LOG_ITEMS":X().parse(e.input),O.reorderChangeLogItemsOperation(t.global,e);break;case"RELEASE_NEW_VERSION":if(Object.keys(e.input).length>0)throw new Error("Expected empty input for action RELEASE_NEW_VERSION");O.releaseNewVersionOperation(t.global,e);break;case"ADD_MODULE":N().parse(e.input),g.addModuleOperation(t.global,e);break;case"SET_MODULE_NAME":oe().parse(e.input),g.setModuleNameOperation(t.global,e);break;case"SET_MODULE_DESCRIPTION":re().parse(e.input),g.setModuleDescriptionOperation(t.global,e);break;case"DELETE_MODULE":k().parse(e.input),g.deleteModuleOperation(t.global,e);break;case"REORDER_MODULES":G().parse(e.input),g.reorderModulesOperation(t.global,e);break;case"ADD_OPERATION_ERROR":L().parse(e.input),c.addOperationErrorOperation(t.global,e);break;case"SET_OPERATION_ERROR_CODE":ie().parse(e.input),c.setOperationErrorCodeOperation(t.global,e);break;case"SET_OPERATION_ERROR_NAME":ae().parse(e.input),c.setOperationErrorNameOperation(t.global,e);break;case"SET_OPERATION_ERROR_DESCRIPTION":se().parse(e.input),c.setOperationErrorDescriptionOperation(t.global,e);break;case"SET_OPERATION_ERROR_TEMPLATE":pe().parse(e.input),c.setOperationErrorTemplateOperation(t.global,e);break;case"DELETE_OPERATION_ERROR":v().parse(e.input),c.deleteOperationErrorOperation(t.global,e);break;case"REORDER_OPERATION_ERRORS":B().parse(e.input),c.reorderOperationErrorsOperation(t.global,e);break;case"ADD_OPERATION_EXAMPLE":P().parse(e.input),f.addOperationExampleOperation(t.global,e);break;case"UPDATE_OPERATION_EXAMPLE":he().parse(e.input),f.updateOperationExampleOperation(t.global,e);break;case"DELETE_OPERATION_EXAMPLE":U().parse(e.input),f.deleteOperationExampleOperation(t.global,e);break;case"REORDER_OPERATION_EXAMPLES":q().parse(e.input),f.reorderOperationExamplesOperation(t.global,e);break;case"ADD_OPERATION":j().parse(e.input),p.addOperationOperation(t.global,e);break;case"SET_OPERATION_NAME":le().parse(e.input),p.setOperationNameOperation(t.global,e);break;case"SET_OPERATION_SCOPE":Le().parse(e.input),p.setOperationScopeOperation(t.global,e);break;case"SET_OPERATION_SCHEMA":de().parse(e.input),p.setOperationSchemaOperation(t.global,e);break;case"SET_OPERATION_DESCRIPTION":ne().parse(e.input),p.setOperationDescriptionOperation(t.global,e);break;case"SET_OPERATION_TEMPLATE":ue().parse(e.input),p.setOperationTemplateOperation(t.global,e);break;case"SET_OPERATION_REDUCER":ce().parse(e.input),p.setOperationReducerOperation(t.global,e);break;case"MOVE_OPERATION":V().parse(e.input),p.moveOperationOperation(t.global,e);break;case"DELETE_OPERATION":F().parse(e.input),p.deleteOperationOperation(t.global,e);break;case"REORDER_MODULE_OPERATIONS":H().parse(e.input),p.reorderModuleOperationsOperation(t.global,e);break;case"SET_STATE_SCHEMA":me().parse(e.input),m.setStateSchemaOperation(t.global,e);break;case"SET_INITIAL_STATE":Q().parse(e.input),m.setInitialStateOperation(t.global,e);break;case"ADD_STATE_EXAMPLE":C().parse(e.input),m.addStateExampleOperation(t.global,e);break;case"UPDATE_STATE_EXAMPLE":Oe().parse(e.input),m.updateStateExampleOperation(t.global,e);break;case"DELETE_STATE_EXAMPLE":$().parse(e.input),m.deleteStateExampleOperation(t.global,e);break;case"REORDER_STATE_EXAMPLES":W().parse(e.input),m.reorderStateExamplesOperation(t.global,e);break;default:return t}},h=s.createReducer(Bt),qt={id:"",name:"",extension:"",description:"",author:{name:"",website:""},specifications:[{version:1,changeLog:[],state:{global:{schema:"",initialValue:"",examples:[]},local:{schema:"",initialValue:"",examples:[]}},modules:[]}]},Wt={},S={fileExtension:"phdm",createState(t){return{global:{...qt,...t==null?void 0:t.global},local:{...Wt,...t==null?void 0:t.local}}},createExtendedState(t){return s.createExtendedState({...t,documentType:"powerhouse/document-model"},S.createState)},createDocument(t){return s.createDocument(S.createExtendedState(t),S.createState)},saveToFile(t,e,r){return s.saveToFile(t,e,"phdm",r)},saveToFileHandle(t,e){return s.saveToFileHandle(t,e)},loadFromFile(t){return s.loadFromFile(t,h)},loadFromInput(t){return s.loadFromInput(t,h)}},Ce=t=>s.createAction("SET_MODEL_NAME",{...t}),ye=t=>s.createAction("SET_MODEL_ID",{...t}),we=t=>s.createAction("SET_MODEL_EXTENSION",{...t}),ke=t=>s.createAction("SET_MODEL_DESCRIPTION",{...t}),ve=t=>s.createAction("SET_AUTHOR_NAME",{...t}),Ue=t=>s.createAction("SET_AUTHOR_WEBSITE",{...t});class Jt extends s.BaseDocument{setModelName(e,r){return this.dispatch(Ce(e),r)}setModelId(e,r){return this.dispatch(ye(e),r)}setModelExtension(e,r){return this.dispatch(we(e),r)}setModelDescription(e,r){return this.dispatch(ke(e),r)}setAuthorName(e,r){return this.dispatch(ve(e),r)}setAuthorWebsite(e,r){return this.dispatch(Ue(e),r)}}const Fe=t=>s.createAction("ADD_CHANGE_LOG_ITEM",{...t}),$e=t=>s.createAction("UPDATE_CHANGE_LOG_ITEM",{...t}),Ve=t=>s.createAction("DELETE_CHANGE_LOG_ITEM",{...t}),Xe=t=>s.createAction("REORDER_CHANGE_LOG_ITEMS",{...t}),He=()=>s.createAction("RELEASE_NEW_VERSION");class Kt extends s.BaseDocument{addChangeLogItem(e,r){return this.dispatch(Fe(e),r)}updateChangeLogItem(e,r){return this.dispatch($e(e),r)}deleteChangeLogItem(e,r){return this.dispatch(Ve(e),r)}reorderChangeLogItems(e,r){return this.dispatch(Xe(e),r)}releaseNewVersion(e){return this.dispatch(He(),e)}}const Ge=t=>s.createAction("ADD_MODULE",{...t}),Be=t=>s.createAction("SET_MODULE_NAME",{...t}),qe=t=>s.createAction("SET_MODULE_DESCRIPTION",{...t}),We=t=>s.createAction("DELETE_MODULE",{...t}),Je=t=>s.createAction("REORDER_MODULES",{...t});class Qt extends s.BaseDocument{addModule(e,r){return this.dispatch(Ge(e),r)}setModuleName(e,r){return this.dispatch(Be(e),r)}setModuleDescription(e,r){return this.dispatch(qe(e),r)}deleteModule(e,r){return this.dispatch(We(e),r)}reorderModules(e,r){return this.dispatch(Je(e),r)}}const Ke=t=>s.createAction("ADD_OPERATION_ERROR",{...t}),Qe=t=>s.createAction("SET_OPERATION_ERROR_CODE",{...t}),Ye=t=>s.createAction("SET_OPERATION_ERROR_NAME",{...t}),Ze=t=>s.createAction("SET_OPERATION_ERROR_DESCRIPTION",{...t}),et=t=>s.createAction("SET_OPERATION_ERROR_TEMPLATE",{...t}),tt=t=>s.createAction("DELETE_OPERATION_ERROR",{...t}),rt=t=>s.createAction("REORDER_OPERATION_ERRORS",{...t});class Yt extends s.BaseDocument{addOperationError(e,r){return this.dispatch(Ke(e),r)}setOperationErrorCode(e,r){return this.dispatch(Qe(e),r)}setOperationErrorName(e,r){return this.dispatch(Ye(e),r)}setOperationErrorDescription(e,r){return this.dispatch(Ze(e),r)}setOperationErrorTemplate(e,r){return this.dispatch(et(e),r)}deleteOperationError(e,r){return this.dispatch(tt(e),r)}reorderOperationErrors(e,r){return this.dispatch(rt(e),r)}}const ot=t=>s.createAction("ADD_OPERATION_EXAMPLE",{...t}),nt=t=>s.createAction("UPDATE_OPERATION_EXAMPLE",{...t}),it=t=>s.createAction("DELETE_OPERATION_EXAMPLE",{...t}),st=t=>s.createAction("REORDER_OPERATION_EXAMPLES",{...t});class Zt extends s.BaseDocument{addOperationExample(e,r){return this.dispatch(ot(e),r)}updateOperationExample(e,r){return this.dispatch(nt(e),r)}deleteOperationExample(e,r){return this.dispatch(it(e),r)}reorderOperationExamples(e,r){return this.dispatch(st(e),r)}}const at=t=>s.createAction("ADD_OPERATION",{...t}),pt=t=>s.createAction("SET_OPERATION_NAME",{...t}),lt=t=>s.createAction("SET_OPERATION_SCOPE",{...t}),ct=t=>s.createAction("SET_OPERATION_SCHEMA",{...t}),dt=t=>s.createAction("SET_OPERATION_DESCRIPTION",{...t}),ut=t=>s.createAction("SET_OPERATION_TEMPLATE",{...t}),mt=t=>s.createAction("SET_OPERATION_REDUCER",{...t}),Et=t=>s.createAction("MOVE_OPERATION",{...t}),ht=t=>s.createAction("DELETE_OPERATION",{...t}),Ot=t=>s.createAction("REORDER_MODULE_OPERATIONS",{...t});class er extends s.BaseDocument{addOperation(e,r){return this.dispatch(at(e),r)}setOperationName(e,r){return this.dispatch(pt(e),r)}setOperationScope(e,r){return this.dispatch(lt(e),r)}setOperationSchema(e,r){return this.dispatch(ct(e),r)}setOperationDescription(e,r){return this.dispatch(dt(e),r)}setOperationTemplate(e,r){return this.dispatch(ut(e),r)}setOperationReducer(e,r){return this.dispatch(mt(e),r)}moveOperation(e,r){return this.dispatch(Et(e),r)}deleteOperation(e,r){return this.dispatch(ht(e),r)}reorderModuleOperations(e,r){return this.dispatch(Ot(e),r)}}const gt=t=>s.createAction("SET_STATE_SCHEMA",{...t}),St=t=>s.createAction("SET_INITIAL_STATE",{...t}),ft=t=>s.createAction("ADD_STATE_EXAMPLE",{...t}),bt=t=>s.createAction("UPDATE_STATE_EXAMPLE",{...t}),_t=t=>s.createAction("DELETE_STATE_EXAMPLE",{...t}),At=t=>s.createAction("REORDER_STATE_EXAMPLES",{...t});class tr extends s.BaseDocument{setStateSchema(e,r){return this.dispatch(gt(e),r)}setInitialState(e,r){return this.dispatch(St(e),r)}addStateExample(e,r){return this.dispatch(ft(e),r)}updateStateExample(e,r){return this.dispatch(bt(e),r)}deleteStateExample(e,r){return this.dispatch(_t(e),r)}reorderStateExamples(e,r){return this.dispatch(At(e),r)}}var E;let I=(E=class extends s.BaseDocument{constructor(e,r){super(h,S.createDocument(e),r)}saveToFile(e,r){return super.saveToFile(e,E.fileExtension,r)}loadFromFile(e){return super.loadFromFile(e)}static async fromFile(e){const r=new this;return await r.loadFromFile(e),r}},be(E,"fileExtension","phdm"),E);s.applyMixins(I,[Jt,Kt,Qt,Yt,Zt,er,tr]);const rr=Object.freeze(Object.defineProperty({__proto__:null,addChangeLogItem:Fe,addModule:Ge,addOperation:at,addOperationError:Ke,addOperationExample:ot,addStateExample:ft,deleteChangeLogItem:Ve,deleteModule:We,deleteOperation:ht,deleteOperationError:tt,deleteOperationExample:it,deleteStateExample:_t,moveOperation:Et,releaseNewVersion:He,reorderChangeLogItems:Xe,reorderModuleOperations:Ot,reorderModules:Je,reorderOperationErrors:rt,reorderOperationExamples:st,reorderStateExamples:At,setAuthorName:ve,setAuthorWebsite:Ue,setInitialState:St,setModelDescription:ke,setModelExtension:we,setModelId:ye,setModelName:Ce,setModuleDescription:qe,setModuleName:Be,setOperationDescription:dt,setOperationErrorCode:Qe,setOperationErrorDescription:Ze,setOperationErrorName:Ye,setOperationErrorTemplate:et,setOperationName:pt,setOperationReducer:mt,setOperationSchema:ct,setOperationScope:lt,setOperationTemplate:ut,setStateSchema:gt,updateChangeLogItem:$e,updateOperationExample:nt,updateStateExample:bt},Symbol.toStringTag,{value:"Module"})),ge=I,Se={...S,...kt},fe={...s.BaseActions,...rr},It={Document:ge,reducer:h,actions:fe,utils:Se,documentModel:M},or=Object.freeze(Object.defineProperty({__proto__:null,Document:ge,DocumentModel:I,actions:fe,documentModel:M,module:It,reducer:h,utils:Se,validateInitialState:T,validateModule:b,validateModuleOperation:_,validateModules:x,validateStateSchemaName:R,z:je},Symbol.toStringTag,{value:"Module"}));exports.Document=ge;exports.DocumentModel=or;exports.DocumentModel$1=I;exports.actions=fe;exports.documentModel=M;exports.module=It;exports.reducer=h;exports.utils=Se;exports.validateInitialState=T;exports.validateModule=b;exports.validateModuleOperation=_;exports.validateModules=x;exports.validateStateSchemaName=R;exports.zod=je;
@@ -1,20 +0,0 @@
1
- "use strict";var se=Object.defineProperty;var ae=(e,t,i)=>t in e?se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var ot=(e,t,i)=>(ae(e,typeof t!="symbol"?t+"":t,i),i);const U=require("immer"),m=require("zod"),pe=require("crypto"),lt=require("fs"),ce=require("https"),le=require("path"),zt=require("jszip"),Et=e=>e!=null,me=m.z.any().refine(e=>Et(e)),vt=m.z.enum(["LOAD_STATE"]),Tt=m.z.enum(["PRUNE"]),kt=m.z.enum(["REDO"]),_t=m.z.enum(["SET_NAME"]),Dt=m.z.enum(["UNDO"]);function ue(){return m.z.object({__typename:m.z.literal("Action").optional(),type:m.z.string()})}function X(){return m.z.literal("global").or(m.z.literal("local"))}function At(){return m.z.union([Nt(),It(),Pt(),Ft(),Rt()])}function fe(){return m.z.object({__typename:m.z.literal("DocumentFile").optional(),data:m.z.string(),extension:m.z.string().nullable(),fileName:m.z.string().nullable(),mimeType:m.z.string()})}function Nt(){return m.z.object({input:m.z.lazy(()=>gt()),type:vt,scope:X()})}function gt(){return m.z.object({operations:m.z.number(),state:m.z.lazy(()=>Mt())})}function Mt(){return m.z.object({data:m.z.unknown().nullish(),name:m.z.string()})}function de(){return m.z.object({__typename:m.z.literal("Operation").optional(),hash:m.z.string(),index:m.z.number(),timestamp:m.z.string().datetime(),type:m.z.string()})}function It(){return m.z.object({input:m.z.lazy(()=>ht()),type:Tt,scope:X()})}function ht(){return m.z.object({end:m.z.number().nullish(),start:m.z.number().nullish()})}const xt=m.z.number;function Pt(){return m.z.object({input:xt(),type:kt,scope:X()})}const yt=m.z.string;function Ft(){return m.z.object({input:yt(),type:_t,scope:m.z.literal("global")})}function ge(){return m.z.object({__typename:m.z.literal("SetNameOperation").optional(),hash:m.z.string(),index:m.z.number(),input:m.z.string(),timestamp:m.z.string().datetime(),type:m.z.string()})}const bt=m.z.number;function Rt(){return m.z.object({input:bt(),type:Dt,scope:X()})}const he=Object.freeze(Object.defineProperty({__proto__:null,ActionSchema:ue,BaseActionSchema:At,DocumentFileSchema:fe,LoadStateActionInputSchema:gt,LoadStateActionSchema:Nt,LoadStateActionStateInputSchema:Mt,Load_StateSchema:vt,OperationSchema:de,OperationScopeSchema:X,PruneActionInputSchema:ht,PruneActionSchema:It,PruneSchema:Tt,RedoActionInputSchema:xt,RedoActionSchema:Pt,RedoSchema:kt,SetNameActionInputSchema:yt,SetNameActionSchema:Ft,SetNameOperationSchema:ge,Set_NameSchema:_t,UndoActionInputSchema:bt,UndoActionSchema:Rt,UndoSchema:Dt,definedNonNullAnySchema:me,isDefinedNonNullAny:Et},Symbol.toStringTag,{value:"Module"}));function xe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var mt={exports:{}};(function(e,t){const{hasOwnProperty:i}=Object.prototype,n=z();n.configure=z,n.stringify=n,n.default=n,t.stringify=n,t.configure=z,e.exports=n;const a=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;function s(c){return c.length<5e3&&!a.test(c)?`"${c}"`:JSON.stringify(c)}function r(c){if(c.length>200)return c.sort();for(let u=1;u<c.length;u++){const b=c[u];let M=u;for(;M!==0&&c[M-1]>b;)c[M]=c[M-1],M--;c[M]=b}return c}const l=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function p(c){return l.call(c)!==void 0&&c.length!==0}function x(c,u,b){c.length<b&&(b=c.length);const M=u===","?"":" ";let B=`"0":${M}${c[0]}`;for(let R=1;R<b;R++)B+=`${u}"${R}":${M}${c[R]}`;return B}function y(c){if(i.call(c,"circularValue")){const u=c.circularValue;if(typeof u=="string")return`"${u}"`;if(u==null)return u;if(u===Error||u===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function E(c,u){let b;if(i.call(c,u)&&(b=c[u],typeof b!="boolean"))throw new TypeError(`The "${u}" argument must be of type boolean`);return b===void 0?!0:b}function h(c,u){let b;if(i.call(c,u)){if(b=c[u],typeof b!="number")throw new TypeError(`The "${u}" argument must be of type number`);if(!Number.isInteger(b))throw new TypeError(`The "${u}" argument must be an integer`);if(b<1)throw new RangeError(`The "${u}" argument must be >= 1`)}return b===void 0?1/0:b}function S(c){return c===1?"1 item":`${c} items`}function $(c){const u=new Set;for(const b of c)(typeof b=="string"||typeof b=="number")&&u.add(String(b));return u}function A(c){if(i.call(c,"strict")){const u=c.strict;if(typeof u!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(u)return b=>{let M=`Object can not safely be stringified. Received type ${typeof b}`;throw typeof b!="function"&&(M+=` (${b.toString()})`),new Error(M)}}}function z(c){c={...c};const u=A(c);u&&(c.bigint===void 0&&(c.bigint=!1),"circularValue"in c||(c.circularValue=Error));const b=y(c),M=E(c,"bigint"),B=E(c,"deterministic"),R=h(c,"maximumDepth"),k=h(c,"maximumBreadth");function et(I,o,f,w,g,O){let d=o[I];switch(typeof d=="object"&&d!==null&&typeof d.toJSON=="function"&&(d=d.toJSON(I)),d=w.call(o,I,d),typeof d){case"string":return s(d);case"object":{if(d===null)return"null";if(f.indexOf(d)!==-1)return b;let j="",T=",";const _=O;if(Array.isArray(d)){if(d.length===0)return"[]";if(R<f.length+1)return'"[Array]"';f.push(d),g!==""&&(O+=g,j+=`
2
- ${O}`,T=`,
3
- ${O}`);const F=Math.min(d.length,k);let J=0;for(;J<F-1;J++){const nt=et(String(J),d,f,w,g,O);j+=nt!==void 0?nt:"null",j+=T}const C=et(String(J),d,f,w,g,O);if(j+=C!==void 0?C:"null",d.length-1>k){const nt=d.length-k-1;j+=`${T}"... ${S(nt)} not stringified"`}return g!==""&&(j+=`
4
- ${_}`),f.pop(),`[${j}]`}let D=Object.keys(d);const N=D.length;if(N===0)return"{}";if(R<f.length+1)return'"[Object]"';let v="",P="";g!==""&&(O+=g,T=`,
5
- ${O}`,v=" ");const L=Math.min(N,k);B&&!p(d)&&(D=r(D)),f.push(d);for(let F=0;F<L;F++){const J=D[F],C=et(J,d,f,w,g,O);C!==void 0&&(j+=`${P}${s(J)}:${v}${C}`,P=T)}if(N>k){const F=N-k;j+=`${P}"...":${v}"${S(F)} not stringified"`,P=T}return g!==""&&P.length>1&&(j=`
6
- ${O}${j}
7
- ${_}`),f.pop(),`{${j}}`}case"number":return isFinite(d)?String(d):u?u(d):"null";case"boolean":return d===!0?"true":"false";case"undefined":return;case"bigint":if(M)return String(d);default:return u?u(d):void 0}}function it(I,o,f,w,g,O){switch(typeof o=="object"&&o!==null&&typeof o.toJSON=="function"&&(o=o.toJSON(I)),typeof o){case"string":return s(o);case"object":{if(o===null)return"null";if(f.indexOf(o)!==-1)return b;const d=O;let j="",T=",";if(Array.isArray(o)){if(o.length===0)return"[]";if(R<f.length+1)return'"[Array]"';f.push(o),g!==""&&(O+=g,j+=`
8
- ${O}`,T=`,
9
- ${O}`);const N=Math.min(o.length,k);let v=0;for(;v<N-1;v++){const L=it(String(v),o[v],f,w,g,O);j+=L!==void 0?L:"null",j+=T}const P=it(String(v),o[v],f,w,g,O);if(j+=P!==void 0?P:"null",o.length-1>k){const L=o.length-k-1;j+=`${T}"... ${S(L)} not stringified"`}return g!==""&&(j+=`
10
- ${d}`),f.pop(),`[${j}]`}f.push(o);let _="";g!==""&&(O+=g,T=`,
11
- ${O}`,_=" ");let D="";for(const N of w){const v=it(N,o[N],f,w,g,O);v!==void 0&&(j+=`${D}${s(N)}:${_}${v}`,D=T)}return g!==""&&D.length>1&&(j=`
12
- ${O}${j}
13
- ${d}`),f.pop(),`{${j}}`}case"number":return isFinite(o)?String(o):u?u(o):"null";case"boolean":return o===!0?"true":"false";case"undefined":return;case"bigint":if(M)return String(o);default:return u?u(o):void 0}}function W(I,o,f,w,g){switch(typeof o){case"string":return s(o);case"object":{if(o===null)return"null";if(typeof o.toJSON=="function"){if(o=o.toJSON(I),typeof o!="object")return W(I,o,f,w,g);if(o===null)return"null"}if(f.indexOf(o)!==-1)return b;const O=g;if(Array.isArray(o)){if(o.length===0)return"[]";if(R<f.length+1)return'"[Array]"';f.push(o),g+=w;let v=`
14
- ${g}`;const P=`,
15
- ${g}`,L=Math.min(o.length,k);let F=0;for(;F<L-1;F++){const C=W(String(F),o[F],f,w,g);v+=C!==void 0?C:"null",v+=P}const J=W(String(F),o[F],f,w,g);if(v+=J!==void 0?J:"null",o.length-1>k){const C=o.length-k-1;v+=`${P}"... ${S(C)} not stringified"`}return v+=`
16
- ${O}`,f.pop(),`[${v}]`}let d=Object.keys(o);const j=d.length;if(j===0)return"{}";if(R<f.length+1)return'"[Object]"';g+=w;const T=`,
17
- ${g}`;let _="",D="",N=Math.min(j,k);p(o)&&(_+=x(o,T,k),d=d.slice(o.length),N-=o.length,D=T),B&&(d=r(d)),f.push(o);for(let v=0;v<N;v++){const P=d[v],L=W(P,o[P],f,w,g);L!==void 0&&(_+=`${D}${s(P)}: ${L}`,D=T)}if(j>k){const v=j-k;_+=`${D}"...": "${S(v)} not stringified"`,D=T}return D!==""&&(_=`
18
- ${g}${_}
19
- ${O}`),f.pop(),`{${_}}`}case"number":return isFinite(o)?String(o):u?u(o):"null";case"boolean":return o===!0?"true":"false";case"undefined":return;case"bigint":if(M)return String(o);default:return u?u(o):void 0}}function Z(I,o,f){switch(typeof o){case"string":return s(o);case"object":{if(o===null)return"null";if(typeof o.toJSON=="function"){if(o=o.toJSON(I),typeof o!="object")return Z(I,o,f);if(o===null)return"null"}if(f.indexOf(o)!==-1)return b;let w="";if(Array.isArray(o)){if(o.length===0)return"[]";if(R<f.length+1)return'"[Array]"';f.push(o);const T=Math.min(o.length,k);let _=0;for(;_<T-1;_++){const N=Z(String(_),o[_],f);w+=N!==void 0?N:"null",w+=","}const D=Z(String(_),o[_],f);if(w+=D!==void 0?D:"null",o.length-1>k){const N=o.length-k-1;w+=`,"... ${S(N)} not stringified"`}return f.pop(),`[${w}]`}let g=Object.keys(o);const O=g.length;if(O===0)return"{}";if(R<f.length+1)return'"[Object]"';let d="",j=Math.min(O,k);p(o)&&(w+=x(o,",",k),g=g.slice(o.length),j-=o.length,d=","),B&&(g=r(g)),f.push(o);for(let T=0;T<j;T++){const _=g[T],D=Z(_,o[_],f);D!==void 0&&(w+=`${d}${s(_)}:${D}`,d=",")}if(O>k){const T=O-k;w+=`${d}"...":"${S(T)} not stringified"`}return f.pop(),`{${w}}`}case"number":return isFinite(o)?String(o):u?u(o):"null";case"boolean":return o===!0?"true":"false";case"undefined":return;case"bigint":if(M)return String(o);default:return u?u(o):void 0}}function re(I,o,f){if(arguments.length>1){let w="";if(typeof f=="number"?w=" ".repeat(Math.min(f,10)):typeof f=="string"&&(w=f.slice(0,10)),o!=null){if(typeof o=="function")return et("",{"":I},[],o,w,"");if(Array.isArray(o))return it("",I,[],$(o),w,"")}if(w.length!==0)return W("",I,[],w,"")}return Z("",I,[])}return re}})(mt,mt.exports);var ye=mt.exports;const rt=xe(ye);rt.configure;function be(e,t){return{...e,name:t}}function we(e,t,i){const n={skip:i,document:e},{scope:a}=t;return!a||t.skip===void 0?n:U.produce(n,s=>{const r=s.document.operations[a].at(-1);t.skip&&t.skip>0&&(s.skip=t.skip),r&&r.type==="NOOP"&&t.index===r.index&&s.skip>r.skip&&s.document.operations[a].pop()})}function je(e,t,i){const{scope:n,input:a}=t,s={document:e,action:t,skip:i};return U.produce(s,r=>{if(r.document.operations[n].length<1)throw new Error(`Cannot undo: no operations in history for scope "${n}"`);if(a<1)throw new Error("Invalid UNDO action: input value must be greater than 0");if(r.skip>0)throw new Error("Cannot undo: skip value from reducer cannot be used with UNDO action");const l=r.document.operations[n].at(-1),p=l&&l.type==="NOOP"&&l.skip>0;if(r.skip+=a,p){r.skip+=l.skip;const h=r.document.operations[n][r.document.operations[n].length-2];h&&l.index-h.index===1&&r.document.operations[n].pop()}if(r.document.operations[n].length<r.skip)throw new Error("Cannot undo: you can't undo more operations than the ones in the scope history");const x=r.document.operations[n].length-1;let y=a,E=p?x-l.skip:x;for(;y>0&&E>=0;){const h=r.document.operations[n][E];if(!h){y--,E--;continue}h.type==="NOOP"&&h.skip>0?(E=E-(h.skip+1),r.skip+=h.skip+1):(r.document.clipboard.push({...h}),y--,E--)}r.action=St(n)})}function Oe(e,t,i){const{scope:n,input:a}=t,s={document:e,action:t,skip:i};return U.produce(s,r=>{if(r.skip>0)throw new Error("Cannot redo: skip value from reducer cannot be used with REDO action");if(a>1)throw new Error("Cannot redo: you can only redo one operation at a time");if(a<1)throw new Error("Invalid REDO action: invalid redo input value");if(r.document.clipboard.length<1)throw new Error("Cannot redo: no operations in the clipboard");const l=r.document.clipboard.findLastIndex(x=>x.scope===n);if(l<0)throw new Error(`Cannot redo: no operations in clipboard for scope "${n}"`);const p=r.document.clipboard.splice(l,1)[0];r.action=U.castDraft({type:p.type,scope:p.scope,input:p.input})})}function Se(e,t,i){const{scope:n}=t,a=e.operations[n];let{input:{start:s,end:r}}=t;s=s||0,r=r||a.length;const l=a.slice(s,r),p=a.slice(0,s),x=a.slice(r),y=st(e.initialState,{...e.operations,[n]:p.concat(l)},i),{name:E,state:h}=y,S=p.length,$=p.length?p[p.length-1].timestamp:x.length?x[0].timestamp:new Date().toISOString();return st(e.initialState,{...e.operations,[n]:[...p,{...Ot({name:E,state:h},l.length),timestamp:$,index:S,hash:ct({state:h},"global")},...x.map((A,z)=>({...A,index:S+z+1}))]},i)}function $e(e,t){return{...e,name:t.name,state:t.state??{global:{},local:{}}}}const qt="SET_NAME",Y="UNDO",tt="REDO",at="PRUNE",Lt="LOAD_STATE",ze="NOOP";function Ee(e,t){let i;return"index"in t?i={...t}:i=e.operations[t.scope].at(-1),((i==null?void 0:i.index)??-1)+1}function ve(e,t){return{...e,revision:{...e.revision,[t.scope]:Ee(e,t)},lastModified:new Date().toISOString()}}function Te(e,t,i=0){if([Y,tt,at].includes(t.type))return e;const{scope:n}=t,a=e.operations[n].slice(0,e.revision[n]),s=[...a].pop();let r=((s==null?void 0:s.index)??-1)+1;if("index"in t){if(t.index>r+i)throw new Error(`Missing operations: expected ${r} with skip 0 or equivalent, got index ${t.index} with skip ${i}`);r=t.index}return a.push({...t,index:r,timestamp:new Date().toISOString(),hash:"",scope:n,skip:i,error:void 0}),{...e,operations:{...e.operations,[n]:a}}}function ke(e,t,i=0){let n=Te(e,t,i);return n=ve(n,t),n}function _e(e,t,i){switch(At().parse(t),t.type){case qt:return be(e,t.input);case at:return Se(e,t,i);case Lt:return $e(e,t.input.state);default:return e}}function Jt(e,t,i){switch(t.type){case Y:return je(e,t,i);case tt:return Oe(e,t,i);default:return{document:e,action:t,skip:i}}}function wt(e,t,i,n,a={}){const{skip:s,ignoreSkipOperations:r=!1,reuseHash:l=!1}=a;let p={...t},x=s||0,y=e,E=[...e.clipboard];if(Ut(p)){const{document:h,skip:S}=we(y,p,x);x=S,y=h}if(ut(p)){const{skip:h,action:S,document:$}=Jt(e,p,x);p=S,x=h,y=$,E=[...y.clipboard]}if(ft(p)&&(y=_e(y,p,i)),x>0&&!r){let h=x;"index"in p&&(h=Wt(y.operations[p.scope],p.index,x)),y=st(y.initialState,y.operations,i,void 0,void 0,void 0,{[p.scope]:h})}return y=ke(y,p,x),y=U.produce(y,h=>{try{const S=i(h.state,p,n),$=ut(t)?[...E]:[];if(S)return U.castDraft({...y,clipboard:[...$],state:S});h.clipboard=U.castDraft([...$])}catch(S){const $=y.operations[p.scope].length-1;h.operations[p.scope][$].error=S.message}}),U.produce(y,h=>{if([Y,tt,at].includes(p.type))return h;const S=p.scope||"global",$=l&&Object.prototype.hasOwnProperty.call(p,"hash")?p.hash:ct(h,S);h.operations[S][h.operations[S].length-1].hash=$,!ft(p)&&p.attachments&&p.attachments.forEach(A=>{const{hash:z,...c}=A;h.attachments[z]={...c}})})}function De(e,t,i){const n=le.join(e,t);return lt.mkdirSync(e,{recursive:!0}),new Promise((a,s)=>{try{lt.writeFile(n,i,{},r=>{r?s(r):a(n)})}catch(r){s(r)}})}function Ct(e){return lt.readFileSync(e)}function Ae(e){return new Promise((t,i)=>{ce.get(e,n=>{const a=[],s=n.headers["content-type"];n.on("data",r=>{a.push(r)}),n.on("end",()=>{t({buffer:Buffer.concat(a),mimeType:s})})}).on("error",n=>{i(n)})})}const Ne=async e=>Ct(e),pt=(e,t="sha1")=>pe.createHash(t).update(e).digest("base64");function Ut(e){return e.type===ze&&e.skip!==void 0&&e.skip>0&&e.hash!==void 0}function ut(e){return[Y,tt].includes(e.type)}function ft(e){return[qt,Y,tt,at,Lt].includes(e.type)}function K(e,t,i,n,a="global"){if(!e)throw new Error("Empty action type");if(typeof e!="string")throw new Error(`Invalid action type: ${JSON.stringify(e)}`);const s={type:e,input:t,scope:a};i&&(s.attachments=i);try{n==null||n().parse(s.input)}catch(r){throw new Error(`Invalid action input: ${r}`)}return s}function Vt(e,t=wt){return(i,n,a,s)=>t(i,n,e,a,s)}const Kt=(e,t)=>({name:"",documentType:"",revision:{global:0,local:0},created:new Date().toISOString(),lastModified:new Date().toISOString(),attachments:{},...e,state:(t==null?void 0:t(e==null?void 0:e.state))??(e==null?void 0:e.state)??{global:{},local:{}}}),Bt=(e,t)=>{const i=Kt(e,t);return{...i,initialState:i,operations:{global:[],local:[]},clipboard:[]}},ct=(e,t="global")=>pt(rt(e.state[t]||"")),Me=(e,t=1e3)=>{const i=Math.random()*t;return pt(`${(e??new Date).toISOString()}${i}`)};function G(e){return U.castImmutable(U.freeze(e,!0))}function Ht(e,t){const i=[...e];let n=t||0,a=i.length>0?i[i.length-1].index:0;const s=[];for(const r of i.reverse()){if(n>0){const x=a-r.index;n-=x}if(n<0)throw new Error("Invalid operation index, missing operations");const l={ignore:n>0,operation:r},p=r.skip>0?r.skip+1:0;if(p>0&&p>n){const x=p-n;n=n+x}a=r.index,s.push(l)}return s.reverse()}function Wt(e,t,i){const n=e.slice().sort((l,p)=>l.skip-p.skip).sort((l,p)=>l.index-p.index);let a=i,s=0,r=t;for(const l of n.reverse()){const p=r-l.index;if(a=a-p,a>-1)s++,r=l.index;else break}return s}function Ie(e){return Object.values(e).flatMap(t=>t).sort((t,i)=>new Date(t.timestamp).getTime()-new Date(i.timestamp).getTime())}function Zt(e){return Object.values(e).flatMap(t=>t).sort((t,i)=>new Date(t.operation.timestamp).getTime()-new Date(i.operation.timestamp).getTime())}function st(e,t,i,n,a,s=wt,r={},l){const p=Vt(i,s);return jt(e,t,p,n,a,r,l)}function jt(e,t,i,n,a,s={},r){const l=(r==null?void 0:r.checkHashes)??!0,p=Bt(e),x=Object.keys(t).reduce(($,A)=>{const z=A;return{...$,[z]:Ht(t[z],s[z])}},{}),y=Zt(x),E=y.reduce(($,{ignore:A,operation:z})=>A?i($,St(z.scope),n,{skip:z.skip,ignoreSkipOperations:!0}):i($,z,n,{skip:z.skip,ignoreSkipOperations:!0,reuseHash:!l}),p);if(!l)for(const $ of Object.keys(E.state))for(let A=y.length-1;A>=0;A--){const{ignore:z,operation:c}=y[A];if(!(z||c.scope!==$)){if(c.hash!==ct(E,$))throw new Error(`Hash mismatch for scope ${$}`);break}}const h=Object.keys(E.operations).reduce(($,A)=>{const z=A;return{...$,[z]:[...E.operations[z].map((c,u)=>{var b;return{...c,timestamp:((b=t[z][u])==null?void 0:b.timestamp)??c.timestamp}})]}},{global:[],local:[]}),S=Object.values(h).reduce(($,A)=>{const z=A[A.length-1];return(z==null?void 0:z.timestamp)>$&&($=z.timestamp),$},e.lastModified);return{...E,operations:h,lastModified:S}}function Pe(e,t){return rt(e)===rt(t)}const Gt=e=>K("SET_NAME",e,void 0,yt,void 0),Qt=(e=1,t="global")=>K("UNDO",e,void 0,bt,t),Xt=(e=1,t="global")=>K("REDO",e,void 0,xt,t),Yt=(e,t,i="global")=>K("PRUNE",{start:e,end:t},void 0,ht,i),Ot=(e,t)=>K("LOAD_STATE",{state:e,operations:t},void 0,gt),St=(e="global")=>K("NOOP",{},void 0,void 0,e),Fe=Object.freeze(Object.defineProperty({__proto__:null,loadState:Ot,noop:St,prune:Yt,redo:Xt,setName:Gt,undo:Qt},Symbol.toStringTag,{value:"Module"})),te={"application/andrew-inset":["ez"],"application/appinstaller":["appinstaller"],"application/applixware":["aw"],"application/appx":["appx"],"application/appxbundle":["appxbundle"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/automationml-aml+xml":["aml"],"application/automationml-amlx+zip":["amlx"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cpl+xml":["cpl"],"application/cu-seeme":["cu"],"application/cwl":["cwl"],"application/dash+xml":["mpd"],"application/dash-patch+xml":["mpp"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdf":["fdf"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["*js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/media-policy-dataset+xml":["mpf"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["*mp4","*mpg4","mp4s","m4p"],"application/msix":["msix"],"application/msixbundle":["msixbundle"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-keys":["asc"],"application/pgp-signature":["sig","*asc"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/sql":["sql"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/watcherinfo+xml":["wif"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xfdf":["xfdf"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/aac":["adts","aac"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avci":["avci"],"image/avcs":["avcs"],"image/avif":["avif"],"image/bmp":["bmp","dib"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/dpx":["dpx"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm","jpgm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/jt":["jt"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/prc":["prc"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/u3d":["u3d"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js","mjs"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["md","markdown"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/wgsl":["wgsl"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","*jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};Object.freeze(te);var q=function(e,t,i,n){if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?n:i==="a"?n.call(e):n?n.value:t.get(e)},H,Q,V;class Re{constructor(...t){H.set(this,new Map),Q.set(this,new Map),V.set(this,new Map);for(const i of t)this.define(i)}define(t,i=!1){for(let[n,a]of Object.entries(t)){n=n.toLowerCase(),a=a.map(l=>l.toLowerCase()),q(this,V,"f").has(n)||q(this,V,"f").set(n,new Set);const s=q(this,V,"f").get(n);let r=!0;for(let l of a){const p=l.startsWith("*");if(l=p?l.slice(1):l,s==null||s.add(l),r&&q(this,Q,"f").set(n,l),r=!1,p)continue;const x=q(this,H,"f").get(l);if(x&&x!=n&&!i)throw new Error(`"${n} -> ${l}" conflicts with "${x} -> ${l}". Pass \`force=true\` to override this definition.`);q(this,H,"f").set(l,n)}}return this}getType(t){if(typeof t!="string")return null;const i=t.replace(/^.*[/\\]/,"").toLowerCase(),n=i.replace(/^.*\./,"").toLowerCase(),a=i.length<t.length;return!(n.length<i.length-1)&&a?null:q(this,H,"f").get(n)??null}getExtension(t){var i;return typeof t!="string"?null:(t=(i=t==null?void 0:t.split)==null?void 0:i.call(t,";")[0],(t&&q(this,Q,"f").get(t.trim().toLowerCase()))??null)}getAllExtensions(t){return typeof t!="string"?null:q(this,V,"f").get(t.toLowerCase())??null}_freeze(){this.define=()=>{throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances")},Object.freeze(this);for(const t of q(this,V,"f").values())Object.freeze(t);return this}_getTestState(){return{types:q(this,H,"f"),extensions:q(this,Q,"f")}}}H=new WeakMap,Q=new WeakMap,V=new WeakMap;const qe=new Re(te)._freeze();function ee(e){const t=[],i=Object.keys(e);for(const n of i){const a=e[n].sort((s,r)=>s.index-r.index);for(let s=0;s<a.length;s++)a[s].index!==s&&t.push({message:`Invalid operation index ${a[s].index} at position ${s}`,details:{position:s,operation:a[s],scope:a[s].scope}})}return t}const $t=async e=>{const t=new zt,{name:i,revision:n,documentType:a,created:s,lastModified:r}=e,l={name:i,revision:n,documentType:a,created:s,lastModified:r};return t.file("header.json",JSON.stringify(l,null,2)),t.file("state.json",JSON.stringify(e.initialState||{},null,2)),t.file("operations.json",JSON.stringify(e.operations,null,2)),Object.keys(e.attachments).forEach(x=>{const{data:y,...E}=e.attachments[x];t.file(x,y,{base64:!0,createFolders:!0,comment:JSON.stringify(E)})}),t},ie=async(e,t,i,n)=>{const s=await(await $t(e)).generateAsync({type:"uint8array",streamFiles:!0}),r=n??e.name,l=`.${i}.zip`;return De(t,r.endsWith(l)?r:`${r}${l}`,s)},Le=async(e,t)=>{const n=await(await $t(e)).generateAsync({type:"blob"}),a=await t.createWritable();await a.write(n),await a.close()},dt=async(e,t,i)=>{const n=Ct(e);return ne(n,t,i)},ne=async(e,t,i)=>{const n=new zt;return await n.loadAsync(e),Je(n,t,i)};async function Je(e,t,i){const n=e.file("state.json");if(!n)throw new Error("Initial state not found");const a=await n.async("string"),s=JSON.parse(a),r=e.file("header.json");let l;r&&(l=JSON.parse(await r.async("string")));const p=e.file("operations.json");if(!p)throw new Error("Operations history not found");const x=JSON.parse(await p.async("string")),y=ee(x);if(y.length){const h=y.map(S=>S.message);throw new Error(h.join(`
20
- `))}let E=jt(s,x,t,void 0,l,{},i);return l&&(E={...E,...l}),E}function oe(e){const t=e.replace(/^.*\./,"")||void 0,i=e.replace(/^.*[/\\]/,"")||void 0;return{extension:t,fileName:i}}async function Ce(e){const{buffer:t,mimeType:i="application/octet-stream"}=await Ae(e),n=oe(e),a=t.toString("base64");return{data:a,hash:pt(a),mimeType:i,...n}}async function Ue(e){const t=await Ne(e),i=qe.getType(e)||"application/octet-stream",n=oe(e),a=t.toString("base64");return{data:a,hash:pt(a),mimeType:i,...n}}class Ve{constructor(t,i,n){ot(this,"_document");ot(this,"_reducer");ot(this,"_signalDispatch");this._reducer=t,this._document=i,this._signalDispatch=n}dispatch(t,i){return this._document=this._reducer(this._document,t,this._signalDispatch,i),this}saveToFile(t,i,n){return ie(this._document,t,i,n)}async loadFromFile(t){this._document=await dt(t,this._reducer)}static async stateFromFile(t,i){return await dt(t,i)}get state(){return G(this._document.state)}get operations(){return G(this._document.operations)}get name(){return this._document.name}get documentType(){return this._document.documentType}get created(){return this._document.created}get lastModified(){return this._document.lastModified}get revision(){return this._document.revision.global}getRevision(t){return this._document.revision[t]}get initialState(){return G(this._document.initialState)}toDocument(){return G(this._document)}getAttachment(t){return this._document.attachments[t]}setName(t){return this.dispatch(Gt(t)),this}undo(t){return this.dispatch(Qt(t)),this}redo(t){return this.dispatch(Xt(t)),this}prune(t,i){return this.dispatch(Yt(t,i)),this}loadState(t,i){return this.dispatch(Ot(t,i)),this}}function Ke(e,t){t.forEach(i=>{Object.getOwnPropertyNames(i.prototype).forEach(n=>{Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(i.prototype,n)||Object.create(null))})})}exports.BaseActions=Fe;exports.BaseDocument=Ve;exports.applyMixins=Ke;exports.baseReducer=wt;exports.calculateSkipsLeft=Wt;exports.createAction=K;exports.createDocument=Bt;exports.createExtendedState=Kt;exports.createReducer=Vt;exports.createZip=$t;exports.getLocalFile=Ue;exports.getRemoteFile=Ce;exports.hashDocument=ct;exports.hashKey=Me;exports.isBaseAction=ft;exports.isNoopOperation=Ut;exports.isSameDocument=Pe;exports.isUndoRedo=ut;exports.loadFromFile=dt;exports.loadFromInput=ne;exports.mapSkippedOperations=Ht;exports.processUndoRedo=Jt;exports.readOnly=G;exports.replayDocument=jt;exports.replayOperations=st;exports.saveToFile=ie;exports.saveToFileHandle=Le;exports.sortMappedOperations=Zt;exports.sortOperations=Ie;exports.validateOperations=ee;exports.zod=he;
@@ -1,42 +0,0 @@
1
- import { j as e, f as a, b as s, a as o, c as t, k as r, m as i, n, o as c, p as l, i as p, q as d, r as u, t as m, l as O, e as y, u as b, v as D, w as S, x as _, s as f, d as g, y as F, z as v, A as h, B as j, h as x, g as z, C as R, D as A, E as B } from "./object-CnV5hY_A.js";
2
- const M = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3
- __proto__: null,
4
- calculateSkipsLeft: e,
5
- createAction: a,
6
- createDocument: s,
7
- createExtendedState: o,
8
- createReducer: t,
9
- createZip: r,
10
- getLocalFile: i,
11
- getRemoteFile: n,
12
- hashDocument: c,
13
- hashKey: l,
14
- isBaseAction: p,
15
- isNoopOperation: d,
16
- isSameDocument: u,
17
- isUndoRedo: m,
18
- loadFromFile: O,
19
- loadFromInput: y,
20
- mapSkippedOperations: b,
21
- readOnly: D,
22
- replayDocument: S,
23
- replayOperations: _,
24
- saveToFile: f,
25
- saveToFileHandle: g,
26
- sortMappedOperations: F,
27
- sortOperations: v,
28
- validateOperations: h
29
- }, Symbol.toStringTag, { value: "Module" })), k = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
30
- __proto__: null,
31
- BaseDocument: j,
32
- actions: x,
33
- applyMixins: z,
34
- baseReducer: R,
35
- processUndoRedo: A,
36
- utils: M,
37
- z: B
38
- }, Symbol.toStringTag, { value: "Module" }));
39
- export {
40
- k as D,
41
- M as i
42
- };