@stll/folio-vue 0.8.1 → 0.9.0

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 (37) hide show
  1. package/dist/ListButtons-C1rU_Y1e.cjs +4 -0
  2. package/dist/{ListButtons-DXqMvba3.js → ListButtons-DMnOM2pN.js} +385 -410
  3. package/dist/{WatermarkDialog-r4wmldt4.js → WatermarkDialog-Cf9ISDvv.js} +1378 -1445
  4. package/dist/WatermarkDialog-ChJtT7Bs.cjs +15 -0
  5. package/dist/components/DocxEditor/pagedEditorRef.d.ts +2 -3
  6. package/dist/composables/index.d.ts +1 -2
  7. package/dist/composables/useDocxEditor.d.ts +26 -0
  8. package/dist/composables/useDocxEditorRefApi.d.ts +1 -0
  9. package/dist/composables/useFindReplace.d.ts +24 -22
  10. package/dist/composables/usePagesPointer.d.ts +9 -13
  11. package/dist/composables/useRemoteSelectionSync.d.ts +10 -0
  12. package/dist/composables/useSelectionSync.d.ts +17 -30
  13. package/dist/composables.cjs +2 -2
  14. package/dist/composables.js +80 -68
  15. package/dist/dialogs.cjs +1 -1
  16. package/dist/dialogs.js +1 -1
  17. package/dist/folio-vue.css +1 -1
  18. package/dist/index.cjs +1 -1
  19. package/dist/index.js +1578 -1174
  20. package/dist/styles/zIndex.d.ts +1 -0
  21. package/dist/styles.cjs +1 -1
  22. package/dist/styles.js +1 -1
  23. package/dist/ui.cjs +1 -1
  24. package/dist/ui.js +2 -2
  25. package/dist/useFindReplace-CL8Rbc3y.js +59 -0
  26. package/dist/useFindReplace-ZCrdvwEk.cjs +1 -0
  27. package/dist/useZoom-BYEcnpS0.cjs +1 -0
  28. package/dist/useZoom-C0p0o54p.js +656 -0
  29. package/dist/zIndex-CYoLNG_N.cjs +1 -0
  30. package/dist/{zIndex-BY0qa8Au.js → zIndex-Ei9BbHSW.js} +1 -0
  31. package/package.json +1 -1
  32. package/dist/ListButtons-BvsV1yti.cjs +0 -4
  33. package/dist/WatermarkDialog-DHfk8jrg.cjs +0 -15
  34. package/dist/components/sidebar/resolveItemPositions.d.ts +0 -22
  35. package/dist/useZoom-C7jhL696.cjs +0 -1
  36. package/dist/useZoom-zJvuJlUd.js +0 -615
  37. package/dist/zIndex-dFsQbASx.cjs +0 -1
@@ -1,22 +1,24 @@
1
- /**
2
- * Vue port of the find/replace UI-state container.
3
- *
4
- * PORT-BLOCKED (missing `utils/findReplace` UI-util): upstream builds this
5
- * composable's entire state on three symbols from
6
- * `@eigenpal/docx-editor-core/utils/findReplace` — the `FindMatch` and
7
- * `FindOptions` data contracts and the `createDefaultFindOptions()` factory.
8
- * That util is absent from our fork: it is neither in `@stll/folio-core`
9
- * (whose search surface is the lower-level `prosemirror/findReplaceSelection`
10
- * `FindMatchPosition` + `managers/FindReplaceManager`, a different shape) nor
11
- * in our ported Vue `../utils/*`. Every field of the reactive state
12
- * (`options: createDefaultFindOptions()`, `matches: FindMatch[]`, the
13
- * `currentMatch`/`setMatches`/`goToMatch` surface) depends on those types, so
14
- * there is no working subset to port without fabricating the data contract.
15
- *
16
- * Unblock: port upstream `packages/core/src/utils/findReplace.ts` (pure, no
17
- * runtime deps) into the Vue package as `../utils/findReplace.ts`, reconciling
18
- * its `FindMatch`/`FindOptions` with core's `FindMatchPosition` /
19
- * `FindReplaceManager`, then restore the full composable — its body is a direct
20
- * `reactive()` translation of the React hook with no other blockers.
21
- */
22
- export {};
1
+ import { ComputedRef, Ref, ShallowRef } from 'vue';
2
+ import { EditorView } from 'prosemirror-view';
3
+ import { ProseMirrorFindMatch } from '@stll/folio-core/prosemirror/findReplaceSelection';
4
+ import { FindOptions } from '@stll/folio-core/utils/findReplace';
5
+ export type UseFindReplaceOptions = {
6
+ editorView: Readonly<Ref<EditorView | null>>;
7
+ scrollVisiblePositionIntoView?: (pmPos: number) => void;
8
+ };
9
+ export type UseFindReplaceReturn = {
10
+ searchText: Ref<string>;
11
+ replaceText: Ref<string>;
12
+ options: FindOptions;
13
+ matches: ShallowRef<ProseMirrorFindMatch[]>;
14
+ currentIndex: Ref<number>;
15
+ currentMatch: ComputedRef<ProseMirrorFindMatch | null>;
16
+ performSearch: () => ProseMirrorFindMatch[];
17
+ goToMatch: (index: number) => boolean;
18
+ findNext: () => ProseMirrorFindMatch | null;
19
+ findPrevious: () => ProseMirrorFindMatch | null;
20
+ replaceCurrent: () => boolean;
21
+ replaceAll: () => number;
22
+ clear: () => void;
23
+ };
24
+ export declare function useFindReplace({ editorView, scrollVisiblePositionIntoView, }: UseFindReplaceOptions): UseFindReplaceReturn;
@@ -1,7 +1,6 @@
1
1
  import { Ref, ShallowRef } from 'vue';
2
2
  import { Command } from 'prosemirror-state';
3
3
  import { EditorView } from 'prosemirror-view';
4
- import { HeaderFooter, BlockContent } from '@stll/folio-core/types/content';
5
4
  import { Document } from '@stll/folio-core/types/document';
6
5
  import { Layout } from '@stll/folio-core/layout-engine';
7
6
  import { ImageSelectionInfo } from '../components/imageSelectionTypes';
@@ -19,9 +18,10 @@ export type TableInsertButton = {
19
18
  cellPmPos: number;
20
19
  };
21
20
  export type HfEditState = {
21
+ isFirstPage: boolean;
22
+ pageNumber: number;
22
23
  position: "header" | "footer";
23
24
  rId: string | null;
24
- headerFooter: HeaderFooter | null;
25
25
  targetRect: {
26
26
  top: number;
27
27
  left: number;
@@ -42,29 +42,25 @@ export type UsePagesPointerOptions = {
42
42
  imageInteracting: Ref<boolean>;
43
43
  hyperlinkPopupData: Ref<HyperlinkPopupData | null>;
44
44
  readOnly: Ref<boolean>;
45
+ showHeaderFooterEditing: Ref<boolean>;
45
46
  zoom: Ref<number>;
46
47
  layout: Ref<Layout | null>;
47
48
  tableResize: TableResizeApi;
48
49
  getCommands: () => Commands;
49
50
  getDocument: () => Document | null;
50
51
  reLayout: () => void;
51
- emit: (event: string, ...args: unknown[]) => void;
52
+ onDocumentChange: (document: Document) => void;
52
53
  clearOverlay: () => void;
53
- /**
54
- * Re-mount HF EditorViews when `package.headers/footers` content changes —
55
- * exposed by `useDocxEditor.syncHfPMs`. Called after every save so the
56
- * persistent PM points at the new HeaderFooter object. Optional so existing
57
- * consumers can no-op until they wire it through.
58
- */
59
- syncHfPMs?: () => void;
54
+ /** Synchronize persistent header/footer views after document-model changes. */
55
+ syncHfPMs: () => void;
60
56
  /** Resolve the persistent EditorView for an HF instance (for click routing). */
61
- getHfPmView?: (hf: HeaderFooter) => EditorView | null;
57
+ getHfPmView: (rId: string) => EditorView | null;
62
58
  /**
63
59
  * Replace the loaded Document — used by HF materialisation to publish a
64
60
  * fresh Document object instead of mutating in place. Optional; if absent,
65
61
  * callers fall back to in-place mutation + `syncHfPMs()`.
66
62
  */
67
- setDocument?: (doc: Document) => void;
63
+ setDocument: (doc: Document) => void;
68
64
  };
69
65
  export type UsePagesPointerReturn = {
70
66
  tableInsertButton: Ref<TableInsertButton | null>;
@@ -80,7 +76,7 @@ export type UsePagesPointerReturn = {
80
76
  handlePagesDoubleClick: (event: MouseEvent) => void;
81
77
  handleTableInsertClick: (event: MouseEvent) => void;
82
78
  clearTableInsertTimer: () => void;
83
- handleHfSave: (content: BlockContent[]) => void;
79
+ handleHfSave: () => void;
84
80
  handleHfRemove: () => void;
85
81
  };
86
82
  export declare function usePagesPointer(opts: UsePagesPointerOptions): UsePagesPointerReturn;
@@ -0,0 +1,10 @@
1
+ import { Ref } from 'vue';
2
+ import { HiddenProseMirrorRemoteSelection } from '@stll/folio-core/controller/hiddenEditorManager';
3
+ import { LayoutSelectionGate } from '@stll/folio-core/paged-layout/LayoutSelectionGate';
4
+ export type UseRemoteSelectionSyncOptions = {
5
+ pagesRef: Ref<HTMLElement | null>;
6
+ remoteSelections: Ref<HiddenProseMirrorRemoteSelection[]>;
7
+ syncCoordinator: LayoutSelectionGate;
8
+ zoom: Ref<number>;
9
+ };
10
+ export declare const useRemoteSelectionSync: (options: UseRemoteSelectionSyncOptions) => void;
@@ -1,30 +1,17 @@
1
- /**
2
- * Selection-overlay composable owns the text-caret blink + selection-rect
3
- * painter, the cell-selection highlight, and the image-selection sync that
4
- * re-derives `selectedImage` from the live PM NodeSelection.
5
- *
6
- * PORT-BLOCKED (multiple absent dependencies):
7
- * - `applyCellSelectionHighlight` — absent from our core. Upstream ships it in
8
- * `layout-bridge/cellSelectionHighlight.ts`; our `layout-bridge` barrel does
9
- * not expose it (see CORE-API-MAP Table 4, PORT). The multi-cell highlight
10
- * branch cannot run without it.
11
- * - `findImageElement` — absent from our core `layout-painter` barrel (which
12
- * exposes only `renderPages`/`LayoutPainter`/registry); it is a PORT item.
13
- * The image-overlay sync (`syncSelectedImageToSelection`) depends on it.
14
- * - `../components/imageSelectionTypes` (`ImageSelectionInfo`) the Vue-package
15
- * image-selection type module has not been ported.
16
- * - `../styles/zIndex` (`Z_INDEX`) — the Vue-package z-index token module does
17
- * not exist in our fork (there is no `styles/` dir).
18
- *
19
- * The DOM primitives it also uses DO resolve, but at drifted paths
20
- * (`getSelectionRectsFromDom`/`getCaretPositionFromDom` →
21
- * `@stll/folio-core/layout-bridge/dom/clickToPositionDom`; `findBodyPmAnchor` →
22
- * `@stll/folio-core/layout-bridge/dom/findBodyPmSpans`). With the four blockers
23
- * above there is no coherent working subset, so the whole composable is blocked.
24
- *
25
- * Unblock: PORT `applyCellSelectionHighlight` and `findImageElement` into core
26
- * (or a core barrel), then port the `imageSelectionTypes` + `styles/zIndex`
27
- * Vue-package modules, and re-point the DOM-primitive imports to the drifted
28
- * paths above.
29
- */
30
- export {};
1
+ import { Ref, ShallowRef } from 'vue';
2
+ import { EditorView } from 'prosemirror-view';
3
+ import { LayoutSelectionGate } from '@stll/folio-core/paged-layout/LayoutSelectionGate';
4
+ import { ImageSelectionInfo } from '../components/imageSelectionTypes';
5
+ export type UseSelectionSyncOptions = {
6
+ editorView: Ref<EditorView | null>;
7
+ pagesRef: Ref<HTMLElement | null>;
8
+ zoom: Ref<number>;
9
+ selectedImage: ShallowRef<ImageSelectionInfo | null>;
10
+ syncCoordinator: LayoutSelectionGate;
11
+ imageInteracting?: Ref<boolean>;
12
+ };
13
+ export type UseSelectionSyncReturn = {
14
+ clearOverlay: () => void;
15
+ updateSelectionOverlay: () => void;
16
+ };
17
+ export declare const useSelectionSync: (opts: UseSelectionSyncOptions) => UseSelectionSyncReturn;
@@ -1,4 +1,4 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./useZoom-C7jhL696.cjs");let t=require("vue"),n=require("prosemirror-history"),r=require("@stll/folio-core/utils/clipboard"),i=require("@stll/folio-core/managers/ClipboardManager"),a=require("@stll/folio-core/managers/TableSelectionManager"),o=require("@stll/folio-core/prosemirror/utils/visualLineNavigation"),s=require("@stll/folio-core/prosemirror/utils/extractTrackedChanges");function c(e={}){let{onCopy:n,onCut:i,onPaste:a,cleanWordFormatting:o=!0,editable:s=!0,onError:c}=e,l=(0,t.ref)(!1),u=(0,t.ref)(null),d=c?{onError:c}:{};async function f(e){if(l.value)return!1;l.value=!0;try{let t=await(0,r.copyRuns)(e.runs,d);return t&&n?.(e),t}finally{l.value=!1}}async function p(e){if(l.value||!s)return!1;l.value=!0;try{let t=await(0,r.copyRuns)(e.runs,d);return t&&i?.(e),t}finally{l.value=!1}}async function m(e=!1){if(l.value||!s)return null;l.value=!0;try{if(navigator.clipboard&&navigator.clipboard.read){let t=await navigator.clipboard.read(),n=``,i=``;for(let e of t)e.types.includes(`text/html`)&&(n=await(await e.getType(`text/html`)).text()),e.types.includes(`text/plain`)&&(i=await(await e.getType(`text/plain`)).text());e&&(n=``);let s=(0,r.parseClipboardHtml)(n,i,o);return u.value=s,a?.(s,e),s}return null}catch(e){return c?.(e instanceof Error?e:Error(String(e))),null}finally{l.value=!1}}return{copy:f,cut:p,paste:m,isProcessing:l,lastPastedContent:u}}function l({isOpen:e,onClose:n,align:r=`left`}){let i=(0,t.ref)(null),a=(0,t.ref)(null),o=(0,t.ref)({position:`fixed`,top:`0px`,left:`0px`,zIndex:1e4});function s(e,t){o.value={position:`fixed`,top:e+`px`,left:t+`px`,zIndex:1e4}}function c(e){let t=e.target;t instanceof Node&&i.value&&!i.value.contains(t)&&a.value&&!a.value.contains(t)&&n()}function l(e){e.key===`Escape`&&n()}function u(e){let t=e.target;t instanceof Node&&a.value&&a.value.contains(t)||n()}function d(){document.addEventListener(`mousedown`,c),document.addEventListener(`keydown`,l),window.addEventListener(`scroll`,u,!0)}function f(){document.removeEventListener(`mousedown`,c),document.removeEventListener(`keydown`,l),window.removeEventListener(`scroll`,u,!0)}(0,t.watch)(e,e=>{if(!e){f();return}let t=i.value;if(!t)return;let n=t.getBoundingClientRect();r===`right`?requestAnimationFrame(()=>{let e=a.value;if(e){let t=e.getBoundingClientRect();s(n.bottom+4,n.right-t.width)}else s(n.bottom+4,n.left)}):s(n.bottom+4,n.left),d()}),(0,t.onScopeDispose)(f);function p(e){e.preventDefault(),e.stopPropagation()}return{containerRef:i,dropdownRef:a,dropdownStyle:o,handleMouseDown:p}}function u(e,r){let i=(0,t.computed)(()=>{r.value;let t=e.value;return t?(0,n.undoDepth)(t.state)>0:!1}),a=(0,t.computed)(()=>{r.value;let t=e.value;return t?(0,n.redoDepth)(t.state)>0:!1});function o(){let t=e.value;return t?(0,n.undo)(t.state,t.dispatch):!1}function s(){let t=e.value;return t?(0,n.redo)(t.state,t.dispatch):!1}return{canUndo:i,canRedo:a,undo:o,redo:s}}var d={backgroundColor:`rgba(26, 115, 232, 0.3)`,borderRadius:0,zIndex:0,opacity:1,mixBlendMode:`multiply`};function f(e){let t=window.getSelection();if(!t||t.rangeCount===0||t.isCollapsed)return[];let n=t.getRangeAt(0);if(e&&!e.contains(n.commonAncestorContainer))return[];let r=0,i=0;if(e){let t=e.getBoundingClientRect();r=t.left+e.scrollLeft,i=t.top+e.scrollTop}let a=[];for(let e of n.getClientRects())e.width===0&&e.height===0||a.push({left:e.left-r,top:e.top-i,width:e.width,height:e.height});return a}function p(e,t=2){if(e.length<=1)return e;let n=[...e].sort((e,n)=>Math.abs(e.top-n.top)<t?e.left-n.left:e.top-n.top),r=n[0];if(!r)return e;let i=[],a={...r};for(let e=1;e<n.length;e++){let r=n[e];if(!r)continue;let o=Math.abs(r.top-a.top)<t,s=r.left<=a.left+a.width+t;if(o&&s){let e=Math.max(a.left+a.width,r.left+r.width);a.width=e-a.left,a.height=Math.max(a.height,r.height)}else i.push(a),a={...r}}return i.push(a),i}function m(e){return p(f(e))}function h(){let e=window.getSelection();return e!==null&&!e.isCollapsed&&e.rangeCount>0}function g(e){let t=window.getSelection();return!t||t.rangeCount===0?!1:e.contains(t.getRangeAt(0).commonAncestorContainer)}var _=`docx-selection-styles`,v=null;function y(){v&&=(v.remove(),null),document.getElementById(_)?.remove()}function b(e=d){y();let t=`
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./useFindReplace-ZCrdvwEk.cjs"),t=require("./useZoom-BYEcnpS0.cjs");let n=require("vue"),r=require("prosemirror-history"),i=require("@stll/folio-core/utils/clipboard"),a=require("@stll/folio-core/managers/ClipboardManager"),o=require("@stll/folio-core/managers/TableSelectionManager"),s=require("@stll/folio-core/prosemirror/utils/visualLineNavigation"),c=require("@stll/folio-core/prosemirror/utils/extractTrackedChanges");function l(e={}){let{onCopy:t,onCut:r,onPaste:a,cleanWordFormatting:o=!0,editable:s=!0,onError:c}=e,l=(0,n.ref)(!1),u=(0,n.ref)(null),d=c?{onError:c}:{};async function f(e){if(l.value)return!1;l.value=!0;try{let n=await(0,i.copyRuns)(e.runs,d);return n&&t?.(e),n}finally{l.value=!1}}async function p(e){if(l.value||!s)return!1;l.value=!0;try{let t=await(0,i.copyRuns)(e.runs,d);return t&&r?.(e),t}finally{l.value=!1}}async function m(e=!1){if(l.value||!s)return null;l.value=!0;try{if(navigator.clipboard&&navigator.clipboard.read){let t=await navigator.clipboard.read(),n=``,r=``;for(let e of t)e.types.includes(`text/html`)&&(n=await(await e.getType(`text/html`)).text()),e.types.includes(`text/plain`)&&(r=await(await e.getType(`text/plain`)).text());e&&(n=``);let s=(0,i.parseClipboardHtml)(n,r,o);return u.value=s,a?.(s,e),s}return null}catch(e){return c?.(e instanceof Error?e:Error(String(e))),null}finally{l.value=!1}}return{copy:f,cut:p,paste:m,isProcessing:l,lastPastedContent:u}}function u({isOpen:e,onClose:t,align:r=`left`}){let i=(0,n.ref)(null),a=(0,n.ref)(null),o=(0,n.ref)({position:`fixed`,top:`0px`,left:`0px`,zIndex:1e4});function s(e,t){o.value={position:`fixed`,top:e+`px`,left:t+`px`,zIndex:1e4}}function c(e){let n=e.target;n instanceof Node&&i.value&&!i.value.contains(n)&&a.value&&!a.value.contains(n)&&t()}function l(e){e.key===`Escape`&&t()}function u(e){let n=e.target;n instanceof Node&&a.value&&a.value.contains(n)||t()}function d(){document.addEventListener(`mousedown`,c),document.addEventListener(`keydown`,l),window.addEventListener(`scroll`,u,!0)}function f(){document.removeEventListener(`mousedown`,c),document.removeEventListener(`keydown`,l),window.removeEventListener(`scroll`,u,!0)}(0,n.watch)(e,e=>{if(!e){f();return}let t=i.value;if(!t)return;let n=t.getBoundingClientRect();r===`right`?requestAnimationFrame(()=>{let e=a.value;if(e){let t=e.getBoundingClientRect();s(n.bottom+4,n.right-t.width)}else s(n.bottom+4,n.left)}):s(n.bottom+4,n.left),d()}),(0,n.onScopeDispose)(f);function p(e){e.preventDefault(),e.stopPropagation()}return{containerRef:i,dropdownRef:a,dropdownStyle:o,handleMouseDown:p}}function d(e,t){let i=(0,n.computed)(()=>{t.value;let n=e.value;return n?(0,r.undoDepth)(n.state)>0:!1}),a=(0,n.computed)(()=>{t.value;let n=e.value;return n?(0,r.redoDepth)(n.state)>0:!1});function o(){let t=e.value;return t?(0,r.undo)(t.state,t.dispatch):!1}function s(){let t=e.value;return t?(0,r.redo)(t.state,t.dispatch):!1}return{canUndo:i,canRedo:a,undo:o,redo:s}}var f={backgroundColor:`rgba(26, 115, 232, 0.3)`,borderRadius:0,zIndex:0,opacity:1,mixBlendMode:`multiply`};function p(e){let t=window.getSelection();if(!t||t.rangeCount===0||t.isCollapsed)return[];let n=t.getRangeAt(0);if(e&&!e.contains(n.commonAncestorContainer))return[];let r=0,i=0;if(e){let t=e.getBoundingClientRect();r=t.left+e.scrollLeft,i=t.top+e.scrollTop}let a=[];for(let e of n.getClientRects())e.width===0&&e.height===0||a.push({left:e.left-r,top:e.top-i,width:e.width,height:e.height});return a}function m(e,t=2){if(e.length<=1)return e;let n=[...e].sort((e,n)=>Math.abs(e.top-n.top)<t?e.left-n.left:e.top-n.top),r=n[0];if(!r)return e;let i=[],a={...r};for(let e=1;e<n.length;e++){let r=n[e];if(!r)continue;let o=Math.abs(r.top-a.top)<t,s=r.left<=a.left+a.width+t;if(o&&s){let e=Math.max(a.left+a.width,r.left+r.width);a.width=e-a.left,a.height=Math.max(a.height,r.height)}else i.push(a),a={...r}}return i.push(a),i}function h(e){return m(p(e))}function g(){let e=window.getSelection();return e!==null&&!e.isCollapsed&&e.rangeCount>0}function _(e){let t=window.getSelection();return!t||t.rangeCount===0?!1:e.contains(t.getRangeAt(0).commonAncestorContainer)}var v=`docx-selection-styles`,y=null;function b(){y&&=(y.remove(),null),document.getElementById(v)?.remove()}function x(e=f){b();let t=`
2
2
  /* DOCX Editor Selection Highlighting */
3
3
 
4
4
  .docx-editor [contenteditable="true"]::selection,
@@ -58,4 +58,4 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
58
58
  background-color: rgba(156, 39, 176, 0.2);
59
59
  border-bottom: 2px dashed rgba(156, 39, 176, 0.6);
60
60
  }
61
- `;v=document.createElement(`style`),v.id=_,v.textContent=t,document.head.appendChild(v)}function x(){return v!==null||document.getElementById(_)!==null}function S(){return window.getSelection()?.toString()??``}function C(e){let{containerRef:n,enabled:r=!0,config:i=d,useOverlay:a=!1,debounceMs:o=16,onSelectionChange:s}=e,c=(0,t.ref)(!1),l=(0,t.ref)(``),u=(0,t.ref)([]),f=(0,t.ref)(!1),p=null,_=0;function v(){let e=n.value,t=h(),r=S(),i=e?g(e):!1;c.value=t,l.value=r,f.value=i,u.value=a&&i&&e?m(e):[],s?.(t&&i,r)}function y(){v()}function C(){let e=performance.now();if(e-_<o){p&&clearTimeout(p),p=setTimeout(()=>{_=performance.now(),v(),p=null},o);return}_=e,v()}function w(e){let t={position:`absolute`,left:`${e.left}px`,top:`${e.top}px`,width:`${e.width}px`,height:`${e.height}px`,backgroundColor:i.backgroundColor,zIndex:i.zIndex??0,pointerEvents:`none`};return i.borderRadius&&(t.borderRadius=`${i.borderRadius}px`),i.borderColor&&(t.border=`1px solid ${i.borderColor}`),t}return(0,t.onMounted)(()=>{r&&(x()||b(i),document.addEventListener(`selectionchange`,C))}),(0,t.onBeforeUnmount)(()=>{document.removeEventListener(`selectionchange`,C),p&&clearTimeout(p)}),(0,t.watch)(n,()=>v()),{hasSelection:(0,t.computed)(()=>c.value),selectedText:(0,t.computed)(()=>l.value),highlightRects:(0,t.computed)(()=>u.value),isSelectionInContainer:(0,t.computed)(()=>f.value),refresh:y,getOverlayStyle:w}}function w(){let e=new a.TableSelectionManager,n=(0,t.ref)(null),r=()=>{let t=e.getSnapshot();n.value=t.tableIndex!==null&&t.rowIndex!==null&&t.columnIndex!==null?{tableIndex:t.tableIndex,rowIndex:t.rowIndex,columnIndex:t.columnIndex}:null},i=e.subscribe(r);r(),(0,t.onScopeDispose)(i);function o(e,t,n){}function s(t,n){(0,a.findTableFromClick)(t,n)||e.clearSelection()}function c(){e.clearSelection()}function l(t,n,r){return e.isCellSelected(t,n,r)}return{selectedCell:n,handleCellClick:o,handleClickTarget:s,clearSelection:c,isCellSelected:l}}function T(e){let t=(0,o.createVisualLineState)();function n(t){let n=e.value;return n?(0,o.getCaretClientX)(n,t):null}function r(t){let n=e.value;return n?(0,o.findLineElementAtPosition)(n,t):null}function i(e,t){return(0,o.findPositionOnLineAtClientX)(e,t)}function a(n,r){return(0,o.handleVisualLineKeyDown)(t,n,r,e.value)}return{state:t,getCaretClientX:n,findLineElementAtPosition:r,findPositionOnLineAtClientX:i,handlePMKeyDown:a}}exports.createSelectionFromDOM=i.createSelectionFromDOM,exports.extractTrackedChanges=s.extractTrackedChanges,exports.getSelectionRuns=i.getSelectionRuns,exports.runsToClipboardContent=r.runsToClipboardContent,exports.useClipboard=c,exports.useDocxEditor=e.a,exports.useDragAutoScroll=e.i,exports.useFixedDropdown=l,exports.useHistory=u,exports.useSelectionHighlight=C,exports.useTableResize=e.r,exports.useTableSelection=w,exports.useTrackedChanges=e.n,exports.useVisualLineNavigation=T,exports.useWheelZoom=e.t,exports.useZoom=e.t;
61
+ `;y=document.createElement(`style`),y.id=v,y.textContent=t,document.head.appendChild(y)}function S(){return y!==null||document.getElementById(v)!==null}function C(){return window.getSelection()?.toString()??``}function w(e){let{containerRef:t,enabled:r=!0,config:i=f,useOverlay:a=!1,debounceMs:o=16,onSelectionChange:s}=e,c=(0,n.ref)(!1),l=(0,n.ref)(``),u=(0,n.ref)([]),d=(0,n.ref)(!1),p=null,m=0;function v(){let e=t.value,n=g(),r=C(),i=e?_(e):!1;c.value=n,l.value=r,d.value=i,u.value=a&&i&&e?h(e):[],s?.(n&&i,r)}function y(){v()}function b(){let e=performance.now();if(e-m<o){p&&clearTimeout(p),p=setTimeout(()=>{m=performance.now(),v(),p=null},o);return}m=e,v()}function w(e){let t={position:`absolute`,left:`${e.left}px`,top:`${e.top}px`,width:`${e.width}px`,height:`${e.height}px`,backgroundColor:i.backgroundColor,zIndex:i.zIndex??0,pointerEvents:`none`};return i.borderRadius&&(t.borderRadius=`${i.borderRadius}px`),i.borderColor&&(t.border=`1px solid ${i.borderColor}`),t}return(0,n.onMounted)(()=>{r&&(S()||x(i),document.addEventListener(`selectionchange`,b))}),(0,n.onBeforeUnmount)(()=>{document.removeEventListener(`selectionchange`,b),p&&clearTimeout(p)}),(0,n.watch)(t,()=>v()),{hasSelection:(0,n.computed)(()=>c.value),selectedText:(0,n.computed)(()=>l.value),highlightRects:(0,n.computed)(()=>u.value),isSelectionInContainer:(0,n.computed)(()=>d.value),refresh:y,getOverlayStyle:w}}function T(){let e=new o.TableSelectionManager,t=(0,n.ref)(null),r=()=>{let n=e.getSnapshot();t.value=n.tableIndex!==null&&n.rowIndex!==null&&n.columnIndex!==null?{tableIndex:n.tableIndex,rowIndex:n.rowIndex,columnIndex:n.columnIndex}:null},i=e.subscribe(r);r(),(0,n.onScopeDispose)(i);function a(t,n,r){e.selectCellCoordinates({tableIndex:t,rowIndex:n,columnIndex:r})}function s(t,n){let r=(0,o.findTableFromClick)(t,n);if(!r){e.clearSelection();return}e.selectCellCoordinates(r)}function c(){e.clearSelection()}function l(t,n,r){return e.isCellSelected(t,n,r)}return{selectedCell:t,handleCellClick:a,handleClickTarget:s,clearSelection:c,isCellSelected:l}}function E(e){let t=(0,s.createVisualLineState)();function n(t){let n=e.value;return n?(0,s.getCaretClientX)(n,t):null}function r(t){let n=e.value;return n?(0,s.findLineElementAtPosition)(n,t):null}function i(e,t){return(0,s.findPositionOnLineAtClientX)(e,t)}function a(n,r){return(0,s.handleVisualLineKeyDown)(t,n,r,e.value)}return{state:t,getCaretClientX:n,findLineElementAtPosition:r,findPositionOnLineAtClientX:i,handlePMKeyDown:a}}exports.createSelectionFromDOM=a.createSelectionFromDOM,exports.extractTrackedChanges=c.extractTrackedChanges,exports.getSelectionRuns=a.getSelectionRuns,exports.runsToClipboardContent=i.runsToClipboardContent,exports.useClipboard=l,exports.useDocxEditor=t.a,exports.useDragAutoScroll=t.i,exports.useFindReplace=e.t,exports.useFixedDropdown=u,exports.useHistory=d,exports.useSelectionHighlight=w,exports.useTableResize=t.r,exports.useTableSelection=T,exports.useTrackedChanges=t.n,exports.useVisualLineNavigation=E,exports.useWheelZoom=t.t,exports.useZoom=t.t;
@@ -1,18 +1,19 @@
1
- import { a as e, i as t, n, o as r, r as i, t as a } from "./useZoom-zJvuJlUd.js";
2
- import { computed as o, onBeforeUnmount as s, onMounted as c, onScopeDispose as l, ref as u, watch as d } from "vue";
3
- import { redo as f, redoDepth as p, undo as m, undoDepth as h } from "prosemirror-history";
4
- import { copyRuns as g, parseClipboardHtml as _, runsToClipboardContent as v } from "@stll/folio-core/utils/clipboard";
5
- import { createSelectionFromDOM as y, getSelectionRuns as b } from "@stll/folio-core/managers/ClipboardManager";
6
- import { TableSelectionManager as x, findTableFromClick as S } from "@stll/folio-core/managers/TableSelectionManager";
7
- import { createVisualLineState as C, findLineElementAtPosition as w, findPositionOnLineAtClientX as T, getCaretClientX as E, handleVisualLineKeyDown as D } from "@stll/folio-core/prosemirror/utils/visualLineNavigation";
1
+ import { t as e } from "./useFindReplace-CL8Rbc3y.js";
2
+ import { a as t, i as n, n as r, o as i, r as a, t as o } from "./useZoom-C0p0o54p.js";
3
+ import { computed as s, onBeforeUnmount as c, onMounted as l, onScopeDispose as u, ref as d, watch as f } from "vue";
4
+ import { redo as p, redoDepth as m, undo as h, undoDepth as g } from "prosemirror-history";
5
+ import { copyRuns as _, parseClipboardHtml as v, runsToClipboardContent as y } from "@stll/folio-core/utils/clipboard";
6
+ import { createSelectionFromDOM as b, getSelectionRuns as x } from "@stll/folio-core/managers/ClipboardManager";
7
+ import { TableSelectionManager as S, findTableFromClick as C } from "@stll/folio-core/managers/TableSelectionManager";
8
+ import { createVisualLineState as w, findLineElementAtPosition as T, findPositionOnLineAtClientX as E, getCaretClientX as D, handleVisualLineKeyDown as O } from "@stll/folio-core/prosemirror/utils/visualLineNavigation";
8
9
  //#region src/composables/useClipboard.ts
9
- function O(e = {}) {
10
- let { onCopy: t, onCut: n, onPaste: r, cleanWordFormatting: i = !0, editable: a = !0, onError: o } = e, s = u(!1), c = u(null), l = o ? { onError: o } : {};
11
- async function d(e) {
10
+ function k(e = {}) {
11
+ let { onCopy: t, onCut: n, onPaste: r, cleanWordFormatting: i = !0, editable: a = !0, onError: o } = e, s = d(!1), c = d(null), l = o ? { onError: o } : {};
12
+ async function u(e) {
12
13
  if (s.value) return !1;
13
14
  s.value = !0;
14
15
  try {
15
- let n = await g(e.runs, l);
16
+ let n = await _(e.runs, l);
16
17
  return n && t?.(e), n;
17
18
  } finally {
18
19
  s.value = !1;
@@ -22,7 +23,7 @@ function O(e = {}) {
22
23
  if (s.value || !a) return !1;
23
24
  s.value = !0;
24
25
  try {
25
- let t = await g(e.runs, l);
26
+ let t = await _(e.runs, l);
26
27
  return t && n?.(e), t;
27
28
  } finally {
28
29
  s.value = !1;
@@ -36,7 +37,7 @@ function O(e = {}) {
36
37
  let t = await navigator.clipboard.read(), n = "", a = "";
37
38
  for (let e of t) e.types.includes("text/html") && (n = await (await e.getType("text/html")).text()), e.types.includes("text/plain") && (a = await (await e.getType("text/plain")).text());
38
39
  e && (n = "");
39
- let o = _(n, a, i);
40
+ let o = v(n, a, i);
40
41
  return c.value = o, r?.(o, e), o;
41
42
  }
42
43
  return null;
@@ -47,7 +48,7 @@ function O(e = {}) {
47
48
  }
48
49
  }
49
50
  return {
50
- copy: d,
51
+ copy: u,
51
52
  cut: f,
52
53
  paste: p,
53
54
  isProcessing: s,
@@ -56,8 +57,8 @@ function O(e = {}) {
56
57
  }
57
58
  //#endregion
58
59
  //#region src/composables/useFixedDropdown.ts
59
- function k({ isOpen: e, onClose: t, align: n = "left" }) {
60
- let r = u(null), i = u(null), a = u({
60
+ function A({ isOpen: e, onClose: t, align: n = "left" }) {
61
+ let r = d(null), i = d(null), a = d({
61
62
  position: "fixed",
62
63
  top: "0px",
63
64
  left: "0px",
@@ -78,17 +79,17 @@ function k({ isOpen: e, onClose: t, align: n = "left" }) {
78
79
  function c(e) {
79
80
  e.key === "Escape" && t();
80
81
  }
81
- function f(e) {
82
+ function l(e) {
82
83
  let n = e.target;
83
84
  n instanceof Node && i.value && i.value.contains(n) || t();
84
85
  }
85
86
  function p() {
86
- document.addEventListener("mousedown", s), document.addEventListener("keydown", c), window.addEventListener("scroll", f, !0);
87
+ document.addEventListener("mousedown", s), document.addEventListener("keydown", c), window.addEventListener("scroll", l, !0);
87
88
  }
88
89
  function m() {
89
- document.removeEventListener("mousedown", s), document.removeEventListener("keydown", c), window.removeEventListener("scroll", f, !0);
90
+ document.removeEventListener("mousedown", s), document.removeEventListener("keydown", c), window.removeEventListener("scroll", l, !0);
90
91
  }
91
- d(e, (e) => {
92
+ f(e, (e) => {
92
93
  if (!e) {
93
94
  m();
94
95
  return;
@@ -103,7 +104,7 @@ function k({ isOpen: e, onClose: t, align: n = "left" }) {
103
104
  o(a.bottom + 4, a.right - t.width);
104
105
  } else o(a.bottom + 4, a.left);
105
106
  }) : o(a.bottom + 4, a.left), p();
106
- }), l(m);
107
+ }), u(m);
107
108
  function h(e) {
108
109
  e.preventDefault(), e.stopPropagation();
109
110
  }
@@ -116,23 +117,23 @@ function k({ isOpen: e, onClose: t, align: n = "left" }) {
116
117
  }
117
118
  //#endregion
118
119
  //#region src/composables/useHistory.ts
119
- function A(e, t) {
120
- let n = o(() => {
120
+ function j(e, t) {
121
+ let n = s(() => {
121
122
  t.value;
122
123
  let n = e.value;
123
- return n ? h(n.state) > 0 : !1;
124
- }), r = o(() => {
124
+ return n ? g(n.state) > 0 : !1;
125
+ }), r = s(() => {
125
126
  t.value;
126
127
  let n = e.value;
127
- return n ? p(n.state) > 0 : !1;
128
+ return n ? m(n.state) > 0 : !1;
128
129
  });
129
130
  function i() {
130
131
  let t = e.value;
131
- return t ? m(t.state, t.dispatch) : !1;
132
+ return t ? h(t.state, t.dispatch) : !1;
132
133
  }
133
134
  function a() {
134
135
  let t = e.value;
135
- return t ? f(t.state, t.dispatch) : !1;
136
+ return t ? p(t.state, t.dispatch) : !1;
136
137
  }
137
138
  return {
138
139
  canUndo: n,
@@ -143,14 +144,14 @@ function A(e, t) {
143
144
  }
144
145
  //#endregion
145
146
  //#region src/utils/selectionHighlight.ts
146
- var j = {
147
+ var M = {
147
148
  backgroundColor: "rgba(26, 115, 232, 0.3)",
148
149
  borderRadius: 0,
149
150
  zIndex: 0,
150
151
  opacity: 1,
151
152
  mixBlendMode: "multiply"
152
153
  };
153
- function M(e) {
154
+ function N(e) {
154
155
  let t = window.getSelection();
155
156
  if (!t || t.rangeCount === 0 || t.isCollapsed) return [];
156
157
  let n = t.getRangeAt(0);
@@ -169,7 +170,7 @@ function M(e) {
169
170
  });
170
171
  return a;
171
172
  }
172
- function N(e, t = 2) {
173
+ function P(e, t = 2) {
173
174
  if (e.length <= 1) return e;
174
175
  let n = [...e].sort((e, n) => Math.abs(e.top - n.top) < t ? e.left - n.left : e.top - n.top), r = n[0];
175
176
  if (!r) return e;
@@ -185,23 +186,23 @@ function N(e, t = 2) {
185
186
  }
186
187
  return i.push(a), i;
187
188
  }
188
- function P(e) {
189
- return N(M(e));
189
+ function F(e) {
190
+ return P(N(e));
190
191
  }
191
- function F() {
192
+ function I() {
192
193
  let e = window.getSelection();
193
194
  return e !== null && !e.isCollapsed && e.rangeCount > 0;
194
195
  }
195
- function I(e) {
196
+ function L(e) {
196
197
  let t = window.getSelection();
197
198
  return !t || t.rangeCount === 0 ? !1 : e.contains(t.getRangeAt(0).commonAncestorContainer);
198
199
  }
199
- var L = "docx-selection-styles", R = null;
200
- function z() {
201
- R &&= (R.remove(), null), document.getElementById(L)?.remove();
200
+ var R = "docx-selection-styles", z = null;
201
+ function B() {
202
+ z &&= (z.remove(), null), document.getElementById(R)?.remove();
202
203
  }
203
- function B(e = j) {
204
- z();
204
+ function V(e = M) {
205
+ B();
205
206
  let t = `
206
207
  /* DOCX Editor Selection Highlighting */
207
208
 
@@ -263,21 +264,21 @@ function B(e = j) {
263
264
  border-bottom: 2px dashed rgba(156, 39, 176, 0.6);
264
265
  }
265
266
  `;
266
- R = document.createElement("style"), R.id = L, R.textContent = t, document.head.appendChild(R);
267
+ z = document.createElement("style"), z.id = R, z.textContent = t, document.head.appendChild(z);
267
268
  }
268
- function V() {
269
- return R !== null || document.getElementById(L) !== null;
269
+ function H() {
270
+ return z !== null || document.getElementById(R) !== null;
270
271
  }
271
272
  //#endregion
272
273
  //#region src/composables/useSelectionHighlight.ts
273
- function H() {
274
+ function U() {
274
275
  return window.getSelection()?.toString() ?? "";
275
276
  }
276
- function U(e) {
277
- let { containerRef: t, enabled: n = !0, config: r = j, useOverlay: i = !1, debounceMs: a = 16, onSelectionChange: l } = e, f = u(!1), p = u(""), m = u([]), h = u(!1), g = null, _ = 0;
277
+ function W(e) {
278
+ let { containerRef: t, enabled: n = !0, config: r = M, useOverlay: i = !1, debounceMs: a = 16, onSelectionChange: o } = e, u = d(!1), p = d(""), m = d([]), h = d(!1), g = null, _ = 0;
278
279
  function v() {
279
- let e = t.value, n = F(), r = H(), a = e ? I(e) : !1;
280
- f.value = n, p.value = r, h.value = a, m.value = i && a && e ? P(e) : [], l?.(n && a, r);
280
+ let e = t.value, n = I(), r = U(), a = e ? L(e) : !1;
281
+ u.value = n, p.value = r, h.value = a, m.value = i && a && e ? F(e) : [], o?.(n && a, r);
281
282
  }
282
283
  function y() {
283
284
  v();
@@ -305,23 +306,23 @@ function U(e) {
305
306
  };
306
307
  return r.borderRadius && (t.borderRadius = `${r.borderRadius}px`), r.borderColor && (t.border = `1px solid ${r.borderColor}`), t;
307
308
  }
308
- return c(() => {
309
- n && (V() || B(r), document.addEventListener("selectionchange", b));
310
- }), s(() => {
309
+ return l(() => {
310
+ n && (H() || V(r), document.addEventListener("selectionchange", b));
311
+ }), c(() => {
311
312
  document.removeEventListener("selectionchange", b), g && clearTimeout(g);
312
- }), d(t, () => v()), {
313
- hasSelection: o(() => f.value),
314
- selectedText: o(() => p.value),
315
- highlightRects: o(() => m.value),
316
- isSelectionInContainer: o(() => h.value),
313
+ }), f(t, () => v()), {
314
+ hasSelection: s(() => u.value),
315
+ selectedText: s(() => p.value),
316
+ highlightRects: s(() => m.value),
317
+ isSelectionInContainer: s(() => h.value),
317
318
  refresh: y,
318
319
  getOverlayStyle: x
319
320
  };
320
321
  }
321
322
  //#endregion
322
323
  //#region src/composables/useTableSelection.ts
323
- function W() {
324
- let e = new x(), t = u(null), n = () => {
324
+ function G() {
325
+ let e = new S(), t = d(null), n = () => {
325
326
  let n = e.getSnapshot();
326
327
  t.value = n.tableIndex !== null && n.rowIndex !== null && n.columnIndex !== null ? {
327
328
  tableIndex: n.tableIndex,
@@ -329,10 +330,21 @@ function W() {
329
330
  columnIndex: n.columnIndex
330
331
  } : null;
331
332
  }, r = e.subscribe(n);
332
- n(), l(r);
333
- function i(e, t, n) {}
333
+ n(), u(r);
334
+ function i(t, n, r) {
335
+ e.selectCellCoordinates({
336
+ tableIndex: t,
337
+ rowIndex: n,
338
+ columnIndex: r
339
+ });
340
+ }
334
341
  function a(t, n) {
335
- S(t, n) || e.clearSelection();
342
+ let r = C(t, n);
343
+ if (!r) {
344
+ e.clearSelection();
345
+ return;
346
+ }
347
+ e.selectCellCoordinates(r);
336
348
  }
337
349
  function o() {
338
350
  e.clearSelection();
@@ -350,21 +362,21 @@ function W() {
350
362
  }
351
363
  //#endregion
352
364
  //#region src/composables/useVisualLineNavigation.ts
353
- function G(e) {
354
- let t = C();
365
+ function K(e) {
366
+ let t = w();
355
367
  function n(t) {
356
368
  let n = e.value;
357
- return n ? E(n, t) : null;
369
+ return n ? D(n, t) : null;
358
370
  }
359
371
  function r(t) {
360
372
  let n = e.value;
361
- return n ? w(n, t) : null;
373
+ return n ? T(n, t) : null;
362
374
  }
363
375
  function i(e, t) {
364
- return T(e, t);
376
+ return E(e, t);
365
377
  }
366
378
  function a(n, r) {
367
- return D(t, n, r, e.value);
379
+ return O(t, n, r, e.value);
368
380
  }
369
381
  return {
370
382
  state: t,
@@ -375,4 +387,4 @@ function G(e) {
375
387
  };
376
388
  }
377
389
  //#endregion
378
- export { y as createSelectionFromDOM, n as extractTrackedChanges, b as getSelectionRuns, v as runsToClipboardContent, O as useClipboard, r as useDocxEditor, e as useDragAutoScroll, k as useFixedDropdown, A as useHistory, U as useSelectionHighlight, t as useTableResize, W as useTableSelection, i as useTrackedChanges, G as useVisualLineNavigation, a as useWheelZoom, a as useZoom };
390
+ export { b as createSelectionFromDOM, r as extractTrackedChanges, x as getSelectionRuns, y as runsToClipboardContent, k as useClipboard, i as useDocxEditor, t as useDragAutoScroll, e as useFindReplace, A as useFixedDropdown, j as useHistory, W as useSelectionHighlight, n as useTableResize, G as useTableSelection, a as useTrackedChanges, K as useVisualLineNavigation, o as useWheelZoom, o as useZoom };
package/dist/dialogs.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./WatermarkDialog-DHfk8jrg.cjs");var t=e.m,n=e.l,r=e.p,i=e.c,a=e.f,o=e.s,s=e.d,c=e.a,l=e.u,u=e.i,d=e.r,f=e.n,p=e.t;exports.FindReplaceDialog=t,exports.FootnotePropertiesDialog=n,exports.HyperlinkDialog=r,exports.ImagePositionDialog=i,exports.ImagePropertiesDialog=a,exports.InsertImageDialog=o,exports.InsertSymbolDialog=s,exports.InsertTableDialog=c,exports.PageSetupDialog=l,exports.PasteSpecialDialog=u,exports.SplitCellDialog=d,exports.TablePropertiesDialog=f,exports.WatermarkDialog=p;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./WatermarkDialog-ChJtT7Bs.cjs");var t=e.m,n=e.l,r=e.p,i=e.c,a=e.f,o=e.s,s=e.d,c=e.a,l=e.u,u=e.i,d=e.r,f=e.n,p=e.t;exports.FindReplaceDialog=t,exports.FootnotePropertiesDialog=n,exports.HyperlinkDialog=r,exports.ImagePositionDialog=i,exports.ImagePropertiesDialog=a,exports.InsertImageDialog=o,exports.InsertSymbolDialog=s,exports.InsertTableDialog=c,exports.PageSetupDialog=l,exports.PasteSpecialDialog=u,exports.SplitCellDialog=d,exports.TablePropertiesDialog=f,exports.WatermarkDialog=p;
package/dist/dialogs.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as e, c as t, d as n, f as r, i, l as a, m as o, n as s, p as c, r as l, s as u, t as d, u as f } from "./WatermarkDialog-r4wmldt4.js";
1
+ import { a as e, c as t, d as n, f as r, i, l as a, m as o, n as s, p as c, r as l, s as u, t as d, u as f } from "./WatermarkDialog-Cf9ISDvv.js";
2
2
  //#region src/components/dialogs/index.ts
3
3
  var p = o, m = a, h = c, g = t, _ = r, v = u, y = n, b = e, x = f, S = i, C = l, w = s, T = d;
4
4
  //#endregion