@activecollab/components 2.0.519 → 2.0.521

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 (92) hide show
  1. package/dist/cjs/components/ConfirmDialog/ConfirmDialog.js +6 -2
  2. package/dist/cjs/components/ConfirmDialog/ConfirmDialog.js.map +1 -1
  3. package/dist/cjs/components/Dialog/Dialog.js +136 -18
  4. package/dist/cjs/components/Dialog/Dialog.js.map +1 -1
  5. package/dist/cjs/components/Dialog/DialogContext.js.map +1 -1
  6. package/dist/cjs/components/Dialog/DialogTitle.js +24 -2
  7. package/dist/cjs/components/Dialog/DialogTitle.js.map +1 -1
  8. package/dist/cjs/components/Dialog/Styles.js +1 -1
  9. package/dist/cjs/components/Dialog/Styles.js.map +1 -1
  10. package/dist/cjs/components/DockedCard/useDockedCard.js +3 -2
  11. package/dist/cjs/components/DockedCard/useDockedCard.js.map +1 -1
  12. package/dist/cjs/components/GlobalPortal/GlobalPortal.js +53 -0
  13. package/dist/cjs/components/GlobalPortal/GlobalPortal.js.map +1 -0
  14. package/dist/cjs/components/GlobalPortal/index.js +17 -0
  15. package/dist/cjs/components/GlobalPortal/index.js.map +1 -0
  16. package/dist/cjs/components/ModalRoot/ModalRoot.js +57 -10
  17. package/dist/cjs/components/ModalRoot/ModalRoot.js.map +1 -1
  18. package/dist/cjs/components/ModalRoot/modalRootStack.js +34 -5
  19. package/dist/cjs/components/ModalRoot/modalRootStack.js.map +1 -1
  20. package/dist/cjs/components/ToastMessage/Styles.js +8 -3
  21. package/dist/cjs/components/ToastMessage/Styles.js.map +1 -1
  22. package/dist/cjs/components/ToastMessage/ToastMessage.js +7 -3
  23. package/dist/cjs/components/ToastMessage/ToastMessage.js.map +1 -1
  24. package/dist/cjs/components/Window/Window.js +2 -2
  25. package/dist/cjs/components/Window/Window.js.map +1 -1
  26. package/dist/cjs/components/index.js +11 -0
  27. package/dist/cjs/components/index.js.map +1 -1
  28. package/dist/cjs/utils/layers.js +12 -4
  29. package/dist/cjs/utils/layers.js.map +1 -1
  30. package/dist/cjs/utils/layers.test.js +30 -0
  31. package/dist/cjs/utils/layers.test.js.map +1 -1
  32. package/dist/esm/components/ConfirmDialog/ConfirmDialog.d.ts +2 -0
  33. package/dist/esm/components/ConfirmDialog/ConfirmDialog.d.ts.map +1 -1
  34. package/dist/esm/components/ConfirmDialog/ConfirmDialog.js +6 -2
  35. package/dist/esm/components/ConfirmDialog/ConfirmDialog.js.map +1 -1
  36. package/dist/esm/components/Dialog/Dialog.d.ts +5 -3
  37. package/dist/esm/components/Dialog/Dialog.d.ts.map +1 -1
  38. package/dist/esm/components/Dialog/Dialog.js +125 -19
  39. package/dist/esm/components/Dialog/Dialog.js.map +1 -1
  40. package/dist/esm/components/Dialog/DialogContext.d.ts +4 -0
  41. package/dist/esm/components/Dialog/DialogContext.d.ts.map +1 -1
  42. package/dist/esm/components/Dialog/DialogContext.js.map +1 -1
  43. package/dist/esm/components/Dialog/DialogTitle.d.ts.map +1 -1
  44. package/dist/esm/components/Dialog/DialogTitle.js +21 -2
  45. package/dist/esm/components/Dialog/DialogTitle.js.map +1 -1
  46. package/dist/esm/components/Dialog/Styles.d.ts.map +1 -1
  47. package/dist/esm/components/Dialog/Styles.js +1 -1
  48. package/dist/esm/components/Dialog/Styles.js.map +1 -1
  49. package/dist/esm/components/DockedCard/useDockedCard.d.ts.map +1 -1
  50. package/dist/esm/components/DockedCard/useDockedCard.js +2 -1
  51. package/dist/esm/components/DockedCard/useDockedCard.js.map +1 -1
  52. package/dist/esm/components/GlobalPortal/GlobalPortal.d.ts +13 -0
  53. package/dist/esm/components/GlobalPortal/GlobalPortal.d.ts.map +1 -0
  54. package/dist/esm/components/GlobalPortal/GlobalPortal.js +39 -0
  55. package/dist/esm/components/GlobalPortal/GlobalPortal.js.map +1 -0
  56. package/dist/esm/components/GlobalPortal/index.d.ts +2 -0
  57. package/dist/esm/components/GlobalPortal/index.d.ts.map +1 -0
  58. package/dist/esm/components/GlobalPortal/index.js +2 -0
  59. package/dist/esm/components/GlobalPortal/index.js.map +1 -0
  60. package/dist/esm/components/ModalRoot/ModalRoot.d.ts +3 -3
  61. package/dist/esm/components/ModalRoot/ModalRoot.d.ts.map +1 -1
  62. package/dist/esm/components/ModalRoot/ModalRoot.js +54 -12
  63. package/dist/esm/components/ModalRoot/ModalRoot.js.map +1 -1
  64. package/dist/esm/components/ModalRoot/modalRootStack.d.ts +6 -1
  65. package/dist/esm/components/ModalRoot/modalRootStack.d.ts.map +1 -1
  66. package/dist/esm/components/ModalRoot/modalRootStack.js +29 -4
  67. package/dist/esm/components/ModalRoot/modalRootStack.js.map +1 -1
  68. package/dist/esm/components/ToastMessage/Styles.d.ts +1 -0
  69. package/dist/esm/components/ToastMessage/Styles.d.ts.map +1 -1
  70. package/dist/esm/components/ToastMessage/Styles.js +7 -2
  71. package/dist/esm/components/ToastMessage/Styles.js.map +1 -1
  72. package/dist/esm/components/ToastMessage/ToastMessage.d.ts +2 -0
  73. package/dist/esm/components/ToastMessage/ToastMessage.d.ts.map +1 -1
  74. package/dist/esm/components/ToastMessage/ToastMessage.js +8 -4
  75. package/dist/esm/components/ToastMessage/ToastMessage.js.map +1 -1
  76. package/dist/esm/components/Window/Window.js +3 -3
  77. package/dist/esm/components/Window/Window.js.map +1 -1
  78. package/dist/esm/components/index.d.ts +1 -0
  79. package/dist/esm/components/index.d.ts.map +1 -1
  80. package/dist/esm/components/index.js +1 -0
  81. package/dist/esm/components/index.js.map +1 -1
  82. package/dist/esm/utils/layers.d.ts +3 -1
  83. package/dist/esm/utils/layers.d.ts.map +1 -1
  84. package/dist/esm/utils/layers.js +11 -3
  85. package/dist/esm/utils/layers.js.map +1 -1
  86. package/dist/esm/utils/layers.test.js +30 -0
  87. package/dist/esm/utils/layers.test.js.map +1 -1
  88. package/dist/index.js +1181 -723
  89. package/dist/index.js.map +1 -1
  90. package/dist/index.min.js +1 -1
  91. package/dist/index.min.js.map +1 -1
  92. package/package.json +1 -1
@@ -4,7 +4,9 @@ export declare const layers: {
4
4
  tower: number;
5
5
  house: number;
6
6
  };
7
- /** The layer in front: the last open window, or null when the page itself is in front. */
7
+ /** The layer an element sits in, or null when it sits on the page. */
8
+ export declare const getLayerOf: (element: Element | null | undefined) => Element | null;
9
+ /** The layer in front: the last open window or dialog, or null when the page itself is in front. */
8
10
  export declare const getTopLayer: () => HTMLElement | null;
9
11
  /**
10
12
  * True when the layer of the element is in front. A handler of a global shortcut asks this first, so the shortcut
@@ -1 +1 @@
1
- {"version":3,"file":"layers.d.ts","sourceRoot":"","sources":["../../../src/utils/layers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;CAKlB,CAAC;AAIF,0FAA0F;AAC1F,eAAO,MAAM,WAAW,QAAO,WAAW,GAAG,IAI5C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,SAAS,OAAO,GAAG,IAAI,GAAG,SAAS,YACK,CAAC"}
1
+ {"version":3,"file":"layers.d.ts","sourceRoot":"","sources":["../../../src/utils/layers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;CAKlB,CAAC;AAKF,sEAAsE;AACtE,eAAO,MAAM,UAAU,GAAI,SAAS,OAAO,GAAG,IAAI,GAAG,SAAS,mBAClB,CAAC;AAE7C,oGAAoG;AACpG,eAAO,MAAM,WAAW,QAAO,WAAW,GAAG,IAI5C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,SAAS,OAAO,GAAG,IAAI,GAAG,SAAS,YACP,CAAC"}
@@ -4,9 +4,17 @@ export const layers = {
4
4
  tower: 1200,
5
5
  house: 1000
6
6
  };
7
- const LAYER_SELECTOR = ".c-window";
8
7
 
9
- /** The layer in front: the last open window, or null when the page itself is in front. */
8
+ // A DS window, or a native modal dialog. A window opened inside a dialog comes after it in the document.
9
+ const LAYER_SELECTOR = ".c-window, dialog[open]";
10
+
11
+ /** The layer an element sits in, or null when it sits on the page. */
12
+ export const getLayerOf = element => {
13
+ var _element$closest;
14
+ return (_element$closest = element == null || element.closest == null ? void 0 : element.closest(LAYER_SELECTOR)) != null ? _element$closest : null;
15
+ };
16
+
17
+ /** The layer in front: the last open window or dialog, or null when the page itself is in front. */
10
18
  export const getTopLayer = () => {
11
19
  const windows = document.querySelectorAll(LAYER_SELECTOR);
12
20
  return windows.length ? windows[windows.length - 1] : null;
@@ -16,5 +24,5 @@ export const getTopLayer = () => {
16
24
  * True when the layer of the element is in front. A handler of a global shortcut asks this first, so the shortcut
17
25
  * goes to the layer the user works in and never to a page or a window under it.
18
26
  */
19
- export const isInTopLayer = element => element ? element.closest(LAYER_SELECTOR) === getTopLayer() : false;
27
+ export const isInTopLayer = element => element ? getLayerOf(element) === getTopLayer() : false;
20
28
  //# sourceMappingURL=layers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layers.js","names":["layers","cloud","skyscraper","tower","house","LAYER_SELECTOR","getTopLayer","windows","document","querySelectorAll","length","isInTopLayer","element","closest"],"sources":["../../../src/utils/layers.ts"],"sourcesContent":["export const layers = {\n cloud: 100000,\n skyscraper: 1300,\n tower: 1200,\n house: 1000,\n};\n\nconst LAYER_SELECTOR = \".c-window\";\n\n/** The layer in front: the last open window, or null when the page itself is in front. */\nexport const getTopLayer = (): HTMLElement | null => {\n const windows = document.querySelectorAll<HTMLElement>(LAYER_SELECTOR);\n\n return windows.length ? windows[windows.length - 1] : null;\n};\n\n/**\n * True when the layer of the element is in front. A handler of a global shortcut asks this first, so the shortcut\n * goes to the layer the user works in and never to a page or a window under it.\n */\nexport const isInTopLayer = (element: Element | null | undefined) =>\n element ? element.closest(LAYER_SELECTOR) === getTopLayer() : false;\n"],"mappings":"AAAA,OAAO,MAAMA,MAAM,GAAG;EACpBC,KAAK,EAAE,MAAM;EACbC,UAAU,EAAE,IAAI;EAChBC,KAAK,EAAE,IAAI;EACXC,KAAK,EAAE;AACT,CAAC;AAED,MAAMC,cAAc,GAAG,WAAW;;AAElC;AACA,OAAO,MAAMC,WAAW,GAAGA,CAAA,KAA0B;EACnD,MAAMC,OAAO,GAAGC,QAAQ,CAACC,gBAAgB,CAAcJ,cAAc,CAAC;EAEtE,OAAOE,OAAO,CAACG,MAAM,GAAGH,OAAO,CAACA,OAAO,CAACG,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI;AAC5D,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAY,GAAIC,OAAmC,IAC9DA,OAAO,GAAGA,OAAO,CAACC,OAAO,CAACR,cAAc,CAAC,KAAKC,WAAW,CAAC,CAAC,GAAG,KAAK","ignoreList":[]}
1
+ {"version":3,"file":"layers.js","names":["layers","cloud","skyscraper","tower","house","LAYER_SELECTOR","getLayerOf","element","_element$closest","closest","getTopLayer","windows","document","querySelectorAll","length","isInTopLayer"],"sources":["../../../src/utils/layers.ts"],"sourcesContent":["export const layers = {\n cloud: 100000,\n skyscraper: 1300,\n tower: 1200,\n house: 1000,\n};\n\n// A DS window, or a native modal dialog. A window opened inside a dialog comes after it in the document.\nconst LAYER_SELECTOR = \".c-window, dialog[open]\";\n\n/** The layer an element sits in, or null when it sits on the page. */\nexport const getLayerOf = (element: Element | null | undefined) =>\n element?.closest?.(LAYER_SELECTOR) ?? null;\n\n/** The layer in front: the last open window or dialog, or null when the page itself is in front. */\nexport const getTopLayer = (): HTMLElement | null => {\n const windows = document.querySelectorAll<HTMLElement>(LAYER_SELECTOR);\n\n return windows.length ? windows[windows.length - 1] : null;\n};\n\n/**\n * True when the layer of the element is in front. A handler of a global shortcut asks this first, so the shortcut\n * goes to the layer the user works in and never to a page or a window under it.\n */\nexport const isInTopLayer = (element: Element | null | undefined) =>\n element ? getLayerOf(element) === getTopLayer() : false;\n"],"mappings":"AAAA,OAAO,MAAMA,MAAM,GAAG;EACpBC,KAAK,EAAE,MAAM;EACbC,UAAU,EAAE,IAAI;EAChBC,KAAK,EAAE,IAAI;EACXC,KAAK,EAAE;AACT,CAAC;;AAED;AACA,MAAMC,cAAc,GAAG,yBAAyB;;AAEhD;AACA,OAAO,MAAMC,UAAU,GAAIC,OAAmC;EAAA,IAAAC,gBAAA;EAAA,QAAAA,gBAAA,GAC5DD,OAAO,YAAPA,OAAO,CAAEE,OAAO,oBAAhBF,OAAO,CAAEE,OAAO,CAAGJ,cAAc,CAAC,YAAAG,gBAAA,GAAI,IAAI;AAAA;;AAE5C;AACA,OAAO,MAAME,WAAW,GAAGA,CAAA,KAA0B;EACnD,MAAMC,OAAO,GAAGC,QAAQ,CAACC,gBAAgB,CAAcR,cAAc,CAAC;EAEtE,OAAOM,OAAO,CAACG,MAAM,GAAGH,OAAO,CAACA,OAAO,CAACG,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI;AAC5D,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAY,GAAIR,OAAmC,IAC9DA,OAAO,GAAGD,UAAU,CAACC,OAAO,CAAC,KAAKG,WAAW,CAAC,CAAC,GAAG,KAAK","ignoreList":[]}
@@ -25,6 +25,36 @@ describe("layers", () => {
25
25
  expect(isInTopLayer(inUnder)).toBe(false);
26
26
  expect(isInTopLayer(onPage)).toBe(false);
27
27
  });
28
+ it("has an open native dialog in front of the page and of the windows under it", () => {
29
+ const onPage = document.body.appendChild(document.createElement("input"));
30
+ const under = addWindow();
31
+ const inUnder = under.appendChild(document.createElement("input"));
32
+ const dialog = document.body.appendChild(document.createElement("dialog"));
33
+ dialog.setAttribute("open", "");
34
+ const inDialog = dialog.appendChild(document.createElement("input"));
35
+ expect(getTopLayer()).toBe(dialog);
36
+ expect(isInTopLayer(inDialog)).toBe(true);
37
+ expect(isInTopLayer(inUnder)).toBe(false);
38
+ expect(isInTopLayer(onPage)).toBe(false);
39
+ });
40
+ it("has a window opened inside a native dialog in front of the dialog", () => {
41
+ const dialog = document.body.appendChild(document.createElement("dialog"));
42
+ dialog.setAttribute("open", "");
43
+ const inDialog = dialog.appendChild(document.createElement("input"));
44
+ const menu = document.createElement("div");
45
+ menu.className = "c-window";
46
+ dialog.appendChild(menu);
47
+ const inMenu = menu.appendChild(document.createElement("input"));
48
+ expect(getTopLayer()).toBe(menu);
49
+ expect(isInTopLayer(inMenu)).toBe(true);
50
+ expect(isInTopLayer(inDialog)).toBe(false);
51
+ });
52
+ it("does not count a closed dialog as a layer", () => {
53
+ const onPage = document.body.appendChild(document.createElement("input"));
54
+ document.body.appendChild(document.createElement("dialog"));
55
+ expect(getTopLayer()).toBeNull();
56
+ expect(isInTopLayer(onPage)).toBe(true);
57
+ });
28
58
  it("is false for no element", () => {
29
59
  expect(isInTopLayer(null)).toBe(false);
30
60
  });
@@ -1 +1 @@
1
- {"version":3,"file":"layers.test.js","names":["getTopLayer","isInTopLayer","addWindow","node","document","createElement","className","body","appendChild","describe","afterEach","innerHTML","it","onPage","expect","toBeNull","toBe","under","inUnder","front","inFront"],"sources":["../../../src/utils/layers.test.ts"],"sourcesContent":["import { getTopLayer, isInTopLayer } from \"./layers\";\n\nconst addWindow = () => {\n const node = document.createElement(\"div\");\n node.className = \"c-window\";\n document.body.appendChild(node);\n\n return node;\n};\n\ndescribe(\"layers\", () => {\n afterEach(() => {\n document.body.innerHTML = \"\";\n });\n\n it(\"has the page in front when no window is open\", () => {\n const onPage = document.body.appendChild(document.createElement(\"input\"));\n\n expect(getTopLayer()).toBeNull();\n expect(isInTopLayer(onPage)).toBe(true);\n });\n\n it(\"has the last open window in front, and not the page or a window under it\", () => {\n const onPage = document.body.appendChild(document.createElement(\"input\"));\n const under = addWindow();\n const inUnder = under.appendChild(document.createElement(\"input\"));\n const front = addWindow();\n const inFront = front.appendChild(document.createElement(\"input\"));\n\n expect(getTopLayer()).toBe(front);\n expect(isInTopLayer(inFront)).toBe(true);\n expect(isInTopLayer(inUnder)).toBe(false);\n expect(isInTopLayer(onPage)).toBe(false);\n });\n\n it(\"is false for no element\", () => {\n expect(isInTopLayer(null)).toBe(false);\n });\n});\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,YAAY,QAAQ,UAA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AAC,CAACJ,IAAI,CAAC,IAAI,CAAC;IACxCF,MAAM,CAACb,YAAY,CAACiB,OAAO,CAAC,CAAC,CAACF,IAAI,CAAC,KAAK,CAAC;IACzCF,MAAM,CAACb,YAAY,CAACY,MAAM,CAAC,CAAC,CAACG,IAAI,CAAC,KAAK,CAAC;EAC1C,CAAC,CAAC;EAEFJ,EAAE,CAAC,yBAAyB,EAAE,MAAM;IAClCE,MAAM,CAACb,YAAY,CAAC,IAAI,CAAC,CAAC,CAACe,IAAI,CAAC,KAAK,CAAC;EACxC,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"layers.test.js","names":["getTopLayer","isInTopLayer","addWindow","node","document","createElement","className","body","appendChild","describe","afterEach","innerHTML","it","onPage","expect","toBeNull","toBe","under","inUnder","front","inFront","dialog","setAttribute","inDialog","menu","inMenu"],"sources":["../../../src/utils/layers.test.ts"],"sourcesContent":["import { getTopLayer, isInTopLayer } from \"./layers\";\n\nconst addWindow = () => {\n const node = document.createElement(\"div\");\n node.className = \"c-window\";\n document.body.appendChild(node);\n\n return node;\n};\n\ndescribe(\"layers\", () => {\n afterEach(() => {\n document.body.innerHTML = \"\";\n });\n\n it(\"has the page in front when no window is open\", () => {\n const onPage = document.body.appendChild(document.createElement(\"input\"));\n\n expect(getTopLayer()).toBeNull();\n expect(isInTopLayer(onPage)).toBe(true);\n });\n\n it(\"has the last open window in front, and not the page or a window under it\", () => {\n const onPage = document.body.appendChild(document.createElement(\"input\"));\n const under = addWindow();\n const inUnder = under.appendChild(document.createElement(\"input\"));\n const front = addWindow();\n const inFront = front.appendChild(document.createElement(\"input\"));\n\n expect(getTopLayer()).toBe(front);\n expect(isInTopLayer(inFront)).toBe(true);\n expect(isInTopLayer(inUnder)).toBe(false);\n expect(isInTopLayer(onPage)).toBe(false);\n });\n\n it(\"has an open native dialog in front of the page and of the windows under it\", () => {\n const onPage = document.body.appendChild(document.createElement(\"input\"));\n const under = addWindow();\n const inUnder = under.appendChild(document.createElement(\"input\"));\n const dialog = document.body.appendChild(document.createElement(\"dialog\"));\n dialog.setAttribute(\"open\", \"\");\n const inDialog = dialog.appendChild(document.createElement(\"input\"));\n\n expect(getTopLayer()).toBe(dialog);\n expect(isInTopLayer(inDialog)).toBe(true);\n expect(isInTopLayer(inUnder)).toBe(false);\n expect(isInTopLayer(onPage)).toBe(false);\n });\n\n it(\"has a window opened inside a native dialog in front of the dialog\", () => {\n const dialog = document.body.appendChild(document.createElement(\"dialog\"));\n dialog.setAttribute(\"open\", \"\");\n const inDialog = dialog.appendChild(document.createElement(\"input\"));\n const menu = document.createElement(\"div\");\n menu.className = \"c-window\";\n dialog.appendChild(menu);\n const inMenu = menu.appendChild(document.createElement(\"input\"));\n\n expect(getTopLayer()).toBe(menu);\n expect(isInTopLayer(inMenu)).toBe(true);\n expect(isInTopLayer(inDialog)).toBe(false);\n });\n\n it(\"does not count a closed dialog as a layer\", () => {\n const onPage = document.body.appendChild(document.createElement(\"input\"));\n document.body.appendChild(document.createElement(\"dialog\"));\n\n expect(getTopLayer()).toBeNull();\n expect(isInTopLayer(onPage)).toBe(true);\n });\n\n it(\"is false for no element\", () => {\n expect(isInTopLayer(null)).toBe(false);\n });\n});\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,YAAY,QAAQ,UAAU;AAEpD,MAAMC,SAAS,GAAGA,CAAA,KAAM;EACtB,MAAMC,IAAI,GAAGC,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EAC1CF,IAAI,CAACG,SAAS,GAAG,UAAU;EAC3BF,QAAQ,CAACG,IAAI,CAACC,WAAW,CAACL,IAAI,CAAC;EAE/B,OAAOA,IAAI;AACb,CAAC;AAEDM,QAAQ,CAAC,QAAQ,EAAE,MAAM;EACvBC,SAAS,CAAC,MAAM;IACdN,QAAQ,CAACG,IAAI,CAACI,SAAS,GAAG,EAAE;EAC9B,CAAC,CAAC;EAEFC,EAAE,CAAC,8CAA8C,EAAE,MAAM;IACvD,MAAM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