bto-md-editor 0.1.12 → 0.1.13
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.
- package/dist/md-editor.es.js +200 -200
- package/dist/md-editor.umd.js +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/md-editor.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(`.tooltip-wrapper[data-v-2e4633d5]{position:relative;display:inline-flex;align-items:center;line-height:0}.tooltip[data-v-2e4633d5]{position:fixed;transform:translate(-50%);background:#3c3c3cf2;color:#fff;border-radius:8px;padding:6px 8px;font-size:12px;line-height:1.2;box-shadow:0 6px 20px #0003;white-space:nowrap;opacity:0;visibility:hidden;transition:opacity .12s ease,visibility .12s ease;pointer-events:none;z-index:1000}.tooltip.visible[data-v-2e4633d5]{opacity:1;visibility:visible}.shortcut[data-v-2e4633d5]{display:inline-block;margin-top:4px;opacity:.9;z-index:1000}.font-size-wrapper[data-v-87f86dca]{position:relative;-webkit-user-select:none;user-select:none}.font-size-wrapper .icon[data-v-87f86dca]{cursor:pointer;width:27px;height:27px;border-radius:4px;display:flex;align-items:center;font-size:12px;transition:all .2s ease-in-out;position:relative;padding:0 6px;min-width:50px;justify-content:space-between;background:var(--bg-base)}.font-size-wrapper .icon[data-v-87f86dca]:hover{background:var(--hover-bg-color)}.font-size-wrapper .label[data-v-87f86dca]{font-size:15px}.dropdown[data-v-87f86dca]{position:absolute;top:calc(100% + 9px);left:50%;transform:translate(-50%);min-width:160px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #00000014;z-index:10;-webkit-user-select:none;user-select:none;will-change:opacity,transform}.dropdown-slide-enter-from[data-v-87f86dca],.dropdown-slide-leave-to[data-v-87f86dca]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-87f86dca],.dropdown-slide-leave-active[data-v-87f86dca]{transition:opacity .18s ease,transform .18s ease}.dropdown-item[data-v-87f86dca]{display:flex;align-items:center;gap:8px;padding:6px 12px;cursor:pointer;font-size:14px}.dropdown-item[data-v-87f86dca]:hover{background:var(--hover-bg-color)}.text[data-v-87f86dca]{flex:1}.color-select-wrapper[data-v-1656be6b]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none}.icon[data-v-1656be6b]{cursor:default;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;position:relative}.icon-dropdown[data-v-1656be6b]{width:auto;justify-content:space-between;background:var(--bg-base)}.icon-stack[data-v-1656be6b]{display:flex;flex-direction:column;align-items:center;line-height:1;border-radius:6px;padding:2px;cursor:pointer}.arrow[data-v-1656be6b]{display:flex;align-items:center;justify-content:center;width:16px;height:27px;border-radius:2px;cursor:pointer}.hoverable[data-v-1656be6b]:hover{background:var(--hover-bg-color)}.underline[data-v-1656be6b]{width:16px;height:2px;border-radius:2px;margin-top:2px;background:var(--bg-base)}.dropdown[data-v-1656be6b]{position:absolute;top:calc(100% + 9px);left:50%;transform:translate(-50%);min-width:280px;max-width:320px;background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #00000014;padding:8px;z-index:20;will-change:opacity,transform;border:1px solid var(--border-color)}.dropdown-slide-enter-from[data-v-1656be6b],.dropdown-slide-leave-to[data-v-1656be6b]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-1656be6b],.dropdown-slide-leave-active[data-v-1656be6b]{transition:opacity .18s ease,transform .18s ease}.section[data-v-1656be6b]{margin-bottom:8px}.section-title[data-v-1656be6b]{font-size:12px;margin-bottom:6px}.swatches[data-v-1656be6b]{display:flex;flex-wrap:wrap;gap:6px}.swatches.grid[data-v-1656be6b]{grid-template-columns:repeat(10,1fr)}.swatch[data-v-1656be6b]{width:18px;height:18px;border-radius:4px;cursor:pointer;position:relative;border:1px solid var(--border-color);display:flex;align-items:center;font-size:12px;justify-content:center}.swatch .check[data-v-1656be6b]{position:absolute;top:0;right:2px;font-size:12px;color:var(--text-base);text-shadow:0 1px 2px rgba(255,255,255,.8)}.inline-actions[data-v-1656be6b]{display:flex;justify-content:space-between;gap:8px}.btn[data-v-1656be6b]{padding:4px 8px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;cursor:pointer;font-size:12px;color:var(--text-base)}.advanced[data-v-1656be6b]{display:grid;grid-template-columns:auto 1fr auto;gap:4px;align-items:center;margin-top:8px}.hex[data-v-1656be6b]{border:1px solid var(--border-color);border-radius:2px;padding:4px 6px;font-size:12px}.apply[data-v-1656be6b]{justify-self:end;flex-shrink:1}.svg-icon[data-v-ee8563cd]{display:inline-block;line-height:0;vertical-align:middle}.svg-icon svg[data-v-ee8563cd]{width:1em;height:1em;display:block}.bg-color-select-wrapper[data-v-f414a9de]{position:relative;-webkit-user-select:none;user-select:none}.icon[data-v-f414a9de]{cursor:default;width:19px;height:19px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;position:relative}.icon-dropdown[data-v-f414a9de]{width:auto;padding:0 2px;min-width:20px;justify-content:space-between;background:var(--bg-base)}.icon-stack[data-v-f414a9de]{display:flex;flex-direction:column;align-items:center;line-height:1;border-radius:6px;padding:2px;cursor:pointer}.arrow[data-v-f414a9de]{display:flex;align-items:center;justify-content:center;width:16px;height:27px;border-radius:4px;cursor:pointer}.hoverable[data-v-f414a9de]:hover{background:var(--hover-bg-color)}.underline[data-v-f414a9de]{width:16px;height:2px;border-radius:2px;margin-top:2px;background:var(--bg-base)}.dropdown[data-v-f414a9de]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:280px;max-width:320px;background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #00000014;padding:8px;z-index:20;will-change:opacity,transform}.section[data-v-f414a9de]{margin-bottom:8px}.section-title[data-v-f414a9de]{font-size:12px;color:#666;margin-bottom:6px}.swatches[data-v-f414a9de]{display:flex;flex-wrap:wrap;gap:6px}.swatches.grid[data-v-f414a9de]{grid-template-columns:repeat(10,1fr)}.swatch[data-v-f414a9de]{width:18px;height:18px;border-radius:4px;cursor:pointer;position:relative;border:1px solid rgba(0,0,0,.08);display:flex;align-items:center;font-size:12px;justify-content:center}.swatch .check[data-v-f414a9de]{position:absolute;top:0;right:2px;font-size:12px;color:#000;text-shadow:0 1px 2px rgba(255,255,255,.8)}.inline-actions[data-v-f414a9de]{display:flex;justify-content:space-between;gap:8px}.btn[data-v-f414a9de]{padding:4px 8px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;cursor:pointer;font-size:12px}.advanced[data-v-f414a9de]{display:grid;grid-template-columns:auto 1fr auto;gap:4px;align-items:center;margin-top:8px}.hex[data-v-f414a9de]{border:1px solid var(--border-color);border-radius:2px;padding:4px 6px;font-size:12px}.apply[data-v-f414a9de]{justify-self:end;flex-shrink:1}.dropdown-slide-enter-from[data-v-f414a9de],.dropdown-slide-leave-to[data-v-f414a9de]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-f414a9de],.dropdown-slide-leave-active[data-v-f414a9de]{transition:opacity .18s ease,transform .18s ease}.image-icon[data-v-6df6e55c]{position:relative}.image-input-panel[data-v-6df6e55c]{position:absolute;top:calc(100% + 9px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.image-input[data-v-6df6e55c]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid var(--border-color);border-radius:4px;outline:none;font-size:14px;background-color:var(--bg-input-bg);color:var(--text-base)}.image-actions[data-v-6df6e55c]{margin-top:8px;display:flex;gap:8px;justify-content:flex-end}.btn[data-v-6df6e55c]{padding:6px 10px;border-radius:2px;border:1px solid var(--border-color);background:var(--bg-base);cursor:pointer;font-size:13px;color:var(--text-base)}.btn[data-v-6df6e55c]:hover{background:var(--hover-bg-color)}.btn-primary[data-v-6df6e55c]{border:none;background:#1677ff;color:var(--text-base)}.btn-primary[data-v-6df6e55c]:hover{background:#1677ff;opacity:.92}.img-panel-enter-active[data-v-6df6e55c],.img-panel-leave-active[data-v-6df6e55c]{transition:opacity .18s ease,transform .18s ease}.img-panel-enter-from[data-v-6df6e55c],.img-panel-leave-to[data-v-6df6e55c]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.img-panel-enter-to[data-v-6df6e55c],.img-panel-leave-from[data-v-6df6e55c]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.video-icon[data-v-9d5e9345]{position:relative}.video-input-panel[data-v-9d5e9345]{position:absolute;top:calc(100% + 9px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.video-input[data-v-9d5e9345]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid var(--border-color);border-radius:2px;outline:none;font-size:14px;background-color:var(--bg-input-bg);color:var(--text-base)}.video-actions[data-v-9d5e9345]{margin-top:8px;display:flex;gap:8px;justify-content:flex-end}.btn[data-v-9d5e9345]{padding:6px 10px;border-radius:2px;border:1px solid var(--border-color);background:var(--bg-base);cursor:pointer;font-size:13px;color:var(--text-base)}.btn[data-v-9d5e9345]:hover{background:var(--hover-bg-color)}.btn-primary[data-v-9d5e9345]{border:none;background:#1677ff;color:var(--text-base)}.btn-primary[data-v-9d5e9345]:hover{background:#1677ff;opacity:.92}.video-panel-enter-active[data-v-9d5e9345],.video-panel-leave-active[data-v-9d5e9345]{transition:opacity .18s ease,transform .18s ease}.video-panel-enter-from[data-v-9d5e9345],.video-panel-leave-to[data-v-9d5e9345]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.video-panel-enter-to[data-v-9d5e9345],.video-panel-leave-from[data-v-9d5e9345]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.find-icon[data-v-8c079e6d]{position:relative}.find-input-panel[data-v-8c079e6d]{position:absolute;top:calc(100% + 9px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.fr-header[data-v-8c079e6d]{display:flex;align-items:center;gap:6px;margin-bottom:6px}.fr-tab[data-v-8c079e6d]{border:none;background:transparent;padding:6px 8px;cursor:pointer;border-bottom:2px solid transparent;color:var(--text-base)}.fr-tab.active[data-v-8c079e6d]{border-color:#1a69f8;font-weight:600}.fr-label[data-v-8c079e6d]{display:block;font-size:12px;margin:6px 0 4px}.fr-input-row[data-v-8c079e6d]{display:flex;align-items:center;gap:6px;width:100%}.fr-input[data-v-8c079e6d]{flex:1;padding:8px;border:1px solid var(--border-color);border-radius:2px;background-color:var(--bg-input-bg);color:var(--text-base);outline:none}.fr-count[data-v-8c079e6d]{font-size:12px}.fr-actions[data-v-8c079e6d]{display:flex;gap:8px;margin-top:10px;justify-content:flex-end}.fr-btn[data-v-8c079e6d]{padding:6px 10px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;cursor:pointer;color:var(--text-base)}.fr-btn.primary[data-v-8c079e6d]{color:var(--text-base);background:#1a69f8;border-color:#1a69f8}.find-panel-enter-active[data-v-8c079e6d],.find-panel-leave-active[data-v-8c079e6d]{transition:opacity .18s ease,transform .18s ease}.find-panel-enter-from[data-v-8c079e6d],.find-panel-leave-to[data-v-8c079e6d]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.find-panel-enter-to[data-v-8c079e6d],.find-panel-leave-from[data-v-8c079e6d]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.link-icon[data-v-5344936c]{position:relative}.link-input-panel[data-v-5344936c]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.field[data-v-5344936c]{margin-bottom:8px}.label[data-v-5344936c]{font-size:12px;color:#666;margin-bottom:6px}.input[data-v-5344936c]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid #e5e7eb;border-radius:8px;outline:none;font-size:14px}.actions[data-v-5344936c]{display:flex;justify-content:flex-end;gap:8px}.btn[data-v-5344936c]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.btn-primary[data-v-5344936c]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-5344936c]:hover{background:#1677ff;opacity:.92}.link-panel-enter-active[data-v-5344936c],.link-panel-leave-active[data-v-5344936c]{transition:opacity .18s ease,transform .18s ease}.link-panel-enter-from[data-v-5344936c],.link-panel-leave-to[data-v-5344936c]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.link-panel-enter-to[data-v-5344936c],.link-panel-leave-from[data-v-5344936c]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.table-icon[data-v-7e1c834b]{position:relative}.table-panel[data-v-7e1c834b]{position:absolute;top:32px;right:0;min-width:220px;padding:10px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #0000001f;z-index:20}.panel-title[data-v-7e1c834b]{font-size:12px;margin-bottom:6px}.grid[data-v-7e1c834b]{display:flex;flex-direction:column;gap:4px;background:var(--bg-base);border-radius:2px}.row[data-v-7e1c834b]{display:flex;gap:4px}.cell[data-v-7e1c834b]{width:18px;height:18px;background:var(--bg-base);border:1px solid var(--border-color);border-radius:3px;cursor:pointer}.cell.active[data-v-7e1c834b]{background:#e8f1ff;border-color:#1677ff}.size[data-v-7e1c834b]{margin-top:6px;font-size:12px}.table-tools[data-v-1b49653a]{position:relative}.tools-panel[data-v-1b49653a]{position:absolute;top:32px;right:0;min-width:280px;padding:10px;background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #0000001f;z-index:20;border:1px solid var(--border-color)}.tools-grid[data-v-1b49653a]{display:grid;grid-template-columns:1fr 1fr;gap:8px}.btn[data-v-1b49653a]{padding:6px 10px;border-radius:2px;border:1px solid var(--border-color);background:var(--bg-base);cursor:pointer;font-size:13px;color:var(--text-base)}.icon[data-v-340a85d5]{cursor:default;border-radius:6px;display:flex;align-items:center;justify-content:center;transition:all .2s ease-in-out;position:relative}.icon[data-v-340a85d5]:hover{background:#0000000d}.icon[data-v-c8360e84]{cursor:pointer;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;position:relative}.icon[data-v-c8360e84]:hover{background:#0000000d}.heading-select[data-v-b93823aa]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none;word-break:keep-all}.icon[data-v-b93823aa]{cursor:pointer;height:27px;border-radius:4px;display:flex;align-items:center;font-size:12px;transition:all .2s ease-in-out;position:relative;padding:0 6px;min-width:52px;justify-content:space-between;background:var(--bg-base)}.icon[data-v-b93823aa]:hover{background:var(--hover-bg-color)}.label[data-v-b93823aa]{font-size:15px;color:var(--text-base)}.dropdown[data-v-b93823aa]{position:absolute;top:calc(100% + 9px);left:50%;transform:translate(-50%);min-width:220px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #00000014;z-index:10;-webkit-user-select:none;user-select:none;will-change:opacity,transform}.dropdown-slide-enter-from[data-v-b93823aa],.dropdown-slide-leave-to[data-v-b93823aa]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-b93823aa],.dropdown-slide-leave-active[data-v-b93823aa]{transition:opacity .18s ease,transform .18s ease}.dropdown-item[data-v-b93823aa]{display:flex;align-items:center;gap:8px;padding:10px 12px;cursor:pointer;font-size:14px}.dropdown-item[data-v-b93823aa]:hover{background:#0000000d}.item-label[data-v-b93823aa]{flex:1}.item-label.paragraph[data-v-b93823aa]{font-size:15px}.item-label.level-1[data-v-b93823aa]{font-size:22px;font-weight:600}.item-label.level-2[data-v-b93823aa]{font-size:20px;font-weight:600}.item-label.level-3[data-v-b93823aa]{font-size:18px;font-weight:600}.item-label.level-4[data-v-b93823aa]{font-size:16px}.item-label.level-5[data-v-b93823aa]{font-size:15px}.item-label.level-6[data-v-b93823aa]{font-size:14px}.shortcut[data-v-b93823aa]{font-size:12px}.align-select[data-v-ba0ceb75]{position:relative;margin:0 2px;-webkit-user-select:none;user-select:none;word-break:keep-all}.icon_box[data-v-ba0ceb75]{cursor:pointer;height:27px;border-radius:4px;display:flex;align-items:center;justify-content:space-between;transition:all .2s ease-in-out;padding:0 6px;background:var(--bg-base);gap:3px}.icon_box[data-v-ba0ceb75]:hover{background:var(--hover-bg-color)}.dropdown[data-v-ba0ceb75]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:160px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #00000014;z-index:10;-webkit-user-select:none;user-select:none;will-change:opacity,transform;padding:6px}.dropdown-slide-enter-from[data-v-ba0ceb75],.dropdown-slide-leave-to[data-v-ba0ceb75]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-ba0ceb75],.dropdown-slide-leave-active[data-v-ba0ceb75]{transition:opacity .18s ease,transform .18s ease}.options[data-v-ba0ceb75]{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.option[data-v-ba0ceb75]{cursor:pointer;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center}.option[data-v-ba0ceb75]:hover,.option.active[data-v-ba0ceb75]{background:var(--hover-bg-color)}.header_box[data-v-02d54bed]{display:flex;align-items:center;gap:3px;padding:8px;border-bottom:1px solid var(--border-color)}.header_box.disabled[data-v-02d54bed]{pointer-events:none;opacity:.5}.header_box .icon[data-v-02d54bed]{position:relative;cursor:pointer;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out}.header_box .icon[data-v-02d54bed]:hover,.header_box .icon.active[data-v-02d54bed]{background:var(--hover-bg-color)}.header_box .icon[aria-disabled=true][data-v-02d54bed]{cursor:not-allowed;opacity:.5}.header_box.dark[data-v-02d54bed] .heading-select .label,.header_box.dark[data-v-02d54bed] .font-size .label{color:#e5e7eb}.header_box.dark[data-v-02d54bed] .heading-select .dropdown,.header_box.dark[data-v-02d54bed] .font-size .dropdown{background:#1f1f21;border-color:#334155;box-shadow:none}.header_box.dark[data-v-02d54bed] .dropdown-item:hover{background:#ffffff0f}.header_box.dark[data-v-02d54bed] .heading-select .item-label,.header_box.dark[data-v-02d54bed] .font-size .text,.header_box.dark[data-v-02d54bed] .heading-select .shortcut{color:#e5e7eb}.header_box.dark[data-v-02d54bed] .color-select .icon-dropdown,.header_box.dark[data-v-02d54bed] .bg-color-select .icon-dropdown,.header_box.dark[data-v-02d54bed] .align-select .icon_box,.header_box.dark[data-v-02d54bed] .bg-color-select .underline{background:#1f1f21;border:1px solid #334155}.header_box.dark[data-v-02d54bed] .bg-color-select .dropdown .swatch[style*=dashed]{border-color:#334155!important}.header_box.dark[data-v-02d54bed] .color-select .hoverable:hover,.header_box.dark[data-v-02d54bed] .bg-color-select .hoverable:hover,.header_box.dark[data-v-02d54bed] .align-select .icon_box:hover{background:#ffffff0f}.header_box.dark[data-v-02d54bed] .color-select .dropdown,.header_box.dark[data-v-02d54bed] .bg-color-select .dropdown,.header_box.dark[data-v-02d54bed] .align-select .dropdown{background:#1f1f21;border:1px solid #334155;box-shadow:none}.header_box.dark[data-v-02d54bed] .align-select .option:hover{background:#ffffff0f}.header_box.dark[data-v-02d54bed] .align-select .option.active{background:#ffffff1a}.header_box.dark[data-v-02d54bed] .color-select .section-title,.header_box.dark[data-v-02d54bed] .bg-color-select .section-title{color:#94a3b8}.header_box.dark[data-v-02d54bed] .color-select .btn,.header_box.dark[data-v-02d54bed] .bg-color-select .btn,.header_box.dark[data-v-02d54bed] .color-select .hex,.header_box.dark[data-v-02d54bed] .bg-color-select .hex{background:#1f1f21;border-color:#334155;color:#e5e7eb}.header_box.dark[data-v-02d54bed] .color-select .swatch,.header_box.dark[data-v-02d54bed] .bg-color-select .swatch{border-color:#ffffff14}.header_box.dark[data-v-02d54bed] .color-select .swatch .check,.header_box.dark[data-v-02d54bed] .bg-color-select .swatch .check{color:#fff;text-shadow:none}.outline-wrapper[data-v-860c5d88]{position:relative;-webkit-user-select:none;user-select:none}.outline[data-v-860c5d88]{border-left:1px solid var(--border-color);padding:8px;box-sizing:border-box;font-size:14px;position:sticky;top:0;align-self:start;height:100%;background:var(--bg-base);display:flex;flex-direction:column;width:0;opacity:0;overflow:hidden;transform:scaleX(0);transform-origin:right center;transition:width .2s ease,transform .2s ease,opacity .2s ease;border-left:none}.outline.isOpen[data-v-860c5d88]{width:240px;opacity:1;transform:scaleX(1);border-left:1px solid var(--border-color)}.outline__listWrap[data-v-860c5d88]{overflow-y:auto;overflow-x:hidden;flex:1 1 auto;min-height:0}.outline__listWrap[data-v-860c5d88]::-webkit-scrollbar{width:6px;height:1px}.outline__listWrap[data-v-860c5d88]::-webkit-scrollbar-thumb{border-radius:10px;box-shadow:inset 0 0 5px #1118181a;background:#787878}.outline__listWrap[data-v-860c5d88]::-webkit-scrollbar-track{border-radius:10px;background:transparent}.outline__header[data-v-860c5d88]{display:flex;align-items:center;font-weight:600;margin-bottom:8px}.outline__header[data-v-860c5d88]>*{display:inline-flex;gap:6px}.outline__list[data-v-860c5d88]{list-style:none;padding:0;margin:0}.outline__item[data-v-860c5d88]{cursor:pointer;padding:4px 0;color:#333}.outline.dark .outline__item[data-v-860c5d88]{color:#e5e7eb}.outline__caret[data-v-860c5d88]{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;margin-right:4px;color:#666;transition:transform .12s ease}.outline.dark .outline__caret[data-v-860c5d88]{color:#94a3b8}.outline__caret.collapsed[data-v-860c5d88]{transform:rotate(0)}.outline__caret.expanded[data-v-860c5d88]{transform:rotate(90deg)}.outline__item[data-v-860c5d88]:hover{color:#1a69f8}.outline.dark .outline__item[data-v-860c5d88]:hover{color:#22c55e}.outline__item.lv-1[data-v-860c5d88]{padding-left:0}.outline__item.lv-2[data-v-860c5d88]{padding-left:8px}.outline__item.lv-3[data-v-860c5d88]{padding-left:16px}.outline__item.lv-4[data-v-860c5d88]{padding-left:24px}.outline__item.lv-5[data-v-860c5d88]{padding-left:32px}.outline__item.lv-6[data-v-860c5d88]{padding-left:40px}.outline__text[data-v-860c5d88]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.outline__close[data-v-860c5d88]{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--border-color);background:#fff;border-radius:50%;box-shadow:0 2px 10px #00000014;color:#666;cursor:pointer}.outline.dark .outline__close[data-v-860c5d88]{background:#1f1f21;border-color:#334155;color:#94a3b8;box-shadow:none}.outline__close[data-v-860c5d88]:hover{color:var(--hover-text-color)}.outline__title[data-v-860c5d88]{display:inline-flex;align-items:center;gap:6px}.outline__pinIcon[data-v-860c5d88]{display:inline-flex;width:16px;height:16px;color:#666;cursor:pointer}.outline-drawer-mask[data-v-860c5d88]{display:none}@media (max-width: 900px){.outline[data-v-860c5d88]{position:absolute;right:0;top:0;bottom:0;width:0;max-width:85vw;box-shadow:-6px 0 24px #00000014;z-index:10}.outline.isOpen[data-v-860c5d88]{width:min(85vw,280px)}.outline-drawer-mask[data-v-860c5d88]{display:block;position:absolute;left:0;right:0;top:0;bottom:0;background:#00000029;z-index:10}}.outline-slide-enter-active[data-v-860c5d88],.outline-slide-leave-active[data-v-860c5d88]{transition:transform .18s ease,opacity .18s ease}.outline-slide-enter-from[data-v-860c5d88],.outline-slide-leave-to[data-v-860c5d88]{opacity:0;transform:translate(16px)}@media (max-width: 900px){.outline-slide-enter-from[data-v-860c5d88],.outline-slide-leave-to[data-v-860c5d88]{transform:translate(100%)}}.outline-mask-enter-active[data-v-860c5d88],.outline-mask-leave-active[data-v-860c5d88]{transition:opacity .18s ease}.outline-mask-enter-from[data-v-860c5d88],.outline-mask-leave-to[data-v-860c5d88]{opacity:0}.simple-editor[data-v-0dda272d]{height:var(--editor-height, auto);min-height:var(--editor-min-height, 100px);display:flex;flex-direction:column;border-radius:2px;background:var(--bg-base);box-sizing:border-box;border:1px solid var(--border-color)}.simple-editor .fullscreen[data-v-0dda272d]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;border-radius:0}.simple-editor.readonly[data-v-0dda272d] .tiptap-resize-handle{pointer-events:none;display:none}.simple-editor.readonly[data-v-0dda272d] img,.simple-editor.readonly[data-v-0dda272d] video{-webkit-user-drag:none}.simple-editor.readonly[data-v-0dda272d] .tiptap-resize-wrapper,.simple-editor.readonly[data-v-0dda272d] .tiptap-resize-container{outline:none!important;border:none!important;width:100%!important;max-width:100%!important}.simple-editor.readonly[data-v-0dda272d] .tiptap-video{width:100%!important;max-width:100%!important}.editor_wrapper[data-v-0dda272d]{position:relative;overflow-y:auto;overflow-x:hidden;align-items:stretch;flex:1 1 auto;min-height:0}.editor_wrapper[data-v-0dda272d]::-webkit-scrollbar{width:6px;height:1px}.editor_wrapper[data-v-0dda272d]::-webkit-scrollbar-thumb{border-radius:10px;box-shadow:inset 0 0 5px #1118181a;background:#787878}.editor_wrapper[data-v-0dda272d]::-webkit-scrollbar-track{border-radius:10px;background:transparent}.editor_main[data-v-0dda272d]{display:grid;grid-template-columns:1fr auto;align-items:stretch;flex:1 1 auto;min-height:0;position:relative}.outline-toggle-row[data-v-0dda272d]{position:sticky;top:12px;z-index:3;display:flex;justify-content:flex-end;padding-right:12px}.outline-markers[data-v-0dda272d]{position:absolute;right:0;top:0;bottom:0;width:18px;z-index:4}.outline-pin[data-v-0dda272d]{position:absolute;right:3px;top:8px;width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--border-color);background:#fff;border-radius:50%;box-shadow:0 2px 10px #00000014;color:#666;cursor:pointer}.outline-marker[data-v-0dda272d]{position:absolute;right:3px;width:12px;height:2px;background:#d0d5dd;border-radius:2px}.outline-marker.active[data-v-0dda272d]{background:#22c55e}.content[data-v-0dda272d]{padding:12px 24px;color:var(--text-base)}.content[data-v-0dda272d] img{max-width:100%;height:auto;display:inline-block}.content[data-v-0dda272d] .ProseMirror{outline:none;caret-color:var(--editor-caret-color)}.content[data-v-0dda272d] .tiptap-resize-container,.content[data-v-0dda272d] .tiptap-resize-wrapper{max-width:100%!important;box-sizing:border-box}.content[data-v-0dda272d] .tiptap-video{max-width:100%!important;height:auto!important;display:block}.content[data-v-0dda272d] .drag-hover-target{background:#eef5ff;border-radius:8px}.content[data-v-0dda272d] ul[data-type=taskList]{list-style:none;padding-left:0;margin:12px 0}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem]{display:flex;align-items:flex-start;gap:8px;margin:6px 0}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem] .todo-box{width:16px;height:16px;border-radius:4px;border:1px solid var(--border-color);background:#fff;box-shadow:inset 0 1px 2px #0000000f;margin-top:2px;flex-shrink:0;cursor:pointer;position:relative;display:inline-flex;align-items:center;justify-content:center;transition:background-color .16s ease,border-color .16s ease}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem] .todo-box:after{content:"✓";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) scale(.3);opacity:0;color:#fff;font-size:12px;font-weight:700;transition:transform .18s ease,opacity .18s ease;animation:todo-check-out-0dda272d .18s ease both}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] .todo-box{background:#22c55e;border-color:#22c55e}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] .todo-box:after{transform:translate(-50%,-50%) scale(1);opacity:1;animation:todo-check-in-0dda272d .22s cubic-bezier(.2,.7,.3,1.2) both}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem] .todo-box:focus{outline:2px solid #1677ff44}@keyframes todo-check-in-0dda272d{0%{transform:translate(-50%,-50%) scale(.3);opacity:0}60%{transform:translate(-50%,-50%) scale(1.15);opacity:1}to{transform:translate(-50%,-50%) scale(1);opacity:1}}@keyframes todo-check-out-0dda272d{0%{transform:translate(-50%,-50%) scale(1);opacity:1}to{transform:translate(-50%,-50%) scale(.3);opacity:0}}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem]>label,.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem] .task-item__label{display:inline-flex;align-items:center;margin-right:6px}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem] input[type=checkbox]{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto;position:static;opacity:1;pointer-events:auto;width:16px;height:16px;border-radius:4px;border:1px solid var(--border-color);margin-top:2px}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] input[type=checkbox]{accent-color:#22c55e}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem] .task-content,.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem] .task-item__content{flex:1;min-width:1px}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem] .task-content p,.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem] .task-item__content p{margin:0}.content[data-v-0dda272d] img.ProseMirror-selectednode{outline:2px solid var(--border-color);border-radius:4px}.content[data-v-0dda272d] [data-resize-wrapper]{display:inline-block}.content[data-v-0dda272d] .tiptap-resize-handle{width:10px;height:10px;background:#1677ffd9;border-radius:2px;box-shadow:0 0 0 1px #fff;cursor:nwse-resize;z-index:4;opacity:0;pointer-events:none;transition:opacity .12s ease}.content[data-v-0dda272d] .tiptap-resize-handle[data-resize-handle=top-left],.content[data-v-0dda272d] .tiptap-resize-handle[data-resize-handle=bottom-right]{cursor:nwse-resize}.content[data-v-0dda272d] .tiptap-resize-handle[data-resize-handle=top-right],.content[data-v-0dda272d] .tiptap-resize-handle[data-resize-handle=bottom-left]{cursor:nesw-resize}.content[data-v-0dda272d] .tiptap-resize-wrapper:hover .tiptap-resize-handle,.content[data-v-0dda272d] .tiptap-resize-container[data-resize-state=true] .tiptap-resize-handle{opacity:1;pointer-events:auto}.content[data-v-0dda272d] .tiptap-resize-wrapper:hover>img,.content[data-v-0dda272d] .tiptap-resize-wrapper:hover>video{outline:2px solid var(--border-color);border-radius:4px}.content[data-v-0dda272d] .tiptap-resize-wrapper{position:relative}.content[data-v-0dda272d] .tiptap-resize-wrapper[data-uploading=true] .tiptap-upload-mask{pointer-events:auto}.content[data-v-0dda272d] .tiptap-upload-mask{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;display:flex;align-items:center;justify-content:center;color:#1677ff;font-size:12px;border-radius:4px;opacity:0;pointer-events:none;transition:opacity .2s ease;z-index:2}.content[data-v-0dda272d] .tiptap-resize-wrapper[data-uploading=true] .tiptap-upload-mask{opacity:1}.content[data-v-0dda272d] .tiptap-upload-progress{width:66%;max-width:360px;height:6px;background:#0003;border-radius:4px;overflow:hidden;position:relative}.content[data-v-0dda272d] .tiptap-upload-progress:before{content:"";position:absolute;left:-40%;width:40%;height:100%;background:#1677ff;border-radius:4px;animation:tiptap-upload-indeterminate-0dda272d 1.1s ease-in-out infinite}@keyframes tiptap-upload-indeterminate-0dda272d{0%{left:-40%}50%{left:60%}to{left:100%}}.content[data-v-0dda272d] .tiptap-resize-container.is-resizing .tiptap-resize-handle{background:#1677ff}.content[data-v-0dda272d] .ProseMirror table{border-collapse:collapse;margin:12px 0;width:100%}.content[data-v-0dda272d] .ProseMirror table th,.content[data-v-0dda272d] .ProseMirror table td{border:1px solid var(--border-color);padding:8px;text-align:left;position:relative}.content[data-v-0dda272d] .ProseMirror table thead th{background:#f7f9fc;font-weight:600}.content .simple-editor.dark[data-v-0dda272d] .ProseMirror table thead th{background:#111827}.content[data-v-0dda272d] .ProseMirror table .selectedCell{background:#1677ff0f;outline:2px solid #1677ff;outline-offset:-2px}.content[data-v-0dda272d] .ProseMirror table .column-resize-handle{position:absolute;right:-3px;top:0;bottom:0;width:8px;background:transparent;cursor:col-resize;z-index:3;-webkit-user-select:none;user-select:none;pointer-events:auto}.content[data-v-0dda272d] .ProseMirror table .column-resize-handle:hover{background:#1677ff40}.content[data-v-0dda272d] .ProseMirror p.is-editor-empty:first-child:before{content:attr(data-placeholder);color:#999;pointer-events:none;float:left;height:0;white-space:pre-line}.content[data-v-0dda272d] code{background:var(--code-bg);padding:2px 4px;border-radius:4px}.content[data-v-0dda272d] blockquote{border-left:3px solid #e5e7eb;margin:12px 0;padding:4px 12px;color:#6b7280}.content[data-v-0dda272d] pre{background:var(--code-bg);padding:12px;border-radius:6px;border:1px solid var(--border-color);overflow:auto}.content[data-v-0dda272d] p{margin:12px 0}[data-v-0dda272d] .md-drag-handle{width:22px;height:22px;border-radius:4px;display:inline-flex;align-items:center;justify-content:center;box-shadow:0 2px 10px #00000014;background:#fff;border:1px solid var(--border-color);cursor:grab;z-index:5}[data-v-0dda272d] .md-drag-handle:before{content:"···";letter-spacing:2px;color:#888;font-weight:700}@media (max-width: 900px){.editor_main[data-v-0dda272d]{grid-template-columns:1fr}.outline-markers[data-v-0dda272d]{display:none}}.link-modal-backdrop[data-v-0dda272d]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0003}.link-modal[data-v-0dda272d]{position:fixed;left:50%;top:20%;transform:translate(-50%);z-index:1000}.link-modal__content[data-v-0dda272d]{background:#fff;border:1px solid var(--border-color);border-radius:2px;min-width:360px;padding:12px;box-shadow:0 6px 24px #00000014}.simple-editor.dark .link-modal__content[data-v-0dda272d]{background:#1f1f21;border-color:#334155;box-shadow:none;color:#e5e7eb}.link-modal__title[data-v-0dda272d]{font-weight:600;margin-bottom:8px}.link-modal__input[data-v-0dda272d]{width:100%;padding:8px;border:1px solid var(--border-color);border-radius:2px;margin-bottom:10px}.simple-editor.dark .link-modal__input[data-v-0dda272d]{background:#0b1220;border-color:#334155;color:#e5e7eb}.link-modal__actions[data-v-0dda272d]{display:flex;gap:8px;justify-content:flex-end}.link-modal__actions button[data-v-0dda272d]{padding:6px 10px;border:1px solid var(--border-color);background:#fff;border-radius:2px;cursor:pointer}.simple-editor.dark .link-modal__actions button[data-v-0dda272d]{background:#1f1f21;border-color:#334155;color:#e5e7eb}.tiptap-video[data-v-0dda272d]{display:block;max-width:100%;height:auto}[data-format-brush=true] .ProseMirror{cursor:url("data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1763569611105'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='87406'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='18'%20height='18'%3e%3cpath%20d='M840%20192h-56v-72c0-13.3-10.7-24-24-24H168c-13.3%200-24%2010.7-24%2024v272c0%2013.3%2010.7%2024%2024%2024h592c13.3%200%2024-10.7%2024-24V256h32v200H465c-22.1%200-40%2017.9-40%2040v136h-44c-4.4%200-8%203.6-8%208v228c0%200.6%200.1%201.3%200.2%201.9-0.1%202-0.2%204.1-0.2%206.1%200%2046.4%2037.6%2084%2084%2084s84-37.6%2084-84c0-2.1-0.1-4.1-0.2-6.1%200.1-0.6%200.2-1.2%200.2-1.9V640c0-4.4-3.6-8-8-8h-44V520h351c22.1%200%2040-17.9%2040-40V232c0-22.1-17.9-40-40-40zM720%20352H208V160h512v192zM477%20876c0%2011-9%2020-20%2020s-20-9-20-20V696h40v180z'%20p-id='87407'%3e%3c/path%3e%3c/svg%3e") 0 16,crosshair}[data-format-brush=true] .ProseMirror *{cursor:inherit}`)),document.head.appendChild(a)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(`.tooltip-wrapper[data-v-2e4633d5]{position:relative;display:inline-flex;align-items:center;line-height:0}.tooltip[data-v-2e4633d5]{position:fixed;transform:translate(-50%);background:#3c3c3cf2;color:#fff;border-radius:8px;padding:6px 8px;font-size:12px;line-height:1.2;box-shadow:0 6px 20px #0003;white-space:nowrap;opacity:0;visibility:hidden;transition:opacity .12s ease,visibility .12s ease;pointer-events:none;z-index:1000}.tooltip.visible[data-v-2e4633d5]{opacity:1;visibility:visible}.shortcut[data-v-2e4633d5]{display:inline-block;margin-top:4px;opacity:.9;z-index:1000}.font-size-wrapper[data-v-87f86dca]{position:relative;-webkit-user-select:none;user-select:none}.font-size-wrapper .icon[data-v-87f86dca]{cursor:pointer;width:27px;height:27px;border-radius:4px;display:flex;align-items:center;font-size:12px;transition:all .2s ease-in-out;position:relative;padding:0 6px;min-width:50px;justify-content:space-between;background:var(--bg-base)}.font-size-wrapper .icon[data-v-87f86dca]:hover{background:var(--hover-bg-color)}.font-size-wrapper .label[data-v-87f86dca]{font-size:15px}.dropdown[data-v-87f86dca]{position:absolute;top:calc(100% + 9px);left:50%;transform:translate(-50%);min-width:160px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #00000014;z-index:10;-webkit-user-select:none;user-select:none;will-change:opacity,transform}.dropdown-slide-enter-from[data-v-87f86dca],.dropdown-slide-leave-to[data-v-87f86dca]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-87f86dca],.dropdown-slide-leave-active[data-v-87f86dca]{transition:opacity .18s ease,transform .18s ease}.dropdown-item[data-v-87f86dca]{display:flex;align-items:center;gap:8px;padding:6px 12px;cursor:pointer;font-size:14px}.dropdown-item[data-v-87f86dca]:hover{background:var(--hover-bg-color)}.text[data-v-87f86dca]{flex:1}.color-select-wrapper[data-v-1656be6b]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none}.icon[data-v-1656be6b]{cursor:default;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;position:relative}.icon-dropdown[data-v-1656be6b]{width:auto;justify-content:space-between;background:var(--bg-base)}.icon-stack[data-v-1656be6b]{display:flex;flex-direction:column;align-items:center;line-height:1;border-radius:6px;padding:2px;cursor:pointer}.arrow[data-v-1656be6b]{display:flex;align-items:center;justify-content:center;width:16px;height:27px;border-radius:2px;cursor:pointer}.hoverable[data-v-1656be6b]:hover{background:var(--hover-bg-color)}.underline[data-v-1656be6b]{width:16px;height:2px;border-radius:2px;margin-top:2px;background:var(--bg-base)}.dropdown[data-v-1656be6b]{position:absolute;top:calc(100% + 9px);left:50%;transform:translate(-50%);min-width:280px;max-width:320px;background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #00000014;padding:8px;z-index:20;will-change:opacity,transform;border:1px solid var(--border-color)}.dropdown-slide-enter-from[data-v-1656be6b],.dropdown-slide-leave-to[data-v-1656be6b]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-1656be6b],.dropdown-slide-leave-active[data-v-1656be6b]{transition:opacity .18s ease,transform .18s ease}.section[data-v-1656be6b]{margin-bottom:8px}.section-title[data-v-1656be6b]{font-size:12px;margin-bottom:6px}.swatches[data-v-1656be6b]{display:flex;flex-wrap:wrap;gap:6px}.swatches.grid[data-v-1656be6b]{grid-template-columns:repeat(10,1fr)}.swatch[data-v-1656be6b]{width:18px;height:18px;border-radius:4px;cursor:pointer;position:relative;border:1px solid var(--border-color);display:flex;align-items:center;font-size:12px;justify-content:center}.swatch .check[data-v-1656be6b]{position:absolute;top:0;right:2px;font-size:12px;color:var(--text-base);text-shadow:0 1px 2px rgba(255,255,255,.8)}.inline-actions[data-v-1656be6b]{display:flex;justify-content:space-between;gap:8px}.btn[data-v-1656be6b]{padding:4px 8px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;cursor:pointer;font-size:12px;color:var(--text-base)}.advanced[data-v-1656be6b]{display:grid;grid-template-columns:auto 1fr auto;gap:4px;align-items:center;margin-top:8px}.hex[data-v-1656be6b]{border:1px solid var(--border-color);border-radius:2px;padding:4px 6px;font-size:12px}.apply[data-v-1656be6b]{justify-self:end;flex-shrink:1}.svg-icon[data-v-ee8563cd]{display:inline-block;line-height:0;vertical-align:middle}.svg-icon svg[data-v-ee8563cd]{width:1em;height:1em;display:block}.bg-color-select-wrapper[data-v-f414a9de]{position:relative;-webkit-user-select:none;user-select:none}.icon[data-v-f414a9de]{cursor:default;width:19px;height:19px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;position:relative}.icon-dropdown[data-v-f414a9de]{width:auto;padding:0 2px;min-width:20px;justify-content:space-between;background:var(--bg-base)}.icon-stack[data-v-f414a9de]{display:flex;flex-direction:column;align-items:center;line-height:1;border-radius:6px;padding:2px;cursor:pointer}.arrow[data-v-f414a9de]{display:flex;align-items:center;justify-content:center;width:16px;height:27px;border-radius:4px;cursor:pointer}.hoverable[data-v-f414a9de]:hover{background:var(--hover-bg-color)}.underline[data-v-f414a9de]{width:16px;height:2px;border-radius:2px;margin-top:2px;background:var(--bg-base)}.dropdown[data-v-f414a9de]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:280px;max-width:320px;background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #00000014;padding:8px;z-index:20;will-change:opacity,transform}.section[data-v-f414a9de]{margin-bottom:8px}.section-title[data-v-f414a9de]{font-size:12px;color:#666;margin-bottom:6px}.swatches[data-v-f414a9de]{display:flex;flex-wrap:wrap;gap:6px}.swatches.grid[data-v-f414a9de]{grid-template-columns:repeat(10,1fr)}.swatch[data-v-f414a9de]{width:18px;height:18px;border-radius:4px;cursor:pointer;position:relative;border:1px solid rgba(0,0,0,.08);display:flex;align-items:center;font-size:12px;justify-content:center}.swatch .check[data-v-f414a9de]{position:absolute;top:0;right:2px;font-size:12px;color:#000;text-shadow:0 1px 2px rgba(255,255,255,.8)}.inline-actions[data-v-f414a9de]{display:flex;justify-content:space-between;gap:8px}.btn[data-v-f414a9de]{padding:4px 8px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;cursor:pointer;font-size:12px}.advanced[data-v-f414a9de]{display:grid;grid-template-columns:auto 1fr auto;gap:4px;align-items:center;margin-top:8px}.hex[data-v-f414a9de]{border:1px solid var(--border-color);border-radius:2px;padding:4px 6px;font-size:12px}.apply[data-v-f414a9de]{justify-self:end;flex-shrink:1}.dropdown-slide-enter-from[data-v-f414a9de],.dropdown-slide-leave-to[data-v-f414a9de]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-f414a9de],.dropdown-slide-leave-active[data-v-f414a9de]{transition:opacity .18s ease,transform .18s ease}.image-icon[data-v-dad55a02]{position:relative}.image-input-panel[data-v-dad55a02]{position:absolute;top:calc(100% + 9px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.image-input[data-v-dad55a02]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid var(--border-color);border-radius:4px;outline:none;font-size:14px;background-color:var(--bg-input-bg);color:var(--text-base)}.image-actions[data-v-dad55a02]{margin-top:8px;display:flex;gap:8px;justify-content:flex-end}.btn[data-v-dad55a02]{padding:6px 10px;border-radius:2px;border:1px solid var(--border-color);background:var(--bg-base);cursor:pointer;font-size:13px;color:var(--text-base)}.btn[data-v-dad55a02]:hover{background:var(--hover-bg-color)}.btn-primary[data-v-dad55a02]{border:none;background:#1677ff;color:var(--text-base)}.btn-primary[data-v-dad55a02]:hover{background:#1677ff;opacity:.92}.img-panel-enter-active[data-v-dad55a02],.img-panel-leave-active[data-v-dad55a02]{transition:opacity .18s ease,transform .18s ease}.img-panel-enter-from[data-v-dad55a02],.img-panel-leave-to[data-v-dad55a02]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.img-panel-enter-to[data-v-dad55a02],.img-panel-leave-from[data-v-dad55a02]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.video-icon[data-v-582dbd57]{position:relative}.video-input-panel[data-v-582dbd57]{position:absolute;top:calc(100% + 9px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.video-input[data-v-582dbd57]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid var(--border-color);border-radius:2px;outline:none;font-size:14px;background-color:var(--bg-input-bg);color:var(--text-base)}.video-actions[data-v-582dbd57]{margin-top:8px;display:flex;gap:8px;justify-content:flex-end}.btn[data-v-582dbd57]{padding:6px 10px;border-radius:2px;border:1px solid var(--border-color);background:var(--bg-base);cursor:pointer;font-size:13px;color:var(--text-base)}.btn[data-v-582dbd57]:hover{background:var(--hover-bg-color)}.btn-primary[data-v-582dbd57]{border:none;background:#1677ff;color:var(--text-base)}.btn-primary[data-v-582dbd57]:hover{background:#1677ff;opacity:.92}.video-panel-enter-active[data-v-582dbd57],.video-panel-leave-active[data-v-582dbd57]{transition:opacity .18s ease,transform .18s ease}.video-panel-enter-from[data-v-582dbd57],.video-panel-leave-to[data-v-582dbd57]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.video-panel-enter-to[data-v-582dbd57],.video-panel-leave-from[data-v-582dbd57]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.find-icon[data-v-8c079e6d]{position:relative}.find-input-panel[data-v-8c079e6d]{position:absolute;top:calc(100% + 9px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.fr-header[data-v-8c079e6d]{display:flex;align-items:center;gap:6px;margin-bottom:6px}.fr-tab[data-v-8c079e6d]{border:none;background:transparent;padding:6px 8px;cursor:pointer;border-bottom:2px solid transparent;color:var(--text-base)}.fr-tab.active[data-v-8c079e6d]{border-color:#1a69f8;font-weight:600}.fr-label[data-v-8c079e6d]{display:block;font-size:12px;margin:6px 0 4px}.fr-input-row[data-v-8c079e6d]{display:flex;align-items:center;gap:6px;width:100%}.fr-input[data-v-8c079e6d]{flex:1;padding:8px;border:1px solid var(--border-color);border-radius:2px;background-color:var(--bg-input-bg);color:var(--text-base);outline:none}.fr-count[data-v-8c079e6d]{font-size:12px}.fr-actions[data-v-8c079e6d]{display:flex;gap:8px;margin-top:10px;justify-content:flex-end}.fr-btn[data-v-8c079e6d]{padding:6px 10px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;cursor:pointer;color:var(--text-base)}.fr-btn.primary[data-v-8c079e6d]{color:var(--text-base);background:#1a69f8;border-color:#1a69f8}.find-panel-enter-active[data-v-8c079e6d],.find-panel-leave-active[data-v-8c079e6d]{transition:opacity .18s ease,transform .18s ease}.find-panel-enter-from[data-v-8c079e6d],.find-panel-leave-to[data-v-8c079e6d]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.find-panel-enter-to[data-v-8c079e6d],.find-panel-leave-from[data-v-8c079e6d]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.link-icon[data-v-84f547ec]{position:relative}.link-input-panel[data-v-84f547ec]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.field[data-v-84f547ec]{margin-bottom:8px}.label[data-v-84f547ec]{font-size:12px;color:#666;margin-bottom:6px}.input[data-v-84f547ec]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid #e5e7eb;border-radius:8px;outline:none;font-size:14px}.actions[data-v-84f547ec]{display:flex;justify-content:flex-end;gap:8px}.btn[data-v-84f547ec]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.btn-primary[data-v-84f547ec]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-84f547ec]:hover{background:#1677ff;opacity:.92}.link-panel-enter-active[data-v-84f547ec],.link-panel-leave-active[data-v-84f547ec]{transition:opacity .18s ease,transform .18s ease}.link-panel-enter-from[data-v-84f547ec],.link-panel-leave-to[data-v-84f547ec]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.link-panel-enter-to[data-v-84f547ec],.link-panel-leave-from[data-v-84f547ec]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.table-icon[data-v-d0d98332]{position:relative}.table-panel[data-v-d0d98332]{position:absolute;top:32px;right:0;min-width:220px;padding:10px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #0000001f;z-index:20}.panel-title[data-v-d0d98332]{font-size:12px;margin-bottom:6px}.grid[data-v-d0d98332]{display:flex;flex-direction:column;gap:4px;background:var(--bg-base);border-radius:2px}.row[data-v-d0d98332]{display:flex;gap:4px}.cell[data-v-d0d98332]{width:18px;height:18px;background:var(--bg-base);border:1px solid var(--border-color);border-radius:3px;cursor:pointer}.cell.active[data-v-d0d98332]{background:#e8f1ff;border-color:#1677ff}.size[data-v-d0d98332]{margin-top:6px;font-size:12px}.table-tools[data-v-1aa3a259]{position:relative}.tools-panel[data-v-1aa3a259]{position:absolute;top:32px;right:0;min-width:280px;padding:10px;background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #0000001f;z-index:20;border:1px solid var(--border-color)}.tools-grid[data-v-1aa3a259]{display:grid;grid-template-columns:1fr 1fr;gap:8px}.btn[data-v-1aa3a259]{padding:6px 10px;border-radius:2px;border:1px solid var(--border-color);background:var(--bg-base);cursor:pointer;font-size:13px;color:var(--text-base)}.icon[data-v-0a1c80da]{cursor:default;border-radius:6px;display:flex;align-items:center;justify-content:center;transition:all .2s ease-in-out;position:relative}.icon[data-v-0a1c80da]:hover{background:#0000000d}.icon[data-v-dcd9c3cd]{cursor:pointer;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;position:relative}.icon[data-v-dcd9c3cd]:hover{background:#0000000d}.heading-select[data-v-b93823aa]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none;word-break:keep-all}.icon[data-v-b93823aa]{cursor:pointer;height:27px;border-radius:4px;display:flex;align-items:center;font-size:12px;transition:all .2s ease-in-out;position:relative;padding:0 6px;min-width:52px;justify-content:space-between;background:var(--bg-base)}.icon[data-v-b93823aa]:hover{background:var(--hover-bg-color)}.label[data-v-b93823aa]{font-size:15px;color:var(--text-base)}.dropdown[data-v-b93823aa]{position:absolute;top:calc(100% + 9px);left:50%;transform:translate(-50%);min-width:220px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #00000014;z-index:10;-webkit-user-select:none;user-select:none;will-change:opacity,transform}.dropdown-slide-enter-from[data-v-b93823aa],.dropdown-slide-leave-to[data-v-b93823aa]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-b93823aa],.dropdown-slide-leave-active[data-v-b93823aa]{transition:opacity .18s ease,transform .18s ease}.dropdown-item[data-v-b93823aa]{display:flex;align-items:center;gap:8px;padding:10px 12px;cursor:pointer;font-size:14px}.dropdown-item[data-v-b93823aa]:hover{background:#0000000d}.item-label[data-v-b93823aa]{flex:1}.item-label.paragraph[data-v-b93823aa]{font-size:15px}.item-label.level-1[data-v-b93823aa]{font-size:22px;font-weight:600}.item-label.level-2[data-v-b93823aa]{font-size:20px;font-weight:600}.item-label.level-3[data-v-b93823aa]{font-size:18px;font-weight:600}.item-label.level-4[data-v-b93823aa]{font-size:16px}.item-label.level-5[data-v-b93823aa]{font-size:15px}.item-label.level-6[data-v-b93823aa]{font-size:14px}.shortcut[data-v-b93823aa]{font-size:12px}.align-select[data-v-b321e2b4]{position:relative;margin:0 2px;-webkit-user-select:none;user-select:none;word-break:keep-all}.icon_box[data-v-b321e2b4]{cursor:pointer;height:27px;border-radius:4px;display:flex;align-items:center;justify-content:space-between;transition:all .2s ease-in-out;padding:0 6px;background:var(--bg-base);gap:3px}.icon_box[data-v-b321e2b4]:hover{background:var(--hover-bg-color)}.dropdown[data-v-b321e2b4]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:160px;border:1px solid var(--border-color);background:var(--bg-base);border-radius:2px;box-shadow:0 6px 24px #00000014;z-index:10;-webkit-user-select:none;user-select:none;will-change:opacity,transform;padding:6px}.dropdown-slide-enter-from[data-v-b321e2b4],.dropdown-slide-leave-to[data-v-b321e2b4]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-b321e2b4],.dropdown-slide-leave-active[data-v-b321e2b4]{transition:opacity .18s ease,transform .18s ease}.options[data-v-b321e2b4]{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.option[data-v-b321e2b4]{cursor:pointer;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center}.option[data-v-b321e2b4]:hover,.option.active[data-v-b321e2b4]{background:var(--hover-bg-color)}.header_box[data-v-8a946786]{display:flex;align-items:center;gap:3px;padding:8px;border-bottom:1px solid var(--border-color)}.header_box.disabled[data-v-8a946786]{pointer-events:none;opacity:.5}.header_box .icon[data-v-8a946786]{position:relative;cursor:pointer;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out}.header_box .icon[data-v-8a946786]:hover,.header_box .icon.active[data-v-8a946786]{background:var(--hover-bg-color)}.header_box .icon[aria-disabled=true][data-v-8a946786]{cursor:not-allowed;opacity:.5}.header_box.dark[data-v-8a946786] .heading-select .label,.header_box.dark[data-v-8a946786] .font-size .label{color:#e5e7eb}.header_box.dark[data-v-8a946786] .heading-select .dropdown,.header_box.dark[data-v-8a946786] .font-size .dropdown{background:#1f1f21;border-color:#334155;box-shadow:none}.header_box.dark[data-v-8a946786] .dropdown-item:hover{background:#ffffff0f}.header_box.dark[data-v-8a946786] .heading-select .item-label,.header_box.dark[data-v-8a946786] .font-size .text,.header_box.dark[data-v-8a946786] .heading-select .shortcut{color:#e5e7eb}.header_box.dark[data-v-8a946786] .color-select .icon-dropdown,.header_box.dark[data-v-8a946786] .bg-color-select .icon-dropdown,.header_box.dark[data-v-8a946786] .align-select .icon_box,.header_box.dark[data-v-8a946786] .bg-color-select .underline{background:#1f1f21;border:1px solid #334155}.header_box.dark[data-v-8a946786] .bg-color-select .dropdown .swatch[style*=dashed]{border-color:#334155!important}.header_box.dark[data-v-8a946786] .color-select .hoverable:hover,.header_box.dark[data-v-8a946786] .bg-color-select .hoverable:hover,.header_box.dark[data-v-8a946786] .align-select .icon_box:hover{background:#ffffff0f}.header_box.dark[data-v-8a946786] .color-select .dropdown,.header_box.dark[data-v-8a946786] .bg-color-select .dropdown,.header_box.dark[data-v-8a946786] .align-select .dropdown{background:#1f1f21;border:1px solid #334155;box-shadow:none}.header_box.dark[data-v-8a946786] .align-select .option:hover{background:#ffffff0f}.header_box.dark[data-v-8a946786] .align-select .option.active{background:#ffffff1a}.header_box.dark[data-v-8a946786] .color-select .section-title,.header_box.dark[data-v-8a946786] .bg-color-select .section-title{color:#94a3b8}.header_box.dark[data-v-8a946786] .color-select .btn,.header_box.dark[data-v-8a946786] .bg-color-select .btn,.header_box.dark[data-v-8a946786] .color-select .hex,.header_box.dark[data-v-8a946786] .bg-color-select .hex{background:#1f1f21;border-color:#334155;color:#e5e7eb}.header_box.dark[data-v-8a946786] .color-select .swatch,.header_box.dark[data-v-8a946786] .bg-color-select .swatch{border-color:#ffffff14}.header_box.dark[data-v-8a946786] .color-select .swatch .check,.header_box.dark[data-v-8a946786] .bg-color-select .swatch .check{color:#fff;text-shadow:none}.outline-wrapper[data-v-64d05f68]{position:relative;-webkit-user-select:none;user-select:none}.outline[data-v-64d05f68]{border-left:1px solid var(--border-color);padding:8px;box-sizing:border-box;font-size:14px;position:sticky;top:0;align-self:start;height:100%;background:var(--bg-base);display:flex;flex-direction:column;width:0;opacity:0;overflow:hidden;transform:scaleX(0);transform-origin:right center;transition:width .2s ease,transform .2s ease,opacity .2s ease;border-left:none}.outline.isOpen[data-v-64d05f68]{width:240px;opacity:1;transform:scaleX(1);border-left:1px solid var(--border-color)}.outline__listWrap[data-v-64d05f68]{overflow-y:auto;overflow-x:hidden;flex:1 1 auto;min-height:0}.outline__listWrap[data-v-64d05f68]::-webkit-scrollbar{width:6px;height:1px}.outline__listWrap[data-v-64d05f68]::-webkit-scrollbar-thumb{border-radius:10px;box-shadow:inset 0 0 5px #1118181a;background:#787878}.outline__listWrap[data-v-64d05f68]::-webkit-scrollbar-track{border-radius:10px;background:transparent}.outline__header[data-v-64d05f68]{display:flex;align-items:center;font-weight:600;margin-bottom:8px}.outline__header[data-v-64d05f68]>*{display:inline-flex;gap:6px}.outline__list[data-v-64d05f68]{list-style:none;padding:0;margin:0}.outline__item[data-v-64d05f68]{cursor:pointer;padding:4px 0;color:#333}.outline.dark .outline__item[data-v-64d05f68]{color:#e5e7eb}.outline__caret[data-v-64d05f68]{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;margin-right:4px;color:#666;transition:transform .12s ease}.outline.dark .outline__caret[data-v-64d05f68]{color:#94a3b8}.outline__caret.collapsed[data-v-64d05f68]{transform:rotate(0)}.outline__caret.expanded[data-v-64d05f68]{transform:rotate(90deg)}.outline__item[data-v-64d05f68]:hover{color:#1a69f8}.outline.dark .outline__item[data-v-64d05f68]:hover{color:#22c55e}.outline__item.lv-1[data-v-64d05f68]{padding-left:0}.outline__item.lv-2[data-v-64d05f68]{padding-left:8px}.outline__item.lv-3[data-v-64d05f68]{padding-left:16px}.outline__item.lv-4[data-v-64d05f68]{padding-left:24px}.outline__item.lv-5[data-v-64d05f68]{padding-left:32px}.outline__item.lv-6[data-v-64d05f68]{padding-left:40px}.outline__text[data-v-64d05f68]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.outline__close[data-v-64d05f68]{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--border-color);background:#fff;border-radius:50%;box-shadow:0 2px 10px #00000014;color:#666;cursor:pointer}.outline.dark .outline__close[data-v-64d05f68]{background:#1f1f21;border-color:#334155;color:#94a3b8;box-shadow:none}.outline__close[data-v-64d05f68]:hover{color:var(--hover-text-color)}.outline__title[data-v-64d05f68]{display:inline-flex;align-items:center;gap:6px}.outline__pinIcon[data-v-64d05f68]{display:inline-flex;width:16px;height:16px;color:#666;cursor:pointer}.outline-drawer-mask[data-v-64d05f68]{display:none}@media (max-width: 900px){.outline[data-v-64d05f68]{position:absolute;right:0;top:0;bottom:0;width:0;max-width:85vw;box-shadow:-6px 0 24px #00000014;z-index:10}.outline.isOpen[data-v-64d05f68]{width:min(85vw,280px)}.outline-drawer-mask[data-v-64d05f68]{display:block;position:absolute;left:0;right:0;top:0;bottom:0;background:#00000029;z-index:10}}.outline-slide-enter-active[data-v-64d05f68],.outline-slide-leave-active[data-v-64d05f68]{transition:transform .18s ease,opacity .18s ease}.outline-slide-enter-from[data-v-64d05f68],.outline-slide-leave-to[data-v-64d05f68]{opacity:0;transform:translate(16px)}@media (max-width: 900px){.outline-slide-enter-from[data-v-64d05f68],.outline-slide-leave-to[data-v-64d05f68]{transform:translate(100%)}}.outline-mask-enter-active[data-v-64d05f68],.outline-mask-leave-active[data-v-64d05f68]{transition:opacity .18s ease}.outline-mask-enter-from[data-v-64d05f68],.outline-mask-leave-to[data-v-64d05f68]{opacity:0}.simple-editor[data-v-0dda272d]{height:var(--editor-height, auto);min-height:var(--editor-min-height, 100px);display:flex;flex-direction:column;border-radius:2px;background:var(--bg-base);box-sizing:border-box;border:1px solid var(--border-color)}.simple-editor .fullscreen[data-v-0dda272d]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;border-radius:0}.simple-editor.readonly[data-v-0dda272d] .tiptap-resize-handle{pointer-events:none;display:none}.simple-editor.readonly[data-v-0dda272d] img,.simple-editor.readonly[data-v-0dda272d] video{-webkit-user-drag:none}.simple-editor.readonly[data-v-0dda272d] .tiptap-resize-wrapper,.simple-editor.readonly[data-v-0dda272d] .tiptap-resize-container{outline:none!important;border:none!important;width:100%!important;max-width:100%!important}.simple-editor.readonly[data-v-0dda272d] .tiptap-video{width:100%!important;max-width:100%!important}.editor_wrapper[data-v-0dda272d]{position:relative;overflow-y:auto;overflow-x:hidden;align-items:stretch;flex:1 1 auto;min-height:0}.editor_wrapper[data-v-0dda272d]::-webkit-scrollbar{width:6px;height:1px}.editor_wrapper[data-v-0dda272d]::-webkit-scrollbar-thumb{border-radius:10px;box-shadow:inset 0 0 5px #1118181a;background:#787878}.editor_wrapper[data-v-0dda272d]::-webkit-scrollbar-track{border-radius:10px;background:transparent}.editor_main[data-v-0dda272d]{display:grid;grid-template-columns:1fr auto;align-items:stretch;flex:1 1 auto;min-height:0;position:relative}.outline-toggle-row[data-v-0dda272d]{position:sticky;top:12px;z-index:3;display:flex;justify-content:flex-end;padding-right:12px}.outline-markers[data-v-0dda272d]{position:absolute;right:0;top:0;bottom:0;width:18px;z-index:4}.outline-pin[data-v-0dda272d]{position:absolute;right:3px;top:8px;width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--border-color);background:#fff;border-radius:50%;box-shadow:0 2px 10px #00000014;color:#666;cursor:pointer}.outline-marker[data-v-0dda272d]{position:absolute;right:3px;width:12px;height:2px;background:#d0d5dd;border-radius:2px}.outline-marker.active[data-v-0dda272d]{background:#22c55e}.content[data-v-0dda272d]{padding:12px 24px;color:var(--text-base)}.content[data-v-0dda272d] img{max-width:100%;height:auto;display:inline-block}.content[data-v-0dda272d] .ProseMirror{outline:none;caret-color:var(--editor-caret-color)}.content[data-v-0dda272d] .tiptap-resize-container,.content[data-v-0dda272d] .tiptap-resize-wrapper{max-width:100%!important;box-sizing:border-box}.content[data-v-0dda272d] .tiptap-video{max-width:100%!important;height:auto!important;display:block}.content[data-v-0dda272d] .drag-hover-target{background:#eef5ff;border-radius:8px}.content[data-v-0dda272d] ul[data-type=taskList]{list-style:none;padding-left:0;margin:12px 0}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem]{display:flex;align-items:flex-start;gap:8px;margin:6px 0}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem] .todo-box{width:16px;height:16px;border-radius:4px;border:1px solid var(--border-color);background:#fff;box-shadow:inset 0 1px 2px #0000000f;margin-top:2px;flex-shrink:0;cursor:pointer;position:relative;display:inline-flex;align-items:center;justify-content:center;transition:background-color .16s ease,border-color .16s ease}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem] .todo-box:after{content:"✓";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) scale(.3);opacity:0;color:#fff;font-size:12px;font-weight:700;transition:transform .18s ease,opacity .18s ease;animation:todo-check-out-0dda272d .18s ease both}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] .todo-box{background:#22c55e;border-color:#22c55e}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] .todo-box:after{transform:translate(-50%,-50%) scale(1);opacity:1;animation:todo-check-in-0dda272d .22s cubic-bezier(.2,.7,.3,1.2) both}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem] .todo-box:focus{outline:2px solid #1677ff44}@keyframes todo-check-in-0dda272d{0%{transform:translate(-50%,-50%) scale(.3);opacity:0}60%{transform:translate(-50%,-50%) scale(1.15);opacity:1}to{transform:translate(-50%,-50%) scale(1);opacity:1}}@keyframes todo-check-out-0dda272d{0%{transform:translate(-50%,-50%) scale(1);opacity:1}to{transform:translate(-50%,-50%) scale(.3);opacity:0}}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem]>label,.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem] .task-item__label{display:inline-flex;align-items:center;margin-right:6px}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem] input[type=checkbox]{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto;position:static;opacity:1;pointer-events:auto;width:16px;height:16px;border-radius:4px;border:1px solid var(--border-color);margin-top:2px}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] input[type=checkbox]{accent-color:#22c55e}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem] .task-content,.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem] .task-item__content{flex:1;min-width:1px}.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem] .task-content p,.content[data-v-0dda272d] ul[data-type=taskList] li[data-type=taskItem] .task-item__content p{margin:0}.content[data-v-0dda272d] img.ProseMirror-selectednode{outline:2px solid var(--border-color);border-radius:4px}.content[data-v-0dda272d] [data-resize-wrapper]{display:inline-block}.content[data-v-0dda272d] .tiptap-resize-handle{width:10px;height:10px;background:#1677ffd9;border-radius:2px;box-shadow:0 0 0 1px #fff;cursor:nwse-resize;z-index:4;opacity:0;pointer-events:none;transition:opacity .12s ease}.content[data-v-0dda272d] .tiptap-resize-handle[data-resize-handle=top-left],.content[data-v-0dda272d] .tiptap-resize-handle[data-resize-handle=bottom-right]{cursor:nwse-resize}.content[data-v-0dda272d] .tiptap-resize-handle[data-resize-handle=top-right],.content[data-v-0dda272d] .tiptap-resize-handle[data-resize-handle=bottom-left]{cursor:nesw-resize}.content[data-v-0dda272d] .tiptap-resize-wrapper:hover .tiptap-resize-handle,.content[data-v-0dda272d] .tiptap-resize-container[data-resize-state=true] .tiptap-resize-handle{opacity:1;pointer-events:auto}.content[data-v-0dda272d] .tiptap-resize-wrapper:hover>img,.content[data-v-0dda272d] .tiptap-resize-wrapper:hover>video{outline:2px solid var(--border-color);border-radius:4px}.content[data-v-0dda272d] .tiptap-resize-wrapper{position:relative}.content[data-v-0dda272d] .tiptap-resize-wrapper[data-uploading=true] .tiptap-upload-mask{pointer-events:auto}.content[data-v-0dda272d] .tiptap-upload-mask{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;display:flex;align-items:center;justify-content:center;color:#1677ff;font-size:12px;border-radius:4px;opacity:0;pointer-events:none;transition:opacity .2s ease;z-index:2}.content[data-v-0dda272d] .tiptap-resize-wrapper[data-uploading=true] .tiptap-upload-mask{opacity:1}.content[data-v-0dda272d] .tiptap-upload-progress{width:66%;max-width:360px;height:6px;background:#0003;border-radius:4px;overflow:hidden;position:relative}.content[data-v-0dda272d] .tiptap-upload-progress:before{content:"";position:absolute;left:-40%;width:40%;height:100%;background:#1677ff;border-radius:4px;animation:tiptap-upload-indeterminate-0dda272d 1.1s ease-in-out infinite}@keyframes tiptap-upload-indeterminate-0dda272d{0%{left:-40%}50%{left:60%}to{left:100%}}.content[data-v-0dda272d] .tiptap-resize-container.is-resizing .tiptap-resize-handle{background:#1677ff}.content[data-v-0dda272d] .ProseMirror table{border-collapse:collapse;margin:12px 0;width:100%}.content[data-v-0dda272d] .ProseMirror table th,.content[data-v-0dda272d] .ProseMirror table td{border:1px solid var(--border-color);padding:8px;text-align:left;position:relative}.content[data-v-0dda272d] .ProseMirror table thead th{background:#f7f9fc;font-weight:600}.content .simple-editor.dark[data-v-0dda272d] .ProseMirror table thead th{background:#111827}.content[data-v-0dda272d] .ProseMirror table .selectedCell{background:#1677ff0f;outline:2px solid #1677ff;outline-offset:-2px}.content[data-v-0dda272d] .ProseMirror table .column-resize-handle{position:absolute;right:-3px;top:0;bottom:0;width:8px;background:transparent;cursor:col-resize;z-index:3;-webkit-user-select:none;user-select:none;pointer-events:auto}.content[data-v-0dda272d] .ProseMirror table .column-resize-handle:hover{background:#1677ff40}.content[data-v-0dda272d] .ProseMirror p.is-editor-empty:first-child:before{content:attr(data-placeholder);color:#999;pointer-events:none;float:left;height:0;white-space:pre-line}.content[data-v-0dda272d] code{background:var(--code-bg);padding:2px 4px;border-radius:4px}.content[data-v-0dda272d] blockquote{border-left:3px solid #e5e7eb;margin:12px 0;padding:4px 12px;color:#6b7280}.content[data-v-0dda272d] pre{background:var(--code-bg);padding:12px;border-radius:6px;border:1px solid var(--border-color);overflow:auto}.content[data-v-0dda272d] p{margin:12px 0}[data-v-0dda272d] .md-drag-handle{width:22px;height:22px;border-radius:4px;display:inline-flex;align-items:center;justify-content:center;box-shadow:0 2px 10px #00000014;background:#fff;border:1px solid var(--border-color);cursor:grab;z-index:5}[data-v-0dda272d] .md-drag-handle:before{content:"···";letter-spacing:2px;color:#888;font-weight:700}@media (max-width: 900px){.editor_main[data-v-0dda272d]{grid-template-columns:1fr}.outline-markers[data-v-0dda272d]{display:none}}.link-modal-backdrop[data-v-0dda272d]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0003}.link-modal[data-v-0dda272d]{position:fixed;left:50%;top:20%;transform:translate(-50%);z-index:1000}.link-modal__content[data-v-0dda272d]{background:#fff;border:1px solid var(--border-color);border-radius:2px;min-width:360px;padding:12px;box-shadow:0 6px 24px #00000014}.simple-editor.dark .link-modal__content[data-v-0dda272d]{background:#1f1f21;border-color:#334155;box-shadow:none;color:#e5e7eb}.link-modal__title[data-v-0dda272d]{font-weight:600;margin-bottom:8px}.link-modal__input[data-v-0dda272d]{width:100%;padding:8px;border:1px solid var(--border-color);border-radius:2px;margin-bottom:10px}.simple-editor.dark .link-modal__input[data-v-0dda272d]{background:#0b1220;border-color:#334155;color:#e5e7eb}.link-modal__actions[data-v-0dda272d]{display:flex;gap:8px;justify-content:flex-end}.link-modal__actions button[data-v-0dda272d]{padding:6px 10px;border:1px solid var(--border-color);background:#fff;border-radius:2px;cursor:pointer}.simple-editor.dark .link-modal__actions button[data-v-0dda272d]{background:#1f1f21;border-color:#334155;color:#e5e7eb}.tiptap-video[data-v-0dda272d]{display:block;max-width:100%;height:auto}[data-format-brush=true] .ProseMirror{cursor:url("data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1763569611105'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='87406'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='18'%20height='18'%3e%3cpath%20d='M840%20192h-56v-72c0-13.3-10.7-24-24-24H168c-13.3%200-24%2010.7-24%2024v272c0%2013.3%2010.7%2024%2024%2024h592c13.3%200%2024-10.7%2024-24V256h32v200H465c-22.1%200-40%2017.9-40%2040v136h-44c-4.4%200-8%203.6-8%208v228c0%200.6%200.1%201.3%200.2%201.9-0.1%202-0.2%204.1-0.2%206.1%200%2046.4%2037.6%2084%2084%2084s84-37.6%2084-84c0-2.1-0.1-4.1-0.2-6.1%200.1-0.6%200.2-1.2%200.2-1.9V640c0-4.4-3.6-8-8-8h-44V520h351c22.1%200%2040-17.9%2040-40V232c0-22.1-17.9-40-40-40zM720%20352H208V160h512v192zM477%20876c0%2011-9%2020-20%2020s-20-9-20-20V696h40v180z'%20p-id='87407'%3e%3c/path%3e%3c/svg%3e") 0 16,crosshair}[data-format-brush=true] .ProseMirror *{cursor:inherit}`)),document.head.appendChild(a)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
2
|
(function(P,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@tiptap/vue-3"),require("@tiptap/starter-kit"),require("@tiptap/markdown"),require("@tiptap/extension-image"),require("@tiptap/core"),require("@tiptap/extension-placeholder"),require("@tiptap/extension-link"),require("@tiptap/extension-text-align"),require("@tiptap/extension-text-style"),require("@tiptap/extension-color"),require("@tiptap/extension-underline"),require("@tiptap/extension-table"),require("@tiptap/extensions"),require("@tiptap/extension-list")):typeof define=="function"&&define.amd?define(["exports","vue","@tiptap/vue-3","@tiptap/starter-kit","@tiptap/markdown","@tiptap/extension-image","@tiptap/core","@tiptap/extension-placeholder","@tiptap/extension-link","@tiptap/extension-text-align","@tiptap/extension-text-style","@tiptap/extension-color","@tiptap/extension-underline","@tiptap/extension-table","@tiptap/extensions","@tiptap/extension-list"],e):(P=typeof globalThis<"u"?globalThis:P||self,e(P.MdEditor={},P.Vue,P.tiptapVue3,P.StarterKit,P.tiptapMarkdown,P.tiptapImage,P.tiptapCore,P.tiptapPlaceholder,P.tiptapLink,P.tiptapTextAlign,P.tiptapTextStyle,P.tiptapColor,P.tiptapUnderline,P.tiptapTable,P.extensions,P.extensionList))})(this,function(P,e,ve,He,Ue,je,ke,Ie,Oe,We,we,Re,Pe,Me,Ge,Be){"use strict";var Fe;function qe(t){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(c,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return c.default=t,Object.freeze(c)}const Ce=qe(ke),Ye=je.Image.extend({draggable:!1,addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),uploading:{default:null,parseHTML:c=>c.getAttribute("data-uploading")?!0:null,renderHTML:c=>c.uploading?{"data-uploading":"true"}:{}},width:{default:null,parseHTML:c=>{const r=c.getAttribute("width")||c.style.width||"",n=String(r).match(/^(\d+)(px)?$/);return n?Number(n[1]):null},renderHTML:c=>c.width?{width:c.width}:{}},height:{default:null,parseHTML:c=>{const r=c.getAttribute("height")||c.style.height||"",n=String(r).match(/^(\d+)(px)?$/);return n?Number(n[1]):null},renderHTML:c=>c.height?{height:c.height}:{}}}},addNodeView(){return({node:t,getPos:c,editor:r})=>{const n=document.createElement("img"),a=t.attrs;n.src=a.src||"",a.alt&&(n.alt=a.alt),a.title&&(n.title=a.title),typeof a.width=="number"&&(n.style.width=`${a.width}px`),typeof a.height=="number"&&(n.style.height=`${a.height}px`),n.style.maxWidth="100%",n.style.height=n.style.height||"auto",n.style.display="inline-block";const i=new ke.ResizableNodeView({element:n,node:t,getPos:c,onResize:(f,N)=>{n.style.width=`${f}px`,n.style.height=`${N}px`},onCommit:(f,N)=>{try{const x=r,m=c();if(m!==void 0){const{state:E}=x,y=E.schema.nodes.image,k=E.doc.nodeAt(m);if(y&&k){const d={...k.attrs||{},width:f,height:N},s=E.tr.setNodeMarkup(m,y,d,k.marks);x.view.dispatch(s)}}}catch{}},onUpdate:f=>{const N=f.attrs;return typeof N.src=="string"&&N.src&&n.src!==N.src&&(n.src=N.src),typeof N.width=="number"&&(n.style.width=`${N.width}px`),typeof N.height=="number"&&(n.style.height=`${N.height}px`),N.uploading?i.wrapper.setAttribute("data-uploading","true"):i.wrapper.removeAttribute("data-uploading"),!0},options:{directions:["bottom-right","bottom-left","top-right","top-left"],min:{width:32,height:32},preserveAspectRatio:!0,className:{container:"tiptap-resize-container",wrapper:"tiptap-resize-wrapper",handle:"tiptap-resize-handle",resizing:"is-resizing"}}});n.addEventListener("dragstart",f=>{const N=r;if(!(N!=null&&N.isEditable))try{f.preventDefault()}catch{}});try{n.setAttribute("draggable","false"),i.wrapper.setAttribute("draggable","false"),i.container.setAttribute("draggable","false"),i.container.style.display="inline-block",i.wrapper.style.display="inline-block"}catch{}const C=document.createElement("div");C.className="tiptap-upload-mask";const p=document.createElement("div");return p.className="tiptap-upload-progress",C.appendChild(p),i.wrapper.appendChild(C),a.uploading&&i.wrapper.setAttribute("data-uploading","true"),i}}}),Ke=Me.TableCell.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),backgroundColor:{default:null,parseHTML:c=>c.getAttribute("data-background-color"),renderHTML:c=>{const r=c.backgroundColor;return r?{"data-background-color":r,style:`background-color: ${r}`}:{}}}}}}),Je=(((Fe=Ce==null?void 0:Ce.Node)==null?void 0:Fe.create)??(t=>t))({name:"video",inline:!0,group:"inline",atom:!0,draggable:!1,selectable:!0,addAttributes(){return{src:{default:null},controls:{default:!0},autoplay:{default:!1},loop:{default:!1},muted:{default:!1},poster:{default:null},playsinline:{default:!0},uploading:{default:null,parseHTML:t=>t.getAttribute("data-uploading")?!0:null,renderHTML:t=>t.uploading?{"data-uploading":"true"}:{}},width:{default:null,parseHTML:t=>{const c=t.getAttribute("width")||t.style.width||"",r=String(c).match(/^(\d+)(px)?$/);return r?Number(r[1]):null},renderHTML:t=>t.width?{width:t.width}:{}},height:{default:null,parseHTML:t=>{const c=t.getAttribute("height")||t.style.height||"",r=String(c).match(/^(\d+)(px)?$/);return r?Number(r[1]):null},renderHTML:t=>t.height?{height:t.height}:{}},class:{default:"tiptap-video"}}},parseHTML(){return[{tag:"video[data-tiptap-video]"},{tag:"video"}]},renderHTML({HTMLAttributes:t}){return["video",{"data-tiptap-video":"",...t}]},renderMarkdown(t){const c=(t==null?void 0:t.attrs)||{},r=typeof c.src=="string"?c.src:"";return r?`[video](${r})`:""},markdownTokenizer:{name:"video",level:"inline",start:t=>t.indexOf("[video]("),tokenize:t=>{const c=/^\[video\]\(([^)]+)\)/.exec(t);if(c)return{type:"video",raw:c[0],href:c[1]}}},parseMarkdown(t){const c=(t==null?void 0:t.href)||(t==null?void 0:t.src)||"";return c?{type:"video",attrs:{src:c,controls:!0}}:{type:"paragraph"}},addNodeView(){return({node:t,getPos:c,editor:r})=>{var f,N,x,m,E;const n=document.createElement("video"),a=t.attrs;n.src=a.src||"",n.controls=a.controls!==!1,n.autoplay=!1,n.loop=!!a.loop,n.muted=!!a.muted,a.poster&&(n.poster=a.poster),n.setAttribute("playsinline","true"),a.class&&(n.className=String(a.class)),typeof a.width=="number"&&(n.style.width=`${a.width}px`),typeof a.height=="number"&&(n.style.height=`${a.height}px`),n.style.display="inline-block";const i=new ke.ResizableNodeView({element:n,node:t,getPos:c,onResize:(y,k)=>{n.style.width=`${y}px`,n.style.height=`${k}px`},onCommit:(y,k)=>{try{const d=r,s=c();if(s!==void 0){const{state:g}=d,h=g.schema.nodes.video,u=g.doc.nodeAt(s);if(h&&u){const B={...u.attrs||{},width:y,height:k},z=g.tr.setNodeMarkup(s,h,B,u.marks);d.view.dispatch(z)}}}catch{}},onUpdate:y=>{const k=y.attrs||{};if(typeof k.src=="string"&&k.src&&n.src!==k.src&&(n.src=k.src),typeof k.width=="number"&&(n.style.width=`${k.width}px`),typeof k.height=="number"&&(n.style.height=`${k.height}px`),k.uploading){i.wrapper.setAttribute("data-uploading","true"),n.controls=!1;try{n.pause()}catch{}n.style.pointerEvents="none"}else i.wrapper.removeAttribute("data-uploading"),n.controls=k.controls!==!1,n.style.pointerEvents="";return!0},options:{directions:["bottom-right","bottom-left","top-right","top-left"],min:{width:120,height:80},preserveAspectRatio:!0,className:{container:"tiptap-resize-container",wrapper:"tiptap-resize-wrapper",handle:"tiptap-resize-handle",resizing:"is-resizing"}}});n.addEventListener("dragstart",y=>{const k=r;if(!(k!=null&&k.isEditable))try{y.preventDefault()}catch{}});try{n.setAttribute("draggable","false"),(N=(f=i==null?void 0:i.wrapper)==null?void 0:f.setAttribute)==null||N.call(f,"draggable","false"),(m=(x=i==null?void 0:i.container)==null?void 0:x.setAttribute)==null||m.call(x,"draggable","false")}catch{}try{i.container.style.display="inline-block",i.wrapper.style.display="inline-block"}catch{}const C=document.createElement("div");C.className="tiptap-upload-mask";const p=document.createElement("div");if(p.className="tiptap-upload-progress",C.appendChild(p),i.wrapper.appendChild(C),(E=t.attrs)!=null&&E.uploading){i.wrapper.setAttribute("data-uploading","true"),n.controls=!1;try{n.pause()}catch{}n.style.pointerEvents="none"}return i}},addCommands(){return{setVideo:t=>({chain:c})=>{const{src:r,HTMLAttributes:n={}}=t||{};return c().insertContent({type:this.name,attrs:{src:r,...n}}).run()}}}}),Ze=Be.TaskItem.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),nested:!0}},addNodeView(){return({node:t,editor:c,getPos:r})=>{const n=document.createElement("li");n.setAttribute("data-type","taskItem"),n.setAttribute("data-checked",t.attrs.checked?"true":"false");const a=document.createElement("span");a.className="todo-box",a.tabIndex=0,a.setAttribute("role","checkbox"),a.setAttribute("aria-checked",t.attrs.checked?"true":"false"),a.addEventListener("mousedown",p=>p.preventDefault());const i=()=>{const p=typeof r=="function"?r():null;if(p==null)return{pos:null,n:null};const f=c.view.state.doc.nodeAt(p);return{pos:p,n:f}};a.addEventListener("click",()=>{var y;const{pos:p,n:f}=i();if(p==null||!f)return;const N=c.view.state,x=N.schema.nodes.taskItem,m=!!((y=f.attrs)!=null&&y.checked),E=N.tr.setNodeMarkup(p,x,{...f.attrs||{},checked:!m});c.view.dispatch(E)}),a.addEventListener("keydown",p=>{var f;if(p.key==="Enter"||p.key===" "){p.preventDefault();const{pos:N,n:x}=i();if(N==null||!x)return;const m=c.view.state,E=m.schema.nodes.taskItem,y=!!((f=x.attrs)!=null&&f.checked),k=m.tr.setNodeMarkup(N,E,{...x.attrs||{},checked:!y});c.view.dispatch(k)}});const C=document.createElement("div");return C.className="task-content",n.appendChild(a),n.appendChild(C),{dom:n,contentDOM:C,update(p){return p.type!==t.type?!1:(n.setAttribute("data-checked",p.attrs.checked?"true":"false"),a.setAttribute("aria-checked",p.attrs.checked?"true":"false"),!0)}}}}});var Xe={size:"1em",strokeWidth:4,strokeLinecap:"round",strokeLinejoin:"round",rtl:!1,theme:"outline",colors:{outline:{fill:"#333",background:"transparent"},filled:{fill:"#333",background:"#FFF"},twoTone:{fill:"#333",twoTone:"#2F88FF"},multiColor:{outStrokeColor:"#333",outFillColor:"#2F88FF",innerStrokeColor:"#FFF",innerFillColor:"#43CCF8"}},prefix:"i"};function Qe(){return"icon-"+((1+Math.random())*4294967296|0).toString(16).substring(1)}function et(t,c,r){var n=typeof c.fill=="string"?[c.fill]:c.fill||[],a=[],i=c.theme||r.theme;switch(i){case"outline":a.push(typeof n[0]=="string"?n[0]:"currentColor"),a.push("none"),a.push(typeof n[0]=="string"?n[0]:"currentColor"),a.push("none");break;case"filled":a.push(typeof n[0]=="string"?n[0]:"currentColor"),a.push(typeof n[0]=="string"?n[0]:"currentColor"),a.push("#FFF"),a.push("#FFF");break;case"two-tone":a.push(typeof n[0]=="string"?n[0]:"currentColor"),a.push(typeof n[1]=="string"?n[1]:r.colors.twoTone.twoTone),a.push(typeof n[0]=="string"?n[0]:"currentColor"),a.push(typeof n[1]=="string"?n[1]:r.colors.twoTone.twoTone);break;case"multi-color":a.push(typeof n[0]=="string"?n[0]:"currentColor"),a.push(typeof n[1]=="string"?n[1]:r.colors.multiColor.outFillColor),a.push(typeof n[2]=="string"?n[2]:r.colors.multiColor.innerStrokeColor),a.push(typeof n[3]=="string"?n[3]:r.colors.multiColor.innerFillColor);break}return{size:c.size||r.size,strokeWidth:c.strokeWidth||r.strokeWidth,strokeLinecap:c.strokeLinecap||r.strokeLinecap,strokeLinejoin:c.strokeLinejoin||r.strokeLinejoin,colors:a,id:t}}var tt=Symbol("icon-context");function te(t,c,r){var n={name:"icon-"+t,props:["size","strokeWidth","strokeLinecap","strokeLinejoin","theme","fill","spin"],setup:function(i){var C=Qe(),p=e.inject(tt,Xe);return function(){var f=i.size,N=i.strokeWidth,x=i.strokeLinecap,m=i.strokeLinejoin,E=i.theme,y=i.fill,k=i.spin,d=et(C,{size:f,strokeWidth:N,strokeLinecap:x,strokeLinejoin:m,theme:E,fill:y},p),s=[p.prefix+"-icon"];return s.push(p.prefix+"-icon-"+t),c&&p.rtl&&s.push(p.prefix+"-icon-rtl"),k&&s.push(p.prefix+"-icon-spin"),e.createVNode("span",{class:s.join(" ")},[r(d)])}}};return n}const de=te("check",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M43 11L16.875 37L5 25.1818",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),ue=te("down-one",!1,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M36 19L24 31L12 19H36Z",fill:t.colors[1],stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linejoin":t.strokeLinejoin},null)])}),ot=te("font-size-two",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M4 44L24 4L44 44",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M12 28H36",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),nt=te("full-screen",!1,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M33 6H42V15",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 33V42H33",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M15 42H6V33",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M6 15V6H15",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),rt=te("go-on",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M36 7L43 13.4615L36 21",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M40 14H17.0062C10.1232 14 4.27787 19.6204 4.00964 26.5C3.72612 33.7696 9.73291 40 17.0062 40H34.0016",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),it=te("off-screen",!1,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M33 6V15H42",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M15 6V15H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M15 42V33H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M33 42V33H41.8995",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),lt=te("preview-close-one",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M9.85786 18C6.23858 21 4 24 4 24C4 24 12.9543 36 24 36C25.3699 36 26.7076 35.8154 28 35.4921M20.0318 12.5C21.3144 12.1816 22.6414 12 24 12C35.0457 12 44 24 44 24C44 24 41.7614 27 38.1421 30",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M20.3142 20.6211C19.4981 21.5109 19 22.6972 19 23.9998C19 26.7612 21.2386 28.9998 24 28.9998C25.3627 28.9998 26.5981 28.4546 27.5 27.5705",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 42L6 6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),st=te("return",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M12.9998 8L6 14L12.9998 21",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M6 14H28.9938C35.8768 14 41.7221 19.6204 41.9904 26.5C42.2739 33.7696 36.2671 40 28.9938 40H11.9984",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),at=te("search",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M21 38C30.3888 38 38 30.3888 38 21C38 11.6112 30.3888 4 21 4C11.6112 4 4 11.6112 4 21C4 30.3888 11.6112 38 21 38Z",fill:t.colors[1],stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M26.657 14.3431C25.2093 12.8954 23.2093 12 21.0001 12C18.791 12 16.791 12.8954 15.3433 14.3431",stroke:t.colors[2],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M33.2216 33.2217L41.7069 41.707",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),ct=te("strikethrough",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M5 24H43",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M24 24C40 30 34 44 24 44C13.9999 44 12 36 12 36",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M35.9999 12C35.9999 12 33 4 23.9999 4C14.9999 4 11.4359 11.5995 15.6096 18",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M12 36C12 36 15.9999 44 24 44C32 44 36.564 36.4005 32.3903 30",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),dt=te("text-bold",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 24C29.5056 24 33.9688 19.5228 33.9688 14C33.9688 8.47715 29.5056 4 24 4H11V24H24Z",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M28.0312 44C33.5368 44 38 39.5228 38 34C38 28.4772 33.5368 24 28.0312 24H11V44H28.0312Z",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),ft=te("text-italic",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M20 6H36",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M12 42H28",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M29 5.95215L19 41.9998",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),pt=te("text-underline",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M8 44H40",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M37 6.09717C37 12.7638 37 15.3335 37 22.0002C37 29.1799 31.1797 35.0002 24 35.0002C16.8203 35.0002 11 29.1799 11 22.0002C11 15.3335 11 12.7638 11 6.09717",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap},null)])}),mt={class:"label"},ut={key:0,class:"shortcut"},ht=e.defineComponent({__name:"Tooltip",props:{text:{type:String,required:!0},shortcut:{type:String,default:""},placement:{type:String,default:"bottom"},offset:{type:Number,default:6}},setup(t){const c=t,r=e.ref(null),n=e.ref(null),a=e.ref(!1),i=e.ref(c.placement),C=e.ref({top:0,left:0});function p(){const x=r.value,m=n.value;if(!x||!m)return;let E=c.placement;const y=m.getBoundingClientRect(),k=y.top,d=window.innerHeight-y.bottom,s=x.offsetHeight+c.offset;E==="bottom"?d<s&&k>=s&&(E="top"):k<s&&d>=s&&(E="bottom"),i.value=E;const g=y.left+y.width/2,h=E==="bottom"?y.bottom+c.offset:y.top-c.offset-x.offsetHeight;C.value={top:h,left:g}}function f(){a.value=!0,e.nextTick(p)}function N(){a.value=!1}return e.onMounted(()=>{window.addEventListener("resize",p),window.addEventListener("scroll",p,!0)}),e.onUnmounted(()=>{window.removeEventListener("resize",p),window.removeEventListener("scroll",p,!0)}),e.watch(()=>c.text,()=>e.nextTick(p)),(x,m)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:n,class:"tooltip-wrapper",onMouseenter:f,onMouseleave:N,onFocusin:f,onFocusout:N},[e.renderSlot(x.$slots,"default",{},void 0,!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createElementVNode("div",{ref_key:"tipRef",ref:r,class:e.normalizeClass(["tooltip",[i.value,{visible:a.value}]]),style:e.normalizeStyle({top:C.value.top+"px",left:C.value.left+"px"})},[e.createElementVNode("div",mt,e.toDisplayString(t.text),1),t.shortcut?(e.openBlock(),e.createElementBlock("div",ut,e.toDisplayString(t.shortcut),1)):e.createCommentVNode("",!0)],6)]))],544))}}),J=(t,c)=>{const r=t.__vccOpts||t;for(const[n,a]of c)r[n]=a;return r},U=J(ht,[["__scopeId","data-v-2e4633d5"]]),gt=["aria-expanded"],kt={class:"label"},wt={key:0,class:"dropdown",role:"listbox"},Ct=["aria-selected","onClick"],yt={class:"text"},ye="md-toolbar-dropdown-open",Le="font-size-select",xt=J(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=["12px","13px","14px","15px","16px","19px","22px","24px","29px","32px","40px","48px"],n=e.computed(()=>{var E,y;const m=(y=(E=c.editor)==null?void 0:E.getAttributes("textStyle"))==null?void 0:y.fontSize;return typeof m=="string"&&m?m:"15px"}),a=e.ref(!1),i=e.ref(null);function C(){a.value||window.dispatchEvent(new CustomEvent(ye,{detail:{id:Le}})),a.value=!a.value}function p(){a.value=!1}function f(m){var E;(E=c.editor)==null||E.chain().focus().setMark("textStyle",{fontSize:m}).run(),p()}function N(m){const E=m.target,y=i.value;y&&!y.contains(E)&&p()}e.onMounted(()=>{document.addEventListener("click",N),window.addEventListener(ye,x)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",N),window.removeEventListener(ye,x)});function x(m){var y;((y=m.detail)==null?void 0:y.id)!==Le&&(a.value=!1)}return(m,E)=>(e.openBlock(),e.createElementBlock("div",{class:"font-size-wrapper",ref_key:"rootRef",ref:i},[e.createVNode(e.unref(U),{text:"字体大小",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon",onClick:e.withModifiers(C,["stop"]),"aria-expanded":a.value},[e.createElementVNode("div",kt,e.toDisplayString(n.value),1),e.createVNode(e.unref(ue),{theme:"filled",strokeWidth:3})],8,gt)]),_:1}),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock("div",wt,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(r,y=>e.createElementVNode("div",{key:y,class:"dropdown-item","aria-selected":y===n.value,onClick:e.withModifiers(k=>f(y),["stop"])},[y===n.value?(e.openBlock(),e.createBlock(e.unref(de),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0),e.createElementVNode("span",yt,e.toDisplayString(y),1)],8,Ct)),64))])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-87f86dca"]]),bt=["aria-expanded"],Vt={key:0,class:"dropdown"},_t={class:"section"},Et={class:"swatches"},Nt=["onClick"],vt={class:"section"},Mt={class:"swatches grid"},Bt=["onClick"],Lt={key:0,class:"section"},zt={class:"swatches"},St=["onClick"],$t={class:"section inline-actions"},Tt={key:1,class:"advanced"},xe="md-toolbar-dropdown-open",ze="color-select",Dt=J(e.defineComponent({__name:"index",props:{editor:{},currentColor:{}},setup(t){const c=t,r=["#000000","#262626","#595959","#8C8C8C","#BFBFBF","#D9D9D9","#E9E9E9","#F5F5F5","#FFFFFF","#F5222D","#FA541C","#FA8C16","#FADB14","#52C41A","#13C2C2","#1677FF","#2F54EB","#722ED1","#EB2F96","#FF4D4F","#FF7A45","#FFA940","#FFD666","#73D13D","#36CFC9","#69C0FF","#85A5FF","#B37FEB","#F759AB"],n=e.ref(!1),a=e.ref(!1),i=e.ref(null),C=e.ref(c.currentColor||"#000000"),p=e.ref(s()),f=e.ref("#F5222D");function N(){n.value||window.dispatchEvent(new CustomEvent(xe,{detail:{id:ze}})),n.value=!n.value}function x(){n.value=!1}function m(){a.value=!a.value}function E(z){var v;(v=c.editor)==null||v.chain().focus().setColor(z).run(),f.value=z,g(z),x()}function y(){var z;(z=c.editor)==null||z.chain().focus().unsetColor().run(),x()}function k(z){const v=z.target,w=i.value;w&&!w.contains(v)&&x()}function d(){}function s(){try{const z=localStorage.getItem("md_color_recent");if(!z)return[];const v=JSON.parse(z);return Array.isArray(v)?v.slice(0,12):[]}catch{return[]}}function g(z){const v=[z,...p.value.filter(w=>w!==z)];p.value=v.slice(0,12);try{localStorage.setItem("md_color_recent",JSON.stringify(p.value))}catch{}}let h=[];function u(){const z=c.editor;z&&(h=[{event:"selectionUpdate",handler:d},{event:"transaction",handler:d},{event:"update",handler:d}],h.forEach(({event:v,handler:w})=>{z.on(v,w)}))}e.onMounted(()=>{document.addEventListener("click",k),window.addEventListener(xe,B),u()}),e.onBeforeUnmount(()=>{document.removeEventListener("click",k),window.removeEventListener(xe,B);const z=c.editor;z&&h.forEach(({event:v,handler:w})=>{z.off(v,w)}),h=[]}),e.watch(()=>c.editor,(z,v)=>{v&&h.forEach(({event:w,handler:M})=>{v.off(w,M)}),h=[],u()});function B(z){var w;((w=z.detail)==null?void 0:w.id)!==ze&&(n.value=!1)}return(z,v)=>(e.openBlock(),e.createElementBlock("div",{class:"color-select-wrapper",ref_key:"rootRef",ref:i},[e.createElementVNode("div",{class:"icon icon-dropdown","aria-expanded":n.value},[e.createVNode(e.unref(U),{text:"文字颜色",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon-stack hoverable",onClick:v[0]||(v[0]=e.withModifiers(w=>E(f.value),["stop"]))},[e.createVNode(e.unref(ot),{theme:"filled",size:"14",fill:f.value,strokeWidth:3},null,8,["fill"]),e.createElementVNode("div",{class:"underline",style:e.normalizeStyle({background:f.value})},null,4)])]),_:1}),e.createVNode(e.unref(U),{text:"更多颜色",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"arrow hoverable",onClick:e.withModifiers(N,["stop"])},[e.createVNode(e.unref(ue),{theme:"filled",strokeWidth:3,size:"12"})])]),_:1})],8,bt),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",Vt,[e.createElementVNode("div",_t,[v[4]||(v[4]=e.createElementVNode("div",{class:"section-title"},"默认",-1)),e.createElementVNode("div",Et,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.slice(0,9),w=>(e.openBlock(),e.createElementBlock("div",{key:w,class:"swatch",style:e.normalizeStyle({background:w}),onClick:e.withModifiers(M=>E(w),["stop"])},[w===f.value?(e.openBlock(),e.createBlock(e.unref(de),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,Nt))),128))])]),e.createElementVNode("div",vt,[v[5]||(v[5]=e.createElementVNode("div",{class:"section-title"},"常用颜色",-1)),e.createElementVNode("div",Mt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.slice(9),w=>(e.openBlock(),e.createElementBlock("div",{key:w,class:"swatch",style:e.normalizeStyle({background:w}),onClick:e.withModifiers(M=>E(w),["stop"])},[w===f.value?(e.openBlock(),e.createBlock(e.unref(de),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,Bt))),128))])]),p.value.length?(e.openBlock(),e.createElementBlock("div",Lt,[v[6]||(v[6]=e.createElementVNode("div",{class:"section-title"},"最近使用自定义颜色",-1)),e.createElementVNode("div",zt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,w=>(e.openBlock(),e.createElementBlock("div",{key:w,class:"swatch",style:e.normalizeStyle({background:w}),onClick:e.withModifiers(M=>E(w),["stop"])},null,12,St))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",$t,[e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(y,["stop"])},"暂无"),e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(m,["stop"])},"更多颜色")]),a.value?(e.openBlock(),e.createElementBlock("div",Tt,[e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":v[1]||(v[1]=w=>C.value=w)},null,512),[[e.vModelText,C.value]]),e.withDirectives(e.createElementVNode("input",{class:"hex","onUpdate:modelValue":v[2]||(v[2]=w=>C.value=w)},null,512),[[e.vModelText,C.value]]),e.createElementVNode("button",{class:"btn apply",onClick:v[3]||(v[3]=e.withModifiers(w=>E(C.value),["stop"]))},"应用")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-1656be6b"]]),Ft='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763565315763" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="81778" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M96 128h832v96H96zM96 576h832v96H96zM224 352h576v96H224zM224 800h576v96H224z" p-id="81779"></path></svg>',At='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763565310640" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="81615" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M96 128h832v96H96zM96 576h832v96H96zM96 352h832v96H96zM96 800h832v96H96z" p-id="81616"></path></svg>',Ht='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763565296828" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="81289" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M96 128h832v96H96zM96 576h832v96H96zM96 352h576v96H96zM96 800h576v96H96z" p-id="81290"></path></svg>',Ut='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763565306218" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="81452" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M96 128h832v96H96zM96 576h832v96H96zM352 352h576v96H352zM352 800h576v96H352z" p-id="81453"></path></svg>',jt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763562183158" class="icon" viewBox="0 0 1102 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="79129" xmlns:xlink="http://www.w3.org/1999/xlink" width="19.37109375" height="18"><path d="M93.105231 187.943385a78.769231 78.769231 0 1 1 0-157.538462 78.769231 78.769231 0 0 1 0 157.538462z m0 393.846153a78.769231 78.769231 0 1 1 0-157.538461 78.769231 78.769231 0 0 1 0 157.538461z m0 393.846154a78.769231 78.769231 0 1 1 0-157.538461 78.769231 78.769231 0 0 1 0 157.538461zM276.243692 161.792v-118.153846h787.692308v118.153846h-787.692308z m0.472616 397.233231v-118.153846h788.007384v118.153846H276.716308z m-3.308308 397.154461v-118.153846h789.267692v118.153846H273.329231z" fill="#333333" p-id="79130"></path></svg>',It='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763566846467" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="83576" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M477.098667 709.717333a46.805333 46.805333 0 0 0 69.802666 0l296.021334-340.736c24.32-28.032 3.328-70.314667-34.944-70.314666H216.021333c-38.272 0-59.306667 42.282667-34.944 70.314666l296.021334 340.736z" fill="#000000" p-id="83577"></path></svg>',Ot='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763568214776" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="84748" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M682.666667 772.266667l332.8-247.466667-324.266667-435.2-409.6 307.2-256 192L260.266667 896h691.2v-85.333333h-324.266667l55.466667-38.4zM674.133333 213.333333l221.866667 294.4-260.266667 196.266667-38.4 25.6-230.4-285.866667L674.133333 213.333333zM145.066667 605.866667l149.333333-110.933334 230.4 285.866667-34.133333 29.866667H298.666667l-153.6-204.8z" fill="#333333" p-id="84749"></path></svg>',Wt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763479929532" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="52528" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M621.568 208.299a38.101 38.101 0 0 0-73.941-18.518L386.773 833.28a38.101 38.101 0 0 0 73.899 18.475l160.853-643.456zM325.632 294.4a38.101 38.101 0 0 1 0 53.888L162.347 511.573 325.632 674.86a38.101 38.101 0 0 1-53.845 53.888L81.493 538.539a38.101 38.101 0 0 1 0-53.931L271.787 294.4a38.101 38.101 0 0 1 53.888 0z m372.736 0a38.101 38.101 0 0 0 0 53.888l163.285 163.285L698.368 674.86a38.101 38.101 0 0 0 53.888 53.888l190.25-190.208a38.101 38.101 0 0 0 0-53.931L752.257 294.4a38.101 38.101 0 0 0-53.888 0z" fill="#333333" p-id="52529"></path></svg>',Rt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480012496" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="54461" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M338.986667 59.413333h52.586666a21.333333 21.333333 0 0 1 21.333334 21.333334V115.84a21.333333 21.333333 0 0 1-21.333334 21.333333H356.266667c-36.48 0-53.76 20.16-53.76 62.4v188.16c0 59.52-27.84 99.84-82.56 120 54.72 23.04 82.56 62.4 82.56 120v189.12c0 40.32 17.28 61.44 53.76 61.44h35.306666a21.333333 21.333333 0 0 1 21.333334 21.333334v35.093333a21.333333 21.333333 0 0 1-21.333334 21.333333H338.986667c-42.24 0-74.88-14.4-97.92-41.28-21.12-24.96-31.68-59.52-31.68-101.76v-180.48c0-27.84-5.76-48-17.28-60.48-11.178667-12.778667-29.653333-20.245333-55.466667-23.488a18.901333 18.901333 0 0 1-16.533333-18.773333v-43.221333c0-10.005333 7.381333-18.474667 17.28-19.84 25.408-3.498667 43.648-11.456 54.72-23.317334 11.52-13.44 17.28-33.6 17.28-60.48V203.413333c0-43.2 10.56-77.76 31.68-102.72 23.04-27.84 55.68-41.28 97.92-41.28z m292.48 0h52.586666c42.24 0 74.88 13.44 97.92 41.28 21.12 24.96 31.68 59.52 31.68 102.72v179.52c0 26.88 5.76 48 18.24 61.44 10.24 11.029333 28.224 18.816 53.418667 22.314667 10.112 1.408 17.621333 10.026667 17.621333 20.245333v40.746667a21.333333 21.333333 0 0 1-18.88 21.184c-24.576 3.413333-42.282667 10.794667-53.12 23.189333-11.52 12.48-17.28 32.64-17.28 60.48v180.48c0 42.24-10.56 76.8-31.68 101.76-23.04 26.88-55.68 41.28-97.92 41.28H631.466667a21.333333 21.333333 0 0 1-21.333334-21.333333V899.626667a21.333333 21.333333 0 0 1 21.333334-21.333334h35.306666c35.52 0 53.76-21.12 53.76-61.44v-189.12c0-57.6 26.88-96.96 82.56-120-55.68-20.16-82.56-60.48-82.56-120v-188.16c0-42.24-18.24-62.4-53.76-62.4H631.466667a21.333333 21.333333 0 0 1-21.333334-21.333333V80.746667a21.333333 21.333333 0 0 1 21.333334-21.333334z" fill="#000000" p-id="54462"></path></svg>',Pt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1768469045840" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6989" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M393.846154 64.174932l117.454119 0.399843H512.499805l117.454119-0.399843-10.395939 10.395939c-18.89262 18.89262-28.488872 44.982429-26.28973 71.472081l20.292073 250.502148c2.998829 36.68567 18.092932 72.171808 42.483405 99.661069l34.186646 38.684889-122.252245-0.899648-55.478329-0.399844h-0.99961l-55.478329 0.399844-122.452167 0.799687 34.186646-38.684888c24.390472-27.589223 39.484576-62.9754 42.483405-99.66107l20.292074-250.402187c2.199141-26.589613-7.397111-52.679422-26.289731-71.472081l-10.395939-10.395939m281.889887-64.174932h-0.199922L512.399844 0.599766h-0.799688L348.36392 0h-0.199922c-20.891839 0-39.684498 13.494729-45.582194 33.58688-4.098399 13.994533-1.899258 30.887934 17.79305 47.581414l38.584927 38.584927c5.597813 5.597813 8.39672 13.294807 7.796955 21.091761L346.464662 391.247169c-1.899258 23.190941-11.195627 45.08239-26.589613 62.475596l-61.87583 69.872706c-8.696603 9.796173-13.894572 22.291292-14.394377 35.386177-0.299883 8.996486 1.599375 18.89262 8.596642 27.28934 6.897306 8.296759 17.293245 12.894963 27.989067 12.894963h0.299882l175.931277-1.199532 55.178446 422.834831 0.399844 3.098789 0.399844-3.098789 55.178446-422.834831 175.931277 1.199532h0.299882c10.795783 0 21.191722-4.598204 27.989067-12.894963 6.897306-8.39672 8.796564-18.292854 8.596642-27.28934-0.399844-13.094885-5.697774-25.590004-14.394377-35.386177l-61.87583-69.872706c-15.393987-17.393206-24.690355-39.284654-26.589613-62.475596l-20.292074-250.402187c-0.599766-7.796954 2.199141-15.593909 7.796955-21.091761l38.584927-38.584927c19.692308-16.693479 21.891449-33.58688 17.79305-47.581414-5.997657-19.992191-24.790316-33.58688-45.682155-33.58688z" p-id="6990"></path></svg>',Gt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763569611105" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="87406" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M840 192h-56v-72c0-13.3-10.7-24-24-24H168c-13.3 0-24 10.7-24 24v272c0 13.3 10.7 24 24 24h592c13.3 0 24-10.7 24-24V256h32v200H465c-22.1 0-40 17.9-40 40v136h-44c-4.4 0-8 3.6-8 8v228c0 0.6 0.1 1.3 0.2 1.9-0.1 2-0.2 4.1-0.2 6.1 0 46.4 37.6 84 84 84s84-37.6 84-84c0-2.1-0.1-4.1-0.2-6.1 0.1-0.6 0.2-1.2 0.2-1.9V640c0-4.4-3.6-8-8-8h-44V520h351c22.1 0 40-17.9 40-40V232c0-22.1-17.9-40-40-40zM720 352H208V160h512v192zM477 876c0 11-9 20-20 20s-20-9-20-20V696h40v180z" p-id="87407"></path></svg>',qt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763473363174" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="28322" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M957.610667 507.434667L603.221333 158.293333a7.893333 7.893333 0 0 0-11.221333 0L353.28 393.386667a8.021333 8.021333 0 0 0-0.085333 11.306666l0.085333 0.128 40.021333 39.381334-117.205333 115.285333a8.021333 8.021333 0 0 0-0.085333 11.306667l0.085333 0.128 39.509333 38.869333-189.098666 187.008H72.106667a8.106667 8.106667 0 0 0-8.106667 8.021333v55.168c0 4.394667 3.584 8.021333 8.021333 8.021334H416.853333c2.133333 0 4.096-0.810667 5.589334-2.304l76.117333-75.605334 40.405333 39.808a7.936 7.936 0 0 0 11.178667 0l117.12-115.626666 40.106667 39.509333a7.893333 7.893333 0 0 0 11.178666 0l238.72-235.178667a7.68 7.68 0 0 0 0.298667-11.221333z m-567.808 288.853333H229.546667l134.4-133.034667 80.128 78.933334-54.314667 54.058666z m154.794666-62.122667l-171.392-168.917333 68.608-67.584 171.392 168.874667-68.608 67.626666z m168.533334-76.117333l-262.826667-258.901333 147.285333-145.066667 262.826667 258.986667-147.328 144.981333z" fill="#999999" p-id="28323"></path></svg>',Yt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480451042" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="58395" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M938.666667 553.92V768c0 64.8-52.533333 117.333333-117.333334 117.333333H202.666667c-64.8 0-117.333333-52.533333-117.333334-117.333333V256c0-64.8 52.533333-117.333333 117.333334-117.333333h618.666666c64.8 0 117.333333 52.533333 117.333334 117.333333v297.92z m-64-74.624V256a53.333333 53.333333 0 0 0-53.333334-53.333333H202.666667a53.333333 53.333333 0 0 0-53.333334 53.333333v344.48A290.090667 290.090667 0 0 1 192 597.333333a286.88 286.88 0 0 1 183.296 65.845334C427.029333 528.384 556.906667 437.333333 704 437.333333c65.706667 0 126.997333 16.778667 170.666667 41.962667z m0 82.24c-5.333333-8.32-21.130667-21.653333-43.648-32.917333C796.768 511.488 753.045333 501.333333 704 501.333333c-121.770667 0-229.130667 76.266667-270.432 188.693334-2.730667 7.445333-7.402667 20.32-13.994667 38.581333-7.68 21.301333-34.453333 28.106667-51.370666 13.056-16.437333-14.634667-28.554667-25.066667-36.138667-31.146667A222.890667 222.890667 0 0 0 192 661.333333c-14.464 0-28.725333 1.365333-42.666667 4.053334V768a53.333333 53.333333 0 0 0 53.333334 53.333333h618.666666a53.333333 53.333333 0 0 0 53.333334-53.333333V561.525333zM320 480a96 96 0 1 1 0-192 96 96 0 0 1 0 192z m0-64a32 32 0 1 0 0-64 32 32 0 0 0 0 64z" fill="#000000" p-id="58396"></path></svg>',Kt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480387136" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="57289" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M213.972 214.906l0.934-0.934c27.606-27.606 68.674-30.581 92.168-7.087l225.23 225.23c29.72-40.254 30.733-93.311-0.599-124.643L345.639 121.406c-35.132-35.132-97.076-30.148-138.356 11.132l-74.744 74.744c-41.28 41.28-46.264 103.224-11.132 138.356l186.065 186.065c31.332 31.332 84.389 30.319 124.643 0.599l-225.23-225.23c-23.494-23.492-20.519-64.56 7.087-92.166zM808.745 809.679l0.934-0.934c27.606-27.606 31.18-68.074 7.686-91.568l-225.23-225.23c40.254-29.72 93.311-30.733 124.643 0.599l186.065 186.065c35.132 35.132 29.548 96.477-11.732 137.757l-74.744 74.744c-41.28 41.28-102.625 46.863-137.757 11.732L492.546 716.779c-31.332-31.332-31.909-82.799-0.599-124.643l225.23 225.23c23.494 23.494 63.962 19.92 91.568-7.687z" fill="#666666" p-id="57290"></path><path d="M627.123 628.713c-12.296 12.296-32.232 12.296-44.528 0L394.938 441.057c-12.296-12.296-12.296-32.232 0-44.528s32.232-12.296 44.528 0l187.656 187.656c12.297 12.296 12.297 32.232 0.001 44.528z" fill="#666666" p-id="57291"></path></svg>',Jt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763562537529" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="80294" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M107.5 736c28.6 0 52.2 7.1 70.2 21.4 18.5 15.1 27.9 36 27.9 61.7 0 22.9-8.4 41.3-24.7 54.1 16 12 29.6 32.8 29.6 57.3 0 27-9.7 49.7-28.8 67.2-19.6 17.5-45 26.3-75.6 26.3-29.2 0-53.4-7.8-71.7-23.3C14 983.6 2.4 958.4 0 926.1v-14.5h69.7V925c0.6 12.9 4.2 21.8 10.9 27.8 6.2 5.7 14.4 8.6 25.2 8.6 12.1 0 21.3-3.2 27.6-9.2 5.6-5.6 8.2-11.9 8.2-19.9 0-10-2.7-16.6-7.9-20.8-5.4-4.5-14.5-6.9-27.8-6.9H74.3v-58.9h31.5c11.6 0 19.8-2.2 24.5-6.1 4.1-3.5 6.3-9.2 6.3-17.4 0-8.3-2-13.9-5.3-17-4.6-3.9-12.3-6.1-23.5-6.1-11.5 0-19.3 2.5-24.8 7.4-5.5 4.8-8.9 12.8-10 23.7v13.4H5.1l-0.2-7v-8.2c2.4-29.1 13.4-52.1 32.7-68.2C55.8 744 79.3 736 107.5 736z m916.5 96v128H384V832h640zM106.9 368c28 0 51.7 8.4 70.5 25.1 18.8 17.1 28.2 39.1 28.2 65.8 0 25.4-9.7 48.8-28.8 70-10.4 11.1-27.9 24.8-55.3 43.2-10.1 6.6-18.5 12.9-25.2 18.7h109.3V656l-7.1 0.1-185.2-0.1c-4.5-0.6-7.5-1.6-9.8-3.8-2.4-2.4-3.2-5.6-3.5-10.4 0-29.7 9.6-55.5 28.8-77.1 10.3-11.8 30.6-28.1 61.1-49.1 14.4-10 25.7-19.2 32.4-26.3 8.9-10 13.2-20.3 13.2-30.8 0-9.8-2.3-16.6-6.4-20.4-4.5-4.1-12.2-6.3-23.6-6.3-11.3 0-18.8 3.4-24.1 10.6-5.7 7.3-9.2 19.8-9.9 37.7-0.5 3.9-1.6 6.8-3.8 9-2.1 2-4.8 3-10.4 4l-43-0.1c-4.2-0.8-7.1-1.9-9.2-4-2.2-2.3-3.2-5.3-3.7-10.3 0.4-32.1 9.9-58.3 28.6-78.2 19.6-21.6 45.5-32.5 76.9-32.5z m917.1 80v128H384V448h640zM146.6 0v288H75.1V94.2c-16.7 10.2-35.9 18.3-50.9 20.3l-8.2 1.6V46l4.8-2C39.3 37.3 52.5 31.7 60 27.6 71 20.9 82.1 11.7 96.3 0.1h50.3zM1024 64v128H384V64h640z" fill="#333333" p-id="80295"></path></svg>',Zt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480239307" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="56277" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M849.6 231v109.5c-46.4 14.9-84.6 41.5-114.4 81.3-29.9 36.5-44.8 76.3-43.1 116.1 8.3-5 21.6-6.6 41.5-6.6 34.8 0 64.7 11.6 91.2 36.5 23.2 24.9 36.5 56.4 36.5 94.5S848 732 821.5 756.8C795 780 761.8 793.3 722 793.3c-46.4 0-82.9-19.9-112.8-56.4s-43.1-84.6-43.1-141c0-89.6 24.9-165.8 76.3-230.5C692 299 761.7 254.2 849.6 231z m-403 0v109.5c-46.4 14.9-82.9 41.5-112.8 81.3-31.5 36.5-46.4 76.3-44.8 116.1 8.3-5 21.6-6.6 41.5-6.6 34.8 0 64.7 11.6 89.6 36.5 24.9 24.9 38.1 56.4 38.1 94.5s-13.3 69.7-38.1 94.5c-26.5 23.2-61.4 36.5-101.2 36.5-46.4 0-82.9-19.9-111.1-56.4-29.9-36.5-44.8-84.6-44.8-141 0-89.6 24.9-165.8 76.3-230.5C289 299 358.7 254.2 446.6 231z" p-id="56278"></path></svg>',Xt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480808376" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="61532" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M959.825 384.002V191.94c0-70.692-57.308-128-128-128H191.94c-70.692 0-128 57.308-128 128v639.885c0 70.692 57.308 128 128 128h639.885c70.692 0 128-57.308 128-128V384.002z m-813.16-237.337a63.738 63.738 0 0 1 45.336-18.785H832a63.962 63.962 0 0 1 63.886 64.121v128.061H127.88v-128.06a63.738 63.738 0 0 1 18.785-45.337z m269.127 461.308v-223.97h192.181v223.97H415.792z m192.181 63.94v223.972H415.792V671.914h192.181z m-256.121-63.94H127.88v-223.97h223.972v223.97zM146.665 877.21a63.467 63.467 0 0 1-18.785-45.21V671.914h223.972v223.97h-159.85a63.626 63.626 0 0 1-45.337-18.675z m749.22-45.21a63.763 63.763 0 0 1-63.886 63.886H671.914V671.914h223.97v160.085z m0-224.026H671.914v-223.97h223.97v223.97z" p-id="61533"></path></svg>',Qt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480994147" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="73821" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M933.529779 1022.701142H87.673207c-48.357498 0-87.523075-39.165577-87.523075-87.523076V1.798419h729.259049c48.357498 0 87.523075 39.165577 87.523076 87.523076v320.818031h204.220509V935.178066c-0.099912 48.357498-39.265489 87.523075-87.622987 87.523076z m-175.046151-904.205289c0-32.171724-26.077081-58.348717-58.348717-58.348717H58.498849v845.856572c0 32.171724 26.077081 58.348717 58.348717 58.348717h583.387257c32.171724 0 58.348717-26.077081 58.348717-58.348717V118.495853zM962.704137 468.588155h-145.871792v495.864182h87.523075c32.171724 0 58.348717-26.077081 58.348717-58.348717V468.588155z m-729.25905 0h379.166748v58.348717H233.445087V468.588155z m0-233.394868h379.166748v58.348717H233.445087v-58.348717z m262.569227 525.03854H233.445087v-58.348716h262.469314v58.348716z m0 0" p-id="73822"></path></svg>',eo='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763477549677" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="31202" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M828.6 75C889.572 75 939 124.428 939 185.4v676.2c0 60.972-49.428 110.4-110.4 110.4H152.4C91.428 972 42 922.572 42 861.6V185.4C42 124.428 91.428 75 152.4 75z m0 59.8H152.4c-27.946 0-50.6 22.654-50.6 50.6v676.2c0 27.946 22.654 50.6 50.6 50.6h676.2c27.946 0 50.6-22.654 50.6-50.6V185.4c0-27.946-22.654-50.6-50.6-50.6z m-20.56 167.48c11.48 11.504 11.641 30.022 0.502 41.725l-0.548 0.56L477.473 674.37c-11.251 11.227-29.274 11.663-41.05 1.123l-0.574-0.527L260.695 509.93c-12.018-11.325-12.581-30.248-1.257-42.266 11.145-11.828 29.65-12.56 41.69-1.788l0.577 0.53L455.756 611.56l310-309.325c11.689-11.664 30.62-11.644 42.284 0.045z" fill="#333333" p-id="31203"></path></svg>',to='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480631673" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="60480" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M960 192h-28.384c-16.8 0-32.928 6.624-44.928 18.432L800 295.936V256a96 96 0 0 0-96-96H96C43.072 160 0 203.04 0 256v512a96 96 0 0 0 96 96h608c52.992 0 96-43.008 96-96v-39.072l86.688 85.504c12 11.808 28.128 18.432 44.928 18.432H960a64 64 0 0 0 64-64V256a64 64 0 0 0-64-64zM96 800c-17.664 0-32-14.368-32-32V256a32 32 0 0 1 32-32h608c17.632 0 32 14.336 32 32v512c0 17.632-14.368 32-32 32H96z m864-31.136h-32l-128-128V640l-32-32v-192l160-160h32v512.864z" fill="#333333" p-id="60481"></path></svg>',oo=["innerHTML"],q=J(e.defineComponent({__name:"SvgIcon",props:{name:{},color:{default:"#000"},size:{}},setup(t){const c=t,r=e.useAttrs(),n=Object.assign({"/src/svg/alignCenter.svg":Ft,"/src/svg/alignJustify.svg":At,"/src/svg/alignLeft.svg":Ht,"/src/svg/alignRight.svg":Ut,"/src/svg/bulletList.svg":jt,"/src/svg/caretDown.svg":It,"/src/svg/clearFormat.svg":Ot,"/src/svg/code.svg":Wt,"/src/svg/codeBlock.svg":Rt,"/src/svg/fixed.svg":Pt,"/src/svg/formatBrush.svg":Gt,"/src/svg/highBg.svg":qt,"/src/svg/img.svg":Yt,"/src/svg/link.svg":Kt,"/src/svg/orderedList.svg":Jt,"/src/svg/quote.svg":Zt,"/src/svg/table.svg":Xt,"/src/svg/tableTools.svg":Qt,"/src/svg/task.svg":eo,"/src/svg/video.svg":to}),a=(()=>{const x={};return Object.entries(n).forEach(([m,E])=>{const k=(m.split("/src/svg/")[1]||m).replace(/\.svg$/i,"");x[k]=E;const d=k.split("/").pop();d&&(x[d]=E)}),x})(),i=e.computed(()=>{const x=c.name.replace(/\.svg$/i,"");return a[x]||""});function C(x){if(!x)return"";let m=x.replace(/<\?xml[\s\S]*?\?>/gi,"").replace(/<!DOCTYPE[\s\S]*?>/gi,"");return m=m.replace(/<svg([^>]*)>/i,(E,y)=>`<svg${y.replace(/\s(width|height)="[^"]*"/gi,"").replace(/\s(fill|stroke)="[^"]*"/gi,"")} width="1em" height="1em" preserveAspectRatio="xMidYMid meet" fill="currentColor" stroke="currentColor">`),m=m.replace(/fill="(?!none)[^"]*"/gi,'fill="currentColor"'),m=m.replace(/stroke="(?!none)[^"]*"/gi,'stroke="currentColor"'),m=m.replace(/fill='(?!none)[^']*'/gi,'fill="currentColor"'),m=m.replace(/stroke='(?!none)[^']*'/gi,'stroke="currentColor"'),m}const p=e.computed(()=>C(i.value));function f(x){if(x!=null)return typeof x=="number"?`${x}px`:x}const N=e.computed(()=>{const x={},m=f(c.size);m&&(x.fontSize=m),c.color&&(x.color=c.color);const E=r.style??void 0;return[x,E].filter(Boolean)});return(x,m)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["svg-icon",e.unref(r).class]),style:e.normalizeStyle(N.value),innerHTML:p.value},null,14,oo))}}),[["__scopeId","data-v-ee8563cd"]]),no=["aria-expanded"],ro={key:0,class:"dropdown"},io={class:"section"},lo={class:"swatches"},so={class:"section"},ao={class:"swatches"},co=["onClick"],fo={key:0,class:"check"},po={class:"section"},mo={class:"swatches grid"},uo=["onClick"],ho={key:0,class:"section"},go={class:"swatches"},ko=["onClick"],wo={class:"section inline-actions"},Co={key:1,class:"advanced"},be="md-toolbar-dropdown-open",Se="bg-color-select",yo=J(e.defineComponent({__name:"index",props:{editor:{},currentBg:{}},setup(t){const c=t,r=["#000000","#262626","#595959","#8C8C8C","#BFBFBF","#D9D9D9","#E9E9E9","#F5F5F5","#FFFFFF","#F5222D","#FA541C","#FA8C16","#FADB14","#52C41A","#13C2C2","#1677FF","#2F54EB","#722ED1","#EB2F96","#FF4D4F","#FF7A45","#FFA940","#FFD666","#73D13D","#36CFC9","#69C0FF","#85A5FF","#B37FEB","#F759AB"],n=e.ref(!1),a=e.ref(!1),i=e.ref(null),C=e.ref(c.currentBg||"#ffffff"),p=e.ref(g()),f=e.ref("#FADB14"),N=e.inject("theme");function x(){n.value||window.dispatchEvent(new CustomEvent(be,{detail:{id:Se}})),n.value=!n.value}function m(){n.value=!1}function E(){a.value=!a.value}function y(w){var M;(M=c.editor)==null||M.chain().focus().setMark("textStyle",{backgroundColor:w}).run(),f.value=w,h(w),m()}function k(){var w;(w=c.editor)==null||w.chain().focus().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run(),m()}function d(w){const M=w.target,S=i.value;S&&!S.contains(M)&&m()}function s(){}function g(){try{const w=localStorage.getItem("md_bg_recent");if(!w)return[];const M=JSON.parse(w);return Array.isArray(M)?M.slice(0,12):[]}catch{return[]}}function h(w){const M=[w,...p.value.filter(S=>S!==w)];p.value=M.slice(0,12);try{localStorage.setItem("md_bg_recent",JSON.stringify(p.value))}catch{}}let u=[];function B(){const w=c.editor;w&&(u=[{event:"selectionUpdate",handler:s},{event:"transaction",handler:s},{event:"update",handler:s}],u.forEach(({event:M,handler:S})=>{w.on(M,S)}))}e.onMounted(()=>{document.addEventListener("click",d),window.addEventListener(be,z),B()}),e.onBeforeUnmount(()=>{document.removeEventListener("click",d),window.removeEventListener(be,z);const w=c.editor;w&&u.forEach(({event:M,handler:S})=>{w.off(M,S)}),u=[]}),e.watch(()=>c.editor,(w,M)=>{M&&u.forEach(({event:S,handler:$})=>{M.off(S,$)}),u=[],B()});function z(w){var S;((S=w.detail)==null?void 0:S.id)!==Se&&(n.value=!1)}const v=e.computed(()=>f.value?f.value:N==="dark"?"#fff":"#000");return(w,M)=>(e.openBlock(),e.createElementBlock("div",{class:"bg-color-select-wrapper",ref_key:"rootRef",ref:i},[e.createElementVNode("div",{class:"icon icon-dropdown","aria-expanded":n.value},[e.createVNode(e.unref(U),{text:"背景色",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon-stack hoverable",onClick:M[0]||(M[0]=e.withModifiers(S=>y(f.value),["stop"]))},[e.createVNode(q,{name:"highBg",size:17,color:v.value},null,8,["color"]),e.createElementVNode("div",{class:"underline",style:e.normalizeStyle({background:f.value})},null,4)])]),_:1}),e.createVNode(e.unref(U),{text:"更多背景色",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"arrow hoverable",onClick:e.withModifiers(x,["stop"])},[e.createVNode(e.unref(ue),{theme:"filled",strokeWidth:3,size:"12"})])]),_:1})],8,no),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",ro,[e.createElementVNode("div",io,[M[4]||(M[4]=e.createElementVNode("div",{class:"section-title"},"无填充色",-1)),e.createElementVNode("div",lo,[e.createElementVNode("div",{class:"swatch",style:{background:`linear-gradient(
|
|
3
3
|
45deg,
|
|
4
4
|
#fff 45%,
|
|
5
5
|
transparent 45%,
|
|
6
6
|
transparent 55%,
|
|
7
7
|
#fff 55%
|
|
8
|
-
)`,border:"1px dashed #ccc"},onClick:e.withModifiers(k,["stop"])})])]),e.createElementVNode("div",so,[M[5]||(M[5]=e.createElementVNode("div",{class:"section-title"},"默认",-1)),e.createElementVNode("div",ao,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.slice(0,9),S=>(e.openBlock(),e.createElementBlock("div",{key:S,class:"swatch",style:e.normalizeStyle({background:S}),onClick:e.withModifiers($=>y(S),["stop"])},[S===f.value?(e.openBlock(),e.createElementBlock("span",fo,"✓")):e.createCommentVNode("",!0)],12,co))),128))])]),e.createElementVNode("div",po,[M[6]||(M[6]=e.createElementVNode("div",{class:"section-title"},"常用颜色",-1)),e.createElementVNode("div",mo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.slice(9),S=>(e.openBlock(),e.createElementBlock("div",{key:S,class:"swatch",style:e.normalizeStyle({background:S}),onClick:e.withModifiers($=>y(S),["stop"])},[S===f.value?(e.openBlock(),e.createBlock(e.unref(de),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,uo))),128))])]),p.value.length?(e.openBlock(),e.createElementBlock("div",ho,[M[7]||(M[7]=e.createElementVNode("div",{class:"section-title"},"最近使用自定义颜色",-1)),e.createElementVNode("div",go,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,S=>(e.openBlock(),e.createElementBlock("div",{key:S,class:"swatch",style:e.normalizeStyle({background:S}),onClick:e.withModifiers($=>y(S),["stop"])},null,12,ko))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",wo,[e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(k,["stop"])},"暂无"),e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(E,["stop"])},"更多颜色")]),a.value?(e.openBlock(),e.createElementBlock("div",Co,[e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":M[1]||(M[1]=S=>C.value=S)},null,512),[[e.vModelText,C.value]]),e.withDirectives(e.createElementVNode("input",{class:"hex","onUpdate:modelValue":M[2]||(M[2]=S=>C.value=S)},null,512),[[e.vModelText,C.value]]),e.createElementVNode("button",{class:"btn apply",onClick:M[3]||(M[3]=e.withModifiers(S=>y(C.value),["stop"]))},"应用")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-f414a9de"]]),xo={class:"image-actions"},bo=["aria-disabled","disabled"],Vo=J(e.defineComponent({__name:"index",props:{editor:{},imageUploader:{type:Function},uploadSizeLimit:{}},setup(t){const c=e.inject("theme"),r=t,n=e.ref(!1),a=e.ref(""),i=e.ref(!1),C=e.ref(null),p=()=>{n.value=!n.value},f=()=>{var d,s,g,h,u,B;const k=a.value.trim();k&&((B=(u=((h=(s=(d=r.editor)==null?void 0:d.chain)==null?void 0:(g=s.call(d)).focus)==null?void 0:h.call(g)).setImage({src:k})).run)==null||B.call(u),n.value=!1,a.value="")},N=k=>{k.key==="Enter"&&f(),k.key==="Escape"&&(n.value=!1,a.value="")},x=()=>{var k;r.imageUploader&&((k=C.value)==null||k.click())},m=async k=>{var h,u,B,z,v,w,M,S;const d=k.target,s=(h=d.files)==null?void 0:h[0];if(d.value="",!s||!r.imageUploader)return;const g=(u=r.uploadSizeLimit)==null?void 0:u.image;if(typeof g=="number"&&g>0){const $=Math.max(1,g)*1024*1024;if(s.size>$){try{window.alert(`图片文件大小超限(${(s.size/1024/1024).toFixed(2)}MB > ${g}MB)`)}catch{}return}}try{i.value=!0;let $=null;$=URL.createObjectURL(s),(S=(M=((w=(z=(B=r.editor)==null?void 0:B.chain)==null?void 0:(v=z.call(B)).focus)==null?void 0:w.call(v)).setImage({src:$,uploading:!0})).run)==null||S.call(M);const A=await r.imageUploader(s);if(typeof A=="string"&&A){const j=r.editor,{state:R}=j,{doc:W}=R;let Z=null;if(W.descendants((G,X)=>{var K,ne;return((K=G==null?void 0:G.type)==null?void 0:K.name)==="image"&&((ne=G==null?void 0:G.attrs)==null?void 0:ne.src)===$?(Z=X,!1):!0}),Z!=null){const G=W.nodeAt(Z),X=R.schema.nodes.image;if(G&&X){const K={...G.attrs||{},src:A,uploading:null},ne=R.tr.setNodeMarkup(Z,X,K,G.marks);j.view.dispatch(ne)}}n.value=!1,a.value=""}}finally{i.value=!1;try{objectUrl&&URL.revokeObjectURL(objectUrl)}catch{}}},E=e.ref(null);let y=null;return e.onMounted(()=>{y=k=>{if(!n.value)return;const d=E.value,s=k.target;d&&s&&!d.contains(s)&&(n.value=!1)},document.addEventListener("mousedown",y,!0)}),e.onBeforeUnmount(()=>{y&&(document.removeEventListener("mousedown",y,!0),y=null)}),(k,d)=>(e.openBlock(),e.createElementBlock("div",{class:"icon image-icon",onClick:p,ref_key:"rootRef",ref:E},[e.createVNode(e.unref(U),{text:"图片",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"img",size:18,color:e.unref(c)==="light"&&"#fff"},null,8,["color"])]),_:1}),e.createVNode(e.Transition,{name:"img-panel",appear:""},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"image-input-panel",onClick:d[1]||(d[1]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{class:"image-input",type:"text",placeholder:"粘贴图片链接(png/jpg/webp/svg 等)","onUpdate:modelValue":d[0]||(d[0]=s=>a.value=s),onKeydown:N},null,544),[[e.vModelText,a.value]]),e.createElementVNode("input",{ref_key:"imageUploadInput",ref:C,type:"file",accept:"image/*",style:{display:"none"},onChange:m},null,544),e.createElementVNode("div",xo,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(f,["stop"])},"插入"),e.createElementVNode("button",{class:"btn","aria-disabled":!r.imageUploader||i.value,disabled:!r.imageUploader||i.value,onClick:e.withModifiers(x,["stop"])},e.toDisplayString(i.value?"上传中…":"上传文件"),9,bo)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-6df6e55c"]]),_o={class:"video-actions"},Eo=["aria-disabled","disabled"],No=J(e.defineComponent({__name:"index",props:{editor:{},videoUploader:{type:Function},uploadSizeLimit:{}},setup(t){const c=e.inject("theme"),r=t,n=e.ref(!1),a=e.ref(""),i=e.ref(!1),C=e.ref(null),p=()=>{n.value=!n.value},f=()=>{const d=a.value.trim();if(!d)return;const s=r.editor,g=s==null?void 0:s.commands;if(/youtube\.com|youtu\.be|youtube-nocookie\.com/i.test(d)){const u=String(d).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");try{s.chain().focus().insertContent(`<p><a href="${u}" target="_blank" rel="noopener noreferrer">${u}</a></p>`).run()}catch{s.chain().focus().insertContent(u).run()}}else if(typeof(g==null?void 0:g.setVideo)=="function")s.chain().focus().setVideo({src:d,HTMLAttributes:{controls:!0,width:640}}).run();else{const u=String(d).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");try{s.chain().focus().insertContent(`<p><a href="${u}" target="_blank" rel="noopener noreferrer">${u}</a></p>`).run()}catch{s.chain().focus().insertContent(u).run()}}n.value=!1,a.value=""},N=d=>{d.key==="Enter"&&f(),d.key==="Escape"&&(n.value=!1,a.value="")},x=()=>{var d;r.videoUploader&&((d=C.value)==null||d.click())},m=async d=>{var B,z;const s=d.target,g=(B=s.files)==null?void 0:B[0];if(s.value="",!g||!r.videoUploader)return;const h=(z=r.uploadSizeLimit)==null?void 0:z.video;if(typeof h=="number"&&h>0){const v=Math.max(1,h)*1024*1024;if(g.size>v){try{window.alert(`视频文件大小超限(${(g.size/1024/1024).toFixed(2)}MB > ${h}MB)`)}catch{}return}}let u=null;try{i.value=!0;const v=r.editor,w=v==null?void 0:v.commands;u=URL.createObjectURL(g);try{if(typeof(w==null?void 0:w.setVideo)=="function")v.chain().focus().setVideo({src:u,HTMLAttributes:{controls:!0,width:640,uploading:!0}}).run();else{const S=String(u).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");try{v.chain().focus().insertContent(`<p><a href="${S}" target="_blank" rel="noopener noreferrer">${S}</a></p>`).run()}catch{v.chain().focus().insertContent(S).run()}}}catch{}const M=await r.videoUploader(g);u&&E(u,M),n.value=!1,a.value=""}finally{i.value=!1;try{u&&URL.revokeObjectURL(u)}catch{}}};function E(d,s){const g=r.editor;if(!g)return;const{state:h}=g,{doc:u}=h;let B=null;if(u.descendants((z,v)=>{var w,M;return((w=z.type)==null?void 0:w.name)==="video"&&((M=z.attrs)==null?void 0:M.src)===d?(B=v,!1):!0}),B!=null){const z=u.nodeAt(B),v=h.schema.nodes.video;if(!z||!v)return;const w={...z.attrs||{},src:s,uploading:null},M=h.tr.setNodeMarkup(B,v,w,z.marks);g.view.dispatch(M)}}const y=e.ref(null);let k=null;return e.onMounted(()=>{k=d=>{if(!n.value)return;const s=y.value,g=d.target;s&&g&&!s.contains(g)&&(n.value=!1)},document.addEventListener("mousedown",k,!0)}),e.onBeforeUnmount(()=>{k&&(document.removeEventListener("mousedown",k,!0),k=null)}),(d,s)=>(e.openBlock(),e.createElementBlock("div",{class:"icon video-icon",onClick:p,ref_key:"rootRef",ref:y},[e.createVNode(e.unref(U),{text:"视频",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"video",size:16,color:e.unref(c)==="light"&&"#fff"},null,8,["color"])]),_:1}),e.createVNode(e.Transition,{name:"video-panel",appear:""},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"video-input-panel",onClick:s[1]||(s[1]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{class:"video-input",type:"text",placeholder:"粘贴视频链接(mp4/webm/m3u8等)","onUpdate:modelValue":s[0]||(s[0]=g=>a.value=g),onKeydown:N},null,544),[[e.vModelText,a.value]]),e.createElementVNode("input",{ref_key:"videoUploadInput",ref:C,type:"file",accept:"video/*,application/x-mpegURL",style:{display:"none"},onChange:m},null,544),e.createElementVNode("div",_o,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(f,["stop"])},"插入"),e.createElementVNode("button",{class:"btn","aria-disabled":!r.videoUploader||i.value,disabled:!r.videoUploader||i.value,onClick:e.withModifiers(x,["stop"])},e.toDisplayString(i.value?"上传中…":"上传文件"),9,Eo)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-9d5e9345"]]),vo={class:"fr-header"},Mo={key:0,class:"fr-body"},Bo={class:"fr-input-row"},Lo=["value"],zo={key:0,class:"fr-count"},So={class:"fr-actions"},$o={key:1,class:"fr-body"},To={class:"fr-input-row"},Do=["value"],Fo={key:0,class:"fr-count"},Ao={class:"fr-actions"},Ho=J(e.defineComponent({__name:"index",props:{editor:{}},setup(t,{expose:c}){const r=t,n=e.ref(!1),a=e.ref("find"),i=e.ref(""),C=e.ref(""),p=e.ref([]),f=e.ref(0),N=e.computed(()=>{const $=p.value.length;return!i.value||!$?"0/0":`${Math.min(Math.max(f.value+1,1),$)}/${$}`}),x=typeof navigator<"u"&&navigator.platform.includes("Mac"),m=e.computed(()=>x?"⌘ F / ⌥ ⌘ F":"Ctrl F / Ctrl H"),E=()=>n.value=!n.value,y=()=>n.value=!1;function k(){var $;return(($=r.editor)==null?void 0:$.view)||null}function d(){const $=k(),A=i.value;if(p.value=[],f.value=0,!$||!A)return;const j=$.dom,R=document.createTreeWalker(j,NodeFilter.SHOW_TEXT,null);let W;for(;W=R.nextNode();){const Z=W,G=Z.data||"";let X=0;for(;;){const K=G.indexOf(A,X);if(K===-1)break;const ne=$.posAtDOM(Z,K),re=$.posAtDOM(Z,K+A.length);typeof ne=="number"&&typeof re=="number"&&p.value.push({from:ne,to:re}),X=K+A.length}}e.nextTick(()=>{p.value.length&&s(0)})}function s($){const A=r.editor,j=k();if(!A||!j||!p.value.length)return;const R=p.value.length;f.value=($%R+R)%R;const W=p.value[f.value];A.chain().focus().setTextSelection({from:W.from,to:W.to}).run()}const g=()=>p.value.length&&s(f.value+1),h=()=>p.value.length&&s(f.value-1);function u(){const $=r.editor;if(!$||!p.value.length)return;const A=p.value[f.value],j=$.state.tr.insertText(C.value,A.from,A.to);$.view.dispatch(j),d()}function B(){const $=r.editor;if(!$||!p.value.length)return;const A=[...p.value],j=$.state.tr;for(let R=A.length-1;R>=0;R--){const W=A[R];j.insertText(C.value,W.from,W.to)}$.view.dispatch(j),d()}function z($){i.value=$.target.value,d()}function v($){$.key==="Enter"&&g(),$.key==="Escape"&&y()}const w=e.ref(null);let M=null;e.onMounted(()=>{M=$=>{if(!n.value)return;const A=w.value,j=$.target;A&&j&&!A.contains(j)&&y()},document.addEventListener("mousedown",M,!0)}),e.onBeforeUnmount(()=>{M&&(document.removeEventListener("mousedown",M,!0),M=null)});function S($){$&&(a.value=$),n.value=!0,e.nextTick(d)}return c({openPanel:S}),($,A)=>(e.openBlock(),e.createElementBlock("div",{class:"icon find-icon",ref_key:"rootRef",ref:w,onClick:E},[e.createVNode(e.unref(U),{text:"查找替换",shortcut:m.value,placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(at),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"]),e.createVNode(e.Transition,{name:"find-panel",appear:""},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"find-input-panel",onClick:A[3]||(A[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",vo,[e.createElementVNode("button",{class:e.normalizeClass(["fr-tab",{active:a.value==="find"}]),onClick:A[0]||(A[0]=e.withModifiers(j=>a.value="find",["stop"]))}," 查找 ",2),e.createElementVNode("button",{class:e.normalizeClass(["fr-tab",{active:a.value==="replace"}]),onClick:A[1]||(A[1]=e.withModifiers(j=>a.value="replace",["stop"]))}," 替换 ",2)]),a.value==="find"?(e.openBlock(),e.createElementBlock("div",Mo,[A[4]||(A[4]=e.createElementVNode("label",{class:"fr-label"},"查找",-1)),e.createElementVNode("div",Bo,[e.createElementVNode("input",{class:"fr-input",value:i.value,placeholder:"输入关键字",onInput:z,onKeydown:v},null,40,Lo),i.value?(e.openBlock(),e.createElementBlock("span",zo,e.toDisplayString(N.value),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",So,[e.createElementVNode("button",{class:"fr-btn",onClick:e.withModifiers(h,["stop"])},"上一个"),e.createElementVNode("button",{class:"fr-btn primary",onClick:e.withModifiers(g,["stop"])},"下一个")])])):(e.openBlock(),e.createElementBlock("div",$o,[A[5]||(A[5]=e.createElementVNode("label",{class:"fr-label"},"查找",-1)),e.createElementVNode("div",To,[e.createElementVNode("input",{class:"fr-input",value:i.value,placeholder:"输入关键字",onInput:z},null,40,Do),i.value?(e.openBlock(),e.createElementBlock("span",Fo,e.toDisplayString(N.value),1)):e.createCommentVNode("",!0)]),A[6]||(A[6]=e.createElementVNode("label",{class:"fr-label"},"替换为",-1)),e.withDirectives(e.createElementVNode("input",{class:"fr-input",style:{width:"95%"},"onUpdate:modelValue":A[2]||(A[2]=j=>C.value=j),placeholder:"请输入"},null,512),[[e.vModelText,C.value]]),e.createElementVNode("div",Ao,[e.createElementVNode("button",{class:"fr-btn",onClick:e.withModifiers(B,["stop"])},"全部替换"),e.createElementVNode("button",{class:"fr-btn",onClick:e.withModifiers(u,["stop"])},"替换"),e.createElementVNode("button",{class:"fr-btn",onClick:e.withModifiers(h,["stop"])},"上一个"),e.createElementVNode("button",{class:"fr-btn primary",onClick:e.withModifiers(g,["stop"])},"下一个")])]))])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-8c079e6d"]]),Uo={class:"field"},jo={class:"field"},Io={class:"actions"},Oo=J(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=e.ref(!1),n=e.ref(""),a=e.ref("");e.ref(!1);const i=e.ref(null),C=e.inject("theme");function p(){const d=c.editor;if(!r.value&&d)try{const s=d.state.selection,g=s.from;s.to>g?N():(n.value="链接",d.chain().focus().insertContent("链接").setTextSelection({from:g,to:g+2}).run())}catch{}r.value=!r.value,r.value&&f()}function f(){setTimeout(()=>{var s;const d=(s=i.value)==null?void 0:s.querySelector('input[name="link-text"]');d==null||d.focus(),d==null||d.select()},0)}function N(){const d=c.editor;if(d)try{const s=d.state.selection,g=s.from,h=s.to,B=h>g?d.state.doc.textBetween(g,h):"";n.value=B||"";const z=d.getAttributes("link")||{};a.value=typeof z.href=="string"?z.href:""}catch{}}function x(){const d=c.editor;if(!d)return;const s=n.value.trim(),g=a.value.trim();if(g)try{const h=d.state.selection,u=h.from,B=h.to;if(B>u){const v=m(s||d.state.doc.textBetween(u,B)),w=m(g);d.chain().focus().insertContent(`<a href="${w}" target="_blank" rel="noopener noreferrer">${v}</a>`,{from:u,to:B}).run()}else{const v=m(g),w=m(s||g);d.chain().focus().insertContent(`<a href="${v}" target="_blank" rel="noopener noreferrer">${w}</a>`).run()}}finally{r.value=!1,n.value="",a.value=""}}function m(d){return String(d).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function E(d){d.key==="Enter"&&x(),d.key==="Escape"&&(r.value=!1)}let y=null;e.onMounted(()=>{y=d=>{if(!r.value)return;const s=i.value,g=d.target;s&&g&&!s.contains(g)&&(r.value=!1)},document.addEventListener("mousedown",y,!0)}),e.onBeforeUnmount(()=>{y&&(document.removeEventListener("mousedown",y,!0),y=null)});const k=e.ref({});return e.watch(r,async d=>{var g;if(!d)return;const s=c.editor;if(s){await e.nextTick();try{const h=s.state.selection,u=h.from,B=h.to;if(!(B>u)){k.value={};return}const v=s.view.coordsAtPos(u),w=s.view.coordsAtPos(B),M=(v.left+w.right)/2,S=Math.max(v.bottom,w.bottom)+8,$=(g=i.value)==null?void 0:g.querySelector(".link-input-panel"),A=$?$.getBoundingClientRect():{width:320,height:120},j=window.innerWidth,R=window.innerHeight,W=12,Z=Math.max(W+A.width/2,Math.min(j-W-A.width/2,M)),G=S,X=Math.min(v.top,w.top)-A.height-8;let K=G;G+A.height+W>R&&X-W>=0&&(K=X),K=Math.max(W,Math.min(R-W-A.height,K)),k.value={position:"fixed",left:Math.round(Z)+"px",top:Math.round(K)+"px"}}catch{}}}),(d,s)=>(e.openBlock(),e.createElementBlock("div",{class:"icon link-icon",onClick:p,ref_key:"rootRef",ref:i},[e.createVNode(e.unref(U),{text:"链接",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"link",size:16,color:e.unref(C)==="light"&&"#fff"},null,8,["color"])]),_:1}),e.createVNode(e.Transition,{name:"link-panel",appear:""},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"link-input-panel",style:e.normalizeStyle(k.value),onClick:s[2]||(s[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Uo,[s[3]||(s[3]=e.createElementVNode("div",{class:"label"},"文本",-1)),e.withDirectives(e.createElementVNode("input",{name:"link-text",class:"input",type:"text","onUpdate:modelValue":s[0]||(s[0]=g=>n.value=g),onKeydown:E},null,544),[[e.vModelText,n.value]])]),e.createElementVNode("div",jo,[s[4]||(s[4]=e.createElementVNode("div",{class:"label"},"链接",-1)),e.withDirectives(e.createElementVNode("input",{name:"link-href",class:"input",type:"text","onUpdate:modelValue":s[1]||(s[1]=g=>a.value=g),placeholder:"链接地址",onKeydown:E},null,544),[[e.vModelText,a.value]])]),e.createElementVNode("div",Io,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(x,["stop"])},"确 定")])],4)):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-5344936c"]]),Wo={class:"grid"},Ro=["onMouseenter"],Po={class:"size"},Go=10,qo=10,Yo=J(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=e.inject("theme"),n=e.ref(!1),a=e.ref(0),i=e.ref(0),C=e.computed(()=>{const x=Math.max(a.value,1),m=Math.max(i.value,1);return`${x} x ${m}`}),p=()=>{n.value=!n.value,n.value||(a.value=0,i.value=0)},f=(x,m)=>{a.value=x,i.value=m},N=()=>{var E,y,k,d,s,g,h,u;const x=Math.max(a.value,1),m=Math.max(i.value,1);(u=(g=(d=(y=(E=c.editor)==null?void 0:E.chain)==null?void 0:(k=y.call(E)).focus)==null?void 0:(s=d.call(k)).insertTable)==null?void 0:(h=g.call(s,{rows:x,cols:m,withHeaderRow:!0})).run)==null||u.call(h),n.value=!1,a.value=0,i.value=0};return(x,m)=>(e.openBlock(),e.createElementBlock("div",{class:"icon table-icon",onClick:p},[e.createVNode(e.unref(U),{text:"表格",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"table",size:16,color:e.unref(r)==="light"&&"#fff"},null,8,["color"])]),_:1}),n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"table-panel",onClick:m[0]||(m[0]=e.withModifiers(()=>{},["stop"]))},[m[1]||(m[1]=e.createElementVNode("div",{class:"panel-title"},"表格",-1)),e.createElementVNode("div",Wo,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(Go,E=>e.createElementVNode("div",{key:"r-"+E,class:"row"},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(qo,y=>e.createElementVNode("span",{key:"c-"+E+"-"+y,class:e.normalizeClass(["cell",{active:E<=a.value&&y<=i.value}]),onMouseenter:k=>f(E,y),onClick:e.withModifiers(N,["stop"])},null,42,Ro)),64))])),64))]),e.createElementVNode("div",Po,e.toDisplayString(C.value),1)])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-7e1c834b"]]),Ko=["aria-disabled"],Jo={class:"tools-grid"},Zo=["disabled"],Xo=["disabled"],Qo=["disabled"],en=["disabled"],tn=["disabled"],on=["disabled"],nn=["disabled"],rn=["disabled"],ln=["disabled"],sn=["disabled"],an=["disabled"],cn=["disabled"],dn=["disabled"],fn=["disabled"],pn=["disabled"],mn=["disabled"],un=["disabled"],hn=J(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=e.ref(!1),n=e.inject("theme"),a=()=>r.value=!r.value,i=(p,...f)=>{var x,m,E;const N=c.editor;return!!((E=(x=N==null?void 0:N.can)==null?void 0:(m=x.call(N))[p])!=null&&E.call(m,...f))},C=(p,...f)=>{var x,m,E,y,k,d,s;const N=c.editor;(s=(d=(k=(y=(E=(x=N==null?void 0:N.chain)==null?void 0:(m=x.call(N)).focus)==null?void 0:E.call(m))[p])==null?void 0:k.call(y,...f))==null?void 0:d.run)==null||s.call(d),r.value=!1};return(p,f)=>{var N,x;return e.openBlock(),e.createElementBlock("div",{class:"icon table-tools",onClick:a,"aria-disabled":!((x=(N=c.editor)==null?void 0:N.isActive)!=null&&x.call(N,"table"))},[e.createVNode(e.unref(U),{text:"表格工具",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"tableTools",size:15,color:e.unref(n)==="light"&&"#fff"},null,8,["color"])]),_:1}),r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"tools-panel",onClick:f[17]||(f[17]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Jo,[e.createElementVNode("button",{class:"btn",onClick:f[0]||(f[0]=e.withModifiers(m=>C("addColumnBefore"),["stop"])),disabled:!i("addColumnBefore")}," 前插列 ",8,Zo),e.createElementVNode("button",{class:"btn",onClick:f[1]||(f[1]=e.withModifiers(m=>C("addColumnAfter"),["stop"])),disabled:!i("addColumnAfter")}," 后插列 ",8,Xo),e.createElementVNode("button",{class:"btn",onClick:f[2]||(f[2]=e.withModifiers(m=>C("deleteColumn"),["stop"])),disabled:!i("deleteColumn")}," 删除列 ",8,Qo),e.createElementVNode("button",{class:"btn",onClick:f[3]||(f[3]=e.withModifiers(m=>C("addRowBefore"),["stop"])),disabled:!i("addRowBefore")}," 前插行 ",8,en),e.createElementVNode("button",{class:"btn",onClick:f[4]||(f[4]=e.withModifiers(m=>C("addRowAfter"),["stop"])),disabled:!i("addRowAfter")}," 后插行 ",8,tn),e.createElementVNode("button",{class:"btn",onClick:f[5]||(f[5]=e.withModifiers(m=>C("deleteRow"),["stop"])),disabled:!i("deleteRow")}," 删除行 ",8,on),e.createElementVNode("button",{class:"btn",onClick:f[6]||(f[6]=e.withModifiers(m=>C("deleteTable"),["stop"])),disabled:!i("deleteTable")}," 删除表 ",8,nn),e.createElementVNode("button",{class:"btn",onClick:f[7]||(f[7]=e.withModifiers(m=>C("mergeCells"),["stop"])),disabled:!i("mergeCells")}," 合并单元格 ",8,rn),e.createElementVNode("button",{class:"btn",onClick:f[8]||(f[8]=e.withModifiers(m=>C("splitCell"),["stop"])),disabled:!i("splitCell")}," 拆分单元格 ",8,ln),e.createElementVNode("button",{class:"btn",onClick:f[9]||(f[9]=e.withModifiers(m=>C("mergeOrSplit"),["stop"])),disabled:!i("mergeOrSplit")}," 合并/拆分 ",8,sn),e.createElementVNode("button",{class:"btn",onClick:f[10]||(f[10]=e.withModifiers(m=>C("toggleHeaderRow"),["stop"])),disabled:!i("toggleHeaderRow")}," 切换表头行 ",8,an),e.createElementVNode("button",{class:"btn",onClick:f[11]||(f[11]=e.withModifiers(m=>C("toggleHeaderColumn"),["stop"])),disabled:!i("toggleHeaderColumn")}," 切换表头列 ",8,cn),e.createElementVNode("button",{class:"btn",onClick:f[12]||(f[12]=e.withModifiers(m=>C("toggleHeaderCell"),["stop"])),disabled:!i("toggleHeaderCell")}," 切换表头单元 ",8,dn),e.createElementVNode("button",{class:"btn",onClick:f[13]||(f[13]=e.withModifiers(m=>C("fixTables"),["stop"])),disabled:!i("fixTables")}," 修复表格 ",8,fn),e.createElementVNode("button",{class:"btn",onClick:f[14]||(f[14]=e.withModifiers(m=>C("goToNextCell"),["stop"])),disabled:!i("goToNextCell")}," 下个单元格 ",8,pn),e.createElementVNode("button",{class:"btn",onClick:f[15]||(f[15]=e.withModifiers(m=>C("goToPreviousCell"),["stop"])),disabled:!i("goToPreviousCell")}," 上个单元格 ",8,mn),e.createElementVNode("button",{class:"btn",onClick:f[16]||(f[16]=e.withModifiers(m=>C("setCellAttribute","backgroundColor","#FAF594"),["stop"])),disabled:!i("setCellAttribute","backgroundColor","#FAF594")}," 单元格着色 ",8,un)])])):e.createCommentVNode("",!0)],8,Ko)}}}),[["__scopeId","data-v-1b49653a"]]),gn=J(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=e.inject("theme"),a=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⇧ ⌘ 9":"Ctrl Shift 9";function i(){const C=c.editor;if(C){C.chain().focus().toggleTaskList().run();try{const{state:p}=C,f=p.selection;let N=null;p.doc.nodesBetween(Math.max(0,f.from-5),Math.min(p.doc.content.size,f.to+5),(x,m)=>{var E;return((E=x==null?void 0:x.type)==null?void 0:E.name)==="taskItem"&&N==null?(N=m,!1):!0}),N!=null&&C.commands.setTextSelection(N+1)}catch{}}}return(C,p)=>(e.openBlock(),e.createElementBlock("div",{class:"icon",onClick:i},[e.createVNode(e.unref(U),{text:"任务列表",shortcut:e.unref(a),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"task",size:17,color:e.unref(r)==="light"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])]))}}),[["__scopeId","data-v-340a85d5"]]),kn=J(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=e.inject("theme");function n(){const a=c.editor;a&&a.chain().focus().toggleBlockquote().run()}return(a,i)=>(e.openBlock(),e.createElementBlock("div",{class:"icon",onClick:n},[e.createVNode(e.unref(U),{text:"引用",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"quote",size:18,color:e.unref(r)==="light"&&"#fff"},null,8,["color"])]),_:1})]))}}),[["__scopeId","data-v-c8360e84"]]),wn=["aria-expanded"],Cn={class:"label"},yn={key:0,class:"dropdown",role:"listbox"},xn=["aria-selected","onClick"],bn={class:"shortcut"},Ve="md-toolbar-dropdown-open",$e="heading-select",Vn=J(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=typeof navigator<"u"&&navigator.platform.includes("Mac"),n={0:r?"⌥ ⌘ 0":"Ctrl Alt 0",1:r?"⌥ ⌘ 1":"Ctrl Alt 1",2:r?"⌥ ⌘ 2":"Ctrl Alt 2",3:r?"⌥ ⌘ 3":"Ctrl Alt 3",4:r?"⌥ ⌘ 4":"Ctrl Alt 4",5:r?"⌥ ⌘ 5":"Ctrl Alt 5",6:r?"⌥ ⌘ 6":"Ctrl Alt 6"},a=[{label:"正文",level:null,shortcut:n[0]},{label:"标题1",level:1,shortcut:n[1]},{label:"标题2",level:2,shortcut:n[2]},{label:"标题3",level:3,shortcut:n[3]},{label:"标题4",level:4,shortcut:n[4]},{label:"标题5",level:5,shortcut:n[5]},{label:"标题6",level:6,shortcut:n[6]}],i=e.computed(()=>{var d,s;const k=c.editor;if(!k)return null;for(let g=1;g<=6;g++)if((d=k.isActive)!=null&&d.call(k,"heading",{level:g}))return g;return(s=k.isActive)!=null&&s.call(k,"paragraph"),null}),C=e.computed(()=>{const k=i.value;return k?`标题${k}`:"正文"}),p=e.ref(!1),f=e.ref(null);function N(){p.value||window.dispatchEvent(new CustomEvent(Ve,{detail:{id:$e}})),p.value=!p.value}function x(){p.value=!1}function m(k){var s,g,h,u,B,z,v,w,M,S;const d=(u=(g=(s=c.editor)==null?void 0:s.chain)==null?void 0:(h=g.call(s)).focus)==null?void 0:u.call(h);d&&(k.level===null?(v=(B=d.setParagraph)==null?void 0:(z=B.call(d)).run)==null||v.call(z):(S=(M=(w=d.toggleHeading)==null?void 0:w.call(d,{level:k.level}))==null?void 0:M.run)==null||S.call(M),x())}function E(k){const d=k.target,s=f.value;s&&!s.contains(d)&&x()}function y(k){var s;((s=k.detail)==null?void 0:s.id)!==$e&&(p.value=!1)}return e.onMounted(()=>{document.addEventListener("click",E),window.addEventListener(Ve,y)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",E),window.removeEventListener(Ve,y)}),(k,d)=>(e.openBlock(),e.createElementBlock("div",{class:"heading-select",ref_key:"rootRef",ref:f},[e.createVNode(e.unref(U),{text:"标题级别",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon",onClick:e.withModifiers(N,["stop"]),"aria-expanded":p.value},[e.createElementVNode("div",Cn,e.toDisplayString(C.value),1),e.createVNode(e.unref(ue),{theme:"filled",strokeWidth:3})],8,wn)]),_:1}),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[p.value?(e.openBlock(),e.createElementBlock("div",yn,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(a,s=>e.createElementVNode("div",{key:s.label,class:"dropdown-item","aria-selected":s.level===i.value,onClick:e.withModifiers(g=>m(s),["stop"])},[s.level===i.value?(e.openBlock(),e.createBlock(e.unref(de),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["item-label",{paragraph:s.level===null,"level-1":s.level===1,"level-2":s.level===2,"level-3":s.level===3,"level-4":s.level===4,"level-5":s.level===5,"level-6":s.level===6}])},e.toDisplayString(s.label),3),e.createElementVNode("span",bn,e.toDisplayString(s.shortcut),1)],8,xn)),64))])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-b93823aa"]]),_n=["aria-expanded"],En={key:0,class:"dropdown",role:"menu"},Nn={class:"options"},_e="md-toolbar-dropdown-open",Te="align-select",vn=J(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=e.inject("theme"),n=e.computed(()=>{var u,B,z,v;const h=c.editor;return!h||(u=h.isActive)!=null&&u.call(h,{textAlign:"left"})?"left":(B=h.isActive)!=null&&B.call(h,{textAlign:"center"})?"center":(z=h.isActive)!=null&&z.call(h,{textAlign:"right"})?"right":(v=h.isActive)!=null&&v.call(h,{textAlign:"justify"})?"justify":"left"}),a=e.computed(()=>({left:"alignLeft",center:"alignCenter",right:"alignRight",justify:"alignJustify"})[n.value]);function i(h){var u,B,z,v,w,M,S,$;($=(M=(v=(B=(u=c.editor)==null?void 0:u.chain)==null?void 0:(z=B.call(u)).focus)==null?void 0:(w=v.call(z)).setTextAlign)==null?void 0:(S=M.call(w,h)).run)==null||$.call(S)}const C=e.ref(!1),p=e.ref(null),f=typeof navigator<"u"&&navigator.platform.includes("Mac"),N=f?"⇧ ⌘ L":"Ctrl Shift L",x=f?"⇧ ⌘ E":"Ctrl Shift E",m=f?"⇧ ⌘ R":"Ctrl Shift R",E=f?"⇧ ⌘ J":"Ctrl Shift J";function y(){C.value||window.dispatchEvent(new CustomEvent(_e,{detail:{id:Te}})),C.value=!C.value}function k(){C.value=!1}function d(h){i(h),k()}function s(h){const u=p.value,B=h.target;u&&!u.contains(B)&&k()}function g(h){var B;((B=h.detail)==null?void 0:B.id)!==Te&&(C.value=!1)}return e.onMounted(()=>{document.addEventListener("click",s),window.addEventListener(_e,g)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",s),window.removeEventListener(_e,g)}),(h,u)=>(e.openBlock(),e.createElementBlock("div",{class:"align-select",ref_key:"rootRef",ref:p},[e.createVNode(e.unref(U),{text:"对齐方式",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon_box",onClick:e.withModifiers(y,["stop"]),"aria-expanded":C.value},[e.createVNode(q,{name:a.value,size:18,color:e.unref(r)==="light"&&"#fff"},null,8,["name","color"]),e.createVNode(q,{name:"caretDown",size:12,color:e.unref(r)==="light"&&"#fff"},null,8,["color"])],8,_n)]),_:1}),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[C.value?(e.openBlock(),e.createElementBlock("div",En,[e.createElementVNode("div",Nn,[e.createElementVNode("div",{class:e.normalizeClass(["option",{active:n.value==="left"}]),role:"menuitem",onClick:u[0]||(u[0]=e.withModifiers(B=>d("left"),["stop"]))},[e.createVNode(e.unref(U),{text:"左对齐",shortcut:e.unref(N),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"alignLeft",size:16,color:e.unref(r)==="light"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["option",{active:n.value==="center"}]),role:"menuitem",onClick:u[1]||(u[1]=e.withModifiers(B=>d("center"),["stop"]))},[e.createVNode(e.unref(U),{text:"居中对齐",shortcut:e.unref(x),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"alignCenter",size:16,color:e.unref(r)==="light"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["option",{active:n.value==="right"}]),role:"menuitem",onClick:u[2]||(u[2]=e.withModifiers(B=>d("right"),["stop"]))},[e.createVNode(e.unref(U),{text:"右对齐",shortcut:e.unref(m),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"alignRight",size:16,color:e.unref(r)==="light"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["option",{active:n.value==="justify"}]),role:"menuitem",onClick:u[3]||(u[3]=e.withModifiers(B=>d("justify"),["stop"]))},[e.createVNode(e.unref(U),{text:"两端对齐",shortcut:e.unref(E),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"alignJustify",size:16,color:e.unref(r)==="light"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-ba0ceb75"]]),Mn=["aria-disabled"],Bn=["aria-disabled"],Ln=J(e.defineComponent({__name:"index",props:{editor:{},currentColor:{},videoUploader:{type:Function},imageUploader:{type:Function},uploadSizeLimit:{},fullscreen:{type:Boolean},disabled:{type:Boolean}},emits:["openLinkModal","toggleFullscreen"],setup(t,{emit:c}){const r=t,n=e.inject("theme"),a=c,i=(_,V)=>{var o,l;return(l=(o=r.editor)==null?void 0:o.isActive)==null?void 0:l.call(o,_,V)},C=(_,V)=>{var b,F,T,D,L,H;const o=r.editor;if(!o)return;const l=(T=(b=o.chain)==null?void 0:(F=b.call(o)).focus)==null?void 0:T.call(F);return(H=(L=(D=l==null?void 0:l[_])==null?void 0:D.call(l))==null?void 0:L.run)==null?void 0:H.call(L)},p=()=>{var _,V,o,l;try{return!!((l=(V=(_=r.editor)==null?void 0:_.can)==null?void 0:(o=V.call(_)).undo)!=null&&l.call(o))}catch{return!1}},f=()=>{var _,V,o,l;try{return!!((l=(V=(_=r.editor)==null?void 0:_.can)==null?void 0:(o=V.call(_)).redo)!=null&&l.call(o))}catch{return!1}},N=()=>{var _,V,o;p()&&((o=(V=(_=r.editor)==null?void 0:_.commands)==null?void 0:V.undo)==null||o.call(V))},x=()=>{var _,V,o;return(o=(V=(_=r.editor)==null?void 0:_.commands)==null?void 0:V.redo)==null?void 0:o.call(V)},m=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⌘ Z":"Ctrl Z",E=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⇧ ⌘ Z":"Ctrl Y",y=typeof navigator<"u"&&navigator.platform.includes("Mac"),k=y?"⌘ B":"Ctrl B",d=y?"⌘ I":"Ctrl I",s=y?"⌘ U":"Ctrl U",g=y?"⇧ ⌘ X":"Ctrl Shift X",h=y?"⌘ \\":"Ctrl \\",u=y?"⇧ ⌘ S":"Ctrl Shift S",B=y?"⇧ ⌘ 8":"Ctrl Shift 8",z=y?"⇧ ⌘ 7":"Ctrl Shift 7",v=y?"⇧ ⌘ C":"Ctrl Shift C",w=e.ref(null),M=()=>{var V,o,l,b,F,T,D;const _=r.editor;_&&((D=(T=(F=(b=(l=(o=(V=_.chain())==null?void 0:V.focus())==null?void 0:o.unsetAllMarks)==null?void 0:l.call(o))==null?void 0:b.removeEmptyTextStyle)==null?void 0:F.call(b))==null?void 0:T.run)==null||D.call(T))},S=e.ref(!1),$=e.ref(!1),A=e.ref({}),j=e.ref(null),R=()=>{var o,l,b,F,T,D;const _=r.editor;if(!_)return;const V=((o=_.getAttributes)==null?void 0:o.call(_,"textStyle"))||{};A.value={bold:!!((l=_.isActive)!=null&&l.call(_,"bold")),italic:!!((b=_.isActive)!=null&&b.call(_,"italic")),strike:!!((F=_.isActive)!=null&&F.call(_,"strike")),underline:!!((T=_.isActive)!=null&&T.call(_,"underline")),code:!!((D=_.isActive)!=null&&D.call(_,"code")),textStyle:{...V!=null&&V.color?{color:V.color}:{},...V!=null&&V.backgroundColor?{backgroundColor:V.backgroundColor}:{},...V!=null&&V.fontSize?{fontSize:V.fontSize}:{}}}},W=()=>{var F,T,D,L,H,I,O,Q,oe,le,fe,Y;const _=r.editor;if(!_)return;const V=A.value;let o=(D=(F=_.chain)==null?void 0:(T=F.call(_)).focus)==null?void 0:D.call(T);const l=V.textStyle||{},b=(L=_.state)==null?void 0:L.selection;b&&b.from===b.to||(o=((H=o==null?void 0:o.unsetAllMarks)==null?void 0:H.call(o))||o,Object.keys(l).length&&(o=((I=o==null?void 0:o.setMark)==null?void 0:I.call(o,"textStyle",l))||o),V.bold&&(o=((O=o==null?void 0:o.toggleBold)==null?void 0:O.call(o))||o),V.italic&&(o=((Q=o==null?void 0:o.toggleItalic)==null?void 0:Q.call(o))||o),V.strike&&(o=((oe=o==null?void 0:o.toggleStrike)==null?void 0:oe.call(o))||o),V.underline&&(o=((le=o==null?void 0:o.toggleUnderline)==null?void 0:le.call(o))||o),V.code&&(o=((fe=o==null?void 0:o.toggleCode)==null?void 0:fe.call(o))||o),(Y=o==null?void 0:o.run)==null||Y.call(o))},Z=_=>{var l;const V=r.editor;if(!V)return;R(),S.value=!0,$.value=!!_;const o=(l=V.state)==null?void 0:l.selection;j.value=o?{from:o.from,to:o.to}:null},G=()=>{S.value=!1,$.value=!1},X=()=>{ae()},K=_=>{r.disabled||!((_.metaKey||_.ctrlKey)&&_.shiftKey&&(_.key==="s"||_.key==="S"))||!r.editor||(_.preventDefault(),Z(!1))},ne=_=>{var D,L,H,I;if(r.disabled)return;const V=_.metaKey||_.ctrlKey,o=_.key==="c"||_.key==="C";if(V&&_.shiftKey&&o){_.preventDefault(),C("toggleCodeBlock");return}const l=_.key==="f"||_.key==="F";if(V&&l){_.preventDefault();try{(L=(D=w.value)==null?void 0:D.openPanel)==null||L.call(D,"find")}catch{}return}const b=_.key==="h"||_.key==="H",F=_.metaKey&&_.altKey&&l,T=_.ctrlKey&&b;if(F||T){_.preventDefault();try{(I=(H=w.value)==null?void 0:H.openPanel)==null||I.call(H,"replace")}catch{}return}};let re=!1;const he=()=>{var V;const _=r.editor;!_||re||(re=!0,(V=_.on)==null||V.call(_,"selectionUpdate",X),window.addEventListener("keydown",K),window.addEventListener("keydown",ne),window.addEventListener("mouseup",ce,!0))},Ee=()=>{var V;const _=r.editor;_&&((V=_.off)==null||V.call(_,"selectionUpdate",X),window.removeEventListener("keydown",K),window.removeEventListener("keydown",ne),window.removeEventListener("mouseup",ce,!0),re=!1)};e.onMounted(()=>{he()}),e.onBeforeUnmount(()=>{Ee()}),e.watch(()=>r.editor,(_,V)=>{var o;V&&((o=V.off)==null||o.call(V,"selectionUpdate",X)),re=!1,he()});const ae=()=>{try{S.value?document.body.setAttribute("data-format-brush","true"):document.body.removeAttribute("data-format-brush")}catch{}};e.watch(S,ae),e.onMounted(ae),e.onBeforeUnmount(()=>{try{document.body.removeAttribute("data-format-brush")}catch{}});const ce=()=>{var l;if(r.disabled||!S.value)return;const _=r.editor;if(!_)return;const V=(l=_.state)==null?void 0:l.selection;if(!V||V.from===V.to)return;const o=j.value;o&&o.from===V.from&&o.to===V.to||(W(),j.value={from:V.from,to:V.to},$.value||G())};return(_,V)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["header_box",{disabled:!!r.disabled}])},[e.createElementVNode("div",{class:"icon","aria-disabled":!p(),onClick:N},[e.createVNode(e.unref(U),{text:"撤销",shortcut:e.unref(m),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(st),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],8,Mn),e.createElementVNode("div",{class:"icon","aria-disabled":!f(),onClick:x},[e.createVNode(e.unref(U),{text:"重做",shortcut:e.unref(E),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(rt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],8,Bn),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:S.value}]),onClick:V[0]||(V[0]=o=>Z(!1)),onDblclick:V[1]||(V[1]=o=>Z(!0))},[e.createVNode(e.unref(U),{text:"格式刷",shortcut:e.unref(u),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"formatBrush",size:18,color:e.unref(n)==="light"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],34),e.createElementVNode("div",{class:"icon",onClick:M},[e.createVNode(e.unref(U),{text:"清除格式",shortcut:e.unref(h),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"clearFormat",size:18,color:e.unref(n)==="light"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])]),e.createVNode(e.unref(Vn),{editor:r.editor},null,8,["editor"]),e.createVNode(e.unref(xt),{editor:r.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("bold")}]),onClick:V[2]||(V[2]=o=>C("toggleBold"))},[e.createVNode(e.unref(U),{text:"加粗",shortcut:e.unref(k),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(dt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("italic")}]),onClick:V[3]||(V[3]=o=>C("toggleItalic"))},[e.createVNode(e.unref(U),{text:"斜体",shortcut:e.unref(d),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(ft),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("strike")}]),onClick:V[4]||(V[4]=o=>C("toggleStrike"))},[e.createVNode(e.unref(U),{text:"删除线",shortcut:e.unref(g),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(ct),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("underline")}]),onClick:V[5]||(V[5]=o=>C("toggleUnderline"))},[e.createVNode(e.unref(U),{text:"下划线",shortcut:e.unref(s),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(pt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createVNode(e.unref(Dt),{editor:r.editor,currentColor:r.currentColor},null,8,["editor","currentColor"]),e.createVNode(e.unref(yo),{editor:r.editor},null,8,["editor"]),e.createVNode(e.unref(vn),{editor:r.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("bulletList")}]),onClick:V[6]||(V[6]=o=>C("toggleBulletList"))},[e.createVNode(e.unref(U),{text:"无序列表",shortcut:e.unref(B),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"bulletList",size:16,color:e.unref(n)==="light"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("orderedList")}]),onClick:V[7]||(V[7]=o=>C("toggleOrderedList"))},[e.createVNode(e.unref(U),{text:"有序列表",shortcut:e.unref(z),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"orderedList",size:16,color:e.unref(n)==="light"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2),e.createVNode(e.unref(gn),{editor:r.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("code")}]),onClick:V[8]||(V[8]=o=>C("toggleCode"))},[e.createVNode(e.unref(U),{text:"行内代码",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"code",size:18,color:e.unref(n)==="light"&&"#fff"},null,8,["color"])]),_:1})],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("codeBlock")}]),onClick:V[9]||(V[9]=o=>C("toggleCodeBlock"))},[e.createVNode(e.unref(U),{text:"代码块",shortcut:e.unref(v),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"codeBlock",size:16,color:e.unref(n)==="light"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2),e.createVNode(e.unref(kn),{editor:r.editor},null,8,["editor"]),e.createVNode(e.unref(Oo),{editor:r.editor},null,8,["editor"]),e.createVNode(e.unref(Vo),{editor:r.editor,imageUploader:r.imageUploader,uploadSizeLimit:r.uploadSizeLimit},null,8,["editor","imageUploader","uploadSizeLimit"]),e.createVNode(e.unref(No),{editor:r.editor,videoUploader:r.videoUploader,uploadSizeLimit:r.uploadSizeLimit},null,8,["editor","videoUploader","uploadSizeLimit"]),e.createVNode(e.unref(Ho),{ref_key:"findRef",ref:w,editor:r.editor},null,8,["editor"]),e.createVNode(e.unref(Yo),{editor:r.editor},null,8,["editor"]),e.createVNode(e.unref(hn),{editor:r.editor},null,8,["editor"]),e.createElementVNode("div",{class:"icon",onClick:V[10]||(V[10]=o=>a("toggleFullscreen"))},[e.createVNode(e.unref(U),{text:r.fullscreen?"退出全屏":"全屏编辑",placement:"bottom"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.fullscreen?e.unref(it):e.unref(nt)),{theme:"outline",strokeWidth:3}))]),_:1},8,["text"])])],2))}}),[["__scopeId","data-v-02d54bed"]]),zn={class:"outline__header"},Sn={class:"outline__listWrap"},$n={class:"outline__list"},Tn=["onClick"],Dn=["onClick"],Fn=J(e.defineComponent({__name:"index",props:{items:{},maxHeight:{},editor:{},container:{},duration:{},offset:{},open:{type:Boolean},pinned:{type:Boolean},theme:{}},emits:["select","update:open"],setup(t,{emit:c}){const r=t,n=c,a=e.inject("theme");function i(g){k(g),n("select",g)}function C(){n("update:open",!1),n("update:pinned",!1)}function p(){r.pinned||C()}function f(g){const h=[],u=[];for(const B of g){const z={...B,children:[]};for(;u.length&&u[u.length-1].level>=z.level;)u.pop();u.length?u[u.length-1].children.push(z):h.push(z),u.push(z)}return h}const N=e.ref(new Set);function x(g){return N.value.has(g.pos)}function m(g){const h=N.value;h.has(g.pos)?h.delete(g.pos):h.add(g.pos),N.value=new Set(h)}const E=e.computed(()=>f(r.items||[])),y=e.computed(()=>{const g=[],h=u=>{for(const B of u)g.push({node:B,level:B.level,hasChildren:B.children.length>0}),N.value.has(B.pos)||h(B.children)};return h(E.value),g});function k(g){const h=e.unref(r.editor);if(!h)return;const{doc:u}=h.state,B=u.nodeAt(g.pos),z=Math.max(1,u.content.size-1);let v=g.pos+1;B&&B.type.name==="heading"&&(v=g.pos+B.nodeSize-1),v=Math.min(Math.max(1,v),z),h.chain().focus().setTextSelection(v).run();const w=e.unref(r.container)??null,M=h.view.coordsAtPos(v),S=r.offset??8,$=r.duration??700;if(w){const A=w.getBoundingClientRect(),j=w.scrollTop+M.top-A.top-S;d(w,j,$)}else{const A=(window.scrollY||window.pageYOffset)+M.top-S;s(A,$)}}function d(g,h,u=600){const B=g.scrollTop,z=h-B,v=performance.now(),w=S=>S<.5?4*S*S*S:1-Math.pow(-2*S+2,3)/2;function M(S){const $=S-v,A=Math.min(1,$/u);g.scrollTop=B+z*w(A),A<1&&requestAnimationFrame(M)}requestAnimationFrame(M)}function s(g,h=600){const u=window.scrollY||window.pageYOffset,B=g-u,z=performance.now(),v=M=>M<.5?4*M*M*M:1-Math.pow(-2*M+2,3)/2;function w(M){const S=M-z,$=Math.min(1,S/h),A=u+B*v($);window.scrollTo(0,A),$<1&&requestAnimationFrame(w)}requestAnimationFrame(w)}return(g,h)=>(e.openBlock(),e.createElementBlock("div",{class:"outline-wrapper",onClick:h[1]||(h[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("aside",{class:e.normalizeClass(["outline",{isOpen:r.open,dark:r.theme==="dark"}]),style:e.normalizeStyle({maxHeight:typeof r.maxHeight=="number"?r.maxHeight+"px":r.maxHeight}),onMouseleave:p},[e.createElementVNode("div",zn,[h[2]||(h[2]=e.createElementVNode("div",{style:{"margin-right":"6px"}},"大纲",-1)),r.open&&!r.pinned?(e.openBlock(),e.createBlock(q,{key:0,style:{"margin-top":"2px"},name:"fixed",size:16,color:e.unref(a)==="light"&&"#fff",onClick:h[0]||(h[0]=u=>g.$emit("update:pinned",!0))},null,8,["color"])):e.createCommentVNode("",!0),r.pinned?(e.openBlock(),e.createBlock(e.unref(lt),{key:1,onClick:C,theme:"outline",size:"16",strokeWidth:3})):e.createCommentVNode("",!0)]),e.createElementVNode("div",Sn,[e.createElementVNode("ul",$n,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(u,B)=>(e.openBlock(),e.createElementBlock("li",{key:u.node.pos+"-"+B,class:e.normalizeClass(["outline__item","lv-"+u.level])},[u.hasChildren?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["outline__caret",{collapsed:x(u.node),expanded:!x(u.node)}]),onClick:e.withModifiers(z=>m(u.node),["stop"]),title:"展开/收起"},[...h[3]||(h[3]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8 5l8 7-8 7V5z",fill:"currentColor"})],-1)])],10,Tn)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:"outline__text",onClick:z=>i(u.node)},e.toDisplayString(u.node.text||"(无标题)"),9,Dn)],2))),128))])])],38),e.createVNode(e.Transition,{name:"outline-mask"},{default:e.withCtx(()=>[r.open?(e.openBlock(),e.createElementBlock("div",{key:0,class:"outline-drawer-mask",onClick:C})):e.createCommentVNode("",!0)]),_:1})]))}}),[["__scopeId","data-v-860c5d88"]]),An=["onClick"],De=J(e.defineComponent({__name:"index",props:{modelValue:{},markdown:{},height:{},placeholder:{},imageUploader:{type:Function},videoUploader:{type:Function},caretColor:{},uploadSizeLimit:{},readonly:{type:Boolean},theme:{}},emits:["update:modelValue","update:markdown"],setup(t,{expose:c,emit:r}){const n=t,a=r;e.provide("theme",n.theme),e.watch(()=>n.theme,o=>{document.documentElement.classList.toggle("dark",o==="dark")});const i=e.ref(null);let C=!1;const p=e.ref(!1),f=e.ref(!1),N=e.ref(""),x=e.ref([]),m=e.ref("#000000"),E=e.ref(!0),y=e.ref(!0),k=e.ref(null),d=e.ref(void 0),s=e.ref([]),g=e.ref(null),h=o=>{var l;if(n.readonly)try{o.preventDefault(),(l=o.stopPropagation)==null||l.call(o)}catch{}},u=()=>{const o=k.value;d.value=o?o.clientHeight:void 0};let B=null;e.onMounted(()=>{u(),B=()=>u(),window.addEventListener("resize",B),e.nextTick(()=>{const o=k.value;o&&o.addEventListener("scroll",ce,{passive:!0})})}),e.onBeforeUnmount(()=>{B&&(window.removeEventListener("resize",B),B=null);const o=k.value;o&&o.removeEventListener("scroll",ce)}),e.watch([()=>n.height,E,p],async()=>{await e.nextTick(),u(),ce()}),e.watch(p,o=>{try{document.body.style.overflow=o?"hidden":""}catch{}try{o?window.addEventListener("keydown",z):window.removeEventListener("keydown",z)}catch{}});function z(o){o.key==="Escape"&&p.value&&(o.preventDefault(),p.value=!1)}const v=()=>n.theme==="dark"?"#fff":n.caretColor||"#000",w=e.computed(()=>{const o=b=>b==null?void 0:typeof b=="number"?`${b}px`:b,l=p.value?"100vh":o(n.height);return{height:l,"--editor-height":l,"--editor-caret-color":v}}),M=we.TextStyle.extend({addAttributes(){return{fontSize:{default:null,parseHTML:o=>o.style.fontSize||null,renderHTML:o=>o.fontSize?{style:`font-size: ${o.fontSize}`}:{}}}},addCommands(){return{setFontSize:o=>({chain:l})=>l().setMark("textStyle",{fontSize:o}).run(),unsetFontSize:()=>({chain:o})=>o().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),S=we.TextStyle.extend({addAttributes(){return{backgroundColor:{default:null,parseHTML:o=>o.style.backgroundColor||null,renderHTML:o=>o.backgroundColor?{style:`background-color: ${o.backgroundColor}`}:{}}}},addCommands(){return{setBackgroundColor:o=>({chain:l})=>l().setMark("textStyle",{backgroundColor:o}).run(),unsetBackgroundColor:()=>({chain:o})=>o().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}});e.onMounted(()=>{i.value=new ve.Editor({extensions:[He.StarterKit.configure({dropcursor:!1}),Ge.Dropcursor.configure({color:"#22c55e",width:2}),Be.TaskList,Ze,Ye.configure({inline:!0,allowBase64:!0}),Je.configure({HTMLAttributes:{class:"tiptap-video",controls:!0}}),Ue.Markdown,Me.TableKit.configure({table:{resizable:!0},tableCell:{HTMLAttributes:{class:"list-item"}}}),Ke,we.TextStyle,M,S,Re.Color,Pe.Underline,Oe.Link.configure({autolink:!0,linkOnPaste:!0,openOnClick:!1,HTMLAttributes:{target:"_blank",rel:"noopener noreferrer"}}),We.TextAlign.configure({types:["heading","paragraph"]}),Ie.Placeholder.configure({placeholder:n.placeholder??"输入 / 以插入块"})],content:n.modelValue!=null?String(n.modelValue||""):String(n.markdown||""),contentType:n.modelValue!=null&&/<\s*(video|iframe)\b|data-youtube-video|<\w+/i.test(String(n.modelValue||""))?"html":"markdown",editable:!n.readonly,autofocus:!n.readonly,editorProps:{handlePaste(o,l){var oe,le,fe;if(n.readonly){try{l.preventDefault()}catch{}return!0}const b=l.clipboardData;if(!b)return!1;const F=b.files&&b.files.length?Array.from(b.files):[],T=F.find(Y=>{var ee;return(ee=Y.type)==null?void 0:ee.startsWith("image/")});if(T){if(l.preventDefault(),!n.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return R(T),!0}const D=F.find(Y=>{var ee;return(ee=Y.type)==null?void 0:ee.startsWith("video/")});if(D)return l.preventDefault(),re(D),!0;const H=(b.items?Array.from(b.items):[]).find(Y=>Y.kind==="file"),I=H?H.getAsFile():null;if(I&&I.type.startsWith("image/")){if(l.preventDefault(),!n.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return R(I),!0}if(I&&I.type.startsWith("video/"))return l.preventDefault(),re(I),!0;const O=b.getData("text/html");if(O){const Y=O.match(/<img[^>]+src=["']([^"']+)["']/i),ee=O.replace(/\s+/g,"").match(/^<img[^>]+src=["']([^"']+)["'][^>]*>$/i);if(Y&&ee&&ee[1]){l.preventDefault();const me=ee[1];if(n.imageUploader&&/^data:image\//i.test(me)){const ge=G(me,"clipboard.png");R(ge)}else{if(/^data:image\//i.test(me)){const ge=G(me,"clipboard.png"),Ne=(oe=n.uploadSizeLimit)==null?void 0:oe.image;if(Ne){const Un=Math.max(1,Ne)*1024*1024;if(ge.size>Un){try{window.alert(`图片文件大小超限(${(ge.size/1024/1024).toFixed(2)}MB > ${Ne}MB)`)}catch{}return!0}}}$(me)}return!0}const se=O.match(/<video[^>]+src=["']([^"']+)["']/i),ie=O.match(/<source[^>]+src=["']([^"']+)["']/i),pe=O.replace(/\s+/g,"").match(/^<video[^>]*>.*<\/video>$/i),Ae=se&&se[1]||ie&&ie[1];if(Ae&&pe)return l.preventDefault(),j(Ae),!0}const Q=b.getData("text/plain");if(Q){const Y=Q.trim(),ee=ne(Y);if(X(Y)&&Y===Q.trim()){if(l.preventDefault(),/^data:image\//i.test(Y)){const se=G(Y,"clipboard.png"),ie=(le=n.uploadSizeLimit)==null?void 0:le.image;if(ie){const pe=Math.max(1,ie)*1024*1024;if(se.size>pe){try{window.alert(`图片文件大小超限(${(se.size/1024/1024).toFixed(2)}MB > ${ie}MB)`)}catch{}return!0}}}return $(Y),!0}if(ee){if(l.preventDefault(),/^data:image\//i.test(ee)){const se=G(ee,"clipboard.png"),ie=(fe=n.uploadSizeLimit)==null?void 0:fe.image;if(ie){const pe=Math.max(1,ie)*1024*1024;if(se.size>pe){try{window.alert(`图片文件大小超限(${(se.size/1024/1024).toFixed(2)}MB > ${ie}MB)`)}catch{}return!0}}}return $(ee),!0}if(K(Y)&&Y===Q.trim())return l.preventDefault(),j(Y),!0}return!1},handleDrop(o,l){if(n.readonly){try{l.preventDefault()}catch{}return!0}const b=l.dataTransfer;if(!b)return!1;const T=(b.files?Array.from(b.files):[]).find(D=>{var L;return(L=D.type)==null?void 0:L.startsWith("image/")});if(T){if(l.preventDefault(),!n.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return R(T),!0}return!1},handleClick(o,l,b){const F=b,T=F.target,D=T?T.closest("a[href]"):null;if(D&&(F.ctrlKey||F.metaKey)){const L=D.getAttribute("href")||"";if(L){F.preventDefault();try{window.open(L,"_blank","noopener,noreferrer")}catch(H){console.warn("打开链接失败:",H)}return!0}}return!1},handleDOMEvents:{dragstart(o,l){if(n.readonly){try{l.preventDefault()}catch{}return!0}return!1},dragover(o,l){if(n.readonly){try{l.preventDefault()}catch{}return!0}return!1},drop(o,l){if(n.readonly){try{l.preventDefault()}catch{}return!0}return!1}}},onSelectionUpdate:o=>{var F;const b=((F=o.editor.getAttributes("textStyle"))==null?void 0:F.color)||"#000000";m.value=typeof b=="string"?b:"#000000"},onUpdate:()=>{const o=i.value;C=!0,a("update:modelValue",o.getHTML()),a("update:markdown",o.getMarkdown()),ae()},onTransaction:()=>{ae()},theme:e.computed(()=>n.theme?"dark":"light")}),e.nextTick(()=>{var o,l,b,F,T,D;ae();try{n.readonly||(o=i.value)==null||o.chain().focus().run()}catch{}try{const L=((b=(l=i.value)==null?void 0:l.view)==null?void 0:b.dom)||null;(F=L==null?void 0:L.addEventListener)==null||F.call(L,"dragstart",h,!0),(T=L==null?void 0:L.addEventListener)==null||T.call(L,"dragover",h,!0),(D=L==null?void 0:L.addEventListener)==null||D.call(L,"drop",h,!0)}catch{}})}),e.onBeforeUnmount(()=>{var o,l,b,F,T,D;try{const L=((l=(o=i.value)==null?void 0:o.view)==null?void 0:l.dom)||null;(b=L==null?void 0:L.removeEventListener)==null||b.call(L,"dragstart",h,!0),(F=L==null?void 0:L.removeEventListener)==null||F.call(L,"dragover",h,!0),(T=L==null?void 0:L.removeEventListener)==null||T.call(L,"drop",h,!0)}catch{}(D=i.value)==null||D.destroy()}),e.watch(()=>n.modelValue,o=>{if(C){C=!1;return}o!=null&&i.value&&e.nextTick(()=>{try{const l=/<\s*(video|iframe)\b|data-youtube-video/i.test(o),b=o.match(/\[video\]\(([^)]+)\)/i);if(!l&&b){const F=b[1],T=o.replace(/\[video\]\(([^)]+)\)/gi,(D,L)=>`<video data-tiptap-video src="${L}" controls></video>`);i.value.commands.setContent(T,{contentType:"html"})}else i.value.commands.setContent(o,{contentType:l?"html":"markdown"})}catch(l){console.warn("setContent 失败,内容更新被忽略:",l)}})}),e.watch(()=>n.readonly,o=>{var l,b;try{(b=(l=i.value)==null?void 0:l.setEditable)==null||b.call(l,!o)}catch{}}),e.watch(()=>n.markdown,o=>{if(C){C=!1;return}n.modelValue==null&&o!=null&&i.value&&e.nextTick(()=>{try{i.value.commands.setContent(o,{contentType:"markdown"})}catch(l){console.warn("setContent 失败,内容更新被忽略:",l)}})});function $(o){var l;(l=i.value)==null||l.chain().focus().setImage({src:o}).run()}function A(o){return String(o).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function j(o){const l=i.value;if(!l)return;if(typeof l.commands.setVideo=="function"){l.chain().focus().setVideo({src:o,HTMLAttributes:{controls:!0,autoplay:!1,width:640}}).run();return}const F=A(o);try{l.chain().focus().insertContent(`<p><a href="${F}" target="_blank" rel="noopener noreferrer">${F}</a></p>`).run()}catch{l.chain().focus().insertContent(F).run()}}async function R(o){var b,F;const l=(b=n.uploadSizeLimit)==null?void 0:b.image;if(l){const T=Math.max(1,l)*1024*1024;if(o.size>T){try{window.alert(`图片文件大小超限(${(o.size/1024/1024).toFixed(2)}MB > ${l}MB)`)}catch{}return}}if(n.imageUploader){const T=URL.createObjectURL(o);(F=i.value)==null||F.chain().focus().setImage({src:T,uploading:!0}).run();try{const D=await n.imageUploader(o);if(typeof D=="string"&&D){W(T,D);return}Z(o,L=>W(T,L))}catch(D){console.warn("图片上传失败,回退为 base64",D),Z(o,L=>W(T,L))}finally{try{URL.revokeObjectURL(T)}catch{}}return}try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}}function W(o,l){var L,H;const b=i.value;if(!b)return;const{state:F}=b,{doc:T}=F;let D=null;if(T.descendants((I,O)=>{var Q,oe;return((Q=I.type)==null?void 0:Q.name)==="image"&&((oe=I.attrs)==null?void 0:oe.src)===o?(D=O,!1):!0}),D!=null){const I=T.nodeAt(D),O=F.schema.nodes.image;if(!I||!O)return;const Q={...I.attrs||{},src:l,uploading:null},oe=F.tr.setNodeMarkup(D,O,Q,I.marks);b.view.dispatch(oe);try{(H=(L=b.options)==null?void 0:L.onUpdate)==null||H.call(L,{editor:b})}catch{}}else $(l)}function Z(o,l){const b=new FileReader;b.onload=()=>l(String(b.result||"")),b.readAsDataURL(o)}function G(o,l="image.png"){var H;const b=o.split(","),F=((H=b[0].match(/:(.*?);/))==null?void 0:H[1])||"image/png",T=atob(b[1]);let D=T.length;const L=new Uint8Array(D);for(;D--;)L[D]=T.charCodeAt(D);return new File([L],l,{type:F})}function X(o){return/^data:image\//i.test(o)||/^https?:\/\//i.test(o)&&/\.(png|jpe?g|gif|webp|svg)(\?.*)?$/i.test(o)}function K(o){return/^https?:\/\//i.test(o)&&/\.(mp4|webm|m3u8|mov|ogv?)(\?.*)?$/i.test(o)}function ne(o){const l=o.match(/^!\[[^\]]*\]\(([^)]+)\)\s*$/);if(!l)return null;const b=l[1].trim().replace(/^<|>$/g,"");return X(b)?b:null}async function re(o){var F;const l=(F=n.uploadSizeLimit)==null?void 0:F.video;if(l){const T=Math.max(1,l)*1024*1024;if(o.size>T){try{window.alert(`视频文件大小超限(${(o.size/1024/1024).toFixed(2)}MB > ${l}MB)`)}catch{}return}}if(n.videoUploader){const T=URL.createObjectURL(o),D=i.value,L=D==null?void 0:D.commands;try{typeof(L==null?void 0:L.setVideo)=="function"?D==null||D.chain().focus().setVideo({src:T,HTMLAttributes:{controls:!0,autoplay:!1,width:640,uploading:!0}}).run():j(T)}catch{j(T)}try{const H=await n.videoUploader(o);he(T,H)}catch(H){console.warn("视频上传失败,保留本地对象 URL 作为预览",H)}finally{try{URL.revokeObjectURL(T)}catch{}}return}const b=URL.createObjectURL(o);j(b)}function he(o,l){const b=i.value;if(!b)return;const{state:F}=b,{doc:T}=F;let D=null;if(T.descendants((L,H)=>{var I,O;return((I=L.type)==null?void 0:I.name)==="video"&&((O=L.attrs)==null?void 0:O.src)===o?(D=H,!1):!0}),D!=null){const L=T.nodeAt(D),H=F.schema.nodes.video;if(!L||!H)return;const I={...L.attrs||{},src:l,uploading:null},O=F.tr.setNodeMarkup(D,H,I,L.marks);b.view.dispatch(O)}}function Ee(){var o,l;N.value=((l=(o=i.value)==null?void 0:o.getAttributes("link"))==null?void 0:l.href)||"",f.value=!0}function ae(){const o=i.value;if(!o)return;const l=[];o.state.doc.descendants((b,F)=>{if(b.type.name==="heading"){const T=b.attrs.level||1,D=b.textContent||"";l.push({text:D,level:T,pos:F})}}),x.value=l,ce()}function ce(){const o=i.value,l=k.value,b=x.value;if(!o||!l||!b.length){s.value=[],g.value=null;return}const F=l.getBoundingClientRect(),T=l.scrollHeight||l.clientHeight,D=l.clientHeight||1,L=b.map(O=>{const oe=o.view.coordsAtPos(Math.min(O.pos+1,o.state.doc.content.size)).top-F.top+l.scrollTop,le=T?Math.max(0,Math.min(1,oe/T)):0;return Math.round(le*D)});s.value=L;const H=l.scrollTop+8;let I=null;for(let O=0;O<b.length;O++){const Q=b[O];if(o.view.coordsAtPos(Math.min(Q.pos+1,o.state.doc.content.size)).top-F.top+l.scrollTop<=H)I=Q.pos;else break}g.value=I}function _(o){const l=o.target;l.closest(".outline")||l.closest(".outline-toggle")||i.value&&i.value.chain().focus().run()}function V(){const o=i.value;return o?o.getMarkdown():""}return c({getMarkdown:V}),(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["simple-editor",{fullscreen:p.value,readonly:!!n.readonly,dark:n.theme==="dark"}]),style:e.normalizeStyle(w.value)},[e.createVNode(e.unref(Ln),{editor:i.value,currentColor:m.value,imageUploader:t.imageUploader,videoUploader:t.videoUploader,"upload-size-limit":n.uploadSizeLimit,fullscreen:p.value,disabled:!!n.readonly,onToggleFullscreen:l[0]||(l[0]=b=>p.value=!p.value),onOpenLinkModal:Ee},null,8,["editor","currentColor","imageUploader","videoUploader","upload-size-limit","fullscreen","disabled"]),e.createElementVNode("div",{class:e.normalizeClass(["editor_main",{hasOutline:E.value}])},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:k,class:"editor_wrapper",onClick:_},[e.createVNode(e.unref(ve.EditorContent),{editor:i.value,class:"content"},null,8,["editor"])],512),e.createVNode(e.unref(Fn),{open:E.value,"onUpdate:open":l[1]||(l[1]=b=>E.value=b),items:x.value,editor:i.value,container:k.value,maxHeight:d.value,pinned:y.value,theme:n.theme,"onUpdate:pinned":l[2]||(l[2]=b=>y.value=b)},null,8,["open","items","editor","container","maxHeight","pinned","theme"]),E.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"outline-markers",onMouseenter:l[3]||(l[3]=b=>(E.value=!0,y.value=!1))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(b,F)=>{var T;return e.openBlock(),e.createElementBlock("span",{key:F,class:e.normalizeClass(["outline-marker",{active:((T=x.value[F])==null?void 0:T.pos)===g.value}]),style:e.normalizeStyle({top:(b||0)+"px"}),onClick:e.withModifiers(D=>{var L,H;return(H=i.value)==null?void 0:H.chain().focus().setTextSelection((((L=x.value[F])==null?void 0:L.pos)||1)+1).run()},["stop"])},null,14,An)}),128))],32))],2)],6))}}),[["__scopeId","data-v-0dda272d"]]),Hn={install(t){t.component("Editor",De)}};P.Editor=De,P.default=Hn,Object.defineProperties(P,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
8
|
+
)`,border:"1px dashed #ccc"},onClick:e.withModifiers(k,["stop"])})])]),e.createElementVNode("div",so,[M[5]||(M[5]=e.createElementVNode("div",{class:"section-title"},"默认",-1)),e.createElementVNode("div",ao,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.slice(0,9),S=>(e.openBlock(),e.createElementBlock("div",{key:S,class:"swatch",style:e.normalizeStyle({background:S}),onClick:e.withModifiers($=>y(S),["stop"])},[S===f.value?(e.openBlock(),e.createElementBlock("span",fo,"✓")):e.createCommentVNode("",!0)],12,co))),128))])]),e.createElementVNode("div",po,[M[6]||(M[6]=e.createElementVNode("div",{class:"section-title"},"常用颜色",-1)),e.createElementVNode("div",mo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.slice(9),S=>(e.openBlock(),e.createElementBlock("div",{key:S,class:"swatch",style:e.normalizeStyle({background:S}),onClick:e.withModifiers($=>y(S),["stop"])},[S===f.value?(e.openBlock(),e.createBlock(e.unref(de),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,uo))),128))])]),p.value.length?(e.openBlock(),e.createElementBlock("div",ho,[M[7]||(M[7]=e.createElementVNode("div",{class:"section-title"},"最近使用自定义颜色",-1)),e.createElementVNode("div",go,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,S=>(e.openBlock(),e.createElementBlock("div",{key:S,class:"swatch",style:e.normalizeStyle({background:S}),onClick:e.withModifiers($=>y(S),["stop"])},null,12,ko))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",wo,[e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(k,["stop"])},"暂无"),e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(E,["stop"])},"更多颜色")]),a.value?(e.openBlock(),e.createElementBlock("div",Co,[e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":M[1]||(M[1]=S=>C.value=S)},null,512),[[e.vModelText,C.value]]),e.withDirectives(e.createElementVNode("input",{class:"hex","onUpdate:modelValue":M[2]||(M[2]=S=>C.value=S)},null,512),[[e.vModelText,C.value]]),e.createElementVNode("button",{class:"btn apply",onClick:M[3]||(M[3]=e.withModifiers(S=>y(C.value),["stop"]))},"应用")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-f414a9de"]]),xo={class:"image-actions"},bo=["aria-disabled","disabled"],Vo=J(e.defineComponent({__name:"index",props:{editor:{},imageUploader:{type:Function},uploadSizeLimit:{}},setup(t){const c=e.inject("theme"),r=t,n=e.ref(!1),a=e.ref(""),i=e.ref(!1),C=e.ref(null),p=()=>{n.value=!n.value},f=()=>{var d,s,g,h,u,B;const k=a.value.trim();k&&((B=(u=((h=(s=(d=r.editor)==null?void 0:d.chain)==null?void 0:(g=s.call(d)).focus)==null?void 0:h.call(g)).setImage({src:k})).run)==null||B.call(u),n.value=!1,a.value="")},N=k=>{k.key==="Enter"&&f(),k.key==="Escape"&&(n.value=!1,a.value="")},x=()=>{var k;r.imageUploader&&((k=C.value)==null||k.click())},m=async k=>{var h,u,B,z,v,w,M,S;const d=k.target,s=(h=d.files)==null?void 0:h[0];if(d.value="",!s||!r.imageUploader)return;const g=(u=r.uploadSizeLimit)==null?void 0:u.image;if(typeof g=="number"&&g>0){const $=Math.max(1,g)*1024*1024;if(s.size>$){try{window.alert(`图片文件大小超限(${(s.size/1024/1024).toFixed(2)}MB > ${g}MB)`)}catch{}return}}try{i.value=!0;let $=null;$=URL.createObjectURL(s),(S=(M=((w=(z=(B=r.editor)==null?void 0:B.chain)==null?void 0:(v=z.call(B)).focus)==null?void 0:w.call(v)).setImage({src:$,uploading:!0})).run)==null||S.call(M);const A=await r.imageUploader(s);if(typeof A=="string"&&A){const j=r.editor,{state:R}=j,{doc:W}=R;let Z=null;if(W.descendants((G,X)=>{var K,ne;return((K=G==null?void 0:G.type)==null?void 0:K.name)==="image"&&((ne=G==null?void 0:G.attrs)==null?void 0:ne.src)===$?(Z=X,!1):!0}),Z!=null){const G=W.nodeAt(Z),X=R.schema.nodes.image;if(G&&X){const K={...G.attrs||{},src:A,uploading:null},ne=R.tr.setNodeMarkup(Z,X,K,G.marks);j.view.dispatch(ne)}}n.value=!1,a.value=""}}finally{i.value=!1;try{objectUrl&&URL.revokeObjectURL(objectUrl)}catch{}}},E=e.ref(null);let y=null;return e.onMounted(()=>{y=k=>{if(!n.value)return;const d=E.value,s=k.target;d&&s&&!d.contains(s)&&(n.value=!1)},document.addEventListener("mousedown",y,!0)}),e.onBeforeUnmount(()=>{y&&(document.removeEventListener("mousedown",y,!0),y=null)}),(k,d)=>(e.openBlock(),e.createElementBlock("div",{class:"icon image-icon",onClick:p,ref_key:"rootRef",ref:E},[e.createVNode(e.unref(U),{text:"图片",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"img",size:18,color:e.unref(c)==="dark"&&"#fff"},null,8,["color"])]),_:1}),e.createVNode(e.Transition,{name:"img-panel",appear:""},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"image-input-panel",onClick:d[1]||(d[1]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{class:"image-input",type:"text",placeholder:"粘贴图片链接(png/jpg/webp/svg 等)","onUpdate:modelValue":d[0]||(d[0]=s=>a.value=s),onKeydown:N},null,544),[[e.vModelText,a.value]]),e.createElementVNode("input",{ref_key:"imageUploadInput",ref:C,type:"file",accept:"image/*",style:{display:"none"},onChange:m},null,544),e.createElementVNode("div",xo,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(f,["stop"])},"插入"),e.createElementVNode("button",{class:"btn","aria-disabled":!r.imageUploader||i.value,disabled:!r.imageUploader||i.value,onClick:e.withModifiers(x,["stop"])},e.toDisplayString(i.value?"上传中…":"上传文件"),9,bo)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-dad55a02"]]),_o={class:"video-actions"},Eo=["aria-disabled","disabled"],No=J(e.defineComponent({__name:"index",props:{editor:{},videoUploader:{type:Function},uploadSizeLimit:{}},setup(t){const c=e.inject("theme"),r=t,n=e.ref(!1),a=e.ref(""),i=e.ref(!1),C=e.ref(null),p=()=>{n.value=!n.value},f=()=>{const d=a.value.trim();if(!d)return;const s=r.editor,g=s==null?void 0:s.commands;if(/youtube\.com|youtu\.be|youtube-nocookie\.com/i.test(d)){const u=String(d).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");try{s.chain().focus().insertContent(`<p><a href="${u}" target="_blank" rel="noopener noreferrer">${u}</a></p>`).run()}catch{s.chain().focus().insertContent(u).run()}}else if(typeof(g==null?void 0:g.setVideo)=="function")s.chain().focus().setVideo({src:d,HTMLAttributes:{controls:!0,width:640}}).run();else{const u=String(d).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");try{s.chain().focus().insertContent(`<p><a href="${u}" target="_blank" rel="noopener noreferrer">${u}</a></p>`).run()}catch{s.chain().focus().insertContent(u).run()}}n.value=!1,a.value=""},N=d=>{d.key==="Enter"&&f(),d.key==="Escape"&&(n.value=!1,a.value="")},x=()=>{var d;r.videoUploader&&((d=C.value)==null||d.click())},m=async d=>{var B,z;const s=d.target,g=(B=s.files)==null?void 0:B[0];if(s.value="",!g||!r.videoUploader)return;const h=(z=r.uploadSizeLimit)==null?void 0:z.video;if(typeof h=="number"&&h>0){const v=Math.max(1,h)*1024*1024;if(g.size>v){try{window.alert(`视频文件大小超限(${(g.size/1024/1024).toFixed(2)}MB > ${h}MB)`)}catch{}return}}let u=null;try{i.value=!0;const v=r.editor,w=v==null?void 0:v.commands;u=URL.createObjectURL(g);try{if(typeof(w==null?void 0:w.setVideo)=="function")v.chain().focus().setVideo({src:u,HTMLAttributes:{controls:!0,width:640,uploading:!0}}).run();else{const S=String(u).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");try{v.chain().focus().insertContent(`<p><a href="${S}" target="_blank" rel="noopener noreferrer">${S}</a></p>`).run()}catch{v.chain().focus().insertContent(S).run()}}}catch{}const M=await r.videoUploader(g);u&&E(u,M),n.value=!1,a.value=""}finally{i.value=!1;try{u&&URL.revokeObjectURL(u)}catch{}}};function E(d,s){const g=r.editor;if(!g)return;const{state:h}=g,{doc:u}=h;let B=null;if(u.descendants((z,v)=>{var w,M;return((w=z.type)==null?void 0:w.name)==="video"&&((M=z.attrs)==null?void 0:M.src)===d?(B=v,!1):!0}),B!=null){const z=u.nodeAt(B),v=h.schema.nodes.video;if(!z||!v)return;const w={...z.attrs||{},src:s,uploading:null},M=h.tr.setNodeMarkup(B,v,w,z.marks);g.view.dispatch(M)}}const y=e.ref(null);let k=null;return e.onMounted(()=>{k=d=>{if(!n.value)return;const s=y.value,g=d.target;s&&g&&!s.contains(g)&&(n.value=!1)},document.addEventListener("mousedown",k,!0)}),e.onBeforeUnmount(()=>{k&&(document.removeEventListener("mousedown",k,!0),k=null)}),(d,s)=>(e.openBlock(),e.createElementBlock("div",{class:"icon video-icon",onClick:p,ref_key:"rootRef",ref:y},[e.createVNode(e.unref(U),{text:"视频",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"video",size:16,color:e.unref(c)==="dark"&&"#fff"},null,8,["color"])]),_:1}),e.createVNode(e.Transition,{name:"video-panel",appear:""},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"video-input-panel",onClick:s[1]||(s[1]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{class:"video-input",type:"text",placeholder:"粘贴视频链接(mp4/webm/m3u8等)","onUpdate:modelValue":s[0]||(s[0]=g=>a.value=g),onKeydown:N},null,544),[[e.vModelText,a.value]]),e.createElementVNode("input",{ref_key:"videoUploadInput",ref:C,type:"file",accept:"video/*,application/x-mpegURL",style:{display:"none"},onChange:m},null,544),e.createElementVNode("div",_o,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(f,["stop"])},"插入"),e.createElementVNode("button",{class:"btn","aria-disabled":!r.videoUploader||i.value,disabled:!r.videoUploader||i.value,onClick:e.withModifiers(x,["stop"])},e.toDisplayString(i.value?"上传中…":"上传文件"),9,Eo)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-582dbd57"]]),vo={class:"fr-header"},Mo={key:0,class:"fr-body"},Bo={class:"fr-input-row"},Lo=["value"],zo={key:0,class:"fr-count"},So={class:"fr-actions"},$o={key:1,class:"fr-body"},To={class:"fr-input-row"},Do=["value"],Fo={key:0,class:"fr-count"},Ao={class:"fr-actions"},Ho=J(e.defineComponent({__name:"index",props:{editor:{}},setup(t,{expose:c}){const r=t,n=e.ref(!1),a=e.ref("find"),i=e.ref(""),C=e.ref(""),p=e.ref([]),f=e.ref(0),N=e.computed(()=>{const $=p.value.length;return!i.value||!$?"0/0":`${Math.min(Math.max(f.value+1,1),$)}/${$}`}),x=typeof navigator<"u"&&navigator.platform.includes("Mac"),m=e.computed(()=>x?"⌘ F / ⌥ ⌘ F":"Ctrl F / Ctrl H"),E=()=>n.value=!n.value,y=()=>n.value=!1;function k(){var $;return(($=r.editor)==null?void 0:$.view)||null}function d(){const $=k(),A=i.value;if(p.value=[],f.value=0,!$||!A)return;const j=$.dom,R=document.createTreeWalker(j,NodeFilter.SHOW_TEXT,null);let W;for(;W=R.nextNode();){const Z=W,G=Z.data||"";let X=0;for(;;){const K=G.indexOf(A,X);if(K===-1)break;const ne=$.posAtDOM(Z,K),re=$.posAtDOM(Z,K+A.length);typeof ne=="number"&&typeof re=="number"&&p.value.push({from:ne,to:re}),X=K+A.length}}e.nextTick(()=>{p.value.length&&s(0)})}function s($){const A=r.editor,j=k();if(!A||!j||!p.value.length)return;const R=p.value.length;f.value=($%R+R)%R;const W=p.value[f.value];A.chain().focus().setTextSelection({from:W.from,to:W.to}).run()}const g=()=>p.value.length&&s(f.value+1),h=()=>p.value.length&&s(f.value-1);function u(){const $=r.editor;if(!$||!p.value.length)return;const A=p.value[f.value],j=$.state.tr.insertText(C.value,A.from,A.to);$.view.dispatch(j),d()}function B(){const $=r.editor;if(!$||!p.value.length)return;const A=[...p.value],j=$.state.tr;for(let R=A.length-1;R>=0;R--){const W=A[R];j.insertText(C.value,W.from,W.to)}$.view.dispatch(j),d()}function z($){i.value=$.target.value,d()}function v($){$.key==="Enter"&&g(),$.key==="Escape"&&y()}const w=e.ref(null);let M=null;e.onMounted(()=>{M=$=>{if(!n.value)return;const A=w.value,j=$.target;A&&j&&!A.contains(j)&&y()},document.addEventListener("mousedown",M,!0)}),e.onBeforeUnmount(()=>{M&&(document.removeEventListener("mousedown",M,!0),M=null)});function S($){$&&(a.value=$),n.value=!0,e.nextTick(d)}return c({openPanel:S}),($,A)=>(e.openBlock(),e.createElementBlock("div",{class:"icon find-icon",ref_key:"rootRef",ref:w,onClick:E},[e.createVNode(e.unref(U),{text:"查找替换",shortcut:m.value,placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(at),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"]),e.createVNode(e.Transition,{name:"find-panel",appear:""},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"find-input-panel",onClick:A[3]||(A[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",vo,[e.createElementVNode("button",{class:e.normalizeClass(["fr-tab",{active:a.value==="find"}]),onClick:A[0]||(A[0]=e.withModifiers(j=>a.value="find",["stop"]))}," 查找 ",2),e.createElementVNode("button",{class:e.normalizeClass(["fr-tab",{active:a.value==="replace"}]),onClick:A[1]||(A[1]=e.withModifiers(j=>a.value="replace",["stop"]))}," 替换 ",2)]),a.value==="find"?(e.openBlock(),e.createElementBlock("div",Mo,[A[4]||(A[4]=e.createElementVNode("label",{class:"fr-label"},"查找",-1)),e.createElementVNode("div",Bo,[e.createElementVNode("input",{class:"fr-input",value:i.value,placeholder:"输入关键字",onInput:z,onKeydown:v},null,40,Lo),i.value?(e.openBlock(),e.createElementBlock("span",zo,e.toDisplayString(N.value),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",So,[e.createElementVNode("button",{class:"fr-btn",onClick:e.withModifiers(h,["stop"])},"上一个"),e.createElementVNode("button",{class:"fr-btn primary",onClick:e.withModifiers(g,["stop"])},"下一个")])])):(e.openBlock(),e.createElementBlock("div",$o,[A[5]||(A[5]=e.createElementVNode("label",{class:"fr-label"},"查找",-1)),e.createElementVNode("div",To,[e.createElementVNode("input",{class:"fr-input",value:i.value,placeholder:"输入关键字",onInput:z},null,40,Do),i.value?(e.openBlock(),e.createElementBlock("span",Fo,e.toDisplayString(N.value),1)):e.createCommentVNode("",!0)]),A[6]||(A[6]=e.createElementVNode("label",{class:"fr-label"},"替换为",-1)),e.withDirectives(e.createElementVNode("input",{class:"fr-input",style:{width:"95%"},"onUpdate:modelValue":A[2]||(A[2]=j=>C.value=j),placeholder:"请输入"},null,512),[[e.vModelText,C.value]]),e.createElementVNode("div",Ao,[e.createElementVNode("button",{class:"fr-btn",onClick:e.withModifiers(B,["stop"])},"全部替换"),e.createElementVNode("button",{class:"fr-btn",onClick:e.withModifiers(u,["stop"])},"替换"),e.createElementVNode("button",{class:"fr-btn",onClick:e.withModifiers(h,["stop"])},"上一个"),e.createElementVNode("button",{class:"fr-btn primary",onClick:e.withModifiers(g,["stop"])},"下一个")])]))])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-8c079e6d"]]),Uo={class:"field"},jo={class:"field"},Io={class:"actions"},Oo=J(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=e.ref(!1),n=e.ref(""),a=e.ref("");e.ref(!1);const i=e.ref(null),C=e.inject("theme");function p(){const d=c.editor;if(!r.value&&d)try{const s=d.state.selection,g=s.from;s.to>g?N():(n.value="链接",d.chain().focus().insertContent("链接").setTextSelection({from:g,to:g+2}).run())}catch{}r.value=!r.value,r.value&&f()}function f(){setTimeout(()=>{var s;const d=(s=i.value)==null?void 0:s.querySelector('input[name="link-text"]');d==null||d.focus(),d==null||d.select()},0)}function N(){const d=c.editor;if(d)try{const s=d.state.selection,g=s.from,h=s.to,B=h>g?d.state.doc.textBetween(g,h):"";n.value=B||"";const z=d.getAttributes("link")||{};a.value=typeof z.href=="string"?z.href:""}catch{}}function x(){const d=c.editor;if(!d)return;const s=n.value.trim(),g=a.value.trim();if(g)try{const h=d.state.selection,u=h.from,B=h.to;if(B>u){const v=m(s||d.state.doc.textBetween(u,B)),w=m(g);d.chain().focus().insertContent(`<a href="${w}" target="_blank" rel="noopener noreferrer">${v}</a>`,{from:u,to:B}).run()}else{const v=m(g),w=m(s||g);d.chain().focus().insertContent(`<a href="${v}" target="_blank" rel="noopener noreferrer">${w}</a>`).run()}}finally{r.value=!1,n.value="",a.value=""}}function m(d){return String(d).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function E(d){d.key==="Enter"&&x(),d.key==="Escape"&&(r.value=!1)}let y=null;e.onMounted(()=>{y=d=>{if(!r.value)return;const s=i.value,g=d.target;s&&g&&!s.contains(g)&&(r.value=!1)},document.addEventListener("mousedown",y,!0)}),e.onBeforeUnmount(()=>{y&&(document.removeEventListener("mousedown",y,!0),y=null)});const k=e.ref({});return e.watch(r,async d=>{var g;if(!d)return;const s=c.editor;if(s){await e.nextTick();try{const h=s.state.selection,u=h.from,B=h.to;if(!(B>u)){k.value={};return}const v=s.view.coordsAtPos(u),w=s.view.coordsAtPos(B),M=(v.left+w.right)/2,S=Math.max(v.bottom,w.bottom)+8,$=(g=i.value)==null?void 0:g.querySelector(".link-input-panel"),A=$?$.getBoundingClientRect():{width:320,height:120},j=window.innerWidth,R=window.innerHeight,W=12,Z=Math.max(W+A.width/2,Math.min(j-W-A.width/2,M)),G=S,X=Math.min(v.top,w.top)-A.height-8;let K=G;G+A.height+W>R&&X-W>=0&&(K=X),K=Math.max(W,Math.min(R-W-A.height,K)),k.value={position:"fixed",left:Math.round(Z)+"px",top:Math.round(K)+"px"}}catch{}}}),(d,s)=>(e.openBlock(),e.createElementBlock("div",{class:"icon link-icon",onClick:p,ref_key:"rootRef",ref:i},[e.createVNode(e.unref(U),{text:"链接",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"link",size:16,color:e.unref(C)==="dark"&&"#fff"},null,8,["color"])]),_:1}),e.createVNode(e.Transition,{name:"link-panel",appear:""},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"link-input-panel",style:e.normalizeStyle(k.value),onClick:s[2]||(s[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Uo,[s[3]||(s[3]=e.createElementVNode("div",{class:"label"},"文本",-1)),e.withDirectives(e.createElementVNode("input",{name:"link-text",class:"input",type:"text","onUpdate:modelValue":s[0]||(s[0]=g=>n.value=g),onKeydown:E},null,544),[[e.vModelText,n.value]])]),e.createElementVNode("div",jo,[s[4]||(s[4]=e.createElementVNode("div",{class:"label"},"链接",-1)),e.withDirectives(e.createElementVNode("input",{name:"link-href",class:"input",type:"text","onUpdate:modelValue":s[1]||(s[1]=g=>a.value=g),placeholder:"链接地址",onKeydown:E},null,544),[[e.vModelText,a.value]])]),e.createElementVNode("div",Io,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(x,["stop"])},"确 定")])],4)):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-84f547ec"]]),Wo={class:"grid"},Ro=["onMouseenter"],Po={class:"size"},Go=10,qo=10,Yo=J(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=e.inject("theme"),n=e.ref(!1),a=e.ref(0),i=e.ref(0),C=e.computed(()=>{const x=Math.max(a.value,1),m=Math.max(i.value,1);return`${x} x ${m}`}),p=()=>{n.value=!n.value,n.value||(a.value=0,i.value=0)},f=(x,m)=>{a.value=x,i.value=m},N=()=>{var E,y,k,d,s,g,h,u;const x=Math.max(a.value,1),m=Math.max(i.value,1);(u=(g=(d=(y=(E=c.editor)==null?void 0:E.chain)==null?void 0:(k=y.call(E)).focus)==null?void 0:(s=d.call(k)).insertTable)==null?void 0:(h=g.call(s,{rows:x,cols:m,withHeaderRow:!0})).run)==null||u.call(h),n.value=!1,a.value=0,i.value=0};return(x,m)=>(e.openBlock(),e.createElementBlock("div",{class:"icon table-icon",onClick:p},[e.createVNode(e.unref(U),{text:"表格",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"table",size:16,color:e.unref(r)==="dark"&&"#fff"},null,8,["color"])]),_:1}),n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"table-panel",onClick:m[0]||(m[0]=e.withModifiers(()=>{},["stop"]))},[m[1]||(m[1]=e.createElementVNode("div",{class:"panel-title"},"表格",-1)),e.createElementVNode("div",Wo,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(Go,E=>e.createElementVNode("div",{key:"r-"+E,class:"row"},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(qo,y=>e.createElementVNode("span",{key:"c-"+E+"-"+y,class:e.normalizeClass(["cell",{active:E<=a.value&&y<=i.value}]),onMouseenter:k=>f(E,y),onClick:e.withModifiers(N,["stop"])},null,42,Ro)),64))])),64))]),e.createElementVNode("div",Po,e.toDisplayString(C.value),1)])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-d0d98332"]]),Ko=["aria-disabled"],Jo={class:"tools-grid"},Zo=["disabled"],Xo=["disabled"],Qo=["disabled"],en=["disabled"],tn=["disabled"],on=["disabled"],nn=["disabled"],rn=["disabled"],ln=["disabled"],sn=["disabled"],an=["disabled"],cn=["disabled"],dn=["disabled"],fn=["disabled"],pn=["disabled"],mn=["disabled"],un=["disabled"],hn=J(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=e.ref(!1),n=e.inject("theme"),a=()=>r.value=!r.value,i=(p,...f)=>{var x,m,E;const N=c.editor;return!!((E=(x=N==null?void 0:N.can)==null?void 0:(m=x.call(N))[p])!=null&&E.call(m,...f))},C=(p,...f)=>{var x,m,E,y,k,d,s;const N=c.editor;(s=(d=(k=(y=(E=(x=N==null?void 0:N.chain)==null?void 0:(m=x.call(N)).focus)==null?void 0:E.call(m))[p])==null?void 0:k.call(y,...f))==null?void 0:d.run)==null||s.call(d),r.value=!1};return(p,f)=>{var N,x;return e.openBlock(),e.createElementBlock("div",{class:"icon table-tools",onClick:a,"aria-disabled":!((x=(N=c.editor)==null?void 0:N.isActive)!=null&&x.call(N,"table"))},[e.createVNode(e.unref(U),{text:"表格工具",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"tableTools",size:15,color:e.unref(n)==="dark"&&"#fff"},null,8,["color"])]),_:1}),r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"tools-panel",onClick:f[17]||(f[17]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Jo,[e.createElementVNode("button",{class:"btn",onClick:f[0]||(f[0]=e.withModifiers(m=>C("addColumnBefore"),["stop"])),disabled:!i("addColumnBefore")}," 前插列 ",8,Zo),e.createElementVNode("button",{class:"btn",onClick:f[1]||(f[1]=e.withModifiers(m=>C("addColumnAfter"),["stop"])),disabled:!i("addColumnAfter")}," 后插列 ",8,Xo),e.createElementVNode("button",{class:"btn",onClick:f[2]||(f[2]=e.withModifiers(m=>C("deleteColumn"),["stop"])),disabled:!i("deleteColumn")}," 删除列 ",8,Qo),e.createElementVNode("button",{class:"btn",onClick:f[3]||(f[3]=e.withModifiers(m=>C("addRowBefore"),["stop"])),disabled:!i("addRowBefore")}," 前插行 ",8,en),e.createElementVNode("button",{class:"btn",onClick:f[4]||(f[4]=e.withModifiers(m=>C("addRowAfter"),["stop"])),disabled:!i("addRowAfter")}," 后插行 ",8,tn),e.createElementVNode("button",{class:"btn",onClick:f[5]||(f[5]=e.withModifiers(m=>C("deleteRow"),["stop"])),disabled:!i("deleteRow")}," 删除行 ",8,on),e.createElementVNode("button",{class:"btn",onClick:f[6]||(f[6]=e.withModifiers(m=>C("deleteTable"),["stop"])),disabled:!i("deleteTable")}," 删除表 ",8,nn),e.createElementVNode("button",{class:"btn",onClick:f[7]||(f[7]=e.withModifiers(m=>C("mergeCells"),["stop"])),disabled:!i("mergeCells")}," 合并单元格 ",8,rn),e.createElementVNode("button",{class:"btn",onClick:f[8]||(f[8]=e.withModifiers(m=>C("splitCell"),["stop"])),disabled:!i("splitCell")}," 拆分单元格 ",8,ln),e.createElementVNode("button",{class:"btn",onClick:f[9]||(f[9]=e.withModifiers(m=>C("mergeOrSplit"),["stop"])),disabled:!i("mergeOrSplit")}," 合并/拆分 ",8,sn),e.createElementVNode("button",{class:"btn",onClick:f[10]||(f[10]=e.withModifiers(m=>C("toggleHeaderRow"),["stop"])),disabled:!i("toggleHeaderRow")}," 切换表头行 ",8,an),e.createElementVNode("button",{class:"btn",onClick:f[11]||(f[11]=e.withModifiers(m=>C("toggleHeaderColumn"),["stop"])),disabled:!i("toggleHeaderColumn")}," 切换表头列 ",8,cn),e.createElementVNode("button",{class:"btn",onClick:f[12]||(f[12]=e.withModifiers(m=>C("toggleHeaderCell"),["stop"])),disabled:!i("toggleHeaderCell")}," 切换表头单元 ",8,dn),e.createElementVNode("button",{class:"btn",onClick:f[13]||(f[13]=e.withModifiers(m=>C("fixTables"),["stop"])),disabled:!i("fixTables")}," 修复表格 ",8,fn),e.createElementVNode("button",{class:"btn",onClick:f[14]||(f[14]=e.withModifiers(m=>C("goToNextCell"),["stop"])),disabled:!i("goToNextCell")}," 下个单元格 ",8,pn),e.createElementVNode("button",{class:"btn",onClick:f[15]||(f[15]=e.withModifiers(m=>C("goToPreviousCell"),["stop"])),disabled:!i("goToPreviousCell")}," 上个单元格 ",8,mn),e.createElementVNode("button",{class:"btn",onClick:f[16]||(f[16]=e.withModifiers(m=>C("setCellAttribute","backgroundColor","#FAF594"),["stop"])),disabled:!i("setCellAttribute","backgroundColor","#FAF594")}," 单元格着色 ",8,un)])])):e.createCommentVNode("",!0)],8,Ko)}}}),[["__scopeId","data-v-1aa3a259"]]),gn=J(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=e.inject("theme"),a=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⇧ ⌘ 9":"Ctrl Shift 9";function i(){const C=c.editor;if(C){C.chain().focus().toggleTaskList().run();try{const{state:p}=C,f=p.selection;let N=null;p.doc.nodesBetween(Math.max(0,f.from-5),Math.min(p.doc.content.size,f.to+5),(x,m)=>{var E;return((E=x==null?void 0:x.type)==null?void 0:E.name)==="taskItem"&&N==null?(N=m,!1):!0}),N!=null&&C.commands.setTextSelection(N+1)}catch{}}}return(C,p)=>(e.openBlock(),e.createElementBlock("div",{class:"icon",onClick:i},[e.createVNode(e.unref(U),{text:"任务列表",shortcut:e.unref(a),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"task",size:17,color:e.unref(r)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])]))}}),[["__scopeId","data-v-0a1c80da"]]),kn=J(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=e.inject("theme");function n(){const a=c.editor;a&&a.chain().focus().toggleBlockquote().run()}return(a,i)=>(e.openBlock(),e.createElementBlock("div",{class:"icon",onClick:n},[e.createVNode(e.unref(U),{text:"引用",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"quote",size:18,color:e.unref(r)==="dark"&&"#fff"},null,8,["color"])]),_:1})]))}}),[["__scopeId","data-v-dcd9c3cd"]]),wn=["aria-expanded"],Cn={class:"label"},yn={key:0,class:"dropdown",role:"listbox"},xn=["aria-selected","onClick"],bn={class:"shortcut"},Ve="md-toolbar-dropdown-open",$e="heading-select",Vn=J(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=typeof navigator<"u"&&navigator.platform.includes("Mac"),n={0:r?"⌥ ⌘ 0":"Ctrl Alt 0",1:r?"⌥ ⌘ 1":"Ctrl Alt 1",2:r?"⌥ ⌘ 2":"Ctrl Alt 2",3:r?"⌥ ⌘ 3":"Ctrl Alt 3",4:r?"⌥ ⌘ 4":"Ctrl Alt 4",5:r?"⌥ ⌘ 5":"Ctrl Alt 5",6:r?"⌥ ⌘ 6":"Ctrl Alt 6"},a=[{label:"正文",level:null,shortcut:n[0]},{label:"标题1",level:1,shortcut:n[1]},{label:"标题2",level:2,shortcut:n[2]},{label:"标题3",level:3,shortcut:n[3]},{label:"标题4",level:4,shortcut:n[4]},{label:"标题5",level:5,shortcut:n[5]},{label:"标题6",level:6,shortcut:n[6]}],i=e.computed(()=>{var d,s;const k=c.editor;if(!k)return null;for(let g=1;g<=6;g++)if((d=k.isActive)!=null&&d.call(k,"heading",{level:g}))return g;return(s=k.isActive)!=null&&s.call(k,"paragraph"),null}),C=e.computed(()=>{const k=i.value;return k?`标题${k}`:"正文"}),p=e.ref(!1),f=e.ref(null);function N(){p.value||window.dispatchEvent(new CustomEvent(Ve,{detail:{id:$e}})),p.value=!p.value}function x(){p.value=!1}function m(k){var s,g,h,u,B,z,v,w,M,S;const d=(u=(g=(s=c.editor)==null?void 0:s.chain)==null?void 0:(h=g.call(s)).focus)==null?void 0:u.call(h);d&&(k.level===null?(v=(B=d.setParagraph)==null?void 0:(z=B.call(d)).run)==null||v.call(z):(S=(M=(w=d.toggleHeading)==null?void 0:w.call(d,{level:k.level}))==null?void 0:M.run)==null||S.call(M),x())}function E(k){const d=k.target,s=f.value;s&&!s.contains(d)&&x()}function y(k){var s;((s=k.detail)==null?void 0:s.id)!==$e&&(p.value=!1)}return e.onMounted(()=>{document.addEventListener("click",E),window.addEventListener(Ve,y)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",E),window.removeEventListener(Ve,y)}),(k,d)=>(e.openBlock(),e.createElementBlock("div",{class:"heading-select",ref_key:"rootRef",ref:f},[e.createVNode(e.unref(U),{text:"标题级别",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon",onClick:e.withModifiers(N,["stop"]),"aria-expanded":p.value},[e.createElementVNode("div",Cn,e.toDisplayString(C.value),1),e.createVNode(e.unref(ue),{theme:"filled",strokeWidth:3})],8,wn)]),_:1}),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[p.value?(e.openBlock(),e.createElementBlock("div",yn,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(a,s=>e.createElementVNode("div",{key:s.label,class:"dropdown-item","aria-selected":s.level===i.value,onClick:e.withModifiers(g=>m(s),["stop"])},[s.level===i.value?(e.openBlock(),e.createBlock(e.unref(de),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["item-label",{paragraph:s.level===null,"level-1":s.level===1,"level-2":s.level===2,"level-3":s.level===3,"level-4":s.level===4,"level-5":s.level===5,"level-6":s.level===6}])},e.toDisplayString(s.label),3),e.createElementVNode("span",bn,e.toDisplayString(s.shortcut),1)],8,xn)),64))])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-b93823aa"]]),_n=["aria-expanded"],En={key:0,class:"dropdown",role:"menu"},Nn={class:"options"},_e="md-toolbar-dropdown-open",Te="align-select",vn=J(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=e.inject("theme"),n=e.computed(()=>{var u,B,z,v;const h=c.editor;return!h||(u=h.isActive)!=null&&u.call(h,{textAlign:"left"})?"left":(B=h.isActive)!=null&&B.call(h,{textAlign:"center"})?"center":(z=h.isActive)!=null&&z.call(h,{textAlign:"right"})?"right":(v=h.isActive)!=null&&v.call(h,{textAlign:"justify"})?"justify":"left"}),a=e.computed(()=>({left:"alignLeft",center:"alignCenter",right:"alignRight",justify:"alignJustify"})[n.value]);function i(h){var u,B,z,v,w,M,S,$;($=(M=(v=(B=(u=c.editor)==null?void 0:u.chain)==null?void 0:(z=B.call(u)).focus)==null?void 0:(w=v.call(z)).setTextAlign)==null?void 0:(S=M.call(w,h)).run)==null||$.call(S)}const C=e.ref(!1),p=e.ref(null),f=typeof navigator<"u"&&navigator.platform.includes("Mac"),N=f?"⇧ ⌘ L":"Ctrl Shift L",x=f?"⇧ ⌘ E":"Ctrl Shift E",m=f?"⇧ ⌘ R":"Ctrl Shift R",E=f?"⇧ ⌘ J":"Ctrl Shift J";function y(){C.value||window.dispatchEvent(new CustomEvent(_e,{detail:{id:Te}})),C.value=!C.value}function k(){C.value=!1}function d(h){i(h),k()}function s(h){const u=p.value,B=h.target;u&&!u.contains(B)&&k()}function g(h){var B;((B=h.detail)==null?void 0:B.id)!==Te&&(C.value=!1)}return e.onMounted(()=>{document.addEventListener("click",s),window.addEventListener(_e,g)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",s),window.removeEventListener(_e,g)}),(h,u)=>(e.openBlock(),e.createElementBlock("div",{class:"align-select",ref_key:"rootRef",ref:p},[e.createVNode(e.unref(U),{text:"对齐方式",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon_box",onClick:e.withModifiers(y,["stop"]),"aria-expanded":C.value},[e.createVNode(q,{name:a.value,size:18,color:e.unref(r)==="dark"&&"#fff"},null,8,["name","color"]),e.createVNode(q,{name:"caretDown",size:12,color:e.unref(r)==="dark"&&"#fff"},null,8,["color"])],8,_n)]),_:1}),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[C.value?(e.openBlock(),e.createElementBlock("div",En,[e.createElementVNode("div",Nn,[e.createElementVNode("div",{class:e.normalizeClass(["option",{active:n.value==="left"}]),role:"menuitem",onClick:u[0]||(u[0]=e.withModifiers(B=>d("left"),["stop"]))},[e.createVNode(e.unref(U),{text:"左对齐",shortcut:e.unref(N),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"alignLeft",size:16,color:e.unref(r)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["option",{active:n.value==="center"}]),role:"menuitem",onClick:u[1]||(u[1]=e.withModifiers(B=>d("center"),["stop"]))},[e.createVNode(e.unref(U),{text:"居中对齐",shortcut:e.unref(x),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"alignCenter",size:16,color:e.unref(r)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["option",{active:n.value==="right"}]),role:"menuitem",onClick:u[2]||(u[2]=e.withModifiers(B=>d("right"),["stop"]))},[e.createVNode(e.unref(U),{text:"右对齐",shortcut:e.unref(m),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"alignRight",size:16,color:e.unref(r)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["option",{active:n.value==="justify"}]),role:"menuitem",onClick:u[3]||(u[3]=e.withModifiers(B=>d("justify"),["stop"]))},[e.createVNode(e.unref(U),{text:"两端对齐",shortcut:e.unref(E),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"alignJustify",size:16,color:e.unref(r)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-b321e2b4"]]),Mn=["aria-disabled"],Bn=["aria-disabled"],Ln=J(e.defineComponent({__name:"index",props:{editor:{},currentColor:{},videoUploader:{type:Function},imageUploader:{type:Function},uploadSizeLimit:{},fullscreen:{type:Boolean},disabled:{type:Boolean}},emits:["openLinkModal","toggleFullscreen"],setup(t,{emit:c}){const r=t,n=e.inject("theme"),a=c,i=(_,V)=>{var o,l;return(l=(o=r.editor)==null?void 0:o.isActive)==null?void 0:l.call(o,_,V)},C=(_,V)=>{var b,F,T,D,L,H;const o=r.editor;if(!o)return;const l=(T=(b=o.chain)==null?void 0:(F=b.call(o)).focus)==null?void 0:T.call(F);return(H=(L=(D=l==null?void 0:l[_])==null?void 0:D.call(l))==null?void 0:L.run)==null?void 0:H.call(L)},p=()=>{var _,V,o,l;try{return!!((l=(V=(_=r.editor)==null?void 0:_.can)==null?void 0:(o=V.call(_)).undo)!=null&&l.call(o))}catch{return!1}},f=()=>{var _,V,o,l;try{return!!((l=(V=(_=r.editor)==null?void 0:_.can)==null?void 0:(o=V.call(_)).redo)!=null&&l.call(o))}catch{return!1}},N=()=>{var _,V,o;p()&&((o=(V=(_=r.editor)==null?void 0:_.commands)==null?void 0:V.undo)==null||o.call(V))},x=()=>{var _,V,o;return(o=(V=(_=r.editor)==null?void 0:_.commands)==null?void 0:V.redo)==null?void 0:o.call(V)},m=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⌘ Z":"Ctrl Z",E=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⇧ ⌘ Z":"Ctrl Y",y=typeof navigator<"u"&&navigator.platform.includes("Mac"),k=y?"⌘ B":"Ctrl B",d=y?"⌘ I":"Ctrl I",s=y?"⌘ U":"Ctrl U",g=y?"⇧ ⌘ X":"Ctrl Shift X",h=y?"⌘ \\":"Ctrl \\",u=y?"⇧ ⌘ S":"Ctrl Shift S",B=y?"⇧ ⌘ 8":"Ctrl Shift 8",z=y?"⇧ ⌘ 7":"Ctrl Shift 7",v=y?"⇧ ⌘ C":"Ctrl Shift C",w=e.ref(null),M=()=>{var V,o,l,b,F,T,D;const _=r.editor;_&&((D=(T=(F=(b=(l=(o=(V=_.chain())==null?void 0:V.focus())==null?void 0:o.unsetAllMarks)==null?void 0:l.call(o))==null?void 0:b.removeEmptyTextStyle)==null?void 0:F.call(b))==null?void 0:T.run)==null||D.call(T))},S=e.ref(!1),$=e.ref(!1),A=e.ref({}),j=e.ref(null),R=()=>{var o,l,b,F,T,D;const _=r.editor;if(!_)return;const V=((o=_.getAttributes)==null?void 0:o.call(_,"textStyle"))||{};A.value={bold:!!((l=_.isActive)!=null&&l.call(_,"bold")),italic:!!((b=_.isActive)!=null&&b.call(_,"italic")),strike:!!((F=_.isActive)!=null&&F.call(_,"strike")),underline:!!((T=_.isActive)!=null&&T.call(_,"underline")),code:!!((D=_.isActive)!=null&&D.call(_,"code")),textStyle:{...V!=null&&V.color?{color:V.color}:{},...V!=null&&V.backgroundColor?{backgroundColor:V.backgroundColor}:{},...V!=null&&V.fontSize?{fontSize:V.fontSize}:{}}}},W=()=>{var F,T,D,L,H,I,O,Q,oe,le,fe,Y;const _=r.editor;if(!_)return;const V=A.value;let o=(D=(F=_.chain)==null?void 0:(T=F.call(_)).focus)==null?void 0:D.call(T);const l=V.textStyle||{},b=(L=_.state)==null?void 0:L.selection;b&&b.from===b.to||(o=((H=o==null?void 0:o.unsetAllMarks)==null?void 0:H.call(o))||o,Object.keys(l).length&&(o=((I=o==null?void 0:o.setMark)==null?void 0:I.call(o,"textStyle",l))||o),V.bold&&(o=((O=o==null?void 0:o.toggleBold)==null?void 0:O.call(o))||o),V.italic&&(o=((Q=o==null?void 0:o.toggleItalic)==null?void 0:Q.call(o))||o),V.strike&&(o=((oe=o==null?void 0:o.toggleStrike)==null?void 0:oe.call(o))||o),V.underline&&(o=((le=o==null?void 0:o.toggleUnderline)==null?void 0:le.call(o))||o),V.code&&(o=((fe=o==null?void 0:o.toggleCode)==null?void 0:fe.call(o))||o),(Y=o==null?void 0:o.run)==null||Y.call(o))},Z=_=>{var l;const V=r.editor;if(!V)return;R(),S.value=!0,$.value=!!_;const o=(l=V.state)==null?void 0:l.selection;j.value=o?{from:o.from,to:o.to}:null},G=()=>{S.value=!1,$.value=!1},X=()=>{ae()},K=_=>{r.disabled||!((_.metaKey||_.ctrlKey)&&_.shiftKey&&(_.key==="s"||_.key==="S"))||!r.editor||(_.preventDefault(),Z(!1))},ne=_=>{var D,L,H,I;if(r.disabled)return;const V=_.metaKey||_.ctrlKey,o=_.key==="c"||_.key==="C";if(V&&_.shiftKey&&o){_.preventDefault(),C("toggleCodeBlock");return}const l=_.key==="f"||_.key==="F";if(V&&l){_.preventDefault();try{(L=(D=w.value)==null?void 0:D.openPanel)==null||L.call(D,"find")}catch{}return}const b=_.key==="h"||_.key==="H",F=_.metaKey&&_.altKey&&l,T=_.ctrlKey&&b;if(F||T){_.preventDefault();try{(I=(H=w.value)==null?void 0:H.openPanel)==null||I.call(H,"replace")}catch{}return}};let re=!1;const he=()=>{var V;const _=r.editor;!_||re||(re=!0,(V=_.on)==null||V.call(_,"selectionUpdate",X),window.addEventListener("keydown",K),window.addEventListener("keydown",ne),window.addEventListener("mouseup",ce,!0))},Ee=()=>{var V;const _=r.editor;_&&((V=_.off)==null||V.call(_,"selectionUpdate",X),window.removeEventListener("keydown",K),window.removeEventListener("keydown",ne),window.removeEventListener("mouseup",ce,!0),re=!1)};e.onMounted(()=>{he()}),e.onBeforeUnmount(()=>{Ee()}),e.watch(()=>r.editor,(_,V)=>{var o;V&&((o=V.off)==null||o.call(V,"selectionUpdate",X)),re=!1,he()});const ae=()=>{try{S.value?document.body.setAttribute("data-format-brush","true"):document.body.removeAttribute("data-format-brush")}catch{}};e.watch(S,ae),e.onMounted(ae),e.onBeforeUnmount(()=>{try{document.body.removeAttribute("data-format-brush")}catch{}});const ce=()=>{var l;if(r.disabled||!S.value)return;const _=r.editor;if(!_)return;const V=(l=_.state)==null?void 0:l.selection;if(!V||V.from===V.to)return;const o=j.value;o&&o.from===V.from&&o.to===V.to||(W(),j.value={from:V.from,to:V.to},$.value||G())};return(_,V)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["header_box",{disabled:!!r.disabled}])},[e.createElementVNode("div",{class:"icon","aria-disabled":!p(),onClick:N},[e.createVNode(e.unref(U),{text:"撤销",shortcut:e.unref(m),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(st),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],8,Mn),e.createElementVNode("div",{class:"icon","aria-disabled":!f(),onClick:x},[e.createVNode(e.unref(U),{text:"重做",shortcut:e.unref(E),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(rt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],8,Bn),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:S.value}]),onClick:V[0]||(V[0]=o=>Z(!1)),onDblclick:V[1]||(V[1]=o=>Z(!0))},[e.createVNode(e.unref(U),{text:"格式刷",shortcut:e.unref(u),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"formatBrush",size:18,color:e.unref(n)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],34),e.createElementVNode("div",{class:"icon",onClick:M},[e.createVNode(e.unref(U),{text:"清除格式",shortcut:e.unref(h),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"clearFormat",size:18,color:e.unref(n)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])]),e.createVNode(e.unref(Vn),{editor:r.editor},null,8,["editor"]),e.createVNode(e.unref(xt),{editor:r.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("bold")}]),onClick:V[2]||(V[2]=o=>C("toggleBold"))},[e.createVNode(e.unref(U),{text:"加粗",shortcut:e.unref(k),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(dt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("italic")}]),onClick:V[3]||(V[3]=o=>C("toggleItalic"))},[e.createVNode(e.unref(U),{text:"斜体",shortcut:e.unref(d),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(ft),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("strike")}]),onClick:V[4]||(V[4]=o=>C("toggleStrike"))},[e.createVNode(e.unref(U),{text:"删除线",shortcut:e.unref(g),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(ct),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("underline")}]),onClick:V[5]||(V[5]=o=>C("toggleUnderline"))},[e.createVNode(e.unref(U),{text:"下划线",shortcut:e.unref(s),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(pt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createVNode(e.unref(Dt),{editor:r.editor,currentColor:r.currentColor},null,8,["editor","currentColor"]),e.createVNode(e.unref(yo),{editor:r.editor},null,8,["editor"]),e.createVNode(e.unref(vn),{editor:r.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("bulletList")}]),onClick:V[6]||(V[6]=o=>C("toggleBulletList"))},[e.createVNode(e.unref(U),{text:"无序列表",shortcut:e.unref(B),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"bulletList",size:16,color:e.unref(n)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("orderedList")}]),onClick:V[7]||(V[7]=o=>C("toggleOrderedList"))},[e.createVNode(e.unref(U),{text:"有序列表",shortcut:e.unref(z),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"orderedList",size:16,color:e.unref(n)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2),e.createVNode(e.unref(gn),{editor:r.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("code")}]),onClick:V[8]||(V[8]=o=>C("toggleCode"))},[e.createVNode(e.unref(U),{text:"行内代码",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"code",size:18,color:e.unref(n)==="dark"&&"#fff"},null,8,["color"])]),_:1})],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:i("codeBlock")}]),onClick:V[9]||(V[9]=o=>C("toggleCodeBlock"))},[e.createVNode(e.unref(U),{text:"代码块",shortcut:e.unref(v),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"codeBlock",size:16,color:e.unref(n)==="dark"&&"#fff"},null,8,["color"])]),_:1},8,["shortcut"])],2),e.createVNode(e.unref(kn),{editor:r.editor},null,8,["editor"]),e.createVNode(e.unref(Oo),{editor:r.editor},null,8,["editor"]),e.createVNode(e.unref(Vo),{editor:r.editor,imageUploader:r.imageUploader,uploadSizeLimit:r.uploadSizeLimit},null,8,["editor","imageUploader","uploadSizeLimit"]),e.createVNode(e.unref(No),{editor:r.editor,videoUploader:r.videoUploader,uploadSizeLimit:r.uploadSizeLimit},null,8,["editor","videoUploader","uploadSizeLimit"]),e.createVNode(e.unref(Ho),{ref_key:"findRef",ref:w,editor:r.editor},null,8,["editor"]),e.createVNode(e.unref(Yo),{editor:r.editor},null,8,["editor"]),e.createVNode(e.unref(hn),{editor:r.editor},null,8,["editor"]),e.createElementVNode("div",{class:"icon",onClick:V[10]||(V[10]=o=>a("toggleFullscreen"))},[e.createVNode(e.unref(U),{text:r.fullscreen?"退出全屏":"全屏编辑",placement:"bottom"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.fullscreen?e.unref(it):e.unref(nt)),{theme:"outline",strokeWidth:3}))]),_:1},8,["text"])])],2))}}),[["__scopeId","data-v-8a946786"]]),zn={class:"outline__header"},Sn={class:"outline__listWrap"},$n={class:"outline__list"},Tn=["onClick"],Dn=["onClick"],Fn=J(e.defineComponent({__name:"index",props:{items:{},maxHeight:{},editor:{},container:{},duration:{},offset:{},open:{type:Boolean},pinned:{type:Boolean},theme:{}},emits:["select","update:open"],setup(t,{emit:c}){const r=t,n=c,a=e.inject("theme");function i(g){k(g),n("select",g)}function C(){n("update:open",!1),n("update:pinned",!1)}function p(){r.pinned||C()}function f(g){const h=[],u=[];for(const B of g){const z={...B,children:[]};for(;u.length&&u[u.length-1].level>=z.level;)u.pop();u.length?u[u.length-1].children.push(z):h.push(z),u.push(z)}return h}const N=e.ref(new Set);function x(g){return N.value.has(g.pos)}function m(g){const h=N.value;h.has(g.pos)?h.delete(g.pos):h.add(g.pos),N.value=new Set(h)}const E=e.computed(()=>f(r.items||[])),y=e.computed(()=>{const g=[],h=u=>{for(const B of u)g.push({node:B,level:B.level,hasChildren:B.children.length>0}),N.value.has(B.pos)||h(B.children)};return h(E.value),g});function k(g){const h=e.unref(r.editor);if(!h)return;const{doc:u}=h.state,B=u.nodeAt(g.pos),z=Math.max(1,u.content.size-1);let v=g.pos+1;B&&B.type.name==="heading"&&(v=g.pos+B.nodeSize-1),v=Math.min(Math.max(1,v),z),h.chain().focus().setTextSelection(v).run();const w=e.unref(r.container)??null,M=h.view.coordsAtPos(v),S=r.offset??8,$=r.duration??700;if(w){const A=w.getBoundingClientRect(),j=w.scrollTop+M.top-A.top-S;d(w,j,$)}else{const A=(window.scrollY||window.pageYOffset)+M.top-S;s(A,$)}}function d(g,h,u=600){const B=g.scrollTop,z=h-B,v=performance.now(),w=S=>S<.5?4*S*S*S:1-Math.pow(-2*S+2,3)/2;function M(S){const $=S-v,A=Math.min(1,$/u);g.scrollTop=B+z*w(A),A<1&&requestAnimationFrame(M)}requestAnimationFrame(M)}function s(g,h=600){const u=window.scrollY||window.pageYOffset,B=g-u,z=performance.now(),v=M=>M<.5?4*M*M*M:1-Math.pow(-2*M+2,3)/2;function w(M){const S=M-z,$=Math.min(1,S/h),A=u+B*v($);window.scrollTo(0,A),$<1&&requestAnimationFrame(w)}requestAnimationFrame(w)}return(g,h)=>(e.openBlock(),e.createElementBlock("div",{class:"outline-wrapper",onClick:h[1]||(h[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("aside",{class:e.normalizeClass(["outline",{isOpen:r.open,dark:r.theme==="dark"}]),style:e.normalizeStyle({maxHeight:typeof r.maxHeight=="number"?r.maxHeight+"px":r.maxHeight}),onMouseleave:p},[e.createElementVNode("div",zn,[h[2]||(h[2]=e.createElementVNode("div",{style:{"margin-right":"6px"}},"大纲",-1)),r.open&&!r.pinned?(e.openBlock(),e.createBlock(q,{key:0,style:{"margin-top":"2px"},name:"fixed",size:16,color:e.unref(a)==="dark"&&"#fff",onClick:h[0]||(h[0]=u=>g.$emit("update:pinned",!0))},null,8,["color"])):e.createCommentVNode("",!0),r.pinned?(e.openBlock(),e.createBlock(e.unref(lt),{key:1,onClick:C,theme:"outline",size:"16",strokeWidth:3})):e.createCommentVNode("",!0)]),e.createElementVNode("div",Sn,[e.createElementVNode("ul",$n,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(u,B)=>(e.openBlock(),e.createElementBlock("li",{key:u.node.pos+"-"+B,class:e.normalizeClass(["outline__item","lv-"+u.level])},[u.hasChildren?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["outline__caret",{collapsed:x(u.node),expanded:!x(u.node)}]),onClick:e.withModifiers(z=>m(u.node),["stop"]),title:"展开/收起"},[...h[3]||(h[3]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8 5l8 7-8 7V5z",fill:"currentColor"})],-1)])],10,Tn)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:"outline__text",onClick:z=>i(u.node)},e.toDisplayString(u.node.text||"(无标题)"),9,Dn)],2))),128))])])],38),e.createVNode(e.Transition,{name:"outline-mask"},{default:e.withCtx(()=>[r.open?(e.openBlock(),e.createElementBlock("div",{key:0,class:"outline-drawer-mask",onClick:C})):e.createCommentVNode("",!0)]),_:1})]))}}),[["__scopeId","data-v-64d05f68"]]),An=["onClick"],De=J(e.defineComponent({__name:"index",props:{modelValue:{},markdown:{},height:{},placeholder:{},imageUploader:{type:Function},videoUploader:{type:Function},caretColor:{},uploadSizeLimit:{},readonly:{type:Boolean},theme:{}},emits:["update:modelValue","update:markdown"],setup(t,{expose:c,emit:r}){const n=t,a=r;e.provide("theme",n.theme),e.watch(()=>n.theme,o=>{document.documentElement.classList.toggle("dark",o==="dark")});const i=e.ref(null);let C=!1;const p=e.ref(!1),f=e.ref(!1),N=e.ref(""),x=e.ref([]),m=e.ref("#000000"),E=e.ref(!0),y=e.ref(!0),k=e.ref(null),d=e.ref(void 0),s=e.ref([]),g=e.ref(null),h=o=>{var l;if(n.readonly)try{o.preventDefault(),(l=o.stopPropagation)==null||l.call(o)}catch{}},u=()=>{const o=k.value;d.value=o?o.clientHeight:void 0};let B=null;e.onMounted(()=>{u(),B=()=>u(),window.addEventListener("resize",B),e.nextTick(()=>{const o=k.value;o&&o.addEventListener("scroll",ce,{passive:!0})})}),e.onBeforeUnmount(()=>{B&&(window.removeEventListener("resize",B),B=null);const o=k.value;o&&o.removeEventListener("scroll",ce)}),e.watch([()=>n.height,E,p],async()=>{await e.nextTick(),u(),ce()}),e.watch(p,o=>{try{document.body.style.overflow=o?"hidden":""}catch{}try{o?window.addEventListener("keydown",z):window.removeEventListener("keydown",z)}catch{}});function z(o){o.key==="Escape"&&p.value&&(o.preventDefault(),p.value=!1)}const v=()=>n.theme==="dark"?"#fff":n.caretColor||"#000",w=e.computed(()=>{const o=b=>b==null?void 0:typeof b=="number"?`${b}px`:b,l=p.value?"100vh":o(n.height);return{height:l,"--editor-height":l,"--editor-caret-color":v}}),M=we.TextStyle.extend({addAttributes(){return{fontSize:{default:null,parseHTML:o=>o.style.fontSize||null,renderHTML:o=>o.fontSize?{style:`font-size: ${o.fontSize}`}:{}}}},addCommands(){return{setFontSize:o=>({chain:l})=>l().setMark("textStyle",{fontSize:o}).run(),unsetFontSize:()=>({chain:o})=>o().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),S=we.TextStyle.extend({addAttributes(){return{backgroundColor:{default:null,parseHTML:o=>o.style.backgroundColor||null,renderHTML:o=>o.backgroundColor?{style:`background-color: ${o.backgroundColor}`}:{}}}},addCommands(){return{setBackgroundColor:o=>({chain:l})=>l().setMark("textStyle",{backgroundColor:o}).run(),unsetBackgroundColor:()=>({chain:o})=>o().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}});e.onMounted(()=>{i.value=new ve.Editor({extensions:[He.StarterKit.configure({dropcursor:!1}),Ge.Dropcursor.configure({color:"#22c55e",width:2}),Be.TaskList,Ze,Ye.configure({inline:!0,allowBase64:!0}),Je.configure({HTMLAttributes:{class:"tiptap-video",controls:!0}}),Ue.Markdown,Me.TableKit.configure({table:{resizable:!0},tableCell:{HTMLAttributes:{class:"list-item"}}}),Ke,we.TextStyle,M,S,Re.Color,Pe.Underline,Oe.Link.configure({autolink:!0,linkOnPaste:!0,openOnClick:!1,HTMLAttributes:{target:"_blank",rel:"noopener noreferrer"}}),We.TextAlign.configure({types:["heading","paragraph"]}),Ie.Placeholder.configure({placeholder:n.placeholder??"输入 / 以插入块"})],content:n.modelValue!=null?String(n.modelValue||""):String(n.markdown||""),contentType:n.modelValue!=null&&/<\s*(video|iframe)\b|data-youtube-video|<\w+/i.test(String(n.modelValue||""))?"html":"markdown",editable:!n.readonly,autofocus:!n.readonly,editorProps:{handlePaste(o,l){var oe,le,fe;if(n.readonly){try{l.preventDefault()}catch{}return!0}const b=l.clipboardData;if(!b)return!1;const F=b.files&&b.files.length?Array.from(b.files):[],T=F.find(Y=>{var ee;return(ee=Y.type)==null?void 0:ee.startsWith("image/")});if(T){if(l.preventDefault(),!n.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return R(T),!0}const D=F.find(Y=>{var ee;return(ee=Y.type)==null?void 0:ee.startsWith("video/")});if(D)return l.preventDefault(),re(D),!0;const H=(b.items?Array.from(b.items):[]).find(Y=>Y.kind==="file"),I=H?H.getAsFile():null;if(I&&I.type.startsWith("image/")){if(l.preventDefault(),!n.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return R(I),!0}if(I&&I.type.startsWith("video/"))return l.preventDefault(),re(I),!0;const O=b.getData("text/html");if(O){const Y=O.match(/<img[^>]+src=["']([^"']+)["']/i),ee=O.replace(/\s+/g,"").match(/^<img[^>]+src=["']([^"']+)["'][^>]*>$/i);if(Y&&ee&&ee[1]){l.preventDefault();const me=ee[1];if(n.imageUploader&&/^data:image\//i.test(me)){const ge=G(me,"clipboard.png");R(ge)}else{if(/^data:image\//i.test(me)){const ge=G(me,"clipboard.png"),Ne=(oe=n.uploadSizeLimit)==null?void 0:oe.image;if(Ne){const Un=Math.max(1,Ne)*1024*1024;if(ge.size>Un){try{window.alert(`图片文件大小超限(${(ge.size/1024/1024).toFixed(2)}MB > ${Ne}MB)`)}catch{}return!0}}}$(me)}return!0}const se=O.match(/<video[^>]+src=["']([^"']+)["']/i),ie=O.match(/<source[^>]+src=["']([^"']+)["']/i),pe=O.replace(/\s+/g,"").match(/^<video[^>]*>.*<\/video>$/i),Ae=se&&se[1]||ie&&ie[1];if(Ae&&pe)return l.preventDefault(),j(Ae),!0}const Q=b.getData("text/plain");if(Q){const Y=Q.trim(),ee=ne(Y);if(X(Y)&&Y===Q.trim()){if(l.preventDefault(),/^data:image\//i.test(Y)){const se=G(Y,"clipboard.png"),ie=(le=n.uploadSizeLimit)==null?void 0:le.image;if(ie){const pe=Math.max(1,ie)*1024*1024;if(se.size>pe){try{window.alert(`图片文件大小超限(${(se.size/1024/1024).toFixed(2)}MB > ${ie}MB)`)}catch{}return!0}}}return $(Y),!0}if(ee){if(l.preventDefault(),/^data:image\//i.test(ee)){const se=G(ee,"clipboard.png"),ie=(fe=n.uploadSizeLimit)==null?void 0:fe.image;if(ie){const pe=Math.max(1,ie)*1024*1024;if(se.size>pe){try{window.alert(`图片文件大小超限(${(se.size/1024/1024).toFixed(2)}MB > ${ie}MB)`)}catch{}return!0}}}return $(ee),!0}if(K(Y)&&Y===Q.trim())return l.preventDefault(),j(Y),!0}return!1},handleDrop(o,l){if(n.readonly){try{l.preventDefault()}catch{}return!0}const b=l.dataTransfer;if(!b)return!1;const T=(b.files?Array.from(b.files):[]).find(D=>{var L;return(L=D.type)==null?void 0:L.startsWith("image/")});if(T){if(l.preventDefault(),!n.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return R(T),!0}return!1},handleClick(o,l,b){const F=b,T=F.target,D=T?T.closest("a[href]"):null;if(D&&(F.ctrlKey||F.metaKey)){const L=D.getAttribute("href")||"";if(L){F.preventDefault();try{window.open(L,"_blank","noopener,noreferrer")}catch(H){console.warn("打开链接失败:",H)}return!0}}return!1},handleDOMEvents:{dragstart(o,l){if(n.readonly){try{l.preventDefault()}catch{}return!0}return!1},dragover(o,l){if(n.readonly){try{l.preventDefault()}catch{}return!0}return!1},drop(o,l){if(n.readonly){try{l.preventDefault()}catch{}return!0}return!1}}},onSelectionUpdate:o=>{var F;const b=((F=o.editor.getAttributes("textStyle"))==null?void 0:F.color)||"#000000";m.value=typeof b=="string"?b:"#000000"},onUpdate:()=>{const o=i.value;C=!0,a("update:modelValue",o.getHTML()),a("update:markdown",o.getMarkdown()),ae()},onTransaction:()=>{ae()},theme:e.computed(()=>n.theme?"dark":"light")}),e.nextTick(()=>{var o,l,b,F,T,D;ae();try{n.readonly||(o=i.value)==null||o.chain().focus().run()}catch{}try{const L=((b=(l=i.value)==null?void 0:l.view)==null?void 0:b.dom)||null;(F=L==null?void 0:L.addEventListener)==null||F.call(L,"dragstart",h,!0),(T=L==null?void 0:L.addEventListener)==null||T.call(L,"dragover",h,!0),(D=L==null?void 0:L.addEventListener)==null||D.call(L,"drop",h,!0)}catch{}})}),e.onBeforeUnmount(()=>{var o,l,b,F,T,D;try{const L=((l=(o=i.value)==null?void 0:o.view)==null?void 0:l.dom)||null;(b=L==null?void 0:L.removeEventListener)==null||b.call(L,"dragstart",h,!0),(F=L==null?void 0:L.removeEventListener)==null||F.call(L,"dragover",h,!0),(T=L==null?void 0:L.removeEventListener)==null||T.call(L,"drop",h,!0)}catch{}(D=i.value)==null||D.destroy()}),e.watch(()=>n.modelValue,o=>{if(C){C=!1;return}o!=null&&i.value&&e.nextTick(()=>{try{const l=/<\s*(video|iframe)\b|data-youtube-video/i.test(o),b=o.match(/\[video\]\(([^)]+)\)/i);if(!l&&b){const F=b[1],T=o.replace(/\[video\]\(([^)]+)\)/gi,(D,L)=>`<video data-tiptap-video src="${L}" controls></video>`);i.value.commands.setContent(T,{contentType:"html"})}else i.value.commands.setContent(o,{contentType:l?"html":"markdown"})}catch(l){console.warn("setContent 失败,内容更新被忽略:",l)}})}),e.watch(()=>n.readonly,o=>{var l,b;try{(b=(l=i.value)==null?void 0:l.setEditable)==null||b.call(l,!o)}catch{}}),e.watch(()=>n.markdown,o=>{if(C){C=!1;return}n.modelValue==null&&o!=null&&i.value&&e.nextTick(()=>{try{i.value.commands.setContent(o,{contentType:"markdown"})}catch(l){console.warn("setContent 失败,内容更新被忽略:",l)}})});function $(o){var l;(l=i.value)==null||l.chain().focus().setImage({src:o}).run()}function A(o){return String(o).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function j(o){const l=i.value;if(!l)return;if(typeof l.commands.setVideo=="function"){l.chain().focus().setVideo({src:o,HTMLAttributes:{controls:!0,autoplay:!1,width:640}}).run();return}const F=A(o);try{l.chain().focus().insertContent(`<p><a href="${F}" target="_blank" rel="noopener noreferrer">${F}</a></p>`).run()}catch{l.chain().focus().insertContent(F).run()}}async function R(o){var b,F;const l=(b=n.uploadSizeLimit)==null?void 0:b.image;if(l){const T=Math.max(1,l)*1024*1024;if(o.size>T){try{window.alert(`图片文件大小超限(${(o.size/1024/1024).toFixed(2)}MB > ${l}MB)`)}catch{}return}}if(n.imageUploader){const T=URL.createObjectURL(o);(F=i.value)==null||F.chain().focus().setImage({src:T,uploading:!0}).run();try{const D=await n.imageUploader(o);if(typeof D=="string"&&D){W(T,D);return}Z(o,L=>W(T,L))}catch(D){console.warn("图片上传失败,回退为 base64",D),Z(o,L=>W(T,L))}finally{try{URL.revokeObjectURL(T)}catch{}}return}try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}}function W(o,l){var L,H;const b=i.value;if(!b)return;const{state:F}=b,{doc:T}=F;let D=null;if(T.descendants((I,O)=>{var Q,oe;return((Q=I.type)==null?void 0:Q.name)==="image"&&((oe=I.attrs)==null?void 0:oe.src)===o?(D=O,!1):!0}),D!=null){const I=T.nodeAt(D),O=F.schema.nodes.image;if(!I||!O)return;const Q={...I.attrs||{},src:l,uploading:null},oe=F.tr.setNodeMarkup(D,O,Q,I.marks);b.view.dispatch(oe);try{(H=(L=b.options)==null?void 0:L.onUpdate)==null||H.call(L,{editor:b})}catch{}}else $(l)}function Z(o,l){const b=new FileReader;b.onload=()=>l(String(b.result||"")),b.readAsDataURL(o)}function G(o,l="image.png"){var H;const b=o.split(","),F=((H=b[0].match(/:(.*?);/))==null?void 0:H[1])||"image/png",T=atob(b[1]);let D=T.length;const L=new Uint8Array(D);for(;D--;)L[D]=T.charCodeAt(D);return new File([L],l,{type:F})}function X(o){return/^data:image\//i.test(o)||/^https?:\/\//i.test(o)&&/\.(png|jpe?g|gif|webp|svg)(\?.*)?$/i.test(o)}function K(o){return/^https?:\/\//i.test(o)&&/\.(mp4|webm|m3u8|mov|ogv?)(\?.*)?$/i.test(o)}function ne(o){const l=o.match(/^!\[[^\]]*\]\(([^)]+)\)\s*$/);if(!l)return null;const b=l[1].trim().replace(/^<|>$/g,"");return X(b)?b:null}async function re(o){var F;const l=(F=n.uploadSizeLimit)==null?void 0:F.video;if(l){const T=Math.max(1,l)*1024*1024;if(o.size>T){try{window.alert(`视频文件大小超限(${(o.size/1024/1024).toFixed(2)}MB > ${l}MB)`)}catch{}return}}if(n.videoUploader){const T=URL.createObjectURL(o),D=i.value,L=D==null?void 0:D.commands;try{typeof(L==null?void 0:L.setVideo)=="function"?D==null||D.chain().focus().setVideo({src:T,HTMLAttributes:{controls:!0,autoplay:!1,width:640,uploading:!0}}).run():j(T)}catch{j(T)}try{const H=await n.videoUploader(o);he(T,H)}catch(H){console.warn("视频上传失败,保留本地对象 URL 作为预览",H)}finally{try{URL.revokeObjectURL(T)}catch{}}return}const b=URL.createObjectURL(o);j(b)}function he(o,l){const b=i.value;if(!b)return;const{state:F}=b,{doc:T}=F;let D=null;if(T.descendants((L,H)=>{var I,O;return((I=L.type)==null?void 0:I.name)==="video"&&((O=L.attrs)==null?void 0:O.src)===o?(D=H,!1):!0}),D!=null){const L=T.nodeAt(D),H=F.schema.nodes.video;if(!L||!H)return;const I={...L.attrs||{},src:l,uploading:null},O=F.tr.setNodeMarkup(D,H,I,L.marks);b.view.dispatch(O)}}function Ee(){var o,l;N.value=((l=(o=i.value)==null?void 0:o.getAttributes("link"))==null?void 0:l.href)||"",f.value=!0}function ae(){const o=i.value;if(!o)return;const l=[];o.state.doc.descendants((b,F)=>{if(b.type.name==="heading"){const T=b.attrs.level||1,D=b.textContent||"";l.push({text:D,level:T,pos:F})}}),x.value=l,ce()}function ce(){const o=i.value,l=k.value,b=x.value;if(!o||!l||!b.length){s.value=[],g.value=null;return}const F=l.getBoundingClientRect(),T=l.scrollHeight||l.clientHeight,D=l.clientHeight||1,L=b.map(O=>{const oe=o.view.coordsAtPos(Math.min(O.pos+1,o.state.doc.content.size)).top-F.top+l.scrollTop,le=T?Math.max(0,Math.min(1,oe/T)):0;return Math.round(le*D)});s.value=L;const H=l.scrollTop+8;let I=null;for(let O=0;O<b.length;O++){const Q=b[O];if(o.view.coordsAtPos(Math.min(Q.pos+1,o.state.doc.content.size)).top-F.top+l.scrollTop<=H)I=Q.pos;else break}g.value=I}function _(o){const l=o.target;l.closest(".outline")||l.closest(".outline-toggle")||i.value&&i.value.chain().focus().run()}function V(){const o=i.value;return o?o.getMarkdown():""}return c({getMarkdown:V}),(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["simple-editor",{fullscreen:p.value,readonly:!!n.readonly,dark:n.theme==="dark"}]),style:e.normalizeStyle(w.value)},[e.createVNode(e.unref(Ln),{editor:i.value,currentColor:m.value,imageUploader:t.imageUploader,videoUploader:t.videoUploader,"upload-size-limit":n.uploadSizeLimit,fullscreen:p.value,disabled:!!n.readonly,onToggleFullscreen:l[0]||(l[0]=b=>p.value=!p.value),onOpenLinkModal:Ee},null,8,["editor","currentColor","imageUploader","videoUploader","upload-size-limit","fullscreen","disabled"]),e.createElementVNode("div",{class:e.normalizeClass(["editor_main",{hasOutline:E.value}])},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:k,class:"editor_wrapper",onClick:_},[e.createVNode(e.unref(ve.EditorContent),{editor:i.value,class:"content"},null,8,["editor"])],512),e.createVNode(e.unref(Fn),{open:E.value,"onUpdate:open":l[1]||(l[1]=b=>E.value=b),items:x.value,editor:i.value,container:k.value,maxHeight:d.value,pinned:y.value,theme:n.theme,"onUpdate:pinned":l[2]||(l[2]=b=>y.value=b)},null,8,["open","items","editor","container","maxHeight","pinned","theme"]),E.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"outline-markers",onMouseenter:l[3]||(l[3]=b=>(E.value=!0,y.value=!1))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(b,F)=>{var T;return e.openBlock(),e.createElementBlock("span",{key:F,class:e.normalizeClass(["outline-marker",{active:((T=x.value[F])==null?void 0:T.pos)===g.value}]),style:e.normalizeStyle({top:(b||0)+"px"}),onClick:e.withModifiers(D=>{var L,H;return(H=i.value)==null?void 0:H.chain().focus().setTextSelection((((L=x.value[F])==null?void 0:L.pos)||1)+1).run()},["stop"])},null,14,An)}),128))],32))],2)],6))}}),[["__scopeId","data-v-0dda272d"]]),Hn={install(t){t.component("Editor",De)}};P.Editor=De,P.default=Hn,Object.defineProperties(P,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|