(function(d,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("prosemirror-model"),require("@tiptap/core"),require("prosemirror-state"),require("uuid"),require("prosemirror-highlight"),require("prosemirror-highlight/shiki"),require("shiki"),require("shiki/bundle/web"),require("prosemirror-tables"),require("@tiptap/extension-bold"),require("@tiptap/extension-code"),require("@tiptap/extension-italic"),require("@tiptap/extension-strike"),require("@tiptap/extension-underline"),require("prosemirror-transform"),require("@tiptap/extension-table-cell"),require("@tiptap/extension-table-header"),require("@tiptap/extension-table-row"),require("prosemirror-view"),require("@tiptap/extension-collaboration"),require("@tiptap/extension-collaboration-cursor"),require("@tiptap/extension-gapcursor"),require("@tiptap/extension-hard-break"),require("@tiptap/extension-history"),require("@tiptap/extension-link"),require("@tiptap/extension-text"),require("prosemirror-dropcursor")):typeof define=="function"&&define.amd?define(["exports","prosemirror-model","@tiptap/core","prosemirror-state","uuid","prosemirror-highlight","prosemirror-highlight/shiki","shiki","shiki/bundle/web","prosemirror-tables","@tiptap/extension-bold","@tiptap/extension-code","@tiptap/extension-italic","@tiptap/extension-strike","@tiptap/extension-underline","prosemirror-transform","@tiptap/extension-table-cell","@tiptap/extension-table-header","@tiptap/extension-table-row","prosemirror-view","@tiptap/extension-collaboration","@tiptap/extension-collaboration-cursor","@tiptap/extension-gapcursor","@tiptap/extension-hard-break","@tiptap/extension-history","@tiptap/extension-link","@tiptap/extension-text","prosemirror-dropcursor"],v):(d=typeof globalThis<"u"?globalThis:d||self,v(d.blocknote={},d.prosemirrorModel,d.core,d.prosemirrorState,d.uuid,d.prosemirrorHighlight,d.shiki$1,d.shiki,d.web,d.prosemirrorTables,d.Bold,d.Code,d.Italic,d.Strike,d.Underline,d.prosemirrorTransform,d.extensionTableCell,d.extensionTableHeader,d.extensionTableRow,d.pmView,d.Collaboration,d.CollaborationCursor,d.extensionGapcursor,d.extensionHardBreak,d.extensionHistory,d.extensionLink,d.extensionText,d.prosemirrorDropcursor))})(this,function(d,v,k,_,ti,oi,ii,lt,ni,$,ai,ri,si,li,di,be,ci,ui,pi,x,hi,mi,fi,gi,bi,ki,_i,yi){"use strict";var Ka=Object.defineProperty;var qa=(d,v,k)=>v in d?Ka(d,v,{enumerable:!0,configurable:!0,writable:!0,value:k}):d[v]=k;var p=(d,v,k)=>qa(d,typeof v!="symbol"?v+"":v,k);const W=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function vi(e){if(e&&typeof e=="object"&&"default"in e)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const wi=W(ai),Ci=W(ri),Ei=W(si),xi=W(li),Si=W(di),dt=vi(x),Bi=W(hi),Ti=W(mi),Mi={slash_menu:{heading:{title:"عنوان 1",subtext:"يستخدم لعناوين المستوى الأعلى",aliases:["ع","عنوان1","ع1"],group:"العناوين"},heading_2:{title:"عنوان 2",subtext:"يستخدم للأقسام الرئيسية",aliases:["ع2","عنوان2","عنوان فرعي"],group:"العناوين"},heading_3:{title:"عنوان 3",subtext:"يستخدم للأقسام الفرعية والعناوين المجموعة",aliases:["ع3","عنوان3","عنوان فرعي"],group:"العناوين"},numbered_list:{title:"قائمة مرقمة",subtext:"تستخدم لعرض قائمة مرقمة",aliases:["ق","عناصر قائمة","قائمة","قائمة مرقمة"],group:"الكتل الأساسية"},bullet_list:{title:"قائمة نقطية",subtext:"تستخدم لعرض قائمة غير مرتبة",aliases:["ق","عناصر قائمة","قائمة","قائمة نقطية"],group:"الكتل الأساسية"},check_list:{title:"قائمة تحقق",subtext:"تستخدم لعرض قائمة بمربعات التحقق",aliases:["قوائم غير مرتبة","عناصر قائمة","قائمة","قائمة تحقق","قائمة التحقق","قائمة مشطوبة","مربع التحقق"],group:"الكتل الأساسية"},paragraph:{title:"فقرة",subtext:"تستخدم لنص الوثيقة الأساسي",aliases:["ف","فقرة"],group:"الكتل الأساسية"},code_block:{title:"كود",subtext:"يستخدم لعرض الكود مع تحديد الصيغة",aliases:["كود","مسبق"],group:"الكتل الأساسية"},table:{title:"جدول",subtext:"يستخدم للجداول",aliases:["جدول"],group:"متقدم"},image:{title:"صورة",subtext:"إدراج صورة",aliases:["صورة","رفع صورة","تحميل","صورة","صورة","وسائط","رابط"],group:"وسائط"},video:{title:"فيديو",subtext:"إدراج فيديو",aliases:["فيديو","رفع فيديو","تحميل","فيديو","فيلم","وسائط","رابط"],group:"وسائط"},audio:{title:"صوت",subtext:"إدراج صوت",aliases:["صوت","رفع صوت","تحميل","صوت","صوت","وسائط","رابط"],group:"وسائط"},file:{title:"ملف",subtext:"إدراج ملف",aliases:["ملف","تحميل","تضمين","وسائط","رابط"],group:"وسائط"},emoji:{title:"الرموز التعبيرية",subtext:"تُستخدم لإدراج رمز تعبيري",aliases:["رمز تعبيري","إيموجي","إيموت","عاطفة","وجه"],group:"آخرون"}},placeholders:{default:"أدخل نصًا أو اكتب '/' للأوامر",heading:"عنوان",bulletListItem:"قائمة",numberedListItem:"قائمة",checkListItem:"قائمة"},file_blocks:{image:{add_button_text:"إضافة صورة"},video:{add_button_text:"إضافة فيديو"},audio:{add_button_text:"إضافة صوت"},file:{add_button_text:"إضافة ملف"}},side_menu:{add_block_label:"إضافة محتوي",drag_handle_label:"فتح قائمة المحتويات"},drag_handle:{delete_menuitem:"حذف",colors_menuitem:"ألوان"},table_handle:{delete_column_menuitem:"حذف عمود",delete_row_menuitem:"حذف صف",add_left_menuitem:"إضافة عمود إلى اليسار",add_right_menuitem:"إضافة عمود إلى اليمين",add_above_menuitem:"إضافة صف أعلى",add_below_menuitem:"إضافة صف أسفل"},suggestion_menu:{no_items_title:"لم يتم العثور على عناصر",loading:"جارٍ التحميل…"},color_picker:{text_title:"نص",background_title:"خلفية",colors:{default:"افتراضي",gray:"رمادي",brown:"بني",red:"أحمر",orange:"برتقالي",yellow:"أصفر",green:"أخضر",blue:"أزرق",purple:"أرجواني",pink:"وردي"}},formatting_toolbar:{bold:{tooltip:"عريض",secondary_tooltip:"Mod+B"},italic:{tooltip:"مائل",secondary_tooltip:"Mod+I"},underline:{tooltip:"تحته خط",secondary_tooltip:"Mod+U"},strike:{tooltip:"مشطوب",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"كود",secondary_tooltip:""},colors:{tooltip:"ألوان"},link:{tooltip:"إنشاء رابط",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"تحرير التسمية التوضيحية",input_placeholder:"تحرير التسمية التوضيحية"},file_replace:{tooltip:{image:"استبدال الصورة",video:"استبدال الفيديو",audio:"استبدال الصوت",file:"استبدال الملف"}},file_rename:{tooltip:{image:"إعادة تسمية الصورة",video:"إعادة تسمية الفيديو",audio:"إعادة تسمية الصوت",file:"إعادة تسمية الملف"},input_placeholder:{image:"إعادة تسمية الصورة",video:"إعادة تسمية الفيديو",audio:"إعادة تسمية الصوت",file:"إعادة تسمية الملف"}},file_download:{tooltip:{image:"تنزيل الصورة",video:"تنزيل الفيديو",audio:"تنزيل الصوت",file:"تنزيل الملف"}},file_delete:{tooltip:{image:"حذف الصورة",video:"حذف الفيديو",audio:"حذف الصوت",file:"حذف الملف"}},file_preview_toggle:{tooltip:"تبديل المعاينة"},nest:{tooltip:"محتويات متداخلة",secondary_tooltip:"Tab"},unnest:{tooltip:"إلغاء التداخل",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"محاذاة النص إلى اليسار"},align_center:{tooltip:"محاذاة النص في المنتصف"},align_right:{tooltip:"محاذاة النص إلى اليمين"},align_justify:{tooltip:"ضبط النص"}},file_panel:{upload:{title:"تحميل",file_placeholder:{image:"تحميل صورة",video:"تحميل فيديو",audio:"تحميل صوت",file:"تحميل ملف"},upload_error:"خطأ: فشل التحميل"},embed:{title:"تضمين",embed_button:{image:"تضمين صورة",video:"تضمين فيديو",audio:"تضمين صوت",file:"تضمين ملف"},url_placeholder:"أدخل الرابط"}},link_toolbar:{delete:{tooltip:"إزالة الرابط"},edit:{text:"تحرير الرابط",tooltip:"تحرير"},open:{tooltip:"فتح في تبويب جديد"},form:{title_placeholder:"تحرير العنوان",url_placeholder:"تحرير الرابط"}},generic:{ctrl_shortcut:"Ctrl"}},Li={slash_menu:{heading:{title:"Überschrift 1",subtext:"Hauptebene Überschrift",aliases:["h","überschrift1","h1"],group:"Überschriften"},heading_2:{title:"Überschrift 2",subtext:"Wichtige Abschnittsüberschrift",aliases:["h2","überschrift2","unterüberschrift"],group:"Überschriften"},heading_3:{title:"Überschrift 3",subtext:"Unterabschnitts- und Gruppenüberschrift",aliases:["h3","überschrift3","unterüberschrift"],group:"Überschriften"},numbered_list:{title:"Nummerierte Liste",subtext:"Liste mit nummerierten Elementen",aliases:["ol","li","liste","nummerierteliste","nummerierte liste"],group:"Grundlegende blöcke"},bullet_list:{title:"Aufzählungsliste",subtext:"Liste mit unnummerierten Elementen",aliases:["ul","li","liste","aufzählungsliste","aufzählung liste"],group:"Grundlegende blöcke"},check_list:{title:"Checkliste",subtext:"Liste mit Kontrollkästchen",aliases:["ul","li","liste","checkliste","check liste","geprüfte liste","kontrollkästchen"],group:"Grundlegende blöcke"},paragraph:{title:"Absatz",subtext:"Der Hauptteil Ihres Dokuments",aliases:["p","absatz"],group:"Grundlegende blöcke"},code_block:{title:"Codeblock",subtext:"Codeblock mit Syntaxhervorhebung",aliases:["code","pre"],group:"Grundlegende blöcke"},table:{title:"Tabelle",subtext:"Tabelle mit editierbaren Zellen",aliases:["tabelle"],group:"Erweitert"},image:{title:"Bild",subtext:"Größenveränderbares Bild mit Beschriftung",aliases:["bild","bildhochladen","hochladen","img","bild","medien","url"],group:"Medien"},video:{title:"Video",subtext:"Größenveränderbares Video mit Beschriftung",aliases:["video","videoupload","hochladen","mp4","film","medien","url"],group:"Medien"},audio:{title:"Audio",subtext:"Eingebettetes Audio mit Beschriftung",aliases:["audio","audioupload","hochladen","mp3","ton","medien","url"],group:"Medien"},file:{title:"Datei",subtext:"Eingebettete Datei",aliases:["datei","hochladen","einbetten","medien","url"],group:"Medien"},emoji:{title:"Emoji",subtext:"Nach Emoji suchen und einfügen",aliases:["emoji","emote","emotion","gesicht"],group:"Andere"}},placeholders:{default:"Text eingeben oder '/' für Befehle tippen",heading:"Überschrift",bulletListItem:"Liste",numberedListItem:"Liste",checkListItem:"Liste"},file_blocks:{image:{add_button_text:"Bild hinzufügen"},video:{add_button_text:"Video hinzufügen"},audio:{add_button_text:"Audio hinzufügen"},file:{add_button_text:"Datei hinzufügen"}},side_menu:{add_block_label:"Block hinzufügen",drag_handle_label:"Blockmenü öffnen"},drag_handle:{delete_menuitem:"Löschen",colors_menuitem:"Farben"},table_handle:{delete_column_menuitem:"Spalte löschen",delete_row_menuitem:"Zeile löschen",add_left_menuitem:"Spalte links hinzufügen",add_right_menuitem:"Spalte rechts hinzufügen",add_above_menuitem:"Zeile oberhalb hinzufügen",add_below_menuitem:"Zeile unterhalb hinzufügen"},suggestion_menu:{no_items_title:"Keine Elemente gefunden",loading:"Laden…"},color_picker:{text_title:"Text",background_title:"Hintergrund",colors:{default:"Standard",gray:"Grau",brown:"Braun",red:"Rot",orange:"Orange",yellow:"Gelb",green:"Grün",blue:"Blau",purple:"Lila",pink:"Rosa"}},formatting_toolbar:{bold:{tooltip:"Fett",secondary_tooltip:"Mod+B"},italic:{tooltip:"Kursiv",secondary_tooltip:"Mod+I"},underline:{tooltip:"Unterstrichen",secondary_tooltip:"Mod+U"},strike:{tooltip:"Durchgestrichen",secondary_tooltip:"Mod+Shift+S"},code:{tooltip:"Code",secondary_tooltip:""},colors:{tooltip:"Farben"},link:{tooltip:"Link erstellen",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Beschriftung bearbeiten",input_placeholder:"Beschriftung bearbeiten"},file_replace:{tooltip:{image:"Bild ersetzen",video:"Video ersetzen",audio:"Audio ersetzen",file:"Datei ersetzen"}},file_rename:{tooltip:{image:"Bild umbenennen",video:"Video umbenennen",audio:"Audio umbenennen",file:"Datei umbenennen"},input_placeholder:{image:"Bild umbenennen",video:"Video umbenennen",audio:"Audio umbenennen",file:"Datei umbenennen"}},file_download:{tooltip:{image:"Bild herunterladen",video:"Video herunterladen",audio:"Audio herunterladen",file:"Datei herunterladen"}},file_delete:{tooltip:{image:"Bild löschen",video:"Video löschen",audio:"Audio löschen",file:"Datei löschen"}},file_preview_toggle:{tooltip:"Vorschau umschalten"},nest:{tooltip:"Block verschachteln",secondary_tooltip:"Tab"},unnest:{tooltip:"Block entnesten",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Text linksbündig"},align_center:{tooltip:"Text zentrieren"},align_right:{tooltip:"Text rechtsbündig"},align_justify:{tooltip:"Text Blocksatz"}},file_panel:{upload:{title:"Hochladen",file_placeholder:{image:"Bild hochladen",video:"Video hochladen",audio:"Audio hochladen",file:"Datei hochladen"},upload_error:"Fehler: Hochladen fehlgeschlagen"},embed:{title:"Einbetten",embed_button:{image:"Bild einbetten",video:"Video einbetten",audio:"Audio einbetten",file:"Datei einbetten"},url_placeholder:"URL eingeben"}},link_toolbar:{delete:{tooltip:"Link entfernen"},edit:{text:"Link bearbeiten",tooltip:"Bearbeiten"},open:{tooltip:"In neuem Tab öffnen"},form:{title_placeholder:"Titel bearbeiten",url_placeholder:"URL bearbeiten"}},generic:{ctrl_shortcut:"Strg"}},ct={slash_menu:{heading:{title:"Heading 1",subtext:"Top-level heading",aliases:["h","heading1","h1"],group:"Headings"},heading_2:{title:"Heading 2",subtext:"Key section heading",aliases:["h2","heading2","subheading"],group:"Headings"},heading_3:{title:"Heading 3",subtext:"Subsection and group heading",aliases:["h3","heading3","subheading"],group:"Headings"},numbered_list:{title:"Numbered List",subtext:"List with ordered items",aliases:["ol","li","list","numberedlist","numbered list"],group:"Basic blocks"},bullet_list:{title:"Bullet List",subtext:"List with unordered items",aliases:["ul","li","list","bulletlist","bullet list"],group:"Basic blocks"},check_list:{title:"Check List",subtext:"List with checkboxes",aliases:["ul","li","list","checklist","check list","checked list","checkbox"],group:"Basic blocks"},paragraph:{title:"Paragraph",subtext:"The body of your document",aliases:["p","paragraph"],group:"Basic blocks"},code_block:{title:"Code Block",subtext:"Code block with syntax highlighting",aliases:["code","pre"],group:"Basic blocks"},table:{title:"Table",subtext:"Table with editable cells",aliases:["table"],group:"Advanced"},image:{title:"Image",subtext:"Resizable image with caption",aliases:["image","imageUpload","upload","img","picture","media","url"],group:"Media"},video:{title:"Video",subtext:"Resizable video with caption",aliases:["video","videoUpload","upload","mp4","film","media","url"],group:"Media"},audio:{title:"Audio",subtext:"Embedded audio with caption",aliases:["audio","audioUpload","upload","mp3","sound","media","url"],group:"Media"},file:{title:"File",subtext:"Embedded file",aliases:["file","upload","embed","media","url"],group:"Media"},emoji:{title:"Emoji",subtext:"Search for and insert an emoji",aliases:["emoji","emote","emotion","face"],group:"Others"}},placeholders:{default:"Enter text or type '/' for commands",heading:"Heading",bulletListItem:"List",numberedListItem:"List",checkListItem:"List"},file_blocks:{image:{add_button_text:"Add image"},video:{add_button_text:"Add video"},audio:{add_button_text:"Add audio"},file:{add_button_text:"Add file"}},side_menu:{add_block_label:"Add block",drag_handle_label:"Open block menu"},drag_handle:{delete_menuitem:"Delete",colors_menuitem:"Colors"},table_handle:{delete_column_menuitem:"Delete column",delete_row_menuitem:"Delete row",add_left_menuitem:"Add column left",add_right_menuitem:"Add column right",add_above_menuitem:"Add row above",add_below_menuitem:"Add row below"},suggestion_menu:{no_items_title:"No items found",loading:"Loading…"},color_picker:{text_title:"Text",background_title:"Background",colors:{default:"Default",gray:"Gray",brown:"Brown",red:"Red",orange:"Orange",yellow:"Yellow",green:"Green",blue:"Blue",purple:"Purple",pink:"Pink"}},formatting_toolbar:{bold:{tooltip:"Bold",secondary_tooltip:"Mod+B"},italic:{tooltip:"Italic",secondary_tooltip:"Mod+I"},underline:{tooltip:"Underline",secondary_tooltip:"Mod+U"},strike:{tooltip:"Strike",secondary_tooltip:"Mod+Shift+S"},code:{tooltip:"Code",secondary_tooltip:""},colors:{tooltip:"Colors"},link:{tooltip:"Create link",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Edit caption",input_placeholder:"Edit caption"},file_replace:{tooltip:{image:"Replace image",video:"Replace video",audio:"Replace audio",file:"Replace file"}},file_rename:{tooltip:{image:"Rename image",video:"Rename video",audio:"Rename audio",file:"Rename file"},input_placeholder:{image:"Rename image",video:"Rename video",audio:"Rename audio",file:"Rename file"}},file_download:{tooltip:{image:"Download image",video:"Download video",audio:"Download audio",file:"Download file"}},file_delete:{tooltip:{image:"Delete image",video:"Delete video",audio:"Delete audio",file:"Delete file"}},file_preview_toggle:{tooltip:"Toggle preview"},nest:{tooltip:"Nest block",secondary_tooltip:"Tab"},unnest:{tooltip:"Unnest block",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Align text left"},align_center:{tooltip:"Align text center"},align_right:{tooltip:"Align text right"},align_justify:{tooltip:"Justify text"}},file_panel:{upload:{title:"Upload",file_placeholder:{image:"Upload image",video:"Upload video",audio:"Upload audio",file:"Upload file"},upload_error:"Error: Upload failed"},embed:{title:"Embed",embed_button:{image:"Embed image",video:"Embed video",audio:"Embed audio",file:"Embed file"},url_placeholder:"Enter URL"}},link_toolbar:{delete:{tooltip:"Remove link"},edit:{text:"Edit link",tooltip:"Edit"},open:{tooltip:"Open in new tab"},form:{title_placeholder:"Edit title",url_placeholder:"Edit URL"}},generic:{ctrl_shortcut:"Ctrl"}},Ii=Object.freeze(Object.defineProperty({__proto__:null,ar:Mi,de:Li,en:ct,es:{slash_menu:{heading:{title:"Encabezado 1",subtext:"Encabezado de primer nivel",aliases:["h","encabezado1","h1"],group:"Encabezados"},heading_2:{title:"Encabezado 2",subtext:"Encabezado de sección principal",aliases:["h2","encabezado2","subencabezado"],group:"Encabezados"},heading_3:{title:"Encabezado 3",subtext:"Encabezado de subsección y grupo",aliases:["h3","encabezado3","subencabezado"],group:"Encabezados"},numbered_list:{title:"Lista Numerada",subtext:"Lista con elementos ordenados",aliases:["ol","li","lista","lista numerada"],group:"Bloques básicos"},bullet_list:{title:"Lista con Viñetas",subtext:"Lista con elementos no ordenados",aliases:["ul","li","lista","lista con viñetas"],group:"Bloques básicos"},check_list:{title:"Lista de Verificación",subtext:"Lista con casillas de verificación",aliases:["ul","li","lista","lista de verificación","lista de chequeo","checkbox"],group:"Bloques básicos"},paragraph:{title:"Párrafo",subtext:"El cuerpo de tu documento",aliases:["p","párrafo"],group:"Bloques básicos"},code_block:{title:"Bloque de Código",subtext:"Bloque de código con resaltado de sintaxis",aliases:["code","pre"],group:"Bloques básicos"},table:{title:"Tabla",subtext:"Tabla con celdas editables",aliases:["tabla"],group:"Avanzado"},image:{title:"Imagen",subtext:"Imagen redimensionable con leyenda",aliases:["imagen","subir imagen","cargar","img","foto","media","url"],group:"Medios"},video:{title:"Vídeo",subtext:"Vídeo redimensionable con leyenda",aliases:["video","subir vídeo","cargar","mp4","película","media","url"],group:"Medios"},audio:{title:"Audio",subtext:"Audio incrustado con leyenda",aliases:["audio","subir audio","cargar","mp3","sonido","media","url"],group:"Medios"},file:{title:"Archivo",subtext:"Archivo incrustado",aliases:["archivo","cargar","incrustar","media","url"],group:"Medios"},emoji:{title:"Emoji",subtext:"Busca e inserta un emoji",aliases:["emoji","emoticono","emoción","cara"],group:"Otros"}},placeholders:{default:"Escribe o teclea '/' para comandos",heading:"Encabezado",bulletListItem:"Lista",numberedListItem:"Lista",checkListItem:"Lista"},file_blocks:{image:{add_button_text:"Agregar imagen"},video:{add_button_text:"Agregar vídeo"},audio:{add_button_text:"Agregar audio"},file:{add_button_text:"Agregar archivo"}},side_menu:{add_block_label:"Agregar bloque",drag_handle_label:"Abrir menú de bloque"},drag_handle:{delete_menuitem:"Eliminar",colors_menuitem:"Colores"},table_handle:{delete_column_menuitem:"Eliminar columna",delete_row_menuitem:"Eliminar fila",add_left_menuitem:"Agregar columna a la izquierda",add_right_menuitem:"Agregar columna a la derecha",add_above_menuitem:"Agregar fila arriba",add_below_menuitem:"Agregar fila abajo"},suggestion_menu:{no_items_title:"No se encontraron elementos",loading:"Cargando…"},color_picker:{text_title:"Texto",background_title:"Fondo",colors:{default:"Por defecto",gray:"Gris",brown:"Marrón",red:"Rojo",orange:"Naranja",yellow:"Amarillo",green:"Verde",blue:"Azul",purple:"Morado",pink:"Rosa"}},formatting_toolbar:{bold:{tooltip:"Negrita",secondary_tooltip:"Mod+B"},italic:{tooltip:"Cursiva",secondary_tooltip:"Mod+I"},underline:{tooltip:"Subrayado",secondary_tooltip:"Mod+U"},strike:{tooltip:"Tachado",secondary_tooltip:"Mod+Shift+S"},code:{tooltip:"Código",secondary_tooltip:""},colors:{tooltip:"Colores"},link:{tooltip:"Crear enlace",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Editar leyenda",input_placeholder:"Editar leyenda"},file_replace:{tooltip:{image:"Reemplazar imagen",video:"Reemplazar vídeo",audio:"Reemplazar audio",file:"Reemplazar archivo"}},file_rename:{tooltip:{image:"Renombrar imagen",video:"Renombrar vídeo",audio:"Renombrar audio",file:"Renombrar archivo"},input_placeholder:{image:"Renombrar imagen",video:"Renombrar vídeo",audio:"Renombrar audio",file:"Renombrar archivo"}},file_download:{tooltip:{image:"Descargar imagen",video:"Descargar vídeo",audio:"Descargar audio",file:"Descargar archivo"}},file_delete:{tooltip:{image:"Eliminar imagen",video:"Eliminar vídeo",audio:"Eliminar audio",file:"Eliminar archivo"}},file_preview_toggle:{tooltip:"Alternar vista previa"},nest:{tooltip:"Anidar bloque",secondary_tooltip:"Tab"},unnest:{tooltip:"Desanidar bloque",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Alinear texto a la izquierda"},align_center:{tooltip:"Alinear texto al centro"},align_right:{tooltip:"Alinear texto a la derecha"},align_justify:{tooltip:"Justificar texto"}},file_panel:{upload:{title:"Subir",file_placeholder:{image:"Subir imagen",video:"Subir vídeo",audio:"Subir audio",file:"Subir archivo"},upload_error:"Error: Fallo en la subida"},embed:{title:"Incrustar",embed_button:{image:"Incrustar imagen",video:"Incrustar vídeo",audio:"Incrustar audio",file:"Incrustar archivo"},url_placeholder:"Introduce la URL"}},link_toolbar:{delete:{tooltip:"Eliminar enlace"},edit:{text:"Editar enlace",tooltip:"Editar"},open:{tooltip:"Abrir en nueva pestaña"},form:{title_placeholder:"Editar título",url_placeholder:"Editar URL"}},generic:{ctrl_shortcut:"Ctrl"}},fr:{slash_menu:{heading:{title:"Titre 1",subtext:"Utilisé pour un titre de premier niveau",aliases:["h","titre1","h1"],group:"Titres"},heading_2:{title:"Titre 2",subtext:"Utilisé pour les sections clés",aliases:["h2","titre2","sous-titre"],group:"Titres"},heading_3:{title:"Titre 3",subtext:"Utilisé pour les sous-sections et les titres de groupe",aliases:["h3","titre3","sous-titre"],group:"Titres"},numbered_list:{title:"Liste Numérotée",subtext:"Utilisé pour afficher une liste numérotée",aliases:["ol","li","liste","listenumérotée","liste numérotée"],group:"Blocs de base"},bullet_list:{title:"Liste à Puces",subtext:"Utilisé pour afficher une liste non ordonnée",aliases:["ul","li","liste","listeàpuces","liste à puces"],group:"Blocs de base"},check_list:{title:"Liste de vérification",subtext:"Utilisé pour afficher une liste avec des cases à cocher",aliases:["ul","li","liste","liste de vérification","liste cochée","case à cocher"],group:"Blocs de base"},paragraph:{title:"Paragraphe",subtext:"Utilisé pour le corps de votre document",aliases:["p","paragraphe"],group:"Blocs de base"},code_block:{title:"Bloc de code",subtext:"Bloc de code avec coloration syntaxique",aliases:["code","pre"],group:"Blocs de base"},table:{title:"Tableau",subtext:"Utilisé pour les tableaux",aliases:["tableau"],group:"Avancé"},image:{title:"Image",subtext:"Insérer une image",aliases:["image","uploadImage","télécharger","img","photo","média","url"],group:"Médias"},video:{title:"Vidéo",subtext:"Insérer une vidéo",aliases:["vidéo","téléchargerVidéo","téléverser","mp4","film","média","url"],group:"Média"},audio:{title:"Audio",subtext:"Insérer un audio",aliases:["audio","téléchargerAudio","téléverser","mp3","son","média","url"],group:"Média"},file:{title:"Fichier",subtext:"Insérer un fichier",aliases:["fichier","téléverser","intégrer","média","url"],group:"Média"},emoji:{title:"Emoji",subtext:"Utilisé pour insérer un emoji",aliases:["emoji","émoticône","émotion","visage"],group:"Autres"}},placeholders:{default:"Entrez du texte ou tapez '/' pour les commandes",heading:"Titre",bulletListItem:"Liste",numberedListItem:"Liste",checkListItem:"Liste"},file_blocks:{image:{add_button_text:"Ajouter une image"},video:{add_button_text:"Ajouter une vidéo"},audio:{add_button_text:"Ajouter un audio"},file:{add_button_text:"Ajouter un fichier"}},side_menu:{add_block_label:"Ajouter un bloc",drag_handle_label:"Ouvrir le menu du bloc"},drag_handle:{delete_menuitem:"Supprimer",colors_menuitem:"Couleurs"},table_handle:{delete_column_menuitem:"Supprimer la colonne",delete_row_menuitem:"Supprimer la ligne",add_left_menuitem:"Ajouter une colonne à gauche",add_right_menuitem:"Ajouter une colonne à droite",add_above_menuitem:"Ajouter une ligne au-dessus",add_below_menuitem:"Ajouter une ligne en dessous"},suggestion_menu:{no_items_title:"Aucun élément trouvé",loading:"Chargement…"},color_picker:{text_title:"Texte",background_title:"Fond",colors:{default:"Défaut",gray:"Gris",brown:"Marron",red:"Rouge",orange:"Orange",yellow:"Jaune",green:"Vert",blue:"Bleu",purple:"Violet",pink:"Rose"}},formatting_toolbar:{bold:{tooltip:"Gras",secondary_tooltip:"Mod+B"},italic:{tooltip:"Italique",secondary_tooltip:"Mod+I"},underline:{tooltip:"Souligner",secondary_tooltip:"Mod+U"},strike:{tooltip:"Barré",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Code",secondary_tooltip:""},colors:{tooltip:"Couleurs"},link:{tooltip:"Créer un lien",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Modifier la légende",input_placeholder:"Modifier la légende"},file_replace:{tooltip:{image:"Remplacer l'image",video:"Remplacer la vidéo",audio:"Remplacer l'audio",file:"Remplacer le fichier"}},file_rename:{tooltip:{image:"Renommer l'image",video:"Renommer la vidéo",audio:"Renommer l'audio",file:"Renommer le fichier"},input_placeholder:{image:"Renommer l'image",video:"Renommer la vidéo",audio:"Renommer l'audio",file:"Renommer le fichier"}},file_download:{tooltip:{image:"Télécharger l'image",video:"Télécharger la vidéo",audio:"Télécharger l'audio",file:"Télécharger le fichier"}},file_delete:{tooltip:{image:"Supprimer l'image",video:"Supprimer la vidéo",audio:"Supprimer l'audio",file:"Supprimer le fichier"}},file_preview_toggle:{tooltip:"Basculer l'aperçu"},nest:{tooltip:"Emboîter le bloc",secondary_tooltip:"Tab"},unnest:{tooltip:"Démboîter le bloc",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Aligner le texte à gauche"},align_center:{tooltip:"Aligner le texte au centre"},align_right:{tooltip:"Aligner le texte à droite"},align_justify:{tooltip:"Justifier le texte"}},file_panel:{upload:{title:"Télécharger",file_placeholder:{image:"Télécharger une image",video:"Télécharger une vidéo",audio:"Télécharger un fichier audio",file:"Télécharger un fichier"},upload_error:"Erreur : Échec du téléchargement"},embed:{title:"Intégrer",embed_button:{image:"Intégrer une image",video:"Intégrer une vidéo",audio:"Intégrer un fichier audio",file:"Intégrer un fichier"},url_placeholder:"Entrez l'URL"}},link_toolbar:{delete:{tooltip:"Supprimer le lien"},edit:{text:"Modifier le lien",tooltip:"Modifier"},open:{tooltip:"Ouvrir dans un nouvel onglet"},form:{title_placeholder:"Modifier le titre",url_placeholder:"Modifier l'URL"}},generic:{ctrl_shortcut:"Ctrl"}},hr:{slash_menu:{heading:{title:"Naslov 1",subtext:"Glavni naslov",aliases:["h","naslov1","h1"],group:"Naslovi"},heading_2:{title:"Naslov 2",subtext:"Naslov poglavlja",aliases:["h2","naslov2","podnaslov"],group:"Naslovi"},heading_3:{title:"Naslov 3",subtext:"Naslov podpoglavlja",aliases:["h3","naslov3","podnaslov"],group:"Naslovi"},numbered_list:{title:"Numerirani popis",subtext:"Popis s numeriranim stavkama",aliases:["poredaniPopis","stavkaPopisa","popis","numeriraniPopis","numerirani popis"],group:"Osnovni blokovi"},bullet_list:{title:"Popis s oznakama",subtext:"Popis s grafičkim oznakama",aliases:["neporedaniPopis","stavkaPopisa","popis","popisSOznakama","popis s oznakama"],group:"Osnovni blokovi"},check_list:{title:"Check lista",subtext:"Popis s kućicama za označavanje",aliases:["neporedaniPopis","stavkaPopisa","popis","popisZaProvjeru","check lista","označeni popis","kućicaZaOznačavanje"],group:"Osnovni blokovi"},paragraph:{title:"Normalan tekst",subtext:"Tekst paragrafa",aliases:["p","paragraf"],group:"Osnovni blokovi"},table:{title:"Tablica",subtext:"Tablica s podesivim ćelijama",aliases:["tablica"],group:"Napredno"},image:{title:"Slika",subtext:"Slika s podesivom veličinom i natpisom",aliases:["slika","učitavanjeSlike","učitaj","img","fotografija","medij","url"],group:"Mediji"},video:{title:"Video",subtext:"Video s podesivom veličinom i natpisom",aliases:["video","učitavanjeVidea","učitaj","mp4","film","medij","url"],group:"Mediji"},audio:{title:"Audio",subtext:"Audio s natpisom",aliases:["audio","učitavanjeAudija","učitaj","mp3","zvuk","medij","url"],group:"Mediji"},file:{title:"Datoteka",subtext:"Ugrađena datoteka",aliases:["datoteka","učitaj","ugradi","medij","url"],group:"Mediji"},emoji:{title:"Emoji",subtext:"Pretraži i umetni emoji",aliases:["emoji","emotikon","emocija","lice"],group:"Ostalo"}},placeholders:{default:"Unesi tekst ili upiši ‘/’ za naredbe",heading:"Naslov",bulletListItem:"Lista",numberedListItem:"Lista",checkListItem:"Lista"},file_blocks:{image:{add_button_text:"Dodaj sliku"},video:{add_button_text:"Dodaj video"},audio:{add_button_text:"Dodaj audio"},file:{add_button_text:"Dodaj datoteku"}},side_menu:{add_block_label:"Dodaj blok",drag_handle_label:"Meni za dodavanje bloka"},drag_handle:{delete_menuitem:"Ukloni",colors_menuitem:"Boje"},table_handle:{delete_column_menuitem:"Ukloni stupac",delete_row_menuitem:"Ukloni redak",add_left_menuitem:"Dodaj stupac lijevo",add_right_menuitem:"Dodaj stupac desno",add_above_menuitem:"Dodaj redak iznad",add_below_menuitem:"Dodaj redak ispod"},suggestion_menu:{no_items_title:"Stavke nisu pronađene",loading:"Učitavanje…"},color_picker:{text_title:"Tekst",background_title:"Pozadina",colors:{default:"Zadano",gray:"Siva",brown:"Smeđa",red:"Crvena",orange:"Narančasta",yellow:"Žuta",green:"Zelena",blue:"Plava",purple:"Ljubičasta",pink:"Ružičasta"}},formatting_toolbar:{bold:{tooltip:"Podebljano",secondary_tooltip:"Mod+B"},italic:{tooltip:"Kurziv",secondary_tooltip:"Mod+I"},underline:{tooltip:"Podcrtano",secondary_tooltip:"Mod+U"},strike:{tooltip:"Precrtano",secondary_tooltip:"Mod+Shift+S"},code:{tooltip:"Kod",secondary_tooltip:""},colors:{tooltip:"Boja"},link:{tooltip:"Kreiraj poveznicu",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Uredi natpis",input_placeholder:"Uredi natpis"},file_replace:{tooltip:{image:"Zamijeni sliku",video:"Zamijeni video",audio:"Zamijeni audio",file:"Zamijeni datoteku"}},file_rename:{tooltip:{image:"Preimenuj sliku",video:"Preimenuj video",audio:"Preimenuj audio",file:"Preimenuj datoteku"},input_placeholder:{image:"Preimenuj sliku",video:"Preimenuj video",audio:"Preimenuj audio",file:"Preimenuj datoteku"}},file_download:{tooltip:{image:"Preuzmi sliku",video:"Preuzmi video",audio:"Preuzmi audio",file:"Preuzmi datoteku"}},file_delete:{tooltip:{image:"Ukloni sliku",video:"Ukloni video",audio:"Ukloni audio",file:"Ukloni datoteku"}},file_preview_toggle:{tooltip:"Prikaži/sakrij pregled"},nest:{tooltip:"Ugnijezdi blok",secondary_tooltip:"Tab"},unnest:{tooltip:"Razgnijezdi blok",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Poravnaj tekst lijevo"},align_center:{tooltip:"Poravnaj tekst po sredini"},align_right:{tooltip:"Poravnaj tekst desno"},align_justify:{tooltip:"Poravnaj tekst obostrano"}},file_panel:{upload:{title:"Učitaj",file_placeholder:{image:"Učitaj sliku",video:"Učitaj video",audio:"Učitaj audio",file:"Učitaj datoteku"},upload_error:"Pogreška: Učitavanje nije uspjelo"},embed:{title:"Ugradi",embed_button:{image:"Ugradi sliku",video:"Ugradi video",audio:"Ugradi audio",file:"Ugradi datoteku"},url_placeholder:"Dodaj URL"}},link_toolbar:{delete:{tooltip:"Ukloni poveznicu"},edit:{text:"Uredi poveznicu",tooltip:"Uredi"},open:{tooltip:"Otvori u novoj kartici"},form:{title_placeholder:"Uredi naslov",url_placeholder:"Uredi URL"}},generic:{ctrl_shortcut:"Ctrl"}},is:{slash_menu:{heading:{title:"Fyrirsögn 1",subtext:"Notað fyrir efstu fyrirsögn",aliases:["h","fyrirsogn1","h1"],group:"Fyrirsagnir"},heading_2:{title:"Fyrirsögn 2",subtext:"Notað fyrir lykilhluta",aliases:["h2","fyrirsogn2","undirfyrirsogn"],group:"Fyrirsagnir"},heading_3:{title:"Fyrirsögn 3",subtext:"Notað fyrir undirhluta og hópfyrirsagnir",aliases:["h3","fyrirsogn3","undirfyrirsogn"],group:"Fyrirsagnir"},numbered_list:{title:"Númeruð listi",subtext:"Notað til að birta númeraðan lista",aliases:["ol","li","listi","numeradurlisti"],group:"Grunnblokkar"},bullet_list:{title:"Punktalisti",subtext:"Notað til að birta óraðaðan lista",aliases:["ul","li","listi","punktalisti"],group:"Grunnblokkar"},check_list:{title:"Athugunarlisti",subtext:"Notað til að sýna lista með gátreitum",aliases:["ul","li","listi","athugunarlisti","merktur listi"],group:"Grunnblokkar"},paragraph:{title:"Málsgrein",subtext:"Notað fyrir meginmál skjalsins",aliases:["p","malsgrein"],group:"Grunnblokkar"},code_block:{title:"Kóðablokk",subtext:"Kóðablokkur með litskiptingu",aliases:["kóði","pre"],group:"Grunnblokkar"},table:{title:"Tafla",subtext:"Notað fyrir töflur",aliases:["tafla"],group:"Ítarlegt"},image:{title:"Mynd",subtext:"Settu inn mynd",aliases:["mynd","myndaupphlaed","upphlaed","img","mynd","media","url"],group:"Miðlar"},video:{title:"Myndband",subtext:"Setja inn myndband",aliases:["myndband","videoUpphala","hlaða upp","mp4","kvikmynd","miðill","url"],group:"Miðill"},audio:{title:"Hljóð",subtext:"Setja inn hljóð",aliases:["hljóð","audioUpphala","hlaða upp","mp3","hljóð","miðill","url"],group:"Miðlar"},file:{title:"Skrá",subtext:"Setja inn skrá",aliases:["skrá","hlaða upp","fella inn","miðill","url"],group:"Miðlar"},emoji:{title:"Emoji",subtext:"Notað til að setja inn smámynd",aliases:["emoji","andlitsávísun","tilfinningar","andlit"],group:"Annað"}},placeholders:{default:"Sláðu inn texta eða skrifaðu '/' fyrir skipanir",heading:"Fyrirsögn",bulletListItem:"Listi",numberedListItem:"Listi",checkListItem:"Listi"},file_blocks:{image:{add_button_text:"Bæta við mynd"},video:{add_button_text:"Bæta við myndbandi"},audio:{add_button_text:"Bæta við hljóði"},file:{add_button_text:"Bæta við skrá"}},side_menu:{add_block_label:"Bæta við blokki",drag_handle_label:"Opna blokkarvalmynd"},drag_handle:{delete_menuitem:"Eyða",colors_menuitem:"Litir"},table_handle:{delete_column_menuitem:"Eyða dálki",delete_row_menuitem:"Eyða röð",add_left_menuitem:"Bæta dálki við til vinstri",add_right_menuitem:"Bæta dálki við til hægri",add_above_menuitem:"Bæta röð við fyrir ofan",add_below_menuitem:"Bæta röð við fyrir neðan"},suggestion_menu:{no_items_title:"Engir hlutir fundust",loading:"Hleður…"},color_picker:{text_title:"Texti",background_title:"Bakgrunnur",colors:{default:"Sjálfgefið",gray:"Grár",brown:"Brúnn",red:"Rauður",orange:"Appelsínugulur",yellow:"Gulur",green:"Grænn",blue:"Blár",purple:"Fjólublár",pink:"Bleikur"}},formatting_toolbar:{bold:{tooltip:"Feitletrað",secondary_tooltip:"Mod+B"},italic:{tooltip:"Skáletrað",secondary_tooltip:"Mod+I"},underline:{tooltip:"Undirstrikað",secondary_tooltip:"Mod+U"},strike:{tooltip:"Yfirstrikað",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Kóði",secondary_tooltip:""},colors:{tooltip:"Litir"},link:{tooltip:"Búa til tengil",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Breyta myndatexta",input_placeholder:"Breyta myndatexta"},file_replace:{tooltip:{image:"Skipta um mynd",video:"Skipta um myndband",audio:"Skipta um hljóð",file:"Skipta um skrá"}},file_rename:{tooltip:{image:"Endurnefna mynd",video:"Endurnefna myndband",audio:"Endurnefna hljóð",file:"Endurnefna skrá"},input_placeholder:{image:"Endurnefna mynd",video:"Endurnefna myndband",audio:"Endurnefna hljóð",file:"Endurnefna skrá"}},file_download:{tooltip:{image:"Sækja mynd",video:"Sækja myndband",audio:"Sækja hljóð",file:"Sækja skrá"}},file_delete:{tooltip:{image:"Eyða mynd",video:"Eyða myndbandi",audio:"Eyða hljóði",file:"Eyða skrá"}},file_preview_toggle:{tooltip:"Skipta um forskoðun"},nest:{tooltip:"Fella blokk saman",secondary_tooltip:"Tab"},unnest:{tooltip:"Afþýða blokk",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Vinstrijafna texta"},align_center:{tooltip:"Miðjustilla texta"},align_right:{tooltip:"Hægrijafna texta"},align_justify:{tooltip:"Jafna texta"}},file_panel:{upload:{title:"Hlaða upp",file_placeholder:{image:"Hlaða upp mynd",video:"Hlaða upp myndband",audio:"Hlaða upp hljóð",file:"Hlaða upp skrá"},upload_error:"Villa: Upphleðsla mistókst"},embed:{title:"Innsetja",embed_button:{image:"Innsetja mynd",video:"Innsetja myndband",audio:"Innsetja hljóð",file:"Innsetja skrá"},url_placeholder:"Sláðu inn URL"}},link_toolbar:{delete:{tooltip:"Fjarlægja tengil"},edit:{text:"Breyta tengli",tooltip:"Breyta"},open:{tooltip:"Opna í nýjum flipa"},form:{title_placeholder:"Breyta titli",url_placeholder:"Breyta URL"}},generic:{ctrl_shortcut:"Ctrl"}},ja:{slash_menu:{heading:{title:"見出し1",subtext:"トップレベルの見出しに使用",aliases:["h","見出し1","h1","大見出し"],group:"見出し"},heading_2:{title:"見出し2",subtext:"重要なセクションに使用",aliases:["h2","見出し2","subheading","中見出し"],group:"見出し"},heading_3:{title:"見出し3",subtext:"セクションやグループの見出しに使用",aliases:["h3","見出し3","subheading","小見出し"],group:"見出し"},numbered_list:{title:"番号付リスト",subtext:"番号付リストを表示するために使用",aliases:["ol","li","numberedlist","numbered list","リスト","番号付リスト","番号 リスト"],group:"基本ブロック"},bullet_list:{title:"箇条書き",subtext:"箇条書きを表示するために使用",aliases:["ul","li","bulletlist","bullet list","リスト","箇条書きリスト"],group:"基本ブロック"},check_list:{title:"チェックリスト",subtext:"チェックボックス付きリストを表示するために使用されます",aliases:["ul","li","list","checklist","checked list","リスト","チェックリスト","チェックされたリスト"],group:"基本ブロック"},paragraph:{title:"標準テキスト",subtext:"本文に使用",aliases:["p","paragraph","標準テキスト"],group:"基本ブロック"},code_block:{title:"コードブロック",subtext:"シンタックスハイライト付きのコードブロック",aliases:["code","pre","コード","コードブロック"],group:"基本ブロック"},table:{title:"表",subtext:"表に使用",aliases:["table","表","テーブル"],group:"高度なブロック"},image:{title:"画像",subtext:"画像を挿入",aliases:["image","imageUpload","upload","img","picture","media","url","画像"],group:"メディア"},video:{title:"ビデオ",subtext:"ビデオを挿入",aliases:["video","videoUpload","upload","mp4","film","media","url","ビデオ"],group:"メディア"},audio:{title:"オーディオ",subtext:"オーディオを挿入",aliases:["audio","audioUpload","upload","mp3","sound","media","url","オーディオ"],group:"メディア"},file:{title:"ファイル",subtext:"ファイルを挿入",aliases:["file","upload","embed","media","url","ファイル"],group:"メディア"},emoji:{title:"絵文字",subtext:"絵文字を挿入するために使用します",aliases:["絵文字","顔文字","感情表現","顔"],group:"その他"}},placeholders:{default:"テキストを入力するか'/' を入力してコマンド選択",heading:"見出し",bulletListItem:"リストを追加",numberedListItem:"リストを追加",checkListItem:"リストを追加"},file_blocks:{image:{add_button_text:"画像を追加"},video:{add_button_text:"ビデオを追加"},audio:{add_button_text:"オーディオを追加"},file:{add_button_text:"ファイルを追加"}},side_menu:{add_block_label:"ブロックを追加",drag_handle_label:"ブロックメニュー"},drag_handle:{delete_menuitem:"削除",colors_menuitem:"色を変更"},table_handle:{delete_column_menuitem:"列を削除",delete_row_menuitem:"行を削除",add_left_menuitem:"左に列を追加",add_right_menuitem:"右に列を追加",add_above_menuitem:"上に行を追加",add_below_menuitem:"下に行を追加"},suggestion_menu:{no_items_title:"アイテムが見つかりません",loading:"読込中…"},color_picker:{text_title:"文字色",background_title:"背景色",colors:{default:"デフォルト",gray:"グレー",brown:"茶色",red:"赤",orange:"オレンジ",yellow:"黄色",green:"緑",blue:"青",purple:"紫",pink:"ピンク"}},formatting_toolbar:{bold:{tooltip:"太字",secondary_tooltip:"Mod+B"},italic:{tooltip:"斜体",secondary_tooltip:"Mod+I"},underline:{tooltip:"下線",secondary_tooltip:"Mod+U"},strike:{tooltip:"打ち消し",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"コード",secondary_tooltip:""},colors:{tooltip:"色"},link:{tooltip:"リンク",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"キャプションを編集",input_placeholder:"キャプションを編集"},file_replace:{tooltip:{image:"画像を置換",video:"ビデオを置換",audio:"オーディオを置換",file:"ファイルを置換"}},file_rename:{tooltip:{image:"画像の名前を変更",video:"ビデオの名前を変更",audio:"オーディオの名前を変更",file:"ファイルの名前を変更"},input_placeholder:{image:"画像の名前を変更",video:"ビデオの名前を変更",audio:"オーディオの名前を変更",file:"ファイルの名前を変更"}},file_download:{tooltip:{image:"画像をダウンロード",video:"ビデオをダウンロード",audio:"オーディオをダウンロード",file:"ファイルをダウンロード"}},file_delete:{tooltip:{image:"画像を削除",video:"ビデオを削除",audio:"オーディオを削除",file:"ファイルを削除"}},file_preview_toggle:{tooltip:"プレビューの切り替え"},nest:{tooltip:"インデント増",secondary_tooltip:"Tab"},unnest:{tooltip:"インデント減",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"左揃え"},align_center:{tooltip:"中央揃え"},align_right:{tooltip:"右揃え"},align_justify:{tooltip:"両端揃え"}},file_panel:{upload:{title:"アップロード",file_placeholder:{image:"画像をアップロード",video:"ビデオをアップロード",audio:"オーディオをアップロード",file:"ファイルをアップロード"},upload_error:"エラー: アップロードが失敗しました"},embed:{title:"埋め込み",embed_button:{image:"画像を埋め込む",video:"ビデオを埋め込む",audio:"オーディオを埋め込む",file:"ファイルを埋め込む"},url_placeholder:"URLを入力"}},link_toolbar:{delete:{tooltip:"リンクを解除"},edit:{text:"リンクを編集",tooltip:"編集"},open:{tooltip:"新しいタブでリンクを開く"},form:{title_placeholder:"タイトルを編集",url_placeholder:"URLを編集"}},generic:{ctrl_shortcut:"Ctrl"}},ko:{slash_menu:{heading:{title:"제목1",subtext:"섹션 제목(대)",aliases:["h","제목1","h1","대제목"],group:"제목"},heading_2:{title:"제목2",subtext:"섹션 제목(중)",aliases:["h2","제목2","중제목"],group:"제목"},heading_3:{title:"제목3",subtext:"섹션 제목(소)",aliases:["h3","제목3","subheading"],group:"제목"},numbered_list:{title:"번호 매기기 목록",subtext:"번호가 매겨진 목록을 추가합니다.",aliases:["ol","li","목록","번호 매기기 목록","번호 목록"],group:"기본 블록"},bullet_list:{title:"글머리 기호 목록",subtext:"간단한 글머리 기호를 추가합니다.",aliases:["ul","li","목록","글머리 기호 목록","글머리 목록"],group:"기본 블록"},check_list:{title:"체크리스트",subtext:"체크박스가 있는 목록을 표시하는 데 사용",aliases:["ul","li","목록","체크리스트","체크 리스트","체크된 목록","체크박스"],group:"기본 블록"},paragraph:{title:"본문",subtext:"일반 텍스트",aliases:["p","paragraph","본문"],group:"기본 블록"},code_block:{title:"코드 블록",subtext:"구문 강조가 있는 코드 블록",aliases:["code","pre"],group:"기본 블록"},table:{title:"표",subtext:"간단한 표를 추가합니다.",aliases:["표"],group:"고급"},image:{title:"이미지",subtext:"이미지 파일을 업로드합니다.",aliases:["image","imageUpload","upload","img","picture","media","이미지","url"],group:"미디어"},video:{title:"비디오",subtext:"비디오 삽입",aliases:["video","videoUpload","upload","mp4","film","media","동영상","url"],group:"미디어"},audio:{title:"오디오",subtext:"오디오 삽입",aliases:["audio","audioUpload","upload","mp3","sound","media","오디오","url"],group:"미디어"},file:{title:"파일",subtext:"파일 삽입",aliases:["file","upload","embed","media","파일","url"],group:"미디어"},emoji:{title:"이모지",subtext:"이모지 삽입용으로 사용됩니다",aliases:["이모지","emoji","감정 표현","emotion expression","표정","face expression","얼굴","face"],group:"기타"}},placeholders:{default:"텍스트를 입력하거나 /를 입력하여 명령을 입력하세요.",heading:"제목",bulletListItem:"목록",numberedListItem:"목록",checkListItem:"목록"},file_blocks:{image:{add_button_text:"이미지 추가"},video:{add_button_text:"비디오 추가"},audio:{add_button_text:"오디오 추가"},file:{add_button_text:"파일 추가"}},side_menu:{add_block_label:"블록 추가",drag_handle_label:"블록 메뉴 열기"},drag_handle:{delete_menuitem:"삭제",colors_menuitem:"색깔"},table_handle:{delete_column_menuitem:"열 1개 삭제",delete_row_menuitem:"행 삭제",add_left_menuitem:"왼쪽에 열 1개 추가",add_right_menuitem:"오른쪽에 열 1개 추가",add_above_menuitem:"위에 행 1개 추가",add_below_menuitem:"아래에 행 1개 추가"},suggestion_menu:{no_items_title:"항목을 찾을 수 없음",loading:"로딩 중…"},color_picker:{text_title:"텍스트",background_title:"배경",colors:{default:"기본",gray:"회색",brown:"갈색",red:"빨간색",orange:"주황색",yellow:"노란색",green:"녹색",blue:"파란색",purple:"보라색",pink:"분홍색"}},formatting_toolbar:{bold:{tooltip:"진하게",secondary_tooltip:"Mod+B"},italic:{tooltip:"기울임",secondary_tooltip:"Mod+I"},underline:{tooltip:"밑줄",secondary_tooltip:"Mod+U"},strike:{tooltip:"취소선",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"코드",secondary_tooltip:""},colors:{tooltip:"색깔"},link:{tooltip:"링크 만들기",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"이미지 캡션 수정",input_placeholder:"이미지 캡션 수정"},file_replace:{tooltip:{image:"이미지 교체",video:"비디오 교체",audio:"오디오 교체",file:"파일 교체"}},file_rename:{tooltip:{image:"이미지 이름 변경",video:"비디오 이름 변경",audio:"오디오 이름 변경",file:"파일 이름 변경"},input_placeholder:{image:"이미지 이름 변경",video:"비디오 이름 변경",audio:"오디오 이름 변경",file:"파일 이름 변경"}},file_download:{tooltip:{image:"이미지 다운로드",video:"비디오 다운로드",audio:"오디오 다운로드",file:"파일 다운로드"}},file_delete:{tooltip:{image:"이미지 삭제",video:"비디오 삭제",audio:"오디오 삭제",file:"파일 삭제"}},file_preview_toggle:{tooltip:"미리보기 전환"},nest:{tooltip:"중첩 블록",secondary_tooltip:"Tab"},unnest:{tooltip:"비중첩 블록",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"텍스트 왼쪽 맞춤"},align_center:{tooltip:"텍스트 가운데 맞춤"},align_right:{tooltip:"텍스트 오른쪽 맞춤"},align_justify:{tooltip:"텍스트 양쪽 맞춤"}},file_panel:{upload:{title:"업로드",file_placeholder:{image:"이미지 업로드",video:"비디오 업로드",audio:"오디오 업로드",file:"파일 업로드"},upload_error:"오류: 업로드 실패"},embed:{title:"임베드",embed_button:{image:"이미지 삽입",video:"비디오 삽입",audio:"오디오 삽입",file:"파일 삽입"},url_placeholder:"URL을 입력하세요."}},link_toolbar:{delete:{tooltip:"링크 삭제"},edit:{text:"링크 수정",tooltip:"수정"},open:{tooltip:"새 탭으로 열기"},form:{title_placeholder:"제목 수정",url_placeholder:"URL 수정"}},generic:{ctrl_shortcut:"Ctrl"}},nl:{slash_menu:{heading:{title:"Kop 1",subtext:"Gebruikt voor een hoofdkop",aliases:["h","kop1","h1"],group:"Koppen"},heading_2:{title:"Kop 2",subtext:"Gebruikt voor belangrijke secties",aliases:["h2","kop2","subkop"],group:"Koppen"},heading_3:{title:"Kop 3",subtext:"Gebruikt voor subsecties en groepskoppen",aliases:["h3","kop3","subkop"],group:"Koppen"},numbered_list:{title:"Genummerde Lijst",subtext:"Gebruikt om een genummerde lijst weer te geven",aliases:["ol","li","lijst","genummerdelijst","genummerde lijst"],group:"Basisblokken"},bullet_list:{title:"Puntenlijst",subtext:"Gebruikt om een ongeordende lijst weer te geven",aliases:["ul","li","lijst","puntenlijst","punten lijst"],group:"Basisblokken"},check_list:{title:"Controlelijst",subtext:"Gebruikt om een lijst met selectievakjes weer te geven",aliases:["ul","li","lijst","aangevinkte lijst","selectievakje"],group:"Basisblokken"},paragraph:{title:"Paragraaf",subtext:"Gebruikt voor de hoofdtekst van uw document",aliases:["p","paragraaf"],group:"Basisblokken"},code_block:{title:"Codeblok",subtext:"Codeblok met syntax highlighting",aliases:["code","pre"],group:"Basisblokken"},table:{title:"Tabel",subtext:"Gebruikt voor tabellen",aliases:["tabel"],group:"Geavanceerd"},image:{title:"Afbeelding",subtext:"Voeg een afbeelding in",aliases:["afbeelding","imageUpload","upload","img","foto","media","url"],group:"Media"},video:{title:"Video",subtext:"Voeg een video in",aliases:["video","videoUploaden","upload","mp4","film","media","url","drive","dropbox"],group:"Media"},audio:{title:"Audio",subtext:"Voeg audio in",aliases:["audio","audioUploaden","upload","mp3","geluid","media","url"],group:"Media"},file:{title:"Bestand",subtext:"Voeg een bestand in",aliases:["bestand","upload","insluiten","media","url"],group:"Media"},emoji:{title:"Emoji",subtext:"Gebruikt voor het invoegen van een emoji",aliases:["emoji","emotie-uitdrukking","gezichtsuitdrukking","gezicht"],group:"Overig"}},placeholders:{default:"Voer tekst in of type '/' voor commando's",heading:"Kop",bulletListItem:"Lijst",numberedListItem:"Lijst",checkListItem:"Lijst"},file_blocks:{image:{add_button_text:"Afbeelding toevoegen"},video:{add_button_text:"Video toevoegen"},audio:{add_button_text:"Audio toevoegen"},file:{add_button_text:"Bestand toevoegen"}},side_menu:{add_block_label:"Nieuw blok",drag_handle_label:"Open blok menu"},drag_handle:{delete_menuitem:"Verwijder",colors_menuitem:"Kleuren"},table_handle:{delete_column_menuitem:"Verwijder kolom",delete_row_menuitem:"Verwijder rij",add_left_menuitem:"Voeg kolom links toe",add_right_menuitem:"Voeg kolom rechts toe",add_above_menuitem:"Voeg rij boven toe",add_below_menuitem:"Voeg rij onder toe"},suggestion_menu:{no_items_title:"Geen items gevonden",loading:"Laden…"},color_picker:{text_title:"Tekst",background_title:"Achtergrond",colors:{default:"Standaard",gray:"Grijs",brown:"Bruin",red:"Rood",orange:"Oranje",yellow:"Geel",green:"Groen",blue:"Blauw",purple:"Paars",pink:"Roze"}},formatting_toolbar:{bold:{tooltip:"Vet",secondary_tooltip:"Mod+B"},italic:{tooltip:"Cursief",secondary_tooltip:"Mod+I"},underline:{tooltip:"Onderstrepen",secondary_tooltip:"Mod+U"},strike:{tooltip:"Doorstrepen",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Code",secondary_tooltip:""},colors:{tooltip:"Kleuren"},link:{tooltip:"Maak link",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Bewerk onderschrift",input_placeholder:"Bewerk onderschrift"},file_replace:{tooltip:{image:"Afbeelding vervangen",video:"Video vervangen",audio:"Audio vervangen",file:"Bestand vervangen"}},file_rename:{tooltip:{image:"Afbeelding hernoemen",video:"Video hernoemen",audio:"Audio hernoemen",file:"Bestand hernoemen"},input_placeholder:{image:"Afbeelding hernoemen",video:"Video hernoemen",audio:"Audio hernoemen",file:"Bestand hernoemen"}},file_download:{tooltip:{image:"Afbeelding downloaden",video:"Video downloaden",audio:"Audio downloaden",file:"Bestand downloaden"}},file_delete:{tooltip:{image:"Afbeelding verwijderen",video:"Video verwijderen",audio:"Audio verwijderen",file:"Bestand verwijderen"}},file_preview_toggle:{tooltip:"Voorbeeldschakelaar"},nest:{tooltip:"Nest blok",secondary_tooltip:"Tab"},unnest:{tooltip:"Ontnest blok",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Tekst links uitlijnen"},align_center:{tooltip:"Tekst centreren"},align_right:{tooltip:"Tekst rechts uitlijnen"},align_justify:{tooltip:"Tekst uitvullen"}},file_panel:{upload:{title:"Upload",file_placeholder:{image:"Afbeelding uploaden",video:"Video uploaden",audio:"Audio uploaden",file:"Bestand uploaden"},upload_error:"Fout: Upload mislukt"},embed:{title:"Insluiten",embed_button:{image:"Afbeelding insluiten",video:"Video insluiten",audio:"Audio insluiten",file:"Bestand insluiten"},url_placeholder:"Voer URL in"}},link_toolbar:{delete:{tooltip:"Verwijder link"},edit:{text:"Bewerk link",tooltip:"Bewerk"},open:{tooltip:"Open in nieuw tabblad"},form:{title_placeholder:"Bewerk titel",url_placeholder:"Bewerk URL"}},generic:{ctrl_shortcut:"Ctrl"}},pl:{slash_menu:{heading:{title:"Nagłówek 1",subtext:"Używany dla nagłówka najwyższego poziomu",aliases:["h","naglowek1","h1"],group:"Nagłówki"},heading_2:{title:"Nagłówek 2",subtext:"Używany dla kluczowych sekcji",aliases:["h2","naglowek2","podnaglowek"],group:"Nagłówki"},heading_3:{title:"Nagłówek 3",subtext:"Używany dla podsekcji i grup nagłówków",aliases:["h3","naglowek3","podnaglowek"],group:"Nagłówki"},numbered_list:{title:"Lista numerowana",subtext:"Używana do wyświetlania listy numerowanej",aliases:["ol","li","lista","numerowana lista"],group:"Podstawowe bloki"},bullet_list:{title:"Lista punktowana",subtext:"Używana do wyświetlania listy bez numeracji",aliases:["ul","li","lista","punktowana lista"],group:"Podstawowe bloki"},check_list:{title:"Lista z polami wyboru",subtext:"Używana do wyświetlania listy z polami wyboru",aliases:["ul","li","lista","lista z polami wyboru","pole wyboru"],group:"Podstawowe bloki"},paragraph:{title:"Akapit",subtext:"Używany dla treści dokumentu",aliases:["p","akapit"],group:"Podstawowe bloki"},code_block:{title:"Blok kodu",subtext:"Blok kodu z podświetleniem składni",aliases:["kod","pre"],group:"Podstawowe bloki"},table:{title:"Tabela",subtext:"Używana do tworzenia tabel",aliases:["tabela"],group:"Zaawansowane"},image:{title:"Zdjęcie",subtext:"Wstaw zdjęcie",aliases:["obraz","wrzućZdjęcie","wrzuć","img","zdjęcie","media","url"],group:"Media"},video:{title:"Wideo",subtext:"Wstaw wideo",aliases:["wideo","wrzućWideo","wrzuć","mp4","film","media","url"],group:"Media"},audio:{title:"Audio",subtext:"Wstaw audio",aliases:["audio","wrzućAudio","wrzuć","mp3","dźwięk","media","url"],group:"Media"},file:{title:"Plik",subtext:"Wstaw plik",aliases:["plik","wrzuć","wstaw","media","url"],group:"Media"},emoji:{title:"Emoji",subtext:"Używane do wstawiania emoji",aliases:["emoji","emotka","wyrażenie emocji","twarz"],group:"Inne"}},placeholders:{default:"Wprowadź tekst lub wpisz '/' aby użyć poleceń",heading:"Nagłówek",bulletListItem:"Lista",numberedListItem:"Lista",checkListItem:"Lista"},file_blocks:{image:{add_button_text:"Dodaj zdjęcie"},video:{add_button_text:"Dodaj wideo"},audio:{add_button_text:"Dodaj audio"},file:{add_button_text:"Dodaj plik"}},side_menu:{add_block_label:"Dodaj blok",drag_handle_label:"Otwórz menu bloków"},drag_handle:{delete_menuitem:"Usuń",colors_menuitem:"Kolory"},table_handle:{delete_column_menuitem:"Usuń kolumnę",delete_row_menuitem:"Usuń wiersz",add_left_menuitem:"Dodaj kolumnę po lewej",add_right_menuitem:"Dodaj kolumnę po prawej",add_above_menuitem:"Dodaj wiersz powyżej",add_below_menuitem:"Dodaj wiersz poniżej"},suggestion_menu:{no_items_title:"Nie znaleziono elementów",loading:"Ładowanie…"},color_picker:{text_title:"Tekst",background_title:"Tło",colors:{default:"Domyślny",gray:"Szary",brown:"Brązowy",red:"Czerwony",orange:"Pomarańczowy",yellow:"Żółty",green:"Zielony",blue:"Niebieski",purple:"Fioletowy",pink:"Różowy"}},formatting_toolbar:{bold:{tooltip:"Pogrubienie",secondary_tooltip:"Mod+B"},italic:{tooltip:"Kursywa",secondary_tooltip:"Mod+I"},underline:{tooltip:"Podkreślenie",secondary_tooltip:"Mod+U"},strike:{tooltip:"Przekreślenie",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Kod",secondary_tooltip:""},colors:{tooltip:"Kolory"},link:{tooltip:"Utwórz link",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Zmień podpis",input_placeholder:"Zmień podpis"},file_replace:{tooltip:{image:"Zmień obraz",video:"Zmień wideo",audio:"Zmień audio",file:"Zmień plik"}},file_rename:{tooltip:{image:"Zmień nazwę zdjęcia",video:"Zmień nazwę wideo",audio:"Zmień nazwę audio",file:"Zmień nazwę pliku"},input_placeholder:{image:"Zmień nazwę zdjęcia",video:"Zmień nazwę wideo",audio:"Zmień nazwę audio",file:"Zmień nazwę pliku"}},file_download:{tooltip:{image:"Pobierz zdjęcie",video:"Pobierz wideo",audio:"Pobierz audio",file:"Pobierz plik"}},file_delete:{tooltip:{image:"Usuń zdjęcie",video:"Usuń wideo",audio:"Usuń audio",file:"Usuń plik"}},file_preview_toggle:{tooltip:"Przełącz podgląd"},nest:{tooltip:"Zagnieźdź blok",secondary_tooltip:"Tab"},unnest:{tooltip:"Odgagnieźdź blok",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Wyrównaj tekst do lewej"},align_center:{tooltip:"Wyśrodkuj tekst"},align_right:{tooltip:"Wyrównaj tekst do prawej"},align_justify:{tooltip:"Wyjustuj tekst"}},file_panel:{upload:{title:"Wrzuć",file_placeholder:{image:"Wrzuć zdjęcie",video:"Wrzuć wideo",audio:"Wrzuć audio",file:"Wrzuć plik"},upload_error:"Błąd: Przesyłanie nie powiodło się"},embed:{title:"Wstaw",embed_button:{image:"Wstaw zdjęice",video:"Wstaw wideo",audio:"Wstaw audio",file:"Wstaw plik"},url_placeholder:"Wprowadź URL"}},link_toolbar:{delete:{tooltip:"Usuń link"},edit:{text:"Edytuj link",tooltip:"Edytuj"},open:{tooltip:"Otwórz w nowej karcie"},form:{title_placeholder:"Edytuj tytuł",url_placeholder:"Edytuj URL"}},generic:{ctrl_shortcut:"Ctrl"}},pt:{slash_menu:{heading:{title:"Título",subtext:"Usado para um título de nível superior",aliases:["h","titulo1","h1"],group:"Títulos"},heading_2:{title:"Título 2",subtext:"Usado para seções principais",aliases:["h2","titulo2","subtitulo"],group:"Títulos"},heading_3:{title:"Título 3",subtext:"Usado para subseções e títulos de grupo",aliases:["h3","titulo3","subtitulo"],group:"Títulos"},numbered_list:{title:"Lista Numerada",subtext:"Usado para exibir uma lista numerada",aliases:["ol","li","lista","listanumerada","lista numerada"],group:"Blocos básicos"},bullet_list:{title:"Lista com Marcadores",subtext:"Usado para exibir uma lista não ordenada",aliases:["ul","li","lista","listamarcadores","lista com marcadores"],group:"Blocos básicos"},check_list:{title:"Lista de verificação",subtext:"Usado para exibir uma lista com caixas de seleção",aliases:["ul","li","lista","lista de verificação","lista marcada","caixa de seleção"],group:"Blocos básicos"},paragraph:{title:"Parágrafo",subtext:"Usado para o corpo do seu documento",aliases:["p","paragrafo"],group:"Blocos básicos"},code_block:{title:"Bloco de Código",subtext:"Usado para exibir código com destaque de sintaxe",aliases:["codigo","pre"],group:"Blocos básicos"},table:{title:"Tabela",subtext:"Usado para tabelas",aliases:["tabela"],group:"Avançado"},image:{title:"Imagem",subtext:"Inserir uma imagem",aliases:["imagem","uploadImagem","upload","img","foto","media","url"],group:"Mídia"},video:{title:"Vídeo",subtext:"Inserir um vídeo",aliases:["vídeo","uploadVídeo","upload","mp4","filme","mídia","url"],group:"Mídia"},audio:{title:"Áudio",subtext:"Inserir um áudio",aliases:["áudio","uploadÁudio","upload","mp3","som","mídia","url"],group:"Mídia"},file:{title:"Arquivo",subtext:"Inserir um arquivo",aliases:["arquivo","upload","incorporar","mídia","url"],group:"Mídia"},emoji:{title:"Emoji",subtext:"Usado para inserir um emoji",aliases:["emoji","emoticon","expressão emocional","rosto"],group:"Outros"}},placeholders:{default:"Digite texto ou use '/' para comandos",heading:"Título",bulletListItem:"Lista",numberedListItem:"Lista",checkListItem:"Lista"},file_blocks:{image:{add_button_text:"Adicionar imagem"},video:{add_button_text:"Adicionar vídeo"},audio:{add_button_text:"Adicionar áudio"},file:{add_button_text:"Adicionar arquivo"}},side_menu:{add_block_label:"Adicionar bloco",drag_handle_label:"Abrir menu do bloco"},drag_handle:{delete_menuitem:"Excluir",colors_menuitem:"Cores"},table_handle:{delete_column_menuitem:"Excluir coluna",delete_row_menuitem:"Excluir linha",add_left_menuitem:"Adicionar coluna à esquerda",add_right_menuitem:"Adicionar coluna à direita",add_above_menuitem:"Adicionar linha acima",add_below_menuitem:"Adicionar linha abaixo"},suggestion_menu:{no_items_title:"Nenhum item encontrado",loading:"Carregando…"},color_picker:{text_title:"Texto",background_title:"Fundo",colors:{default:"Padrão",gray:"Cinza",brown:"Marrom",red:"Vermelho",orange:"Laranja",yellow:"Amarelo",green:"Verde",blue:"Azul",purple:"Roxo",pink:"Rosa"}},formatting_toolbar:{bold:{tooltip:"Negrito",secondary_tooltip:"Mod+B"},italic:{tooltip:"Itálico",secondary_tooltip:"Mod+I"},underline:{tooltip:"Sublinhado",secondary_tooltip:"Mod+U"},strike:{tooltip:"Riscado",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Código",secondary_tooltip:""},colors:{tooltip:"Cores"},link:{tooltip:"Criar link",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Editar legenda",input_placeholder:"Editar legenda"},file_replace:{tooltip:{image:"Substituir imagem",video:"Substituir vídeo",audio:"Substituir áudio",file:"Substituir arquivo"}},file_rename:{tooltip:{image:"Renomear imagem",video:"Renomear vídeo",audio:"Renomear áudio",file:"Renomear arquivo"},input_placeholder:{image:"Renomear imagem",video:"Renomear vídeo",audio:"Renomear áudio",file:"Renomear arquivo"}},file_download:{tooltip:{image:"Baixar imagem",video:"Baixar vídeo",audio:"Baixar áudio",file:"Baixar arquivo"}},file_delete:{tooltip:{image:"Excluir imagem",video:"Excluir vídeo",audio:"Excluir áudio",file:"Excluir arquivo"}},file_preview_toggle:{tooltip:"Alternar visualização"},nest:{tooltip:"Aninhar bloco",secondary_tooltip:"Tab"},unnest:{tooltip:"Desaninhar bloco",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Alinhar à esquerda"},align_center:{tooltip:"Alinhar ao centro"},align_right:{tooltip:"Alinhar à direita"},align_justify:{tooltip:"Justificar texto"}},file_panel:{upload:{title:"Upload",file_placeholder:{image:"Upload de imagem",video:"Upload de vídeo",audio:"Upload de áudio",file:"Upload de arquivo"},upload_error:"Erro: Falha no upload"},embed:{title:"Incorporar",embed_button:{image:"Incorporar imagem",video:"Incorporar vídeo",audio:"Incorporar áudio",file:"Incorporar arquivo"},url_placeholder:"Insira a URL"}},link_toolbar:{delete:{tooltip:"Remover link"},edit:{text:"Editar link",tooltip:"Editar"},open:{tooltip:"Abrir em nova aba"},form:{title_placeholder:"Editar título",url_placeholder:"Editar URL"}},generic:{ctrl_shortcut:"Ctrl"}},ru:{slash_menu:{heading:{title:"Заголовок 1 уровня",subtext:"Используется для заголовка верхнего уровня",aliases:["h","heading1","h1","заголовок1"],group:"Заголовки"},heading_2:{title:"Заголовок 2 уровня",subtext:"Используется для ключевых разделов",aliases:["h2","heading2","subheading","заголовок2","подзаголовок"],group:"Заголовки"},heading_3:{title:"Заголовок 3 уровня",subtext:"Используется для подразделов и групп",aliases:["h3","heading3","subheading","заголовок3","подзаголовок"],group:"Заголовки"},numbered_list:{title:"Нумерованный список",subtext:"Используется для отображения нумерованного списка",aliases:["ol","li","list","numberedlist","numbered list","список","нумерованный список"],group:"Базовые блоки"},bullet_list:{title:"Маркированный список",subtext:"Для отображения неупорядоченного списка.",aliases:["ul","li","list","bulletlist","bullet list","список","маркированный список"],group:"Базовые блоки"},check_list:{title:"Контрольный список",subtext:"Для отображения списка с флажками",aliases:["ul","li","list","checklist","check list","checked list","checkbox","список"],group:"Базовые блоки"},paragraph:{title:"Параграф",subtext:"Основной текст",aliases:["p","paragraph","параграф"],group:"Базовые блоки"},code_block:{title:"Блок кода",subtext:"Блок кода с подсветкой синтаксиса",aliases:["code","pre","блок кода"],group:"Базовые блоки"},table:{title:"Таблица",subtext:"Используется для таблиц",aliases:["table","таблица"],group:"Продвинутый"},image:{title:"Картинка",subtext:"Вставить изображение",aliases:["image","imageUpload","upload","img","picture","media","url","загрузка","картинка","рисунок"],group:"Медиа"},video:{title:"Видео",subtext:"Вставить видео",aliases:["video","videoUpload","upload","mp4","film","media","url","загрузка","видео"],group:"Медиа"},audio:{title:"Аудио",subtext:"Вставить аудио",aliases:["audio","audioUpload","upload","mp3","sound","media","url","загрузка","аудио","звук","музыка"],group:"Медиа"},file:{title:"Файл",subtext:"Вставить файл",aliases:["file","upload","embed","media","url","загрузка","файл"],group:"Медиа"},emoji:{title:"Эмодзи",subtext:"Используется для вставки эмодзи",aliases:["эмодзи","смайлик","выражение эмоций","лицо"],group:"Прочее"}},placeholders:{default:"Ведите текст или введите «/» для команд",heading:"Заголовок",bulletListItem:"Список",numberedListItem:"Список",checkListItem:"Список"},file_blocks:{image:{add_button_text:"Добавить изображение"},video:{add_button_text:"Добавить видео"},audio:{add_button_text:"Добавить аудио"},file:{add_button_text:"Добавить файл"}},side_menu:{add_block_label:"Добавить блок",drag_handle_label:"Открыть меню блока"},drag_handle:{delete_menuitem:"Удалить",colors_menuitem:"Цвета"},table_handle:{delete_column_menuitem:"Удалить столбец",delete_row_menuitem:"Удалить строку",add_left_menuitem:"Добавить столбец слева",add_right_menuitem:"Добавить столбец справа",add_above_menuitem:"Добавить строку выше",add_below_menuitem:"Добавить строку ниже"},suggestion_menu:{no_items_title:"ничего не найдено",loading:"Загрузка…"},color_picker:{text_title:"Текст",background_title:"Задний фон",colors:{default:"По умолчинию",gray:"Серый",brown:"Коричневый",red:"Красный",orange:"Оранжевый",yellow:"Жёлтый",green:"Зелёный",blue:"Голубой",purple:"Фиолетовый",pink:"Розовый"}},formatting_toolbar:{bold:{tooltip:"Жирный",secondary_tooltip:"Mod+B"},italic:{tooltip:"Курсив",secondary_tooltip:"Mod+I"},underline:{tooltip:"Подчёркнутый",secondary_tooltip:"Mod+U"},strike:{tooltip:"Зачёркнутый",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Код",secondary_tooltip:""},colors:{tooltip:"Цвета"},link:{tooltip:"Создать ссылку",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Изменить подпись",input_placeholder:"Изменить подпись"},file_replace:{tooltip:{image:"Заменить изображение",video:"Заменить видео",audio:"Заменить аудио",file:"Заменить файл"}},file_rename:{tooltip:{image:"Переименовать изображение",video:"Переименовать видео",audio:"Переименовать аудио",file:"Переименовать файл"},input_placeholder:{image:"Переименовать изображение",video:"Переименовать видео",audio:"Переименовать аудио",file:"Переименовать файл"}},file_download:{tooltip:{image:"Скачать картинку",video:"Скачать видео",audio:"Скачать аудио",file:"Скачать файл"}},file_delete:{tooltip:{image:"Удалить картинку",video:"Удалить видео",audio:"Удалить аудио",file:"Скачать файл"}},file_preview_toggle:{tooltip:"Переключить предварительный просмотр"},nest:{tooltip:"Сдвинуть вправо",secondary_tooltip:"Tab"},unnest:{tooltip:"Сдвинуть влево",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Текст по левому краю"},align_center:{tooltip:"Текст по середине"},align_right:{tooltip:"Текст по правому краю"},align_justify:{tooltip:"По середине текст"}},file_panel:{upload:{title:"Загрузить",file_placeholder:{image:"Загрузить картинки",video:"Загрузить видео",audio:"Загрузить аудио",file:"Загрузить файл"},upload_error:"Ошибка: не удалось загрузить"},embed:{title:"Вставить",embed_button:{image:"Вставить картинку",video:"Вставить видео",audio:"Вставить аудио",file:"Вставить файл"},url_placeholder:"Введите URL"}},link_toolbar:{delete:{tooltip:"Удалить ссылку"},edit:{text:"Изменить ссылку",tooltip:"Редактировать"},open:{tooltip:"Открыть в новой вкладке"},form:{title_placeholder:"Изменить заголовок",url_placeholder:"Изменить URL"}},generic:{ctrl_shortcut:"Ctrl"}},vi:{slash_menu:{heading:{title:"Tiêu đề H1",subtext:"Sử dụng cho tiêu đề cấp cao nhất",aliases:["h","tieude1","dd1"],group:"Tiêu đề"},heading_2:{title:"Tiêu đề H2",subtext:"Sử dụng cho các phần chính",aliases:["h2","tieude2","tieudephu"],group:"Tiêu đề"},heading_3:{title:"Tiêu đề H3",subtext:"Sử dụng cho phụ đề và tiêu đề nhóm",aliases:["h3","tieude3","tieudephu"],group:"Tiêu đề"},numbered_list:{title:"Danh sách đánh số",subtext:"Sử dụng để hiển thị danh sách có đánh số",aliases:["ol","li","ds","danhsachdso","danh sach danh so"],group:"Khối cơ bản"},bullet_list:{title:"Danh sách",subtext:"Sử dụng để hiển thị danh sách không đánh số",aliases:["ul","li","ds","danhsach","danh sach"],group:"Khối cơ bản"},check_list:{title:"Danh sách kiểm tra",subtext:"Dùng để hiển thị danh sách có hộp kiểm",aliases:["ul","li","danh sach","danh sach kiem tra","danh sach da kiem tra","hop kiem"],group:"Khối cơ bản"},paragraph:{title:"Đoạn văn",subtext:"Sử dụng cho nội dung chính của tài liệu",aliases:["p","doanvan"],group:"Khối cơ bản"},code_block:{title:"Mã",subtext:"Sử dụng để hiển thị mã với cú pháp",aliases:["code","pre"],group:"Khối cơ bản"},table:{title:"Bảng",subtext:"Sử dụng để tạo bảng",aliases:["bang"],group:"Nâng cao"},image:{title:"Hình ảnh",subtext:"Chèn hình ảnh",aliases:["anh","tai-len-anh","tai-len","img","hinh","media","url"],group:"Phương tiện"},video:{title:"Video",subtext:"Chèn video",aliases:["video","tai-len-video","tai-len","mp4","phim","media","url"],group:"Phương tiện"},audio:{title:"Âm thanh",subtext:"Chèn âm thanh",aliases:["âm thanh","tai-len-am-thanh","tai-len","mp3","am thanh","media","url"],group:"Phương tiện"},file:{title:"Tệp",subtext:"Chèn tệp",aliases:["tep","tai-len","nhung","media","url"],group:"Phương tiện"},emoji:{title:"Biểu tượng cảm xúc",subtext:"Dùng để chèn biểu tượng cảm xúc",aliases:["biểu tượng cảm xúc","emoji","emoticon","cảm xúc expression","khuôn mặt","face"],group:"Khác"}},placeholders:{default:"Nhập văn bản hoặc gõ '/' để thêm định dạng",heading:"Tiêu đề",bulletListItem:"Danh sách",numberedListItem:"Danh sách",checkListItem:"Danh sách"},file_blocks:{image:{add_button_text:"Thêm ảnh"},video:{add_button_text:"Thêm video"},audio:{add_button_text:"Thêm âm thanh"},file:{add_button_text:"Thêm tệp"}},side_menu:{add_block_label:"Thêm khối",drag_handle_label:"Mở trình đơn khối"},drag_handle:{delete_menuitem:"Xóa",colors_menuitem:"Màu sắc"},table_handle:{delete_column_menuitem:"Xóa cột",delete_row_menuitem:"Xóa hàng",add_left_menuitem:"Thêm cột bên trái",add_right_menuitem:"Thêm cột bên phải",add_above_menuitem:"Thêm hàng phía trên",add_below_menuitem:"Thêm hàng phía dưới"},suggestion_menu:{no_items_title:"Không tìm thấy mục nào",loading:"Đang tải..."},color_picker:{text_title:"Văn bản",background_title:"Nền",colors:{default:"Mặc định",gray:"Xám",brown:"Nâu",red:"Đỏ",orange:"Cam",yellow:"Vàng",green:"Xanh lá",blue:"Xanh dương",purple:"Tím",pink:"Hồng"}},formatting_toolbar:{bold:{tooltip:"In đậm",secondary_tooltip:"Mod+B"},italic:{tooltip:"In nghiêng",secondary_tooltip:"Mod+I"},underline:{tooltip:"Gạch dưới",secondary_tooltip:"Mod+U"},strike:{tooltip:"Gạch ngang",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Code",secondary_tooltip:""},colors:{tooltip:"Màu sắc"},link:{tooltip:"Tạo liên kết",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Chỉnh sửa chú thích",input_placeholder:"Chỉnh sửa chú thích"},file_replace:{tooltip:{image:"Thay thế hình ảnh",video:"Thay thế video",audio:"Thay thế âm thanh",file:"Thay thế tệp"}},file_rename:{tooltip:{image:"Đổi tên hình ảnh",video:"Đổi tên video",audio:"Đổi tên âm thanh",file:"Đổi tên tệp"},input_placeholder:{image:"Đổi tên hình ảnh",video:"Đổi tên video",audio:"Đổi tên âm thanh",file:"Đổi tên tệp"}},file_download:{tooltip:{image:"Tải xuống hình ảnh",video:"Tải xuống video",audio:"Tải xuống âm thanh",file:"Tải xuống tệp"}},file_delete:{tooltip:{image:"Xóa hình ảnh",video:"Xóa video",audio:"Xóa âm thanh",file:"Xóa tệp"}},file_preview_toggle:{tooltip:"Chuyển đổi xem trước"},nest:{tooltip:"Lồng khối",secondary_tooltip:"Tab"},unnest:{tooltip:"Bỏ lồng khối",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Căn trái văn bản"},align_center:{tooltip:"Căn giữa văn bản"},align_right:{tooltip:"Căn phải văn bản"},align_justify:{tooltip:"Căn đều văn bản"}},file_panel:{upload:{title:"Tải lên",file_placeholder:{image:"Tải lên hình ảnh",video:"Tải lên video",audio:"Tải lên âm thanh",file:"Tải lên tệp"},upload_error:"Lỗi: Tải lên thất bại"},embed:{title:"Nhúng",embed_button:{image:"Nhúng hình ảnh",video:"Nhúng video",audio:"Nhúng âm thanh",file:"Nhúng tệp"},url_placeholder:"Nhập URL"}},link_toolbar:{delete:{tooltip:"Xóa liên kết"},edit:{text:"Chỉnh sửa liên kết",tooltip:"Chỉnh sửa"},open:{tooltip:"Mở trong tab mới"},form:{title_placeholder:"Chỉnh sửa tiêu đề",url_placeholder:"Chỉnh sửa URL"}},generic:{ctrl_shortcut:"Ctrl"}},zh:{slash_menu:{heading:{title:"一级标题",subtext:"用于顶级标题",aliases:["h","heading1","h1","标题","一级标题"],group:"标题"},heading_2:{title:"二级标题",subtext:"用于关键部分",aliases:["h2","heading2","subheading","标题","二级标题","副标题"],group:"标题"},heading_3:{title:"三级标题",subtext:"用于小节和分组标题",aliases:["h3","heading3","subheading","标题","三级标题"],group:"标题"},numbered_list:{title:"有序列表",subtext:"用于显示有序列表",aliases:["ol","li","list","numberedlist","numbered list","列表","有序列表"],group:"基础"},bullet_list:{title:"无序列表",subtext:"用于显示无序列表",aliases:["ul","li","list","bulletlist","bullet list","列表","无序列表"],group:"基础"},check_list:{title:"检查清单",subtext:"用于显示带有复选框的列表",aliases:["ul","li","checklist","checked list","列表","检查清单","勾选列表","复选框"],group:"基础"},paragraph:{title:"段落",subtext:"用于文档正文",aliases:["p","paragraph","text","正文"],group:"基础"},code_block:{title:"代码块",subtext:"用于显示带有语法高亮的代码块",aliases:["code","pre","代码","预格式"],group:"基础"},table:{title:"表格",subtext:"使用表格",aliases:["table","表格"],group:"高级功能"},image:{title:"图片",subtext:"插入图片",aliases:["图片","上传图片","上传","image","img","相册","媒体","url"],group:"媒体"},video:{title:"视频",subtext:"插入视频",aliases:["视频","视频上传","上传","video","mp4","电影","媒体","url","驱动","dropbox"],group:"媒体"},audio:{title:"音频",subtext:"插入音频",aliases:["音频","音频上传","上传","audio","mp3","声音","媒体","url","驱动","dropbox"],group:"媒体"},file:{title:"文件",subtext:"插入文件",aliases:["文件","上传","file","嵌入","媒体","url"],group:"媒体"},emoji:{title:"表情符号",subtext:"用于插入表情符号",aliases:["表情符号","emoji","face","emote","表情","表情表达","表情"],group:"其他"}},placeholders:{default:"输入 '/' 以使用命令",heading:"标题",bulletListItem:"列表",numberedListItem:"列表",checkListItem:"列表"},file_blocks:{image:{add_button_text:"添加图片"},video:{add_button_text:"添加视频"},audio:{add_button_text:"添加音频"},file:{add_button_text:"添加文件"}},side_menu:{add_block_label:"添加块",drag_handle_label:"打开菜单"},drag_handle:{delete_menuitem:"删除",colors_menuitem:"颜色"},table_handle:{delete_column_menuitem:"删除列",delete_row_menuitem:"删除行",add_left_menuitem:"左侧添加列",add_right_menuitem:"右侧添加列",add_above_menuitem:"上方添加行",add_below_menuitem:"下方添加行"},suggestion_menu:{no_items_title:"无匹配项",loading:"加载中…"},color_picker:{text_title:"文本",background_title:"背景色",colors:{default:"默认",gray:"灰色",brown:"棕色",red:"红色",orange:"橙色",yellow:"黄色",green:"绿色",blue:"蓝色",purple:"紫色",pink:"粉色"}},formatting_toolbar:{bold:{tooltip:"加粗",secondary_tooltip:"Mod+B"},italic:{tooltip:"斜体",secondary_tooltip:"Mod+I"},underline:{tooltip:"下划线",secondary_tooltip:"Mod+U"},strike:{tooltip:"删除线",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"代码标记",secondary_tooltip:""},colors:{tooltip:"颜色"},link:{tooltip:"添加链接",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"编辑标题",input_placeholder:"编辑标题"},file_replace:{tooltip:{image:"替换图片",video:"替换视频",audio:"替换音频",file:"替换文件"}},file_rename:{tooltip:{image:"重命名图片",video:"重命名视频",audio:"重命名音频",file:"重命名文件"},input_placeholder:{image:"重命名图片",video:"重命名视频",audio:"重命名音频",file:"重命名文件"}},file_download:{tooltip:{image:"下载图片",video:"下载视频",audio:"下载音频",file:"下载文件"}},file_delete:{tooltip:{image:"删除图片",video:"删除视频",audio:"删除音频",file:"删除文件"}},file_preview_toggle:{tooltip:"切换预览"},nest:{tooltip:"嵌套",secondary_tooltip:"Tab"},unnest:{tooltip:"取消嵌套",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"左对齐"},align_center:{tooltip:"居中"},align_right:{tooltip:"右对齐"},align_justify:{tooltip:"文本对齐"}},file_panel:{upload:{title:"上传",file_placeholder:{image:"上传图片",video:"上传视频",audio:"上传音频",file:"上传文件"},upload_error:"Error:上传失败"},embed:{title:"嵌入",embed_button:{image:"嵌入图片",video:"嵌入视频",audio:"嵌入音频",file:"嵌入文件"},url_placeholder:"输入图片地址"}},link_toolbar:{delete:{tooltip:"清除链接"},edit:{text:"编辑链接",tooltip:"编辑"},open:{tooltip:"新窗口打开"},form:{title_placeholder:"编辑标题",url_placeholder:"编辑链接地址"}},generic:{ctrl_shortcut:"Ctrl"}}},Symbol.toStringTag,{value:"Module"}));class N extends Error{constructor(t){super(`Unreachable case: ${t}`)}}function Pi(e,t=!0){const{"data-test":o,...i}=e;if(Object.keys(i).length>0&&t)throw new Error("Object must be empty "+JSON.stringify(e))}function Ai(e,t=JSON.stringify){const o={};return e.filter(i=>{const n=t(i);return Object.prototype.hasOwnProperty.call(o,n)?!1:o[n]=!0})}function Ni(e){const t=e.filter((i,n)=>e.indexOf(i)!==n);return Ai(t)}const X=k.Extension.create({name:"uniqueID",priority:1e4,addOptions(){return{attributeName:"id",types:[],setIdAttribute:!1,generateID:()=>{if(typeof window<"u"&&window.__TEST_OPTIONS){const e=window.__TEST_OPTIONS;return e.mockID===void 0?e.mockID=0:e.mockID++,e.mockID.toString()}return ti.v4()},filterTransaction:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{[this.options.attributeName]:{default:null,parseHTML:e=>e.getAttribute(`data-${this.options.attributeName}`),renderHTML:e=>{const t={[`data-${this.options.attributeName}`]:e[this.options.attributeName]};return this.options.setIdAttribute?{...t,id:e[this.options.attributeName]}:t}}}}]},addProseMirrorPlugins(){let e=null,t=!1;return[new _.Plugin({key:new _.PluginKey("uniqueID"),appendTransaction:(o,i,n)=>{const a=o.some(g=>g.docChanged)&&!i.doc.eq(n.doc),r=this.options.filterTransaction&&o.some(g=>{let b,y;return!(!((y=(b=this.options).filterTransaction)===null||y===void 0)&&y.call(b,g))});if(!a||r)return;const{tr:s}=n,{types:l,attributeName:c,generateID:u}=this.options,h=k.combineTransactionSteps(i.doc,o),{mapping:m}=h;if(k.getChangedRanges(h).forEach(({newRange:g})=>{const b=k.findChildrenInRange(n.doc,g,M=>l.includes(M.type.name)),y=b.map(({node:M})=>M.attrs[c]).filter(M=>M!==null),C=Ni(y);b.forEach(({node:M,pos:D})=>{let ie;const ge=(ie=s.doc.nodeAt(D))===null||ie===void 0?void 0:ie.attrs[c];if(ge===null){const B=i.doc.type.createAndFill().content;if(i.doc.content.findDiffStart(B)===null){const ei=JSON.parse(JSON.stringify(n.doc.toJSON()));if(ei.content[0].content[0].attrs.id="initialBlockId",JSON.stringify(ei.content)===JSON.stringify(B.toJSON())){s.setNodeMarkup(D,void 0,{...M.attrs,[c]:"initialBlockId"});return}}s.setNodeMarkup(D,void 0,{...M.attrs,[c]:u()});return}const{deleted:Me}=m.invert().mapResult(D);Me&&C.includes(ge)&&s.setNodeMarkup(D,void 0,{...M.attrs,[c]:u()})})}),!!s.steps.length)return s},view(o){const i=n=>{let a;e=!((a=o.dom.parentElement)===null||a===void 0)&&a.contains(n.target)?o.dom.parentElement:null};return window.addEventListener("dragstart",i),{destroy(){window.removeEventListener("dragstart",i)}}},props:{handleDOMEvents:{drop:(o,i)=>{let n;return(e!==o.dom.parentElement||((n=i.dataTransfer)===null||n===void 0?void 0:n.effectAllowed)==="copy")&&(e=null,t=!0),!1},paste:()=>(t=!0,!1)},transformPasted:o=>{if(!t)return o;const{types:i,attributeName:n}=this.options,a=r=>{const s=[];return r.forEach(l=>{if(l.isText){s.push(l);return}if(!i.includes(l.type.name)){s.push(l.copy(a(l.content)));return}const c=l.type.create({...l.attrs,[n]:null},a(l.content),l.marks);s.push(c)}),v.Fragment.from(s)};return t=!1,new v.Slice(a(o.content),o.openStart,o.openEnd)}}})]}});function Le(e){return e.type==="link"}function Ie(e){return typeof e!="string"&&e.type==="link"}function Z(e){return typeof e!="string"&&e.type==="text"}function ut(e,t,o){const i=[];for(const[n,a]of Object.entries(e.styles)){const r=o[n];if(!r)throw new Error(`style ${n} not found in styleSchema`);if(r.propSchema==="boolean")i.push(t.mark(n));else if(r.propSchema==="string")i.push(t.mark(n,{stringValue:a}));else throw new N(r.propSchema)}return e.text.split(/(\n)/g).filter(n=>n.length>0).map(n=>n===` `?t.nodes.hardBreak.createChecked():t.text(n,i))}function ji(e,t,o){const i=t.marks.link.create({href:e.href});return Pe(e.content,t,o).map(n=>{if(n.type.name==="text")return n.mark([...n.marks,i]);if(n.type.name==="hardBreak")return n;throw new Error("unexpected node type")})}function Pe(e,t,o){const i=[];if(typeof e=="string")return i.push(...ut({type:"text",text:e,styles:{}},t,o)),i;for(const n of e)i.push(...ut(n,t,o));return i}function j(e,t,o){const i=[];for(const n of e)typeof n=="string"?i.push(...Pe(n,t,o)):Ie(n)?i.push(...ji(n,t,o)):Z(n)?i.push(...Pe([n],t,o)):i.push(pt(n,t,o));return i}function ne(e,t,o){var n;const i=[];for(const a of e.rows){const r=[];for(let l=0;l0?t.nodes.blockGroup.createChecked({},n):void 0;return t.nodes.blockContainer.createChecked({id:i,...e.props},s?[r,s]:r)}else{if(a.isInGroup("bnBlock"))return t.nodes[e.type].createChecked({id:i,...e.props},n);throw new Error(`block type ${e.type} doesn't match blockContent or bnBlock group`)}}function ht(e){const t=[...e.classList].filter(o=>!o.startsWith("bn-"))||[];t.length>0?e.className=t.join(" "):e.removeAttribute("class")}function mt(e,t,o,i){let n;if(t)if(typeof t=="string")n=j([t],e.pmSchema,e.schema.styleSchema);else if(Array.isArray(t))n=j(t,e.pmSchema,e.schema.styleSchema);else if(t.type==="tableContent")n=ne(t,e.pmSchema,e.schema.styleSchema);else throw new N(t.type);else throw new Error("blockContent is required");const a=o.serializeFragment(v.Fragment.from(n),i);return a.nodeType===1&&ht(a),a}function Di(e,t,o,i,n,a,r){var b,y,C,M,D,ie,ge,Me;const s=(r==null?void 0:r.document)??document,l=t.pmSchema.nodes.blockContainer;let c=o.props;if(!o.props){c={};for(const[L,B]of Object.entries(t.schema.blockSchema[o.type].propSchema))c[L]=B.default}const h=[...((y=(b=l.spec)==null?void 0:b.toDOM)==null?void 0:y.call(b,l.create({id:o.id,...c}))).dom.attributes],m=t.blockImplementations[o.type].implementation.toExternalHTML({...o,props:c},t),f=s.createDocumentFragment();if(m.dom.classList.contains("bn-block-content")){const L=[...h,...m.dom.attributes].filter(B=>B.name.startsWith("data")&&B.name!=="data-content-type"&&B.name!=="data-file-block"&&B.name!=="data-node-view-wrapper"&&B.name!=="data-node-type"&&B.name!=="data-id"&&B.name!=="data-index"&&B.name!=="data-editable");for(const B of L)m.dom.firstChild.setAttribute(B.name,B.value);ht(m.dom.firstChild),f.append(...m.dom.childNodes)}else f.append(m.dom);if(m.contentDOM&&o.content){const L=mt(t,o.content,i,r);m.contentDOM.appendChild(L)}let g;if(n.has(o.type)?g="OL":a.has(o.type)&&(g="UL"),g){if(((C=e.lastChild)==null?void 0:C.nodeName)!==g){const B=s.createElement(g);e.append(B)}const L=s.createElement("li");L.append(f),e.lastChild.appendChild(L)}else e.append(f);if(o.children&&o.children.length>0){const L=s.createDocumentFragment();if(ft(L,t,o.children,i,n,a,r),((M=e.lastChild)==null?void 0:M.nodeName)==="UL"||((D=e.lastChild)==null?void 0:D.nodeName)==="OL")for(;((ie=L.firstChild)==null?void 0:ie.nodeName)==="UL"||((ge=L.firstChild)==null?void 0:ge.nodeName)==="OL";)e.lastChild.lastChild.appendChild(L.firstChild);t.pmSchema.nodes[o.type].isInGroup("blockContent")?e.append(L):(Me=m.contentDOM)==null||Me.append(L)}}const ft=(e,t,o,i,n,a,r)=>{for(const s of o)Di(e,t,s,i,n,a,r)},Hi=(e,t,o,i,n,a)=>{const s=((a==null?void 0:a.document)??document).createDocumentFragment();return ft(s,e,t,o,i,n,a),s},ae=(e,t)=>{const o=v.DOMSerializer.fromSchema(e);return{exportBlocks:(i,n)=>{const a=Hi(t,i,o,new Set(["numberedListItem"]),new Set(["bulletListItem","checkListItem"]),n),r=document.createElement("div");return r.append(a),r.innerHTML},exportInlineContent:(i,n)=>{const a=mt(t,i,o,n),r=document.createElement("div");return r.append(a.cloneNode(!0)),r.innerHTML}}};function Ui(e,t,o,i){let n;if(t)if(typeof t=="string")n=j([t],e.pmSchema,e.schema.styleSchema);else if(Array.isArray(t))n=j(t,e.pmSchema,e.schema.styleSchema);else if(t.type==="tableContent")n=ne(t,e.pmSchema,e.schema.styleSchema);else throw new N(t.type);else throw new Error("blockContent is required");return o.serializeFragment(v.Fragment.from(n),i)}function Oi(e,t,o,i,n){var h,m,f,g,b;const a=e.pmSchema.nodes.blockContainer;let r=t.props;if(!t.props){r={};for(const[y,C]of Object.entries(e.schema.blockSchema[t.type].propSchema))r[y]=C.default}const l=e.blockImplementations[t.type].implementation.toInternalHTML({...t,props:r},e);if(t.type==="numberedListItem"&&l.dom.setAttribute("data-index",i.toString()),l.contentDOM&&t.content){const y=Ui(e,t.content,o,n);l.contentDOM.appendChild(y)}if(e.pmSchema.nodes[t.type].isInGroup("bnBlock")){if(t.children&&t.children.length>0){const y=gt(e,t.children,o,n);(h=l.contentDOM)==null||h.append(y)}return l.dom}const u=(f=(m=a.spec)==null?void 0:m.toDOM)==null?void 0:f.call(m,a.create({id:t.id,...r}));return(g=u.contentDOM)==null||g.appendChild(l.dom),t.children&&t.children.length>0&&((b=u.contentDOM)==null||b.appendChild(bt(e,t.children,o,n))),u.dom}function gt(e,t,o,i){const a=((i==null?void 0:i.document)??document).createDocumentFragment();let r=0;for(const s of t){s.type==="numberedListItem"?r++:r=0;const l=Oi(e,s,o,r,i);a.appendChild(l)}return a}const bt=(e,t,o,i)=>{var s;const n=e.pmSchema.nodes.blockGroup,a=n.spec.toDOM(n.create({})),r=gt(e,t,o,i);return(s=a.contentDOM)==null||s.appendChild(r),a.dom},kt=(e,t)=>{const o=v.DOMSerializer.fromSchema(e);return{serializeBlocks:(i,n)=>bt(t,i,o,n).outerHTML}};function re(e,t){const o=e.resolve(t);if(o.nodeAfter&&o.nodeAfter.type.isInGroup("bnBlock"))return{posBeforeNode:o.pos,node:o.nodeAfter};let i=o.depth,n=o.node(i);for(;i>0;){if(n.type.isInGroup("bnBlock"))return{posBeforeNode:o.before(i),node:n};i--,n=o.node(i)}const a=[];e.descendants((s,l)=>{s.type.isInGroup("bnBlock")&&a.push(l)}),console.warn(`Position ${t} is not within a blockContainer node.`);const r=e.resolve(a.find(s=>s>=t)||a[a.length-1]);return{posBeforeNode:r.pos,node:r.nodeAfter}}function ke(e,t){if(!e.type.isInGroup("bnBlock"))throw new Error(`Attempted to get bnBlock node at position but found node of different type ${e.type}`);const o=e,i=t,n=i+o.nodeSize,a={node:o,beforePos:i,afterPos:n};if(o.type.name==="blockContainer"){let r,s;if(o.forEach((l,c)=>{if(l.type.spec.group==="blockContent"){const u=l,h=i+c+1,m=h+l.nodeSize;r={node:u,beforePos:h,afterPos:m}}else if(l.type.name==="blockGroup"){const u=l,h=i+c+1,m=h+l.nodeSize;s={node:u,beforePos:h,afterPos:m}}}),!r)throw new Error(`blockContainer node does not contain a blockContent node in its children: ${o}`);return{isBlockContainer:!0,bnBlock:a,blockContent:r,childContainer:s,blockNoteType:r.node.type.name}}else{if(!a.node.type.isInGroup("childContainer"))throw new Error(`bnBlock node is not in the childContainer group: ${a.node}`);return{isBlockContainer:!1,bnBlock:a,childContainer:a,blockNoteType:a.node.type.name}}}function K(e){return ke(e.node,e.posBeforeNode)}function J(e){if(!e.nodeAfter)throw new Error(`Attempted to get blockContainer node at position ${e.pos} but a node at this position does not exist`);return ke(e.nodeAfter,e.pos)}function w(e){const t=re(e.doc,e.selection.anchor),o=K(t);if(!o.isBlockContainer)throw new Error(`selection always expected to return blockContainer ${e.selection.anchor}`);return o}function q(e,t){let o,i;if(t.firstChild.descendants((n,a)=>o?!1:!n.type.isInGroup("bnBlock")||n.attrs.id!==e?!0:(o=n,i=a+1,!1)),o===void 0||i===void 0)throw Error("Could not find block in the editor with matching ID.");return{node:o,posBeforeNode:i}}const _t=()=>typeof navigator<"u"&&(/Mac/.test(navigator.platform)||/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent));function O(e,t="Ctrl"){return _t()?e.replace("Mod","⌘"):e.replace("Mod",t)}function R(...e){return e.filter(t=>t).join(" ")}const Ri=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function H(e,t,o,i){const n=document.createElement("div");n.className=R("bn-block-content",o.class),n.setAttribute("data-content-type",e);for(const[r,s]of Object.entries(o))r!=="class"&&n.setAttribute(r,s);const a=document.createElement(t);a.className=R("bn-inline-content",i.class);for(const[r,s]of Object.entries(i))r!=="class"&&a.setAttribute(r,s);return n.appendChild(a),{dom:n,contentDOM:a}}const Ae=(e,t)=>{let o=F(e,t.pmSchema,t.schema.styleSchema);o.type.name==="blockContainer"&&(o=o.firstChild);const i=t.pmSchema.nodes[o.type.name].spec.toDOM;if(i===void 0)throw new Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");const n=i(o);if(typeof n!="object"||!("dom"in n))throw new Error("Cannot use this block's default HTML serialization as its corresponding TipTap node's `renderHTML` function does not return an object with the `dom` property.");return n},E={backgroundColor:{default:"default"},textColor:{default:"default"},textAlignment:{default:"left",values:["left","center","right","justify"]}},Ne=["backgroundColor","textColor"];function se(e){return"data-"+e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function zi(e){const t=e.split("/");return!t.length||t[t.length-1]===""?e:t[t.length-1]}function je(e){const t={};return Object.entries(e).filter(([o,i])=>!Ne.includes(o)).forEach(([o,i])=>{t[o]={default:i.default,keepOnSplit:!0,parseHTML:n=>{const a=n.getAttribute(se(o));if(a===null)return null;if(typeof i.default=="boolean")return a==="true"?!0:a==="false"?!1:null;if(typeof i.default=="number"){const r=parseFloat(a);return!Number.isNaN(r)&&Number.isFinite(r)?r:null}return a},renderHTML:n=>n[o]!==i.default?{[se(o)]:n[o]}:{}}}),t}function yt(e,t,o,i){if(typeof e=="boolean")throw new Error("Cannot find node position as getPos is a boolean, not a function.");const n=e(),r=o.state.doc.resolve(n).node().attrs.id;if(!r)throw new Error("Block doesn't have id");const s=t.getBlock(r);if(s.type!==i)throw new Error("Block type does not match");return s}function le(e,t,o,i,n=!1,a){const r=document.createElement("div");if(a!==void 0)for(const[s,l]of Object.entries(a))s!=="class"&&r.setAttribute(s,l);r.className=R("bn-block-content",(a==null?void 0:a.class)||""),r.setAttribute("data-content-type",t);for(const[s,l]of Object.entries(o))!Ne.includes(s)&&l!==i[s].default&&r.setAttribute(se(s),l);return n&&r.setAttribute("data-file-block",""),r.appendChild(e.dom),e.contentDOM!==void 0&&(e.contentDOM.className=R("bn-inline-content",e.contentDOM.className),e.contentDOM.setAttribute("data-editable","")),{...e,dom:r}}function z(e){return k.Node.create(e)}function De(e,t){return{config:e,implementation:t}}function V(e,t,o){return De({type:e.name,content:e.config.content==="inline*"?"inline":e.config.content==="tableRow+"?"table":"none",propSchema:t},{node:e,requiredExtensions:o,toInternalHTML:Ae,toExternalHTML:Ae})}function He(e){return Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o.config]))}function vt(e,t){e.stopEvent=o=>(o.type==="mousedown"&&setTimeout(()=>{t.view.dom.blur()},10),!0)}function wt(e,t){const o=[{tag:"[data-content-type="+e.type+"]",contentElement:"[data-editable]"}];return t&&o.push({tag:"*",getAttrs(i){if(typeof i=="string")return!1;const n=t==null?void 0:t(i);return n===void 0?!1:n}}),o}function de(e,t){const o=z({name:e.type,content:e.content==="inline"?"inline*":"",group:"blockContent",selectable:e.isSelectable??!0,addAttributes(){return je(e.propSchema)},parseHTML(){return wt(e,t.parse)},renderHTML({HTMLAttributes:i}){const n=document.createElement("div");return le({dom:n,contentDOM:e.content==="inline"?n:void 0},e.type,{},e.propSchema,e.isFileBlock,i)},addNodeView(){return({getPos:i})=>{var c;const n=this.options.editor,a=yt(i,n,this.editor,e.type),r=((c=this.options.domAttributes)==null?void 0:c.blockContent)||{},s=t.render(a,n),l=le(s,a.type,a.props,e.propSchema,r);return e.isSelectable===!1&&vt(l,this.editor),l}}});if(o.name!==e.type)throw new Error("Node name does not match block type. This is a bug in BlockNote.");return De(e,{node:o,toInternalHTML:(i,n)=>{var s;const a=((s=o.options.domAttributes)==null?void 0:s.blockContent)||{},r=t.render(i,n);return le(r,i.type,i.props,e.propSchema,e.isFileBlock,a)},toExternalHTML:(i,n)=>{var s,l;const a=((s=o.options.domAttributes)==null?void 0:s.blockContent)||{};let r=(l=t.toExternalHTML)==null?void 0:l.call(t,i,n);return r===void 0&&(r=t.render(i,n)),le(r,i.type,i.props,e.propSchema,a)}})}function Ue(e,t,o){const i={type:"tableContent",columnWidths:[],rows:[]};return e.content.forEach((n,a,r)=>{const s={cells:[]};r===0&&n.content.forEach(l=>{var c;i.columnWidths.push(((c=l.attrs.colwidth)==null?void 0:c[0])||void 0)}),n.content.forEach(l=>{s.cells.push(ce(l.firstChild,t,o))}),i.rows.push(s)}),i}function ce(e,t,o){const i=[];let n;return e.content.forEach(a=>{if(a.type.name==="hardBreak"){if(n)if(Z(n))n.text+=` `;else if(Le(n))n.content[n.content.length-1].text+=` `;else throw new Error("unexpected");else n={type:"text",text:` `,styles:{}};return}if(a.type.name!=="link"&&a.type.name!=="text"&&t[a.type.name]){n&&(i.push(n),n=void 0),i.push(_e(a,t,o));return}const r={};let s;for(const l of a.marks)if(l.type.name==="link")s=l;else{const c=o[l.type.name];if(!c)throw new Error(`style ${l.type.name} not found in styleSchema`);if(c.propSchema==="boolean")r[c.type]=!0;else if(c.propSchema==="string")r[c.type]=l.attrs.stringValue;else throw new N(c.propSchema)}n?Z(n)?s?(i.push(n),n={type:"link",href:s.attrs.href,content:[{type:"text",text:a.textContent,styles:r}]}):JSON.stringify(n.styles)===JSON.stringify(r)?n.text+=a.textContent:(i.push(n),n={type:"text",text:a.textContent,styles:r}):Le(n)&&(s?n.href===s.attrs.href?JSON.stringify(n.content[n.content.length-1].styles)===JSON.stringify(r)?n.content[n.content.length-1].text+=a.textContent:n.content.push({type:"text",text:a.textContent,styles:r}):(i.push(n),n={type:"link",href:s.attrs.href,content:[{type:"text",text:a.textContent,styles:r}]}):(i.push(n),n={type:"text",text:a.textContent,styles:r})):s?n={type:"link",href:s.attrs.href,content:[{type:"text",text:a.textContent,styles:r}]}:n={type:"text",text:a.textContent,styles:r}}),n&&i.push(n),i}function _e(e,t,o){if(e.type.name==="text"||e.type.name==="link")throw new Error("unexpected");const i={},n=t[e.type.name];for(const[s,l]of Object.entries(e.attrs)){if(!n)throw Error("ic node is of an unrecognized type: "+e.type.name);const c=n.propSchema;s in c&&(i[s]=l)}let a;return n.content==="styled"?a=ce(e,t,o):a=void 0,{type:e.type.name,props:i,content:a}}function S(e,t,o,i,n){var g;if(!e.type.isInGroup("bnBlock"))throw Error("Node must be in bnBlock group, but is of type"+e.type.name);const a=n==null?void 0:n.get(e);if(a)return a;const r=ke(e,0);let s=r.bnBlock.node.attrs.id;s===null&&(s=X.options.generateID());const l=t[r.blockNoteType];if(!l)throw Error("Block is of an unrecognized type: "+r.blockNoteType);const c={};for(const[b,y]of Object.entries({...e.attrs,...r.isBlockContainer?r.blockContent.node.attrs:{}})){const C=l.propSchema;b in C&&(c[b]=y)}const u=t[r.blockNoteType],h=[];(g=r.childContainer)==null||g.node.forEach(b=>{h.push(S(b,t,o,i,n))});let m;if(u.content==="inline"){if(!r.isBlockContainer)throw new Error("impossible");m=ce(r.blockContent.node,o,i)}else if(u.content==="table"){if(!r.isBlockContainer)throw new Error("impossible");m=Ue(r.blockContent.node,o,i)}else if(u.content==="none")m=void 0;else throw new N(u.content);const f={id:s,type:u.type,props:c,content:m,children:h};return n==null||n.set(e,f),f}function Oe(e,t,o,i){return e.dom.setAttribute("data-inline-content-type",t),Object.entries(o).filter(([n,a])=>a!==i[n].default).map(([n,a])=>[se(n),a]).forEach(([n,a])=>e.dom.setAttribute(n,a)),e.contentDOM!==void 0&&e.contentDOM.setAttribute("data-editable",""),e}function Ct(e){return{Backspace:({editor:t})=>{const o=t.state.selection.$from;return t.state.selection.empty&&o.node().type.name===e.type&&o.parentOffset===0}}}function Et(e,t){return{config:e,implementation:t}}function xt(e,t){return Et({type:e.name,propSchema:t,content:e.config.content==="inline*"?"styled":"none"},{node:e})}function Re(e){return Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o.config]))}function St(e){return[{tag:`[data-inline-content-type="${e.type}"]`,contentElement:t=>{const o=t;return o.matches("[data-editable]")?o:o.querySelector("[data-editable]")||o}}]}function Vi(e,t){const o=k.Node.create({name:e.type,inline:!0,group:"inline",selectable:e.content==="styled",atom:e.content==="none",content:e.content==="styled"?"inline*":"",addAttributes(){return je(e.propSchema)},addKeyboardShortcuts(){return Ct(e)},parseHTML(){return St(e)},renderHTML({node:i}){const n=this.options.editor,a=t.render(_e(i,n.schema.inlineContentSchema,n.schema.styleSchema),()=>{},n);return Oe(a,e.type,i.attrs,e.propSchema)},addNodeView(){return({node:i,getPos:n})=>{const a=this.options.editor,r=t.render(_e(i,a.schema.inlineContentSchema,a.schema.styleSchema),s=>{if(typeof n=="boolean")return;const l=j([s],a._tiptapEditor.schema,a.schema.styleSchema);a._tiptapEditor.view.dispatch(a._tiptapEditor.view.state.tr.replaceWith(n(),n()+i.nodeSize,l))},a);return Oe(r,e.type,i.attrs,e.propSchema)}}});return xt(o,e.propSchema)}function Bt(e){return e==="boolean"?{}:{stringValue:{default:void 0,keepOnSplit:!0,parseHTML:t=>t.getAttribute("data-value"),renderHTML:t=>t.stringValue!==void 0?{"data-value":t.stringValue}:{}}}}function Tt(e,t,o,i){return e.dom.setAttribute("data-style-type",t),i==="string"&&e.dom.setAttribute("data-value",o),e.contentDOM!==void 0&&e.contentDOM.setAttribute("data-editable",""),e}function ze(e,t){return{config:e,implementation:t}}function G(e,t){return ze({type:e.name,propSchema:t},{mark:e})}function Ve(e){return Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o.config]))}function Mt(e){return[{tag:`[data-style-type="${e.type}"]`,contentElement:t=>{const o=t;return o.matches("[data-editable]")?o:o.querySelector("[data-editable]")||o}}]}function Fi(e,t){const o=k.Mark.create({name:e.type,addAttributes(){return Bt(e.propSchema)},parseHTML(){return Mt(e)},renderHTML({mark:i}){let n;if(e.propSchema==="boolean")n=t.render();else if(e.propSchema==="string")n=t.render(i.attrs.stringValue);else throw new N(e.propSchema);return Tt(n,e.type,i.attrs.stringValue,e.propSchema)}});return ze(e,{mark:o})}const Lt='',ue=(e,t,o,i,n)=>{const a=document.createElement("div");if(a.className="bn-file-block-content-wrapper",e.props.url===""){const r=It(e,t,i,n);a.appendChild(r.dom);const s=document.createElement("div");s.className="bn-file-loading-preview",s.textContent="Loading...";const l=t.onUploadStart(u=>{u===e.id&&(a.removeChild(r.dom),a.appendChild(s))}),c=t.onUploadEnd(u=>{u===e.id&&(a.removeChild(s),a.appendChild(r.dom))});return{dom:a,destroy:()=>{var u;(u=r.destroy)==null||u.call(r),l(),c()}}}else if(e.props.showPreview===!1){const r=Fe(e).dom;return{dom:Y(e,r).dom}}else return a.appendChild(o.dom),{dom:a,destroy:o.destroy}},Fe=e=>{const t=document.createElement("div");t.className="bn-file-default-preview";const o=document.createElement("div");o.className="bn-file-default-preview-icon",o.innerHTML=Lt;const i=document.createElement("p");return i.className="bn-file-default-preview-name",i.textContent=e.props.name||"",t.appendChild(o),t.appendChild(i),{dom:t}},Y=(e,t)=>{const o=document.createElement("div");o.className="bn-file-and-caption-wrapper";const i=document.createElement("p");return i.className="bn-file-caption",i.textContent=e.props.caption,typeof e.props.previewWidth=="number"&&e.props.previewWidth>0&&e.props.caption!==void 0&&(i.style.width=`${e.props.previewWidth}px`),o.appendChild(t),o.appendChild(i),{dom:o}},It=(e,t,o,i)=>{const n=document.createElement("div");n.className="bn-add-file-button";const a=document.createElement("div");a.className="bn-add-file-button-icon",i?a.appendChild(i):a.innerHTML='';const r=document.createElement("p");r.className="bn-add-file-button-text",r.innerHTML=o||t.dictionary.file_blocks.file.add_button_text;const s=c=>{c.preventDefault()},l=()=>{t.dispatch(t._tiptapEditor.state.tr.setMeta(t.filePanel.plugin,{block:e}))};return n.appendChild(a),n.appendChild(r),n.addEventListener("mousedown",s,!0),n.addEventListener("click",l,!0),{dom:n,destroy:()=>{n.removeEventListener("mousedown",s,!0),n.removeEventListener("click",l,!0)}}},Ge=e=>({url:e.src||void 0}),pe=(e,t)=>{const o=e.querySelector(t);if(!o)return;const i=e.querySelector("figcaption"),n=(i==null?void 0:i.textContent)??void 0;return{targetElement:o,caption:n}},he=(e,t)=>{const o=document.createElement("div"),i=document.createElement("p");return i.textContent=t,o.appendChild(e),o.appendChild(i),{dom:o}},ye=(e,t)=>{const o=document.createElement("figure"),i=document.createElement("figcaption");return i.textContent=t,o.appendChild(e),o.appendChild(i),{dom:o}},We=(e,t,o,i,n)=>{if(!e.props.previewWidth)throw new Error("Block must have a `previewWidth` prop.");const a=document.createElement("div");a.className="bn-visual-media-wrapper";const r=document.createElement("div");r.className="bn-visual-media-resize-handle",r.style.left="4px";const s=document.createElement("div");s.className="bn-visual-media-resize-handle",s.style.right="4px";let l;const c=b=>{if(!l){!t.isEditable&&a.contains(r)&&a.contains(s)&&(a.removeChild(r),a.removeChild(s));return}let y;e.props.textAlignment==="center"?l.handleUsed==="left"?y=l.initialWidth+(l.initialClientX-b.clientX)*2:y=l.initialWidth+(b.clientX-l.initialClientX)*2:l.handleUsed==="left"?y=l.initialWidth+l.initialClientX-b.clientX:y=l.initialWidth+b.clientX-l.initialClientX;const C=64;yt.domElement.firstElementChild.clientWidth?n(t.domElement.firstElementChild.clientWidth):n(y)},u=b=>{(!b.target||!a.contains(b.target)||!t.isEditable)&&a.contains(r)&&a.contains(s)&&(a.removeChild(r),a.removeChild(s)),l&&(l=void 0,t.updateBlock(e,{props:{previewWidth:i()}}))},h=()=>{t.isEditable&&(a.appendChild(r),a.appendChild(s))},m=b=>{b.relatedTarget===r||b.relatedTarget===s||l||t.isEditable&&a.contains(r)&&a.contains(s)&&(a.removeChild(r),a.removeChild(s))},f=b=>{b.preventDefault(),a.appendChild(r),a.appendChild(s),l={handleUsed:"left",initialWidth:e.props.previewWidth,initialClientX:b.clientX}},g=b=>{b.preventDefault(),a.appendChild(r),a.appendChild(s),l={handleUsed:"right",initialWidth:e.props.previewWidth,initialClientX:b.clientX}};return a.appendChild(o),window.addEventListener("mousemove",c),window.addEventListener("mouseup",u),o.addEventListener("mouseenter",h),o.addEventListener("mouseleave",m),r.addEventListener("mousedown",f),s.addEventListener("mousedown",g),{dom:a,destroy:()=>{window.removeEventListener("mousemove",c),window.removeEventListener("mouseup",u),o.removeEventListener("mouseenter",h),o.removeEventListener("mouseleave",m),r.removeEventListener("mousedown",f),s.removeEventListener("mousedown",g)}}},Pt=e=>({url:e.src||void 0}),At='',Nt={backgroundColor:E.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0}},jt={type:"audio",propSchema:Nt,content:"none",isFileBlock:!0,fileBlockAccept:["audio/*"]},Dt=(e,t)=>{const o=document.createElement("div");o.innerHTML=At;const i=document.createElement("audio");i.className="bn-audio",t.resolveFileUrl(e.props.url).then(a=>{i.src=a}),i.controls=!0,i.contentEditable="false",i.draggable=!1;const n=Y(e,i);return ue(e,t,n,t.dictionary.file_blocks.audio.add_button_text,o.firstElementChild)},Ht=e=>{if(e.tagName==="AUDIO")return Pt(e);if(e.tagName==="FIGURE"){const t=pe(e,"audio");if(!t)return;const{targetElement:o,caption:i}=t;return{...Pt(o),caption:i}}},Ut=e=>{if(!e.props.url){const o=document.createElement("p");return o.textContent="Add audio",{dom:o}}let t;return e.props.showPreview?(t=document.createElement("audio"),t.src=e.props.url):(t=document.createElement("a"),t.href=e.props.url,t.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?ye(t,e.props.caption):he(t,e.props.caption):{dom:t}},Ot=de(jt,{render:Dt,parse:Ht,toExternalHTML:Ut}),Rt=[{id:"text",name:"Plain Text",match:["text","txt","plain"]},...ni.bundledLanguagesInfo.filter(e=>!["angular-html","angular-ts","astro","blade","coffee","handlebars","html-derivative","http","imba","jinja","jison","json5","marko","mdc","stylus","ts-tags"].includes(e.id)).map(e=>({match:[e.id,...e.aliases||[]],id:e.id,name:e.name})),{id:"haskell",name:"Haskell",match:["haskell","hs"]},{id:"csharp",name:"C#",match:["c#","csharp","cs"]},{id:"latex",name:"LaTeX",match:["latex"]},{id:"lua",name:"Lua",match:["lua"]},{id:"mermaid",name:"Mermaid",match:["mermaid","mmd"]},{id:"ruby",name:"Ruby",match:["ruby","rb"]},{id:"rust",name:"Rust",match:["rust","rs"]},{id:"scala",name:"Scala",match:["scala"]},{id:"swift",name:"Swift",match:["swift"]},{id:"kotlin",name:"Kotlin",match:["kotlin","kt","kts"]},{id:"objective-c",name:"Objective C",match:["objective-c","objc"]}],ve={language:{default:"javascript",values:[...Rt.map(e=>e.id)]}},zt=z({name:"codeBlock",content:"inline*",group:"blockContent",marks:"",code:!0,defining:!0,addOptions(){return{defaultLanguage:"javascript",indentLineWithTab:!0,supportedLanguages:Rt}},addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{let t=e;(t==null?void 0:t.tagName)==="DIV"&&(t==null?void 0:t.dataset.contentType)==="codeBlock"&&(t=t.children[0]),(t==null?void 0:t.tagName)==="PRE"&&(t=t==null?void 0:t.children[0]);const o=t==null?void 0:t.getAttribute("data-language");if(o)return o.toLowerCase();const n=[...(t==null?void 0:t.className.split(" "))||[]].filter(r=>r.startsWith("language-")).map(r=>r.replace("language-","")),[a]=n;return a?a.toLowerCase():null},renderHTML:e=>e.language&&e.language!=="text"?{class:`language-${e.language}`}:{}}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"pre",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:e}){var n,a;const t=document.createElement("pre"),{dom:o,contentDOM:i}=H(this.name,"code",((n=this.options.domAttributes)==null?void 0:n.blockContent)||{},{...((a=this.options.domAttributes)==null?void 0:a.inlineContent)||{},...e});return o.removeChild(i),o.appendChild(t),t.appendChild(i),{dom:o,contentDOM:i}},addNodeView(){const e=this.options.supportedLanguages;return({editor:t,node:o,getPos:i,HTMLAttributes:n})=>{var h,m;const a=document.createElement("pre"),r=document.createElement("select"),s=document.createElement("div"),{dom:l,contentDOM:c}=H(this.name,"code",{...((h=this.options.domAttributes)==null?void 0:h.blockContent)||{},...n},((m=this.options.domAttributes)==null?void 0:m.inlineContent)||{}),u=f=>{const g=f.target.value;t.commands.command(({tr:b})=>(b.setNodeAttribute(i(),"language",g),!0))};return e.forEach(({id:f,name:g})=>{const b=document.createElement("option");b.value=f,b.text=g,r.appendChild(b)}),s.contentEditable="false",r.value=o.attrs.language||this.options.defaultLanguage,l.removeChild(c),l.appendChild(s),l.appendChild(a),a.appendChild(c),s.appendChild(r),r.addEventListener("change",u),{dom:l,contentDOM:c,update:f=>f.type===this.type,destroy:()=>{r.removeEventListener("change",u)}}}},addProseMirrorPlugins(){let e,t;const o=this.options.supportedLanguages,i=a=>{if(!e)return lt.createHighlighter({themes:["github-dark"],langs:[]}).then(s=>{e=s});const r=a.language;return r&&r!=="text"&&!e.getLoadedLanguages().includes(r)&&o.find(({id:s})=>s===r)&<.bundledLanguagesInfo.find(({id:s})=>s===r)?e.loadLanguage(r):(t||(t=ii.createParser(e)),t(a))};return[oi.createHighlightPlugin({parser:i,languageExtractor:a=>a.attrs.language,nodeTypes:[this.name]})]},addInputRules(){const e=this.options.supportedLanguages;return[new k.InputRule({find:/^```(.*?)\s$/,handler:({state:t,range:o,match:i})=>{var s;const n=t.doc.resolve(o.from),a=i[1].trim(),r={language:((s=e.find(({match:l})=>l.includes(a)))==null?void 0:s.id)||this.options.defaultLanguage};if(!n.node(-1).canReplaceWith(n.index(-1),n.indexAfter(-1),this.type))return null;t.tr.delete(o.from,o.to).setBlockType(o.from,o.from,this.type,r).setSelection(_.TextSelection.create(t.tr.doc,o.from))}})]},addKeyboardShortcuts(){return{Delete:({editor:e})=>{const{selection:t}=e.state,{$from:o}=t;if(e.isActive(this.name)&&!o.parent.textContent&&k.isTextSelection(t)){const i=o.pos-o.parentOffset-2;return e.chain().setNodeSelection(i).deleteSelection().run(),!0}return!1},Tab:({editor:e})=>this.options.indentLineWithTab&&e.isActive(this.name)?(e.commands.insertContent(" "),!0):!1,Enter:({editor:e})=>{const{$from:t}=e.state.selection;if(!e.isActive(this.name))return!1;const o=t.parentOffset===t.parent.nodeSize-2,i=t.parent.textContent.endsWith(` `);return!o||!i?(e.commands.insertContent(` `),!0):e.chain().command(({tr:n})=>(n.delete(t.pos-2,t.pos),!0)).exitCode().run()},"Shift-Enter":({editor:e})=>{const{$from:t}=e.state.selection;return e.isActive(this.name)?(e.chain().insertContentAt(t.pos-t.parentOffset+t.parent.nodeSize,{type:"paragraph"}).run(),!0):!1}}}}),Vt=V(zt,ve);function Gi(e){var t;return V(zt.configure(e),{language:{default:e.defaultLanguage||ve.language.default,values:((t=e.supportedLanguages)==null?void 0:t.map(o=>o.id))||ve.language.values}})}const Ft={backgroundColor:E.backgroundColor,name:{default:""},url:{default:""},caption:{default:""}},Gt={type:"file",propSchema:Ft,content:"none",isFileBlock:!0},Wt=(e,t)=>{const o=Fe(e).dom,i=Y(e,o);return ue(e,t,i)},Kt=e=>{if(e.tagName==="EMBED")return Ge(e);if(e.tagName==="FIGURE"){const t=pe(e,"embed");if(!t)return;const{targetElement:o,caption:i}=t;return{...Ge(o),caption:i}}},qt=e=>{if(!e.props.url){const o=document.createElement("p");return o.textContent="Add file",{dom:o}}const t=document.createElement("a");return t.href=e.props.url,t.textContent=e.props.name||e.props.url,e.props.caption?he(t,e.props.caption):{dom:t}},$t=de(Gt,{render:Wt,parse:Kt,toExternalHTML:qt}),Wi=async e=>{const t=new FormData;return t.append("file",e),(await(await fetch("https://tmpfiles.org/api/v1/upload",{method:"POST",body:t})).json()).data.url.replace("tmpfiles.org/","tmpfiles.org/dl/")},Ke=e=>{const t=e.src||void 0,o=e.width||void 0;return{url:t,previewWidth:o}},Xt='',Zt={textAlignment:E.textAlignment,backgroundColor:E.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0},previewWidth:{default:512}},Jt={type:"image",propSchema:Zt,content:"none",isFileBlock:!0,fileBlockAccept:["image/*"]},Yt=(e,t)=>{const o=document.createElement("div");o.innerHTML=Xt;const i=document.createElement("img");i.className="bn-visual-media",t.resolveFileUrl(e.props.url).then(r=>{i.src=r}),i.alt=e.props.name||e.props.caption||"BlockNote image",i.contentEditable="false",i.draggable=!1,i.width=Math.min(e.props.previewWidth,t.domElement.firstElementChild.clientWidth);const n=We(e,t,i,()=>i.width,r=>i.width=r),a=Y(e,n.dom);return ue(e,t,a,t.dictionary.file_blocks.image.add_button_text,o.firstElementChild)},Qt=e=>{if(e.tagName==="IMG")return Ke(e);if(e.tagName==="FIGURE"){const t=pe(e,"img");if(!t)return;const{targetElement:o,caption:i}=t;return{...Ke(o),caption:i}}},eo=e=>{if(!e.props.url){const o=document.createElement("p");return o.textContent="Add image",{dom:o}}let t;return e.props.showPreview?(t=document.createElement("img"),t.src=e.props.url,t.alt=e.props.name||e.props.caption||"BlockNote image",t.width=e.props.previewWidth):(t=document.createElement("a"),t.href=e.props.url,t.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?ye(t,e.props.caption):he(t,e.props.caption):{dom:t}},to=de(Jt,{render:Yt,parse:Qt,toExternalHTML:eo}),Ki=35,qe=120,qi=31,$i=k.Extension.create({name:"BlockNoteTableExtension",addProseMirrorPlugins:()=>[$.columnResizing({cellMinWidth:Ki,defaultCellMinWidth:qe,View:null}),$.tableEditing()],addKeyboardShortcuts(){return{Enter:()=>this.editor.state.selection.empty&&this.editor.state.selection.$head.parent.type.name==="tableParagraph"?(this.editor.commands.setHardBreak(),!0):!1,Backspace:()=>{const e=this.editor.state.selection,t=e.empty,o=e.$head.parentOffset===0,i=e.$head.node().type.name==="tableParagraph";return t&&o&&i}}},extendNodeSchema(e){const t={name:e.name,options:e.options,storage:e.storage};return{tableRole:k.callOrReturn(k.getExtensionField(e,"tableRole",t))}}}),oo=e=>{const t=e.src||void 0,o=e.width||void 0;return{url:t,previewWidth:o}},io='',no={textAlignment:E.textAlignment,backgroundColor:E.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0},previewWidth:{default:512}},ao={type:"video",propSchema:no,content:"none",isFileBlock:!0,fileBlockAccept:["video/*"]},ro=(e,t)=>{const o=document.createElement("div");o.innerHTML=io;const i=document.createElement("video");i.className="bn-visual-media",i.src=e.props.url,i.controls=!0,i.contentEditable="false",i.draggable=!1,i.width=Math.min(e.props.previewWidth,t.domElement.firstElementChild.clientWidth);const n=We(e,t,i,()=>i.width,r=>i.width=r),a=Y(e,n.dom);return ue(e,t,a,t.dictionary.file_blocks.video.add_button_text,o.firstElementChild)},so=e=>{if(e.tagName==="VIDEO")return oo(e);if(e.tagName==="FIGURE"){const t=pe(e,"video");if(!t)return;const{targetElement:o,caption:i}=t;return{...oo(o),caption:i}}},lo=e=>{if(!e.props.url){const o=document.createElement("p");return o.textContent="Add video",{dom:o}}let t;return e.props.showPreview?(t=document.createElement("video"),t.src=e.props.url,t.width=e.props.previewWidth):(t=document.createElement("a"),t.href=e.props.url,t.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?ye(t,e.props.caption):he(t,e.props.caption):{dom:t}},co=de(ao,{render:ro,parse:so,toExternalHTML:lo}),Xi=k.Mark.create({name:"backgroundColor",addAttributes(){return{stringValue:{default:void 0,parseHTML:e=>e.getAttribute("data-background-color"),renderHTML:e=>({"data-background-color":e.stringValue})}}},parseHTML(){return[{tag:"span",getAttrs:e=>typeof e=="string"?!1:e.hasAttribute("data-background-color")?{stringValue:e.getAttribute("data-background-color")}:!1}]},renderHTML({HTMLAttributes:e}){return["span",e,0]}}),Zi=G(Xi,"string"),Ji=k.Mark.create({name:"textColor",addAttributes(){return{stringValue:{default:void 0,parseHTML:e=>e.getAttribute("data-text-color"),renderHTML:e=>({"data-text-color":e.stringValue})}}},parseHTML(){return[{tag:"span",getAttrs:e=>typeof e=="string"?!1:e.hasAttribute("data-text-color")?{stringValue:e.getAttribute("data-text-color")}:!1}]},renderHTML({HTMLAttributes:e}){return["span",e,0]}}),Yi=G(Ji,"string"),T=(e,t,o)=>({state:i,dispatch:n})=>{const a=J(i.doc.resolve(t));if(n){const r=i.schema.nodes[a.blockNoteType],s=i.schema.nodes[o.type||a.blockNoteType],l=s.isInGroup("bnBlock")?s:i.schema.nodes.blockContainer;if(a.isBlockContainer&&s.isInGroup("blockContent"))uo(o,i,e,a),Qi(o,i,e,r,s,a);else if(!a.isBlockContainer&&s.isInGroup("bnBlock"))uo(o,i,e,a);else{const c=S(a.bnBlock.node,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache);return i.tr.replaceWith(a.bnBlock.beforePos,a.bnBlock.afterPos,F({children:c.children,...o},i.schema,e.schema.styleSchema)),!0}i.tr.setNodeMarkup(a.bnBlock.beforePos,l,{...a.bnBlock.node.attrs,...o.props})}return!0};function Qi(e,t,o,i,n,a){let r="keep";if(e.content)if(typeof e.content=="string")r=j([e.content],t.schema,o.schema.styleSchema);else if(Array.isArray(e.content))r=j(e.content,t.schema,o.schema.styleSchema);else if(e.content.type==="tableContent")r=ne(e.content,t.schema,o.schema.styleSchema);else throw new N(e.content.type);else i.spec.content===""||n.spec.content!==i.spec.content&&(r=[]);r==="keep"?t.tr.setNodeMarkup(a.blockContent.beforePos,e.type===void 0?void 0:t.schema.nodes[e.type],{...a.blockContent.node.attrs,...e.props}):t.tr.replaceWith(a.blockContent.beforePos,a.blockContent.afterPos,n.createChecked({...a.blockContent.node.attrs,...e.props},r))}function uo(e,t,o,i){if(e.children!==void 0){const n=e.children.map(a=>F(a,t.schema,o.schema.styleSchema));if(i.childContainer)t.tr.step(new be.ReplaceStep(i.childContainer.beforePos+1,i.childContainer.afterPos-1,new v.Slice(v.Fragment.from(n),0,0)));else{if(!i.isBlockContainer)throw new Error("impossible");t.tr.insert(i.blockContent.afterPos,t.schema.nodes.blockGroup.createChecked({},n))}}}function en(e,t,o){const i=e._tiptapEditor,n=typeof t=="string"?t:t.id,{posBeforeNode:a}=q(n,i.state.doc);i.commands.command(({state:s,dispatch:l})=>(T(e,a,o)({state:s,dispatch:l}),!0));const r=i.state.doc.resolve(a+1).node();return S(r,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}const tn={...E,level:{default:1,values:[1,2,3]}},on=z({name:"heading",content:"inline*",group:"blockContent",addAttributes(){return{level:{default:1,parseHTML:e=>{const t=e.getAttribute("data-level"),o=parseInt(t);if(isFinite(o))return o},renderHTML:e=>({"data-level":e.level.toString()})}}},addInputRules(){return[...[1,2,3].map(e=>new k.InputRule({find:new RegExp(`^(#{${e}})\\s$`),handler:({state:t,chain:o,range:i})=>{const n=w(t);n.blockContent.node.type.spec.content==="inline*"&&o().command(T(this.options.editor,n.bnBlock.beforePos,{type:"heading",props:{level:e}})).deleteRange({from:i.from,to:i.to}).run()}}))]},addKeyboardShortcuts(){return{"Mod-Alt-1":()=>{const e=w(this.editor.state);return e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(T(this.options.editor,e.bnBlock.beforePos,{type:"heading",props:{level:1}}))},"Mod-Alt-2":()=>{const e=w(this.editor.state);return e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(T(this.options.editor,e.bnBlock.beforePos,{type:"heading",props:{level:2}}))},"Mod-Alt-3":()=>{const e=w(this.editor.state);return e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(T(this.options.editor,e.bnBlock.beforePos,{type:"heading",props:{level:3}}))}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]",getAttrs:e=>typeof e=="string"?!1:{level:e.getAttribute("data-level")}},{tag:"h1",attrs:{level:1},node:"heading"},{tag:"h2",attrs:{level:2},node:"heading"},{tag:"h3",attrs:{level:3},node:"heading"}]},renderHTML({node:e,HTMLAttributes:t}){var o,i;return H(this.name,`h${e.attrs.level}`,{...((o=this.options.domAttributes)==null?void 0:o.blockContent)||{},...t},((i=this.options.domAttributes)==null?void 0:i.inlineContent)||{})}}),nn=V(on,tn),po=(e,t,o)=>({state:i,dispatch:n})=>{const a=re(i.doc,e),r=K(a);if(!r.isBlockContainer)throw new Error(`BlockContainer expected when calling splitBlock, position ${e}`);const s=[{type:r.bnBlock.node.type,attrs:o?{...r.bnBlock.node.attrs,id:void 0}:{}},{type:t?r.blockContent.node.type:i.schema.nodes.paragraph,attrs:o?{...r.blockContent.node.attrs}:{}}];return n&&i.tr.split(e,2,s),!0},$e=e=>{const t=e._tiptapEditor,{blockContent:o,bnBlock:i}=w(t.state),n=t.state.selection.anchor===t.state.selection.head;return!(o.node.type.name==="bulletListItem"||o.node.type.name==="numberedListItem"||o.node.type.name==="checkListItem")||!n?!1:t.commands.first(({state:a,chain:r,commands:s})=>[()=>s.command(()=>o.node.childCount===0?s.command(T(e,i.beforePos,{type:"paragraph",props:{}})):!1),()=>s.command(()=>o.node.childCount>0?(r().deleteSelection().command(po(a.selection.from,!0)).run(),!0):!1)])},an={...E},rn=z({name:"bulletListItem",content:"inline*",group:"blockContent",priority:90,addInputRules(){return[new k.InputRule({find:new RegExp("^[-+*]\\s$"),handler:({state:e,chain:t,range:o})=>{const i=w(e);i.blockContent.node.type.spec.content==="inline*"&&t().command(T(this.options.editor,i.bnBlock.beforePos,{type:"bulletListItem",props:{}})).deleteRange({from:o.from,to:o.to})}})]},addKeyboardShortcuts(){return{Enter:()=>$e(this.options.editor),"Mod-Shift-8":()=>{const e=w(this.editor.state);return e.blockContent.node.type.spec.content!=="inline*"?!0:this.options.editor.commands.command(T(this.options.editor,e.bnBlock.beforePos,{type:"bulletListItem",props:{}}))}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"li",getAttrs:e=>{if(typeof e=="string")return!1;const t=e.parentElement;return t===null?!1:t.tagName==="UL"||t.tagName==="DIV"&&t.parentElement.tagName==="UL"?{}:!1},node:"bulletListItem"},{tag:"p",getAttrs:e=>{if(typeof e=="string")return!1;const t=e.parentElement;return t===null?!1:t.getAttribute("data-content-type")==="bulletListItem"?{}:!1},priority:300,node:"bulletListItem"}]},renderHTML({HTMLAttributes:e}){var t,o;return H(this.name,"p",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((o=this.options.domAttributes)==null?void 0:o.inlineContent)||{})}}),sn=V(rn,an),ln={...E,checked:{default:!1}},dn=z({name:"checkListItem",content:"inline*",group:"blockContent",addAttributes(){return{checked:{default:!1,parseHTML:e=>e.getAttribute("data-checked")==="true"||void 0,renderHTML:e=>e.checked?{"data-checked":e.checked.toString()}:{}}}},addInputRules(){return[new k.InputRule({find:new RegExp("\\[\\s*\\]\\s$"),handler:({state:e,chain:t,range:o})=>{const i=w(e);i.blockContent.node.type.spec.content==="inline*"&&t().command(T(this.options.editor,i.bnBlock.beforePos,{type:"checkListItem",props:{checked:!1}})).deleteRange({from:o.from,to:o.to})}}),new k.InputRule({find:new RegExp("\\[[Xx]\\]\\s$"),handler:({state:e,chain:t,range:o})=>{const i=w(e);i.blockContent.node.type.spec.content==="inline*"&&t().command(T(this.options.editor,i.bnBlock.beforePos,{type:"checkListItem",props:{checked:!0}})).deleteRange({from:o.from,to:o.to})}})]},addKeyboardShortcuts(){return{Enter:()=>$e(this.options.editor),"Mod-Shift-9":()=>{const e=w(this.options.editor.state);return e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(T(this.options.editor,e.bnBlock.beforePos,{type:"checkListItem",props:{}}))}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"input",getAttrs:e=>typeof e=="string"?!1:e.type==="checkbox"?{checked:e.checked}:!1,node:"checkListItem"},{tag:"li",getAttrs:e=>{if(typeof e=="string")return!1;const t=e.parentElement;if(t===null)return!1;if(t.tagName==="UL"||t.tagName==="DIV"&&t.parentElement.tagName==="UL"){const o=e.querySelector("input[type=checkbox]")||null;return o===null?!1:{checked:o.checked}}return!1},node:"checkListItem"}]},renderHTML({node:e,HTMLAttributes:t}){var a,r;const o=document.createElement("input");o.type="checkbox",o.checked=e.attrs.checked,e.attrs.checked&&o.setAttribute("checked","");const{dom:i,contentDOM:n}=H(this.name,"p",{...((a=this.options.domAttributes)==null?void 0:a.blockContent)||{},...t},((r=this.options.domAttributes)==null?void 0:r.inlineContent)||{});return i.insertBefore(o,n),{dom:i,contentDOM:n}},addNodeView(){return({node:e,getPos:t,editor:o,HTMLAttributes:i})=>{var u,h;const n=document.createElement("div"),a=document.createElement("div");a.contentEditable="false";const r=document.createElement("input");r.type="checkbox",r.checked=e.attrs.checked,e.attrs.checked&&r.setAttribute("checked","");const s=()=>{if(!o.isEditable){r.checked=!r.checked;return}if(typeof t!="boolean"){const m=re(o.state.doc,t());this.editor.commands.command(T(this.options.editor,m.posBeforeNode,{type:"checkListItem",props:{checked:r.checked}}))}};r.addEventListener("change",s);const{dom:l,contentDOM:c}=H(this.name,"p",{...((u=this.options.domAttributes)==null?void 0:u.blockContent)||{},...i},((h=this.options.domAttributes)==null?void 0:h.inlineContent)||{});if(typeof t!="boolean"){const f="label-"+this.editor.state.doc.resolve(t()).node().attrs.id;r.setAttribute("aria-labelledby",f),c.id=f}return l.removeChild(c),l.appendChild(n),n.appendChild(a),n.appendChild(c),a.appendChild(r),{dom:l,contentDOM:c,destroy:()=>{r.removeEventListener("change",s)}}}}}),cn=V(dn,ln),un=new _.PluginKey("numbered-list-indexing"),pn=()=>new _.Plugin({key:un,appendTransaction:(e,t,o)=>{const i=o.tr;i.setMeta("numberedListIndexing",!0);let n=!1;return o.doc.descendants((a,r)=>{if(a.type.name==="blockContainer"&&a.firstChild.type.name==="numberedListItem"){let s="1";const l=K({posBeforeNode:r,node:a});if(!l.isBlockContainer)throw new Error("impossible");const c=i.doc.resolve(l.bnBlock.beforePos).nodeBefore;if(c){const m=K({posBeforeNode:l.bnBlock.beforePos-c.nodeSize,node:c});if(m.blockNoteType==="numberedListItem"){if(!m.isBlockContainer)throw new Error("impossible");const g=m.blockContent.node.attrs.index;s=(parseInt(g)+1).toString()}}const u=l.blockContent.node;u.attrs.index!==s&&(n=!0,i.setNodeMarkup(l.blockContent.beforePos,void 0,{...u.attrs,index:s}))}}),n?i:null}}),hn={...E},mn=z({name:"numberedListItem",content:"inline*",group:"blockContent",priority:90,addAttributes(){return{index:{default:null,parseHTML:e=>e.getAttribute("data-index"),renderHTML:e=>({"data-index":e.index})}}},addInputRules(){return[new k.InputRule({find:new RegExp("^1\\.\\s$"),handler:({state:e,chain:t,range:o})=>{const i=w(e);i.blockContent.node.type.spec.content==="inline*"&&t().command(T(this.options.editor,i.bnBlock.beforePos,{type:"numberedListItem",props:{}})).deleteRange({from:o.from,to:o.to})}})]},addKeyboardShortcuts(){return{Enter:()=>$e(this.options.editor),"Mod-Shift-7":()=>{const e=w(this.editor.state);return e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(T(this.options.editor,e.bnBlock.beforePos,{type:"numberedListItem",props:{}}))}}},addProseMirrorPlugins(){return[pn()]},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"li",getAttrs:e=>{if(typeof e=="string")return!1;const t=e.parentElement;return t===null?!1:t.tagName==="OL"||t.tagName==="DIV"&&t.parentElement.tagName==="OL"?{}:!1},node:"numberedListItem"},{tag:"p",getAttrs:e=>{if(typeof e=="string")return!1;const t=e.parentElement;return t===null?!1:t.getAttribute("data-content-type")==="numberedListItem"?{}:!1},priority:300,node:"numberedListItem"}]},renderHTML({HTMLAttributes:e}){var t,o;return H(this.name,"p",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((o=this.options.domAttributes)==null?void 0:o.inlineContent)||{})}}),fn=V(mn,hn),gn={...E},bn=z({name:"paragraph",content:"inline*",group:"blockContent",addKeyboardShortcuts(){return{"Mod-Alt-0":()=>{const e=w(this.editor.state);return e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(T(this.options.editor,e.bnBlock.beforePos,{type:"paragraph",props:{}}))}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"p",priority:200,getAttrs:e=>{var t;return typeof e=="string"||!((t=e.textContent)!=null&&t.trim())?!1:{}},node:"paragraph"}]},renderHTML({HTMLAttributes:e}){var t,o;return H(this.name,"p",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((o=this.options.domAttributes)==null?void 0:o.inlineContent)||{})}}),kn=V(bn,gn),_n={backgroundColor:E.backgroundColor,textColor:E.textColor},yn=z({name:"table",content:"tableRow+",group:"blockContent",tableRole:"table",isolating:!0,parseHTML(){return[{tag:"table"}]},renderHTML({HTMLAttributes:e}){var t,o;return H(this.name,"table",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((o=this.options.domAttributes)==null?void 0:o.inlineContent)||{})},addNodeView(){return({node:e,HTMLAttributes:t})=>{var i;class o extends $.TableView{constructor(a,r,s){super(a,r),this.node=a,this.cellMinWidth=r,this.blockContentHTMLAttributes=s;const l=document.createElement("div");l.className=R("bn-block-content",s.class),l.setAttribute("data-content-type","table");for(const[m,f]of Object.entries(s))m!=="class"&&l.setAttribute(m,f);const c=this.dom,u=document.createElement("div");u.className="tableWrapper-inner",u.appendChild(c.firstChild),c.appendChild(u),l.appendChild(c);const h=document.createElement("div");h.className="table-widgets-container",h.style.position="relative",c.appendChild(h),this.dom=l}ignoreMutation(a){return!a.target.closest(".tableWrapper-inner")||super.ignoreMutation(a)}}return new o(e,qe,{...((i=this.options.domAttributes)==null?void 0:i.blockContent)||{},...t})}}}),vn=k.Node.create({name:"tableParagraph",group:"tableContent",content:"inline*",parseHTML(){return[{preserveWhitespace:"full",priority:210,context:"tableContent",tag:"p",getAttrs:e=>({})},{tag:"p",getAttrs:e=>{if(typeof e=="string"||!e.textContent)return!1;const t=e.parentElement;return t===null?!1:t.tagName==="TD"?{}:!1}}]},renderHTML({HTMLAttributes:e}){return["p",e,0]}}),wn=V(yn,_n,[$i,vn,ui.TableHeader.extend({content:"tableContent"}),ci.TableCell.extend({content:"tableContent"}),pi.TableRow]),Xe={paragraph:kn,heading:nn,codeBlock:Vt,bulletListItem:sn,numberedListItem:fn,checkListItem:cn,table:wn,file:$t,image:to,video:co,audio:Ot},ho=He(Xe),Ze={bold:G(wi.default,"boolean"),italic:G(Ei.default,"boolean"),underline:G(Si.default,"boolean"),strike:G(xi.default,"boolean"),code:G(Ci.default,"boolean"),textColor:Yi,backgroundColor:Zi},Cn=Ve(Ze),Je={text:{config:"text",implementation:{}},link:{config:"link",implementation:{}}},mo=Re(Je);function I(e,t){return e in t.schema.blockSchema&&t.schema.blockSchema[e]===ho[e]}function fo(e,t){return e in t.schema.inlineContentSchema&&t.schema.inlineContentSchema[e]===mo[e]}function go(e,t,o){return t.type===e&&t.type in o.schema.blockSchema&&I(t.type,o)}function En(e,t){return e.type in t.schema.blockSchema&&t.schema.blockSchema[e.type].isFileBlock||!1}function xn(e,t){return e.type in t.schema.blockSchema&&t.schema.blockSchema[e.type].isFileBlock&&"showPreview"in t.schema.blockSchema[e.type].propSchema||!1}function Sn(e,t){return t.schema.blockSchema[e.type].isFileBlock&&!e.props.url}function bo(e,t,o){return t in o.schema.blockSchema&&e in o.schema.blockSchema[t].propSchema&&o.schema.blockSchema[t].propSchema[e]===E[e]}function Bn(e,t,o){return bo(e,t.type,o)}function Tn(e,t,o,i="before"){const n=typeof o=="string"?o:o.id,a=[];for(const c of t)a.push(F(c,e.pmSchema,e.schema.styleSchema));const{node:r,posBeforeNode:s}=q(n,e._tiptapEditor.state.doc);i==="before"&&e.dispatch(e._tiptapEditor.state.tr.insert(s,a)),i==="after"&&e.dispatch(e._tiptapEditor.state.tr.insert(s+r.nodeSize,a));const l=[];for(const c of a)l.push(S(c,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache));return l}function Mn(e){const{bnBlock:t}=w(e._tiptapEditor.state),o={blockId:t.node.attrs.id,blockPos:t.beforePos};return e._tiptapEditor.state.selection instanceof $.CellSelection?{...o,type:"cell",anchorCell:e._tiptapEditor.state.selection.$anchorCell.pos,headCell:e._tiptapEditor.state.selection.$headCell.pos}:e._tiptapEditor.state.selection instanceof _.NodeSelection?{...o,type:"node",from:e._tiptapEditor.state.selection.from}:{...o,type:"text",anchor:e._tiptapEditor.state.selection.anchor,head:e._tiptapEditor.state.selection.head}}function Ln(e,t){const o=q(t.blockId,e._tiptapEditor.state.doc).posBeforeNode;let i;t.type==="cell"?i=$.CellSelection.create(e._tiptapEditor.state.doc,t.anchorCell+(o-t.blockPos),t.headCell+(o-t.blockPos)):t.type==="node"?i=_.NodeSelection.create(e._tiptapEditor.state.doc,t.from+(o-t.blockPos)):i=_.TextSelection.create(e._tiptapEditor.state.doc,t.anchor+(o-t.blockPos),t.head+(o-t.blockPos)),e._tiptapEditor.view.dispatch(e._tiptapEditor.state.tr.setSelection(i))}function ko(e,t,o){const{block:i}=e.getTextCursorPosition(),n=Mn(e);e.removeBlocks([i]),e.insertBlocks([i],t,o),Ln(e,n)}function In(e){const t=e.getSelection();if(t&&t.blocks.length>1)return;const{prevBlock:o,parentBlock:i}=e.getTextCursorPosition();let n,a;o?o.children.length>0?(n=o.children[o.children.length-1].id,a="after"):(n=o.id,a="before"):i&&(n=i.id,a="before"),!(!n||!a)&&ko(e,n,a)}function Pn(e){const t=e.getSelection();if(t&&t.blocks.length>1)return;const{nextBlock:o,parentBlock:i}=e.getTextCursorPosition();let n,a;o?o.children.length>0?(n=o.children[0].id,a="before"):(n=o.id,a="after"):i&&(n=i.id,a="after"),!(!n||!a)&&ko(e,n,a)}function An(e,t){return function({state:o,dispatch:i}){const{$from:n,$to:a}=o.selection,r=n.blockRange(a,u=>u.childCount>0&&(u.type.name==="blockGroup"||u.type.name==="column"));if(!r)return!1;const s=r.startIndex;if(s===0)return!1;const c=r.parent.child(s-1);if(c.type!==e)return!1;if(i){const u=c.lastChild&&c.lastChild.type===t,h=v.Fragment.from(u?e.create():null),m=new v.Slice(v.Fragment.from(e.create(null,v.Fragment.from(t.create(null,h)))),u?3:1,0),f=r.start,g=r.end;i(o.tr.step(new be.ReplaceAroundStep(f-(u?3:1),g,f,g,m,1,!0)).scrollIntoView())}return!0}}function _o(e){return e._tiptapEditor.commands.command(An(e._tiptapEditor.schema.nodes.blockContainer,e._tiptapEditor.schema.nodes.blockGroup))}function Nn(e){e._tiptapEditor.commands.liftListItem("blockContainer")}function jn(e){const{bnBlock:t}=w(e._tiptapEditor.state);return e._tiptapEditor.state.doc.resolve(t.beforePos).nodeBefore!==null}function Dn(e){const{bnBlock:t}=w(e._tiptapEditor.state);return e._tiptapEditor.state.doc.resolve(t.beforePos).depth>1}function yo(e,t,o){const i=e._tiptapEditor,n=i.state.tr,a=new Set(t.map(l=>typeof l=="string"?l:l.id)),r=[];let s=0;if(i.state.doc.descendants((l,c)=>{if(a.size===0)return!1;if(!l.type.isInGroup("bnBlock")||!a.has(l.attrs.id))return!0;r.push(S(l,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)),a.delete(l.attrs.id),s=(o==null?void 0:o(l,c,n,s))||s;const u=n.doc.nodeSize;n.delete(c-s-1,c-s+l.nodeSize+1);const h=n.doc.nodeSize;return s+=u-h,!1}),a.size>0){const l=[...a].join(` `);throw Error("Blocks with the following IDs could not be found in the editor: "+l)}return e.dispatch(n),r}function Hn(e,t){return yo(e,t)}function Un(e,t,o){const i=[];for(const s of o)i.push(F(s,e.pmSchema,e.schema.styleSchema));const n=typeof t[0]=="string"?t[0]:t[0].id,a=yo(e,t,(s,l,c,u)=>{if(s.attrs.id===n){const h=c.doc.nodeSize;c.insert(l,i);const m=c.doc.nodeSize;return u+h-m}return u}),r=[];for(const s of i)r.push(S(s,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache));return{insertedBlocks:r,removedBlocks:a}}function On(e,t,o,i={updateSelection:!0}){const n=o._tiptapEditor.state.tr;let{from:a,to:r}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},s=!0,l=!0,c="";if(t.forEach(u=>{u.check(),s&&u.isText&&u.marks.length===0?c+=u.text:s=!1,l=l?u.isBlock:!1}),a===r&&l){const{parent:u}=n.doc.resolve(a);u.isTextblock&&!u.type.spec.code&&!u.childCount&&(a-=1,r+=1)}return s?n.insertText(c,a,r):n.replaceWith(a,r,t),i.updateSelection&&k.selectionToInsertionEnd(n,n.steps.length-1,-1),o.dispatch(n),!0}function Rn(e){const{bnBlock:t}=w(e._tiptapEditor.state),o=e._tiptapEditor.state.doc.resolve(t.beforePos),i=o.nodeBefore,n=e._tiptapEditor.state.doc.resolve(t.afterPos).nodeAfter;let a;return o.depth>1&&(a=o.node(),a.type.isInGroup("bnBlock")||(a=o.node(o.depth-1))),{block:S(t.node,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache),prevBlock:i===null?void 0:S(i,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache),nextBlock:n===null?void 0:S(n,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache),parentBlock:a===void 0?void 0:S(a,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}}function vo(e,t,o="start"){const i=typeof t=="string"?t:t.id,n=q(i,e._tiptapEditor.state.doc),a=K(n),r=e.schema.blockSchema[a.blockNoteType].content;if(a.isBlockContainer){const s=a.blockContent;if(r==="none"){e._tiptapEditor.commands.setNodeSelection(s.beforePos);return}if(r==="inline")o==="start"?e._tiptapEditor.commands.setTextSelection(s.beforePos+1):e._tiptapEditor.commands.setTextSelection(s.afterPos-1);else if(r==="table")o==="start"?e._tiptapEditor.commands.setTextSelection(s.beforePos+4):e._tiptapEditor.commands.setTextSelection(s.afterPos-4);else throw new N(r)}else{const s=o==="start"?a.childContainer.node.firstChild:a.childContainer.node.lastChild;vo(e,s.attrs.id,o)}}d.esmDependencies=void 0;async function we(){if(d.esmDependencies)return d.esmDependencies;const e=await Promise.all([import("rehype-parse"),import("rehype-stringify"),import("unified"),import("hast-util-from-dom"),import("rehype-remark"),import("remark-gfm"),import("remark-stringify"),import("remark-parse"),import("remark-rehype"),import("rehype-format")]);return d.esmDependencies={rehypeParse:e[0],rehypeStringify:e[1],unified:e[2],hastUtilFromDom:e[3],rehypeRemark:e[4],remarkGfm:e[5],remarkStringify:e[6],remarkParse:e[7],remarkRehype:e[8],rehypeFormat:e[9]},d.esmDependencies}function zn(){const e=t=>{let o=t.children.length;for(let i=0;i0){t.children.splice(i,1,...n.children);const a=n.children.length-1;o+=a,i+=a}else t.children.splice(i,1),o--,i--}};return e}function Vn(){const e=d.esmDependencies;if(!e)throw new Error("addSpacesToCheckboxes requires ESM dependencies to be initialized");const t=o=>{var i;if(o.children&&"length"in o.children&&o.children.length)for(let n=o.children.length-1;n>=0;n--){const a=o.children[n],r=n+1i.value}}).processSync(e).value}async function wo(e,t,o,i){await we();const a=ae(t,o).exportBlocks(e,i);return Ce(a)}function Fn(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}function Gn(e){return e.nodeType===3&&!/\S/.test(e.nodeValue||"")}function Wn(e){e.querySelectorAll("li > ul, li > ol").forEach(t=>{const o=Fn(t),i=t.parentElement,n=Array.from(i.childNodes).slice(o+1);t.remove(),n.forEach(a=>{a.remove()}),i.insertAdjacentElement("afterend",t),n.reverse().forEach(a=>{if(Gn(a))return;const r=document.createElement("li");r.append(a),t.insertAdjacentElement("afterend",r)}),i.childNodes.length===0&&i.remove()})}function Kn(e){e.querySelectorAll("li + ul, li + ol").forEach(t=>{var a,r;const o=t.previousElementSibling,i=document.createElement("div");o.insertAdjacentElement("afterend",i),i.append(o);const n=document.createElement("div");for(n.setAttribute("data-node-type","blockGroup"),i.append(n);((a=i.nextElementSibling)==null?void 0:a.nodeName)==="UL"||((r=i.nextElementSibling)==null?void 0:r.nodeName)==="OL";)n.append(i.nextElementSibling)})}let Co=null;function qn(){return Co||(Co=document.implementation.createHTMLDocument("title"))}function Eo(e){if(typeof e=="string"){const t=qn().createElement("div");t.innerHTML=e,e=t}return Wn(e),Kn(e),e}async function Ye(e,t,o,i,n){const a=Eo(e),s=v.DOMParser.fromSchema(n).parse(a,{topNode:n.nodes.blockGroup.create()}),l=[];for(let c=0;cthis.off(t,o)}emit(t,...o){const i=this.callbacks[t];i&&i.forEach(n=>n.apply(this,o))}off(t,o){const i=this.callbacks[t];i&&(o?this.callbacks[t]=i.filter(n=>n!==o):delete this.callbacks[t])}removeAllListeners(){this.callbacks={}}}class So{constructor(t,o,i,n){p(this,"state");p(this,"emitUpdate");p(this,"mouseDownHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});p(this,"dragstartHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});p(this,"scrollHandler",()=>{var t;if((t=this.state)!=null&&t.show){const o=this.pmView.root.querySelector(`[data-node-type="blockContainer"][data-id="${this.state.block.id}"]`);if(!o)return;this.state.referencePos=o.getBoundingClientRect(),this.emitUpdate()}});p(this,"closeMenu",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});this.editor=t,this.pluginKey=o,this.pmView=i,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized file panel");n(this.state)},i.dom.addEventListener("mousedown",this.mouseDownHandler),i.dom.addEventListener("dragstart",this.dragstartHandler),i.root.addEventListener("scroll",this.scrollHandler,!0)}update(t,o){var n,a;const i=this.pluginKey.getState(t.state);if(!((n=this.state)!=null&&n.show)&&i.block&&this.editor.isEditable){const r=this.pmView.root.querySelector(`[data-node-type="blockContainer"][data-id="${i.block.id}"]`);if(!r)return;this.state={show:!0,referencePos:r.getBoundingClientRect(),block:i.block},this.emitUpdate();return}(!t.state.selection.eq(o.selection)||!t.state.doc.eq(o.doc)||!this.editor.isEditable)&&(a=this.state)!=null&&a.show&&(this.state.show=!1,this.emitUpdate())}destroy(){this.pmView.dom.removeEventListener("mousedown",this.mouseDownHandler),this.pmView.dom.removeEventListener("dragstart",this.dragstartHandler),this.pmView.root.removeEventListener("scroll",this.scrollHandler,!0)}}const Qe=new _.PluginKey("FilePanelPlugin");class Bo extends Q{constructor(o){super();p(this,"view");p(this,"plugin");p(this,"closeMenu",()=>{var o;return(o=this.view)==null?void 0:o.closeMenu()});this.plugin=new _.Plugin({key:Qe,view:i=>(this.view=new So(o,Qe,i,n=>{this.emit("update",n)}),this.view),props:{handleKeyDown:(i,n)=>{var a;return n.key==="Escape"&&this.shown?((a=this.view)==null||a.closeMenu(),!0):!1}},state:{init:()=>({block:void 0}),apply:i=>{var a;return{block:(a=i.getMeta(Qe))==null?void 0:a.block}}}})}get shown(){var o,i;return((i=(o=this.view)==null?void 0:o.state)==null?void 0:i.show)||!1}onUpdate(o){return this.on("update",o)}}class To{constructor(t,o,i){p(this,"state");p(this,"emitUpdate");p(this,"preventHide",!1);p(this,"preventShow",!1);p(this,"shouldShow",({state:t,from:o,to:i,view:n})=>{const{doc:a,selection:r}=t,{empty:s}=r,l=!a.textBetween(o,i).length&&k.isTextSelection(t.selection);return r.$from.parent.type.spec.code||k.isNodeSelection(r)&&r.node.type.spec.code?!1:!(!n.hasFocus()||s||l)});p(this,"blurHandler",t=>{var i;if(this.preventHide){this.preventHide=!1;return}const o=this.pmView.dom.parentElement;t&&t.relatedTarget&&(o===t.relatedTarget||o.contains(t.relatedTarget)||t.relatedTarget.matches(".bn-ui-container, .bn-ui-container *"))||(i=this.state)!=null&&i.show&&(this.state.show=!1,this.emitUpdate())});p(this,"viewMousedownHandler",()=>{this.preventShow=!0});p(this,"viewMouseupHandler",()=>{this.preventShow=!1,setTimeout(()=>this.update(this.pmView))});p(this,"dragHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});p(this,"scrollHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.referencePos=this.getSelectionBoundingBox(),this.emitUpdate())});p(this,"closeMenu",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});this.editor=t,this.pmView=o,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized formatting toolbar");i(this.state)},o.dom.addEventListener("mousedown",this.viewMousedownHandler),o.dom.addEventListener("mouseup",this.viewMouseupHandler),o.dom.addEventListener("dragstart",this.dragHandler),o.dom.addEventListener("dragover",this.dragHandler),o.dom.addEventListener("blur",this.blurHandler),o.root.addEventListener("scroll",this.scrollHandler,!0)}update(t,o){var m,f;const{state:i,composing:n}=t,{doc:a,selection:r}=i,s=o&&o.doc.eq(a)&&o.selection.eq(r);if(n||s)return;const{ranges:l}=r,c=Math.min(...l.map(g=>g.$from.pos)),u=Math.max(...l.map(g=>g.$to.pos)),h=(m=this.shouldShow)==null?void 0:m.call(this,{view:t,state:i,from:c,to:u});if(!this.preventShow&&(h||this.preventHide)){this.state={show:!0,referencePos:this.getSelectionBoundingBox()},this.emitUpdate();return}if((f=this.state)!=null&&f.show&&!this.preventHide&&(!h||this.preventShow||!this.editor.isEditable)){this.state.show=!1,this.emitUpdate();return}}destroy(){this.pmView.dom.removeEventListener("mousedown",this.viewMousedownHandler),this.pmView.dom.removeEventListener("mouseup",this.viewMouseupHandler),this.pmView.dom.removeEventListener("dragstart",this.dragHandler),this.pmView.dom.removeEventListener("dragover",this.dragHandler),this.pmView.dom.removeEventListener("blur",this.blurHandler),this.pmView.root.removeEventListener("scroll",this.scrollHandler,!0)}getSelectionBoundingBox(){const{state:t}=this.pmView,{selection:o}=t,{ranges:i}=o,n=Math.min(...i.map(r=>r.$from.pos)),a=Math.max(...i.map(r=>r.$to.pos));if(k.isNodeSelection(o)){const r=this.pmView.nodeDOM(n);if(r)return r.getBoundingClientRect()}return k.posToDOMRect(this.pmView,n,a)}}const Mo=new _.PluginKey("FormattingToolbarPlugin");class Lo extends Q{constructor(o){super();p(this,"view");p(this,"plugin");p(this,"closeMenu",()=>this.view.closeMenu());this.plugin=new _.Plugin({key:Mo,view:i=>(this.view=new To(o,i,n=>{this.emit("update",n)}),this.view),props:{handleKeyDown:(i,n)=>n.key==="Escape"&&this.shown?(this.view.closeMenu(),!0):!1}})}get shown(){var o,i;return((i=(o=this.view)==null?void 0:o.state)==null?void 0:i.show)||!1}onUpdate(o){return this.on("update",o)}}class Xn{constructor(t,o,i){p(this,"state");p(this,"emitUpdate");p(this,"menuUpdateTimer");p(this,"startMenuUpdateTimer");p(this,"stopMenuUpdateTimer");p(this,"mouseHoveredLinkMark");p(this,"mouseHoveredLinkMarkRange");p(this,"keyboardHoveredLinkMark");p(this,"keyboardHoveredLinkMarkRange");p(this,"linkMark");p(this,"linkMarkRange");p(this,"mouseOverHandler",t=>{if(this.mouseHoveredLinkMark=void 0,this.mouseHoveredLinkMarkRange=void 0,this.stopMenuUpdateTimer(),t.target instanceof HTMLAnchorElement&&t.target.nodeName==="A"){const o=t.target,i=this.pmView.posAtDOM(o,0)+1,n=this.pmView.state.doc.resolve(i),a=n.marks();for(const r of a)if(r.type.name===this.pmView.state.schema.mark("link").type.name){this.mouseHoveredLinkMark=r,this.mouseHoveredLinkMarkRange=k.getMarkRange(n,r.type,r.attrs)||void 0;break}}return this.startMenuUpdateTimer(),!1});p(this,"clickHandler",t=>{var i;const o=this.pmView.dom.parentElement;this.linkMark&&t&&t.target&&!(o===t.target||o.contains(t.target))&&(i=this.state)!=null&&i.show&&(this.state.show=!1,this.emitUpdate())});p(this,"scrollHandler",()=>{var t;this.linkMark!==void 0&&(t=this.state)!=null&&t.show&&(this.state.referencePos=k.posToDOMRect(this.pmView,this.linkMarkRange.from,this.linkMarkRange.to),this.emitUpdate())});p(this,"closeMenu",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});this.editor=t,this.pmView=o,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized link toolbar");i(this.state)},this.startMenuUpdateTimer=()=>{this.menuUpdateTimer=setTimeout(()=>{this.update()},250)},this.stopMenuUpdateTimer=()=>(this.menuUpdateTimer&&(clearTimeout(this.menuUpdateTimer),this.menuUpdateTimer=void 0),!1),this.pmView.dom.addEventListener("mouseover",this.mouseOverHandler),this.pmView.root.addEventListener("click",this.clickHandler,!0),this.pmView.root.addEventListener("scroll",this.scrollHandler,!0)}editLink(t,o){var n;const i=this.pmView.state.tr.insertText(o,this.linkMarkRange.from,this.linkMarkRange.to);i.addMark(this.linkMarkRange.from,this.linkMarkRange.from+o.length,this.pmView.state.schema.mark("link",{href:t})),this.editor.dispatch(i),this.pmView.focus(),(n=this.state)!=null&&n.show&&(this.state.show=!1,this.emitUpdate())}deleteLink(){var t;this.editor.dispatch(this.pmView.state.tr.removeMark(this.linkMarkRange.from,this.linkMarkRange.to,this.linkMark.type).setMeta("preventAutolink",!0)),this.pmView.focus(),(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())}update(){var o;if(!this.pmView.hasFocus())return;const t=this.linkMark;if(this.linkMark=void 0,this.linkMarkRange=void 0,this.keyboardHoveredLinkMark=void 0,this.keyboardHoveredLinkMarkRange=void 0,this.pmView.state.selection.empty){const i=this.pmView.state.selection.$from.marks();for(const n of i)if(n.type.name===this.pmView.state.schema.mark("link").type.name){this.keyboardHoveredLinkMark=n,this.keyboardHoveredLinkMarkRange=k.getMarkRange(this.pmView.state.selection.$from,n.type,n.attrs)||void 0;break}}if(this.mouseHoveredLinkMark&&(this.linkMark=this.mouseHoveredLinkMark,this.linkMarkRange=this.mouseHoveredLinkMarkRange),this.keyboardHoveredLinkMark&&(this.linkMark=this.keyboardHoveredLinkMark,this.linkMarkRange=this.keyboardHoveredLinkMarkRange),this.linkMark&&this.editor.isEditable){this.state={show:!0,referencePos:k.posToDOMRect(this.pmView,this.linkMarkRange.from,this.linkMarkRange.to),url:this.linkMark.attrs.href,text:this.pmView.state.doc.textBetween(this.linkMarkRange.from,this.linkMarkRange.to)},this.emitUpdate();return}if((o=this.state)!=null&&o.show&&t&&(!this.linkMark||!this.editor.isEditable)){this.state.show=!1,this.emitUpdate();return}}destroy(){this.pmView.dom.removeEventListener("mouseover",this.mouseOverHandler),this.pmView.root.removeEventListener("scroll",this.scrollHandler,!0),this.pmView.root.removeEventListener("click",this.clickHandler,!0)}}const Io=new _.PluginKey("LinkToolbarPlugin");class Po extends Q{constructor(o){super();p(this,"view");p(this,"plugin");p(this,"editLink",(o,i)=>{this.view.editLink(o,i)});p(this,"deleteLink",()=>{this.view.deleteLink()});p(this,"startHideTimer",()=>{this.view.startMenuUpdateTimer()});p(this,"stopHideTimer",()=>{this.view.stopMenuUpdateTimer()});p(this,"closeMenu",()=>this.view.closeMenu());this.plugin=new _.Plugin({key:Io,view:i=>(this.view=new Xn(o,i,n=>{this.emit("update",n)}),this.view),props:{handleKeyDown:(i,n)=>n.key==="Escape"&&this.shown?(this.view.closeMenu(),!0):!1}})}onUpdate(o){return this.on("update",o)}get shown(){var o,i;return((i=(o=this.view)==null?void 0:o.state)==null?void 0:i.show)||!1}}function Ao(e,t){var o,i;for(;e&&e.parentElement&&e.parentElement!==t.dom&&((o=e.getAttribute)==null?void 0:o.call(e,"data-node-type"))!=="blockContainer";)e=e.parentElement;if(((i=e.getAttribute)==null?void 0:i.call(e,"data-node-type"))==="blockContainer")return{node:e,id:e.getAttribute("data-id")}}function No(e,t){const o=[];return e.descendants(i=>{var n,a;return i.type.name==="blockContainer"&&((n=i.firstChild)==null?void 0:n.type.name)==="blockGroup"?!0:i.type.name==="columnList"&&i.childCount===1?((a=i.firstChild)==null||a.forEach(r=>{o.push(S(r,t.blockSchema,t.inlineContentSchema,t.styleSchema))}),!1):i.type.isInGroup("bnBlock")?(o.push(S(i,t.blockSchema,t.inlineContentSchema,t.styleSchema)),!1):!0}),o}class ee extends _.Selection{constructor(o,i){super(o,i);p(this,"nodes");const n=o.node();this.nodes=[],o.doc.nodesBetween(o.pos,i.pos,(a,r,s)=>{if(s!==null&&s.eq(n))return this.nodes.push(a),!1})}static create(o,i,n=i){return new ee(o.resolve(i),o.resolve(n))}content(){return new v.Slice(v.Fragment.from(this.nodes),0,0)}eq(o){if(!(o instanceof ee)||this.nodes.length!==o.nodes.length||this.from!==o.from||this.to!==o.to)return!1;for(let i=0;iArray.prototype.indexOf.call(u.children,h),r=a(n,e.domAtPos(t+1).node.parentElement),s=a(n,e.domAtPos(o-1).node.parentElement);for(let u=n.childElementCount-1;u>=0;u--)(u>s||uu!=="ProseMirror"&&u!=="bn-root"&&u!=="bn-editor").join(" ");U.className=U.className+" bn-drag-preview "+c,e.root instanceof ShadowRoot?e.root.appendChild(U):e.root.body.appendChild(U)}function Do(e){U!==void 0&&(e instanceof ShadowRoot?e.removeChild(U):e.body.removeChild(U),U=void 0)}function Jn(e,t,o){if(!e.dataTransfer)return;const i=o.prosemirrorView,n=q(t.id,i.state.doc).posBeforeNode;if(n!=null){const a=i.state.selection,r=i.state.doc,{from:s,to:l}=Zn(a,r),c=s<=n&&no.right;n&&(i.left=o.left+10),a&&(i.left=o.right-10);let r=et(t,i);if(!a&&r){const s=r.node.getBoundingClientRect();i.left=s.right-10,r=et(t,i,!1)}return r}class Ho{constructor(t,o,i){p(this,"state");p(this,"emitUpdate");p(this,"mousePos");p(this,"hoveredBlock");p(this,"menuFrozen",!1);p(this,"updateState",t=>{this.state=t,this.emitUpdate(this.state)});p(this,"updateStateFromMousePos",()=>{var i,n,a,r;if(this.menuFrozen||!this.mousePos)return;const t=Yn(this.mousePos,this.pmView);if(!t||!this.editor.isEditable){(i=this.state)!=null&&i.show&&(this.state.show=!1,this.updateState(this.state));return}if((n=this.state)!=null&&n.show&&((a=this.hoveredBlock)!=null&&a.hasAttribute("data-id"))&&((r=this.hoveredBlock)==null?void 0:r.getAttribute("data-id"))===t.id)return;this.hoveredBlock=t.node;const o=t.node.firstChild;if(o&&this.editor.isEditable){const s=o.getBoundingClientRect(),l=t.node.closest("[data-node-type=column]");this.updateState({show:!0,referencePos:new DOMRect(l?l.firstElementChild.getBoundingClientRect().x:this.pmView.dom.firstChild.getBoundingClientRect().x,s.y,s.width,s.height),block:this.editor.getBlock(this.hoveredBlock.getAttribute("data-id"))})}});p(this,"onDrop",t=>{var i;if(this.editor._tiptapEditor.commands.blur(),t.synthetic||!((i=t.dataTransfer)!=null&&i.types.includes("blocknote/html")))return;const o=this.pmView.posAtCoords({left:t.clientX,top:t.clientY});if(!o||o.inside===-1){const n=this.createSyntheticEvent(t);this.pmView.dom.dispatchEvent(n)}});p(this,"onDragOver",t=>{var i;if(t.synthetic||!((i=t.dataTransfer)!=null&&i.types.includes("blocknote/html")))return;const o=this.pmView.posAtCoords({left:t.clientX,top:t.clientY});if(!o||o.inside===-1&&this.pmView.dom.firstChild){const n=this.createSyntheticEvent(t);this.pmView.dom.dispatchEvent(n)}});p(this,"onKeyDown",t=>{var o;(o=this.state)!=null&&o.show&&this.editor.isFocused()&&(this.state.show=!1,this.emitUpdate(this.state))});p(this,"onMouseMove",t=>{var a;if(this.menuFrozen)return;this.mousePos={x:t.clientX,y:t.clientY};const o=this.pmView.dom.getBoundingClientRect(),i=this.mousePos.x>o.left&&this.mousePos.xo.top&&this.mousePos.y{if(!this.state)throw new Error("Attempting to update uninitialized side menu");i(this.state)},this.pmView.root.addEventListener("drop",this.onDrop,!0),this.pmView.root.addEventListener("dragover",this.onDragOver),we(),this.pmView.root.addEventListener("mousemove",this.onMouseMove,!0),this.pmView.root.addEventListener("keydown",this.onKeyDown,!0)}createSyntheticEvent(t){const o=new Event(t.type,t),i=this.pmView.dom.firstChild.getBoundingClientRect();return o.clientX=t.clientX,o.clientY=t.clientY,t.clientXi.left-i.width*me?o.clientX=i.left+i.width*me/2:t.clientX>i.right&&t.clientXi.right)&&(o.clientX=i.left+me*i.width*2),o.clientY=Math.min(Math.max(t.clientY,i.top),i.top+i.height),o.dataTransfer=t.dataTransfer,o.preventDefault=()=>t.preventDefault(),o.synthetic=!0,o}update(t,o){var n;!o.doc.eq(this.pmView.state.doc)&&((n=this.state)!=null&&n.show)&&this.updateStateFromMousePos()}destroy(){var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate(this.state)),this.pmView.root.removeEventListener("mousemove",this.onMouseMove,!0),this.pmView.root.removeEventListener("dragover",this.onDragOver),this.pmView.root.removeEventListener("drop",this.onDrop,!0),this.pmView.root.removeEventListener("keydown",this.onKeyDown,!0)}}const Uo=new _.PluginKey("SideMenuPlugin");class Oo extends Q{constructor(o){super();p(this,"view");p(this,"plugin");p(this,"blockDragStart",(o,i)=>{Jn(o,i,this.editor)});p(this,"blockDragEnd",()=>Do(this.editor.prosemirrorView.root));p(this,"freezeMenu",()=>this.view.menuFrozen=!0);p(this,"unfreezeMenu",()=>{this.view.menuFrozen=!1,this.view.state.show=!1,this.view.emitUpdate(this.view.state)});this.editor=o,this.plugin=new _.Plugin({key:Uo,view:i=>(this.view=new Ho(o,i,n=>{this.emit("update",n)}),this.view)})}onUpdate(o){return this.on("update",o)}}const Qn=k.findParentNode(e=>e.type.name==="blockContainer");class ea{constructor(t,o){p(this,"state");p(this,"emitUpdate");p(this,"rootEl");p(this,"pluginState");p(this,"handleScroll",()=>{var t,o;if((t=this.state)!=null&&t.show){const i=(o=this.rootEl)==null?void 0:o.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);if(!i)return;this.state.referencePos=i.getBoundingClientRect(),this.emitUpdate(this.pluginState.triggerCharacter)}});p(this,"closeMenu",()=>{this.editor.dispatch(this.editor._tiptapEditor.view.state.tr.setMeta(te,null))});p(this,"clearQuery",()=>{this.pluginState!==void 0&&this.editor._tiptapEditor.chain().focus().deleteRange({from:this.pluginState.queryStartPos-(this.pluginState.deleteTriggerCharacter?this.pluginState.triggerCharacter.length:0),to:this.editor._tiptapEditor.state.selection.from}).run()});this.editor=t,this.pluginState=void 0,this.emitUpdate=i=>{var n;if(!this.state)throw new Error("Attempting to update uninitialized suggestions menu");o(i,{...this.state,ignoreQueryLength:(n=this.pluginState)==null?void 0:n.ignoreQueryLength})},this.rootEl=this.editor._tiptapEditor.view.root,this.rootEl.addEventListener("scroll",this.handleScroll,!0)}update(t,o){var c;const i=te.getState(o),n=te.getState(t.state),a=i===void 0&&n!==void 0,r=i!==void 0&&n===void 0;if(!a&&!(i!==void 0&&n!==void 0)&&!r)return;if(this.pluginState=r?i:n,r||!this.editor.isEditable){this.state.show=!1,this.emitUpdate(this.pluginState.triggerCharacter);return}const l=(c=this.rootEl)==null?void 0:c.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);this.editor.isEditable&&l&&(this.state={show:!0,referencePos:l.getBoundingClientRect(),query:this.pluginState.query},this.emitUpdate(this.pluginState.triggerCharacter))}destroy(){var t;(t=this.rootEl)==null||t.removeEventListener("scroll",this.handleScroll,!0)}}const te=new _.PluginKey("SuggestionMenuPlugin");class Ro extends Q{constructor(o){super();p(this,"view");p(this,"plugin");p(this,"triggerCharacters",[]);p(this,"addTriggerCharacter",o=>{this.triggerCharacters.push(o)});p(this,"removeTriggerCharacter",o=>{this.triggerCharacters=this.triggerCharacters.filter(i=>i!==o)});p(this,"closeMenu",()=>this.view.closeMenu());p(this,"clearQuery",()=>this.view.clearQuery());const i=this.triggerCharacters;this.plugin=new _.Plugin({key:te,view:()=>(this.view=new ea(o,(n,a)=>{this.emit(`update ${n}`,a)}),this.view),state:{init(){},apply(n,a,r,s){if(n.getMeta("orderedListIndexing")!==void 0||n.selection.$from.parent.type.spec.code)return a;const l=n.getMeta(te);if(typeof l=="object"&&l!==null&&a===void 0)return{triggerCharacter:l.triggerCharacter,deleteTriggerCharacter:l.deleteTriggerCharacter!==!1,queryStartPos:s.selection.from,query:"",decorationId:`id_${Math.floor(Math.random()*4294967295)}`,ignoreQueryLength:l==null?void 0:l.ignoreQueryLength};if(a===void 0)return a;if(s.selection.from!==s.selection.to||l===null||n.getMeta("focus")||n.getMeta("blur")||n.getMeta("pointer")||a.triggerCharacter!==void 0&&s.selection.from{this.mouseState="down"});p(this,"mouseUpHandler",t=>{this.mouseState="up",this.mouseMoveHandler(t)});p(this,"mouseMoveHandler",t=>{var c,u,h,m;if(this.menuFrozen||this.mouseState==="selecting"||!(t.target instanceof Element)||!this.pmView.dom.contains(t.target))return;const o=ia(t.target);if((o==null?void 0:o.type)==="cell"&&this.mouseState==="down"&&!((c=this.state)!=null&&c.draggingState)){this.mouseState="selecting",(u=this.state)!=null&&u.show&&(this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate());return}if(!o||!this.editor.isEditable){(h=this.state)!=null&&h.show&&(this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate());return}if(!o.tbodyNode)return;const i=o.tbodyNode.getBoundingClientRect(),n=Ao(o.domNode,this.pmView);if(!n)return;this.tableElement=n.node;let a;const r=q(n.id,this.editor._tiptapEditor.state.doc),s=S(r.node,this.editor.schema.blockSchema,this.editor.schema.inlineContentSchema,this.editor.schema.styleSchema,this.editor.blockCache);if(go("table",s,this.editor)&&(this.tablePos=r.posBeforeNode+1,a=s),!a)return;this.tableId=n.id;const l=(m=o.domNode.closest(".tableWrapper"))==null?void 0:m.querySelector(".table-widgets-container");if((o==null?void 0:o.type)==="wrapper"){const f=t.clientY>=i.bottom-1&&t.clientY=i.right-1&&t.clientXi.right||t.clientY>i.bottom;this.state={...this.state,show:!0,showAddOrRemoveRowsButton:f,showAddOrRemoveColumnsButton:g,referencePosTable:i,block:a,widgetContainer:l,colIndex:b?void 0:this.state.colIndex,rowIndex:b?void 0:this.state.rowIndex,referencePosCell:b?void 0:this.state.referencePosCell}}else{const f=Ee(o.domNode),g=Ee(o.domNode.parentElement),b=o.domNode.getBoundingClientRect();if(this.state!==void 0&&this.state.show&&this.tableId===n.id&&this.state.rowIndex===g&&this.state.colIndex===f)return;this.state={show:!0,showAddOrRemoveColumnsButton:f===a.content.rows[0].cells.length-1,showAddOrRemoveRowsButton:g===a.content.rows.length-1,referencePosTable:i,block:a,draggingState:void 0,referencePosCell:b,colIndex:f,rowIndex:g,widgetContainer:l}}return this.emitUpdate(),!1});p(this,"dragOverHandler",t=>{var m;if(((m=this.state)==null?void 0:m.draggingState)===void 0)return;t.preventDefault(),t.dataTransfer.dropEffect="move",na(".prosemirror-dropcursor-block, .prosemirror-dropcursor-inline",this.pmView.root);const o={left:Math.min(Math.max(t.clientX,this.state.referencePosTable.left+1),this.state.referencePosTable.right-1),top:Math.min(Math.max(t.clientY,this.state.referencePosTable.top+1),this.state.referencePosTable.bottom-1)},i=this.pmView.root.elementsFromPoint(o.left,o.top).filter(f=>f.tagName==="TD"||f.tagName==="TH");if(i.length===0)throw new Error("Could not find table cell element that the mouse cursor is hovering over.");const n=i[0];let a=!1;const r=Ee(n.parentElement),s=Ee(n),l=this.state.draggingState.draggedCellOrientation==="row"?this.state.rowIndex:this.state.colIndex,u=(this.state.draggingState.draggedCellOrientation==="row"?r:s)!==l;(this.state.rowIndex!==r||this.state.colIndex!==s)&&(this.state.rowIndex=r,this.state.colIndex=s,this.state.referencePosCell=n.getBoundingClientRect(),a=!0);const h=this.state.draggingState.draggedCellOrientation==="row"?o.top:o.left;this.state.draggingState.mousePos!==h&&(this.state.draggingState.mousePos=h,a=!0),a&&this.emitUpdate(),u&&this.editor.dispatch(this.pmView.state.tr.setMeta(oe,!0))});p(this,"dropHandler",t=>{if(this.mouseState="up",this.state===void 0||this.state.draggingState===void 0)return;if(this.state.rowIndex===void 0||this.state.colIndex===void 0)throw new Error("Attempted to drop table row or column, but no table block was hovered prior.");t.preventDefault();const{draggingState:o,colIndex:i,rowIndex:n}=this.state,a=this.state.block.content.rows;if(o.draggedCellOrientation==="row"){const r=a[o.originalIndex];a.splice(o.originalIndex,1),a.splice(n,0,r)}else{const r=a.map(s=>s.cells[o.originalIndex]);a.forEach((s,l)=>{s.cells.splice(o.originalIndex,1),s.cells.splice(i,0,r[l])})}this.editor.updateBlock(this.state.block,{type:"table",content:{type:"tableContent",rows:a}}),this.editor.setTextCursorPosition(this.state.block.id)});this.editor=t,this.pmView=o,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized image toolbar");i(this.state)},o.dom.addEventListener("mousemove",this.mouseMoveHandler),o.dom.addEventListener("mousedown",this.viewMousedownHandler),window.addEventListener("mouseup",this.mouseUpHandler),o.root.addEventListener("dragover",this.dragOverHandler),o.root.addEventListener("drop",this.dropHandler)}update(){if(!this.state||!this.state.show)return;const t=this.tableElement.querySelector("tbody");if(t){if(this.state.rowIndex!==void 0&&this.state.colIndex!==void 0){this.state.rowIndex>=t.children.length&&(this.state.rowIndex=t.children.length-1),this.state.colIndex>=t.children[0].children.length&&(this.state.colIndex=t.children[0].children.length-1);const i=t.children[this.state.rowIndex].children[this.state.colIndex];this.state.referencePosCell=i.getBoundingClientRect()}this.state.block=this.editor.getBlock(this.state.block.id),this.state.referencePosTable=t.getBoundingClientRect(),this.emitUpdate()}}destroy(){this.pmView.dom.removeEventListener("mousemove",this.mouseMoveHandler),window.removeEventListener("mouseup",this.mouseUpHandler),this.pmView.dom.removeEventListener("mousedown",this.viewMousedownHandler),this.pmView.root.removeEventListener("dragover",this.dragOverHandler),this.pmView.root.removeEventListener("drop",this.dropHandler)}}const oe=new _.PluginKey("TableHandlesPlugin");class Fo extends Q{constructor(o){super();p(this,"view");p(this,"plugin");p(this,"colDragStart",o=>{if(this.view.state===void 0||this.view.state.colIndex===void 0)throw new Error("Attempted to drag table column, but no table block was hovered prior.");this.view.state.draggingState={draggedCellOrientation:"col",originalIndex:this.view.state.colIndex,mousePos:o.clientX},this.view.emitUpdate(),this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(oe,{draggedCellOrientation:this.view.state.draggingState.draggedCellOrientation,originalIndex:this.view.state.colIndex,newIndex:this.view.state.colIndex,tablePos:this.view.tablePos})),zo(this.editor._tiptapEditor.view.root),o.dataTransfer.setDragImage(P,0,0),o.dataTransfer.effectAllowed="move"});p(this,"rowDragStart",o=>{if(this.view.state===void 0||this.view.state.rowIndex===void 0)throw new Error("Attempted to drag table row, but no table block was hovered prior.");this.view.state.draggingState={draggedCellOrientation:"row",originalIndex:this.view.state.rowIndex,mousePos:o.clientY},this.view.emitUpdate(),this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(oe,{draggedCellOrientation:this.view.state.draggingState.draggedCellOrientation,originalIndex:this.view.state.rowIndex,newIndex:this.view.state.rowIndex,tablePos:this.view.tablePos})),zo(this.editor._tiptapEditor.view.root),o.dataTransfer.setDragImage(P,0,0),o.dataTransfer.effectAllowed="copyMove"});p(this,"dragEnd",()=>{if(this.view.state===void 0)throw new Error("Attempted to drag table row, but no table block was hovered prior.");this.view.state.draggingState=void 0,this.view.emitUpdate(),this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(oe,null)),oa(this.editor._tiptapEditor.view.root)});p(this,"freezeHandles",()=>{this.view.menuFrozen=!0});p(this,"unfreezeHandles",()=>{this.view.menuFrozen=!1});this.editor=o,this.plugin=new _.Plugin({key:oe,view:i=>(this.view=new Vo(o,i,n=>{this.emit("update",n)}),this.view),props:{decorations:i=>{if(this.view===void 0||this.view.state===void 0||this.view.state.draggingState===void 0||this.view.tablePos===void 0)return;const n=this.view.state.draggingState.draggedCellOrientation==="row"?this.view.state.rowIndex:this.view.state.colIndex;if(n===void 0)return;const a=[];if(n===this.view.state.draggingState.originalIndex)return x.DecorationSet.create(i.doc,a);const r=i.doc.resolve(this.view.tablePos+1),s=r.node();if(this.view.state.draggingState.draggedCellOrientation==="row"){const l=i.doc.resolve(r.posAtIndex(n)+1),c=l.node();for(let u=0;uthis.view.state.draggingState.originalIndex?m.nodeSize-2:0);a.push(x.Decoration.widget(f,()=>{const g=document.createElement("div");return g.className="bn-table-drop-cursor",g.style.left="0",g.style.right="0",n>this.view.state.draggingState.originalIndex?g.style.bottom="-2px":g.style.top="-3px",g.style.height="4px",g}))}}else for(let l=0;lthis.view.state.draggingState.originalIndex?h.nodeSize-2:0);a.push(x.Decoration.widget(m,()=>{const f=document.createElement("div");return f.className="bn-table-drop-cursor",f.style.top="0",f.style.bottom="0",n>this.view.state.draggingState.originalIndex?f.style.right="-2px":f.style.left="-3px",f.style.width="4px",f}))}return x.DecorationSet.create(i.doc,a)}}})}onUpdate(o){return this.on("update",o)}}const tt=["vscode-editor-data","blocknote/html","Files","text/html","text/plain"];function aa(e,t){if(!e.startsWith(".")||!t.startsWith("."))throw new Error("The strings provided are not valid file extensions.");return e===t}function ra(e,t){const o=e.split("/"),i=t.split("/");if(o.length!==2)throw new Error(`The string ${e} is not a valid MIME type.`);if(i.length!==2)throw new Error(`The string ${t} is not a valid MIME type.`);return o[1]==="*"||i[1]==="*"?o[0]===i[0]:(o[0]==="*"||i[0]==="*"||o[0]===i[0])&&o[1]===i[1]}async function Go(e,t){if(!t.uploadFile)return;const o="dataTransfer"in e?e.dataTransfer:e.clipboardData;if(o===null)return;let i=null;for(const r of tt)if(o.types.includes(r)){i=r;break}if(i!=="Files")return;const n=o.items;if(!n)return;e.preventDefault();const a=Object.values(t.schema.blockSchema).filter(r=>r.isFileBlock);for(let r=0;rk.Extension.create({name:"dropFile",addProseMirrorPlugins(){return[new _.Plugin({props:{handleDOMEvents:{drop(t,o){if(!e.isEditable)return;let i=null;for(const n of tt)if(o.dataTransfer.types.includes(n)){i=n;break}return i===null?!0:i==="Files"?(Go(o,e),!0):!1}}}})]}});async function la(e,t){const o=t.prosemirrorView,{schema:i}=o.state;if(!e.clipboardData)return!1;const n=e.clipboardData.getData("text/plain"),a=e.clipboardData.getData("vscode-editor-data"),r=a?JSON.parse(a):void 0,s=r==null?void 0:r.mode;return n?i.nodes.codeBlock?s?(t._tiptapEditor.view.pasteHTML(`
${n.replace(/\r\n?/g,`
`)}
`),!0):!1:(o.pasteText(n),!0):!1}const da=e=>k.Extension.create({name:"pasteFromClipboard",addProseMirrorPlugins(){return[new _.Plugin({props:{handleDOMEvents:{paste(t,o){if(o.preventDefault(),!e.isEditable)return;let i;for(const a of tt)if(o.clipboardData.types.includes(a)){i=a;break}if(!i)return!0;if(i==="vscode-editor-data")return la(o,e),!0;if(i==="Files")return Go(o,e),!0;let n=o.clipboardData.getData(i);return i==="blocknote/html"?(e._tiptapEditor.view.pasteHTML(n),!0):i==="text/html"?(n=Eo(n.trim()).innerHTML,e._tiptapEditor.view.pasteHTML(n),!0):(e._tiptapEditor.view.pasteText(n),!0)}}}})]}});function ca(e,t,o){var s;let i=!1;const n=e.state.selection instanceof $.CellSelection;if(!n){const l=e.state.doc.slice(e.state.selection.from,e.state.selection.to,!1).content,c=[];for(let u=0;uu.type.isInGroup("bnBlock")||u.type.name==="blockGroup"||u.type.spec.group==="blockContent")===void 0,i&&(t=l)}let a;const r=ae(e.state.schema,o);if(n){((s=t.firstChild)==null?void 0:s.type.name)==="table"&&(t=t.firstChild.content);const l=Ue(t,o.schema.inlineContentSchema,o.schema.styleSchema);a=r.exportInlineContent(l,{})}else if(i){const l=ce(t,o.schema.inlineContentSchema,o.schema.styleSchema);a=r.exportInlineContent(l,{})}else{const l=No(t,o.schema);a=r.exportBlocks(l,{})}return a}function Wo(e,t){"node"in e.state.selection&&e.state.selection.node.type.spec.group==="blockContent"&&t.dispatch(t._tiptapEditor.state.tr.setSelection(new _.NodeSelection(e.state.doc.resolve(e.state.selection.from-1))));const o=dt.__serializeForClipboard(e,e.state.selection.content()).dom.innerHTML,i=e.state.selection.content().content,n=ca(e,i,t),a=Ce(n);return{clipboardHTML:o,externalHTML:n,markdown:a}}const Ko=(e,t,o)=>{o.preventDefault(),o.clipboardData.clearData();const{clipboardHTML:i,externalHTML:n,markdown:a}=Wo(t,e);o.clipboardData.setData("blocknote/html",i),o.clipboardData.setData("text/html",n),o.clipboardData.setData("text/plain",a)},ua=e=>k.Extension.create({name:"copyToClipboard",addProseMirrorPlugins(){return[new _.Plugin({props:{handleDOMEvents:{copy(t,o){return Ko(e,t,o),!0},cut(t,o){return Ko(e,t,o),t.dispatch(t.state.tr.deleteSelection()),!0},dragstart(t,o){if(!("node"in t.state.selection)||t.state.selection.node.type.spec.group!=="blockContent")return;e.dispatch(e._tiptapEditor.state.tr.setSelection(new _.NodeSelection(t.state.doc.resolve(t.state.selection.from-1)))),o.preventDefault(),o.dataTransfer.clearData();const{clipboardHTML:i,externalHTML:n,markdown:a}=Wo(t,e);return o.dataTransfer.setData("blocknote/html",i),o.dataTransfer.setData("text/html",n),o.dataTransfer.setData("text/plain",a),!0}}}})]}}),pa=k.Extension.create({name:"blockBackgroundColor",addGlobalAttributes(){return[{types:["blockContainer"],attributes:{backgroundColor:{default:E.backgroundColor.default,parseHTML:e=>e.hasAttribute("data-background-color")?e.getAttribute("data-background-color"):E.backgroundColor.default,renderHTML:e=>e.backgroundColor===E.backgroundColor.default?{}:{"data-background-color":e.backgroundColor}}}}]}}),qo=(e,t)=>{const o=e.resolve(t);if(o.depth<=1)return;const i=o.posAtIndex(o.index(o.depth-1),o.depth-1);return J(e.resolve(i))},ot=(e,t)=>{const o=e.resolve(t),i=o.index();if(i===0)return;const n=o.posAtIndex(i-1);return J(e.resolve(n))},$o=(e,t)=>{for(;t.childContainer;){const o=t.childContainer.node,i=e.resolve(t.childContainer.beforePos+1).posAtIndex(o.childCount-1);t=J(e.resolve(i))}return t},ha=(e,t)=>e.isBlockContainer&&e.blockContent.node.type.spec.content==="inline*"&&e.blockContent.node.childCount>0&&t.isBlockContainer&&t.blockContent.node.type.spec.content==="inline*",ma=(e,t,o,i)=>{if(!i.isBlockContainer)throw new Error(`Attempted to merge block at position ${i.bnBlock.beforePos} into previous block at position ${o.bnBlock.beforePos}, but next block is not a block container`);if(i.childContainer){const n=e.doc.resolve(i.childContainer.beforePos+1),a=e.doc.resolve(i.childContainer.afterPos-1),r=n.blockRange(a);if(t){const s=e.doc.resolve(i.bnBlock.beforePos);e.tr.lift(r,s.depth)}}if(t){if(!o.isBlockContainer)throw new Error(`Attempted to merge block at position ${i.bnBlock.beforePos} into previous block at position ${o.bnBlock.beforePos}, but previous block is not a block container`);t(e.tr.delete(o.blockContent.afterPos-1,i.blockContent.beforePos+1))}return!0},Xo=e=>({state:t,dispatch:o})=>{const i=t.doc.resolve(e),n=J(i),a=ot(t.doc,n.bnBlock.beforePos);if(!a)return!1;const r=$o(t.doc,a);return ha(r,n)?ma(t,o,r,n):!1},fa=k.Extension.create({priority:50,addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.first(({chain:i,commands:n})=>[()=>n.deleteSelection(),()=>n.undoInputRule(),()=>n.command(({state:a})=>{const r=w(a),s=a.selection.from===r.blockContent.beforePos+1,l=r.blockContent.node.type.name==="paragraph";return s&&!l?n.command(T(this.options.editor,r.bnBlock.beforePos,{type:"paragraph",props:{}})):!1}),()=>n.command(({state:a})=>{const{blockContent:r}=w(a);return a.selection.from===r.beforePos+1?n.liftListItem("blockContainer"):!1}),()=>n.command(({state:a})=>{const{bnBlock:r,blockContent:s}=w(a),l=a.selection.from===s.beforePos+1,c=a.selection.empty,u=r.beforePos;return l&&c?i().command(Xo(u)).scrollIntoView().run():!1}),()=>n.command(({state:a,dispatch:r})=>{const s=w(a);if(!(a.selection.from===s.blockContent.beforePos+1)||ot(a.doc,s.bnBlock.beforePos))return!1;const u=qo(a.doc,s.bnBlock.beforePos);if((u==null?void 0:u.blockNoteType)!=="column")return!1;const h=u,m=qo(a.doc,h.bnBlock.beforePos);if((m==null?void 0:m.blockNoteType)!=="columnList")throw new Error("parent of column is not a column list");const f=h.childContainer.node.childCount===1,g=f&&m.childContainer.node.childCount===2,b=m.childContainer.node.firstChild===h.bnBlock.node;if(r){const y=a.doc.slice(s.bnBlock.beforePos,s.bnBlock.afterPos,!1);if(g)if(b){a.tr.step(new be.ReplaceAroundStep(m.bnBlock.beforePos,m.bnBlock.afterPos,h.bnBlock.afterPos+1,m.bnBlock.afterPos-2,y,y.size,!1));const C=a.tr.doc.resolve(h.bnBlock.beforePos);a.tr.setSelection(_.TextSelection.between(C,C))}else{a.tr.step(new be.ReplaceAroundStep(m.bnBlock.beforePos,m.bnBlock.afterPos,m.bnBlock.beforePos+2,h.bnBlock.beforePos-1,y,0,!1));const C=a.tr.doc.resolve(a.tr.mapping.map(h.bnBlock.beforePos-1));a.tr.setSelection(_.TextSelection.between(C,C))}else if(f)if(b){a.tr.delete(h.bnBlock.beforePos,h.bnBlock.afterPos),a.tr.insert(m.bnBlock.beforePos,y.content);const C=a.tr.doc.resolve(m.bnBlock.beforePos);a.tr.setSelection(_.TextSelection.between(C,C))}else a.tr.delete(h.bnBlock.beforePos-1,h.bnBlock.beforePos+1);else{a.tr.delete(s.bnBlock.beforePos,s.bnBlock.afterPos),b?a.tr.insert(m.bnBlock.beforePos-1,y.content):a.tr.insert(h.bnBlock.beforePos-1,y.content);const C=a.tr.doc.resolve(h.bnBlock.beforePos-1);a.tr.setSelection(_.TextSelection.between(C,C))}}return!0}),()=>n.command(({state:a})=>{const r=w(a);if(!r.isBlockContainer)throw new Error("todo");const s=a.selection.from===r.blockContent.beforePos+1,l=a.selection.empty,c=ot(a.doc,r.bnBlock.beforePos);if(c&&s&&l){const u=$o(a.doc,c);if(!u.isBlockContainer)throw new Error("todo");if(u.blockContent.node.type.spec.content===""||u.blockContent.node.type.spec.content==="inline*"&&u.blockContent.node.childCount===0)return i().cut({from:r.bnBlock.beforePos,to:r.bnBlock.afterPos},u.bnBlock.afterPos).deleteRange({from:u.bnBlock.beforePos,to:u.bnBlock.afterPos}).run()}return!1})]),Delete:()=>this.editor.commands.first(({commands:i})=>[()=>i.deleteSelection(),()=>i.command(({state:n})=>{const{bnBlock:a,blockContent:r,childContainer:s}=w(n),{depth:l}=n.doc.resolve(a.beforePos),c=a.afterPos===n.doc.nodeSize-3,u=n.selection.from===r.afterPos-1,h=n.selection.empty;if(!c&&u&&h&&!(s!==void 0)){let f=l,g=a.afterPos+1,b=n.doc.resolve(g).depth;for(;bthis.editor.commands.first(({commands:i})=>[()=>i.command(({state:n})=>{const{blockContent:a,bnBlock:r}=w(n),{depth:s}=n.doc.resolve(r.beforePos),l=n.selection.$anchor.parentOffset===0,c=n.selection.anchor===n.selection.head,u=a.node.childCount===0,h=s>1;return l&&c&&u&&h?i.liftListItem("blockContainer"):!1}),()=>i.command(({state:n,dispatch:a})=>{const{bnBlock:r,blockContent:s}=w(n),l=n.selection.$anchor.parentOffset===0,c=n.selection.anchor===n.selection.head,u=s.node.childCount===0;if(l&&c&&u){const h=r.afterPos,m=h+2;if(a){const f=n.schema.nodes.blockContainer.createAndFill();n.tr.insert(h,f).scrollIntoView(),n.tr.setSelection(new _.TextSelection(n.doc.resolve(m)))}return!0}return!1}),()=>i.command(({state:n,chain:a})=>{const{blockContent:r}=w(n),s=n.selection.$anchor.parentOffset===0;return r.node.childCount===0?!1:(a().deleteSelection().command(po(n.selection.from,s,s)).run(),!0)})]),Tab:()=>{var i,n,a;return(i=this.options.editor.formattingToolbar)!=null&&i.shown||(n=this.options.editor.linkToolbar)!=null&&n.shown||(a=this.options.editor.filePanel)!=null&&a.shown?!1:_o(this.options.editor)},"Shift-Tab":()=>{var i,n,a;return(i=this.options.editor.formattingToolbar)!=null&&i.shown||(n=this.options.editor.linkToolbar)!=null&&n.shown||(a=this.options.editor.filePanel)!=null&&a.shown?!1:(this.editor.commands.liftListItem("blockContainer"),!0)},"Shift-Mod-ArrowUp":()=>(this.options.editor.moveBlockUp(),!0),"Shift-Mod-ArrowDown":()=>(this.options.editor.moveBlockDown(),!0)}}}),ga=k.Extension.create({name:"textAlignment",addGlobalAttributes(){return[{types:["paragraph","heading","bulletListItem","numberedListItem","checkListItem"],attributes:{textAlignment:{default:"left",parseHTML:e=>e.getAttribute("data-text-alignment"),renderHTML:e=>e.textAlignment==="left"?{}:{"data-text-alignment":e.textAlignment}}}}]}}),ba=k.Extension.create({name:"blockTextColor",addGlobalAttributes(){return[{types:["blockContainer"],attributes:{textColor:{default:E.textColor.default,parseHTML:e=>e.hasAttribute("data-text-color")?e.getAttribute("data-text-color"):E.textColor.default,renderHTML:e=>e.textColor===E.textColor.default?{}:{"data-text-color":e.textColor}}}}]}}),ka=k.Extension.create({name:"trailingNode",addProseMirrorPlugins(){const e=new _.PluginKey(this.name);return[new _.Plugin({key:e,appendTransaction:(t,o,i)=>{const{doc:n,tr:a,schema:r}=i,s=e.getState(i),l=n.content.size-2,c=r.nodes.blockContainer,u=r.nodes.paragraph;if(s)return a.insert(l,c.create(void 0,u.create()))},state:{init:(t,o)=>{},apply:(t,o)=>{if(!t.docChanged)return o;let i=t.doc.lastChild;if(!i||i.type.name!=="blockGroup")throw new Error("Expected blockGroup");if(i=i.lastChild,!i||i.type.name!=="blockContainer")return!0;const n=i.firstChild;if(!n)throw new Error("Expected blockContent");return i.nodeSize>4||n.type.spec.content!=="inline*"}}})]}}),_a={blockColor:"data-block-color",blockStyle:"data-block-style",id:"data-id",depth:"data-depth",depthChange:"data-depth-change"},ya=k.Node.create({name:"blockContainer",group:"blockGroupChild bnBlock",content:"blockContent blockGroup?",priority:50,defining:!0,parseHTML(){return[{tag:"div",getAttrs:e=>{if(typeof e=="string")return!1;const t={};for(const[o,i]of Object.entries(_a))e.getAttribute(i)&&(t[o]=e.getAttribute(i));return e.getAttribute("data-node-type")==="blockContainer"?t:!1}}]},renderHTML({HTMLAttributes:e}){var n;const t=document.createElement("div");t.className="bn-block-outer",t.setAttribute("data-node-type","blockOuter");for(const[a,r]of Object.entries(e))a!=="class"&&t.setAttribute(a,r);const o={...((n=this.options.domAttributes)==null?void 0:n.block)||{},...e},i=document.createElement("div");i.className=R("bn-block",o.class),i.setAttribute("data-node-type",this.name);for(const[a,r]of Object.entries(o))a!=="class"&&i.setAttribute(a,r);return t.appendChild(i),{dom:t,contentDOM:i}}}),va=k.Node.create({name:"blockGroup",group:"childContainer",content:"blockGroupChild+",parseHTML(){return[{tag:"div",getAttrs:e=>typeof e=="string"?!1:e.getAttribute("data-node-type")==="blockGroup"?null:!1}]},renderHTML({HTMLAttributes:e}){var i;const t={...((i=this.options.domAttributes)==null?void 0:i.blockGroup)||{},...e},o=document.createElement("div");o.className=R("bn-block-group",t.class),o.setAttribute("data-node-type","blockGroup");for(const[n,a]of Object.entries(t))n!=="class"&&o.setAttribute(n,a);return{dom:o,contentDOM:o}}}),wa=k.Node.create({name:"doc",topNode:!0,content:"blockGroup"}),Zo=e=>{var i;const t=[k.extensions.ClipboardTextSerializer,k.extensions.Commands,k.extensions.Editable,k.extensions.FocusEvents,k.extensions.Tabindex,fi.Gapcursor,X.configure({types:["blockContainer","columnList","column"],setIdAttribute:e.setIdAttribute}),gi.HardBreak.extend({priority:10}),_i.Text,ki.Link.extend({addKeyboardShortcuts(){return{"Mod-k":()=>(this.editor.commands.toggleLink({href:""}),!0)}}}),...Object.values(e.styleSpecs).map(n=>n.implementation.mark),ba,pa,ga,k.Extension.create({name:"OverrideEscape",addKeyboardShortcuts(){return{Escape:()=>e.editor.suggestionMenus.shown?!1:this.editor.commands.blur()}}}),wa,ya.configure({editor:e.editor,domAttributes:e.domAttributes}),fa.configure({editor:e.editor}),va.configure({domAttributes:e.domAttributes}),...Object.values(e.inlineContentSpecs).filter(n=>n.config!=="link"&&n.config!=="text").map(n=>n.implementation.node.configure({editor:e.editor})),...Object.values(e.blockSpecs).flatMap(n=>[...(n.implementation.requiredExtensions||[]).map(a=>a.configure({editor:e.editor,domAttributes:e.domAttributes})),n.implementation.node.configure({editor:e.editor,domAttributes:e.domAttributes})]),ua(e.editor),da(e.editor),sa(e.editor),...e.trailingBlock===void 0||e.trailingBlock?[ka]:[]];if(e.collaboration){if(t.push(Bi.default.configure({fragment:e.collaboration.fragment})),(i=e.collaboration.provider)!=null&&i.awareness){const n=a=>{const r=document.createElement("span");r.classList.add("collaboration-cursor__caret"),r.setAttribute("style",`border-color: ${a.color}`);const s=document.createElement("span");s.classList.add("collaboration-cursor__label"),s.setAttribute("style",`background-color: ${a.color}`),s.insertBefore(document.createTextNode(a.name),null);const l=document.createTextNode("⁠"),c=document.createTextNode("⁠");return r.insertBefore(l,null),r.insertBefore(s,null),r.insertBefore(c,null),r};t.push(Ti.default.configure({user:e.collaboration.user,render:e.collaboration.renderCursor||n,provider:e.collaboration.provider}))}}else t.push(bi.History);const o=e.disableExtensions||[];return t.filter(n=>!o.includes(n.name))};function Ca(e,t){const o=[];return e.forEach((i,n,a)=>{a!==t&&o.push(i)}),v.Fragment.from(o)}function Ea(e,t){const o=[];for(let i=0;i0&&o[o.length-1].type.name==="table"){const n=o[o.length-1],a=n.copy(n.content.addToEnd(e.child(i)));o[o.length-1]=a}else{const n=t.nodes.table.createChecked(void 0,e.child(i));o.push(n)}else o.push(e.child(i));return e=v.Fragment.from(o),e}function xa(e,t){let o=v.Fragment.from(e.content);o=Ea(o,t.state.schema);for(let i=0;it!==void 0))}class xe{constructor(t){p(this,"blockSpecs");p(this,"inlineContentSpecs");p(this,"styleSpecs");p(this,"blockSchema");p(this,"inlineContentSchema");p(this,"styleSchema");p(this,"BlockNoteEditor","only for types");p(this,"Block","only for types");p(this,"PartialBlock","only for types");this.blockSpecs=it(t==null?void 0:t.blockSpecs)||Xe,this.inlineContentSpecs=it(t==null?void 0:t.inlineContentSpecs)||Je,this.styleSpecs=it(t==null?void 0:t.styleSpecs)||Ze,this.blockSchema=He(this.blockSpecs),this.inlineContentSchema=Re(this.inlineContentSpecs),this.styleSchema=Ve(this.styleSpecs)}static create(t){return new xe(t)}}const Te=class Te extends k.Editor{constructor(o,i){super({...o,content:void 0});p(this,"_state");p(this,"_creating",!1);p(this,"mount",o=>{o?(this.options.element=o,this.createViewAlternative()):(this.destroy(),this._creating=!1)});const n=this.schema;let a;const r=n.nodes.doc.createAndFill;n.nodes.doc.createAndFill=(...l)=>{if(a)return a;const c=r.apply(n.nodes.doc,l),u=JSON.parse(JSON.stringify(c.toJSON()));return u.content[0].content[0].attrs.id="initialBlockId",a=v.Node.fromJSON(n,u),a};let s;try{const l=o==null?void 0:o.content.map(c=>F(c,this.schema,i).toJSON());s=k.createDocument({type:"doc",content:[{type:"blockGroup",content:l}]},this.schema,this.options.parseOptions)}catch(l){throw console.error("Error creating document from blocks passed as `initialContent`. Caused by exception: ",l),new Error("Error creating document from blocks passed as `initialContent`:\n"+ +JSON.stringify(o.content))}this._state=_.EditorState.create({doc:s,schema:this.schema})}get state(){return this.view&&(this._state=this.view.state),this._state}dispatch(o){this.view?this.view.dispatch(o):this._state=this.state.apply(o)}createViewAlternative(){this._creating=!0,queueMicrotask(()=>{if(!this._creating)return;this.view=new x.EditorView({mount:this.options.element},{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:this.state});const o=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(o),this.createNodeViews(),this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0,this._creating=!1})}};p(Te,"create",(o,i)=>{var a,r;const n=(a=globalThis==null?void 0:globalThis.window)==null?void 0:a.setTimeout;typeof((r=globalThis==null?void 0:globalThis.window)==null?void 0:r.setTimeout)<"u"&&(globalThis.window.setTimeout=()=>0);try{return new Te(o,i)}finally{n&&(globalThis.window.setTimeout=n)}});let Se=Te;Se.prototype.createView=function(){this.options.onPaste=this.options.onDrop=void 0};const Sa=new _.PluginKey("blocknote-placeholder"),Ba=(e,t)=>new _.Plugin({key:Sa,view:()=>{const o=document.createElement("style"),i=e._tiptapEditor.options.injectNonce;i&&o.setAttribute("nonce",i),e._tiptapEditor.view.root instanceof ShadowRoot?e._tiptapEditor.view.root.append(o):e._tiptapEditor.view.root.head.appendChild(o);const n=o.sheet,a=(s="")=>`.bn-block-content${s} .bn-inline-content:has(> .ProseMirror-trailingBreak:only-child):before`,r=(s,l=!0)=>{const c=l?"[data-is-empty-and-focused]":"";if(s==="default")return a(c);const u=`[data-content-type="${s}"]`;return a(c+u)};for(const[s,l]of Object.entries(t)){const c=s==="default";n.insertRule(`${r(s,c)}{ content: ${JSON.stringify(l)}; }`),c||n.insertRule(`${r(s,!0)}{ content: ${JSON.stringify(l)}; }`)}return{destroy:()=>{e._tiptapEditor.view.root instanceof ShadowRoot?e._tiptapEditor.view.root.removeChild(o):e._tiptapEditor.view.root.head.removeChild(o)}}},props:{decorations:o=>{const{doc:i,selection:n}=o;if(!e.isEditable||!n.empty||n.$from.parent.type.spec.code)return;const a=n.$anchor,r=a.parent;if(r.content.size>0)return null;const s=a.before(),l=x.Decoration.node(s,s+r.nodeSize,{"data-is-empty-and-focused":"true"});return x.DecorationSet.create(i,[l])}}}),Ta=new _.PluginKey("node-selection-keyboard"),Ma=()=>new _.Plugin({key:Ta,props:{handleKeyDown:(e,t)=>{if("node"in e.state.selection){if(t.ctrlKey||t.metaKey)return!1;if(t.key.length===1)return t.preventDefault(),!0;if(t.key==="Enter"&&!t.shiftKey&&!t.altKey&&!t.ctrlKey&&!t.metaKey){const o=e.state.tr;return e.dispatch(o.insert(e.state.tr.selection.$to.after(),e.state.schema.nodes.paragraph.createChecked()).setSelection(new _.TextSelection(o.doc.resolve(e.state.tr.selection.$to.after()+1)))),!0}}return!1}}}),Jo=new _.PluginKey("previous-blocks"),La={index:"index",level:"level",type:"type",depth:"depth","depth-change":"depth-change"},Ia=()=>{let e;return new _.Plugin({key:Jo,view(t){return{update:async(o,i)=>{var n;((n=this.key)==null?void 0:n.getState(o.state).updatedBlocks.size)>0&&(e=setTimeout(()=>{o.dispatch(o.state.tr.setMeta(Jo,{clearUpdate:!0}))},0))},destroy:()=>{e&&clearTimeout(e)}}},state:{init(){return{prevTransactionOldBlockAttrs:{},currentTransactionOldBlockAttrs:{},updatedBlocks:new Set}},apply(t,o,i,n){if(o.currentTransactionOldBlockAttrs={},o.updatedBlocks.clear(),!t.docChanged||i.doc.eq(n.doc))return o;const a={},r=k.findChildren(i.doc,c=>c.attrs.id),s=new Map(r.map(c=>[c.node.attrs.id,c])),l=k.findChildren(n.doc,c=>c.attrs.id);for(const c of l){const u=s.get(c.node.attrs.id),h=u==null?void 0:u.node.firstChild,m=c.node.firstChild;if(u&&h&&m){const f={index:m.attrs.index,level:m.attrs.level,type:m.type.name,depth:n.doc.resolve(c.pos).depth};let g={index:h.attrs.index,level:h.attrs.level,type:h.type.name,depth:i.doc.resolve(u.pos).depth};a[c.node.attrs.id]=g,t.getMeta("numberedListIndexing")&&(c.node.attrs.id in o.prevTransactionOldBlockAttrs&&(g=o.prevTransactionOldBlockAttrs[c.node.attrs.id]),f.type==="numberedListItem"&&(g.index=f.index)),o.currentTransactionOldBlockAttrs[c.node.attrs.id]=g,JSON.stringify(g)!==JSON.stringify(f)&&(g["depth-change"]=g.depth-f.depth,o.updatedBlocks.add(c.node.attrs.id))}}return o.prevTransactionOldBlockAttrs=a,o}},props:{decorations(t){const o=this.getState(t);if(o.updatedBlocks.size===0)return;const i=[];return t.doc.descendants((n,a)=>{if(!n.attrs.id||!o.updatedBlocks.has(n.attrs.id))return;const r=o.currentTransactionOldBlockAttrs[n.attrs.id],s={};for(const[c,u]of Object.entries(r))s["data-prev-"+La[c]]=u||"none";const l=x.Decoration.node(a,a+n.nodeSize,{...s});i.push(l)}),x.DecorationSet.create(t.doc,i)}}})},Pa=new _.PluginKey("blockSelect"),Aa=()=>new _.Plugin({key:Pa,state:{init(){return{selectedBlocks:[]}},apply(e,t){const o=e.getMeta("blockSelect");if(o){if(o.type==="select")return{selectedBlocks:[...o.ids]};if(o.type==="deselect")return{selectedBlocks:t.selectedBlocks.filter(i=>!o.ids.includes(i))};if(o.type==="clear")return{selectedBlocks:[]}}return t}},props:{decorations(e){const t=this.getState(e);if(!t||t.selectedBlocks.length===0)return x.DecorationSet.empty;const{selectedBlocks:o}=t,i=[];return e.doc.descendants((n,a)=>{n.type.name==="blockContainer"&&o.includes(n.attrs.id)&&i.push(x.Decoration.node(a,a+n.nodeSize,{class:"bn-block-selected","data-selected":"true"},{inclusiveStart:!0,inclusiveEnd:!0}))}),x.DecorationSet.create(e.doc,i)}}}),Na=k.Extension.create({name:"ghost",addOptions(){return{emptyNodeClass:"is-empty",autocomplete:null,placeholder:"Write something...",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addKeyboardShortcuts(){return{Tab:()=>this.options.autocomplete?this.editor.chain().focus().command(({tr:e})=>(e.insertText(this.options.autocomplete||""),this.options.autocomplete=null,!0)).run():!1}},addProseMirrorPlugins(){return[new _.Plugin({key:new _.PluginKey("ghost"),props:{decorations:({doc:e,selection:t})=>{const o=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=t,n=[];if(!o)return null;const a=e.firstChild;return a?(a.descendants((r,s)=>{if(r.type.name==="paragraph"){const l=i>=s&&i<=s+r.nodeSize,c=r.textContent.slice(i-s).trim().length>0;if(l&&!c){const u=x.Decoration.inline(s,s+r.nodeSize,{class:"ghost-inline","data-ghost":this.options.autocomplete??""});n.push(u)}}return!0}),x.DecorationSet.create(e,n)):null}}})]}}),ja={enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!1};class nt{constructor(t){p(this,"_pmSchema");p(this,"headless",!1);p(this,"_tiptapEditor");p(this,"elementRenderer",null);p(this,"blockCache",new WeakMap);p(this,"dictionary");p(this,"schema");p(this,"blockImplementations");p(this,"inlineContentImplementations");p(this,"styleImplementations");p(this,"formattingToolbar");p(this,"linkToolbar");p(this,"sideMenu");p(this,"suggestionMenus");p(this,"filePanel");p(this,"tableHandles");p(this,"_selectedBlockIds",[]);p(this,"uploadFile");p(this,"onUploadStartCallbacks",[]);p(this,"onUploadEndCallbacks",[]);p(this,"resolveFileUrl");p(this,"mount",t=>{this._tiptapEditor.mount(t)});var c,u,h,m,f,g,b;this.options=t;const o=t;if(o.onEditorContentChange)throw new Error("onEditorContentChange initialization option is deprecated, use , the useEditorChange(...) hook, or editor.onChange(...)");if(o.onTextCursorPositionChange)throw new Error("onTextCursorPositionChange initialization option is deprecated, use , the useEditorSelectionChange(...) hook, or editor.onSelectionChange(...)");if(o.onEditorReady)throw new Error("onEditorReady is deprecated. Editor is immediately ready for use after creation.");if(o.editable)throw new Error("editable initialization option is deprecated, use , or alternatively editor.isEditable = true/false");this.dictionary=t.dictionary||ct;const i={defaultStyles:!0,schema:t.schema||xe.create(),_headless:!1,...t,placeholders:{...this.dictionary.placeholders,...t.placeholders}};this.schema=i.schema,this.blockImplementations=i.schema.blockSpecs,this.inlineContentImplementations=i.schema.inlineContentSpecs,this.styleImplementations=i.schema.styleSpecs,this.formattingToolbar=new Lo(this),this.linkToolbar=new Po(this),this.sideMenu=new Oo(this),this.suggestionMenus=new Ro(this),this.filePanel=new Bo(this),I("table",this)&&(this.tableHandles=new Fo(this));const n=Zo({editor:this,domAttributes:i.domAttributes||{},blockSpecs:this.schema.blockSpecs,styleSpecs:this.schema.styleSpecs,inlineContentSpecs:this.schema.inlineContentSpecs,collaboration:i.collaboration,trailingBlock:i.trailingBlock,disableExtensions:i.disableExtensions,setIdAttribute:i.setIdAttribute}),a=this.options.dropCursor??yi.dropCursor,r=k.Extension.create({name:"BlockNoteUIExtension",addProseMirrorPlugins:()=>[this.formattingToolbar.plugin,this.linkToolbar.plugin,this.sideMenu.plugin,this.suggestionMenus.plugin,...this.filePanel?[this.filePanel.plugin]:[],...this.tableHandles?[this.tableHandles.plugin]:[],a({width:5,color:"#ddeeff",editor:this}),Ba(this,i.placeholders),Ma(),...this.options.animations??!0?[Ia()]:[]]});if(n.push(r),i.uploadFile){const y=i.uploadFile;this.uploadFile=async(C,M)=>{this.onUploadStartCallbacks.forEach(D=>D.apply(this,[M]));try{return await y(C,M)}finally{this.onUploadEndCallbacks.forEach(D=>D.apply(this,[M]))}}}this.resolveFileUrl=i.resolveFileUrl||(async y=>y),this.headless=i._headless,i.collaboration&&i.initialContent&&console.warn("When using Collaboration, initialContent might cause conflicts, because changes should come from the collaboration provider");const s=i.initialContent||(t.collaboration?[{type:"paragraph",id:"initialBlockId"}]:[{type:"paragraph",id:X.options.generateID()}]);if(!Array.isArray(s)||s.length===0)throw new Error("initialContent must be a non-empty array of blocks, received: "+s);const l={...ja,...i._tiptapOptions,content:s,extensions:[...((c=i._tiptapOptions)==null?void 0:c.extensions)||[],...n,k.Extension.create({name:"blockSelect",addProseMirrorPlugins(){return[Aa()]}}),Na.configure()],editorProps:{...(u=i._tiptapOptions)==null?void 0:u.editorProps,attributes:{tabIndex:"0",...(m=(h=i._tiptapOptions)==null?void 0:h.editorProps)==null?void 0:m.attributes,...(f=i.domAttributes)==null?void 0:f.editor,class:R("bn-editor",i.defaultStyles?"bn-default-styles":"",((b=(g=i.domAttributes)==null?void 0:g.editor)==null?void 0:b.class)||"")},transformPasted:xa},onUpdate:()=>{this._tiptapEditor.extensionManager.extensions.filter(y=>y.name==="ghost")[0].options.autocomplete="",this._tiptapEditor.view.dispatch(this._tiptapEditor.state.tr)}};this.headless?this._pmSchema=k.getSchema(l.extensions):(this._tiptapEditor=Se.create(l,this.schema.styleSchema),this._pmSchema=this._tiptapEditor.schema)}get pmSchema(){return this._pmSchema}static create(t={}){return new nt(t)}dispatch(t){this._tiptapEditor.dispatch(t)}get prosemirrorView(){return this._tiptapEditor.view}get domElement(){return this._tiptapEditor.view.dom}isFocused(){return this._tiptapEditor.view.hasFocus()}focus(){this._tiptapEditor.view.focus()}onUploadStart(t){return this.onUploadStartCallbacks.push(t),()=>{const o=this.onUploadStartCallbacks.indexOf(t);o>-1&&this.onUploadStartCallbacks.splice(o,1)}}onUploadEnd(t){return this.onUploadEndCallbacks.push(t),()=>{const o=this.onUploadEndCallbacks.indexOf(t);o>-1&&this.onUploadEndCallbacks.splice(o,1)}}get topLevelBlocks(){return this.document}get document(){const t=[];return this._tiptapEditor.state.doc.firstChild.descendants(o=>(t.push(S(o,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.blockCache)),!1)),t}getBlock(t){const o=typeof t=="string"?t:t.id;let i;return this._tiptapEditor.state.doc.firstChild.descendants(n=>typeof i<"u"?!1:n.type.name!=="blockContainer"||n.attrs.id!==o?!0:(i=S(n,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.blockCache),!1)),i}forEachBlock(t,o=!1){const i=this.document.slice();o&&i.reverse();function n(a){for(const r of a){if(t(r)===!1)return!1;const s=o?r.children.slice().reverse():r.children;if(!n(s))return!1}return!0}n(i)}onEditorContentChange(t){this._tiptapEditor.on("update",t)}onEditorSelectionChange(t){this._tiptapEditor.on("selectionUpdate",t)}getTextCursorPosition(){return Rn(this)}setTextCursorPosition(t,o="start"){vo(this,t,o)}getSelection(){if(this._tiptapEditor.state.selection.from===this._tiptapEditor.state.selection.to||"node"in this._tiptapEditor.state.selection)return;const t=[];return this._tiptapEditor.state.doc.descendants((o,i)=>{if(o.type.spec.group!=="blockContent")return!0;const n=i+o.nodeSize-1,a=i+1;return n<=this._tiptapEditor.state.selection.from||a>=this._tiptapEditor.state.selection.to?!0:(t.push(S(this._tiptapEditor.state.doc.resolve(i).node(),this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.blockCache)),!1)}),{blocks:t}}get isEditable(){if(!this._tiptapEditor){if(!this.headless)throw new Error("no editor, but also not headless?");return!1}return this._tiptapEditor.isEditable===void 0?!0:this._tiptapEditor.isEditable}set isEditable(t){if(!this._tiptapEditor){if(!this.headless)throw new Error("no editor, but also not headless?");return}this._tiptapEditor.options.editable!==t&&this._tiptapEditor.setEditable(t)}insertBlocks(t,o,i="before"){return Tn(this,t,o,i)}updateBlock(t,o){return en(this,t,o)}removeBlocks(t){return Hn(this,t)}replaceBlocks(t,o){return Un(this,t,o)}insertInlineContent(t){const o=j(t,this.pmSchema,this.schema.styleSchema);On({from:this._tiptapEditor.state.selection.from,to:this._tiptapEditor.state.selection.to},o,this)}getActiveStyles(){const t={},o=this._tiptapEditor.state.selection.$to.marks();for(const i of o){const n=this.schema.styleSchema[i.type.name];if(!n){i.type.name!=="link"&&console.warn("mark not found in styleschema",i.type.name);continue}n.propSchema==="boolean"?t[n.type]=!0:t[n.type]=i.attrs.stringValue}return t}addStyles(t){for(const[o,i]of Object.entries(t)){const n=this.schema.styleSchema[o];if(!n)throw new Error(`style ${o} not found in styleSchema`);if(n.propSchema==="boolean")this._tiptapEditor.commands.setMark(o);else if(n.propSchema==="string")this._tiptapEditor.commands.setMark(o,{stringValue:i});else throw new N(n.propSchema)}}removeStyles(t){for(const o of Object.keys(t))this._tiptapEditor.commands.unsetMark(o)}toggleStyles(t){for(const[o,i]of Object.entries(t)){const n=this.schema.styleSchema[o];if(!n)throw new Error(`style ${o} not found in styleSchema`);if(n.propSchema==="boolean")this._tiptapEditor.commands.toggleMark(o);else if(n.propSchema==="string")this._tiptapEditor.commands.toggleMark(o,{stringValue:i});else throw new N(n.propSchema)}}getSelectedText(){return this._tiptapEditor.state.doc.textBetween(this._tiptapEditor.state.selection.from,this._tiptapEditor.state.selection.to)}getSelectedLinkUrl(){return this._tiptapEditor.getAttributes("link").href}createLink(t,o){if(t==="")return;const{from:i,to:n}=this._tiptapEditor.state.selection;o||(o=this._tiptapEditor.state.doc.textBetween(i,n));const a=this.pmSchema.mark("link",{href:t});this.dispatch(this._tiptapEditor.state.tr.insertText(o,i,n).addMark(i,i+o.length,a))}canNestBlock(){return jn(this)}nestBlock(){_o(this)}canUnnestBlock(){return Dn(this)}unnestBlock(){Nn(this)}moveBlockUp(){In(this)}moveBlockDown(){Pn(this)}async blocksToHTMLLossy(t=this.document){return ae(this.pmSchema,this).exportBlocks(t,{})}async blocksToFullHTML(t){return kt(this.pmSchema,this).serializeBlocks(t,{})}async tryParseHTMLToBlocks(t){return Ye(t,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.pmSchema)}async blocksToMarkdownLossy(t=this.document){return wo(t,this.pmSchema,this,{})}async tryParseMarkdownToBlocks(t){return xo(t,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.pmSchema)}updateCollaborationUserInfo(t){if(!this.options.collaboration)throw new Error("Cannot update collaboration user info when collaboration is disabled.");this._tiptapEditor.commands.updateUser(t)}onChange(t){if(this.headless)return;const o=()=>{t(this)};return this._tiptapEditor.on("update",o),()=>{this._tiptapEditor.off("update",o)}}onSelectionChange(t){if(this.headless)return;const o=()=>{t(this)};return this._tiptapEditor.on("selectionUpdate",o),()=>{this._tiptapEditor.off("selectionUpdate",o)}}openSuggestionMenu(t,o){const i=this.prosemirrorView.state.tr,n=o&&o.deleteTriggerCharacter?i.insertText(t):i;this.prosemirrorView.focus(),this.prosemirrorView.dispatch(n.scrollIntoView().setMeta(this.suggestionMenus.plugin,{triggerCharacter:t,deleteTriggerCharacter:(o==null?void 0:o.deleteTriggerCharacter)||!1,ignoreQueryLength:(o==null?void 0:o.ignoreQueryLength)||!1}))}selectBlocks(t){this._tiptapEditor.view.dispatch(this._tiptapEditor.view.state.tr.setMeta("blockSelect",{type:"select",ids:t})),this._selectedBlockIds=t}deselectBlocks(t){this._tiptapEditor.view.dispatch(this._tiptapEditor.view.state.tr.setMeta("blockSelect",{type:"deselect",ids:t})),this._selectedBlockIds=this._selectedBlockIds.filter(o=>!t.includes(o))}clearBlockSelection(){this._tiptapEditor.view.dispatch(this._tiptapEditor.view.state.tr.setMeta("blockSelect",{type:"clear"})),this._selectedBlockIds=[]}updateAutocompleteText(t){this._tiptapEditor.extensionManager.extensions.filter(o=>o.name==="ghost")[0].options.autocomplete=t,this._tiptapEditor.view.dispatch(this._tiptapEditor.state.tr)}getSelectedBlockIds(){return this._selectedBlockIds}}const Da={gray:{text:"#9b9a97",background:"#ebeced"},brown:{text:"#64473a",background:"#e9e5e3"},red:{text:"#e03e3e",background:"#fbe4e4"},orange:{text:"#d9730d",background:"#f6e9d9"},yellow:{text:"#dfab01",background:"#fbf3db"},green:{text:"#4d6461",background:"#ddedea"},blue:{text:"#0b6e99",background:"#ddebf1"},purple:{text:"#6940a5",background:"#eae4f2"},pink:{text:"#ad1a72",background:"#f4dfeb"}},Ha={gray:{text:"#bebdb8",background:"#9b9a97"},brown:{text:"#8e6552",background:"#64473a"},red:{text:"#ec4040",background:"#be3434"},orange:{text:"#e3790d",background:"#b7600a"},yellow:{text:"#dfab01",background:"#b58b00"},green:{text:"#6b8b87",background:"#4d6461"},blue:{text:"#0e87bc",background:"#0b6e99"},purple:{text:"#8552d7",background:"#6940a5"},pink:{text:"#da208f",background:"#ad1a72"}};class Ua{constructor(t,o,i){this.mappings=o,this.options=i}async resolveFile(t){var i;if(!((i=this.options)!=null&&i.resolveFileUrl))return(await fetch(t)).blob();const o=await this.options.resolveFileUrl(t);return o instanceof Blob?o:(await fetch(o)).blob()}mapStyles(t){return Object.entries(t).map(([i,n])=>this.mappings.styleMapping[i](n,this))}mapInlineContent(t){return this.mappings.inlineContentMapping[t.type](t,this)}transformInlineContent(t){return t.map(o=>this.mapInlineContent(o))}async mapBlock(t,o,i){return this.mappings.blockMapping[t.type](t,this,o,i)}}function Oa(e){return{createBlockMapping:t=>t,createInlineContentMapping:t=>t,createStyleMapping:t=>t}}let Be,at;async function Ra(e,t){if(!fo("text",e))return[];if(!Be){Be=import("@emoji-mart/data"),at=await import("emoji-mart");const n=(await Be).default;await at.init({data:n})}const o=(await Be).default;return(t.trim()===""?Object.values(o.emojis):await at.SearchIndex.search(t)).map(n=>({id:n.skins[0].native,onItemClick:()=>e.insertInlineContent(n.skins[0].native+" ")}))}function za(e){let t=e.getTextCursorPosition().block,o=e.schema.blockSchema[t.type].content;for(;o==="none";)t=e.getTextCursorPosition().nextBlock,o=e.schema.blockSchema[t.type].content,e.setTextCursorPosition(t,"end")}function A(e,t){const o=e.getTextCursorPosition().block;if(o.content===void 0)throw new Error("Slash Menu open in a block that doesn't contain content.");let i;return Array.isArray(o.content)&&(o.content.length===1&&Z(o.content[0])&&o.content[0].type==="text"&&o.content[0].text==="/"||o.content.length===0)?(i=e.updateBlock(o,t),e.setTextCursorPosition(i)):(i=e.insertBlocks([t],o,"after")[0],e.setTextCursorPosition(e.getTextCursorPosition().nextBlock)),za(e),i}function Va(e){const t=[];return I("heading",e)&&t.push({onItemClick:()=>{A(e,{type:"heading",props:{level:1}})},badge:O("Mod-Alt-1"),key:"heading",...e.dictionary.slash_menu.heading},{onItemClick:()=>{A(e,{type:"heading",props:{level:2}})},badge:O("Mod-Alt-2"),key:"heading_2",...e.dictionary.slash_menu.heading_2},{onItemClick:()=>{A(e,{type:"heading",props:{level:3}})},badge:O("Mod-Alt-3"),key:"heading_3",...e.dictionary.slash_menu.heading_3}),I("numberedListItem",e)&&t.push({onItemClick:()=>{A(e,{type:"numberedListItem"})},badge:O("Mod-Shift-7"),key:"numbered_list",...e.dictionary.slash_menu.numbered_list}),I("bulletListItem",e)&&t.push({onItemClick:()=>{A(e,{type:"bulletListItem"})},badge:O("Mod-Shift-8"),key:"bullet_list",...e.dictionary.slash_menu.bullet_list}),I("checkListItem",e)&&t.push({onItemClick:()=>{A(e,{type:"checkListItem"})},badge:O("Mod-Shift-9"),key:"check_list",...e.dictionary.slash_menu.check_list}),I("paragraph",e)&&t.push({onItemClick:()=>{A(e,{type:"paragraph"})},badge:O("Mod-Alt-0"),key:"paragraph",...e.dictionary.slash_menu.paragraph}),I("codeBlock",e)&&t.push({onItemClick:()=>{const o=e._tiptapEditor.state.selection.from;A(e,{type:"codeBlock"}),e._tiptapEditor.commands.setTextSelection(o)},badge:O("Mod-Alt-c"),key:"code_block",...e.dictionary.slash_menu.code_block}),I("table",e)&&t.push({onItemClick:()=>{A(e,{type:"table",content:{type:"tableContent",rows:[{cells:["","",""]},{cells:["","",""]}]}})},badge:void 0,key:"table",...e.dictionary.slash_menu.table}),I("image",e)&&t.push({onItemClick:()=>{const o=A(e,{type:"image"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:o}))},key:"image",...e.dictionary.slash_menu.image}),I("video",e)&&t.push({onItemClick:()=>{const o=A(e,{type:"video"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:o}))},key:"video",...e.dictionary.slash_menu.video}),I("audio",e)&&t.push({onItemClick:()=>{const o=A(e,{type:"audio"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:o}))},key:"audio",...e.dictionary.slash_menu.audio}),I("file",e)&&t.push({onItemClick:()=>{const o=A(e,{type:"file"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:o}))},key:"file",...e.dictionary.slash_menu.file}),t.push({onItemClick:()=>{e.openSuggestionMenu(":",{deleteTriggerCharacter:!0,ignoreQueryLength:!0})},key:"emoji",...e.dictionary.slash_menu.emoji}),t}function Fa(e,t){return e.filter(({title:o,aliases:i})=>o.toLowerCase().includes(t.toLowerCase())||i&&i.filter(n=>n.toLowerCase().includes(t.toLowerCase())).length!==0)}function Ga(e,...t){const o=[...e];for(const i of t)for(const n of i){const a=o.findLastIndex(r=>r.group===n.group);a===-1?o.push(n):o.splice(a+1,0,n)}return o}function rt(e=""){return typeof e=="string"?[{type:"text",text:e,styles:{}}]:e}function fe(e){return typeof e=="string"?rt(e):Array.isArray(e)?e.flatMap(t=>typeof t=="string"?rt(t):Ie(t)?{...t,content:rt(t.content)}:Z(t)?t:{props:{},...t,content:fe(t.content)}):(e==null?void 0:e.type)==="tableContent"?{type:"tableContent",columnWidths:e.columnWidths,rows:e.rows.map(t=>({...t,cells:t.cells.map(o=>fe(o))}))}:e}function Wa(e,t){return t.map(o=>st(e.blockSchema,o))}function st(e,t){var n;const o=e[t.type].content,i={id:"",type:t.type,props:{},content:o==="inline"?[]:o==="table"?{type:"tableContent",columnWidths:[],rows:[]}:void 0,children:[],...t};if(Object.entries(e[t.type].propSchema).forEach(([a,r])=>{i.props[a]===void 0&&(i.props[a]=r.default)}),o==="inline"){const a=i.content;i.content=fe(a)}else if(o==="table"){const a=i.content;i.content={type:"tableContent",columnWidths:(a==null?void 0:a.columnWidths)||((n=a==null?void 0:a.rows[0])==null?void 0:n.cells.map(()=>{}))||[],rows:(a==null?void 0:a.rows.map(r=>({cells:r.cells.map(s=>fe(s))})))||[]}}return{...i,content:fe(i.content),children:i.children.map(a=>st(e,a))}}function Yo(e){e.id||(e.id=X.options.generateID()),e.children&&Qo(e.children)}function Qo(e){for(const t of e)Yo(t)}d.AudioBlock=Ot,d.BlockNoteEditor=nt,d.BlockNoteSchema=xe,d.COLORS_DARK_MODE_DEFAULT=Ha,d.COLORS_DEFAULT=Da,d.CodeBlock=Vt,d.EMPTY_CELL_HEIGHT=qi,d.EMPTY_CELL_WIDTH=qe,d.Exporter=Ua,d.FILE_AUDIO_ICON_SVG=At,d.FILE_ICON_SVG=Lt,d.FILE_IMAGE_ICON_SVG=Xt,d.FILE_VIDEO_ICON_SVG=io,d.FileBlock=$t,d.FilePanelProsemirrorPlugin=Bo,d.FilePanelView=So,d.FormattingToolbarProsemirrorPlugin=Lo,d.FormattingToolbarView=To,d.HTMLToBlocks=Ye,d.ImageBlock=to,d.LinkToolbarProsemirrorPlugin=Po,d.SideMenuProsemirrorPlugin=Oo,d.SideMenuView=Ho,d.SuggestionMenuProseMirrorPlugin=Ro,d.TableHandlesProsemirrorPlugin=Fo,d.TableHandlesView=Vo,d.UniqueID=X,d.UnreachableCaseError=N,d.VideoBlock=co,d.addIdsToBlock=Yo,d.addIdsToBlocks=Qo,d.addInlineContentAttributes=Oe,d.addInlineContentKeyboardShortcuts=Ct,d.addStyleAttributes=Tt,d.applyNonSelectableBlockFix=vt,d.assertEmpty=Pi,d.audioBlockConfig=jt,d.audioParse=Ht,d.audioPropSchema=Nt,d.audioRender=Dt,d.audioToExternalHTML=Ut,d.blockToNode=F,d.blocksToMarkdown=wo,d.camelToDataKebab=se,d.checkBlockHasDefaultProp=Bn,d.checkBlockIsDefaultType=go,d.checkBlockIsFileBlock=En,d.checkBlockIsFileBlockWithPlaceholder=Sn,d.checkBlockIsFileBlockWithPreview=xn,d.checkBlockTypeHasDefaultProp=bo,d.checkDefaultBlockTypeInSchema=I,d.checkDefaultInlineContentTypeInSchema=fo,d.cleanHTMLToMarkdown=Ce,d.combineByGroup=Ga,d.contentNodeToInlineContent=ce,d.contentNodeToTableContent=Ue,d.createAddFileButton=It,d.createBlockSpec=de,d.createBlockSpecFromStronglyTypedTiptapNode=V,d.createDefaultBlockDOMOutputSpec=H,d.createDefaultFilePreview=Fe,d.createExternalHTMLExporter=ae,d.createFigureWithCaption=ye,d.createFileAndCaptionWrapper=Y,d.createFileBlockWrapper=ue,d.createInlineContentSpec=Vi,d.createInlineContentSpecFromTipTapNode=xt,d.createInternalBlockSpec=De,d.createInternalHTMLSerializer=kt,d.createInternalInlineContentSpec=Et,d.createInternalStyleSpec=ze,d.createLinkWithCaption=he,d.createResizeHandlesWrapper=We,d.createStronglyTypedTiptapNode=z,d.createStyleSpec=Fi,d.createStyleSpecFromTipTapMark=G,d.createSuggestionMenu=ta,d.customizeCodeBlock=Gi,d.defaultBlockSchema=ho,d.defaultBlockSpecs=Xe,d.defaultBlockToHTML=Ae,d.defaultCodeBlockPropSchema=ve,d.defaultInlineContentSchema=mo,d.defaultInlineContentSpecs=Je,d.defaultProps=E,d.defaultStyleSchema=Cn,d.defaultStyleSpecs=Ze,d.fileBlockConfig=Gt,d.fileParse=Kt,d.filePropSchema=Ft,d.fileRender=Wt,d.fileToExternalHTML=qt,d.filenameFromURL=zi,d.filterSuggestionItems=Fa,d.formatKeyboardShortcut=O,d.formattingToolbarPluginKey=Mo,d.getBlockFromPos=yt,d.getBlockInfo=K,d.getBlockInfoFromResolvedPos=J,d.getBlockInfoFromSelection=w,d.getBlockInfoWithManualOffset=ke,d.getBlockNoteExtensions=Zo,d.getBlockSchemaFromSpecs=He,d.getDefaultEmojiPickerItems=Ra,d.getDefaultSlashMenuItems=Va,d.getInlineContentParseRules=St,d.getInlineContentSchemaFromSpecs=Re,d.getNearestBlockContainerPos=re,d.getNodeById=q,d.getParseRules=wt,d.getStyleParseRules=Mt,d.getStyleSchemaFromSpecs=Ve,d.imageBlockConfig=Jt,d.imageParse=Qt,d.imagePropSchema=Zt,d.imageRender=Yt,d.imageToExternalHTML=eo,d.inheritedProps=Ne,d.initializeESMDependencies=we,d.inlineContentToNodes=j,d.insertOrUpdateBlock=A,d.isAppleOS=_t,d.isLinkInlineContent=Le,d.isPartialLinkInlineContent=Ie,d.isSafari=Ri,d.isStyledTextInlineContent=Z,d.linkToolbarPluginKey=Io,d.locales=Ii,d.mappingFactory=Oa,d.markdownToBlocks=xo,d.mergeCSSClasses=R,d.nodeToBlock=S,d.nodeToCustomInlineContent=_e,d.parseEmbedElement=Ge,d.parseFigureElement=pe,d.parseImageElement=Ke,d.partialBlockToBlockForTesting=st,d.partialBlocksToBlocksForTesting=Wa,d.propsToAttributes=je,d.sideMenuPluginKey=Uo,d.stylePropsToAttributes=Bt,d.tableContentToNodes=ne,d.tableHandlesPluginKey=oe,d.uploadToTmpFilesDotOrg_DEV_ONLY=Wi,d.videoBlockConfig=ao,d.videoParse=so,d.videoPropSchema=no,d.videoRender=ro,d.videoToExternalHTML=lo,d.wrapInBlockStructure=le,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}); //# sourceMappingURL=blocknote.umd.cjs.map