document-model 1.0.16 → 1.0.18

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 (63) hide show
  1. package/dist/browser/document/schema/zod.d.ts +24 -0
  2. package/dist/browser/document/types.d.ts +8 -7
  3. package/dist/browser/document/utils/base.d.ts +4 -4
  4. package/dist/browser/document-model/gen/header/object.d.ts +2 -2
  5. package/dist/browser/document-model/gen/module/object.d.ts +2 -2
  6. package/dist/browser/document-model/gen/object.d.ts +4 -4
  7. package/dist/browser/document-model/gen/operation/object.d.ts +2 -2
  8. package/dist/browser/document-model/gen/operation-error/object.d.ts +2 -2
  9. package/dist/browser/document-model/gen/operation-example/object.d.ts +2 -2
  10. package/dist/browser/document-model/gen/reducer.d.ts +2 -2
  11. package/dist/browser/document-model/gen/schema/types.d.ts +12 -5
  12. package/dist/browser/document-model/gen/schema/zod.d.ts +20 -1
  13. package/dist/browser/document-model/gen/state/object.d.ts +2 -2
  14. package/dist/browser/document-model/gen/types.d.ts +3 -3
  15. package/dist/browser/document-model/gen/utils.d.ts +4 -2
  16. package/dist/browser/document-model/gen/versioning/object.d.ts +2 -2
  17. package/dist/browser/document-model/index.d.ts +9 -9
  18. package/dist/browser/document-model.cjs +1 -1
  19. package/dist/browser/document-model.js +2 -2
  20. package/dist/browser/document.cjs +1 -1
  21. package/dist/browser/document.js +2 -2
  22. package/dist/browser/index.cjs +1 -1
  23. package/dist/browser/index.js +3 -3
  24. package/dist/browser/internal/{index-37753e74.js → index-10a12861.js} +520 -441
  25. package/dist/{node/internal/index-0e7af6c6.js → browser/internal/index-2aee8ea9.js} +1 -1
  26. package/dist/{node/internal/index-124bda95.js → browser/internal/index-a1282d5c.js} +1 -1
  27. package/dist/browser/internal/index-ec8cd58f.js +22 -0
  28. package/dist/browser/internal/object-24df9d92.js +6 -0
  29. package/dist/browser/internal/{object-17aee7a9.js → object-7e8eaff4.js} +377 -365
  30. package/dist/node/document/schema/zod.d.ts +24 -0
  31. package/dist/node/document/types.d.ts +8 -7
  32. package/dist/node/document/utils/base.d.ts +4 -4
  33. package/dist/node/document-model/gen/header/object.d.ts +2 -2
  34. package/dist/node/document-model/gen/module/object.d.ts +2 -2
  35. package/dist/node/document-model/gen/object.d.ts +4 -4
  36. package/dist/node/document-model/gen/operation/object.d.ts +2 -2
  37. package/dist/node/document-model/gen/operation-error/object.d.ts +2 -2
  38. package/dist/node/document-model/gen/operation-example/object.d.ts +2 -2
  39. package/dist/node/document-model/gen/reducer.d.ts +2 -2
  40. package/dist/node/document-model/gen/schema/types.d.ts +12 -5
  41. package/dist/node/document-model/gen/schema/zod.d.ts +20 -1
  42. package/dist/node/document-model/gen/state/object.d.ts +2 -2
  43. package/dist/node/document-model/gen/types.d.ts +3 -3
  44. package/dist/node/document-model/gen/utils.d.ts +4 -2
  45. package/dist/node/document-model/gen/versioning/object.d.ts +2 -2
  46. package/dist/node/document-model/index.d.ts +9 -9
  47. package/dist/node/document-model.cjs +1 -1
  48. package/dist/node/document-model.js +2 -2
  49. package/dist/node/document.cjs +1 -1
  50. package/dist/node/document.js +2 -2
  51. package/dist/node/index.cjs +1 -1
  52. package/dist/node/index.js +3 -3
  53. package/dist/node/internal/{index-9037f83a.js → index-09364517.js} +520 -441
  54. package/dist/node/internal/index-284511b8.js +22 -0
  55. package/dist/{browser/internal/index-f5587600.js → node/internal/index-2d4783d9.js} +1 -1
  56. package/dist/{browser/internal/index-9b4d67fc.js → node/internal/index-5ef0c6b0.js} +1 -1
  57. package/dist/node/internal/object-21f3d2ee.js +1 -0
  58. package/dist/node/internal/{object-f7cd4777.js → object-c32ea0a0.js} +154 -142
  59. package/package.json +1 -1
  60. package/dist/browser/internal/index-a5150e7e.js +0 -22
  61. package/dist/browser/internal/object-28a1a8bf.js +0 -6
  62. package/dist/node/internal/index-417115f1.js +0 -22
  63. package/dist/node/internal/object-f3dd289e.js +0 -1
@@ -1,14 +1,14 @@
1
1
  var dt = Object.defineProperty;
2
- var ct = (t, e, n) => e in t ? dt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var pe = (t, e, n) => (ct(t, typeof e != "symbol" ? e + "" : e, n), n);
4
- import { c as ut, i as mt, a as Et, b as ht, s as Ot, d as gt, l as St, e as ft, f as s, B as l, g as _t, h as It } from "./object-17aee7a9.js";
2
+ var ut = (t, e, o) => e in t ? dt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
3
+ var le = (t, e, o) => (ut(t, typeof e != "symbol" ? e + "" : e, o), o);
4
+ import { c as mt, i as Et, a as ht, b as Ot, s as gt, d as St, l as bt, e as ft, f as s, B as l, g as _t, h as It } from "./object-7e8eaff4.js";
5
5
  import "json-stringify-deterministic";
6
6
  import "immer";
7
7
  import "jszip";
8
8
  import { z as r } from "zod";
9
9
  const Tt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10
10
  __proto__: null
11
- }, Symbol.toStringTag, { value: "Module" })), le = {
11
+ }, Symbol.toStringTag, { value: "Module" })), ce = {
12
12
  id: "powerhouse/document-model",
13
13
  name: "DocumentModel",
14
14
  extension: "phdm",
@@ -535,8 +535,9 @@ const Tt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
535
535
  }
536
536
  ],
537
537
  state: {
538
- schema: "",
539
- initialValue: `{
538
+ global: {
539
+ schema: "",
540
+ initialValue: `{
540
541
  "id": "",
541
542
  "name": "",
542
543
  "extension": "",
@@ -558,11 +559,17 @@ const Tt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
558
559
  }
559
560
  ]
560
561
  }`,
561
- examples: []
562
+ examples: []
563
+ },
564
+ local: {
565
+ schema: "",
566
+ initialValue: "{}",
567
+ examples: []
568
+ }
562
569
  }
563
570
  }
564
571
  ]
565
- }, de = (t) => t != null, bt = r.any().refine((t) => de(t));
572
+ }, de = (t) => t != null, Rt = r.any().refine((t) => de(t));
566
573
  function f() {
567
574
  return r.object({
568
575
  __typename: r.literal("AddChangeLogItemInput").optional(),
@@ -595,7 +602,7 @@ function T() {
595
602
  operationId: r.string()
596
603
  });
597
604
  }
598
- function b() {
605
+ function R() {
599
606
  return r.object({
600
607
  description: r.string().nullish(),
601
608
  id: r.string(),
@@ -607,21 +614,22 @@ function b() {
607
614
  scope: r.literal("local").or(r.literal("global")).nullish()
608
615
  });
609
616
  }
610
- function R() {
617
+ function A() {
611
618
  return r.object({
619
+ scope: r.string(),
612
620
  example: r.string(),
613
621
  id: r.string(),
614
622
  insertBefore: r.string().nullish()
615
623
  });
616
624
  }
617
- function ce() {
625
+ function ue() {
618
626
  return r.object({
619
627
  __typename: r.literal("Author").optional(),
620
628
  name: r.string(),
621
629
  website: r.string().nullable()
622
630
  });
623
631
  }
624
- function A() {
632
+ function x() {
625
633
  return r.object({
626
634
  __typename: r.literal("CodeExample").optional(),
627
635
  id: r.string(),
@@ -634,11 +642,6 @@ function D() {
634
642
  id: r.string()
635
643
  });
636
644
  }
637
- function x() {
638
- return r.object({
639
- id: r.string()
640
- });
641
- }
642
645
  function M() {
643
646
  return r.object({
644
647
  id: r.string()
@@ -659,16 +662,21 @@ function P() {
659
662
  id: r.string()
660
663
  });
661
664
  }
662
- function Rt() {
665
+ function j() {
666
+ return r.object({
667
+ scope: r.string(),
668
+ id: r.string()
669
+ });
670
+ }
671
+ function At() {
663
672
  return r.union([
664
673
  f(),
665
674
  _(),
666
675
  I(),
667
676
  T(),
668
- b(),
669
677
  R(),
678
+ A(),
670
679
  D(),
671
- x(),
672
680
  M(),
673
681
  N(),
674
682
  L(),
@@ -678,15 +686,15 @@ function Rt() {
678
686
  k(),
679
687
  y(),
680
688
  w(),
681
- U(),
682
689
  v(),
690
+ U(),
691
+ V(),
683
692
  F(),
684
693
  H(),
685
- V(),
686
694
  X(),
687
695
  G(),
688
- W(),
689
696
  $(),
697
+ W(),
690
698
  z(),
691
699
  B(),
692
700
  q(),
@@ -701,50 +709,51 @@ function Rt() {
701
709
  oe(),
702
710
  ne(),
703
711
  ie(),
704
- se()
712
+ se(),
713
+ ae()
705
714
  ]);
706
715
  }
707
- function At() {
716
+ function xt() {
708
717
  return r.object({
709
718
  __typename: r.literal("DocumentModelState").optional(),
710
- author: ce(),
719
+ author: ue(),
711
720
  description: r.string(),
712
721
  extension: r.string(),
713
722
  id: r.string(),
714
723
  name: r.string(),
715
- specifications: r.array(ue())
724
+ specifications: r.array(me())
716
725
  });
717
726
  }
718
- function ue() {
727
+ function me() {
719
728
  return r.object({
720
729
  __typename: r.literal("DocumentSpecification").optional(),
721
730
  changeLog: r.array(r.string()),
722
- modules: r.array(me()),
723
- state: ge(),
731
+ modules: r.array(Ee()),
732
+ state: Se(),
724
733
  version: r.number()
725
734
  });
726
735
  }
727
- function me() {
736
+ function Ee() {
728
737
  return r.object({
729
738
  __typename: r.literal("Module").optional(),
730
739
  description: r.string().nullable(),
731
740
  id: r.string(),
732
741
  name: r.string(),
733
- operations: r.array(Ee())
742
+ operations: r.array(he())
734
743
  });
735
744
  }
736
- function j() {
745
+ function C() {
737
746
  return r.object({
738
747
  newModuleId: r.string(),
739
748
  operationId: r.string()
740
749
  });
741
750
  }
742
- function Ee() {
751
+ function he() {
743
752
  return r.object({
744
753
  __typename: r.literal("Operation").optional(),
745
754
  description: r.string().nullable(),
746
- errors: r.array(he()),
747
- examples: r.array(A()),
755
+ errors: r.array(Oe()),
756
+ examples: r.array(x()),
748
757
  id: r.string(),
749
758
  name: r.string().nullable(),
750
759
  reducer: r.string().nullable(),
@@ -753,7 +762,7 @@ function Ee() {
753
762
  scope: r.literal("local").or(r.literal("global"))
754
763
  });
755
764
  }
756
- function he() {
765
+ function Oe() {
757
766
  return r.object({
758
767
  __typename: r.literal("OperationError").optional(),
759
768
  code: r.string().nullable(),
@@ -763,24 +772,24 @@ function he() {
763
772
  template: r.string().nullable()
764
773
  });
765
774
  }
766
- function C() {
775
+ function k() {
767
776
  return r.object({
768
777
  __typename: r.literal("ReorderChangeLogItemsInput").optional(),
769
778
  order: r.array(r.string())
770
779
  });
771
780
  }
772
- function k() {
781
+ function y() {
773
782
  return r.object({
774
783
  moduleId: r.string(),
775
784
  order: r.array(r.string())
776
785
  });
777
786
  }
778
- function y() {
787
+ function w() {
779
788
  return r.object({
780
789
  order: r.array(r.string())
781
790
  });
782
791
  }
783
- function w() {
792
+ function v() {
784
793
  return r.object({
785
794
  operationId: r.string(),
786
795
  order: r.array(r.string())
@@ -792,8 +801,9 @@ function U() {
792
801
  order: r.array(r.string())
793
802
  });
794
803
  }
795
- function v() {
804
+ function V() {
796
805
  return r.object({
806
+ scope: r.string(),
797
807
  order: r.array(r.string())
798
808
  });
799
809
  }
@@ -807,17 +817,18 @@ function H() {
807
817
  authorWebsite: r.string()
808
818
  });
809
819
  }
810
- function V() {
820
+ function X() {
811
821
  return r.object({
822
+ scope: r.string(),
812
823
  initialValue: r.string()
813
824
  });
814
825
  }
815
- function X() {
826
+ function G() {
816
827
  return r.object({
817
828
  description: r.string()
818
829
  });
819
830
  }
820
- function G() {
831
+ function $() {
821
832
  return r.object({
822
833
  extension: r.string()
823
834
  });
@@ -827,111 +838,119 @@ function W() {
827
838
  id: r.string()
828
839
  });
829
840
  }
830
- function $() {
841
+ function z() {
831
842
  return r.object({
832
843
  name: r.string()
833
844
  });
834
845
  }
835
- function z() {
846
+ function B() {
836
847
  return r.object({
837
848
  description: r.string().nullish(),
838
849
  id: r.string()
839
850
  });
840
851
  }
841
- function B() {
852
+ function q() {
842
853
  return r.object({
843
854
  id: r.string(),
844
855
  name: r.string().nullish()
845
856
  });
846
857
  }
847
- function q() {
858
+ function J() {
848
859
  return r.object({
849
860
  description: r.string().nullish(),
850
861
  id: r.string()
851
862
  });
852
863
  }
853
- function J() {
864
+ function K() {
854
865
  return r.object({
855
866
  errorCode: r.string().nullish(),
856
867
  id: r.string()
857
868
  });
858
869
  }
859
- function K() {
870
+ function Q() {
860
871
  return r.object({
861
872
  errorDescription: r.string().nullish(),
862
873
  id: r.string()
863
874
  });
864
875
  }
865
- function Q() {
876
+ function Y() {
866
877
  return r.object({
867
878
  errorName: r.string().nullish(),
868
879
  id: r.string()
869
880
  });
870
881
  }
871
- function Y() {
882
+ function Z() {
872
883
  return r.object({
873
884
  errorTemplate: r.string().nullish(),
874
885
  id: r.string()
875
886
  });
876
887
  }
877
- function Z() {
888
+ function ee() {
878
889
  return r.object({
879
890
  id: r.string(),
880
891
  name: r.string().nullish()
881
892
  });
882
893
  }
883
- function Oe() {
894
+ function ge() {
884
895
  return r.object({
885
896
  id: r.string(),
886
897
  scope: r.literal("global").or(r.literal("local"))
887
898
  });
888
899
  }
889
- function ee() {
900
+ function te() {
890
901
  return r.object({
891
902
  id: r.string(),
892
903
  reducer: r.string().nullish()
893
904
  });
894
905
  }
895
- function te() {
906
+ function re() {
896
907
  return r.object({
897
908
  id: r.string(),
898
909
  schema: r.string().nullish()
899
910
  });
900
911
  }
901
- function re() {
912
+ function oe() {
902
913
  return r.object({
903
914
  id: r.string(),
904
915
  template: r.string().nullish()
905
916
  });
906
917
  }
907
- function oe() {
918
+ function ne() {
908
919
  return r.object({
920
+ scope: r.string(),
909
921
  schema: r.string()
910
922
  });
911
923
  }
912
- function ge() {
924
+ function b() {
913
925
  return r.object({
914
926
  __typename: r.literal("State").optional(),
915
- examples: r.array(A()),
927
+ examples: r.array(x()),
916
928
  initialValue: r.string(),
917
929
  schema: r.string()
918
930
  });
919
931
  }
920
- function ne() {
932
+ function Se() {
933
+ return r.object({
934
+ global: b(),
935
+ local: b()
936
+ });
937
+ }
938
+ function ie() {
921
939
  return r.object({
922
940
  __typename: r.literal("UpdateChangeLogItemInput").optional(),
923
941
  id: r.string(),
924
942
  newContent: r.string()
925
943
  });
926
944
  }
927
- function ie() {
945
+ function se() {
928
946
  return r.object({
929
947
  example: r.string(),
930
948
  id: r.string()
931
949
  });
932
950
  }
933
- function se() {
951
+ function ae() {
934
952
  return r.object({
953
+ scope: r.string(),
935
954
  id: r.string(),
936
955
  newExample: r.string()
937
956
  });
@@ -942,56 +961,57 @@ const Dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
942
961
  AddModuleInputSchema: _,
943
962
  AddOperationErrorInputSchema: I,
944
963
  AddOperationExampleInputSchema: T,
945
- AddOperationInputSchema: b,
946
- AddStateExampleInputSchema: R,
947
- AuthorSchema: ce,
948
- CodeExampleSchema: A,
964
+ AddOperationInputSchema: R,
965
+ AddStateExampleInputSchema: A,
966
+ AuthorSchema: ue,
967
+ CodeExampleSchema: x,
949
968
  DeleteChangeLogItemInputSchema: D,
950
- DeleteModuleInputSchema: x,
951
- DeleteOperationErrorInputSchema: M,
952
- DeleteOperationExampleInputSchema: N,
953
- DeleteOperationInputSchema: L,
954
- DeleteStateExampleInputSchema: P,
955
- DocumentModelInputSchema: Rt,
956
- DocumentModelStateSchema: At,
957
- DocumentSpecificationSchema: ue,
958
- ModuleSchema: me,
959
- MoveOperationInputSchema: j,
960
- OperationErrorSchema: he,
961
- OperationSchema: Ee,
962
- ReorderChangeLogItemsInputSchema: C,
963
- ReorderModuleOperationsInputSchema: k,
964
- ReorderModulesInputSchema: y,
965
- ReorderOperationErrorsInputSchema: w,
969
+ DeleteModuleInputSchema: M,
970
+ DeleteOperationErrorInputSchema: N,
971
+ DeleteOperationExampleInputSchema: L,
972
+ DeleteOperationInputSchema: P,
973
+ DeleteStateExampleInputSchema: j,
974
+ DocumentModelInputSchema: At,
975
+ DocumentModelStateSchema: xt,
976
+ DocumentSpecificationSchema: me,
977
+ ModuleSchema: Ee,
978
+ MoveOperationInputSchema: C,
979
+ OperationErrorSchema: Oe,
980
+ OperationSchema: he,
981
+ ReorderChangeLogItemsInputSchema: k,
982
+ ReorderModuleOperationsInputSchema: y,
983
+ ReorderModulesInputSchema: w,
984
+ ReorderOperationErrorsInputSchema: v,
966
985
  ReorderOperationExamplesInputSchema: U,
967
- ReorderStateExamplesInputSchema: v,
986
+ ReorderStateExamplesInputSchema: V,
987
+ ScopeStateSchema: Se,
968
988
  SetAuthorNameInputSchema: F,
969
989
  SetAuthorWebsiteInputSchema: H,
970
- SetInitialStateInputSchema: V,
971
- SetModelDescriptionInputSchema: X,
972
- SetModelExtensionInputSchema: G,
990
+ SetInitialStateInputSchema: X,
991
+ SetModelDescriptionInputSchema: G,
992
+ SetModelExtensionInputSchema: $,
973
993
  SetModelIdInputSchema: W,
974
- SetModelNameInputSchema: $,
975
- SetModuleDescriptionInputSchema: z,
976
- SetModuleNameInputSchema: B,
977
- SetOperationDescriptionInputSchema: q,
978
- SetOperationErrorCodeInputSchema: J,
979
- SetOperationErrorDescriptionInputSchema: K,
980
- SetOperationErrorNameInputSchema: Q,
981
- SetOperationErrorTemplateInputSchema: Y,
982
- SetOperationNameInputSchema: Z,
983
- SetOperationReducerInputSchema: ee,
984
- SetOperationSchemaInputSchema: te,
985
- SetOperationScopeInputSchema: Oe,
986
- SetOperationTemplateInputSchema: re,
987
- SetStateSchemaInputSchema: oe,
988
- StateSchema: ge,
989
- UpdateChangeLogItemInputSchema: ne,
990
- UpdateOperationExampleInputSchema: ie,
991
- UpdateStateExampleInputSchema: se,
992
- definedNonNullAnySchema: bt,
994
+ SetModelNameInputSchema: z,
995
+ SetModuleDescriptionInputSchema: B,
996
+ SetModuleNameInputSchema: q,
997
+ SetOperationDescriptionInputSchema: J,
998
+ SetOperationErrorCodeInputSchema: K,
999
+ SetOperationErrorDescriptionInputSchema: Q,
1000
+ SetOperationErrorNameInputSchema: Y,
1001
+ SetOperationErrorTemplateInputSchema: Z,
1002
+ SetOperationNameInputSchema: ee,
1003
+ SetOperationReducerInputSchema: te,
1004
+ SetOperationSchemaInputSchema: re,
1005
+ SetOperationScopeInputSchema: ge,
1006
+ SetOperationTemplateInputSchema: oe,
1007
+ SetStateSchemaInputSchema: ne,
1008
+ StateSchema: b,
1009
+ UpdateChangeLogItemInputSchema: ie,
1010
+ UpdateOperationExampleInputSchema: se,
1011
+ UpdateStateExampleInputSchema: ae,
1012
+ definedNonNullAnySchema: Rt,
993
1013
  isDefinedNonNullAny: de
994
- }, Symbol.toStringTag, { value: "Module" })), c = {
1014
+ }, Symbol.toStringTag, { value: "Module" })), d = {
995
1015
  setModelNameOperation(t, e) {
996
1016
  t.name = e.input.name;
997
1017
  },
@@ -1026,9 +1046,9 @@ const Dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1026
1046
  releaseNewVersionOperation(t, e) {
1027
1047
  throw new Error('Reducer "releaseNewVersionOperation" not yet implemented');
1028
1048
  }
1029
- }, xt = (t) => {
1049
+ }, Mt = (t) => {
1030
1050
  const e = {};
1031
- return t.forEach((n, o) => e[n] = o), (n, o) => (e[o.id] || 999999) - (e[n.id] || 999999);
1051
+ return t.forEach((o, n) => e[o] = n), (o, n) => (e[n.id] || 999999) - (e[o.id] || 999999);
1032
1052
  }, h = {
1033
1053
  addModuleOperation(t, e) {
1034
1054
  t.specifications[t.specifications.length - 1].modules.push({
@@ -1039,33 +1059,33 @@ const Dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1039
1059
  });
1040
1060
  },
1041
1061
  setModuleNameOperation(t, e) {
1042
- const n = t.specifications[t.specifications.length - 1];
1043
- for (let o = 0; o < n.modules.length; o++)
1044
- n.modules[o].id === e.input.id && (n.modules[o].name = e.input.name || "");
1062
+ const o = t.specifications[t.specifications.length - 1];
1063
+ for (let n = 0; n < o.modules.length; n++)
1064
+ o.modules[n].id === e.input.id && (o.modules[n].name = e.input.name || "");
1045
1065
  },
1046
1066
  setModuleDescriptionOperation(t, e) {
1047
- const n = t.specifications[t.specifications.length - 1];
1048
- for (let o = 0; o < n.modules.length; o++)
1049
- n.modules[o].id === e.input.id && (n.modules[o].description = e.input.description || "");
1067
+ const o = t.specifications[t.specifications.length - 1];
1068
+ for (let n = 0; n < o.modules.length; n++)
1069
+ o.modules[n].id === e.input.id && (o.modules[n].description = e.input.description || "");
1050
1070
  },
1051
1071
  deleteModuleOperation(t, e) {
1052
- const n = t.specifications[t.specifications.length - 1];
1053
- n.modules = n.modules.filter(
1054
- (o) => o.id != e.input.id
1072
+ const o = t.specifications[t.specifications.length - 1];
1073
+ o.modules = o.modules.filter(
1074
+ (n) => n.id != e.input.id
1055
1075
  );
1056
1076
  },
1057
1077
  reorderModulesOperation(t, e) {
1058
- t.specifications[t.specifications.length - 1].modules.sort(xt(e.input.order));
1078
+ t.specifications[t.specifications.length - 1].modules.sort(Mt(e.input.order));
1059
1079
  }
1060
- }, Mt = (t) => {
1080
+ }, Nt = (t) => {
1061
1081
  const e = {};
1062
- return t.forEach((n, o) => e[n] = o), (n, o) => (e[o.id] || 999999) - (e[n.id] || 999999);
1063
- }, d = {
1082
+ return t.forEach((o, n) => e[o] = n), (o, n) => (e[n.id] || 999999) - (e[o.id] || 999999);
1083
+ }, c = {
1064
1084
  addOperationErrorOperation(t, e) {
1065
- const n = t.specifications[t.specifications.length - 1];
1066
- for (let o = 0; o < n.modules.length; o++)
1067
- for (let i = 0; i < n.modules[o].operations.length; i++)
1068
- n.modules[o].operations[i].id == e.input.operationId && n.modules[o].operations[i].errors.push({
1085
+ const o = t.specifications[t.specifications.length - 1];
1086
+ for (let n = 0; n < o.modules.length; n++)
1087
+ for (let i = 0; i < o.modules[n].operations.length; i++)
1088
+ o.modules[n].operations[i].id == e.input.operationId && o.modules[n].operations[i].errors.push({
1069
1089
  id: e.input.id,
1070
1090
  name: e.input.errorName || "",
1071
1091
  code: e.input.errorCode || "",
@@ -1074,91 +1094,91 @@ const Dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1074
1094
  });
1075
1095
  },
1076
1096
  setOperationErrorCodeOperation(t, e) {
1077
- const n = t.specifications[t.specifications.length - 1];
1078
- for (let o = 0; o < n.modules.length; o++)
1079
- for (let i = 0; i < n.modules[o].operations.length; i++)
1080
- for (let a = 0; a < n.modules[o].operations[i].errors.length; a++)
1081
- n.modules[o].operations[i].errors[a].id == e.input.id && (n.modules[o].operations[i].errors[a].code = e.input.errorCode || "");
1097
+ const o = t.specifications[t.specifications.length - 1];
1098
+ for (let n = 0; n < o.modules.length; n++)
1099
+ for (let i = 0; i < o.modules[n].operations.length; i++)
1100
+ for (let a = 0; a < o.modules[n].operations[i].errors.length; a++)
1101
+ o.modules[n].operations[i].errors[a].id == e.input.id && (o.modules[n].operations[i].errors[a].code = e.input.errorCode || "");
1082
1102
  },
1083
1103
  setOperationErrorNameOperation(t, e) {
1084
- const n = t.specifications[t.specifications.length - 1];
1085
- for (let o = 0; o < n.modules.length; o++)
1086
- for (let i = 0; i < n.modules[o].operations.length; i++)
1087
- for (let a = 0; a < n.modules[o].operations[i].errors.length; a++)
1088
- n.modules[o].operations[i].errors[a].id == e.input.id && (n.modules[o].operations[i].errors[a].name = e.input.errorName || "");
1104
+ const o = t.specifications[t.specifications.length - 1];
1105
+ for (let n = 0; n < o.modules.length; n++)
1106
+ for (let i = 0; i < o.modules[n].operations.length; i++)
1107
+ for (let a = 0; a < o.modules[n].operations[i].errors.length; a++)
1108
+ o.modules[n].operations[i].errors[a].id == e.input.id && (o.modules[n].operations[i].errors[a].name = e.input.errorName || "");
1089
1109
  },
1090
1110
  setOperationErrorDescriptionOperation(t, e) {
1091
- const n = t.specifications[t.specifications.length - 1];
1092
- for (let o = 0; o < n.modules.length; o++)
1093
- for (let i = 0; i < n.modules[o].operations.length; i++)
1094
- for (let a = 0; a < n.modules[o].operations[i].errors.length; a++)
1095
- n.modules[o].operations[i].errors[a].id == e.input.id && (n.modules[o].operations[i].errors[a].description = e.input.errorDescription || "");
1111
+ const o = t.specifications[t.specifications.length - 1];
1112
+ for (let n = 0; n < o.modules.length; n++)
1113
+ for (let i = 0; i < o.modules[n].operations.length; i++)
1114
+ for (let a = 0; a < o.modules[n].operations[i].errors.length; a++)
1115
+ o.modules[n].operations[i].errors[a].id == e.input.id && (o.modules[n].operations[i].errors[a].description = e.input.errorDescription || "");
1096
1116
  },
1097
1117
  setOperationErrorTemplateOperation(t, e) {
1098
- const n = t.specifications[t.specifications.length - 1];
1099
- for (let o = 0; o < n.modules.length; o++)
1100
- for (let i = 0; i < n.modules[o].operations.length; i++)
1101
- for (let a = 0; a < n.modules[o].operations[i].errors.length; a++)
1102
- n.modules[o].operations[i].errors[a].id == e.input.id && (n.modules[o].operations[i].errors[a].template = e.input.errorTemplate || "");
1118
+ const o = t.specifications[t.specifications.length - 1];
1119
+ for (let n = 0; n < o.modules.length; n++)
1120
+ for (let i = 0; i < o.modules[n].operations.length; i++)
1121
+ for (let a = 0; a < o.modules[n].operations[i].errors.length; a++)
1122
+ o.modules[n].operations[i].errors[a].id == e.input.id && (o.modules[n].operations[i].errors[a].template = e.input.errorTemplate || "");
1103
1123
  },
1104
1124
  deleteOperationErrorOperation(t, e) {
1105
- const n = t.specifications[t.specifications.length - 1];
1106
- for (let o = 0; o < n.modules.length; o++)
1107
- for (let i = 0; i < n.modules[o].operations.length; i++)
1108
- n.modules[o].operations[i].errors = n.modules[o].operations[i].errors.filter((a) => a.id != e.input.id);
1125
+ const o = t.specifications[t.specifications.length - 1];
1126
+ for (let n = 0; n < o.modules.length; n++)
1127
+ for (let i = 0; i < o.modules[n].operations.length; i++)
1128
+ o.modules[n].operations[i].errors = o.modules[n].operations[i].errors.filter((a) => a.id != e.input.id);
1109
1129
  },
1110
1130
  reorderOperationErrorsOperation(t, e) {
1111
- const n = t.specifications[t.specifications.length - 1];
1112
- for (let o = 0; o < n.modules.length; o++)
1113
- for (let i = 0; i < n.modules[o].operations.length; i++)
1114
- n.modules[o].operations[i].id == e.input.operationId && n.modules[o].operations[i].errors.sort(
1115
- Mt(e.input.order)
1131
+ const o = t.specifications[t.specifications.length - 1];
1132
+ for (let n = 0; n < o.modules.length; n++)
1133
+ for (let i = 0; i < o.modules[n].operations.length; i++)
1134
+ o.modules[n].operations[i].id == e.input.operationId && o.modules[n].operations[i].errors.sort(
1135
+ Nt(e.input.order)
1116
1136
  );
1117
1137
  }
1118
- }, Nt = (t) => {
1138
+ }, Lt = (t) => {
1119
1139
  const e = {};
1120
- return t.forEach((n, o) => e[n] = o), (n, o) => (e[o.id] || 999999) - (e[n.id] || 999999);
1140
+ return t.forEach((o, n) => e[o] = n), (o, n) => (e[n.id] || 999999) - (e[o.id] || 999999);
1121
1141
  }, S = {
1122
1142
  addOperationExampleOperation(t, e) {
1123
- const n = t.specifications[t.specifications.length - 1];
1124
- for (let o = 0; o < n.modules.length; o++)
1125
- for (let i = 0; i < n.modules[o].operations.length; i++)
1126
- n.modules[o].operations[i].id == e.input.operationId && n.modules[o].operations[i].examples.push({
1143
+ const o = t.specifications[t.specifications.length - 1];
1144
+ for (let n = 0; n < o.modules.length; n++)
1145
+ for (let i = 0; i < o.modules[n].operations.length; i++)
1146
+ o.modules[n].operations[i].id == e.input.operationId && o.modules[n].operations[i].examples.push({
1127
1147
  id: e.input.id,
1128
1148
  value: e.input.example
1129
1149
  });
1130
1150
  },
1131
1151
  updateOperationExampleOperation(t, e) {
1132
- const n = t.specifications[t.specifications.length - 1];
1133
- for (let o = 0; o < n.modules.length; o++)
1134
- for (let i = 0; i < n.modules[o].operations.length; i++)
1135
- for (let a = 0; a < n.modules[o].operations[i].examples.length; a++)
1136
- n.modules[o].operations[i].examples[a].id == e.input.id && (n.modules[o].operations[i].examples[a].value = e.input.example);
1152
+ const o = t.specifications[t.specifications.length - 1];
1153
+ for (let n = 0; n < o.modules.length; n++)
1154
+ for (let i = 0; i < o.modules[n].operations.length; i++)
1155
+ for (let a = 0; a < o.modules[n].operations[i].examples.length; a++)
1156
+ o.modules[n].operations[i].examples[a].id == e.input.id && (o.modules[n].operations[i].examples[a].value = e.input.example);
1137
1157
  },
1138
1158
  deleteOperationExampleOperation(t, e) {
1139
- const n = t.specifications[t.specifications.length - 1];
1140
- for (let o = 0; o < n.modules.length; o++)
1141
- for (let i = 0; i < n.modules[o].operations.length; i++)
1142
- n.modules[o].operations[i].examples = n.modules[o].operations[i].examples.filter(
1159
+ const o = t.specifications[t.specifications.length - 1];
1160
+ for (let n = 0; n < o.modules.length; n++)
1161
+ for (let i = 0; i < o.modules[n].operations.length; i++)
1162
+ o.modules[n].operations[i].examples = o.modules[n].operations[i].examples.filter(
1143
1163
  (a) => a.id != e.input.id
1144
1164
  );
1145
1165
  },
1146
1166
  reorderOperationExamplesOperation(t, e) {
1147
- const n = t.specifications[t.specifications.length - 1];
1148
- for (let o = 0; o < n.modules.length; o++)
1149
- for (let i = 0; i < n.modules[o].operations.length; i++)
1150
- n.modules[o].operations[i].id == e.input.operationId && n.modules[o].operations[i].examples.sort(
1151
- Nt(e.input.order)
1167
+ const o = t.specifications[t.specifications.length - 1];
1168
+ for (let n = 0; n < o.modules.length; n++)
1169
+ for (let i = 0; i < o.modules[n].operations.length; i++)
1170
+ o.modules[n].operations[i].id == e.input.operationId && o.modules[n].operations[i].examples.sort(
1171
+ Lt(e.input.order)
1152
1172
  );
1153
1173
  }
1154
- }, Lt = (t) => {
1174
+ }, Pt = (t) => {
1155
1175
  const e = {};
1156
- return t.forEach((n, o) => e[n] = o), (n, o) => (e[o.id] || 999999) - (e[n.id] || 999999);
1176
+ return t.forEach((o, n) => e[o] = n), (o, n) => (e[n.id] || 999999) - (e[o.id] || 999999);
1157
1177
  }, p = {
1158
1178
  addOperationOperation(t, e) {
1159
- const n = t.specifications[t.specifications.length - 1];
1160
- for (let o = 0; o < n.modules.length; o++)
1161
- n.modules[o].id == e.input.moduleId && n.modules[o].operations.push({
1179
+ const o = t.specifications[t.specifications.length - 1];
1180
+ for (let n = 0; n < o.modules.length; n++)
1181
+ o.modules[n].id == e.input.moduleId && o.modules[n].operations.push({
1162
1182
  id: e.input.id,
1163
1183
  name: e.input.name,
1164
1184
  description: e.input.description || "",
@@ -1171,253 +1191,302 @@ const Dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1171
1191
  });
1172
1192
  },
1173
1193
  setOperationNameOperation(t, e) {
1174
- const n = t.specifications[t.specifications.length - 1];
1175
- for (let o = 0; o < n.modules.length; o++)
1176
- for (let i = 0; i < n.modules[o].operations.length; i++)
1177
- n.modules[o].operations[i].id == e.input.id && (n.modules[o].operations[i].name = e.input.name || "");
1194
+ const o = t.specifications[t.specifications.length - 1];
1195
+ for (let n = 0; n < o.modules.length; n++)
1196
+ for (let i = 0; i < o.modules[n].operations.length; i++)
1197
+ o.modules[n].operations[i].id == e.input.id && (o.modules[n].operations[i].name = e.input.name || "");
1178
1198
  },
1179
1199
  setOperationScopeOperation(t, e) {
1180
- const n = t.specifications[t.specifications.length - 1];
1181
- for (let o = 0; o < n.modules.length; o++)
1182
- for (let i = 0; i < n.modules[o].operations.length; i++)
1183
- n.modules[o].operations[i].id == e.input.id && (n.modules[o].operations[i].scope = e.input.scope || "global");
1200
+ const o = t.specifications[t.specifications.length - 1];
1201
+ for (let n = 0; n < o.modules.length; n++)
1202
+ for (let i = 0; i < o.modules[n].operations.length; i++)
1203
+ o.modules[n].operations[i].id == e.input.id && (o.modules[n].operations[i].scope = e.input.scope || "global");
1184
1204
  },
1185
1205
  setOperationSchemaOperation(t, e) {
1186
- const n = t.specifications[t.specifications.length - 1];
1187
- for (let o = 0; o < n.modules.length; o++)
1188
- for (let i = 0; i < n.modules[o].operations.length; i++)
1189
- n.modules[o].operations[i].id == e.input.id && (n.modules[o].operations[i].schema = e.input.schema || "");
1206
+ const o = t.specifications[t.specifications.length - 1];
1207
+ for (let n = 0; n < o.modules.length; n++)
1208
+ for (let i = 0; i < o.modules[n].operations.length; i++)
1209
+ o.modules[n].operations[i].id == e.input.id && (o.modules[n].operations[i].schema = e.input.schema || "");
1190
1210
  },
1191
1211
  setOperationDescriptionOperation(t, e) {
1192
- const n = t.specifications[t.specifications.length - 1];
1193
- for (let o = 0; o < n.modules.length; o++)
1194
- for (let i = 0; i < n.modules[o].operations.length; i++)
1195
- n.modules[o].operations[i].id == e.input.id && (n.modules[o].operations[i].description = e.input.description || "");
1212
+ const o = t.specifications[t.specifications.length - 1];
1213
+ for (let n = 0; n < o.modules.length; n++)
1214
+ for (let i = 0; i < o.modules[n].operations.length; i++)
1215
+ o.modules[n].operations[i].id == e.input.id && (o.modules[n].operations[i].description = e.input.description || "");
1196
1216
  },
1197
1217
  setOperationTemplateOperation(t, e) {
1198
- const n = t.specifications[t.specifications.length - 1];
1199
- for (let o = 0; o < n.modules.length; o++)
1200
- for (let i = 0; i < n.modules[o].operations.length; i++)
1201
- n.modules[o].operations[i].id == e.input.id && (n.modules[o].operations[i].template = e.input.template || "");
1218
+ const o = t.specifications[t.specifications.length - 1];
1219
+ for (let n = 0; n < o.modules.length; n++)
1220
+ for (let i = 0; i < o.modules[n].operations.length; i++)
1221
+ o.modules[n].operations[i].id == e.input.id && (o.modules[n].operations[i].template = e.input.template || "");
1202
1222
  },
1203
1223
  setOperationReducerOperation(t, e) {
1204
- const n = t.specifications[t.specifications.length - 1];
1205
- for (let o = 0; o < n.modules.length; o++)
1206
- for (let i = 0; i < n.modules[o].operations.length; i++)
1207
- n.modules[o].operations[i].id == e.input.id && (n.modules[o].operations[i].reducer = e.input.reducer || "");
1224
+ const o = t.specifications[t.specifications.length - 1];
1225
+ for (let n = 0; n < o.modules.length; n++)
1226
+ for (let i = 0; i < o.modules[n].operations.length; i++)
1227
+ o.modules[n].operations[i].id == e.input.id && (o.modules[n].operations[i].reducer = e.input.reducer || "");
1208
1228
  },
1209
1229
  moveOperationOperation(t, e) {
1210
- const n = [], o = t.specifications[t.specifications.length - 1];
1211
- for (let i = 0; i < o.modules.length; i++)
1212
- o.modules[i].operations = o.modules[i].operations.filter((a) => a.id == e.input.operationId ? (n.push(a), !1) : !0);
1213
- for (let i = 0; i < o.modules.length; i++)
1214
- o.modules[i].id == e.input.newModuleId && o.modules[i].operations.push(...n);
1230
+ const o = [], n = t.specifications[t.specifications.length - 1];
1231
+ for (let i = 0; i < n.modules.length; i++)
1232
+ n.modules[i].operations = n.modules[i].operations.filter((a) => a.id == e.input.operationId ? (o.push(a), !1) : !0);
1233
+ for (let i = 0; i < n.modules.length; i++)
1234
+ n.modules[i].id == e.input.newModuleId && n.modules[i].operations.push(...o);
1215
1235
  },
1216
1236
  deleteOperationOperation(t, e) {
1217
- const n = t.specifications[t.specifications.length - 1];
1218
- for (let o = 0; o < n.modules.length; o++)
1219
- n.modules[o].operations = n.modules[o].operations.filter((i) => i.id != e.input.id);
1237
+ const o = t.specifications[t.specifications.length - 1];
1238
+ for (let n = 0; n < o.modules.length; n++)
1239
+ o.modules[n].operations = o.modules[n].operations.filter((i) => i.id != e.input.id);
1220
1240
  },
1221
1241
  reorderModuleOperationsOperation(t, e) {
1222
- const n = t.specifications[t.specifications.length - 1];
1223
- for (let o = 0; o < n.modules.length; o++)
1224
- n.modules[o].id == e.input.moduleId && n.modules[o].operations.sort(
1225
- Lt(e.input.order)
1242
+ const o = t.specifications[t.specifications.length - 1];
1243
+ for (let n = 0; n < o.modules.length; n++)
1244
+ o.modules[n].id == e.input.moduleId && o.modules[n].operations.sort(
1245
+ Pt(e.input.order)
1226
1246
  );
1227
1247
  }
1228
- }, Pt = (t) => {
1248
+ }, jt = (t) => {
1229
1249
  const e = {};
1230
- return t.forEach((n, o) => e[n] = o), (n, o) => (e[o.id] || 999999) - (e[n.id] || 999999);
1250
+ return t.forEach((o, n) => e[o] = n), (o, n) => (e[n.id] || 999999) - (e[o.id] || 999999);
1231
1251
  }, u = {
1232
1252
  setStateSchemaOperation(t, e) {
1233
- const n = t.specifications[t.specifications.length - 1];
1234
- n.state.schema = e.input.schema;
1253
+ const o = t.specifications[t.specifications.length - 1];
1254
+ if (Object.keys(o.state).includes(e.input.scope))
1255
+ o.state[e.input.scope].schema = e.input.schema;
1256
+ else
1257
+ throw new Error(`Invalid scope: ${e.input.scope}`);
1235
1258
  },
1236
1259
  setInitialStateOperation(t, e) {
1237
- const n = t.specifications[t.specifications.length - 1];
1238
- n.state.initialValue = e.input.initialValue;
1260
+ const o = t.specifications[t.specifications.length - 1];
1261
+ if (Object.keys(o.state).includes(e.input.scope))
1262
+ o.state[e.input.scope].initialValue = e.input.initialValue;
1263
+ else
1264
+ throw new Error(`Invalid scope: ${e.input.scope}`);
1239
1265
  },
1240
1266
  addStateExampleOperation(t, e) {
1241
- t.specifications[t.specifications.length - 1].state.examples.push({
1242
- id: e.input.id,
1243
- value: e.input.example
1244
- });
1267
+ const o = t.specifications[t.specifications.length - 1];
1268
+ if (Object.keys(o.state).includes(e.input.scope))
1269
+ o.state[e.input.scope].examples.push({
1270
+ id: e.input.id,
1271
+ value: e.input.example
1272
+ });
1273
+ else
1274
+ throw new Error(`Invalid scope: ${e.input.scope}`);
1245
1275
  },
1246
1276
  updateStateExampleOperation(t, e) {
1247
- const n = t.specifications[t.specifications.length - 1];
1248
- for (let o = 0; o < n.state.examples.length; o++)
1249
- n.state.examples[o].id == e.input.id && (n.state.examples[o].value = e.input.newExample);
1277
+ const o = t.specifications[t.specifications.length - 1];
1278
+ if (!Object.keys(o.state).includes(e.input.scope))
1279
+ throw new Error(`Invalid scope: ${e.input.scope}`);
1280
+ const n = o.state[e.input.scope].examples;
1281
+ for (let i = 0; i < n.length; i++)
1282
+ n[i].id == e.input.id && (n[i].value = e.input.newExample);
1250
1283
  },
1251
1284
  deleteStateExampleOperation(t, e) {
1252
- const n = t.specifications[t.specifications.length - 1];
1253
- n.state.examples = n.state.examples.filter(
1254
- (o) => o.id != e.input.id
1255
- );
1285
+ const o = t.specifications[t.specifications.length - 1];
1286
+ if (Object.keys(o.state).includes(e.input.scope))
1287
+ o.state[e.input.scope].examples = o.state[e.input.scope].examples.filter((n) => n.id != e.input.id);
1288
+ else
1289
+ throw new Error(`Invalid scope: ${e.input.scope}`);
1256
1290
  },
1257
1291
  reorderStateExamplesOperation(t, e) {
1258
- t.specifications[t.specifications.length - 1].state.examples.sort(Pt(e.input.order));
1292
+ const o = t.specifications[t.specifications.length - 1];
1293
+ if (Object.keys(o.state).includes(e.input.scope))
1294
+ o.state[e.input.scope].examples.sort(jt(e.input.order));
1295
+ else
1296
+ throw new Error(`Invalid scope: ${e.input.scope}`);
1259
1297
  }
1260
- }, jt = (t, e) => {
1261
- if (mt(e))
1298
+ }, Ct = (t, e) => {
1299
+ if (Et(e))
1262
1300
  return t;
1263
1301
  switch (e.type) {
1264
1302
  case "SET_MODEL_NAME":
1265
- $().parse(e.input), c.setModelNameOperation(t, e);
1303
+ z().parse(e.input), d.setModelNameOperation(t.global, e);
1266
1304
  break;
1267
1305
  case "SET_MODEL_ID":
1268
- W().parse(e.input), c.setModelIdOperation(t, e);
1306
+ W().parse(e.input), d.setModelIdOperation(t.global, e);
1269
1307
  break;
1270
1308
  case "SET_MODEL_EXTENSION":
1271
- G().parse(e.input), c.setModelExtensionOperation(t, e);
1309
+ $().parse(e.input), d.setModelExtensionOperation(t.global, e);
1272
1310
  break;
1273
1311
  case "SET_MODEL_DESCRIPTION":
1274
- X().parse(e.input), c.setModelDescriptionOperation(t, e);
1312
+ G().parse(e.input), d.setModelDescriptionOperation(t.global, e);
1275
1313
  break;
1276
1314
  case "SET_AUTHOR_NAME":
1277
- F().parse(e.input), c.setAuthorNameOperation(t, e);
1315
+ F().parse(e.input), d.setAuthorNameOperation(t.global, e);
1278
1316
  break;
1279
1317
  case "SET_AUTHOR_WEBSITE":
1280
- H().parse(e.input), c.setAuthorWebsiteOperation(t, e);
1318
+ H().parse(e.input), d.setAuthorWebsiteOperation(t.global, e);
1281
1319
  break;
1282
1320
  case "ADD_CHANGE_LOG_ITEM":
1283
- f().parse(e.input), E.addChangeLogItemOperation(t, e);
1321
+ f().parse(e.input), E.addChangeLogItemOperation(t.global, e);
1284
1322
  break;
1285
1323
  case "UPDATE_CHANGE_LOG_ITEM":
1286
- ne().parse(e.input), E.updateChangeLogItemOperation(t, e);
1324
+ ie().parse(e.input), E.updateChangeLogItemOperation(
1325
+ t.global,
1326
+ e
1327
+ );
1287
1328
  break;
1288
1329
  case "DELETE_CHANGE_LOG_ITEM":
1289
- D().parse(e.input), E.deleteChangeLogItemOperation(t, e);
1330
+ D().parse(e.input), E.deleteChangeLogItemOperation(
1331
+ t.global,
1332
+ e
1333
+ );
1290
1334
  break;
1291
1335
  case "REORDER_CHANGE_LOG_ITEMS":
1292
- C().parse(e.input), E.reorderChangeLogItemsOperation(t, e);
1336
+ k().parse(e.input), E.reorderChangeLogItemsOperation(
1337
+ t.global,
1338
+ e
1339
+ );
1293
1340
  break;
1294
1341
  case "RELEASE_NEW_VERSION":
1295
1342
  if (Object.keys(e.input).length > 0)
1296
1343
  throw new Error(
1297
1344
  "Expected empty input for action RELEASE_NEW_VERSION"
1298
1345
  );
1299
- E.releaseNewVersionOperation(t, e);
1346
+ E.releaseNewVersionOperation(t.global, e);
1300
1347
  break;
1301
1348
  case "ADD_MODULE":
1302
- _().parse(e.input), h.addModuleOperation(t, e);
1349
+ _().parse(e.input), h.addModuleOperation(t.global, e);
1303
1350
  break;
1304
1351
  case "SET_MODULE_NAME":
1305
- B().parse(e.input), h.setModuleNameOperation(t, e);
1352
+ q().parse(e.input), h.setModuleNameOperation(t.global, e);
1306
1353
  break;
1307
1354
  case "SET_MODULE_DESCRIPTION":
1308
- z().parse(e.input), h.setModuleDescriptionOperation(t, e);
1355
+ B().parse(e.input), h.setModuleDescriptionOperation(t.global, e);
1309
1356
  break;
1310
1357
  case "DELETE_MODULE":
1311
- x().parse(e.input), h.deleteModuleOperation(t, e);
1358
+ M().parse(e.input), h.deleteModuleOperation(t.global, e);
1312
1359
  break;
1313
1360
  case "REORDER_MODULES":
1314
- y().parse(e.input), h.reorderModulesOperation(t, e);
1361
+ w().parse(e.input), h.reorderModulesOperation(t.global, e);
1315
1362
  break;
1316
1363
  case "ADD_OPERATION_ERROR":
1317
- I().parse(e.input), d.addOperationErrorOperation(t, e);
1364
+ I().parse(e.input), c.addOperationErrorOperation(
1365
+ t.global,
1366
+ e
1367
+ );
1318
1368
  break;
1319
1369
  case "SET_OPERATION_ERROR_CODE":
1320
- J().parse(e.input), d.setOperationErrorCodeOperation(t, e);
1370
+ K().parse(e.input), c.setOperationErrorCodeOperation(
1371
+ t.global,
1372
+ e
1373
+ );
1321
1374
  break;
1322
1375
  case "SET_OPERATION_ERROR_NAME":
1323
- Q().parse(e.input), d.setOperationErrorNameOperation(t, e);
1376
+ Y().parse(e.input), c.setOperationErrorNameOperation(
1377
+ t.global,
1378
+ e
1379
+ );
1324
1380
  break;
1325
1381
  case "SET_OPERATION_ERROR_DESCRIPTION":
1326
- K().parse(e.input), d.setOperationErrorDescriptionOperation(
1327
- t,
1382
+ Q().parse(e.input), c.setOperationErrorDescriptionOperation(
1383
+ t.global,
1328
1384
  e
1329
1385
  );
1330
1386
  break;
1331
1387
  case "SET_OPERATION_ERROR_TEMPLATE":
1332
- Y().parse(e.input), d.setOperationErrorTemplateOperation(
1333
- t,
1388
+ Z().parse(e.input), c.setOperationErrorTemplateOperation(
1389
+ t.global,
1334
1390
  e
1335
1391
  );
1336
1392
  break;
1337
1393
  case "DELETE_OPERATION_ERROR":
1338
- M().parse(e.input), d.deleteOperationErrorOperation(t, e);
1394
+ N().parse(e.input), c.deleteOperationErrorOperation(
1395
+ t.global,
1396
+ e
1397
+ );
1339
1398
  break;
1340
1399
  case "REORDER_OPERATION_ERRORS":
1341
- w().parse(e.input), d.reorderOperationErrorsOperation(
1342
- t,
1400
+ v().parse(e.input), c.reorderOperationErrorsOperation(
1401
+ t.global,
1343
1402
  e
1344
1403
  );
1345
1404
  break;
1346
1405
  case "ADD_OPERATION_EXAMPLE":
1347
- T().parse(e.input), S.addOperationExampleOperation(t, e);
1406
+ T().parse(e.input), S.addOperationExampleOperation(
1407
+ t.global,
1408
+ e
1409
+ );
1348
1410
  break;
1349
1411
  case "UPDATE_OPERATION_EXAMPLE":
1350
- ie().parse(e.input), S.updateOperationExampleOperation(
1351
- t,
1412
+ se().parse(e.input), S.updateOperationExampleOperation(
1413
+ t.global,
1352
1414
  e
1353
1415
  );
1354
1416
  break;
1355
1417
  case "DELETE_OPERATION_EXAMPLE":
1356
- N().parse(e.input), S.deleteOperationExampleOperation(
1357
- t,
1418
+ L().parse(e.input), S.deleteOperationExampleOperation(
1419
+ t.global,
1358
1420
  e
1359
1421
  );
1360
1422
  break;
1361
1423
  case "REORDER_OPERATION_EXAMPLES":
1362
1424
  U().parse(e.input), S.reorderOperationExamplesOperation(
1363
- t,
1425
+ t.global,
1364
1426
  e
1365
1427
  );
1366
1428
  break;
1367
1429
  case "ADD_OPERATION":
1368
- b().parse(e.input), p.addOperationOperation(t, e);
1430
+ R().parse(e.input), p.addOperationOperation(t.global, e);
1369
1431
  break;
1370
1432
  case "SET_OPERATION_NAME":
1371
- Z().parse(e.input), p.setOperationNameOperation(t, e);
1433
+ ee().parse(e.input), p.setOperationNameOperation(t.global, e);
1372
1434
  break;
1373
1435
  case "SET_OPERATION_SCOPE":
1374
- Oe().parse(e.input), p.setOperationScopeOperation(t, e);
1436
+ ge().parse(e.input), p.setOperationScopeOperation(t.global, e);
1375
1437
  break;
1376
1438
  case "SET_OPERATION_SCHEMA":
1377
- te().parse(e.input), p.setOperationSchemaOperation(t, e);
1439
+ re().parse(e.input), p.setOperationSchemaOperation(t.global, e);
1378
1440
  break;
1379
1441
  case "SET_OPERATION_DESCRIPTION":
1380
- q().parse(e.input), p.setOperationDescriptionOperation(t, e);
1442
+ J().parse(e.input), p.setOperationDescriptionOperation(
1443
+ t.global,
1444
+ e
1445
+ );
1381
1446
  break;
1382
1447
  case "SET_OPERATION_TEMPLATE":
1383
- re().parse(e.input), p.setOperationTemplateOperation(t, e);
1448
+ oe().parse(e.input), p.setOperationTemplateOperation(
1449
+ t.global,
1450
+ e
1451
+ );
1384
1452
  break;
1385
1453
  case "SET_OPERATION_REDUCER":
1386
- ee().parse(e.input), p.setOperationReducerOperation(t, e);
1454
+ te().parse(e.input), p.setOperationReducerOperation(t.global, e);
1387
1455
  break;
1388
1456
  case "MOVE_OPERATION":
1389
- j().parse(e.input), p.moveOperationOperation(t, e);
1457
+ C().parse(e.input), p.moveOperationOperation(t.global, e);
1390
1458
  break;
1391
1459
  case "DELETE_OPERATION":
1392
- L().parse(e.input), p.deleteOperationOperation(t, e);
1460
+ P().parse(e.input), p.deleteOperationOperation(t.global, e);
1393
1461
  break;
1394
1462
  case "REORDER_MODULE_OPERATIONS":
1395
- k().parse(e.input), p.reorderModuleOperationsOperation(t, e);
1463
+ y().parse(e.input), p.reorderModuleOperationsOperation(
1464
+ t.global,
1465
+ e
1466
+ );
1396
1467
  break;
1397
1468
  case "SET_STATE_SCHEMA":
1398
- oe().parse(e.input), u.setStateSchemaOperation(t, e);
1469
+ ne().parse(e.input), u.setStateSchemaOperation(t.global, e);
1399
1470
  break;
1400
1471
  case "SET_INITIAL_STATE":
1401
- V().parse(e.input), u.setInitialStateOperation(t, e);
1472
+ X().parse(e.input), u.setInitialStateOperation(t.global, e);
1402
1473
  break;
1403
1474
  case "ADD_STATE_EXAMPLE":
1404
- R().parse(e.input), u.addStateExampleOperation(t, e);
1475
+ A().parse(e.input), u.addStateExampleOperation(t.global, e);
1405
1476
  break;
1406
1477
  case "UPDATE_STATE_EXAMPLE":
1407
- se().parse(e.input), u.updateStateExampleOperation(t, e);
1478
+ ae().parse(e.input), u.updateStateExampleOperation(t.global, e);
1408
1479
  break;
1409
1480
  case "DELETE_STATE_EXAMPLE":
1410
- P().parse(e.input), u.deleteStateExampleOperation(t, e);
1481
+ j().parse(e.input), u.deleteStateExampleOperation(t.global, e);
1411
1482
  break;
1412
1483
  case "REORDER_STATE_EXAMPLES":
1413
- v().parse(e.input), u.reorderStateExamplesOperation(t, e);
1484
+ V().parse(e.input), u.reorderStateExamplesOperation(t.global, e);
1414
1485
  break;
1415
1486
  default:
1416
1487
  return t;
1417
1488
  }
1418
- }, g = ut(
1419
- jt
1420
- ), Ct = {
1489
+ }, g = mt(Ct), kt = {
1421
1490
  id: "",
1422
1491
  name: "",
1423
1492
  extension: "",
@@ -1431,43 +1500,53 @@ const Dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1431
1500
  version: 1,
1432
1501
  changeLog: [],
1433
1502
  state: {
1434
- schema: "",
1435
- initialValue: "",
1436
- examples: []
1503
+ global: {
1504
+ schema: "",
1505
+ initialValue: "",
1506
+ examples: []
1507
+ },
1508
+ local: {
1509
+ schema: "",
1510
+ initialValue: "",
1511
+ examples: []
1512
+ }
1437
1513
  },
1438
1514
  modules: []
1439
1515
  }
1440
1516
  ]
1441
- }, O = {
1517
+ }, yt = {}, O = {
1442
1518
  fileExtension: "phdm",
1443
1519
  createState(t) {
1444
- return { ...Ct, ...t };
1520
+ return {
1521
+ global: { ...kt, ...t == null ? void 0 : t.global },
1522
+ local: { ...yt, ...t == null ? void 0 : t.local }
1523
+ };
1445
1524
  },
1446
1525
  createExtendedState(t) {
1447
- return Et(
1526
+ return ht(
1448
1527
  { ...t, documentType: "powerhouse/document-model" },
1449
1528
  O.createState
1450
1529
  );
1451
1530
  },
1452
1531
  createDocument(t) {
1453
- return ht(
1532
+ return Ot(
1454
1533
  O.createExtendedState(t),
1455
1534
  O.createState
1456
1535
  );
1457
1536
  },
1458
- saveToFile(t, e, n) {
1459
- return Ot(t, e, "phdm", n);
1537
+ saveToFile(t, e, o) {
1538
+ return gt(t, e, "phdm", o);
1460
1539
  },
1461
1540
  saveToFileHandle(t, e) {
1462
- return gt(t, e);
1541
+ return St(t, e);
1463
1542
  },
1464
1543
  loadFromFile(t) {
1465
- return St(t, g);
1544
+ return bt(t, g);
1466
1545
  },
1467
1546
  loadFromInput(t) {
1468
1547
  return ft(t, g);
1469
1548
  }
1470
- }, Se = (t) => s(
1549
+ }, be = (t) => s(
1471
1550
  "SET_MODEL_NAME",
1472
1551
  { ...t }
1473
1552
  ), fe = (t) => s(
@@ -1482,13 +1561,13 @@ const Dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1482
1561
  ), Te = (t) => s(
1483
1562
  "SET_AUTHOR_NAME",
1484
1563
  { ...t }
1485
- ), be = (t) => s(
1564
+ ), Re = (t) => s(
1486
1565
  "SET_AUTHOR_WEBSITE",
1487
1566
  { ...t }
1488
1567
  );
1489
- class kt extends l {
1568
+ class wt extends l {
1490
1569
  setModelName(e) {
1491
- return this.dispatch(Se(e));
1570
+ return this.dispatch(be(e));
1492
1571
  }
1493
1572
  setModelId(e) {
1494
1573
  return this.dispatch(fe(e));
@@ -1503,85 +1582,85 @@ class kt extends l {
1503
1582
  return this.dispatch(Te(e));
1504
1583
  }
1505
1584
  setAuthorWebsite(e) {
1506
- return this.dispatch(be(e));
1585
+ return this.dispatch(Re(e));
1507
1586
  }
1508
1587
  }
1509
- const Re = (t) => s(
1588
+ const Ae = (t) => s(
1510
1589
  "ADD_CHANGE_LOG_ITEM",
1511
1590
  { ...t }
1512
- ), Ae = (t) => s(
1591
+ ), xe = (t) => s(
1513
1592
  "UPDATE_CHANGE_LOG_ITEM",
1514
1593
  { ...t }
1515
1594
  ), De = (t) => s(
1516
1595
  "DELETE_CHANGE_LOG_ITEM",
1517
1596
  { ...t }
1518
- ), xe = (t) => s(
1597
+ ), Me = (t) => s(
1519
1598
  "REORDER_CHANGE_LOG_ITEMS",
1520
1599
  { ...t }
1521
- ), Me = () => s("RELEASE_NEW_VERSION");
1522
- class yt extends l {
1600
+ ), Ne = () => s("RELEASE_NEW_VERSION");
1601
+ class vt extends l {
1523
1602
  addChangeLogItem(e) {
1524
- return this.dispatch(Re(e));
1603
+ return this.dispatch(Ae(e));
1525
1604
  }
1526
1605
  updateChangeLogItem(e) {
1527
- return this.dispatch(Ae(e));
1606
+ return this.dispatch(xe(e));
1528
1607
  }
1529
1608
  deleteChangeLogItem(e) {
1530
1609
  return this.dispatch(De(e));
1531
1610
  }
1532
1611
  reorderChangeLogItems(e) {
1533
- return this.dispatch(xe(e));
1612
+ return this.dispatch(Me(e));
1534
1613
  }
1535
1614
  releaseNewVersion() {
1536
- return this.dispatch(Me());
1615
+ return this.dispatch(Ne());
1537
1616
  }
1538
1617
  }
1539
- const Ne = (t) => s(
1618
+ const Le = (t) => s(
1540
1619
  "ADD_MODULE",
1541
1620
  { ...t }
1542
- ), Le = (t) => s(
1621
+ ), Pe = (t) => s(
1543
1622
  "SET_MODULE_NAME",
1544
1623
  { ...t }
1545
- ), Pe = (t) => s(
1624
+ ), je = (t) => s(
1546
1625
  "SET_MODULE_DESCRIPTION",
1547
1626
  { ...t }
1548
- ), je = (t) => s(
1627
+ ), Ce = (t) => s(
1549
1628
  "DELETE_MODULE",
1550
1629
  { ...t }
1551
- ), Ce = (t) => s(
1630
+ ), ke = (t) => s(
1552
1631
  "REORDER_MODULES",
1553
1632
  { ...t }
1554
1633
  );
1555
- class wt extends l {
1634
+ class Ut extends l {
1556
1635
  addModule(e) {
1557
- return this.dispatch(Ne(e));
1636
+ return this.dispatch(Le(e));
1558
1637
  }
1559
1638
  setModuleName(e) {
1560
- return this.dispatch(Le(e));
1639
+ return this.dispatch(Pe(e));
1561
1640
  }
1562
1641
  setModuleDescription(e) {
1563
- return this.dispatch(Pe(e));
1642
+ return this.dispatch(je(e));
1564
1643
  }
1565
1644
  deleteModule(e) {
1566
- return this.dispatch(je(e));
1645
+ return this.dispatch(Ce(e));
1567
1646
  }
1568
1647
  reorderModules(e) {
1569
- return this.dispatch(Ce(e));
1648
+ return this.dispatch(ke(e));
1570
1649
  }
1571
1650
  }
1572
- const ke = (t) => s(
1651
+ const ye = (t) => s(
1573
1652
  "ADD_OPERATION_ERROR",
1574
1653
  { ...t }
1575
- ), ye = (t) => s(
1654
+ ), we = (t) => s(
1576
1655
  "SET_OPERATION_ERROR_CODE",
1577
1656
  { ...t }
1578
- ), we = (t) => s(
1657
+ ), ve = (t) => s(
1579
1658
  "SET_OPERATION_ERROR_NAME",
1580
1659
  { ...t }
1581
1660
  ), Ue = (t) => s(
1582
1661
  "SET_OPERATION_ERROR_DESCRIPTION",
1583
1662
  { ...t }
1584
- ), ve = (t) => s(
1663
+ ), Ve = (t) => s(
1585
1664
  "SET_OPERATION_ERROR_TEMPLATE",
1586
1665
  { ...t }
1587
1666
  ), Fe = (t) => s(
@@ -1591,21 +1670,21 @@ const ke = (t) => s(
1591
1670
  "REORDER_OPERATION_ERRORS",
1592
1671
  { ...t }
1593
1672
  );
1594
- class Ut extends l {
1673
+ class Vt extends l {
1595
1674
  addOperationError(e) {
1596
- return this.dispatch(ke(e));
1675
+ return this.dispatch(ye(e));
1597
1676
  }
1598
1677
  setOperationErrorCode(e) {
1599
- return this.dispatch(ye(e));
1678
+ return this.dispatch(we(e));
1600
1679
  }
1601
1680
  setOperationErrorName(e) {
1602
- return this.dispatch(we(e));
1681
+ return this.dispatch(ve(e));
1603
1682
  }
1604
1683
  setOperationErrorDescription(e) {
1605
1684
  return this.dispatch(Ue(e));
1606
1685
  }
1607
1686
  setOperationErrorTemplate(e) {
1608
- return this.dispatch(ve(e));
1687
+ return this.dispatch(Ve(e));
1609
1688
  }
1610
1689
  deleteOperationError(e) {
1611
1690
  return this.dispatch(Fe(e));
@@ -1614,230 +1693,230 @@ class Ut extends l {
1614
1693
  return this.dispatch(He(e));
1615
1694
  }
1616
1695
  }
1617
- const Ve = (t) => s(
1696
+ const Xe = (t) => s(
1618
1697
  "ADD_OPERATION_EXAMPLE",
1619
1698
  { ...t }
1620
- ), Xe = (t) => s(
1699
+ ), Ge = (t) => s(
1621
1700
  "UPDATE_OPERATION_EXAMPLE",
1622
1701
  { ...t }
1623
- ), Ge = (t) => s(
1702
+ ), $e = (t) => s(
1624
1703
  "DELETE_OPERATION_EXAMPLE",
1625
1704
  { ...t }
1626
1705
  ), We = (t) => s(
1627
1706
  "REORDER_OPERATION_EXAMPLES",
1628
1707
  { ...t }
1629
1708
  );
1630
- class vt extends l {
1709
+ class Ft extends l {
1631
1710
  addOperationExample(e) {
1632
- return this.dispatch(Ve(e));
1711
+ return this.dispatch(Xe(e));
1633
1712
  }
1634
1713
  updateOperationExample(e) {
1635
- return this.dispatch(Xe(e));
1714
+ return this.dispatch(Ge(e));
1636
1715
  }
1637
1716
  deleteOperationExample(e) {
1638
- return this.dispatch(Ge(e));
1717
+ return this.dispatch($e(e));
1639
1718
  }
1640
1719
  reorderOperationExamples(e) {
1641
1720
  return this.dispatch(We(e));
1642
1721
  }
1643
1722
  }
1644
- const $e = (t) => s(
1723
+ const ze = (t) => s(
1645
1724
  "ADD_OPERATION",
1646
1725
  { ...t }
1647
- ), ze = (t) => s(
1726
+ ), Be = (t) => s(
1648
1727
  "SET_OPERATION_NAME",
1649
1728
  { ...t }
1650
- ), Be = (t) => s(
1729
+ ), qe = (t) => s(
1651
1730
  "SET_OPERATION_SCOPE",
1652
1731
  { ...t }
1653
- ), qe = (t) => s(
1732
+ ), Je = (t) => s(
1654
1733
  "SET_OPERATION_SCHEMA",
1655
1734
  { ...t }
1656
- ), Je = (t) => s(
1735
+ ), Ke = (t) => s(
1657
1736
  "SET_OPERATION_DESCRIPTION",
1658
1737
  { ...t }
1659
- ), Ke = (t) => s(
1738
+ ), Qe = (t) => s(
1660
1739
  "SET_OPERATION_TEMPLATE",
1661
1740
  { ...t }
1662
- ), Qe = (t) => s(
1741
+ ), Ye = (t) => s(
1663
1742
  "SET_OPERATION_REDUCER",
1664
1743
  { ...t }
1665
- ), Ye = (t) => s(
1744
+ ), Ze = (t) => s(
1666
1745
  "MOVE_OPERATION",
1667
1746
  { ...t }
1668
- ), Ze = (t) => s(
1747
+ ), et = (t) => s(
1669
1748
  "DELETE_OPERATION",
1670
1749
  { ...t }
1671
- ), et = (t) => s(
1750
+ ), tt = (t) => s(
1672
1751
  "REORDER_MODULE_OPERATIONS",
1673
1752
  { ...t }
1674
1753
  );
1675
- class Ft extends l {
1754
+ class Ht extends l {
1676
1755
  addOperation(e) {
1677
- return this.dispatch($e(e));
1756
+ return this.dispatch(ze(e));
1678
1757
  }
1679
1758
  setOperationName(e) {
1680
- return this.dispatch(ze(e));
1759
+ return this.dispatch(Be(e));
1681
1760
  }
1682
1761
  setOperationScope(e) {
1683
- return this.dispatch(Be(e));
1762
+ return this.dispatch(qe(e));
1684
1763
  }
1685
1764
  setOperationSchema(e) {
1686
- return this.dispatch(qe(e));
1765
+ return this.dispatch(Je(e));
1687
1766
  }
1688
1767
  setOperationDescription(e) {
1689
- return this.dispatch(Je(e));
1768
+ return this.dispatch(Ke(e));
1690
1769
  }
1691
1770
  setOperationTemplate(e) {
1692
- return this.dispatch(Ke(e));
1771
+ return this.dispatch(Qe(e));
1693
1772
  }
1694
1773
  setOperationReducer(e) {
1695
- return this.dispatch(Qe(e));
1774
+ return this.dispatch(Ye(e));
1696
1775
  }
1697
1776
  moveOperation(e) {
1698
- return this.dispatch(Ye(e));
1777
+ return this.dispatch(Ze(e));
1699
1778
  }
1700
1779
  deleteOperation(e) {
1701
- return this.dispatch(Ze(e));
1780
+ return this.dispatch(et(e));
1702
1781
  }
1703
1782
  reorderModuleOperations(e) {
1704
- return this.dispatch(et(e));
1783
+ return this.dispatch(tt(e));
1705
1784
  }
1706
1785
  }
1707
- const tt = (t) => s(
1786
+ const rt = (t) => s(
1708
1787
  "SET_STATE_SCHEMA",
1709
1788
  { ...t }
1710
- ), rt = (t) => s(
1789
+ ), ot = (t) => s(
1711
1790
  "SET_INITIAL_STATE",
1712
1791
  { ...t }
1713
- ), ot = (t) => s(
1792
+ ), nt = (t) => s(
1714
1793
  "ADD_STATE_EXAMPLE",
1715
1794
  { ...t }
1716
- ), nt = (t) => s(
1795
+ ), it = (t) => s(
1717
1796
  "UPDATE_STATE_EXAMPLE",
1718
1797
  { ...t }
1719
- ), it = (t) => s(
1798
+ ), st = (t) => s(
1720
1799
  "DELETE_STATE_EXAMPLE",
1721
1800
  { ...t }
1722
- ), st = (t) => s(
1801
+ ), at = (t) => s(
1723
1802
  "REORDER_STATE_EXAMPLES",
1724
1803
  { ...t }
1725
1804
  );
1726
- class Ht extends l {
1805
+ class Xt extends l {
1727
1806
  setStateSchema(e) {
1728
- return this.dispatch(tt(e));
1807
+ return this.dispatch(rt(e));
1729
1808
  }
1730
1809
  setInitialState(e) {
1731
- return this.dispatch(rt(e));
1810
+ return this.dispatch(ot(e));
1732
1811
  }
1733
1812
  addStateExample(e) {
1734
- return this.dispatch(ot(e));
1813
+ return this.dispatch(nt(e));
1735
1814
  }
1736
1815
  updateStateExample(e) {
1737
- return this.dispatch(nt(e));
1816
+ return this.dispatch(it(e));
1738
1817
  }
1739
1818
  deleteStateExample(e) {
1740
- return this.dispatch(it(e));
1819
+ return this.dispatch(st(e));
1741
1820
  }
1742
1821
  reorderStateExamples(e) {
1743
- return this.dispatch(st(e));
1822
+ return this.dispatch(at(e));
1744
1823
  }
1745
1824
  }
1746
1825
  var m;
1747
- let ae = (m = class extends l {
1748
- constructor(e, n) {
1749
- super(g, O.createDocument(e), n);
1826
+ let pe = (m = class extends l {
1827
+ constructor(e, o) {
1828
+ super(g, O.createDocument(e), o);
1750
1829
  }
1751
- saveToFile(e, n) {
1752
- return super.saveToFile(e, m.fileExtension, n);
1830
+ saveToFile(e, o) {
1831
+ return super.saveToFile(e, m.fileExtension, o);
1753
1832
  }
1754
1833
  loadFromFile(e) {
1755
1834
  return super.loadFromFile(e);
1756
1835
  }
1757
1836
  static async fromFile(e) {
1758
- const n = new this();
1759
- return await n.loadFromFile(e), n;
1837
+ const o = new this();
1838
+ return await o.loadFromFile(e), o;
1760
1839
  }
1761
- }, pe(m, "fileExtension", "phdm"), m);
1762
- _t(ae, [
1763
- kt,
1764
- yt,
1840
+ }, le(m, "fileExtension", "phdm"), m);
1841
+ _t(pe, [
1765
1842
  wt,
1766
- Ut,
1767
1843
  vt,
1844
+ Ut,
1845
+ Vt,
1768
1846
  Ft,
1769
- Ht
1847
+ Ht,
1848
+ Xt
1770
1849
  ]);
1771
- const Vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1850
+ const Gt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1772
1851
  __proto__: null,
1773
- addChangeLogItem: Re,
1774
- addModule: Ne,
1775
- addOperation: $e,
1776
- addOperationError: ke,
1777
- addOperationExample: Ve,
1778
- addStateExample: ot,
1852
+ addChangeLogItem: Ae,
1853
+ addModule: Le,
1854
+ addOperation: ze,
1855
+ addOperationError: ye,
1856
+ addOperationExample: Xe,
1857
+ addStateExample: nt,
1779
1858
  deleteChangeLogItem: De,
1780
- deleteModule: je,
1781
- deleteOperation: Ze,
1859
+ deleteModule: Ce,
1860
+ deleteOperation: et,
1782
1861
  deleteOperationError: Fe,
1783
- deleteOperationExample: Ge,
1784
- deleteStateExample: it,
1785
- moveOperation: Ye,
1786
- releaseNewVersion: Me,
1787
- reorderChangeLogItems: xe,
1788
- reorderModuleOperations: et,
1789
- reorderModules: Ce,
1862
+ deleteOperationExample: $e,
1863
+ deleteStateExample: st,
1864
+ moveOperation: Ze,
1865
+ releaseNewVersion: Ne,
1866
+ reorderChangeLogItems: Me,
1867
+ reorderModuleOperations: tt,
1868
+ reorderModules: ke,
1790
1869
  reorderOperationErrors: He,
1791
1870
  reorderOperationExamples: We,
1792
- reorderStateExamples: st,
1871
+ reorderStateExamples: at,
1793
1872
  setAuthorName: Te,
1794
- setAuthorWebsite: be,
1795
- setInitialState: rt,
1873
+ setAuthorWebsite: Re,
1874
+ setInitialState: ot,
1796
1875
  setModelDescription: Ie,
1797
1876
  setModelExtension: _e,
1798
1877
  setModelId: fe,
1799
- setModelName: Se,
1800
- setModuleDescription: Pe,
1801
- setModuleName: Le,
1802
- setOperationDescription: Je,
1803
- setOperationErrorCode: ye,
1878
+ setModelName: be,
1879
+ setModuleDescription: je,
1880
+ setModuleName: Pe,
1881
+ setOperationDescription: Ke,
1882
+ setOperationErrorCode: we,
1804
1883
  setOperationErrorDescription: Ue,
1805
- setOperationErrorName: we,
1806
- setOperationErrorTemplate: ve,
1807
- setOperationName: ze,
1808
- setOperationReducer: Qe,
1809
- setOperationSchema: qe,
1810
- setOperationScope: Be,
1811
- setOperationTemplate: Ke,
1812
- setStateSchema: tt,
1813
- updateChangeLogItem: Ae,
1814
- updateOperationExample: Xe,
1815
- updateStateExample: nt
1816
- }, Symbol.toStringTag, { value: "Module" })), at = ae, pt = { ...O, ...Tt }, lt = { ...It, ...Vt }, Xt = {
1817
- Document: at,
1884
+ setOperationErrorName: ve,
1885
+ setOperationErrorTemplate: Ve,
1886
+ setOperationName: Be,
1887
+ setOperationReducer: Ye,
1888
+ setOperationSchema: Je,
1889
+ setOperationScope: qe,
1890
+ setOperationTemplate: Qe,
1891
+ setStateSchema: rt,
1892
+ updateChangeLogItem: xe,
1893
+ updateOperationExample: Ge,
1894
+ updateStateExample: it
1895
+ }, Symbol.toStringTag, { value: "Module" })), pt = pe, lt = { ...O, ...Tt }, ct = { ...It, ...Gt }, $t = {
1896
+ Document: pt,
1818
1897
  reducer: g,
1819
- actions: lt,
1820
- utils: pt,
1821
- documentModel: le
1822
- }, Jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1898
+ actions: ct,
1899
+ utils: lt,
1900
+ documentModel: ce
1901
+ }, Qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1823
1902
  __proto__: null,
1824
- Document: at,
1825
- DocumentModel: ae,
1826
- actions: lt,
1827
- documentModel: le,
1828
- module: Xt,
1903
+ Document: pt,
1904
+ DocumentModel: pe,
1905
+ actions: ct,
1906
+ documentModel: ce,
1907
+ module: $t,
1829
1908
  reducer: g,
1830
- utils: pt,
1909
+ utils: lt,
1831
1910
  z: Dt
1832
1911
  }, Symbol.toStringTag, { value: "Module" }));
1833
1912
  export {
1834
- Jt as D,
1835
- ae as a,
1836
- at as b,
1837
- lt as c,
1838
- le as d,
1839
- Xt as m,
1913
+ Qt as D,
1914
+ pe as a,
1915
+ pt as b,
1916
+ ct as c,
1917
+ ce as d,
1918
+ $t as m,
1840
1919
  g as r,
1841
- pt as u,
1920
+ lt as u,
1842
1921
  Dt as z
1843
1922
  };