@blocknote/core 0.15.0 → 0.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocknote.js +721 -698
- package/dist/blocknote.js.map +1 -1
- package/dist/blocknote.umd.cjs +6 -6
- package/dist/blocknote.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +4 -4
- package/src/api/parsers/html/util/__snapshots__/nestedLists.test.ts.snap +7 -7
- package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +37 -0
- package/src/extensions/SideMenu/SideMenuPlugin.ts +13 -2
- package/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.ts +18 -11
- package/src/i18n/locales/en.ts +1 -1
- package/types/src/api/blockManipulation/blockManipulation.d.ts +1 -1
- package/types/src/api/exporters/copyExtension.d.ts +2 -2
- package/types/src/api/exporters/html/externalHTMLExporter.d.ts +1 -1
- package/types/src/api/exporters/html/internalHTMLSerializer.d.ts +1 -1
- package/types/src/api/exporters/html/util/sharedHTMLConversion.d.ts +2 -2
- package/types/src/api/parsers/fileDropExtension.d.ts +2 -2
- package/types/src/api/parsers/pasteExtension.d.ts +2 -2
- package/types/src/blocks/defaultBlockHelpers.d.ts +2 -2
- package/types/src/editor/BlockNoteExtensions.d.ts +2 -2
- package/types/src/extensions/FormattingToolbar/FormattingToolbarPlugin.d.ts +1 -0
- package/types/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.d.ts +1 -1
- package/types/src/pm-nodes/BlockContainer.d.ts +2 -8
- package/types/src/pm-nodes/BlockGroup.d.ts +2 -7
- package/types/src/schema/inlineContent/internal.d.ts +1 -1
package/dist/blocknote.umd.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(function(d,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("prosemirror-model"),require("rehype-parse"),require("rehype-stringify"),require("unified"),require("@tiptap/core"),require("prosemirror-state"),require("uuid"),require("hast-util-from-dom"),require("@tiptap/extension-bold"),require("@tiptap/extension-code"),require("@tiptap/extension-italic"),require("@tiptap/extension-strike"),require("@tiptap/extension-underline"),require("@tiptap/extension-table-cell"),require("@tiptap/extension-table-header"),require("@tiptap/extension-table-row"),require("prosemirror-tables"),require("rehype-remark"),require("remark-gfm"),require("remark-stringify"),require("remark-parse"),require("remark-rehype"),require("prosemirror-view"),require("@tiptap/extension-collaboration"),require("@tiptap/extension-collaboration-cursor"),require("@tiptap/extension-dropcursor"),require("@tiptap/extension-gapcursor"),require("@tiptap/extension-hard-break"),require("@tiptap/extension-history"),require("@tiptap/extension-link"),require("@tiptap/extension-text"),require("@emoji-mart/data"),require("emoji-mart")):typeof define=="function"&&define.amd?define(["exports","prosemirror-model","rehype-parse","rehype-stringify","unified","@tiptap/core","prosemirror-state","uuid","hast-util-from-dom","@tiptap/extension-bold","@tiptap/extension-code","@tiptap/extension-italic","@tiptap/extension-strike","@tiptap/extension-underline","@tiptap/extension-table-cell","@tiptap/extension-table-header","@tiptap/extension-table-row","prosemirror-tables","rehype-remark","remark-gfm","remark-stringify","remark-parse","remark-rehype","prosemirror-view","@tiptap/extension-collaboration","@tiptap/extension-collaboration-cursor","@tiptap/extension-dropcursor","@tiptap/extension-gapcursor","@tiptap/extension-hard-break","@tiptap/extension-history","@tiptap/extension-link","@tiptap/extension-text","@emoji-mart/data","emoji-mart"],y):(d=typeof globalThis<"u"?globalThis:d||self,y(d.blocknote={},d.prosemirrorModel,d.rehypeParse,d.rehypeStringify,d.unified,d.core,d.prosemirrorState,d.uuid,d.hastUtilFromDom,d.Bold,d.Code,d.Italic,d.Strike,d.Underline,d.extensionTableCell,d.extensionTableHeader,d.extensionTableRow,d.prosemirrorTables,d.rehypeRemark,d.remarkGfm,d.remarkStringify,d.remarkParse,d.remarkRehype,d.prosemirrorView,d.Collaboration,d.CollaborationCursor,d.extensionDropcursor,d.extensionGapcursor,d.extensionHardBreak,d.extensionHistory,d.extensionLink,d.extensionText,d.data,d.emojiMart))})(this,function(d,y,z,Ei,me,b,_,Ci,fe,Si,Ti,Mi,Bi,Li,Ii,Pi,Ai,Fe,Ni,Hi,Di,Ui,Ke,M,ji,Ri,Oi,Vi,zi,Fi,Ki,qi,Gi,qe){"use strict";var $n=Object.defineProperty;var Xn=(d,y,z)=>y in d?$n(d,y,{enumerable:!0,configurable:!0,writable:!0,value:z}):d[y]=z;var u=(d,y,z)=>(Xn(d,typeof y!="symbol"?y+"":y,z),z);const E=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},Ge=E(z),We=E(Ei),Wi=E(Si),$i=E(Ti),Xi=E(Mi),Zi=E(Bi),Ji=E(Li),Yi=E(Ni),$e=E(Hi),Qi=E(Di),eo=E(Ui),to=E(Ke),io=E(ji),oo=E(Ri),no=E(Gi),ro={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:"الكتل الأساسية"},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"}},Xe={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"},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+X"},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"}},ao=Object.freeze(Object.defineProperty({__proto__:null,ar:ro,en:Xe,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"},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"}},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"},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:"基本ブロック"},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:"기본 블록"},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"},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"},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"},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:"Базовые блоки"},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"},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:"基础"},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"}));function so(e,t=JSON.stringify){const i={};return e.filter(o=>{const n=t(o);return Object.prototype.hasOwnProperty.call(i,n)?!1:i[n]=!0})}function lo(e){const t=e.filter((o,n)=>e.indexOf(o)!==n);return so(t)}const G=b.Extension.create({name:"uniqueID",priority:1e4,addOptions(){return{attributeName:"id",types:[],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 Ci.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=>({[`data-${this.options.attributeName}`]:e[this.options.attributeName]})}}}]},addProseMirrorPlugins(){let e=null,t=!1;return[new _.Plugin({key:new _.PluginKey("uniqueID"),appendTransaction:(i,o,n)=>{const r=i.some(f=>f.docChanged)&&!o.doc.eq(n.doc),a=this.options.filterTransaction&&i.some(f=>{let k,w;return!(!((w=(k=this.options).filterTransaction)===null||w===void 0)&&w.call(k,f))});if(!r||a)return;const{tr:s}=n,{types:l,attributeName:c,generateID:p}=this.options,h=b.combineTransactionSteps(o.doc,i),{mapping:m}=h;if(b.getChangedRanges(h).forEach(({newRange:f})=>{const k=b.findChildrenInRange(n.doc,f,A=>l.includes(A.type.name)),w=k.map(({node:A})=>A.attrs[c]).filter(A=>A!==null),O=lo(w);k.forEach(({node:A,pos:V})=>{let ae;const wi=(ae=s.doc.nodeAt(V))===null||ae===void 0?void 0:ae.attrs[c];if(wi===null){const vi=o.doc.type.createAndFill().content;if(o.doc.content.findDiffStart(vi)===null){const xi=JSON.parse(JSON.stringify(n.doc.toJSON()));if(xi.content[0].content[0].attrs.id="initialBlockId",JSON.stringify(xi.content)===JSON.stringify(vi.toJSON())){s.setNodeMarkup(V,void 0,{...A.attrs,[c]:"initialBlockId"});return}}s.setNodeMarkup(V,void 0,{...A.attrs,[c]:p()});return}const{deleted:Wn}=m.invert().mapResult(V);Wn&&O.includes(wi)&&s.setNodeMarkup(V,void 0,{...A.attrs,[c]:p()})})}),!!s.steps.length)return s},view(i){const o=n=>{let r;e=!((r=i.dom.parentElement)===null||r===void 0)&&r.contains(n.target)?i.dom.parentElement:null};return window.addEventListener("dragstart",o),{destroy(){window.removeEventListener("dragstart",o)}}},props:{handleDOMEvents:{drop:(i,o)=>{let n;return(e!==i.dom.parentElement||((n=o.dataTransfer)===null||n===void 0?void 0:n.effectAllowed)==="copy")&&(e=null,t=!0),!1},paste:()=>(t=!0,!1)},transformPasted:i=>{if(!t)return i;const{types:o,attributeName:n}=this.options,r=a=>{const s=[];return a.forEach(l=>{if(l.isText){s.push(l);return}if(!o.includes(l.type.name)){s.push(l.copy(r(l.content)));return}const c=l.type.create({...l.attrs,[n]:null},r(l.content),l.marks);s.push(c)}),y.Fragment.from(s)};return t=!1,new y.Slice(r(i.content),i.openStart,i.openEnd)}}})]}});function Ze(e){const t=e.attrs.id,i=e.firstChild,o=i.type,n=e.childCount===2?e.lastChild.childCount:0;return{id:t,node:e,contentNode:i,contentType:o,numChildBlocks:n}}function v(e,t){const o=e.nodeSize-2;if(t<=1)for(t=1+1;e.resolve(t).parent.type.name!=="blockContainer"&&t<o;)t++;else if(t>=o)for(t=o-1;e.resolve(t).parent.type.name!=="blockContainer"&&t>1;)t--;e.resolve(t).parent.type.name==="blockGroup"&&t++;const n=e.resolve(t),r=n.depth;let a=n.node(r),s=r;for(;;){if(s<0)throw new Error("Could not find blockContainer node. This can only happen if the underlying BlockNote schema has been edited.");if(a.type.name==="blockContainer")break;s-=1,a=n.node(s)}const{id:l,contentNode:c,contentType:p,numChildBlocks:h}=Ze(a),m=n.start(s),g=n.end(s);return{id:l,node:a,contentNode:c,contentType:p,numChildBlocks:h,startPos:m,endPos:g,depth:s}}function ge(e){return e.type==="link"}function be(e){return typeof e!="string"&&e.type==="link"}function W(e){return typeof e!="string"&&e.type==="text"}class I extends Error{constructor(t){super(`Unreachable case: ${t}`)}}function co(e,t=!0){const{"data-test":i,...o}=e;if(Object.keys(o).length>0&&t)throw new Error("Object must be empty "+JSON.stringify(e))}function Je(e,t,i){const o=[];for(const[n,r]of Object.entries(e.styles)){const a=i[n];if(!a)throw new Error(`style ${n} not found in styleSchema`);if(a.propSchema==="boolean")o.push(t.mark(n));else if(a.propSchema==="string")o.push(t.mark(n,{stringValue:r}));else throw new I(a.propSchema)}return e.text.split(/(\n)/g).filter(n=>n.length>0).map(n=>n===`
|
|
2
|
-
`?t.nodes.hardBreak.create():t.text(n,o))}function
|
|
3
|
-
`;else if(
|
|
1
|
+
(function(d,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("prosemirror-model"),require("rehype-parse"),require("rehype-stringify"),require("unified"),require("@tiptap/core"),require("prosemirror-state"),require("uuid"),require("hast-util-from-dom"),require("@tiptap/extension-bold"),require("@tiptap/extension-code"),require("@tiptap/extension-italic"),require("@tiptap/extension-strike"),require("@tiptap/extension-underline"),require("@tiptap/extension-table-cell"),require("@tiptap/extension-table-header"),require("@tiptap/extension-table-row"),require("prosemirror-tables"),require("rehype-remark"),require("remark-gfm"),require("remark-stringify"),require("remark-parse"),require("remark-rehype"),require("prosemirror-view"),require("@tiptap/extension-collaboration"),require("@tiptap/extension-collaboration-cursor"),require("@tiptap/extension-dropcursor"),require("@tiptap/extension-gapcursor"),require("@tiptap/extension-hard-break"),require("@tiptap/extension-history"),require("@tiptap/extension-link"),require("@tiptap/extension-text"),require("emoji-mart")):typeof define=="function"&&define.amd?define(["exports","prosemirror-model","rehype-parse","rehype-stringify","unified","@tiptap/core","prosemirror-state","uuid","hast-util-from-dom","@tiptap/extension-bold","@tiptap/extension-code","@tiptap/extension-italic","@tiptap/extension-strike","@tiptap/extension-underline","@tiptap/extension-table-cell","@tiptap/extension-table-header","@tiptap/extension-table-row","prosemirror-tables","rehype-remark","remark-gfm","remark-stringify","remark-parse","remark-rehype","prosemirror-view","@tiptap/extension-collaboration","@tiptap/extension-collaboration-cursor","@tiptap/extension-dropcursor","@tiptap/extension-gapcursor","@tiptap/extension-hard-break","@tiptap/extension-history","@tiptap/extension-link","@tiptap/extension-text","emoji-mart"],y):(d=typeof globalThis<"u"?globalThis:d||self,y(d.blocknote={},d.prosemirrorModel,d.rehypeParse,d.rehypeStringify,d.unified,d.core,d.prosemirrorState,d.uuid,d.hastUtilFromDom,d.Bold,d.Code,d.Italic,d.Strike,d.Underline,d.extensionTableCell,d.extensionTableHeader,d.extensionTableRow,d.prosemirrorTables,d.rehypeRemark,d.remarkGfm,d.remarkStringify,d.remarkParse,d.remarkRehype,d.prosemirrorView,d.Collaboration,d.CollaborationCursor,d.extensionDropcursor,d.extensionGapcursor,d.extensionHardBreak,d.extensionHistory,d.extensionLink,d.extensionText,d.emojiMart))})(this,function(d,y,q,Ei,fe,b,_,xi,ge,Ci,Si,Ti,Mi,Bi,Li,Ii,Pi,Ke,Ai,Ni,Hi,Di,qe,M,Ui,ji,Ri,Oi,Vi,zi,Fi,Ki,Ge){"use strict";var qn=Object.defineProperty;var Gn=(d,y,q)=>y in d?qn(d,y,{enumerable:!0,configurable:!0,writable:!0,value:q}):d[y]=q;var u=(d,y,q)=>Gn(d,typeof y!="symbol"?y+"":y,q);const C=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},We=C(q),$e=C(Ei),qi=C(Ci),Gi=C(Si),Wi=C(Ti),$i=C(Mi),Xi=C(Bi),Zi=C(Ai),Xe=C(Ni),Ji=C(Hi),Yi=C(Di),Qi=C(qe),eo=C(Ui),to=C(ji),io={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:"الكتل الأساسية"},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"}},Ze={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"},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"}},oo=Object.freeze(Object.defineProperty({__proto__:null,ar:io,en:Ze,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"},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"}},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"},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:"基本ブロック"},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:"기본 블록"},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"},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"},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"},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:"Базовые блоки"},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"},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:"基础"},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"}));function no(e,t=JSON.stringify){const i={};return e.filter(o=>{const n=t(o);return Object.prototype.hasOwnProperty.call(i,n)?!1:i[n]=!0})}function ro(e){const t=e.filter((o,n)=>e.indexOf(o)!==n);return no(t)}const G=b.Extension.create({name:"uniqueID",priority:1e4,addOptions(){return{attributeName:"id",types:[],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 xi.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=>({[`data-${this.options.attributeName}`]:e[this.options.attributeName]})}}}]},addProseMirrorPlugins(){let e=null,t=!1;return[new _.Plugin({key:new _.PluginKey("uniqueID"),appendTransaction:(i,o,n)=>{const r=i.some(f=>f.docChanged)&&!o.doc.eq(n.doc),a=this.options.filterTransaction&&i.some(f=>{let k,w;return!(!((w=(k=this.options).filterTransaction)===null||w===void 0)&&w.call(k,f))});if(!r||a)return;const{tr:s}=n,{types:l,attributeName:c,generateID:p}=this.options,h=b.combineTransactionSteps(o.doc,i),{mapping:m}=h;if(b.getChangedRanges(h).forEach(({newRange:f})=>{const k=b.findChildrenInRange(n.doc,f,A=>l.includes(A.type.name)),w=k.map(({node:A})=>A.attrs[c]).filter(A=>A!==null),O=ro(w);k.forEach(({node:A,pos:V})=>{let ae;const yi=(ae=s.doc.nodeAt(V))===null||ae===void 0?void 0:ae.attrs[c];if(yi===null){const wi=o.doc.type.createAndFill().content;if(o.doc.content.findDiffStart(wi)===null){const vi=JSON.parse(JSON.stringify(n.doc.toJSON()));if(vi.content[0].content[0].attrs.id="initialBlockId",JSON.stringify(vi.content)===JSON.stringify(wi.toJSON())){s.setNodeMarkup(V,void 0,{...A.attrs,[c]:"initialBlockId"});return}}s.setNodeMarkup(V,void 0,{...A.attrs,[c]:p()});return}const{deleted:Kn}=m.invert().mapResult(V);Kn&&O.includes(yi)&&s.setNodeMarkup(V,void 0,{...A.attrs,[c]:p()})})}),!!s.steps.length)return s},view(i){const o=n=>{let r;e=!((r=i.dom.parentElement)===null||r===void 0)&&r.contains(n.target)?i.dom.parentElement:null};return window.addEventListener("dragstart",o),{destroy(){window.removeEventListener("dragstart",o)}}},props:{handleDOMEvents:{drop:(i,o)=>{let n;return(e!==i.dom.parentElement||((n=o.dataTransfer)===null||n===void 0?void 0:n.effectAllowed)==="copy")&&(e=null,t=!0),!1},paste:()=>(t=!0,!1)},transformPasted:i=>{if(!t)return i;const{types:o,attributeName:n}=this.options,r=a=>{const s=[];return a.forEach(l=>{if(l.isText){s.push(l);return}if(!o.includes(l.type.name)){s.push(l.copy(r(l.content)));return}const c=l.type.create({...l.attrs,[n]:null},r(l.content),l.marks);s.push(c)}),y.Fragment.from(s)};return t=!1,new y.Slice(r(i.content),i.openStart,i.openEnd)}}})]}});function Je(e){const t=e.attrs.id,i=e.firstChild,o=i.type,n=e.childCount===2?e.lastChild.childCount:0;return{id:t,node:e,contentNode:i,contentType:o,numChildBlocks:n}}function v(e,t){const o=e.nodeSize-2;if(t<=1)for(t=2;e.resolve(t).parent.type.name!=="blockContainer"&&t<o;)t++;else if(t>=o)for(t=o-1;e.resolve(t).parent.type.name!=="blockContainer"&&t>1;)t--;e.resolve(t).parent.type.name==="blockGroup"&&t++;const n=e.resolve(t),r=n.depth;let a=n.node(r),s=r;for(;;){if(s<0)throw new Error("Could not find blockContainer node. This can only happen if the underlying BlockNote schema has been edited.");if(a.type.name==="blockContainer")break;s-=1,a=n.node(s)}const{id:l,contentNode:c,contentType:p,numChildBlocks:h}=Je(a),m=n.start(s),g=n.end(s);return{id:l,node:a,contentNode:c,contentType:p,numChildBlocks:h,startPos:m,endPos:g,depth:s}}function be(e){return e.type==="link"}function ke(e){return typeof e!="string"&&e.type==="link"}function W(e){return typeof e!="string"&&e.type==="text"}class I extends Error{constructor(t){super(`Unreachable case: ${t}`)}}function ao(e,t=!0){const{"data-test":i,...o}=e;if(Object.keys(o).length>0&&t)throw new Error("Object must be empty "+JSON.stringify(e))}function Ye(e,t,i){const o=[];for(const[n,r]of Object.entries(e.styles)){const a=i[n];if(!a)throw new Error(`style ${n} not found in styleSchema`);if(a.propSchema==="boolean")o.push(t.mark(n));else if(a.propSchema==="string")o.push(t.mark(n,{stringValue:r}));else throw new I(a.propSchema)}return e.text.split(/(\n)/g).filter(n=>n.length>0).map(n=>n===`
|
|
2
|
+
`?t.nodes.hardBreak.create():t.text(n,o))}function so(e,t,i){const o=t.marks.link.create({href:e.href});return _e(e.content,t,i).map(n=>{if(n.type.name==="text")return n.mark([...n.marks,o]);if(n.type.name==="hardBreak")return n;throw new Error("unexpected node type")})}function _e(e,t,i){const o=[];if(typeof e=="string")return o.push(...Ye({type:"text",text:e,styles:{}},t,i)),o;for(const n of e)o.push(...Ye(n,t,i));return o}function z(e,t,i){const o=[];for(const n of e)typeof n=="string"?o.push(..._e(n,t,i)):ke(n)?o.push(...so(n,t,i)):W(n)?o.push(..._e([n],t,i)):o.push(Qe(n,t,i));return o}function ye(e,t,i){const o=[];for(const n of e.rows){const r=[];for(const s of n.cells){let l;if(!s)l=t.nodes.tableParagraph.create({});else if(typeof s=="string")l=t.nodes.tableParagraph.create({},t.text(s));else{const p=z(s,t,i);l=t.nodes.tableParagraph.create({},p)}const c=t.nodes.tableCell.create({},l);r.push(c)}const a=t.nodes.tableRow.create({},r);o.push(a)}return o}function Qe(e,t,i){let o,n=e.type;if(n===void 0&&(n="paragraph"),!t.nodes[n])throw new Error(`node type ${n} not found in schema`);if(!e.content)o=t.nodes[n].create(e.props);else if(typeof e.content=="string"){const r=z([e.content],t,i);o=t.nodes[n].create(e.props,r)}else if(Array.isArray(e.content)){const r=z(e.content,t,i);o=t.nodes[n].create(e.props,r)}else if(e.content.type==="tableContent"){const r=ye(e.content,t,i);o=t.nodes[n].create(e.props,r)}else throw new I(e.content.type);return o}function N(e,t,i){let o=e.id;o===void 0&&(o=G.options.generateID());const n=Qe(e,t,i),r=[];if(e.children)for(const s of e.children)r.push(N(s,t,i));const a=t.nodes.blockGroup.create({},r);return t.nodes.blockContainer.create({id:o,...e.props},r.length>0?[n,a]:n)}function lo(e,t,i){const o={type:"tableContent",rows:[]};return e.content.forEach(n=>{const r={cells:[]};n.content.forEach(a=>{r.cells.push(se(a.firstChild,t,i))}),o.rows.push(r)}),o}function se(e,t,i){const o=[];let n;return e.content.forEach(r=>{if(r.type.name==="hardBreak"){if(n)if(W(n))n.text+=`
|
|
3
|
+
`;else if(be(n))n.content[n.content.length-1].text+=`
|
|
4
4
|
`;else throw new Error("unexpected");else n={type:"text",text:`
|
|
5
|
-
`,styles:{}};return}if(r.type.name!=="link"&&r.type.name!=="text"&&t[r.type.name]){n&&(o.push(n),n=void 0),o.push(ye(r,t,i));return}const a={};let s;for(const l of r.marks)if(l.type.name==="link")s=l;else{const c=i[l.type.name];if(!c)throw new Error(`style ${l.type.name} not found in styleSchema`);if(c.propSchema==="boolean")a[c.type]=!0;else if(c.propSchema==="string")a[c.type]=l.attrs.stringValue;else throw new I(c.propSchema)}n?W(n)?s?(o.push(n),n={type:"link",href:s.attrs.href,content:[{type:"text",text:r.textContent,styles:a}]}):JSON.stringify(n.styles)===JSON.stringify(a)?n.text+=r.textContent:(o.push(n),n={type:"text",text:r.textContent,styles:a}):ge(n)&&(s?n.href===s.attrs.href?JSON.stringify(n.content[n.content.length-1].styles)===JSON.stringify(a)?n.content[n.content.length-1].text+=r.textContent:n.content.push({type:"text",text:r.textContent,styles:a}):(o.push(n),n={type:"link",href:s.attrs.href,content:[{type:"text",text:r.textContent,styles:a}]}):(o.push(n),n={type:"text",text:r.textContent,styles:a})):s?n={type:"link",href:s.attrs.href,content:[{type:"text",text:r.textContent,styles:a}]}:n={type:"text",text:r.textContent,styles:a}}),n&&o.push(n),o}function ye(e,t,i){if(e.type.name==="text"||e.type.name==="link")throw new Error("unexpected");const o={},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&&(o[s]=l)}let r;return n.content==="styled"?r=se(e,t,i):r=void 0,{type:e.type.name,props:o,content:r}}function C(e,t,i,o,n){if(e.type.name!=="blockContainer")throw Error("Node must be of type blockContainer, but is of type"+e.type.name+".");const r=n==null?void 0:n.get(e);if(r)return r;const a=Ze(e);let s=a.id;s===null&&(s=G.options.generateID());const l={};for(const[g,f]of Object.entries({...e.attrs,...a.contentNode.attrs})){const k=t[a.contentType.name];if(!k)throw Error("Block is of an unrecognized type: "+a.contentType.name);const w=k.propSchema;g in w&&(l[g]=f)}const c=t[a.contentType.name],p=[];for(let g=0;g<a.numChildBlocks;g++)p.push(C(e.lastChild.child(g),t,i,o,n));let h;if(c.content==="inline")h=se(a.contentNode,i,o);else if(c.content==="table")h=po(a.contentNode,i,o);else if(c.content==="none")h=void 0;else throw new I(c.content);const m={id:s,type:c.type,props:l,content:h,children:p};return n==null||n.set(e,m),m}function ho(e){return e.document||window.document}const Qe=(e,t,i,o,n)=>{if(!i.nodes[e.type.name])throw new Error("Serializer is missing a node type: "+e.type.name);const{dom:r,contentDOM:a}=y.DOMSerializer.renderSpec(ho(t),i.nodes[e.type.name](e));if(a){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");if(e.type.name==="blockContainer"){const s=e.childCount>0&&e.firstChild.type.spec.group==="blockContent"?e.firstChild:void 0,l=e.childCount>0&&e.lastChild.type.spec.group==="blockGroup"?e.lastChild:void 0;if(s!==void 0){const c=o.blockImplementations[s.type.name].implementation,h=(n?c.toExternalHTML:c.toInternalHTML)(C(e,o.schema.blockSchema,o.schema.inlineContentSchema,o.schema.styleSchema,o.blockCache),o);if(h.contentDOM!==void 0){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");h.contentDOM.appendChild(i.serializeFragment(s.content,t))}a.appendChild(h.dom)}l!==void 0&&i.serializeFragment(y.Fragment.from(l),t,a)}else i.serializeFragment(e.content,t,a)}return r},et=(e,t,i)=>{const o=t.serializeFragment(e,i),n=document.createElement("div");return n.appendChild(o),n.innerHTML};function mo(e){const t=new Set([...e.orderedListItemBlockTypes,...e.unorderedListItemBlockTypes]),i=o=>{var a;if(o.children.length===1&&((a=o.children[0].properties)==null?void 0:a.dataNodeType)==="blockGroup"){const s=o.children[0];o.children.pop(),o.children.push(...s.children)}let n=o.children.length,r;for(let s=0;s<n;s++){const c=o.children[s].children[0],p=c.children.find(f=>{const k=f.properties,w=k==null?void 0:k.className;return w==null?void 0:w.includes("bn-block-content")}),h=c.children.find(f=>{const k=f.properties,w=k==null?void 0:k.className;return w==null?void 0:w.includes("bn-block-group")});if(!p){o.children.splice(s,1,...h.children),i(o);return}const m=t.has(p.properties.dataContentType),g=m?e.orderedListItemBlockTypes.has(p.properties.dataContentType)?"ol":"ul":null;if(h&&i(h),r&&r.tagName!==g){o.children.splice(s-r.children.length,r.children.length,r);const f=r.children.length-1;s-=f,n-=f,r=void 0}if(m){r||(r=fe.fromDom(document.createElement(g)));const f=fe.fromDom(document.createElement("li"));f.children.push(...p.children),h&&f.children.push(...h.children),r.children.push(f)}else if(h){o.children.splice(s+1,0,...h.children),o.children[s]=p.children[0];const f=h.children.length;s+=f,n+=f}else o.children[s]=p.children[0]}r&&o.children.splice(n-r.children.length,r.children.length,r)};return i}const Y=(e,t)=>{const i=y.DOMSerializer.fromSchema(e);return i.serializeNodeInner=(o,n)=>Qe(o,n,i,t,!0),i.exportProseMirrorFragment=(o,n)=>me.unified().use(Ge.default,{fragment:!0}).use(mo,{orderedListItemBlockTypes:new Set(["numberedListItem"]),unorderedListItemBlockTypes:new Set(["bulletListItem","checkListItem"])}).use(We.default).processSync(et(o,i,n)).value,i.exportBlocks=(o,n)=>{const r=o.map(s=>N(s,e,t.schema.styleSchema)),a=e.nodes.blockGroup.create(null,r);return i.exportProseMirrorFragment(y.Fragment.from(a),n)},i},le=(e,t)=>{const i=y.DOMSerializer.fromSchema(e);return i.serializeNodeInner=(o,n)=>Qe(o,n,i,t,!1),i.serializeProseMirrorFragment=(o,n)=>et(o,i,n),i.serializeBlocks=(o,n)=>{const r=o.map(s=>N(s,e,t.schema.styleSchema)),a=e.nodes.blockGroup.create(null,r);return i.serializeProseMirrorFragment(y.Fragment.from(a),n)},i},tt=()=>typeof navigator<"u"&&(/Mac/.test(navigator.platform)||/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent));function H(e,t="Ctrl"){return tt()?e.replace("Mod","⌘"):e.replace("Mod",t)}function D(...e){return e.filter(t=>t).join(" ")}const fo=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function K(e,t,i,o){const n=document.createElement("div");n.className=D("bn-block-content",i.class),n.setAttribute("data-content-type",e);for(const[a,s]of Object.entries(i))a!=="class"&&n.setAttribute(a,s);const r=document.createElement(t);r.className=D("bn-inline-content",o.class);for(const[a,s]of Object.entries(o))a!=="class"&&r.setAttribute(a,s);return n.appendChild(r),{dom:n,contentDOM:r}}const it=(e,t)=>{const i=N(e,t.pmSchema,t.schema.styleSchema).firstChild,o=t.pmSchema.nodes[i.type.name].spec.toDOM;if(o===void 0)throw new Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");const n=o(i);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},x={backgroundColor:{default:"default"},textColor:{default:"default"},textAlignment:{default:"left",values:["left","center","right","justify"]}},we=["backgroundColor","textColor"];function Q(e){return"data-"+e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function go(e){const t=e.split("/");return!t.length||t[t.length-1]===""?e:t[t.length-1]}function ve(e){const t={};return Object.entries(e).filter(([i,o])=>!we.includes(i)).forEach(([i,o])=>{t[i]={default:o.default,keepOnSplit:!0,parseHTML:n=>{const r=n.getAttribute(Q(i));if(r===null)return null;if(typeof o.default=="boolean")return r==="true"?!0:r==="false"?!1:null;if(typeof o.default=="number"){const a=parseFloat(r);return!Number.isNaN(a)&&Number.isFinite(a)?a:null}return r},renderHTML:n=>n[i]!==o.default?{[Q(i)]:n[i]}:{}}}),t}function ot(e,t,i,o){if(typeof e=="boolean")throw new Error("Cannot find node position as getPos is a boolean, not a function.");const n=e(),a=i.state.doc.resolve(n).node().attrs.id;if(!a)throw new Error("Block doesn't have id");const s=t.getBlock(a);if(s.type!==o)throw new Error("Block type does not match");return s}function de(e,t,i,o,n=!1,r){const a=document.createElement("div");if(r!==void 0)for(const[s,l]of Object.entries(r))s!=="class"&&a.setAttribute(s,l);a.className=D("bn-block-content",(r==null?void 0:r.class)||""),a.setAttribute("data-content-type",t);for(const[s,l]of Object.entries(i))!we.includes(s)&&l!==o[s].default&&a.setAttribute(Q(s),l);return n&&a.setAttribute("data-file-block",""),a.appendChild(e.dom),e.contentDOM!==void 0&&(e.contentDOM.className=D("bn-inline-content",e.contentDOM.className),e.contentDOM.setAttribute("data-editable","")),{...e,dom:a}}function U(e){return b.Node.create(e)}function xe(e,t){return{config:e,implementation:t}}function q(e,t,i){return xe({type:e.name,content:e.config.content==="inline*"?"inline":e.config.content==="tableRow+"?"table":"none",propSchema:t},{node:e,requiredExtensions:i,toInternalHTML:it,toExternalHTML:it})}function Ee(e){return Object.fromEntries(Object.entries(e).map(([t,i])=>[t,i.config]))}function nt(e,t){const i=[{tag:"[data-content-type="+e.type+"]",contentElement:"[data-editable]"}];return t&&i.push({tag:"*",getAttrs(o){if(typeof o=="string")return!1;const n=t==null?void 0:t(o);return n===void 0?!1:n}}),i}function ee(e,t){const i=U({name:e.type,content:e.content==="inline"?"inline*":"",group:"blockContent",selectable:!0,addAttributes(){return ve(e.propSchema)},parseHTML(){return nt(e,t.parse)},renderHTML(){const o=document.createElement("div");return o.setAttribute("data-tmp-placeholder","true"),{dom:o}},addNodeView(){return({getPos:o})=>{var l;const n=this.options.editor,r=ot(o,n,this.editor,e.type),a=((l=this.options.domAttributes)==null?void 0:l.blockContent)||{},s=t.render(r,n);return de(s,r.type,r.props,e.propSchema,a)}}});if(i.name!==e.type)throw new Error("Node name does not match block type. This is a bug in BlockNote.");return xe(e,{node:i,toInternalHTML:(o,n)=>{var s;const r=((s=i.options.domAttributes)==null?void 0:s.blockContent)||{},a=t.render(o,n);return de(a,o.type,o.props,e.propSchema,e.isFileBlock,r)},toExternalHTML:(o,n)=>{var s,l;const r=((s=i.options.domAttributes)==null?void 0:s.blockContent)||{};let a=(l=t.toExternalHTML)==null?void 0:l.call(t,o,n);return a===void 0&&(a=t.render(o,n)),de(a,o.type,o.props,e.propSchema,r)}})}function rt(e,t,i,o){return e.dom.setAttribute("data-inline-content-type",t),Object.entries(i).filter(([n,r])=>r!==o[n].default).map(([n,r])=>[Q(n),r]).forEach(([n,r])=>e.dom.setAttribute(n,r)),e.contentDOM!==void 0&&e.contentDOM.setAttribute("data-editable",""),e}function at(e){return{Backspace:({editor:t})=>{const i=t.state.selection.$from;return t.state.selection.empty&&i.node().type.name===e.type&&i.parentOffset===0}}}function st(e,t){return{config:e,implementation:t}}function lt(e,t){return st({type:e.name,propSchema:t,content:e.config.content==="inline*"?"styled":"none"},{node:e})}function Ce(e){return Object.fromEntries(Object.entries(e).map(([t,i])=>[t,i.config]))}function dt(e){return[{tag:`[data-inline-content-type="${e.type}"]`,contentElement:t=>{const i=t;return i.matches("[data-editable]")?i:i.querySelector("[data-editable]")||i}}]}function bo(e,t){const i=b.Node.create({name:e.type,inline:!0,group:"inline",selectable:e.content==="styled",atom:e.content==="none",content:e.content==="styled"?"inline*":"",addAttributes(){return ve(e.propSchema)},addKeyboardShortcuts(){return at(e)},parseHTML(){return dt(e)},renderHTML({node:o}){const n=this.options.editor,r=t.render(ye(o,n.schema.inlineContentSchema,n.schema.styleSchema));return rt(r,e.type,o.attrs,e.propSchema)}});return lt(i,e.propSchema)}function ct(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 ut(e,t,i,o){return e.dom.setAttribute("data-style-type",t),o==="string"&&e.dom.setAttribute("data-value",i),e.contentDOM!==void 0&&e.contentDOM.setAttribute("data-editable",""),e}function Se(e,t){return{config:e,implementation:t}}function j(e,t){return Se({type:e.name,propSchema:t},{mark:e})}function Te(e){return Object.fromEntries(Object.entries(e).map(([t,i])=>[t,i.config]))}function pt(e){return[{tag:`[data-style-type="${e.type}"]`,contentElement:t=>{const i=t;return i.matches("[data-editable]")?i:i.querySelector("[data-editable]")||i}}]}function ko(e,t){const i=b.Mark.create({name:e.type,addAttributes(){return ct(e.propSchema)},parseHTML(){return pt(e)},renderHTML({mark:o}){let n;if(e.propSchema==="boolean")n=t.render();else if(e.propSchema==="string")n=t.render(o.attrs.stringValue);else throw new I(e.propSchema);return ut(n,e.type,o.attrs.stringValue,e.propSchema)}});return Se(e,{mark:i})}const te=e=>{const t=document.createElement("div");t.className="bn-file-default-preview";const i=document.createElement("div");i.className="bn-file-default-preview-icon",i.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>';const o=document.createElement("p");return o.className="bn-file-default-preview-name",o.textContent=e.props.name||"",t.appendChild(i),t.appendChild(o),{dom:t}},R=(e,t)=>{const i=document.createElement("div");i.className="bn-file-and-caption-wrapper";const o=document.createElement("p");return o.className="bn-file-caption",o.textContent=e.props.caption,i.appendChild(t),i.appendChild(o),{dom:i}},ie=(e,t,i,o)=>{const n=document.createElement("div");n.className="bn-add-file-button";const r=document.createElement("div");r.className="bn-add-file-button-icon",o?r.appendChild(o):r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>';const a=document.createElement("p");a.className="bn-add-file-button-text",a.innerHTML=i||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(r),n.appendChild(a),n.addEventListener("mousedown",s,!0),n.addEventListener("click",l,!0),{dom:n,destroy:()=>{n.removeEventListener("mousedown",s,!0),n.removeEventListener("click",l,!0)}}},Me=e=>({url:e.src||void 0}),oe=(e,t)=>{const i=e.querySelector(t);if(!i)return;const o=e.querySelector("figcaption"),n=(o==null?void 0:o.textContent)??void 0;return{targetElement:i,caption:n}},ne=(e,t)=>{const i=document.createElement("div"),o=document.createElement("p");return o.textContent=t,i.appendChild(e),i.appendChild(o),{dom:i}},ce=(e,t)=>{const i=document.createElement("figure"),o=document.createElement("figcaption");return o.textContent=t,i.appendChild(e),i.appendChild(o),{dom:i}},Be=(e,t,i,o,n)=>{if(!e.props.previewWidth)throw new Error("Block must have a `previewWidth` prop.");const r=document.createElement("div");r.className="bn-visual-media-wrapper";const a=document.createElement("div");a.className="bn-visual-media-resize-handle",a.style.left="4px";const s=document.createElement("div");s.className="bn-visual-media-resize-handle",s.style.right="4px";let l;const c=k=>{if(!l){!t.isEditable&&r.contains(a)&&r.contains(s)&&(r.removeChild(a),r.removeChild(s));return}let w;e.props.textAlignment==="center"?l.handleUsed==="left"?w=l.initialWidth+(l.initialClientX-k.clientX)*2:w=l.initialWidth+(k.clientX-l.initialClientX)*2:l.handleUsed==="left"?w=l.initialWidth+l.initialClientX-k.clientX:w=l.initialWidth+k.clientX-l.initialClientX;const O=64;w<O?n(O):w>t.domElement.firstElementChild.clientWidth?n(t.domElement.firstElementChild.clientWidth):n(w)},p=k=>{(!k.target||!r.contains(k.target)||!t.isEditable)&&r.contains(a)&&r.contains(s)&&(r.removeChild(a),r.removeChild(s)),l&&(l=void 0,t.updateBlock(e,{props:{previewWidth:o()}}))},h=()=>{t.isEditable&&(r.appendChild(a),r.appendChild(s))},m=k=>{k.relatedTarget===a||k.relatedTarget===s||l||t.isEditable&&r.contains(a)&&r.contains(s)&&(r.removeChild(a),r.removeChild(s))},g=k=>{k.preventDefault(),r.appendChild(a),r.appendChild(s),l={handleUsed:"left",initialWidth:e.props.previewWidth,initialClientX:k.clientX}},f=k=>{k.preventDefault(),r.appendChild(a),r.appendChild(s),l={handleUsed:"right",initialWidth:e.props.previewWidth,initialClientX:k.clientX}};return r.appendChild(i),window.addEventListener("mousemove",c),window.addEventListener("mouseup",p),i.addEventListener("mouseenter",h),i.addEventListener("mouseleave",m),a.addEventListener("mousedown",g),s.addEventListener("mousedown",f),{dom:r,destroy:()=>{window.removeEventListener("mousemove",c),window.removeEventListener("mouseup",p),i.removeEventListener("mouseenter",h),i.removeEventListener("mouseleave",m),a.removeEventListener("mousedown",g),s.removeEventListener("mousedown",f)}}},ht=e=>({url:e.src||void 0}),mt={backgroundColor:x.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0}},ft={type:"audio",propSchema:mt,content:"none",isFileBlock:!0,fileBlockAcceptMimeTypes:["audio/*"]},gt=(e,t)=>{const i=document.createElement("div");if(i.className="bn-file-block-content-wrapper",e.props.url===""){const o=document.createElement("div");o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"></path></svg>';const n=ie(e,t,t.dictionary.file_blocks.audio.add_button_text,o.firstElementChild);return i.appendChild(n.dom),{dom:i,destroy:()=>{var r;(r=n==null?void 0:n.destroy)==null||r.call(n)}}}else if(e.props.showPreview){const o=document.createElement("audio");o.className="bn-audio",t.resolveFileUrl(e.props.url).then(r=>{o.src=r}),o.controls=!0,o.contentEditable="false",o.draggable=!1;const n=R(e,o);return i.appendChild(n.dom),{dom:i}}else{const o=te(e).dom;return{dom:R(e,o).dom}}},bt=e=>{if(e.tagName==="AUDIO")return ht(e);if(e.tagName==="FIGURE"){const t=oe(e,"audio");if(!t)return;const{targetElement:i,caption:o}=t;return{...ht(i),caption:o}}},kt=e=>{if(!e.props.url){const i=document.createElement("p");return i.textContent="Add audio",{dom:i}}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?ce(t,e.props.caption):ne(t,e.props.caption):{dom:t}},_t=ee(ft,{render:gt,parse:bt,toExternalHTML:kt}),yt={backgroundColor:x.backgroundColor,name:{default:""},url:{default:""},caption:{default:""}},wt={type:"file",propSchema:yt,content:"none",isFileBlock:!0},vt=(e,t)=>{const i=document.createElement("div");if(i.className="bn-file-block-content-wrapper",e.props.url===""){const o=ie(e,t);return i.appendChild(o.dom),{dom:i,destroy:o.destroy}}else{const o=te(e).dom,n=R(e,o);return i.appendChild(n.dom),{dom:i}}},xt=e=>{if(e.tagName==="EMBED")return Me(e);if(e.tagName==="FIGURE"){const t=oe(e,"embed");if(!t)return;const{targetElement:i,caption:o}=t;return{...Me(i),caption:o}}},Et=e=>{if(!e.props.url){const i=document.createElement("p");return i.textContent="Add file",{dom:i}}const t=document.createElement("a");return t.href=e.props.url,t.textContent=e.props.name||e.props.url,e.props.caption?ne(t,e.props.caption):{dom:t}},Ct=ee(wt,{render:vt,parse:xt,toExternalHTML:Et}),Le=e=>{const t=e.src||void 0,i=e.width||void 0;return{url:t,previewWidth:i}},St={textAlignment:x.textAlignment,backgroundColor:x.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0},previewWidth:{default:512}},Tt={type:"image",propSchema:St,content:"none",isFileBlock:!0,fileBlockAcceptMimeTypes:["image/*"]},Mt=(e,t)=>{const i=document.createElement("div");if(i.className="bn-file-block-content-wrapper",e.props.url===""){const o=document.createElement("div");o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z"></path></svg>';const n=ie(e,t,t.dictionary.file_blocks.image.add_button_text,o.firstElementChild);return i.appendChild(n.dom),{dom:i,destroy:()=>{var r;(r=n==null?void 0:n.destroy)==null||r.call(n)}}}else if(e.props.showPreview){const o=document.createElement("img");o.className="bn-visual-media",t.resolveFileUrl(e.props.url).then(a=>{o.src=a}),o.alt=e.props.name||e.props.caption||"BlockNote image",o.contentEditable="false",o.draggable=!1,o.width=Math.min(e.props.previewWidth,t.domElement.firstElementChild.clientWidth);const n=Be(e,t,o,()=>o.width,a=>o.width=a),r=R(e,n.dom);return i.appendChild(r.dom),{dom:i,destroy:n.destroy}}else{const o=te(e).dom;return{dom:R(e,o).dom}}},Bt=e=>{if(e.tagName==="IMG")return Le(e);if(e.tagName==="FIGURE"){const t=oe(e,"img");if(!t)return;const{targetElement:i,caption:o}=t;return{...Le(i),caption:o}}},Lt=e=>{if(!e.props.url){const i=document.createElement("p");return i.textContent="Add image",{dom:i}}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?ce(t,e.props.caption):ne(t,e.props.caption):{dom:t}},It=ee(Tt,{render:Mt,parse:Bt,toExternalHTML:Lt}),Pt=e=>{const t=e.src||void 0,i=e.width||void 0;return{url:t,previewWidth:i}},At={textAlignment:x.textAlignment,backgroundColor:x.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0},previewWidth:{default:512}},Nt={type:"video",propSchema:At,content:"none",isFileBlock:!0,fileBlockAcceptMimeTypes:["video/*"]},Ht=(e,t)=>{const i=document.createElement("div");if(i.className="bn-file-block-content-wrapper",e.props.url===""){const o=document.createElement("div");o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z"></path></svg>';const n=ie(e,t,t.dictionary.file_blocks.video.add_button_text,o.firstElementChild);return i.appendChild(n.dom),{dom:i,destroy:()=>{var r;(r=n==null?void 0:n.destroy)==null||r.call(n)}}}else if(e.props.showPreview){const o=document.createElement("video");o.className="bn-visual-media",o.src=e.props.url,o.controls=!0,o.contentEditable="false",o.draggable=!1,o.width=Math.min(e.props.previewWidth,t.domElement.firstElementChild.clientWidth);const n=Be(e,t,o,()=>o.width,a=>o.width=a),r=R(e,n.dom);return i.appendChild(r.dom),{dom:i,destroy:n.destroy}}else{const o=te(e).dom;return{dom:R(e,o).dom}}},Dt=e=>{if(e.tagName==="VIDEO")return Pt(e);if(e.tagName==="FIGURE"){const t=oe(e,"video");if(!t)return;const{targetElement:i,caption:o}=t;return{...Pt(i),caption:o}}},Ut=e=>{if(!e.props.url){const i=document.createElement("p");return i.textContent="Add video",{dom:i}}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?ce(t,e.props.caption):ne(t,e.props.caption):{dom:t}},jt=ee(Nt,{render:Ht,parse:Dt,toExternalHTML:Ut}),_o=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/")},yo=b.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]}}),wo=j(yo,"string"),vo=b.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]}}),xo=j(vo,"string"),L=e=>{const{contentType:t}=v(e.state.doc,e.state.selection.from);return t.spec.content},Eo={...x,level:{default:1,values:[1,2,3]}},Co=U({name:"heading",content:"inline*",group:"blockContent",addAttributes(){return{level:{default:1,parseHTML:e=>{const t=e.getAttribute("data-level"),i=parseInt(t);if(isFinite(i))return i},renderHTML:e=>({"data-level":e.level.toString()})}}},addInputRules(){return[...[1,2,3].map(e=>new b.InputRule({find:new RegExp(`^(#{${e}})\\s$`),handler:({state:t,chain:i,range:o})=>{L(this.editor)==="inline*"&&i().BNUpdateBlock(t.selection.from,{type:"heading",props:{level:e}}).deleteRange({from:o.from,to:o.to})}}))]},addKeyboardShortcuts(){return{"Mod-Alt-1":()=>L(this.editor)!=="inline*"?!0:this.editor.commands.BNUpdateBlock(this.editor.state.selection.anchor,{type:"heading",props:{level:1}}),"Mod-Alt-2":()=>L(this.editor)!=="inline*"?!0:this.editor.commands.BNUpdateBlock(this.editor.state.selection.anchor,{type:"heading",props:{level:2}}),"Mod-Alt-3":()=>L(this.editor)!=="inline*"?!0:this.editor.commands.BNUpdateBlock(this.editor.state.selection.anchor,{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 i,o;return K(this.name,`h${e.attrs.level}`,{...((i=this.options.domAttributes)==null?void 0:i.blockContent)||{},...t},((o=this.options.domAttributes)==null?void 0:o.inlineContent)||{})}}),So=q(Co,Eo),Ie=e=>{const{contentNode:t,contentType:i}=v(e.state.doc,e.state.selection.from),o=e.state.selection.anchor===e.state.selection.head;return!(i.name==="bulletListItem"||i.name==="numberedListItem"||i.name==="checkListItem")||!o?!1:e.commands.first(({state:n,chain:r,commands:a})=>[()=>a.command(()=>t.childCount===0?a.BNUpdateBlock(n.selection.from,{type:"paragraph",props:{}}):!1),()=>a.command(()=>t.childCount>0?(r().deleteSelection().BNSplitBlock(n.selection.from,!0).run(),!0):!1)])},To={...x},Mo=U({name:"bulletListItem",content:"inline*",group:"blockContent",priority:90,addInputRules(){return[new b.InputRule({find:new RegExp("^[-+*]\\s$"),handler:({state:e,chain:t,range:i})=>{L(this.editor)==="inline*"&&t().BNUpdateBlock(e.selection.from,{type:"bulletListItem",props:{}}).deleteRange({from:i.from,to:i.to})}})]},addKeyboardShortcuts(){return{Enter:()=>Ie(this.editor),"Mod-Shift-8":()=>L(this.editor)!=="inline*"?!0:this.editor.commands.BNUpdateBlock(this.editor.state.selection.anchor,{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,i;return K(this.name,"p",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((i=this.options.domAttributes)==null?void 0:i.inlineContent)||{})}}),Bo=q(Mo,To),Lo=new _.PluginKey("numbered-list-indexing"),Io=()=>new _.Plugin({key:Lo,appendTransaction:(e,t,i)=>{const o=i.tr;o.setMeta("numberedListIndexing",!0);let n=!1;return i.doc.descendants((r,a)=>{if(r.type.name==="blockContainer"&&r.firstChild.type.name==="numberedListItem"){let s="1";const l=a===1,c=v(o.doc,a+1);if(c===void 0)return;if(!l){const m=v(o.doc,a-2);if(m===void 0)return;if(!(c.depth!==m.depth)){const f=m.contentNode;if(m.contentType.name==="numberedListItem"){const O=f.attrs.index;s=(parseInt(O)+1).toString()}}}c.contentNode.attrs.index!==s&&(n=!0,o.setNodeMarkup(a+1,void 0,{index:s}))}}),n?o:null}}),Po={...x},Ao=U({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 b.InputRule({find:new RegExp("^1\\.\\s$"),handler:({state:e,chain:t,range:i})=>{L(this.editor)==="inline*"&&t().BNUpdateBlock(e.selection.from,{type:"numberedListItem",props:{}}).deleteRange({from:i.from,to:i.to})}})]},addKeyboardShortcuts(){return{Enter:()=>Ie(this.editor),"Mod-Shift-7":()=>L(this.editor)!=="inline*"?!0:this.editor.commands.BNUpdateBlock(this.editor.state.selection.anchor,{type:"numberedListItem",props:{}})}},addProseMirrorPlugins(){return[Io()]},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,i;return K(this.name,"p",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((i=this.options.domAttributes)==null?void 0:i.inlineContent)||{})}}),No=q(Ao,Po),Ho={...x,checked:{default:!1}},Do=U({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 b.InputRule({find:new RegExp("\\[\\s*\\]\\s$"),handler:({state:e,chain:t,range:i})=>{L(this.editor)==="inline*"&&t().BNUpdateBlock(e.selection.from,{type:"checkListItem",props:{checked:!1}}).deleteRange({from:i.from,to:i.to})}}),new b.InputRule({find:new RegExp("\\[[Xx]\\]\\s$"),handler:({state:e,chain:t,range:i})=>{L(this.editor)==="inline*"&&t().BNUpdateBlock(e.selection.from,{type:"checkListItem",props:{checked:!0}}).deleteRange({from:i.from,to:i.to})}})]},addKeyboardShortcuts(){return{Enter:()=>Ie(this.editor),"Mod-Shift-9":()=>L(this.editor)!=="inline*"?!0:this.editor.commands.BNUpdateBlock(this.editor.state.selection.anchor,{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 i=e.querySelector("input[type=checkbox]")||null;return i===null?!1:{checked:i.checked}}return!1},node:"checkListItem"}]},renderHTML({node:e,HTMLAttributes:t}){var r,a;const i=document.createElement("input");i.type="checkbox",i.checked=e.attrs.checked,e.attrs.checked&&i.setAttribute("checked","");const{dom:o,contentDOM:n}=K(this.name,"p",{...((r=this.options.domAttributes)==null?void 0:r.blockContent)||{},...t},((a=this.options.domAttributes)==null?void 0:a.inlineContent)||{});return o.insertBefore(i,n),{dom:o,contentDOM:n}},addNodeView(){return({node:e,getPos:t,editor:i,HTMLAttributes:o})=>{var p,h;const n=document.createElement("div"),r=document.createElement("div");r.contentEditable="false";const a=document.createElement("input");a.type="checkbox",a.checked=e.attrs.checked,e.attrs.checked&&a.setAttribute("checked","");const s=()=>{if(!i.isEditable){a.checked=!a.checked;return}typeof t!="boolean"&&this.editor.commands.BNUpdateBlock(t(),{type:"checkListItem",props:{checked:a.checked}})};a.addEventListener("change",s);const{dom:l,contentDOM:c}=K(this.name,"p",{...((p=this.options.domAttributes)==null?void 0:p.blockContent)||{},...o},((h=this.options.domAttributes)==null?void 0:h.inlineContent)||{});if(typeof t!="boolean"){const g="label-"+this.editor.state.doc.resolve(t()).node().attrs.id;a.setAttribute("aria-labelledby",g),c.id=g}return l.removeChild(c),l.appendChild(n),n.appendChild(r),n.appendChild(c),r.appendChild(a),{dom:l,contentDOM:c,destroy:()=>{a.removeEventListener("change",s)}}}}}),Uo=q(Do,Ho),jo={...x},Ro=U({name:"paragraph",content:"inline*",group:"blockContent",addKeyboardShortcuts(){return{"Mod-Alt-0":()=>L(this.editor)!=="inline*"?!0:this.editor.commands.BNUpdateBlock(this.editor.state.selection.anchor,{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,i;return K(this.name,"p",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((i=this.options.domAttributes)==null?void 0:i.inlineContent)||{})}}),Oo=q(Ro,jo),Vo=b.Extension.create({name:"BlockNoteTableExtension",addProseMirrorPlugins:()=>[Fe.columnResizing({cellMinWidth:100}),Fe.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,i=e.$head.parentOffset===0,o=e.$head.node().type.name==="tableParagraph";return t&&i&&o}}},extendNodeSchema(e){const t={name:e.name,options:e.options,storage:e.storage};return{tableRole:b.callOrReturn(b.getExtensionField(e,"tableRole",t))}}}),zo={...x},Fo=U({name:"table",content:"tableRow+",group:"blockContent",tableRole:"table",isolating:!0,parseHTML(){return[{tag:"table"}]},renderHTML({HTMLAttributes:e}){var t,i;return K(this.name,"table",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((i=this.options.domAttributes)==null?void 0:i.inlineContent)||{})}}),Ko=b.Node.create({name:"tableParagraph",group:"tableContent",content:"inline*",parseHTML(){return[{tag:"td"},{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",b.mergeAttributes(this.options.HTMLAttributes,e),0]}}),qo=q(Fo,zo,[Vo,Ko,Pi.TableHeader.extend({content:"tableContent"}),Ii.TableCell.extend({content:"tableContent"}),Ai.TableRow]),Pe={paragraph:Oo,heading:So,bulletListItem:Bo,numberedListItem:No,checkListItem:Uo,table:qo,file:Ct,image:It,video:jt,audio:_t},Rt=Ee(Pe),Ae={bold:j(Wi.default,"boolean"),italic:j(Xi.default,"boolean"),underline:j(Ji.default,"boolean"),strike:j(Zi.default,"boolean"),code:j($i.default,"boolean"),textColor:xo,backgroundColor:wo},Go=Te(Ae),Ne={text:{config:"text",implementation:{}},link:{config:"link",implementation:{}}},Ot=Ce(Ne);function B(e,t){return e in t.schema.blockSchema&&t.schema.blockSchema[e]===Rt[e]}function Vt(e,t){return e in t.schema.inlineContentSchema&&t.schema.inlineContentSchema[e]===Ot[e]}function zt(e,t,i){return t.type===e&&t.type in i.schema.blockSchema&&B(t.type,i)}function Wo(e,t){return e.type in t.schema.blockSchema&&t.schema.blockSchema[e.type].isFileBlock||!1}function $o(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 Xo(e,t){return t.schema.blockSchema[e.type].isFileBlock&&!e.props.url}function Ft(e,t,i){return t in i.schema.blockSchema&&e in i.schema.blockSchema[t].propSchema&&i.schema.blockSchema[t].propSchema[e]===x[e]}function Zo(e,t,i){return Ft(e,t.type,i)}function He(e,t){let i,o;if(t.firstChild.descendants((n,r)=>i?!1:n.type.name!=="blockContainer"||n.attrs.id!==e?!0:(i=n,o=r+1,!1)),i===void 0||o===void 0)throw Error("Could not find block in the editor with matching ID.");return{node:i,posBeforeNode:o}}function Jo(e,t,i="before",o){const n=typeof t=="string"?t:t.id,r=[];for(const c of e)r.push(N(c,o.pmSchema,o.schema.styleSchema));const{node:a,posBeforeNode:s}=He(n,o._tiptapEditor.state.doc);if(i==="before"&&o.dispatch(o._tiptapEditor.state.tr.insert(s,r)),i==="after"&&o.dispatch(o._tiptapEditor.state.tr.insert(s+a.nodeSize,r)),i==="nested"&&a.childCount<2){const c=o._tiptapEditor.state.schema.nodes.blockGroup.create({},r);o.dispatch(o._tiptapEditor.state.tr.insert(s+a.firstChild.nodeSize+1,c))}const l=[];for(const c of r)l.push(C(c,o.schema.blockSchema,o.schema.inlineContentSchema,o.schema.styleSchema,o.blockCache));return l}function Yo(e,t,i){const o=i._tiptapEditor,n=typeof e=="string"?e:e.id,{posBeforeNode:r}=He(n,o.state.doc);o.commands.BNUpdateBlock(r+1,t);const a=o.state.doc.resolve(r+1).node();return C(a,i.schema.blockSchema,i.schema.inlineContentSchema,i.schema.styleSchema,i.blockCache)}function Kt(e,t,i){const o=t._tiptapEditor,n=o.state.tr,r=new Set(e.map(l=>typeof l=="string"?l:l.id)),a=[];let s=0;if(o.state.doc.descendants((l,c)=>{if(r.size===0)return!1;if(l.type.name!=="blockContainer"||!r.has(l.attrs.id))return!0;a.push(C(l,t.schema.blockSchema,t.schema.inlineContentSchema,t.schema.styleSchema,t.blockCache)),r.delete(l.attrs.id),s=(i==null?void 0:i(l,c,n,s))||s;const p=n.doc.nodeSize;n.delete(c-s-1,c-s+l.nodeSize+1);const h=n.doc.nodeSize;return s+=p-h,!1}),r.size>0){const l=[...r].join(`
|
|
6
|
-
`);throw Error("Blocks with the following IDs could not be found in the editor: "+l)}return t.dispatch(n),a}function
|
|
7
|
-
`:"",o={};t.lang&&(o["data-language"]=t.lang);let n={type:"element",tagName:"code",properties:o,children:[{type:"text",value:i}]};return t.meta&&(n.data={meta:t.meta}),e.patch(t,n),n=e.applyData(t,n),n={type:"element",tagName:"pre",properties:{},children:[n]},e.patch(t,n),n}function $t(e,t,i,o,n){const r=me.unified().use(eo.default).use($e.default).use(to.default,{handlers:{...Ke.defaultHandlers,code:cn}}).use(We.default).processSync(e);return De(r.value,t,i,o,n)}class ${constructor(){u(this,"callbacks",{})}on(t,i){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(i),()=>this.off(t,i)}emit(t,...i){const o=this.callbacks[t];o&&o.forEach(n=>n.apply(this,i))}off(t,i){const o=this.callbacks[t];o&&(i?this.callbacks[t]=o.filter(n=>n!==i):delete this.callbacks[t])}removeAllListeners(){this.callbacks={}}}class Xt{constructor(t,i,o,n){u(this,"state");u(this,"emitUpdate");u(this,"mouseDownHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});u(this,"dragstartHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});u(this,"scrollHandler",()=>{var t;if((t=this.state)!=null&&t.show){const i=this.pmView.root.querySelector(`[data-node-type="blockContainer"][data-id="${this.state.block.id}"]`);this.state.referencePos=i.getBoundingClientRect(),this.emitUpdate()}});u(this,"closeMenu",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});this.editor=t,this.pluginKey=i,this.pmView=o,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized file panel");n(this.state)},o.dom.addEventListener("mousedown",this.mouseDownHandler),o.dom.addEventListener("dragstart",this.dragstartHandler),o.root.addEventListener("scroll",this.scrollHandler,!0)}update(t,i){var n,r;const o=this.pluginKey.getState(t.state);if(!((n=this.state)!=null&&n.show)&&o.block&&this.editor.isEditable){const a=this.pmView.root.querySelector(`[data-node-type="blockContainer"][data-id="${o.block.id}"]`);this.state={show:!0,referencePos:a.getBoundingClientRect(),block:o.block},this.emitUpdate();return}(!t.state.selection.eq(i.selection)||!t.state.doc.eq(i.doc)||!this.editor.isEditable)&&(r=this.state)!=null&&r.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 Ue=new _.PluginKey("FilePanelPlugin");class Zt extends ${constructor(i){super();u(this,"view");u(this,"plugin");u(this,"closeMenu",()=>this.view.closeMenu());this.plugin=new _.Plugin({key:Ue,view:o=>(this.view=new Xt(i,Ue,o,n=>{this.emit("update",n)}),this.view),props:{handleKeyDown:(o,n)=>n.key==="Escape"&&this.shown?(this.view.closeMenu(),!0):!1},state:{init:()=>({block:void 0}),apply:o=>{var r;return{block:(r=o.getMeta(Ue))==null?void 0:r.block}}}})}get shown(){var i,o;return((o=(i=this.view)==null?void 0:i.state)==null?void 0:o.show)||!1}onUpdate(i){return this.on("update",i)}}class Jt{constructor(t,i,o){u(this,"state");u(this,"emitUpdate");u(this,"preventHide",!1);u(this,"preventShow",!1);u(this,"shouldShow",({state:t,from:i,to:o,view:n})=>{const{doc:r,selection:a}=t,{empty:s}=a,l=!r.textBetween(i,o).length&&b.isTextSelection(t.selection);return!(!n.hasFocus()||s||l)});u(this,"viewMousedownHandler",()=>{this.preventShow=!0});u(this,"viewMouseupHandler",()=>{this.preventShow=!1,setTimeout(()=>this.update(this.pmView))});u(this,"dragHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});u(this,"scrollHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.referencePos=this.getSelectionBoundingBox(),this.emitUpdate())});u(this,"closeMenu",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});this.editor=t,this.pmView=i,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized formatting toolbar");o(this.state)},i.dom.addEventListener("mousedown",this.viewMousedownHandler),i.dom.addEventListener("mouseup",this.viewMouseupHandler),i.dom.addEventListener("dragstart",this.dragHandler),i.dom.addEventListener("dragover",this.dragHandler),i.root.addEventListener("scroll",this.scrollHandler,!0)}update(t,i){var m,g;const{state:o,composing:n}=t,{doc:r,selection:a}=o,s=i&&i.doc.eq(r)&&i.selection.eq(a);if(n||s)return;const{ranges:l}=a,c=Math.min(...l.map(f=>f.$from.pos)),p=Math.max(...l.map(f=>f.$to.pos)),h=(m=this.shouldShow)==null?void 0:m.call(this,{view:t,state:o,from:c,to:p});if(!this.preventShow&&(h||this.preventHide)){this.state={show:!0,referencePos:this.getSelectionBoundingBox()},this.emitUpdate();return}if((g=this.state)!=null&&g.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.root.removeEventListener("scroll",this.scrollHandler,!0)}getSelectionBoundingBox(){const{state:t}=this.pmView,{selection:i}=t,{ranges:o}=i,n=Math.min(...o.map(a=>a.$from.pos)),r=Math.max(...o.map(a=>a.$to.pos));if(b.isNodeSelection(i)){const a=this.pmView.nodeDOM(n);if(a)return a.getBoundingClientRect()}return b.posToDOMRect(this.pmView,n,r)}}const Yt=new _.PluginKey("FormattingToolbarPlugin");class Qt extends ${constructor(i){super();u(this,"view");u(this,"plugin");u(this,"closeMenu",()=>this.view.closeMenu());this.plugin=new _.Plugin({key:Yt,view:o=>(this.view=new Jt(i,o,n=>{this.emit("update",n)}),this.view),props:{handleKeyDown:(o,n)=>n.key==="Escape"&&this.shown?(this.view.closeMenu(),!0):!1}})}get shown(){var i,o;return((o=(i=this.view)==null?void 0:i.state)==null?void 0:o.show)||!1}onUpdate(i){return this.on("update",i)}}class un{constructor(t,i,o){u(this,"state");u(this,"emitUpdate");u(this,"menuUpdateTimer");u(this,"startMenuUpdateTimer");u(this,"stopMenuUpdateTimer");u(this,"mouseHoveredLinkMark");u(this,"mouseHoveredLinkMarkRange");u(this,"keyboardHoveredLinkMark");u(this,"keyboardHoveredLinkMarkRange");u(this,"linkMark");u(this,"linkMarkRange");u(this,"mouseOverHandler",t=>{if(this.mouseHoveredLinkMark=void 0,this.mouseHoveredLinkMarkRange=void 0,this.stopMenuUpdateTimer(),t.target instanceof HTMLAnchorElement&&t.target.nodeName==="A"){const i=t.target,o=this.pmView.posAtDOM(i,0)+1,n=this.pmView.state.doc.resolve(o),r=n.marks();for(const a of r)if(a.type.name===this.pmView.state.schema.mark("link").type.name){this.mouseHoveredLinkMark=a,this.mouseHoveredLinkMarkRange=b.getMarkRange(n,a.type,a.attrs)||void 0;break}}return this.startMenuUpdateTimer(),!1});u(this,"clickHandler",t=>{var o;const i=this.pmView.dom.parentElement;this.linkMark&&t&&t.target&&!(i===t.target||i.contains(t.target))&&(o=this.state)!=null&&o.show&&(this.state.show=!1,this.emitUpdate())});u(this,"scrollHandler",()=>{var t;this.linkMark!==void 0&&(t=this.state)!=null&&t.show&&(this.state.referencePos=b.posToDOMRect(this.pmView,this.linkMarkRange.from,this.linkMarkRange.to),this.emitUpdate())});u(this,"closeMenu",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});this.editor=t,this.pmView=i,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized link toolbar");o(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,i){var n;const o=this.pmView.state.tr.insertText(i,this.linkMarkRange.from,this.linkMarkRange.to);o.addMark(this.linkMarkRange.from,this.linkMarkRange.from+i.length,this.pmView.state.schema.mark("link",{href:t})),this.editor.dispatch(o),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 i;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 o=this.pmView.state.selection.$from.marks();for(const n of o)if(n.type.name===this.pmView.state.schema.mark("link").type.name){this.keyboardHoveredLinkMark=n,this.keyboardHoveredLinkMarkRange=b.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:b.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((i=this.state)!=null&&i.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 ei=new _.PluginKey("LinkToolbarPlugin");class ti extends ${constructor(i){super();u(this,"view");u(this,"plugin");u(this,"editLink",(i,o)=>{this.view.editLink(i,o)});u(this,"deleteLink",()=>{this.view.deleteLink()});u(this,"startHideTimer",()=>{this.view.startMenuUpdateTimer()});u(this,"stopHideTimer",()=>{this.view.stopMenuUpdateTimer()});u(this,"closeMenu",()=>this.view.closeMenu());this.plugin=new _.Plugin({key:ei,view:o=>(this.view=new un(i,o,n=>{this.emit("update",n)}),this.view),props:{handleKeyDown:(o,n)=>n.key==="Escape"&&this.shown?(this.view.closeMenu(),!0):!1}})}onUpdate(i){return this.on("update",i)}get shown(){var i,o;return((o=(i=this.view)==null?void 0:i.state)==null?void 0:o.show)||!1}}class X extends _.Selection{constructor(i,o){super(i,o);u(this,"nodes");const n=i.node();this.nodes=[],i.doc.nodesBetween(i.pos,o.pos,(r,a,s)=>{if(s!==null&&s.eq(n))return this.nodes.push(r),!1})}static create(i,o,n=o){return new X(i.resolve(o),i.resolve(n))}content(){return new y.Slice(y.Fragment.from(this.nodes),0,0)}eq(i){if(!(i instanceof X)||this.nodes.length!==i.nodes.length||this.from!==i.from||this.to!==i.to)return!1;for(let o=0;o<this.nodes.length;o++)if(!this.nodes[o].eq(i.nodes[o]))return!1;return!0}map(i,o){const n=o.mapResult(this.from),r=o.mapResult(this.to);return r.deleted?_.Selection.near(i.resolve(n.pos)):n.deleted?_.Selection.near(i.resolve(r.pos)):new X(i.resolve(n.pos),i.resolve(r.pos))}toJSON(){return{type:"node",anchor:this.anchor,head:this.head}}}let P;function re(e,t){var i;for(;e&&e.parentElement&&e.parentElement!==t.dom&&!((i=e.hasAttribute)!=null&&i.call(e,"data-id"));)e=e.parentElement;if(e.hasAttribute("data-id"))return{node:e,id:e.getAttribute("data-id")}}function pn(e,t){const i=re(e,t);if(i&&i.node.nodeType===1){const o=t.docView,n=o.nearestDesc(i.node,!0);return!n||n===o?null:n.posBefore}return null}function hn(e,t){let i,o;const n=t.resolve(e.from).node().type.spec.group==="blockContent",r=t.resolve(e.to).node().type.spec.group==="blockContent",a=Math.min(e.$anchor.depth,e.$head.depth);if(n&&r){const s=e.$from.start(a-1),l=e.$to.end(a-1);i=t.resolve(s-1).pos,o=t.resolve(l+1).pos}else i=e.from,o=e.to;return{from:i,to:o}}function ii(e,t,i=t){t===i&&(i+=e.state.doc.resolve(t+1).node().nodeSize);const o=e.domAtPos(t).node.cloneNode(!0),n=e.domAtPos(t).node,r=(p,h)=>Array.prototype.indexOf.call(p.children,h),a=r(n,e.domAtPos(t+1).node.parentElement),s=r(n,e.domAtPos(i-1).node.parentElement);for(let p=n.childElementCount-1;p>=0;p--)(p>s||p<a)&&o.removeChild(o.children[p]);oi(e.root),P=o;const c=e.dom.className.split(" ").filter(p=>p!=="ProseMirror"&&p!=="bn-root"&&p!=="bn-editor").join(" ");P.className=P.className+" bn-drag-preview "+c,e.root instanceof ShadowRoot?e.root.appendChild(P):e.root.body.appendChild(P)}function oi(e){P!==void 0&&(e instanceof ShadowRoot?e.removeChild(P):e.body.removeChild(P),P=void 0)}function mn(e,t){if(!e.dataTransfer)return;const i=t.prosemirrorView,o=i.dom.getBoundingClientRect(),n={left:o.left+o.width/2,top:e.clientY},r=i.root.elementsFromPoint(n.left,n.top);let a;for(const l of r)if(i.dom.contains(l)){a=re(l,i);break}if(!a)return;const s=pn(a.node,i);if(s!=null){const l=i.state.selection,c=i.state.doc,{from:p,to:h}=hn(l,c),m=p<=s&&s<h,g=l.$anchor.node()!==l.$head.node()||l instanceof X;m&&g?(i.dispatch(i.state.tr.setSelection(X.create(c,p,h))),ii(i,p,h)):(i.dispatch(i.state.tr.setSelection(_.NodeSelection.create(i.state.doc,s))),ii(i,s));const f=i.state.selection.content(),k=t.pmSchema,O=le(k,t).serializeProseMirrorFragment(f.content,{}),V=Y(k,t).exportProseMirrorFragment(f.content,{}),ae=ue(V);e.dataTransfer.clearData(),e.dataTransfer.setData("blocknote/html",O),e.dataTransfer.setData("text/html",V),e.dataTransfer.setData("text/plain",ae),e.dataTransfer.effectAllowed="move",e.dataTransfer.setDragImage(P,0,0),i.dragging={slice:f,move:!0}}}class ni{constructor(t,i,o){u(this,"state");u(this,"emitUpdate");u(this,"needUpdate",!1);u(this,"mousePos");u(this,"horizontalPosAnchoredAtRoot");u(this,"horizontalPosAnchor");u(this,"hoveredBlock");u(this,"isDragging",!1);u(this,"menuFrozen",!1);u(this,"updateState",()=>{var a,s,l,c;if(this.menuFrozen||!this.mousePos)return;const t=this.pmView.dom.firstChild.getBoundingClientRect();this.horizontalPosAnchor=t.x;const i={left:t.left+t.width/2,top:this.mousePos.y},o=this.pmView.root.elementsFromPoint(i.left,i.top);let n;for(const p of o)if(this.pmView.dom.contains(p)){n=re(p,this.pmView);break}if(!n||!this.editor.isEditable){(a=this.state)!=null&&a.show&&(this.state.show=!1,this.needUpdate=!0);return}if((s=this.state)!=null&&s.show&&((l=this.hoveredBlock)!=null&&l.hasAttribute("data-id"))&&((c=this.hoveredBlock)==null?void 0:c.getAttribute("data-id"))===n.id)return;this.hoveredBlock=n.node;const r=n.node.firstChild;if(r&&this.editor.isEditable){const p=r.getBoundingClientRect();this.state={show:!0,referencePos:new DOMRect(this.horizontalPosAnchoredAtRoot?this.horizontalPosAnchor:p.x,p.y,p.width,p.height),block:this.editor.getBlock(this.hoveredBlock.getAttribute("data-id"))},this.needUpdate=!0}});u(this,"onDragStart",()=>{this.isDragging=!0});u(this,"onDrop",t=>{if(this.editor._tiptapEditor.commands.blur(),t.synthetic||!this.isDragging)return;const i=this.pmView.posAtCoords({left:t.clientX,top:t.clientY});if(this.isDragging=!1,!i||i.inside===-1){const o=new Event("drop",t),n=this.pmView.dom.firstChild.getBoundingClientRect();o.clientX=n.left+n.width/2,o.clientY=t.clientY,o.dataTransfer=t.dataTransfer,o.preventDefault=()=>t.preventDefault(),o.synthetic=!0,this.pmView.dom.dispatchEvent(o)}});u(this,"onDragOver",t=>{if(t.synthetic||!this.isDragging)return;const i=this.pmView.posAtCoords({left:t.clientX,top:t.clientY});if(!i||i.inside===-1){const o=new Event("dragover",t),n=this.pmView.dom.firstChild.getBoundingClientRect();o.clientX=n.left+n.width/2,o.clientY=t.clientY,o.dataTransfer=t.dataTransfer,o.preventDefault=()=>t.preventDefault(),o.synthetic=!0,this.pmView.dom.dispatchEvent(o)}});u(this,"onKeyDown",t=>{var i;(i=this.state)!=null&&i.show&&this.editor.isFocused()&&(this.state.show=!1,this.emitUpdate(this.state),this.menuFrozen=!1)});u(this,"onMouseDown",()=>{this.state&&this.state.show&&this.menuFrozen&&(this.menuFrozen=!1,this.state.show=!1,this.emitUpdate(this.state))});u(this,"onMouseMove",t=>{var r;this.mousePos={x:t.clientX,y:t.clientY};const i=this.pmView.dom.getBoundingClientRect(),o=this.mousePos.x>i.left&&this.mousePos.x<i.right&&this.mousePos.y>i.top&&this.mousePos.y<i.bottom,n=this.pmView.dom.parentElement;if(o&&t&&t.target&&!(n===t.target||n.contains(t.target))){(r=this.state)!=null&&r.show&&(this.state.show=!1,this.emitUpdate(this.state));return}this.updateState(),this.needUpdate&&(this.emitUpdate(this.state),this.needUpdate=!1)});u(this,"onScroll",()=>{var t;if((t=this.state)!=null&&t.show){const o=this.hoveredBlock.firstChild.getBoundingClientRect();this.state.referencePos=new DOMRect(this.horizontalPosAnchoredAtRoot?this.horizontalPosAnchor:o.x,o.y,o.width,o.height),this.emitUpdate(this.state)}});this.editor=t,this.pmView=i,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized side menu");o(this.state)},this.horizontalPosAnchoredAtRoot=!0,this.horizontalPosAnchor=this.pmView.dom.firstChild.getBoundingClientRect().x,this.pmView.root.addEventListener("drop",this.onDrop,!0),this.pmView.root.addEventListener("dragover",this.onDragOver),this.pmView.dom.addEventListener("dragstart",this.onDragStart),this.pmView.root.addEventListener("mousemove",this.onMouseMove,!0),this.pmView.dom.addEventListener("mousedown",this.onMouseDown),this.pmView.root.addEventListener("keydown",this.onKeyDown,!0),this.pmView.root.addEventListener("scroll",this.onScroll,!0)}update(){var i;const t=(i=this.state)==null?void 0:i.block.id;this.updateState(),this.needUpdate&&this.state&&t!==this.state.block.id&&(this.emitUpdate(this.state),this.needUpdate=!1)}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.dom.removeEventListener("dragstart",this.onDragStart),this.pmView.root.removeEventListener("drop",this.onDrop,!0),this.pmView.root.removeEventListener("scroll",this.onScroll,!0),this.pmView.dom.removeEventListener("mousedown",this.onMouseDown),this.pmView.root.removeEventListener("keydown",this.onKeyDown,!0)}addBlock(){var l;(l=this.state)!=null&&l.show&&(this.state.show=!1,this.emitUpdate(this.state));const i=this.hoveredBlock.firstChild.getBoundingClientRect(),o=this.pmView.posAtCoords({left:i.left+i.width/2,top:i.top+i.height/2});if(!o)return;const n=v(this.editor._tiptapEditor.state.doc,o.pos);if(n===void 0)return;const{contentNode:r,startPos:a,endPos:s}=n;if(r.type.spec.content!=="inline*"||r.textContent.length!==0){const c=s+1,p=c+2;this.editor._tiptapEditor.chain().BNCreateBlock(c).setTextSelection(p).run()}else this.editor._tiptapEditor.commands.setTextSelection(a+1);this.editor.openSelectionMenu("/")}}const ri=new _.PluginKey("SideMenuPlugin");class ai extends ${constructor(i){super();u(this,"view");u(this,"plugin");u(this,"addBlock",()=>this.view.addBlock());u(this,"blockDragStart",i=>{this.view.isDragging=!0,mn(i,this.editor)});u(this,"blockDragEnd",()=>oi(this.editor.prosemirrorView.root));u(this,"freezeMenu",()=>this.view.menuFrozen=!0);u(this,"unfreezeMenu",()=>{this.view.menuFrozen=!1,this.view.state.show=!1,this.view.emitUpdate(this.view.state)});this.editor=i,this.plugin=new _.Plugin({key:ri,view:o=>(this.view=new ni(i,o,n=>{this.emit("update",n)}),this.view)})}onUpdate(i){return this.on("update",i)}}const fn=b.findParentNode(e=>e.type.name==="blockContainer");class gn{constructor(t,i){u(this,"state");u(this,"emitUpdate");u(this,"rootEl");u(this,"pluginState");u(this,"handleScroll",()=>{var t,i;if((t=this.state)!=null&&t.show){const o=(i=this.rootEl)==null?void 0:i.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);this.state.referencePos=o.getBoundingClientRect(),this.emitUpdate(this.pluginState.triggerCharacter)}});u(this,"closeMenu",()=>{this.editor.dispatch(this.editor._tiptapEditor.view.state.tr.setMeta(Z,null))});u(this,"clearQuery",()=>{this.pluginState!==void 0&&this.editor._tiptapEditor.chain().focus().deleteRange({from:this.pluginState.queryStartPos-(this.pluginState.fromUserInput?this.pluginState.triggerCharacter.length:0),to:this.editor._tiptapEditor.state.selection.from}).run()});this.editor=t,this.pluginState=void 0,this.emitUpdate=o=>{if(!this.state)throw new Error("Attempting to update uninitialized suggestions menu");i(o,this.state)},this.rootEl=this.editor._tiptapEditor.view.root,this.rootEl.addEventListener("scroll",this.handleScroll,!0)}update(t,i){var c;const o=Z.getState(i),n=Z.getState(t.state),r=o===void 0&&n!==void 0,a=o!==void 0&&n===void 0;if(!r&&!(o!==void 0&&n!==void 0)&&!a)return;if(this.pluginState=a?o:n,a||!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&&(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 Z=new _.PluginKey("SuggestionMenuPlugin");class si extends ${constructor(i){super();u(this,"view");u(this,"plugin");u(this,"triggerCharacters",[]);u(this,"addTriggerCharacter",i=>{this.triggerCharacters.push(i)});u(this,"removeTriggerCharacter",i=>{this.triggerCharacters=this.triggerCharacters.filter(o=>o!==i)});u(this,"closeMenu",()=>this.view.closeMenu());u(this,"clearQuery",()=>this.view.clearQuery());const o=this.triggerCharacters;this.plugin=new _.Plugin({key:Z,view:()=>(this.view=new gn(i,(n,r)=>{this.emit(`update ${n}`,r)}),this.view),state:{init(){},apply(n,r,a,s){if(n.getMeta("orderedListIndexing")!==void 0)return r;const l=n.getMeta(Z);if(typeof l=="object"&&l!==null&&r===void 0)return{triggerCharacter:l.triggerCharacter,fromUserInput:l.fromUserInput!==!1,queryStartPos:s.selection.from,query:"",decorationId:`id_${Math.floor(Math.random()*4294967295)}`};if(r===void 0)return r;if(s.selection.from!==s.selection.to||l===null||n.getMeta("focus")||n.getMeta("blur")||n.getMeta("pointer")||r.triggerCharacter!==void 0&&s.selection.from<r.queryStartPos)return;const c={...r};return c.query=s.doc.textBetween(r.queryStartPos,s.selection.from),c}},props:{handleTextInput(n,r,a,s){const l=this.getState(n.state);return o.includes(s)&&l===void 0?(n.dispatch(n.state.tr.insertText(s).scrollIntoView().setMeta(Z,{triggerCharacter:s})),!0):!1},decorations(n){const r=this.getState(n);if(r===void 0)return null;if(!r.fromUserInput){const a=fn(n.selection);if(a)return M.DecorationSet.create(n.doc,[M.Decoration.node(a.pos,a.pos+a.node.nodeSize,{nodeName:"span",class:"bn-suggestion-decorator","data-decoration-id":r.decorationId})])}return M.DecorationSet.create(n.doc,[M.Decoration.inline(r.queryStartPos-r.triggerCharacter.length,r.queryStartPos,{nodeName:"span",class:"bn-suggestion-decorator","data-decoration-id":r.decorationId})])}}})}onUpdate(i,o){return this.triggerCharacters.includes(i)||this.addTriggerCharacter(i),this.on(`update ${i}`,o)}get shown(){var i,o;return((o=(i=this.view)==null?void 0:i.state)==null?void 0:o.show)||!1}}function bn(e,t){e.suggestionMenus.addTriggerCharacter(t)}let S;function li(e){S||(S=document.createElement("div"),S.innerHTML="_",S.style.opacity="0",S.style.height="1px",S.style.width="1px",e instanceof Document?e.body.appendChild(S):e.appendChild(S))}function kn(e){S&&(e instanceof Document?e.body.removeChild(S):e.removeChild(S),S=void 0)}function pe(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}function _n(e){for(;e&&e.nodeName!=="TD"&&e.nodeName!=="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function yn(e,t){e.forEach(i=>{const o=t.querySelectorAll(i);for(let n=0;n<o.length;n++)o[n].style.visibility="hidden"})}class di{constructor(t,i,o){u(this,"state");u(this,"emitUpdate");u(this,"tableId");u(this,"tablePos");u(this,"menuFrozen",!1);u(this,"prevWasEditable",null);u(this,"mouseMoveHandler",t=>{var c;if(this.menuFrozen)return;const i=_n(t.target);if(!i||!this.editor.isEditable){(c=this.state)!=null&&c.show&&(this.state.show=!1,this.emitUpdate());return}const o=pe(i),n=pe(i.parentElement),r=i.getBoundingClientRect(),a=i.parentElement.parentElement.getBoundingClientRect(),s=re(i,this.pmView);if(!s)return;let l;if(this.editor._tiptapEditor.state.doc.descendants((p,h)=>{if(typeof l<"u")return!1;if(p.type.name!=="blockContainer"||p.attrs.id!==s.id)return!0;const m=C(p,this.editor.schema.blockSchema,this.editor.schema.inlineContentSchema,this.editor.schema.styleSchema,this.editor.blockCache);return zt("table",m,this.editor)&&(this.tablePos=h+1,l=m),!1}),!!l&&(this.tableId=s.id,!(this.state!==void 0&&this.state.show&&this.tableId===s.id&&this.state.rowIndex===n&&this.state.colIndex===o)))return this.state={show:!0,referencePosCell:r,referencePosTable:a,block:l,colIndex:o,rowIndex:n,draggingState:void 0},this.emitUpdate(),!1});u(this,"dragOverHandler",t=>{var m;if(((m=this.state)==null?void 0:m.draggingState)===void 0)return;t.preventDefault(),t.dataTransfer.dropEffect="move",yn(["column-resize-handle","prosemirror-dropcursor-block","prosemirror-dropcursor-inline"],this.pmView.root);const i={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)},o=this.pmView.root.elementsFromPoint(i.left,i.top).filter(g=>g.tagName==="TD"||g.tagName==="TH");if(o.length===0)throw new Error("Could not find table cell element that the mouse cursor is hovering over.");const n=o[0];let r=!1;const a=pe(n.parentElement),s=pe(n),l=this.state.draggingState.draggedCellOrientation==="row"?this.state.rowIndex:this.state.colIndex,p=(this.state.draggingState.draggedCellOrientation==="row"?a:s)!==l;(this.state.rowIndex!==a||this.state.colIndex!==s)&&(this.state.rowIndex=a,this.state.colIndex=s,this.state.referencePosCell=n.getBoundingClientRect(),r=!0);const h=this.state.draggingState.draggedCellOrientation==="row"?i.top:i.left;this.state.draggingState.mousePos!==h&&(this.state.draggingState.mousePos=h,r=!0),r&&this.emitUpdate(),p&&this.editor.dispatch(this.pmView.state.tr.setMeta(J,!0))});u(this,"dropHandler",t=>{if(this.state===void 0||this.state.draggingState===void 0)return;t.preventDefault();const i=this.state.block.content.rows;if(this.state.draggingState.draggedCellOrientation==="row"){const o=i[this.state.draggingState.originalIndex];i.splice(this.state.draggingState.originalIndex,1),i.splice(this.state.rowIndex,0,o)}else{const o=i.map(n=>n.cells[this.state.draggingState.originalIndex]);i.forEach((n,r)=>{n.cells.splice(this.state.draggingState.originalIndex,1),n.cells.splice(this.state.colIndex,0,o[r])})}this.editor.updateBlock(this.state.block,{type:"table",content:{type:"tableContent",rows:i}})});u(this,"scrollHandler",()=>{var t;if((t=this.state)!=null&&t.show){const i=this.pmView.root.querySelector(`[data-node-type="blockContainer"][data-id="${this.tableId}"] table`),o=i.querySelector(`tr:nth-child(${this.state.rowIndex+1}) > td:nth-child(${this.state.colIndex+1})`);this.state.referencePosTable=i.getBoundingClientRect(),this.state.referencePosCell=o.getBoundingClientRect(),this.emitUpdate()}});this.editor=t,this.pmView=i,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized image toolbar");o(this.state)},i.dom.addEventListener("mousemove",this.mouseMoveHandler),i.root.addEventListener("dragover",this.dragOverHandler),i.root.addEventListener("drop",this.dropHandler),i.root.addEventListener("scroll",this.scrollHandler,!0)}destroy(){this.pmView.dom.removeEventListener("mousemove",this.mouseMoveHandler),this.pmView.root.removeEventListener("dragover",this.dragOverHandler),this.pmView.root.removeEventListener("drop",this.dropHandler),this.pmView.root.removeEventListener("scroll",this.scrollHandler,!0)}}const J=new _.PluginKey("TableHandlesPlugin");class ci extends ${constructor(i){super();u(this,"view");u(this,"plugin");u(this,"colDragStart",i=>{if(this.view.state===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:i.clientX},this.view.emitUpdate(),this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(J,{draggedCellOrientation:this.view.state.draggingState.draggedCellOrientation,originalIndex:this.view.state.colIndex,newIndex:this.view.state.colIndex,tablePos:this.view.tablePos})),li(this.editor._tiptapEditor.view.root),i.dataTransfer.setDragImage(S,0,0),i.dataTransfer.effectAllowed="move"});u(this,"rowDragStart",i=>{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={draggedCellOrientation:"row",originalIndex:this.view.state.rowIndex,mousePos:i.clientY},this.view.emitUpdate(),this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(J,{draggedCellOrientation:this.view.state.draggingState.draggedCellOrientation,originalIndex:this.view.state.rowIndex,newIndex:this.view.state.rowIndex,tablePos:this.view.tablePos})),li(this.editor._tiptapEditor.view.root),i.dataTransfer.setDragImage(S,0,0),i.dataTransfer.effectAllowed="copyMove"});u(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(J,null)),kn(this.editor._tiptapEditor.view.root)});u(this,"freezeHandles",()=>{this.view.menuFrozen=!0});u(this,"unfreezeHandles",()=>{this.view.menuFrozen=!1});this.editor=i,this.plugin=new _.Plugin({key:J,view:o=>(this.view=new di(i,o,n=>{this.emit("update",n)}),this.view),props:{decorations:o=>{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,r=[];if(n===this.view.state.draggingState.originalIndex)return M.DecorationSet.create(o.doc,r);const a=o.doc.resolve(this.view.tablePos+1),s=a.node();if(this.view.state.draggingState.draggedCellOrientation==="row"){const l=o.doc.resolve(a.posAtIndex(n)+1),c=l.node();for(let p=0;p<c.childCount;p++){const h=o.doc.resolve(l.posAtIndex(p)+1),m=h.node(),g=h.pos+(n>this.view.state.draggingState.originalIndex?m.nodeSize-2:0);r.push(M.Decoration.widget(g,()=>{const f=document.createElement("div");return f.className="bn-table-drop-cursor",f.style.left="0",f.style.right="0",n>this.view.state.draggingState.originalIndex?f.style.bottom="-2px":f.style.top="-3px",f.style.height="4px",f}))}}else for(let l=0;l<s.childCount;l++){const c=o.doc.resolve(a.posAtIndex(l)+1),p=o.doc.resolve(c.posAtIndex(n)+1),h=p.node(),m=p.pos+(n>this.view.state.draggingState.originalIndex?h.nodeSize-2:0);r.push(M.Decoration.widget(m,()=>{const g=document.createElement("div");return g.className="bn-table-drop-cursor",g.style.top="0",g.style.bottom="0",n>this.view.state.draggingState.originalIndex?g.style.right="-2px":g.style.left="-3px",g.style.width="4px",g}))}return M.DecorationSet.create(o.doc,r)}}})}onUpdate(i){return this.on("update",i)}}function ui(e,t){const i=e.state.selection.content().content,n=le(e.state.schema,t).serializeProseMirrorFragment(i,{}),a=Y(e.state.schema,t).exportProseMirrorFragment(i,{}),s=ue(a);return{internalHTML:n,externalHTML:a,plainText:s}}const wn=e=>b.Extension.create({name:"copyToClipboard",addProseMirrorPlugins(){return[new _.Plugin({props:{handleDOMEvents:{copy(t,i){i.preventDefault(),i.clipboardData.clearData(),"node"in t.state.selection&&t.state.selection.node.type.spec.group==="blockContent"&&e.dispatch(e._tiptapEditor.state.tr.setSelection(new _.NodeSelection(t.state.doc.resolve(t.state.selection.from-1))));const{internalHTML:o,externalHTML:n,plainText:r}=ui(t,e);return i.clipboardData.setData("blocknote/html",o),i.clipboardData.setData("text/html",n),i.clipboardData.setData("text/plain",r),!0},dragstart(t,i){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)))),i.preventDefault(),i.dataTransfer.clearData();const{internalHTML:o,externalHTML:n,plainText:r}=ui(t,e);return i.dataTransfer.setData("blocknote/html",o),i.dataTransfer.setData("text/html",n),i.dataTransfer.setData("text/plain",r),!0}}}})]}});function vn(e){let t=e.getTextCursorPosition().block,i=e.schema.blockSchema[t.type].content;for(;i==="none";)t=e.getTextCursorPosition().nextBlock,i=e.schema.blockSchema[t.type].content,e.setTextCursorPosition(t,"end")}function T(e,t){const i=e.getTextCursorPosition().block;if(i.content===void 0)throw new Error("Slash Menu open in a block that doesn't contain content.");Array.isArray(i.content)&&(i.content.length===1&&W(i.content[0])&&i.content[0].type==="text"&&i.content[0].text==="/"||i.content.length===0)?e.updateBlock(i,t):(e.insertBlocks([t],i,"after"),e.setTextCursorPosition(e.getTextCursorPosition().nextBlock,"end"));const o=e.getTextCursorPosition().block;return vn(e),o}function xn(e){const t=[];return B("heading",e)&&t.push({onItemClick:()=>{T(e,{type:"heading",props:{level:1}})},badge:H("Mod-Alt-1"),key:"heading",...e.dictionary.slash_menu.heading},{onItemClick:()=>{T(e,{type:"heading",props:{level:2}})},badge:H("Mod-Alt-2"),key:"heading_2",...e.dictionary.slash_menu.heading_2},{onItemClick:()=>{T(e,{type:"heading",props:{level:3}})},badge:H("Mod-Alt-3"),key:"heading_3",...e.dictionary.slash_menu.heading_3}),B("numberedListItem",e)&&t.push({onItemClick:()=>{T(e,{type:"numberedListItem"})},badge:H("Mod-Shift-7"),key:"numbered_list",...e.dictionary.slash_menu.numbered_list}),B("bulletListItem",e)&&t.push({onItemClick:()=>{T(e,{type:"bulletListItem"})},badge:H("Mod-Shift-8"),key:"bullet_list",...e.dictionary.slash_menu.bullet_list}),B("checkListItem",e)&&t.push({onItemClick:()=>{T(e,{type:"checkListItem"})},badge:H("Mod-Shift-9"),key:"check_list",...e.dictionary.slash_menu.check_list}),B("paragraph",e)&&t.push({onItemClick:()=>{T(e,{type:"paragraph"})},badge:H("Mod-Alt-0"),key:"paragraph",...e.dictionary.slash_menu.paragraph}),B("table",e)&&t.push({onItemClick:()=>{T(e,{type:"table",content:{type:"tableContent",rows:[{cells:["","",""]},{cells:["","",""]}]}})},badge:void 0,key:"table",...e.dictionary.slash_menu.table}),B("image",e)&&t.push({onItemClick:()=>{const i=T(e,{type:"image"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:i}))},key:"image",...e.dictionary.slash_menu.image}),B("video",e)&&t.push({onItemClick:()=>{const i=T(e,{type:"video"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:i}))},key:"video",...e.dictionary.slash_menu.video}),B("audio",e)&&t.push({onItemClick:()=>{const i=T(e,{type:"audio"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:i}))},key:"audio",...e.dictionary.slash_menu.audio}),B("file",e)&&t.push({onItemClick:()=>{const i=T(e,{type:"file"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:i}))},key:"image",...e.dictionary.slash_menu.file}),t.push({onItemClick:()=>e.openSelectionMenu(":"),key:"emoji",...e.dictionary.slash_menu.emoji}),t}function En(e,t){return e.filter(({title:i,aliases:o})=>i.toLowerCase().includes(t.toLowerCase())||o&&o.filter(n=>n.toLowerCase().includes(t.toLowerCase())).length!==0)}const je=["blocknote/html","Files","text/html","text/plain"];function Cn(e,t){const i=e.split("/"),o=t.split("/");if(i.length!==2)throw new Error(`The string ${e} is not a valid MIME type.`);if(o.length!==2)throw new Error(`The string ${t} is not a valid MIME type.`);return i[1]==="*"||o[1]==="*"?i[0]===o[0]:(i[0]==="*"||o[0]==="*"||i[0]===o[0])&&i[1]===o[1]}async function pi(e,t){if(!t.uploadFile)return;const i="dataTransfer"in e?e.dataTransfer:e.clipboardData;if(i===null)return;let o=null;for(const a of je)if(i.types.includes(a)){o=a;break}if(o!=="Files")return;const n=i.items;if(!n)return;e.preventDefault();const r=Object.values(t.schema.blockSchema).filter(a=>a.isFileBlock);for(let a=0;a<n.length;a++){let s="file";for(const c of r)for(const p of c.fileBlockAcceptMimeTypes||[])if(Cn(n[a].type,p)){s=c.type;break}const l=n[a].getAsFile();if(l){const c=await t.uploadFile(l);if(typeof c=="string"){const p={type:s,props:{name:l.name,url:c}};T(t,p)}}}}const Sn=e=>b.Extension.create({name:"pasteFromClipboard",addProseMirrorPlugins(){return[new _.Plugin({props:{handleDOMEvents:{paste(t,i){if(i.preventDefault(),!e.isEditable)return;let o=null;for(const r of je)if(i.clipboardData.types.includes(r)){o=r;break}if(o===null)return!0;if(o==="Files")return pi(i,e),!0;let n=i.clipboardData.getData(o);return o==="text/html"&&(n=Wt(n.trim()).innerHTML),e._tiptapEditor.view.pasteHTML(n),!0}}}})]}}),Tn=e=>b.Extension.create({name:"dropFile",addProseMirrorPlugins(){return[new _.Plugin({props:{handleDOMEvents:{drop(t,i){if(!e.isEditable)return;let o=null;for(const n of je)if(i.dataTransfer.types.includes(n)){o=n;break}return o===null?!0:o==="Files"?(pi(i,e),!0):!1}}}})]}}),Mn=b.Extension.create({name:"blockBackgroundColor",addGlobalAttributes(){return[{types:["blockContainer"],attributes:{backgroundColor:{default:x.backgroundColor.default,parseHTML:e=>e.hasAttribute("data-background-color")?e.getAttribute("data-background-color"):x.backgroundColor.default,renderHTML:e=>e.backgroundColor===x.backgroundColor.default?{}:{"data-background-color":e.backgroundColor}}}}]}}),Bn=b.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}}}}]}}),Ln=b.Extension.create({name:"blockTextColor",addGlobalAttributes(){return[{types:["blockContainer"],attributes:{textColor:{default:x.textColor.default,parseHTML:e=>e.hasAttribute("data-text-color")?e.getAttribute("data-text-color"):x.textColor.default,renderHTML:e=>e.textColor===x.textColor.default?{}:{"data-text-color":e.textColor}}}}]}}),In=b.Extension.create({name:"trailingNode",addProseMirrorPlugins(){const e=new _.PluginKey(this.name);return[new _.Plugin({key:e,appendTransaction:(t,i,o)=>{const{doc:n,tr:r,schema:a}=o,s=e.getState(o),l=n.content.size-2,c=a.nodes.blockContainer,p=a.nodes.paragraph;if(s)return r.insert(l,c.create(void 0,p.create()))},state:{init:(t,i)=>{},apply:(t,i)=>{if(!t.docChanged)return i;let o=t.doc.lastChild;if(!o||o.type.name!=="blockGroup")throw new Error("Expected blockGroup");if(o=o.lastChild,!o||o.type.name!=="blockContainer")throw new Error("Expected blockContainer");const n=o.firstChild;if(!n)throw new Error("Expected blockContent");return o.nodeSize>4||n.type.spec.content!=="inline*"}}})]}}),Pn=new _.PluginKey("non-editable-block"),An=()=>new _.Plugin({key:Pn,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"){const i=e.state.tr;return e.dispatch(i.insert(e.state.tr.selection.$to.after(),e.state.schema.nodes.paragraph.create()).setSelection(new _.TextSelection(i.doc.resolve(e.state.tr.selection.$to.after()+1)))),!0}}return!1}}}),hi=new _.PluginKey("previous-blocks"),Nn={index:"index",level:"level",type:"type",depth:"depth","depth-change":"depth-change"},Hn=()=>{let e;return new _.Plugin({key:hi,view(t){return{update:async(i,o)=>{var n;((n=this.key)==null?void 0:n.getState(i.state).updatedBlocks.size)>0&&(e=setTimeout(()=>{i.dispatch(i.state.tr.setMeta(hi,{clearUpdate:!0}))},0))},destroy:()=>{e&&clearTimeout(e)}}},state:{init(){return{prevTransactionOldBlockAttrs:{},currentTransactionOldBlockAttrs:{},updatedBlocks:new Set}},apply(t,i,o,n){if(i.currentTransactionOldBlockAttrs={},i.updatedBlocks.clear(),!t.docChanged||o.doc.eq(n.doc))return i;const r={},a=b.findChildren(o.doc,c=>c.attrs.id),s=new Map(a.map(c=>[c.node.attrs.id,c])),l=b.findChildren(n.doc,c=>c.attrs.id);for(const c of l){const p=s.get(c.node.attrs.id),h=p==null?void 0:p.node.firstChild,m=c.node.firstChild;if(p&&h&&m){const g={index:m.attrs.index,level:m.attrs.level,type:m.type.name,depth:n.doc.resolve(c.pos).depth};let f={index:h.attrs.index,level:h.attrs.level,type:h.type.name,depth:o.doc.resolve(p.pos).depth};r[c.node.attrs.id]=f,t.getMeta("numberedListIndexing")&&(c.node.attrs.id in i.prevTransactionOldBlockAttrs&&(f=i.prevTransactionOldBlockAttrs[c.node.attrs.id]),g.type==="numberedListItem"&&(f.index=g.index)),i.currentTransactionOldBlockAttrs[c.node.attrs.id]=f,JSON.stringify(f)!==JSON.stringify(g)&&(f["depth-change"]=f.depth-g.depth,i.updatedBlocks.add(c.node.attrs.id))}}return i.prevTransactionOldBlockAttrs=r,i}},props:{decorations(t){const i=this.getState(t);if(i.updatedBlocks.size===0)return;const o=[];return t.doc.descendants((n,r)=>{if(!n.attrs.id||!i.updatedBlocks.has(n.attrs.id))return;const a=i.currentTransactionOldBlockAttrs[n.attrs.id],s={};for(const[c,p]of Object.entries(a))s["data-prev-"+Nn[c]]=p||"none";const l=M.Decoration.node(r,r+n.nodeSize,{...s});o.push(l)}),M.DecorationSet.create(t.doc,o)}}})},Dn={blockColor:"data-block-color",blockStyle:"data-block-style",id:"data-id",depth:"data-depth",depthChange:"data-depth-change"},Un=b.Node.create({name:"blockContainer",group:"blockContainer",content:"blockContent blockGroup?",priority:50,defining:!0,parseHTML(){return[{tag:"div",getAttrs:e=>{if(typeof e=="string")return!1;const t={};for(const[i,o]of Object.entries(Dn))e.getAttribute(o)&&(t[i]=e.getAttribute(o));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[r,a]of Object.entries(e))r!=="class"&&t.setAttribute(r,a);const i={...((n=this.options.domAttributes)==null?void 0:n.block)||{},...e},o=document.createElement("div");o.className=D("bn-block",i.class),o.setAttribute("data-node-type",this.name);for(const[r,a]of Object.entries(i))r!=="class"&&o.setAttribute(r,a);return t.appendChild(o),{dom:t,contentDOM:o}},addCommands(){return{BNCreateBlock:e=>({state:t,dispatch:i})=>{const o=t.schema.nodes.blockContainer.createAndFill();return i&&t.tr.insert(e,o).scrollIntoView(),!0},BNDeleteBlock:e=>({state:t,dispatch:i})=>{const o=v(t.doc,e);if(o===void 0)return!1;const{startPos:n,endPos:r}=o;return i&&t.tr.deleteRange(n,r),!0},BNUpdateBlock:(e,t)=>({state:i,dispatch:o})=>{const n=v(i.doc,e);if(n===void 0)return!1;const{startPos:r,endPos:a,node:s,contentNode:l}=n;if(o){if(t.children!==void 0){const m=[];for(const g of t.children)m.push(N(g,i.schema,this.options.editor.schema.styleSchema));s.childCount===2?i.tr.replace(r+l.nodeSize+1,a-1,new y.Slice(y.Fragment.from(m),0,0)):i.tr.insert(r+l.nodeSize,i.schema.nodes.blockGroup.create({},m))}const c=l.type.name,p=t.type||c;let h="keep";if(t.content)if(typeof t.content=="string")h=F([t.content],i.schema,this.options.editor.schema.styleSchema);else if(Array.isArray(t.content))h=F(t.content,i.schema,this.options.editor.schema.styleSchema);else if(t.content.type==="tableContent")h=_e(t.content,i.schema,this.options.editor.schema.styleSchema);else throw new I(t.content.type);else{const m=i.schema.nodes[c].spec.content,g=i.schema.nodes[p].spec.content;m===""||g!==m&&(h=[])}h==="keep"?i.tr.setNodeMarkup(r,t.type===void 0?void 0:i.schema.nodes[t.type],{...l.attrs,...t.props}):i.tr.replaceWith(r,a,i.schema.nodes[p].create({...l.attrs,...t.props},h)).setSelection(i.schema.nodes[p].spec.content===""?new _.NodeSelection(i.tr.doc.resolve(r)):i.schema.nodes[p].spec.content==="inline*"?new _.TextSelection(i.tr.doc.resolve(r)):new _.TextSelection(i.tr.doc.resolve(r+4))),i.tr.setNodeMarkup(r-1,void 0,{...s.attrs,...t.props})}return!0},BNMergeBlocks:e=>({state:t,dispatch:i})=>{const o=t.doc.resolve(e+1).node().type.name==="blockContainer",n=t.doc.resolve(e-1).node().type.name==="blockContainer";if(!o||!n)return!1;const r=v(t.doc,e+1),{node:a,contentNode:s,startPos:l,endPos:c,depth:p}=r;if(a.childCount===2){const g=t.doc.resolve(l+s.nodeSize+1),f=t.doc.resolve(c-1),k=g.blockRange(f);i&&t.tr.lift(k,p-1)}let h=e-1,m=v(t.doc,h);for(;m.numChildBlocks>0;)if(h--,m=v(t.doc,h),m===void 0)return!1;return i&&(i(t.tr.deleteRange(l,l+s.nodeSize).replace(h-1,l,new y.Slice(s.content,0,0)).scrollIntoView()),t.tr.setSelection(new _.TextSelection(t.doc.resolve(h-1)))),!0},BNSplitBlock:(e,t,i)=>({state:o,dispatch:n})=>{const r=v(o.doc,e);if(r===void 0)return!1;const{contentNode:a,contentType:s,startPos:l,endPos:c,depth:p}=r,h=o.doc.cut(l+1,e),m=o.doc.cut(e,c-1),g=o.schema.nodes.blockContainer.createAndFill(),f=c+1,k=f+2;return n&&(o.tr.insert(f,g),o.tr.replace(k,k+1,m.content.size>0?new y.Slice(y.Fragment.from(m),p+2,p+2):void 0),t&&o.tr.setBlockType(k,k,o.schema.node(s).type,i?a.attrs:void 0),o.tr.setSelection(new _.TextSelection(o.doc.resolve(k))),o.tr.replace(l+1,c-1,h.content.size>0?new y.Slice(y.Fragment.from(h),p+2,p+2):void 0),o.tr.scrollIntoView()),!0}}},addProseMirrorPlugins(){return[Hn(),An()]},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.undoInputRule(),()=>o.command(({state:n})=>{const{contentType:r,startPos:a}=v(n.doc,n.selection.from),s=n.selection.from===a+1,l=r.name==="paragraph";return s&&!l?o.BNUpdateBlock(n.selection.from,{type:"paragraph",props:{}}):!1}),()=>o.command(({state:n})=>{const{startPos:r}=v(n.doc,n.selection.from);return n.selection.from===r+1?o.liftListItem("blockContainer"):!1}),()=>o.command(({state:n})=>{const{depth:r,startPos:a}=v(n.doc,n.selection.from),s=n.selection.from===a+1,l=n.selection.empty,c=a===2,p=a-1;return!c&&s&&l&&r===2?o.BNMergeBlocks(p):!1})]),Delete:()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.command(({state:n})=>{const{node:r,depth:a,endPos:s}=v(n.doc,n.selection.from),l=s===n.doc.nodeSize-4,c=n.selection.from===s-1,p=n.selection.empty,h=r.childCount===2;if(!l&&c&&p&&!h){let m=a,g=s+2,f=n.doc.resolve(g).depth;for(;f<m;)m=f,g+=2,f=n.doc.resolve(g).depth;return o.BNMergeBlocks(g-1)}return!1})]),Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.command(({state:n})=>{const{contentNode:r,depth:a}=v(n.doc,n.selection.from),s=n.selection.$anchor.parentOffset===0,l=n.selection.anchor===n.selection.head,c=r.childCount===0,p=a>2;return s&&l&&c&&p?o.liftListItem("blockContainer"):!1}),()=>o.command(({state:n,chain:r})=>{const{contentNode:a,endPos:s}=v(n.doc,n.selection.from),l=n.selection.$anchor.parentOffset===0,c=n.selection.anchor===n.selection.head,p=a.childCount===0;if(l&&c&&p){const h=s+1,m=h+2;return r().BNCreateBlock(h).setTextSelection(m).run(),!0}return!1}),()=>o.command(({state:n,chain:r})=>{const{contentNode:a}=v(n.doc,n.selection.from),s=n.selection.$anchor.parentOffset===0;return a.childCount===0?!1:(r().deleteSelection().BNSplitBlock(n.selection.from,s,s).run(),!0)})]),Tab:()=>{var o,n,r;return(o=this.options.editor.formattingToolbar)!=null&&o.shown||(n=this.options.editor.linkToolbar)!=null&&n.shown||(r=this.options.editor.filePanel)!=null&&r.shown?!1:(this.editor.commands.sinkListItem("blockContainer"),!0)},"Shift-Tab":()=>{var o,n,r;return(o=this.options.editor.formattingToolbar)!=null&&o.shown||(n=this.options.editor.linkToolbar)!=null&&n.shown||(r=this.options.editor.filePanel)!=null&&r.shown?!1:(this.editor.commands.liftListItem("blockContainer"),!0)}}}}),jn=b.Node.create({name:"blockGroup",group:"blockGroup",content:"blockContainer+",parseHTML(){return[{tag:"div",getAttrs:e=>typeof e=="string"?!1:e.getAttribute("data-node-type")==="blockGroup"?null:!1}]},renderHTML({HTMLAttributes:e}){var o;const t={...((o=this.options.domAttributes)==null?void 0:o.blockGroup)||{},...e},i=document.createElement("div");i.className=D("bn-block-group",t.class),i.setAttribute("data-node-type","blockGroup");for(const[n,r]of Object.entries(t))n!=="class"&&i.setAttribute(n,r);return{dom:i,contentDOM:i}}}),Rn=b.Node.create({name:"doc",topNode:!0,content:"blockGroup"}),mi=e=>{var o;const t=[b.extensions.ClipboardTextSerializer,b.extensions.Commands,b.extensions.Editable,b.extensions.FocusEvents,b.extensions.Tabindex,Vi.Gapcursor,G.configure({types:["blockContainer"]}),zi.HardBreak.extend({priority:10}),qi.Text,Ki.Link.extend({addKeyboardShortcuts(){return{"Mod-k":()=>(this.editor.commands.toggleLink({href:""}),!0)}}}),...Object.values(e.styleSpecs).map(n=>n.implementation.mark),Ln,Mn,Bn,b.Extension.create({name:"OverrideEscape",addKeyboardShortcuts(){return{Escape:()=>e.editor.suggestionMenus.shown?!1:this.editor.commands.blur()}}}),Rn,Un.configure({editor:e.editor,domAttributes:e.domAttributes}),jn.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(r=>r.configure({editor:e.editor,domAttributes:e.domAttributes})),n.implementation.node.configure({editor:e.editor,domAttributes:e.domAttributes})]),wn(e.editor),Sn(e.editor),Tn(e.editor),Oi.Dropcursor.configure({width:5,color:"#ddeeff"}),...e.trailingBlock===void 0||e.trailingBlock?[In]:[]];if(e.collaboration){if(t.push(io.default.configure({fragment:e.collaboration.fragment})),(o=e.collaboration.provider)!=null&&o.awareness){const n=r=>{const a=document.createElement("span");a.classList.add("collaboration-cursor__caret"),a.setAttribute("style",`border-color: ${r.color}`);const s=document.createElement("span");s.classList.add("collaboration-cursor__label"),s.setAttribute("style",`background-color: ${r.color}`),s.insertBefore(document.createTextNode(r.name),null);const l=document.createTextNode(""),c=document.createTextNode("");return a.insertBefore(l,null),a.insertBefore(s,null),a.insertBefore(c,null),a};t.push(oo.default.configure({user:e.collaboration.user,render:e.collaboration.renderCursor||n,provider:e.collaboration.provider}))}}else t.push(Fi.History);const i=e.disableExtensions||[];return t.filter(n=>!i.includes(n.name))};function On(e,t){const i=[];return e.forEach((o,n,r)=>{r!==t&&i.push(o)}),y.Fragment.from(i)}function Vn(e,t){let i=y.Fragment.from(e.content);for(let o=0;o<i.childCount;o++)if(i.child(o).type.spec.group==="blockContent"){const n=[i.child(o)];if(o+1<i.childCount&&i.child(o+1).type.spec.group==="blockGroup"){const a=i.child(o+1).child(0).child(0);(a.type.name==="bulletListItem"||a.type.name==="numberedListItem"||a.type.name==="checkListItem")&&(n.push(i.child(o+1)),i=On(i,o+1))}const r=t.state.schema.nodes.blockContainer.create(void 0,n);i=i.replaceChild(o,r)}return new y.Slice(i,e.openStart,e.openEnd)}function Re(e){return e&&Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}class he{constructor(t){u(this,"blockSpecs");u(this,"inlineContentSpecs");u(this,"styleSpecs");u(this,"blockSchema");u(this,"inlineContentSchema");u(this,"styleSchema");u(this,"BlockNoteEditor","only for types");u(this,"Block","only for types");u(this,"PartialBlock","only for types");this.blockSpecs=Re(t==null?void 0:t.blockSpecs)||Pe,this.inlineContentSpecs=Re(t==null?void 0:t.inlineContentSpecs)||Ne,this.styleSpecs=Re(t==null?void 0:t.styleSpecs)||Ae,this.blockSchema=Ee(this.blockSpecs),this.inlineContentSchema=Ce(this.inlineContentSpecs),this.styleSchema=Te(this.styleSpecs)}static create(t){return new he(t)}}class fi extends b.Editor{constructor(i,o){super({...i,content:void 0});u(this,"_state");u(this,"mount",i=>{i?(this.options.element=i,this.createViewAlternative()):this.destroy()});const n=this.schema;let r;const a=n.nodes.doc.createAndFill;n.nodes.doc.createAndFill=(...l)=>{if(r)return r;const c=a.apply(n.nodes.doc,l),p=JSON.parse(JSON.stringify(c.toJSON()));return p.content[0].content[0].attrs.id="initialBlockId",r=y.Node.fromJSON(n,p),r};let s;try{const l=i==null?void 0:i.content.map(c=>N(c,this.schema,o).toJSON());s=b.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(i.content))}this._state=_.EditorState.create({doc:s,schema:this.schema})}get state(){return this.view&&(this._state=this.view.state),this._state}dispatch(i){this.view?this.view.dispatch(i):this._state=this.state.apply(i)}createViewAlternative(){queueMicrotask(()=>{this.view=new M.EditorView({mount:this.options.element},{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:this.state});const i=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(i),this.createNodeViews()})}}fi.prototype.createView=()=>{};const zn=new _.PluginKey("blocknote-placeholder"),Fn=(e,t)=>new _.Plugin({key:zn,view:()=>{const i=document.createElement("style"),o=e._tiptapEditor.options.injectNonce;o&&i.setAttribute("nonce",o),e._tiptapEditor.view.root instanceof ShadowRoot?e._tiptapEditor.view.root.append(i):e._tiptapEditor.view.root.head.appendChild(i);const n=i.sheet,r=(s="")=>`.bn-block-content${s} .bn-inline-content:has(> .ProseMirror-trailingBreak:only-child):before`,a=(s,l=!0)=>{const c=l?"[data-is-empty-and-focused]":"";if(s==="default")return r(c);const p=`[data-content-type="${s}"]`;return r(c+p)};for(const[s,l]of Object.entries(t)){const c=s==="default";n.insertRule(`${a(s,c)}{ content: ${JSON.stringify(l)}; }`),c||n.insertRule(`${a(s,!0)}{ content: ${JSON.stringify(l)}; }`)}return{destroy:()=>{e._tiptapEditor.view.root instanceof ShadowRoot?e._tiptapEditor.view.root.removeChild(i):e._tiptapEditor.view.root.head.removeChild(i)}}},props:{decorations:i=>{const{doc:o,selection:n}=i;if(!e.isEditable||!n.empty)return;const r=n.$anchor,a=r.parent;if(a.content.size>0)return null;const s=r.before(),l=M.Decoration.node(s,s+a.nodeSize,{"data-is-empty-and-focused":"true"});return M.DecorationSet.create(o,[l])}}}),ar="",Kn={enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!1};class Oe{constructor(t){u(this,"_pmSchema");u(this,"headless",!1);u(this,"_tiptapEditor");u(this,"elementRenderer",null);u(this,"blockCache",new WeakMap);u(this,"dictionary");u(this,"schema");u(this,"blockImplementations");u(this,"inlineContentImplementations");u(this,"styleImplementations");u(this,"formattingToolbar");u(this,"linkToolbar");u(this,"sideMenu");u(this,"suggestionMenus");u(this,"filePanel");u(this,"tableHandles");u(this,"uploadFile");u(this,"resolveFileUrl");u(this,"mount",t=>{this._tiptapEditor.mount(t)});var l,c,p,h,m,g,f;this.options=t;const i=t;if(i.onEditorContentChange)throw new Error("onEditorContentChange initialization option is deprecated, use <BlockNoteView onChange={...} />, the useEditorChange(...) hook, or editor.onChange(...)");if(i.onTextCursorPositionChange)throw new Error("onTextCursorPositionChange initialization option is deprecated, use <BlockNoteView onSelectionChange={...} />, the useEditorSelectionChange(...) hook, or editor.onSelectionChange(...)");if(i.onEditorReady)throw new Error("onEditorReady is deprecated. Editor is immediately ready for use after creation.");if(i.editable)throw new Error("editable initialization option is deprecated, use <BlockNoteView editable={true/false} />, or alternatively editor.isEditable = true/false");this.dictionary=t.dictionary||Xe;const o={defaultStyles:!0,schema:t.schema||he.create(),_headless:!1,...t,placeholders:{...this.dictionary.placeholders,...t.placeholders}};this.schema=o.schema,this.blockImplementations=o.schema.blockSpecs,this.inlineContentImplementations=o.schema.inlineContentSpecs,this.styleImplementations=o.schema.styleSpecs,this.formattingToolbar=new Qt(this),this.linkToolbar=new ti(this),this.sideMenu=new ai(this),this.suggestionMenus=new si(this),this.filePanel=new Zt(this),B("table",this)&&(this.tableHandles=new ci(this));const n=mi({editor:this,domAttributes:o.domAttributes||{},blockSpecs:this.schema.blockSpecs,styleSpecs:this.schema.styleSpecs,inlineContentSpecs:this.schema.inlineContentSpecs,collaboration:o.collaboration,trailingBlock:o.trailingBlock,disableExtensions:o.disableExtensions}),r=b.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]:[],Fn(this,o.placeholders)]});n.push(r),this.uploadFile=o.uploadFile,this.resolveFileUrl=o.resolveFileUrl||(async k=>k),this.headless=o._headless,o.collaboration&&o.initialContent&&console.warn("When using Collaboration, initialContent might cause conflicts, because changes should come from the collaboration provider");const a=o.initialContent||(t.collaboration?[{type:"paragraph",id:"initialBlockId"}]:[{type:"paragraph",id:G.options.generateID()}]);if(!Array.isArray(a)||a.length===0)throw new Error("initialContent must be a non-empty array of blocks, received: "+a);const s={...Kn,...o._tiptapOptions,content:a,extensions:[...((l=o._tiptapOptions)==null?void 0:l.extensions)||[],...n],editorProps:{...(c=o._tiptapOptions)==null?void 0:c.editorProps,attributes:{...(h=(p=o._tiptapOptions)==null?void 0:p.editorProps)==null?void 0:h.attributes,...(m=o.domAttributes)==null?void 0:m.editor,class:D("bn-editor",o.defaultStyles?"bn-default-styles":"",((f=(g=o.domAttributes)==null?void 0:g.editor)==null?void 0:f.class)||"")},transformPasted:Vn}};this.headless?this._pmSchema=b.getSchema(s.extensions):(this._tiptapEditor=new fi(s,this.schema.styleSchema),this._pmSchema=this._tiptapEditor.schema)}get pmSchema(){return this._pmSchema}static create(t={}){return new Oe(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()}get topLevelBlocks(){return this.document}get document(){const t=[];return this._tiptapEditor.state.doc.firstChild.descendants(i=>(t.push(C(i,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.blockCache)),!1)),t}getBlock(t){const i=typeof t=="string"?t:t.id;let o;return this._tiptapEditor.state.doc.firstChild.descendants(n=>typeof o<"u"?!1:n.type.name!=="blockContainer"||n.attrs.id!==i?!0:(o=C(n,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.blockCache),!1)),o}forEachBlock(t,i=!1){const o=this.document.slice();i&&o.reverse();function n(r){for(const a of r){if(!t(a))return!1;const s=i?a.children.slice().reverse():a.children;if(!n(s))return!1}return!0}n(o)}onEditorContentChange(t){this._tiptapEditor.on("update",t)}onEditorSelectionChange(t){this._tiptapEditor.on("selectionUpdate",t)}getTextCursorPosition(){const{node:t,depth:i,startPos:o,endPos:n}=v(this._tiptapEditor.state.doc,this._tiptapEditor.state.selection.from),r=this._tiptapEditor.state.doc.resolve(n).index(i-1),a=this._tiptapEditor.state.doc.resolve(n+1).node().childCount;let s;r>0&&(s=this._tiptapEditor.state.doc.resolve(o-2).node());let l;return r<a-1&&(l=this._tiptapEditor.state.doc.resolve(n+2).node()),{block:C(t,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.blockCache),prevBlock:s===void 0?void 0:C(s,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.blockCache),nextBlock:l===void 0?void 0:C(l,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.blockCache)}}setTextCursorPosition(t,i="start"){const o=typeof t=="string"?t:t.id,{posBeforeNode:n}=He(o,this._tiptapEditor.state.doc),{startPos:r,contentNode:a}=v(this._tiptapEditor.state.doc,n+2),s=this.schema.blockSchema[a.type.name].content;if(s==="none"){this._tiptapEditor.commands.setNodeSelection(r);return}if(s==="inline")i==="start"?this._tiptapEditor.commands.setTextSelection(r+1):this._tiptapEditor.commands.setTextSelection(r+a.nodeSize-1);else if(s==="table")i==="start"?this._tiptapEditor.commands.setTextSelection(r+4):this._tiptapEditor.commands.setTextSelection(r+a.nodeSize-4);else throw new I(s)}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((i,o)=>i.type.spec.group!=="blockContent"||o+i.nodeSize<this._tiptapEditor.state.selection.from||o>this._tiptapEditor.state.selection.to?!0:(t.push(C(this._tiptapEditor.state.doc.resolve(o).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}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,i,o="before"){return Jo(t,i,o,this)}updateBlock(t,i){return Yo(t,i,this)}removeBlocks(t){return Qo(t,this)}replaceBlocks(t,i){return en(t,i,this)}insertInlineContent(t){const i=F(t,this.pmSchema,this.schema.styleSchema);tn({from:this._tiptapEditor.state.selection.from,to:this._tiptapEditor.state.selection.to},i,this)}getActiveStyles(){const t={},i=this._tiptapEditor.state.selection.$to.marks();for(const o of i){const n=this.schema.styleSchema[o.type.name];if(!n){o.type.name!=="link"&&console.warn("mark not found in styleschema",o.type.name);continue}n.propSchema==="boolean"?t[n.type]=!0:t[n.type]=o.attrs.stringValue}return t}addStyles(t){for(const[i,o]of Object.entries(t)){const n=this.schema.styleSchema[i];if(!n)throw new Error(`style ${i} not found in styleSchema`);if(n.propSchema==="boolean")this._tiptapEditor.commands.setMark(i);else if(n.propSchema==="string")this._tiptapEditor.commands.setMark(i,{stringValue:o});else throw new I(n.propSchema)}}removeStyles(t){for(const i of Object.keys(t))this._tiptapEditor.commands.unsetMark(i)}toggleStyles(t){for(const[i,o]of Object.entries(t)){const n=this.schema.styleSchema[i];if(!n)throw new Error(`style ${i} not found in styleSchema`);if(n.propSchema==="boolean")this._tiptapEditor.commands.toggleMark(i);else if(n.propSchema==="string")this._tiptapEditor.commands.toggleMark(i,{stringValue:o});else throw new I(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,i){if(t==="")return;const{from:o,to:n}=this._tiptapEditor.state.selection;i||(i=this._tiptapEditor.state.doc.textBetween(o,n));const r=this.pmSchema.mark("link",{href:t});this.dispatch(this._tiptapEditor.state.tr.insertText(i,o,n).addMark(o,o+i.length,r))}canNestBlock(){const{startPos:t,depth:i}=v(this._tiptapEditor.state.doc,this._tiptapEditor.state.selection.from);return this._tiptapEditor.state.doc.resolve(t).index(i-1)>0}nestBlock(){this._tiptapEditor.commands.sinkListItem("blockContainer")}canUnnestBlock(){const{depth:t}=v(this._tiptapEditor.state.doc,this._tiptapEditor.state.selection.from);return t>2}unnestBlock(){this._tiptapEditor.commands.liftListItem("blockContainer")}async blocksToHTMLLossy(t=this.document){return Y(this.pmSchema,this).exportBlocks(t,{})}async blocksToFullHTML(t){return le(this.pmSchema,this).serializeBlocks(t,{})}async tryParseHTMLToBlocks(t){return De(t,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.pmSchema)}async blocksToMarkdownLossy(t=this.document){return qt(t,this.pmSchema,this,{})}async tryParseMarkdownToBlocks(t){return $t(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 i=()=>{t(this)};return this._tiptapEditor.on("update",i),()=>{this._tiptapEditor.off("update",i)}}onSelectionChange(t){if(this.headless)return;const i=()=>{t(this)};return this._tiptapEditor.on("selectionUpdate",i),()=>{this._tiptapEditor.off("selectionUpdate",i)}}openSelectionMenu(t){this.prosemirrorView.focus(),this.prosemirrorView.dispatch(this.prosemirrorView.state.tr.scrollIntoView().setMeta(this.suggestionMenus.plugin,{triggerCharacter:t,fromUserInput:!1}))}}let gi=!1;const bi=no.default;async function qn(e,t){return Vt("text",e)?(gi||(gi=!0,await qe.init({emojiMartData:bi})),(t.trim()===""?Object.values(bi.emojis):await qe.SearchIndex.search(t)).map(o=>({id:o.skins[0].native,onItemClick:()=>e.insertInlineContent(o.skins[0].native+" ")}))):[]}function Ve(e=""){return typeof e=="string"?[{type:"text",text:e,styles:{}}]:e}function ki(e){return typeof e=="string"?Ve(e):Array.isArray(e)?e.flatMap(t=>typeof t=="string"?Ve(t):be(t)?{...t,content:Ve(t.content)}:W(t)?t:{props:{},...t,content:ki(t.content)}):e}function Gn(e,t){return t.map(i=>ze(e,i))}function ze(e,t){const i={id:"",type:t.type,props:{},content:e[t.type].content==="inline"?[]:void 0,children:[],...t};return Object.entries(e[t.type].propSchema).forEach(([o,n])=>{i.props[o]===void 0&&(i.props[o]=n.default)}),{...i,content:ki(i.content),children:i.children.map(o=>ze(e,o))}}function _i(e){e.id||(e.id=G.options.generateID()),e.children&&yi(e.children)}function yi(e){for(const t of e)_i(t)}d.AudioBlock=_t,d.BlockNoteEditor=Oe,d.BlockNoteSchema=he,d.FileBlock=Ct,d.FilePanelProsemirrorPlugin=Zt,d.FilePanelView=Xt,d.FormattingToolbarProsemirrorPlugin=Qt,d.FormattingToolbarView=Jt,d.HTMLToBlocks=De,d.ImageBlock=It,d.LinkToolbarProsemirrorPlugin=ti,d.SideMenuProsemirrorPlugin=ai,d.SideMenuView=ni,d.SuggestionMenuProseMirrorPlugin=si,d.TableHandlesProsemirrorPlugin=ci,d.TableHandlesView=di,d.UniqueID=G,d.UnreachableCaseError=I,d.VideoBlock=jt,d.addIdsToBlock=_i,d.addIdsToBlocks=yi,d.addInlineContentAttributes=rt,d.addInlineContentKeyboardShortcuts=at,d.addStyleAttributes=ut,d.assertEmpty=co,d.audioBlockConfig=ft,d.audioParse=bt,d.audioPropSchema=mt,d.audioRender=gt,d.audioToExternalHTML=kt,d.blockToNode=N,d.blocksToMarkdown=qt,d.camelToDataKebab=Q,d.checkBlockHasDefaultProp=Zo,d.checkBlockIsDefaultType=zt,d.checkBlockIsFileBlock=Wo,d.checkBlockIsFileBlockWithPlaceholder=Xo,d.checkBlockIsFileBlockWithPreview=$o,d.checkBlockTypeHasDefaultProp=Ft,d.checkDefaultBlockTypeInSchema=B,d.checkDefaultInlineContentTypeInSchema=Vt,d.cleanHTMLToMarkdown=ue,d.contentNodeToInlineContent=se,d.createAddFileButton=ie,d.createBlockSpec=ee,d.createBlockSpecFromStronglyTypedTiptapNode=q,d.createDefaultFilePreview=te,d.createExternalHTMLExporter=Y,d.createFigureWithCaption=ce,d.createFileAndCaptionWrapper=R,d.createInlineContentSpec=bo,d.createInlineContentSpecFromTipTapNode=lt,d.createInternalBlockSpec=xe,d.createInternalHTMLSerializer=le,d.createInternalInlineContentSpec=st,d.createInternalStyleSpec=Se,d.createLinkWithCaption=ne,d.createResizeHandlesWrapper=Be,d.createStronglyTypedTiptapNode=U,d.createStyleSpec=ko,d.createStyleSpecFromTipTapMark=j,d.createSuggestionMenu=bn,d.defaultBlockSchema=Rt,d.defaultBlockSpecs=Pe,d.defaultInlineContentSchema=Ot,d.defaultInlineContentSpecs=Ne,d.defaultProps=x,d.defaultStyleSchema=Go,d.defaultStyleSpecs=Ae,d.fileBlockConfig=wt,d.fileParse=xt,d.filePropSchema=yt,d.fileRender=vt,d.fileToExternalHTML=Et,d.filenameFromURL=go,d.filterSuggestionItems=En,d.formatKeyboardShortcut=H,d.formattingToolbarPluginKey=Yt,d.getBlockFromPos=ot,d.getBlockNoteExtensions=mi,d.getBlockSchemaFromSpecs=Ee,d.getDefaultEmojiPickerItems=qn,d.getDefaultSlashMenuItems=xn,d.getDraggableBlockFromElement=re,d.getInlineContentParseRules=dt,d.getInlineContentSchemaFromSpecs=Ce,d.getParseRules=nt,d.getStyleParseRules=pt,d.getStyleSchemaFromSpecs=Te,d.imageBlockConfig=Tt,d.imageParse=Bt,d.imagePropSchema=St,d.imageRender=Mt,d.imageToExternalHTML=Lt,d.inheritedProps=we,d.inlineContentToNodes=F,d.insertOrUpdateBlock=T,d.isAppleOS=tt,d.isLinkInlineContent=ge,d.isPartialLinkInlineContent=be,d.isSafari=fo,d.isStyledTextInlineContent=W,d.linkToolbarPluginKey=ei,d.locales=ao,d.markdownToBlocks=$t,d.mergeCSSClasses=D,d.nodeToBlock=C,d.nodeToCustomInlineContent=ye,d.parseEmbedElement=Me,d.parseFigureElement=oe,d.parseImageElement=Le,d.partialBlockToBlockForTesting=ze,d.partialBlocksToBlocksForTesting=Gn,d.propsToAttributes=ve,d.sideMenuPluginKey=ri,d.stylePropsToAttributes=ct,d.tableContentToNodes=_e,d.tableHandlesPluginKey=J,d.uploadToTmpFilesDotOrg_DEV_ONLY=_o,d.videoBlockConfig=Nt,d.videoParse=Dt,d.videoPropSchema=At,d.videoRender=Ht,d.videoToExternalHTML=Ut,d.wrapInBlockStructure=de,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
5
|
+
`,styles:{}};return}if(r.type.name!=="link"&&r.type.name!=="text"&&t[r.type.name]){n&&(o.push(n),n=void 0),o.push(we(r,t,i));return}const a={};let s;for(const l of r.marks)if(l.type.name==="link")s=l;else{const c=i[l.type.name];if(!c)throw new Error(`style ${l.type.name} not found in styleSchema`);if(c.propSchema==="boolean")a[c.type]=!0;else if(c.propSchema==="string")a[c.type]=l.attrs.stringValue;else throw new I(c.propSchema)}n?W(n)?s?(o.push(n),n={type:"link",href:s.attrs.href,content:[{type:"text",text:r.textContent,styles:a}]}):JSON.stringify(n.styles)===JSON.stringify(a)?n.text+=r.textContent:(o.push(n),n={type:"text",text:r.textContent,styles:a}):be(n)&&(s?n.href===s.attrs.href?JSON.stringify(n.content[n.content.length-1].styles)===JSON.stringify(a)?n.content[n.content.length-1].text+=r.textContent:n.content.push({type:"text",text:r.textContent,styles:a}):(o.push(n),n={type:"link",href:s.attrs.href,content:[{type:"text",text:r.textContent,styles:a}]}):(o.push(n),n={type:"text",text:r.textContent,styles:a})):s?n={type:"link",href:s.attrs.href,content:[{type:"text",text:r.textContent,styles:a}]}:n={type:"text",text:r.textContent,styles:a}}),n&&o.push(n),o}function we(e,t,i){if(e.type.name==="text"||e.type.name==="link")throw new Error("unexpected");const o={},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&&(o[s]=l)}let r;return n.content==="styled"?r=se(e,t,i):r=void 0,{type:e.type.name,props:o,content:r}}function x(e,t,i,o,n){if(e.type.name!=="blockContainer")throw Error("Node must be of type blockContainer, but is of type"+e.type.name+".");const r=n==null?void 0:n.get(e);if(r)return r;const a=Je(e);let s=a.id;s===null&&(s=G.options.generateID());const l={};for(const[g,f]of Object.entries({...e.attrs,...a.contentNode.attrs})){const k=t[a.contentType.name];if(!k)throw Error("Block is of an unrecognized type: "+a.contentType.name);const w=k.propSchema;g in w&&(l[g]=f)}const c=t[a.contentType.name],p=[];for(let g=0;g<a.numChildBlocks;g++)p.push(x(e.lastChild.child(g),t,i,o,n));let h;if(c.content==="inline")h=se(a.contentNode,i,o);else if(c.content==="table")h=lo(a.contentNode,i,o);else if(c.content==="none")h=void 0;else throw new I(c.content);const m={id:s,type:c.type,props:l,content:h,children:p};return n==null||n.set(e,m),m}function co(e){return e.document||window.document}const et=(e,t,i,o,n)=>{if(!i.nodes[e.type.name])throw new Error("Serializer is missing a node type: "+e.type.name);const{dom:r,contentDOM:a}=y.DOMSerializer.renderSpec(co(t),i.nodes[e.type.name](e));if(a){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");if(e.type.name==="blockContainer"){const s=e.childCount>0&&e.firstChild.type.spec.group==="blockContent"?e.firstChild:void 0,l=e.childCount>0&&e.lastChild.type.spec.group==="blockGroup"?e.lastChild:void 0;if(s!==void 0){const c=o.blockImplementations[s.type.name].implementation,h=(n?c.toExternalHTML:c.toInternalHTML)(x(e,o.schema.blockSchema,o.schema.inlineContentSchema,o.schema.styleSchema,o.blockCache),o);if(h.contentDOM!==void 0){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");h.contentDOM.appendChild(i.serializeFragment(s.content,t))}a.appendChild(h.dom)}l!==void 0&&i.serializeFragment(y.Fragment.from(l),t,a)}else i.serializeFragment(e.content,t,a)}return r},tt=(e,t,i)=>{const o=t.serializeFragment(e,i),n=document.createElement("div");return n.appendChild(o),n.innerHTML};function uo(e){const t=new Set([...e.orderedListItemBlockTypes,...e.unorderedListItemBlockTypes]),i=o=>{var a;if(o.children.length===1&&((a=o.children[0].properties)==null?void 0:a.dataNodeType)==="blockGroup"){const s=o.children[0];o.children.pop(),o.children.push(...s.children)}let n=o.children.length,r;for(let s=0;s<n;s++){const c=o.children[s].children[0],p=c.children.find(f=>{const k=f.properties,w=k==null?void 0:k.className;return w==null?void 0:w.includes("bn-block-content")}),h=c.children.find(f=>{const k=f.properties,w=k==null?void 0:k.className;return w==null?void 0:w.includes("bn-block-group")});if(!p){o.children.splice(s,1,...h.children),i(o);return}const m=t.has(p.properties.dataContentType),g=m?e.orderedListItemBlockTypes.has(p.properties.dataContentType)?"ol":"ul":null;if(h&&i(h),r&&r.tagName!==g){o.children.splice(s-r.children.length,r.children.length,r);const f=r.children.length-1;s-=f,n-=f,r=void 0}if(m){r||(r=ge.fromDom(document.createElement(g)));const f=ge.fromDom(document.createElement("li"));f.children.push(...p.children),h&&f.children.push(...h.children),r.children.push(f)}else if(h){o.children.splice(s+1,0,...h.children),o.children[s]=p.children[0];const f=h.children.length;s+=f,n+=f}else o.children[s]=p.children[0]}r&&o.children.splice(n-r.children.length,r.children.length,r)};return i}const Y=(e,t)=>{const i=y.DOMSerializer.fromSchema(e);return i.serializeNodeInner=(o,n)=>et(o,n,i,t,!0),i.exportProseMirrorFragment=(o,n)=>fe.unified().use(We.default,{fragment:!0}).use(uo,{orderedListItemBlockTypes:new Set(["numberedListItem"]),unorderedListItemBlockTypes:new Set(["bulletListItem","checkListItem"])}).use($e.default).processSync(tt(o,i,n)).value,i.exportBlocks=(o,n)=>{const r=o.map(s=>N(s,e,t.schema.styleSchema)),a=e.nodes.blockGroup.create(null,r);return i.exportProseMirrorFragment(y.Fragment.from(a),n)},i},le=(e,t)=>{const i=y.DOMSerializer.fromSchema(e);return i.serializeNodeInner=(o,n)=>et(o,n,i,t,!1),i.serializeProseMirrorFragment=(o,n)=>tt(o,i,n),i.serializeBlocks=(o,n)=>{const r=o.map(s=>N(s,e,t.schema.styleSchema)),a=e.nodes.blockGroup.create(null,r);return i.serializeProseMirrorFragment(y.Fragment.from(a),n)},i},it=()=>typeof navigator<"u"&&(/Mac/.test(navigator.platform)||/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent));function H(e,t="Ctrl"){return it()?e.replace("Mod","⌘"):e.replace("Mod",t)}function D(...e){return e.filter(t=>t).join(" ")}const po=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function F(e,t,i,o){const n=document.createElement("div");n.className=D("bn-block-content",i.class),n.setAttribute("data-content-type",e);for(const[a,s]of Object.entries(i))a!=="class"&&n.setAttribute(a,s);const r=document.createElement(t);r.className=D("bn-inline-content",o.class);for(const[a,s]of Object.entries(o))a!=="class"&&r.setAttribute(a,s);return n.appendChild(r),{dom:n,contentDOM:r}}const ot=(e,t)=>{const i=N(e,t.pmSchema,t.schema.styleSchema).firstChild,o=t.pmSchema.nodes[i.type.name].spec.toDOM;if(o===void 0)throw new Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");const n=o(i);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"]}},ve=["backgroundColor","textColor"];function Q(e){return"data-"+e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ho(e){const t=e.split("/");return!t.length||t[t.length-1]===""?e:t[t.length-1]}function Ee(e){const t={};return Object.entries(e).filter(([i,o])=>!ve.includes(i)).forEach(([i,o])=>{t[i]={default:o.default,keepOnSplit:!0,parseHTML:n=>{const r=n.getAttribute(Q(i));if(r===null)return null;if(typeof o.default=="boolean")return r==="true"?!0:r==="false"?!1:null;if(typeof o.default=="number"){const a=parseFloat(r);return!Number.isNaN(a)&&Number.isFinite(a)?a:null}return r},renderHTML:n=>n[i]!==o.default?{[Q(i)]:n[i]}:{}}}),t}function nt(e,t,i,o){if(typeof e=="boolean")throw new Error("Cannot find node position as getPos is a boolean, not a function.");const n=e(),a=i.state.doc.resolve(n).node().attrs.id;if(!a)throw new Error("Block doesn't have id");const s=t.getBlock(a);if(s.type!==o)throw new Error("Block type does not match");return s}function de(e,t,i,o,n=!1,r){const a=document.createElement("div");if(r!==void 0)for(const[s,l]of Object.entries(r))s!=="class"&&a.setAttribute(s,l);a.className=D("bn-block-content",(r==null?void 0:r.class)||""),a.setAttribute("data-content-type",t);for(const[s,l]of Object.entries(i))!ve.includes(s)&&l!==o[s].default&&a.setAttribute(Q(s),l);return n&&a.setAttribute("data-file-block",""),a.appendChild(e.dom),e.contentDOM!==void 0&&(e.contentDOM.className=D("bn-inline-content",e.contentDOM.className),e.contentDOM.setAttribute("data-editable","")),{...e,dom:a}}function U(e){return b.Node.create(e)}function xe(e,t){return{config:e,implementation:t}}function K(e,t,i){return xe({type:e.name,content:e.config.content==="inline*"?"inline":e.config.content==="tableRow+"?"table":"none",propSchema:t},{node:e,requiredExtensions:i,toInternalHTML:ot,toExternalHTML:ot})}function Ce(e){return Object.fromEntries(Object.entries(e).map(([t,i])=>[t,i.config]))}function rt(e,t){const i=[{tag:"[data-content-type="+e.type+"]",contentElement:"[data-editable]"}];return t&&i.push({tag:"*",getAttrs(o){if(typeof o=="string")return!1;const n=t==null?void 0:t(o);return n===void 0?!1:n}}),i}function ee(e,t){const i=U({name:e.type,content:e.content==="inline"?"inline*":"",group:"blockContent",selectable:!0,addAttributes(){return Ee(e.propSchema)},parseHTML(){return rt(e,t.parse)},renderHTML(){const o=document.createElement("div");return o.setAttribute("data-tmp-placeholder","true"),{dom:o}},addNodeView(){return({getPos:o})=>{var l;const n=this.options.editor,r=nt(o,n,this.editor,e.type),a=((l=this.options.domAttributes)==null?void 0:l.blockContent)||{},s=t.render(r,n);return de(s,r.type,r.props,e.propSchema,a)}}});if(i.name!==e.type)throw new Error("Node name does not match block type. This is a bug in BlockNote.");return xe(e,{node:i,toInternalHTML:(o,n)=>{var s;const r=((s=i.options.domAttributes)==null?void 0:s.blockContent)||{},a=t.render(o,n);return de(a,o.type,o.props,e.propSchema,e.isFileBlock,r)},toExternalHTML:(o,n)=>{var s,l;const r=((s=i.options.domAttributes)==null?void 0:s.blockContent)||{};let a=(l=t.toExternalHTML)==null?void 0:l.call(t,o,n);return a===void 0&&(a=t.render(o,n)),de(a,o.type,o.props,e.propSchema,r)}})}function at(e,t,i,o){return e.dom.setAttribute("data-inline-content-type",t),Object.entries(i).filter(([n,r])=>r!==o[n].default).map(([n,r])=>[Q(n),r]).forEach(([n,r])=>e.dom.setAttribute(n,r)),e.contentDOM!==void 0&&e.contentDOM.setAttribute("data-editable",""),e}function st(e){return{Backspace:({editor:t})=>{const i=t.state.selection.$from;return t.state.selection.empty&&i.node().type.name===e.type&&i.parentOffset===0}}}function lt(e,t){return{config:e,implementation:t}}function dt(e,t){return lt({type:e.name,propSchema:t,content:e.config.content==="inline*"?"styled":"none"},{node:e})}function Se(e){return Object.fromEntries(Object.entries(e).map(([t,i])=>[t,i.config]))}function ct(e){return[{tag:`[data-inline-content-type="${e.type}"]`,contentElement:t=>{const i=t;return i.matches("[data-editable]")?i:i.querySelector("[data-editable]")||i}}]}function mo(e,t){const i=b.Node.create({name:e.type,inline:!0,group:"inline",selectable:e.content==="styled",atom:e.content==="none",content:e.content==="styled"?"inline*":"",addAttributes(){return Ee(e.propSchema)},addKeyboardShortcuts(){return st(e)},parseHTML(){return ct(e)},renderHTML({node:o}){const n=this.options.editor,r=t.render(we(o,n.schema.inlineContentSchema,n.schema.styleSchema));return at(r,e.type,o.attrs,e.propSchema)}});return dt(i,e.propSchema)}function ut(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 pt(e,t,i,o){return e.dom.setAttribute("data-style-type",t),o==="string"&&e.dom.setAttribute("data-value",i),e.contentDOM!==void 0&&e.contentDOM.setAttribute("data-editable",""),e}function Te(e,t){return{config:e,implementation:t}}function j(e,t){return Te({type:e.name,propSchema:t},{mark:e})}function Me(e){return Object.fromEntries(Object.entries(e).map(([t,i])=>[t,i.config]))}function ht(e){return[{tag:`[data-style-type="${e.type}"]`,contentElement:t=>{const i=t;return i.matches("[data-editable]")?i:i.querySelector("[data-editable]")||i}}]}function fo(e,t){const i=b.Mark.create({name:e.type,addAttributes(){return ut(e.propSchema)},parseHTML(){return ht(e)},renderHTML({mark:o}){let n;if(e.propSchema==="boolean")n=t.render();else if(e.propSchema==="string")n=t.render(o.attrs.stringValue);else throw new I(e.propSchema);return pt(n,e.type,o.attrs.stringValue,e.propSchema)}});return Te(e,{mark:i})}const te=e=>{const t=document.createElement("div");t.className="bn-file-default-preview";const i=document.createElement("div");i.className="bn-file-default-preview-icon",i.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>';const o=document.createElement("p");return o.className="bn-file-default-preview-name",o.textContent=e.props.name||"",t.appendChild(i),t.appendChild(o),{dom:t}},R=(e,t)=>{const i=document.createElement("div");i.className="bn-file-and-caption-wrapper";const o=document.createElement("p");return o.className="bn-file-caption",o.textContent=e.props.caption,i.appendChild(t),i.appendChild(o),{dom:i}},ie=(e,t,i,o)=>{const n=document.createElement("div");n.className="bn-add-file-button";const r=document.createElement("div");r.className="bn-add-file-button-icon",o?r.appendChild(o):r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>';const a=document.createElement("p");a.className="bn-add-file-button-text",a.innerHTML=i||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(r),n.appendChild(a),n.addEventListener("mousedown",s,!0),n.addEventListener("click",l,!0),{dom:n,destroy:()=>{n.removeEventListener("mousedown",s,!0),n.removeEventListener("click",l,!0)}}},Be=e=>({url:e.src||void 0}),oe=(e,t)=>{const i=e.querySelector(t);if(!i)return;const o=e.querySelector("figcaption"),n=(o==null?void 0:o.textContent)??void 0;return{targetElement:i,caption:n}},ne=(e,t)=>{const i=document.createElement("div"),o=document.createElement("p");return o.textContent=t,i.appendChild(e),i.appendChild(o),{dom:i}},ce=(e,t)=>{const i=document.createElement("figure"),o=document.createElement("figcaption");return o.textContent=t,i.appendChild(e),i.appendChild(o),{dom:i}},Le=(e,t,i,o,n)=>{if(!e.props.previewWidth)throw new Error("Block must have a `previewWidth` prop.");const r=document.createElement("div");r.className="bn-visual-media-wrapper";const a=document.createElement("div");a.className="bn-visual-media-resize-handle",a.style.left="4px";const s=document.createElement("div");s.className="bn-visual-media-resize-handle",s.style.right="4px";let l;const c=k=>{if(!l){!t.isEditable&&r.contains(a)&&r.contains(s)&&(r.removeChild(a),r.removeChild(s));return}let w;e.props.textAlignment==="center"?l.handleUsed==="left"?w=l.initialWidth+(l.initialClientX-k.clientX)*2:w=l.initialWidth+(k.clientX-l.initialClientX)*2:l.handleUsed==="left"?w=l.initialWidth+l.initialClientX-k.clientX:w=l.initialWidth+k.clientX-l.initialClientX;const O=64;w<O?n(O):w>t.domElement.firstElementChild.clientWidth?n(t.domElement.firstElementChild.clientWidth):n(w)},p=k=>{(!k.target||!r.contains(k.target)||!t.isEditable)&&r.contains(a)&&r.contains(s)&&(r.removeChild(a),r.removeChild(s)),l&&(l=void 0,t.updateBlock(e,{props:{previewWidth:o()}}))},h=()=>{t.isEditable&&(r.appendChild(a),r.appendChild(s))},m=k=>{k.relatedTarget===a||k.relatedTarget===s||l||t.isEditable&&r.contains(a)&&r.contains(s)&&(r.removeChild(a),r.removeChild(s))},g=k=>{k.preventDefault(),r.appendChild(a),r.appendChild(s),l={handleUsed:"left",initialWidth:e.props.previewWidth,initialClientX:k.clientX}},f=k=>{k.preventDefault(),r.appendChild(a),r.appendChild(s),l={handleUsed:"right",initialWidth:e.props.previewWidth,initialClientX:k.clientX}};return r.appendChild(i),window.addEventListener("mousemove",c),window.addEventListener("mouseup",p),i.addEventListener("mouseenter",h),i.addEventListener("mouseleave",m),a.addEventListener("mousedown",g),s.addEventListener("mousedown",f),{dom:r,destroy:()=>{window.removeEventListener("mousemove",c),window.removeEventListener("mouseup",p),i.removeEventListener("mouseenter",h),i.removeEventListener("mouseleave",m),a.removeEventListener("mousedown",g),s.removeEventListener("mousedown",f)}}},mt=e=>({url:e.src||void 0}),ft={backgroundColor:E.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0}},gt={type:"audio",propSchema:ft,content:"none",isFileBlock:!0,fileBlockAcceptMimeTypes:["audio/*"]},bt=(e,t)=>{const i=document.createElement("div");if(i.className="bn-file-block-content-wrapper",e.props.url===""){const o=document.createElement("div");o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"></path></svg>';const n=ie(e,t,t.dictionary.file_blocks.audio.add_button_text,o.firstElementChild);return i.appendChild(n.dom),{dom:i,destroy:()=>{var r;(r=n==null?void 0:n.destroy)==null||r.call(n)}}}else if(e.props.showPreview){const o=document.createElement("audio");o.className="bn-audio",t.resolveFileUrl(e.props.url).then(r=>{o.src=r}),o.controls=!0,o.contentEditable="false",o.draggable=!1;const n=R(e,o);return i.appendChild(n.dom),{dom:i}}else{const o=te(e).dom;return{dom:R(e,o).dom}}},kt=e=>{if(e.tagName==="AUDIO")return mt(e);if(e.tagName==="FIGURE"){const t=oe(e,"audio");if(!t)return;const{targetElement:i,caption:o}=t;return{...mt(i),caption:o}}},_t=e=>{if(!e.props.url){const i=document.createElement("p");return i.textContent="Add audio",{dom:i}}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?ce(t,e.props.caption):ne(t,e.props.caption):{dom:t}},yt=ee(gt,{render:bt,parse:kt,toExternalHTML:_t}),wt={backgroundColor:E.backgroundColor,name:{default:""},url:{default:""},caption:{default:""}},vt={type:"file",propSchema:wt,content:"none",isFileBlock:!0},Et=(e,t)=>{const i=document.createElement("div");if(i.className="bn-file-block-content-wrapper",e.props.url===""){const o=ie(e,t);return i.appendChild(o.dom),{dom:i,destroy:o.destroy}}else{const o=te(e).dom,n=R(e,o);return i.appendChild(n.dom),{dom:i}}},xt=e=>{if(e.tagName==="EMBED")return Be(e);if(e.tagName==="FIGURE"){const t=oe(e,"embed");if(!t)return;const{targetElement:i,caption:o}=t;return{...Be(i),caption:o}}},Ct=e=>{if(!e.props.url){const i=document.createElement("p");return i.textContent="Add file",{dom:i}}const t=document.createElement("a");return t.href=e.props.url,t.textContent=e.props.name||e.props.url,e.props.caption?ne(t,e.props.caption):{dom:t}},St=ee(vt,{render:Et,parse:xt,toExternalHTML:Ct}),Ie=e=>{const t=e.src||void 0,i=e.width||void 0;return{url:t,previewWidth:i}},Tt={textAlignment:E.textAlignment,backgroundColor:E.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0},previewWidth:{default:512}},Mt={type:"image",propSchema:Tt,content:"none",isFileBlock:!0,fileBlockAcceptMimeTypes:["image/*"]},Bt=(e,t)=>{const i=document.createElement("div");if(i.className="bn-file-block-content-wrapper",e.props.url===""){const o=document.createElement("div");o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z"></path></svg>';const n=ie(e,t,t.dictionary.file_blocks.image.add_button_text,o.firstElementChild);return i.appendChild(n.dom),{dom:i,destroy:()=>{var r;(r=n==null?void 0:n.destroy)==null||r.call(n)}}}else if(e.props.showPreview){const o=document.createElement("img");o.className="bn-visual-media",t.resolveFileUrl(e.props.url).then(a=>{o.src=a}),o.alt=e.props.name||e.props.caption||"BlockNote image",o.contentEditable="false",o.draggable=!1,o.width=Math.min(e.props.previewWidth,t.domElement.firstElementChild.clientWidth);const n=Le(e,t,o,()=>o.width,a=>o.width=a),r=R(e,n.dom);return i.appendChild(r.dom),{dom:i,destroy:n.destroy}}else{const o=te(e).dom;return{dom:R(e,o).dom}}},Lt=e=>{if(e.tagName==="IMG")return Ie(e);if(e.tagName==="FIGURE"){const t=oe(e,"img");if(!t)return;const{targetElement:i,caption:o}=t;return{...Ie(i),caption:o}}},It=e=>{if(!e.props.url){const i=document.createElement("p");return i.textContent="Add image",{dom:i}}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?ce(t,e.props.caption):ne(t,e.props.caption):{dom:t}},Pt=ee(Mt,{render:Bt,parse:Lt,toExternalHTML:It}),At=e=>{const t=e.src||void 0,i=e.width||void 0;return{url:t,previewWidth:i}},Nt={textAlignment:E.textAlignment,backgroundColor:E.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0},previewWidth:{default:512}},Ht={type:"video",propSchema:Nt,content:"none",isFileBlock:!0,fileBlockAcceptMimeTypes:["video/*"]},Dt=(e,t)=>{const i=document.createElement("div");if(i.className="bn-file-block-content-wrapper",e.props.url===""){const o=document.createElement("div");o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z"></path></svg>';const n=ie(e,t,t.dictionary.file_blocks.video.add_button_text,o.firstElementChild);return i.appendChild(n.dom),{dom:i,destroy:()=>{var r;(r=n==null?void 0:n.destroy)==null||r.call(n)}}}else if(e.props.showPreview){const o=document.createElement("video");o.className="bn-visual-media",o.src=e.props.url,o.controls=!0,o.contentEditable="false",o.draggable=!1,o.width=Math.min(e.props.previewWidth,t.domElement.firstElementChild.clientWidth);const n=Le(e,t,o,()=>o.width,a=>o.width=a),r=R(e,n.dom);return i.appendChild(r.dom),{dom:i,destroy:n.destroy}}else{const o=te(e).dom;return{dom:R(e,o).dom}}},Ut=e=>{if(e.tagName==="VIDEO")return At(e);if(e.tagName==="FIGURE"){const t=oe(e,"video");if(!t)return;const{targetElement:i,caption:o}=t;return{...At(i),caption:o}}},jt=e=>{if(!e.props.url){const i=document.createElement("p");return i.textContent="Add video",{dom:i}}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?ce(t,e.props.caption):ne(t,e.props.caption):{dom:t}},Rt=ee(Ht,{render:Dt,parse:Ut,toExternalHTML:jt}),go=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/")},bo=b.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]}}),ko=j(bo,"string"),_o=b.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]}}),yo=j(_o,"string"),L=e=>{const{contentType:t}=v(e.state.doc,e.state.selection.from);return t.spec.content},wo={...E,level:{default:1,values:[1,2,3]}},vo=U({name:"heading",content:"inline*",group:"blockContent",addAttributes(){return{level:{default:1,parseHTML:e=>{const t=e.getAttribute("data-level"),i=parseInt(t);if(isFinite(i))return i},renderHTML:e=>({"data-level":e.level.toString()})}}},addInputRules(){return[...[1,2,3].map(e=>new b.InputRule({find:new RegExp(`^(#{${e}})\\s$`),handler:({state:t,chain:i,range:o})=>{L(this.editor)==="inline*"&&i().BNUpdateBlock(t.selection.from,{type:"heading",props:{level:e}}).deleteRange({from:o.from,to:o.to})}}))]},addKeyboardShortcuts(){return{"Mod-Alt-1":()=>L(this.editor)!=="inline*"?!0:this.editor.commands.BNUpdateBlock(this.editor.state.selection.anchor,{type:"heading",props:{level:1}}),"Mod-Alt-2":()=>L(this.editor)!=="inline*"?!0:this.editor.commands.BNUpdateBlock(this.editor.state.selection.anchor,{type:"heading",props:{level:2}}),"Mod-Alt-3":()=>L(this.editor)!=="inline*"?!0:this.editor.commands.BNUpdateBlock(this.editor.state.selection.anchor,{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 i,o;return F(this.name,`h${e.attrs.level}`,{...((i=this.options.domAttributes)==null?void 0:i.blockContent)||{},...t},((o=this.options.domAttributes)==null?void 0:o.inlineContent)||{})}}),Eo=K(vo,wo),Pe=e=>{const{contentNode:t,contentType:i}=v(e.state.doc,e.state.selection.from),o=e.state.selection.anchor===e.state.selection.head;return!(i.name==="bulletListItem"||i.name==="numberedListItem"||i.name==="checkListItem")||!o?!1:e.commands.first(({state:n,chain:r,commands:a})=>[()=>a.command(()=>t.childCount===0?a.BNUpdateBlock(n.selection.from,{type:"paragraph",props:{}}):!1),()=>a.command(()=>t.childCount>0?(r().deleteSelection().BNSplitBlock(n.selection.from,!0).run(),!0):!1)])},xo={...E},Co=U({name:"bulletListItem",content:"inline*",group:"blockContent",priority:90,addInputRules(){return[new b.InputRule({find:new RegExp("^[-+*]\\s$"),handler:({state:e,chain:t,range:i})=>{L(this.editor)==="inline*"&&t().BNUpdateBlock(e.selection.from,{type:"bulletListItem",props:{}}).deleteRange({from:i.from,to:i.to})}})]},addKeyboardShortcuts(){return{Enter:()=>Pe(this.editor),"Mod-Shift-8":()=>L(this.editor)!=="inline*"?!0:this.editor.commands.BNUpdateBlock(this.editor.state.selection.anchor,{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,i;return F(this.name,"p",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((i=this.options.domAttributes)==null?void 0:i.inlineContent)||{})}}),So=K(Co,xo),To=new _.PluginKey("numbered-list-indexing"),Mo=()=>new _.Plugin({key:To,appendTransaction:(e,t,i)=>{const o=i.tr;o.setMeta("numberedListIndexing",!0);let n=!1;return i.doc.descendants((r,a)=>{if(r.type.name==="blockContainer"&&r.firstChild.type.name==="numberedListItem"){let s="1";const l=a===1,c=v(o.doc,a+1);if(c===void 0)return;if(!l){const m=v(o.doc,a-2);if(m===void 0)return;if(!(c.depth!==m.depth)){const f=m.contentNode;if(m.contentType.name==="numberedListItem"){const O=f.attrs.index;s=(parseInt(O)+1).toString()}}}c.contentNode.attrs.index!==s&&(n=!0,o.setNodeMarkup(a+1,void 0,{index:s}))}}),n?o:null}}),Bo={...E},Lo=U({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 b.InputRule({find:new RegExp("^1\\.\\s$"),handler:({state:e,chain:t,range:i})=>{L(this.editor)==="inline*"&&t().BNUpdateBlock(e.selection.from,{type:"numberedListItem",props:{}}).deleteRange({from:i.from,to:i.to})}})]},addKeyboardShortcuts(){return{Enter:()=>Pe(this.editor),"Mod-Shift-7":()=>L(this.editor)!=="inline*"?!0:this.editor.commands.BNUpdateBlock(this.editor.state.selection.anchor,{type:"numberedListItem",props:{}})}},addProseMirrorPlugins(){return[Mo()]},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,i;return F(this.name,"p",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((i=this.options.domAttributes)==null?void 0:i.inlineContent)||{})}}),Io=K(Lo,Bo),Po={...E,checked:{default:!1}},Ao=U({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 b.InputRule({find:new RegExp("\\[\\s*\\]\\s$"),handler:({state:e,chain:t,range:i})=>{L(this.editor)==="inline*"&&t().BNUpdateBlock(e.selection.from,{type:"checkListItem",props:{checked:!1}}).deleteRange({from:i.from,to:i.to})}}),new b.InputRule({find:new RegExp("\\[[Xx]\\]\\s$"),handler:({state:e,chain:t,range:i})=>{L(this.editor)==="inline*"&&t().BNUpdateBlock(e.selection.from,{type:"checkListItem",props:{checked:!0}}).deleteRange({from:i.from,to:i.to})}})]},addKeyboardShortcuts(){return{Enter:()=>Pe(this.editor),"Mod-Shift-9":()=>L(this.editor)!=="inline*"?!0:this.editor.commands.BNUpdateBlock(this.editor.state.selection.anchor,{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 i=e.querySelector("input[type=checkbox]")||null;return i===null?!1:{checked:i.checked}}return!1},node:"checkListItem"}]},renderHTML({node:e,HTMLAttributes:t}){var r,a;const i=document.createElement("input");i.type="checkbox",i.checked=e.attrs.checked,e.attrs.checked&&i.setAttribute("checked","");const{dom:o,contentDOM:n}=F(this.name,"p",{...((r=this.options.domAttributes)==null?void 0:r.blockContent)||{},...t},((a=this.options.domAttributes)==null?void 0:a.inlineContent)||{});return o.insertBefore(i,n),{dom:o,contentDOM:n}},addNodeView(){return({node:e,getPos:t,editor:i,HTMLAttributes:o})=>{var p,h;const n=document.createElement("div"),r=document.createElement("div");r.contentEditable="false";const a=document.createElement("input");a.type="checkbox",a.checked=e.attrs.checked,e.attrs.checked&&a.setAttribute("checked","");const s=()=>{if(!i.isEditable){a.checked=!a.checked;return}typeof t!="boolean"&&this.editor.commands.BNUpdateBlock(t(),{type:"checkListItem",props:{checked:a.checked}})};a.addEventListener("change",s);const{dom:l,contentDOM:c}=F(this.name,"p",{...((p=this.options.domAttributes)==null?void 0:p.blockContent)||{},...o},((h=this.options.domAttributes)==null?void 0:h.inlineContent)||{});if(typeof t!="boolean"){const g="label-"+this.editor.state.doc.resolve(t()).node().attrs.id;a.setAttribute("aria-labelledby",g),c.id=g}return l.removeChild(c),l.appendChild(n),n.appendChild(r),n.appendChild(c),r.appendChild(a),{dom:l,contentDOM:c,destroy:()=>{a.removeEventListener("change",s)}}}}}),No=K(Ao,Po),Ho={...E},Do=U({name:"paragraph",content:"inline*",group:"blockContent",addKeyboardShortcuts(){return{"Mod-Alt-0":()=>L(this.editor)!=="inline*"?!0:this.editor.commands.BNUpdateBlock(this.editor.state.selection.anchor,{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,i;return F(this.name,"p",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((i=this.options.domAttributes)==null?void 0:i.inlineContent)||{})}}),Uo=K(Do,Ho),jo=b.Extension.create({name:"BlockNoteTableExtension",addProseMirrorPlugins:()=>[Ke.columnResizing({cellMinWidth:100}),Ke.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,i=e.$head.parentOffset===0,o=e.$head.node().type.name==="tableParagraph";return t&&i&&o}}},extendNodeSchema(e){const t={name:e.name,options:e.options,storage:e.storage};return{tableRole:b.callOrReturn(b.getExtensionField(e,"tableRole",t))}}}),Ro={...E},Oo=U({name:"table",content:"tableRow+",group:"blockContent",tableRole:"table",isolating:!0,parseHTML(){return[{tag:"table"}]},renderHTML({HTMLAttributes:e}){var t,i;return F(this.name,"table",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((i=this.options.domAttributes)==null?void 0:i.inlineContent)||{})}}),Vo=b.Node.create({name:"tableParagraph",group:"tableContent",content:"inline*",parseHTML(){return[{tag:"td"},{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",b.mergeAttributes(this.options.HTMLAttributes,e),0]}}),zo=K(Oo,Ro,[jo,Vo,Ii.TableHeader.extend({content:"tableContent"}),Li.TableCell.extend({content:"tableContent"}),Pi.TableRow]),Ae={paragraph:Uo,heading:Eo,bulletListItem:So,numberedListItem:Io,checkListItem:No,table:zo,file:St,image:Pt,video:Rt,audio:yt},Ot=Ce(Ae),Ne={bold:j(qi.default,"boolean"),italic:j(Wi.default,"boolean"),underline:j(Xi.default,"boolean"),strike:j($i.default,"boolean"),code:j(Gi.default,"boolean"),textColor:yo,backgroundColor:ko},Fo=Me(Ne),He={text:{config:"text",implementation:{}},link:{config:"link",implementation:{}}},Vt=Se(He);function B(e,t){return e in t.schema.blockSchema&&t.schema.blockSchema[e]===Ot[e]}function zt(e,t){return e in t.schema.inlineContentSchema&&t.schema.inlineContentSchema[e]===Vt[e]}function Ft(e,t,i){return t.type===e&&t.type in i.schema.blockSchema&&B(t.type,i)}function Ko(e,t){return e.type in t.schema.blockSchema&&t.schema.blockSchema[e.type].isFileBlock||!1}function qo(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 Go(e,t){return t.schema.blockSchema[e.type].isFileBlock&&!e.props.url}function Kt(e,t,i){return t in i.schema.blockSchema&&e in i.schema.blockSchema[t].propSchema&&i.schema.blockSchema[t].propSchema[e]===E[e]}function Wo(e,t,i){return Kt(e,t.type,i)}function De(e,t){let i,o;if(t.firstChild.descendants((n,r)=>i?!1:n.type.name!=="blockContainer"||n.attrs.id!==e?!0:(i=n,o=r+1,!1)),i===void 0||o===void 0)throw Error("Could not find block in the editor with matching ID.");return{node:i,posBeforeNode:o}}function $o(e,t,i="before",o){const n=typeof t=="string"?t:t.id,r=[];for(const c of e)r.push(N(c,o.pmSchema,o.schema.styleSchema));const{node:a,posBeforeNode:s}=De(n,o._tiptapEditor.state.doc);if(i==="before"&&o.dispatch(o._tiptapEditor.state.tr.insert(s,r)),i==="after"&&o.dispatch(o._tiptapEditor.state.tr.insert(s+a.nodeSize,r)),i==="nested"&&a.childCount<2){const c=o._tiptapEditor.state.schema.nodes.blockGroup.create({},r);o.dispatch(o._tiptapEditor.state.tr.insert(s+a.firstChild.nodeSize+1,c))}const l=[];for(const c of r)l.push(x(c,o.schema.blockSchema,o.schema.inlineContentSchema,o.schema.styleSchema,o.blockCache));return l}function Xo(e,t,i){const o=i._tiptapEditor,n=typeof e=="string"?e:e.id,{posBeforeNode:r}=De(n,o.state.doc);o.commands.BNUpdateBlock(r+1,t);const a=o.state.doc.resolve(r+1).node();return x(a,i.schema.blockSchema,i.schema.inlineContentSchema,i.schema.styleSchema,i.blockCache)}function qt(e,t,i){const o=t._tiptapEditor,n=o.state.tr,r=new Set(e.map(l=>typeof l=="string"?l:l.id)),a=[];let s=0;if(o.state.doc.descendants((l,c)=>{if(r.size===0)return!1;if(l.type.name!=="blockContainer"||!r.has(l.attrs.id))return!0;a.push(x(l,t.schema.blockSchema,t.schema.inlineContentSchema,t.schema.styleSchema,t.blockCache)),r.delete(l.attrs.id),s=(i==null?void 0:i(l,c,n,s))||s;const p=n.doc.nodeSize;n.delete(c-s-1,c-s+l.nodeSize+1);const h=n.doc.nodeSize;return s+=p-h,!1}),r.size>0){const l=[...r].join(`
|
|
6
|
+
`);throw Error("Blocks with the following IDs could not be found in the editor: "+l)}return t.dispatch(n),a}function Zo(e,t){return qt(e,t)}function Jo(e,t,i){const o=[];for(const s of t)o.push(N(s,i.pmSchema,i.schema.styleSchema));const n=typeof e[0]=="string"?e[0]:e[0].id,r=qt(e,i,(s,l,c,p)=>{if(s.attrs.id===n){const h=c.doc.nodeSize;c.insert(l,o);const m=c.doc.nodeSize;return p+h-m}return p}),a=[];for(const s of o)a.push(x(s,i.schema.blockSchema,i.schema.inlineContentSchema,i.schema.styleSchema,i.blockCache));return{insertedBlocks:a,removedBlocks:r}}function Yo(e,t,i,o={updateSelection:!0}){const n=i._tiptapEditor.state.tr;let{from:r,to:a}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},s=!0,l=!0,c="";if(t.forEach(p=>{p.check(),s&&p.isText&&p.marks.length===0?c+=p.text:s=!1,l=l?p.isBlock:!1}),r===a&&l){const{parent:p}=n.doc.resolve(r);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(r-=1,a+=1)}return s?n.insertText(c,r,a):n.replaceWith(r,a,t),o.updateSelection&&b.selectionToInsertionEnd(n,n.steps.length-1,-1),i.dispatch(n),!0}function Qo(){const e=t=>{let i=t.children.length;for(let o=0;o<i;o++){const n=t.children[o];if(n.type==="element"&&(e(n),n.tagName==="u"))if(n.children.length>0){t.children.splice(o,1,...n.children);const r=n.children.length-1;i+=r,o+=r}else t.children.splice(o,1),i--,o--}};return e}function en(){const e=t=>{var i;if(t.children&&"length"in t.children&&t.children.length)for(let o=t.children.length-1;o>=0;o--){const n=t.children[o],r=o+1<t.children.length?t.children[o+1]:void 0;n.type==="element"&&n.tagName==="input"&&((i=n.properties)==null?void 0:i.type)==="checkbox"&&(r==null?void 0:r.type)==="element"&&r.tagName==="p"?(r.tagName="span",r.children.splice(0,0,ge.fromDom(document.createTextNode(" ")))):e(n)}};return e}function ue(e){return fe.unified().use(We.default,{fragment:!0}).use(Qo).use(en).use(Zi.default).use(Xe.default).use(Ji.default,{handlers:{text:i=>i.value}}).processSync(e).value}function Gt(e,t,i,o){const r=Y(t,i).exportBlocks(e,o);return ue(r)}function tn(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}function on(e){return e.nodeType===3&&!/\S/.test(e.nodeValue||"")}function nn(e){e.querySelectorAll("li > ul, li > ol").forEach(t=>{const i=tn(t),o=t.parentElement,n=Array.from(o.childNodes).slice(i+1);t.remove(),n.forEach(r=>{r.remove()}),o.insertAdjacentElement("afterend",t),n.reverse().forEach(r=>{if(on(r))return;const a=document.createElement("li");a.append(r),t.insertAdjacentElement("afterend",a)}),o.childNodes.length===0&&o.remove()})}function rn(e){e.querySelectorAll("li + ul, li + ol").forEach(t=>{var r,a;const i=t.previousElementSibling,o=document.createElement("div");i.insertAdjacentElement("afterend",o),o.append(i);const n=document.createElement("div");for(n.setAttribute("data-node-type","blockGroup"),o.append(n);((r=o.nextElementSibling)==null?void 0:r.nodeName)==="UL"||((a=o.nextElementSibling)==null?void 0:a.nodeName)==="OL";)n.append(o.nextElementSibling)})}let Wt=null;function an(){return Wt||(Wt=document.implementation.createHTMLDocument("title"))}function $t(e){if(typeof e=="string"){const t=an().createElement("div");t.innerHTML=e,e=t}return nn(e),rn(e),e}async function Ue(e,t,i,o,n){const r=$t(e),s=y.DOMParser.fromSchema(n).parse(r,{topNode:n.nodes.blockGroup.create()}),l=[];for(let c=0;c<s.childCount;c++)l.push(x(s.child(c),t,i,o));return l}function sn(e,t){const i=t.value?t.value+`
|
|
7
|
+
`:"",o={};t.lang&&(o["data-language"]=t.lang);let n={type:"element",tagName:"code",properties:o,children:[{type:"text",value:i}]};return t.meta&&(n.data={meta:t.meta}),e.patch(t,n),n=e.applyData(t,n),n={type:"element",tagName:"pre",properties:{},children:[n]},e.patch(t,n),n}function Xt(e,t,i,o,n){const r=fe.unified().use(Yi.default).use(Xe.default).use(Qi.default,{handlers:{...qe.defaultHandlers,code:sn}}).use($e.default).processSync(e);return Ue(r.value,t,i,o,n)}class ${constructor(){u(this,"callbacks",{})}on(t,i){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(i),()=>this.off(t,i)}emit(t,...i){const o=this.callbacks[t];o&&o.forEach(n=>n.apply(this,i))}off(t,i){const o=this.callbacks[t];o&&(i?this.callbacks[t]=o.filter(n=>n!==i):delete this.callbacks[t])}removeAllListeners(){this.callbacks={}}}class Zt{constructor(t,i,o,n){u(this,"state");u(this,"emitUpdate");u(this,"mouseDownHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});u(this,"dragstartHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});u(this,"scrollHandler",()=>{var t;if((t=this.state)!=null&&t.show){const i=this.pmView.root.querySelector(`[data-node-type="blockContainer"][data-id="${this.state.block.id}"]`);this.state.referencePos=i.getBoundingClientRect(),this.emitUpdate()}});u(this,"closeMenu",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});this.editor=t,this.pluginKey=i,this.pmView=o,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized file panel");n(this.state)},o.dom.addEventListener("mousedown",this.mouseDownHandler),o.dom.addEventListener("dragstart",this.dragstartHandler),o.root.addEventListener("scroll",this.scrollHandler,!0)}update(t,i){var n,r;const o=this.pluginKey.getState(t.state);if(!((n=this.state)!=null&&n.show)&&o.block&&this.editor.isEditable){const a=this.pmView.root.querySelector(`[data-node-type="blockContainer"][data-id="${o.block.id}"]`);this.state={show:!0,referencePos:a.getBoundingClientRect(),block:o.block},this.emitUpdate();return}(!t.state.selection.eq(i.selection)||!t.state.doc.eq(i.doc)||!this.editor.isEditable)&&(r=this.state)!=null&&r.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 je=new _.PluginKey("FilePanelPlugin");class Jt extends ${constructor(i){super();u(this,"view");u(this,"plugin");u(this,"closeMenu",()=>this.view.closeMenu());this.plugin=new _.Plugin({key:je,view:o=>(this.view=new Zt(i,je,o,n=>{this.emit("update",n)}),this.view),props:{handleKeyDown:(o,n)=>n.key==="Escape"&&this.shown?(this.view.closeMenu(),!0):!1},state:{init:()=>({block:void 0}),apply:o=>{var r;return{block:(r=o.getMeta(je))==null?void 0:r.block}}}})}get shown(){var i,o;return((o=(i=this.view)==null?void 0:i.state)==null?void 0:o.show)||!1}onUpdate(i){return this.on("update",i)}}class Yt{constructor(t,i,o){u(this,"state");u(this,"emitUpdate");u(this,"preventHide",!1);u(this,"preventShow",!1);u(this,"shouldShow",({state:t,from:i,to:o,view:n})=>{const{doc:r,selection:a}=t,{empty:s}=a,l=!r.textBetween(i,o).length&&b.isTextSelection(t.selection);return!(!n.hasFocus()||s||l)});u(this,"blurHandler",t=>{var o;if(this.preventHide){this.preventHide=!1;return}const i=this.pmView.dom.parentElement;t&&t.relatedTarget&&(i===t.relatedTarget||i.contains(t.relatedTarget)||t.relatedTarget.matches(".bn-ui-container, .bn-ui-container *"))||(o=this.state)!=null&&o.show&&(this.state.show=!1,this.emitUpdate())});u(this,"viewMousedownHandler",()=>{this.preventShow=!0});u(this,"viewMouseupHandler",()=>{this.preventShow=!1,setTimeout(()=>this.update(this.pmView))});u(this,"dragHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});u(this,"scrollHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.referencePos=this.getSelectionBoundingBox(),this.emitUpdate())});u(this,"closeMenu",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});this.editor=t,this.pmView=i,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized formatting toolbar");o(this.state)},i.dom.addEventListener("mousedown",this.viewMousedownHandler),i.dom.addEventListener("mouseup",this.viewMouseupHandler),i.dom.addEventListener("dragstart",this.dragHandler),i.dom.addEventListener("dragover",this.dragHandler),i.dom.addEventListener("blur",this.blurHandler),i.root.addEventListener("scroll",this.scrollHandler,!0)}update(t,i){var m,g;const{state:o,composing:n}=t,{doc:r,selection:a}=o,s=i&&i.doc.eq(r)&&i.selection.eq(a);if(n||s)return;const{ranges:l}=a,c=Math.min(...l.map(f=>f.$from.pos)),p=Math.max(...l.map(f=>f.$to.pos)),h=(m=this.shouldShow)==null?void 0:m.call(this,{view:t,state:o,from:c,to:p});if(!this.preventShow&&(h||this.preventHide)){this.state={show:!0,referencePos:this.getSelectionBoundingBox()},this.emitUpdate();return}if((g=this.state)!=null&&g.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:i}=t,{ranges:o}=i,n=Math.min(...o.map(a=>a.$from.pos)),r=Math.max(...o.map(a=>a.$to.pos));if(b.isNodeSelection(i)){const a=this.pmView.nodeDOM(n);if(a)return a.getBoundingClientRect()}return b.posToDOMRect(this.pmView,n,r)}}const Qt=new _.PluginKey("FormattingToolbarPlugin");class ei extends ${constructor(i){super();u(this,"view");u(this,"plugin");u(this,"closeMenu",()=>this.view.closeMenu());this.plugin=new _.Plugin({key:Qt,view:o=>(this.view=new Yt(i,o,n=>{this.emit("update",n)}),this.view),props:{handleKeyDown:(o,n)=>n.key==="Escape"&&this.shown?(this.view.closeMenu(),!0):!1}})}get shown(){var i,o;return((o=(i=this.view)==null?void 0:i.state)==null?void 0:o.show)||!1}onUpdate(i){return this.on("update",i)}}class ln{constructor(t,i,o){u(this,"state");u(this,"emitUpdate");u(this,"menuUpdateTimer");u(this,"startMenuUpdateTimer");u(this,"stopMenuUpdateTimer");u(this,"mouseHoveredLinkMark");u(this,"mouseHoveredLinkMarkRange");u(this,"keyboardHoveredLinkMark");u(this,"keyboardHoveredLinkMarkRange");u(this,"linkMark");u(this,"linkMarkRange");u(this,"mouseOverHandler",t=>{if(this.mouseHoveredLinkMark=void 0,this.mouseHoveredLinkMarkRange=void 0,this.stopMenuUpdateTimer(),t.target instanceof HTMLAnchorElement&&t.target.nodeName==="A"){const i=t.target,o=this.pmView.posAtDOM(i,0)+1,n=this.pmView.state.doc.resolve(o),r=n.marks();for(const a of r)if(a.type.name===this.pmView.state.schema.mark("link").type.name){this.mouseHoveredLinkMark=a,this.mouseHoveredLinkMarkRange=b.getMarkRange(n,a.type,a.attrs)||void 0;break}}return this.startMenuUpdateTimer(),!1});u(this,"clickHandler",t=>{var o;const i=this.pmView.dom.parentElement;this.linkMark&&t&&t.target&&!(i===t.target||i.contains(t.target))&&(o=this.state)!=null&&o.show&&(this.state.show=!1,this.emitUpdate())});u(this,"scrollHandler",()=>{var t;this.linkMark!==void 0&&(t=this.state)!=null&&t.show&&(this.state.referencePos=b.posToDOMRect(this.pmView,this.linkMarkRange.from,this.linkMarkRange.to),this.emitUpdate())});u(this,"closeMenu",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});this.editor=t,this.pmView=i,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized link toolbar");o(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,i){var n;const o=this.pmView.state.tr.insertText(i,this.linkMarkRange.from,this.linkMarkRange.to);o.addMark(this.linkMarkRange.from,this.linkMarkRange.from+i.length,this.pmView.state.schema.mark("link",{href:t})),this.editor.dispatch(o),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 i;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 o=this.pmView.state.selection.$from.marks();for(const n of o)if(n.type.name===this.pmView.state.schema.mark("link").type.name){this.keyboardHoveredLinkMark=n,this.keyboardHoveredLinkMarkRange=b.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:b.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((i=this.state)!=null&&i.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 ti=new _.PluginKey("LinkToolbarPlugin");class ii extends ${constructor(i){super();u(this,"view");u(this,"plugin");u(this,"editLink",(i,o)=>{this.view.editLink(i,o)});u(this,"deleteLink",()=>{this.view.deleteLink()});u(this,"startHideTimer",()=>{this.view.startMenuUpdateTimer()});u(this,"stopHideTimer",()=>{this.view.stopMenuUpdateTimer()});u(this,"closeMenu",()=>this.view.closeMenu());this.plugin=new _.Plugin({key:ti,view:o=>(this.view=new ln(i,o,n=>{this.emit("update",n)}),this.view),props:{handleKeyDown:(o,n)=>n.key==="Escape"&&this.shown?(this.view.closeMenu(),!0):!1}})}onUpdate(i){return this.on("update",i)}get shown(){var i,o;return((o=(i=this.view)==null?void 0:i.state)==null?void 0:o.show)||!1}}class X extends _.Selection{constructor(i,o){super(i,o);u(this,"nodes");const n=i.node();this.nodes=[],i.doc.nodesBetween(i.pos,o.pos,(r,a,s)=>{if(s!==null&&s.eq(n))return this.nodes.push(r),!1})}static create(i,o,n=o){return new X(i.resolve(o),i.resolve(n))}content(){return new y.Slice(y.Fragment.from(this.nodes),0,0)}eq(i){if(!(i instanceof X)||this.nodes.length!==i.nodes.length||this.from!==i.from||this.to!==i.to)return!1;for(let o=0;o<this.nodes.length;o++)if(!this.nodes[o].eq(i.nodes[o]))return!1;return!0}map(i,o){const n=o.mapResult(this.from),r=o.mapResult(this.to);return r.deleted?_.Selection.near(i.resolve(n.pos)):n.deleted?_.Selection.near(i.resolve(r.pos)):new X(i.resolve(n.pos),i.resolve(r.pos))}toJSON(){return{type:"node",anchor:this.anchor,head:this.head}}}let P;function re(e,t){var i;for(;e&&e.parentElement&&e.parentElement!==t.dom&&!((i=e.hasAttribute)!=null&&i.call(e,"data-id"));)e=e.parentElement;if(e.hasAttribute("data-id"))return{node:e,id:e.getAttribute("data-id")}}function dn(e,t){const i=re(e,t);if(i&&i.node.nodeType===1){const o=t.docView,n=o.nearestDesc(i.node,!0);return!n||n===o?null:n.posBefore}return null}function cn(e,t){let i,o;const n=t.resolve(e.from).node().type.spec.group==="blockContent",r=t.resolve(e.to).node().type.spec.group==="blockContent",a=Math.min(e.$anchor.depth,e.$head.depth);if(n&&r){const s=e.$from.start(a-1),l=e.$to.end(a-1);i=t.resolve(s-1).pos,o=t.resolve(l+1).pos}else i=e.from,o=e.to;return{from:i,to:o}}function oi(e,t,i=t){t===i&&(i+=e.state.doc.resolve(t+1).node().nodeSize);const o=e.domAtPos(t).node.cloneNode(!0),n=e.domAtPos(t).node,r=(p,h)=>Array.prototype.indexOf.call(p.children,h),a=r(n,e.domAtPos(t+1).node.parentElement),s=r(n,e.domAtPos(i-1).node.parentElement);for(let p=n.childElementCount-1;p>=0;p--)(p>s||p<a)&&o.removeChild(o.children[p]);ni(e.root),P=o;const c=e.dom.className.split(" ").filter(p=>p!=="ProseMirror"&&p!=="bn-root"&&p!=="bn-editor").join(" ");P.className=P.className+" bn-drag-preview "+c,e.root instanceof ShadowRoot?e.root.appendChild(P):e.root.body.appendChild(P)}function ni(e){P!==void 0&&(e instanceof ShadowRoot?e.removeChild(P):e.body.removeChild(P),P=void 0)}function un(e,t){if(!e.dataTransfer)return;const i=t.prosemirrorView,o=i.dom.getBoundingClientRect(),n={left:o.left+o.width/2,top:e.clientY},r=i.root.elementsFromPoint(n.left,n.top);let a;for(const l of r)if(i.dom.contains(l)){a=re(l,i);break}if(!a)return;const s=dn(a.node,i);if(s!=null){const l=i.state.selection,c=i.state.doc,{from:p,to:h}=cn(l,c),m=p<=s&&s<h,g=l.$anchor.node()!==l.$head.node()||l instanceof X;m&&g?(i.dispatch(i.state.tr.setSelection(X.create(c,p,h))),oi(i,p,h)):(i.dispatch(i.state.tr.setSelection(_.NodeSelection.create(i.state.doc,s))),oi(i,s));const f=i.state.selection.content(),k=t.pmSchema,O=le(k,t).serializeProseMirrorFragment(f.content,{}),V=Y(k,t).exportProseMirrorFragment(f.content,{}),ae=ue(V);e.dataTransfer.clearData(),e.dataTransfer.setData("blocknote/html",O),e.dataTransfer.setData("text/html",V),e.dataTransfer.setData("text/plain",ae),e.dataTransfer.effectAllowed="move",e.dataTransfer.setDragImage(P,0,0),i.dragging={slice:f,move:!0}}}class ri{constructor(t,i,o){u(this,"state");u(this,"emitUpdate");u(this,"needUpdate",!1);u(this,"mousePos");u(this,"horizontalPosAnchoredAtRoot");u(this,"horizontalPosAnchor");u(this,"hoveredBlock");u(this,"isDragging",!1);u(this,"menuFrozen",!1);u(this,"updateState",()=>{var a,s,l,c;if(this.menuFrozen||!this.mousePos)return;const t=this.pmView.dom.firstChild.getBoundingClientRect();this.horizontalPosAnchor=t.x;const i={left:t.left+t.width/2,top:this.mousePos.y},o=this.pmView.root.elementsFromPoint(i.left,i.top);let n;for(const p of o)if(this.pmView.dom.contains(p)){n=re(p,this.pmView);break}if(!n||!this.editor.isEditable){(a=this.state)!=null&&a.show&&(this.state.show=!1,this.needUpdate=!0);return}if((s=this.state)!=null&&s.show&&((l=this.hoveredBlock)!=null&&l.hasAttribute("data-id"))&&((c=this.hoveredBlock)==null?void 0:c.getAttribute("data-id"))===n.id)return;this.hoveredBlock=n.node;const r=n.node.firstChild;if(r&&this.editor.isEditable){const p=r.getBoundingClientRect();this.state={show:!0,referencePos:new DOMRect(this.horizontalPosAnchoredAtRoot?this.horizontalPosAnchor:p.x,p.y,p.width,p.height),block:this.editor.getBlock(this.hoveredBlock.getAttribute("data-id"))},this.needUpdate=!0}});u(this,"onDragStart",()=>{this.isDragging=!0});u(this,"onDrop",t=>{if(this.editor._tiptapEditor.commands.blur(),t.synthetic||!this.isDragging)return;const i=this.pmView.posAtCoords({left:t.clientX,top:t.clientY});if(this.isDragging=!1,!i||i.inside===-1){const o=new Event("drop",t),n=this.pmView.dom.firstChild.getBoundingClientRect();o.clientX=t.clientX<n.left||t.clientX>n.left+n.width?n.left+n.width/2:t.clientX,o.clientY=Math.min(Math.max(t.clientY,n.top),n.top+n.height),o.dataTransfer=t.dataTransfer,o.preventDefault=()=>t.preventDefault(),o.synthetic=!0,this.pmView.dom.dispatchEvent(o)}});u(this,"onDragOver",t=>{if(t.synthetic||!this.isDragging)return;const i=this.pmView.posAtCoords({left:t.clientX,top:t.clientY});if(!i||i.inside===-1){const o=new Event("dragover",t),n=this.pmView.dom.firstChild.getBoundingClientRect();o.clientX=n.left+n.width/2,o.clientY=t.clientY,o.dataTransfer=t.dataTransfer,o.preventDefault=()=>t.preventDefault(),o.synthetic=!0,this.pmView.dom.dispatchEvent(o)}});u(this,"onKeyDown",t=>{var i;(i=this.state)!=null&&i.show&&this.editor.isFocused()&&(this.state.show=!1,this.emitUpdate(this.state),this.menuFrozen=!1)});u(this,"onMouseDown",()=>{this.state&&this.state.show&&this.menuFrozen&&(this.menuFrozen=!1,this.state.show=!1,this.emitUpdate(this.state))});u(this,"onMouseMove",t=>{var r;if(this.menuFrozen)return;this.mousePos={x:t.clientX,y:t.clientY};const i=this.pmView.dom.getBoundingClientRect(),o=this.mousePos.x>i.left&&this.mousePos.x<i.right&&this.mousePos.y>i.top&&this.mousePos.y<i.bottom,n=this.pmView.dom.parentElement;if(o&&t&&t.target&&!(n===t.target||n.contains(t.target))){(r=this.state)!=null&&r.show&&(this.state.show=!1,this.emitUpdate(this.state));return}this.updateState(),this.needUpdate&&(this.emitUpdate(this.state),this.needUpdate=!1)});u(this,"onScroll",()=>{var t;if((t=this.state)!=null&&t.show){const o=this.hoveredBlock.firstChild.getBoundingClientRect();this.state.referencePos=new DOMRect(this.horizontalPosAnchoredAtRoot?this.horizontalPosAnchor:o.x,o.y,o.width,o.height),this.emitUpdate(this.state)}});this.editor=t,this.pmView=i,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized side menu");o(this.state)},this.horizontalPosAnchoredAtRoot=!0,this.horizontalPosAnchor=this.pmView.dom.firstChild.getBoundingClientRect().x,this.pmView.root.addEventListener("drop",this.onDrop,!0),this.pmView.root.addEventListener("dragover",this.onDragOver),this.pmView.dom.addEventListener("dragstart",this.onDragStart),this.pmView.root.addEventListener("mousemove",this.onMouseMove,!0),this.pmView.dom.addEventListener("mousedown",this.onMouseDown),this.pmView.root.addEventListener("keydown",this.onKeyDown,!0),this.pmView.root.addEventListener("scroll",this.onScroll,!0)}update(){var i;const t=(i=this.state)==null?void 0:i.block.id;this.updateState(),this.needUpdate&&this.state&&t!==this.state.block.id&&(this.emitUpdate(this.state),this.needUpdate=!1)}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.dom.removeEventListener("dragstart",this.onDragStart),this.pmView.root.removeEventListener("drop",this.onDrop,!0),this.pmView.root.removeEventListener("scroll",this.onScroll,!0),this.pmView.dom.removeEventListener("mousedown",this.onMouseDown),this.pmView.root.removeEventListener("keydown",this.onKeyDown,!0)}addBlock(){var l;(l=this.state)!=null&&l.show&&(this.state.show=!1,this.emitUpdate(this.state));const i=this.hoveredBlock.firstChild.getBoundingClientRect(),o=this.pmView.posAtCoords({left:i.left+i.width/2,top:i.top+i.height/2});if(!o)return;const n=v(this.editor._tiptapEditor.state.doc,o.pos);if(n===void 0)return;const{contentNode:r,startPos:a,endPos:s}=n;if(r.type.spec.content!=="inline*"||r.textContent.length!==0){const c=s+1,p=c+2;this.editor._tiptapEditor.chain().BNCreateBlock(c).setTextSelection(p).run()}else this.editor._tiptapEditor.commands.setTextSelection(a+1);this.editor.openSelectionMenu("/")}}const ai=new _.PluginKey("SideMenuPlugin");class si extends ${constructor(i){super();u(this,"view");u(this,"plugin");u(this,"addBlock",()=>this.view.addBlock());u(this,"blockDragStart",i=>{this.view.isDragging=!0,un(i,this.editor)});u(this,"blockDragEnd",()=>ni(this.editor.prosemirrorView.root));u(this,"freezeMenu",()=>this.view.menuFrozen=!0);u(this,"unfreezeMenu",()=>{this.view.menuFrozen=!1,this.view.state.show=!1,this.view.emitUpdate(this.view.state)});this.editor=i,this.plugin=new _.Plugin({key:ai,view:o=>(this.view=new ri(i,o,n=>{this.emit("update",n)}),this.view)})}onUpdate(i){return this.on("update",i)}}const pn=b.findParentNode(e=>e.type.name==="blockContainer");class hn{constructor(t,i){u(this,"state");u(this,"emitUpdate");u(this,"rootEl");u(this,"pluginState");u(this,"handleScroll",()=>{var t,i;if((t=this.state)!=null&&t.show){const o=(i=this.rootEl)==null?void 0:i.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);this.state.referencePos=o.getBoundingClientRect(),this.emitUpdate(this.pluginState.triggerCharacter)}});u(this,"closeMenu",()=>{this.editor.dispatch(this.editor._tiptapEditor.view.state.tr.setMeta(Z,null))});u(this,"clearQuery",()=>{this.pluginState!==void 0&&this.editor._tiptapEditor.chain().focus().deleteRange({from:this.pluginState.queryStartPos-(this.pluginState.fromUserInput?this.pluginState.triggerCharacter.length:0),to:this.editor._tiptapEditor.state.selection.from}).run()});this.editor=t,this.pluginState=void 0,this.emitUpdate=o=>{if(!this.state)throw new Error("Attempting to update uninitialized suggestions menu");i(o,this.state)},this.rootEl=this.editor._tiptapEditor.view.root,this.rootEl.addEventListener("scroll",this.handleScroll,!0)}update(t,i){var c;const o=Z.getState(i),n=Z.getState(t.state),r=o===void 0&&n!==void 0,a=o!==void 0&&n===void 0;if(!r&&!(o!==void 0&&n!==void 0)&&!a)return;if(this.pluginState=a?o:n,a||!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&&(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 Z=new _.PluginKey("SuggestionMenuPlugin");class li extends ${constructor(i){super();u(this,"view");u(this,"plugin");u(this,"triggerCharacters",[]);u(this,"addTriggerCharacter",i=>{this.triggerCharacters.push(i)});u(this,"removeTriggerCharacter",i=>{this.triggerCharacters=this.triggerCharacters.filter(o=>o!==i)});u(this,"closeMenu",()=>this.view.closeMenu());u(this,"clearQuery",()=>this.view.clearQuery());const o=this.triggerCharacters;this.plugin=new _.Plugin({key:Z,view:()=>(this.view=new hn(i,(n,r)=>{this.emit(`update ${n}`,r)}),this.view),state:{init(){},apply(n,r,a,s){if(n.getMeta("orderedListIndexing")!==void 0)return r;const l=n.getMeta(Z);if(typeof l=="object"&&l!==null&&r===void 0)return{triggerCharacter:l.triggerCharacter,fromUserInput:l.fromUserInput!==!1,queryStartPos:s.selection.from,query:"",decorationId:`id_${Math.floor(Math.random()*4294967295)}`};if(r===void 0)return r;if(s.selection.from!==s.selection.to||l===null||n.getMeta("focus")||n.getMeta("blur")||n.getMeta("pointer")||r.triggerCharacter!==void 0&&s.selection.from<r.queryStartPos)return;const c={...r};return c.query=s.doc.textBetween(r.queryStartPos,s.selection.from),c}},props:{handleTextInput(n,r,a,s){const l=this.getState(n.state);return o.includes(s)&&l===void 0?(n.dispatch(n.state.tr.insertText(s).scrollIntoView().setMeta(Z,{triggerCharacter:s})),!0):!1},decorations(n){const r=this.getState(n);if(r===void 0)return null;if(!r.fromUserInput){const a=pn(n.selection);if(a)return M.DecorationSet.create(n.doc,[M.Decoration.node(a.pos,a.pos+a.node.nodeSize,{nodeName:"span",class:"bn-suggestion-decorator","data-decoration-id":r.decorationId})])}return M.DecorationSet.create(n.doc,[M.Decoration.inline(r.queryStartPos-r.triggerCharacter.length,r.queryStartPos,{nodeName:"span",class:"bn-suggestion-decorator","data-decoration-id":r.decorationId})])}}})}onUpdate(i,o){return this.triggerCharacters.includes(i)||this.addTriggerCharacter(i),this.on(`update ${i}`,o)}get shown(){var i,o;return((o=(i=this.view)==null?void 0:i.state)==null?void 0:o.show)||!1}}function mn(e,t){e.suggestionMenus.addTriggerCharacter(t)}let S;function di(e){S||(S=document.createElement("div"),S.innerHTML="_",S.style.opacity="0",S.style.height="1px",S.style.width="1px",e instanceof Document?e.body.appendChild(S):e.appendChild(S))}function fn(e){S&&(e instanceof Document?e.body.removeChild(S):e.removeChild(S),S=void 0)}function pe(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}function gn(e){for(;e&&e.nodeName!=="TD"&&e.nodeName!=="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function bn(e,t){e.forEach(i=>{const o=t.querySelectorAll(i);for(let n=0;n<o.length;n++)o[n].style.visibility="hidden"})}class ci{constructor(t,i,o){u(this,"state");u(this,"emitUpdate");u(this,"tableId");u(this,"tablePos");u(this,"menuFrozen",!1);u(this,"prevWasEditable",null);u(this,"mouseMoveHandler",t=>{var c;if(this.menuFrozen)return;const i=gn(t.target);if(!i||!this.editor.isEditable){(c=this.state)!=null&&c.show&&(this.state.show=!1,this.emitUpdate());return}const o=pe(i),n=pe(i.parentElement),r=i.getBoundingClientRect(),a=i.parentElement.parentElement.getBoundingClientRect(),s=re(i,this.pmView);if(!s)return;let l;if(this.editor._tiptapEditor.state.doc.descendants((p,h)=>{if(typeof l<"u")return!1;if(p.type.name!=="blockContainer"||p.attrs.id!==s.id)return!0;const m=x(p,this.editor.schema.blockSchema,this.editor.schema.inlineContentSchema,this.editor.schema.styleSchema,this.editor.blockCache);return Ft("table",m,this.editor)&&(this.tablePos=h+1,l=m),!1}),!!l&&(this.tableId=s.id,!(this.state!==void 0&&this.state.show&&this.tableId===s.id&&this.state.rowIndex===n&&this.state.colIndex===o)))return this.state={show:!0,referencePosCell:r,referencePosTable:a,block:l,colIndex:o,rowIndex:n,draggingState:void 0},this.emitUpdate(),!1});u(this,"dragOverHandler",t=>{var m;if(((m=this.state)==null?void 0:m.draggingState)===void 0)return;t.preventDefault(),t.dataTransfer.dropEffect="move",bn(["column-resize-handle","prosemirror-dropcursor-block","prosemirror-dropcursor-inline"],this.pmView.root);const i={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)},o=this.pmView.root.elementsFromPoint(i.left,i.top).filter(g=>g.tagName==="TD"||g.tagName==="TH");if(o.length===0)throw new Error("Could not find table cell element that the mouse cursor is hovering over.");const n=o[0];let r=!1;const a=pe(n.parentElement),s=pe(n),l=this.state.draggingState.draggedCellOrientation==="row"?this.state.rowIndex:this.state.colIndex,p=(this.state.draggingState.draggedCellOrientation==="row"?a:s)!==l;(this.state.rowIndex!==a||this.state.colIndex!==s)&&(this.state.rowIndex=a,this.state.colIndex=s,this.state.referencePosCell=n.getBoundingClientRect(),r=!0);const h=this.state.draggingState.draggedCellOrientation==="row"?i.top:i.left;this.state.draggingState.mousePos!==h&&(this.state.draggingState.mousePos=h,r=!0),r&&this.emitUpdate(),p&&this.editor.dispatch(this.pmView.state.tr.setMeta(J,!0))});u(this,"dropHandler",t=>{if(this.state===void 0||this.state.draggingState===void 0)return;t.preventDefault();const i=this.state.block.content.rows;if(this.state.draggingState.draggedCellOrientation==="row"){const o=i[this.state.draggingState.originalIndex];i.splice(this.state.draggingState.originalIndex,1),i.splice(this.state.rowIndex,0,o)}else{const o=i.map(n=>n.cells[this.state.draggingState.originalIndex]);i.forEach((n,r)=>{n.cells.splice(this.state.draggingState.originalIndex,1),n.cells.splice(this.state.colIndex,0,o[r])})}this.editor.updateBlock(this.state.block,{type:"table",content:{type:"tableContent",rows:i}})});u(this,"scrollHandler",()=>{var t;if((t=this.state)!=null&&t.show){const i=this.pmView.root.querySelector(`[data-node-type="blockContainer"][data-id="${this.tableId}"] table`),o=i.querySelector(`tr:nth-child(${this.state.rowIndex+1}) > td:nth-child(${this.state.colIndex+1})`);this.state.referencePosTable=i.getBoundingClientRect(),this.state.referencePosCell=o.getBoundingClientRect(),this.emitUpdate()}});this.editor=t,this.pmView=i,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized image toolbar");o(this.state)},i.dom.addEventListener("mousemove",this.mouseMoveHandler),i.root.addEventListener("dragover",this.dragOverHandler),i.root.addEventListener("drop",this.dropHandler),i.root.addEventListener("scroll",this.scrollHandler,!0)}destroy(){this.pmView.dom.removeEventListener("mousemove",this.mouseMoveHandler),this.pmView.root.removeEventListener("dragover",this.dragOverHandler),this.pmView.root.removeEventListener("drop",this.dropHandler),this.pmView.root.removeEventListener("scroll",this.scrollHandler,!0)}}const J=new _.PluginKey("TableHandlesPlugin");class ui extends ${constructor(i){super();u(this,"view");u(this,"plugin");u(this,"colDragStart",i=>{if(this.view.state===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:i.clientX},this.view.emitUpdate(),this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(J,{draggedCellOrientation:this.view.state.draggingState.draggedCellOrientation,originalIndex:this.view.state.colIndex,newIndex:this.view.state.colIndex,tablePos:this.view.tablePos})),di(this.editor._tiptapEditor.view.root),i.dataTransfer.setDragImage(S,0,0),i.dataTransfer.effectAllowed="move"});u(this,"rowDragStart",i=>{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={draggedCellOrientation:"row",originalIndex:this.view.state.rowIndex,mousePos:i.clientY},this.view.emitUpdate(),this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(J,{draggedCellOrientation:this.view.state.draggingState.draggedCellOrientation,originalIndex:this.view.state.rowIndex,newIndex:this.view.state.rowIndex,tablePos:this.view.tablePos})),di(this.editor._tiptapEditor.view.root),i.dataTransfer.setDragImage(S,0,0),i.dataTransfer.effectAllowed="copyMove"});u(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(J,null)),fn(this.editor._tiptapEditor.view.root)});u(this,"freezeHandles",()=>{this.view.menuFrozen=!0});u(this,"unfreezeHandles",()=>{this.view.menuFrozen=!1});this.editor=i,this.plugin=new _.Plugin({key:J,view:o=>(this.view=new ci(i,o,n=>{this.emit("update",n)}),this.view),props:{decorations:o=>{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,r=[];if(n===this.view.state.draggingState.originalIndex)return M.DecorationSet.create(o.doc,r);const a=o.doc.resolve(this.view.tablePos+1),s=a.node();if(this.view.state.draggingState.draggedCellOrientation==="row"){const l=o.doc.resolve(a.posAtIndex(n)+1),c=l.node();for(let p=0;p<c.childCount;p++){const h=o.doc.resolve(l.posAtIndex(p)+1),m=h.node(),g=h.pos+(n>this.view.state.draggingState.originalIndex?m.nodeSize-2:0);r.push(M.Decoration.widget(g,()=>{const f=document.createElement("div");return f.className="bn-table-drop-cursor",f.style.left="0",f.style.right="0",n>this.view.state.draggingState.originalIndex?f.style.bottom="-2px":f.style.top="-3px",f.style.height="4px",f}))}}else for(let l=0;l<s.childCount;l++){const c=o.doc.resolve(a.posAtIndex(l)+1),p=o.doc.resolve(c.posAtIndex(n)+1),h=p.node(),m=p.pos+(n>this.view.state.draggingState.originalIndex?h.nodeSize-2:0);r.push(M.Decoration.widget(m,()=>{const g=document.createElement("div");return g.className="bn-table-drop-cursor",g.style.top="0",g.style.bottom="0",n>this.view.state.draggingState.originalIndex?g.style.right="-2px":g.style.left="-3px",g.style.width="4px",g}))}return M.DecorationSet.create(o.doc,r)}}})}onUpdate(i){return this.on("update",i)}}function pi(e,t){const i=e.state.selection.content().content,n=le(e.state.schema,t).serializeProseMirrorFragment(i,{}),a=Y(e.state.schema,t).exportProseMirrorFragment(i,{}),s=ue(a);return{internalHTML:n,externalHTML:a,plainText:s}}const kn=e=>b.Extension.create({name:"copyToClipboard",addProseMirrorPlugins(){return[new _.Plugin({props:{handleDOMEvents:{copy(t,i){i.preventDefault(),i.clipboardData.clearData(),"node"in t.state.selection&&t.state.selection.node.type.spec.group==="blockContent"&&e.dispatch(e._tiptapEditor.state.tr.setSelection(new _.NodeSelection(t.state.doc.resolve(t.state.selection.from-1))));const{internalHTML:o,externalHTML:n,plainText:r}=pi(t,e);return i.clipboardData.setData("blocknote/html",o),i.clipboardData.setData("text/html",n),i.clipboardData.setData("text/plain",r),!0},dragstart(t,i){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)))),i.preventDefault(),i.dataTransfer.clearData();const{internalHTML:o,externalHTML:n,plainText:r}=pi(t,e);return i.dataTransfer.setData("blocknote/html",o),i.dataTransfer.setData("text/html",n),i.dataTransfer.setData("text/plain",r),!0}}}})]}});function _n(e){let t=e.getTextCursorPosition().block,i=e.schema.blockSchema[t.type].content;for(;i==="none";)t=e.getTextCursorPosition().nextBlock,i=e.schema.blockSchema[t.type].content,e.setTextCursorPosition(t,"end")}function T(e,t){const i=e.getTextCursorPosition().block;if(i.content===void 0)throw new Error("Slash Menu open in a block that doesn't contain content.");Array.isArray(i.content)&&(i.content.length===1&&W(i.content[0])&&i.content[0].type==="text"&&i.content[0].text==="/"||i.content.length===0)?e.updateBlock(i,t):(e.insertBlocks([t],i,"after"),e.setTextCursorPosition(e.getTextCursorPosition().nextBlock,"end"));const o=e.getTextCursorPosition().block;return _n(e),o}function yn(e){const t=[];return B("heading",e)&&t.push({onItemClick:()=>{T(e,{type:"heading",props:{level:1}})},badge:H("Mod-Alt-1"),key:"heading",...e.dictionary.slash_menu.heading},{onItemClick:()=>{T(e,{type:"heading",props:{level:2}})},badge:H("Mod-Alt-2"),key:"heading_2",...e.dictionary.slash_menu.heading_2},{onItemClick:()=>{T(e,{type:"heading",props:{level:3}})},badge:H("Mod-Alt-3"),key:"heading_3",...e.dictionary.slash_menu.heading_3}),B("numberedListItem",e)&&t.push({onItemClick:()=>{T(e,{type:"numberedListItem"})},badge:H("Mod-Shift-7"),key:"numbered_list",...e.dictionary.slash_menu.numbered_list}),B("bulletListItem",e)&&t.push({onItemClick:()=>{T(e,{type:"bulletListItem"})},badge:H("Mod-Shift-8"),key:"bullet_list",...e.dictionary.slash_menu.bullet_list}),B("checkListItem",e)&&t.push({onItemClick:()=>{T(e,{type:"checkListItem"})},badge:H("Mod-Shift-9"),key:"check_list",...e.dictionary.slash_menu.check_list}),B("paragraph",e)&&t.push({onItemClick:()=>{T(e,{type:"paragraph"})},badge:H("Mod-Alt-0"),key:"paragraph",...e.dictionary.slash_menu.paragraph}),B("table",e)&&t.push({onItemClick:()=>{T(e,{type:"table",content:{type:"tableContent",rows:[{cells:["","",""]},{cells:["","",""]}]}})},badge:void 0,key:"table",...e.dictionary.slash_menu.table}),B("image",e)&&t.push({onItemClick:()=>{const i=T(e,{type:"image"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:i}))},key:"image",...e.dictionary.slash_menu.image}),B("video",e)&&t.push({onItemClick:()=>{const i=T(e,{type:"video"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:i}))},key:"video",...e.dictionary.slash_menu.video}),B("audio",e)&&t.push({onItemClick:()=>{const i=T(e,{type:"audio"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:i}))},key:"audio",...e.dictionary.slash_menu.audio}),B("file",e)&&t.push({onItemClick:()=>{const i=T(e,{type:"file"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:i}))},key:"image",...e.dictionary.slash_menu.file}),t.push({onItemClick:()=>e.openSelectionMenu(":"),key:"emoji",...e.dictionary.slash_menu.emoji}),t}function wn(e,t){return e.filter(({title:i,aliases:o})=>i.toLowerCase().includes(t.toLowerCase())||o&&o.filter(n=>n.toLowerCase().includes(t.toLowerCase())).length!==0)}const Re=["blocknote/html","Files","text/html","text/plain"];function vn(e,t){const i=e.split("/"),o=t.split("/");if(i.length!==2)throw new Error(`The string ${e} is not a valid MIME type.`);if(o.length!==2)throw new Error(`The string ${t} is not a valid MIME type.`);return i[1]==="*"||o[1]==="*"?i[0]===o[0]:(i[0]==="*"||o[0]==="*"||i[0]===o[0])&&i[1]===o[1]}async function hi(e,t){if(!t.uploadFile)return;const i="dataTransfer"in e?e.dataTransfer:e.clipboardData;if(i===null)return;let o=null;for(const a of Re)if(i.types.includes(a)){o=a;break}if(o!=="Files")return;const n=i.items;if(!n)return;e.preventDefault();const r=Object.values(t.schema.blockSchema).filter(a=>a.isFileBlock);for(let a=0;a<n.length;a++){let s="file";for(const c of r)for(const p of c.fileBlockAcceptMimeTypes||[])if(vn(n[a].type,p)){s=c.type;break}const l=n[a].getAsFile();if(l){const c=await t.uploadFile(l);if(typeof c=="string"){const p={type:s,props:{name:l.name,url:c}};T(t,p)}}}}const En=e=>b.Extension.create({name:"pasteFromClipboard",addProseMirrorPlugins(){return[new _.Plugin({props:{handleDOMEvents:{paste(t,i){if(i.preventDefault(),!e.isEditable)return;let o=null;for(const r of Re)if(i.clipboardData.types.includes(r)){o=r;break}if(o===null)return!0;if(o==="Files")return hi(i,e),!0;let n=i.clipboardData.getData(o);return o==="text/html"&&(n=$t(n.trim()).innerHTML),e._tiptapEditor.view.pasteHTML(n),!0}}}})]}}),xn=e=>b.Extension.create({name:"dropFile",addProseMirrorPlugins(){return[new _.Plugin({props:{handleDOMEvents:{drop(t,i){if(!e.isEditable)return;let o=null;for(const n of Re)if(i.dataTransfer.types.includes(n)){o=n;break}return o===null?!0:o==="Files"?(hi(i,e),!0):!1}}}})]}}),Cn=b.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}}}}]}}),Sn=b.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}}}}]}}),Tn=b.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}}}}]}}),Mn=b.Extension.create({name:"trailingNode",addProseMirrorPlugins(){const e=new _.PluginKey(this.name);return[new _.Plugin({key:e,appendTransaction:(t,i,o)=>{const{doc:n,tr:r,schema:a}=o,s=e.getState(o),l=n.content.size-2,c=a.nodes.blockContainer,p=a.nodes.paragraph;if(s)return r.insert(l,c.create(void 0,p.create()))},state:{init:(t,i)=>{},apply:(t,i)=>{if(!t.docChanged)return i;let o=t.doc.lastChild;if(!o||o.type.name!=="blockGroup")throw new Error("Expected blockGroup");if(o=o.lastChild,!o||o.type.name!=="blockContainer")throw new Error("Expected blockContainer");const n=o.firstChild;if(!n)throw new Error("Expected blockContent");return o.nodeSize>4||n.type.spec.content!=="inline*"}}})]}}),Bn=new _.PluginKey("non-editable-block"),Ln=()=>new _.Plugin({key:Bn,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"){const i=e.state.tr;return e.dispatch(i.insert(e.state.tr.selection.$to.after(),e.state.schema.nodes.paragraph.create()).setSelection(new _.TextSelection(i.doc.resolve(e.state.tr.selection.$to.after()+1)))),!0}}return!1}}}),mi=new _.PluginKey("previous-blocks"),In={index:"index",level:"level",type:"type",depth:"depth","depth-change":"depth-change"},Pn=()=>{let e;return new _.Plugin({key:mi,view(t){return{update:async(i,o)=>{var n;((n=this.key)==null?void 0:n.getState(i.state).updatedBlocks.size)>0&&(e=setTimeout(()=>{i.dispatch(i.state.tr.setMeta(mi,{clearUpdate:!0}))},0))},destroy:()=>{e&&clearTimeout(e)}}},state:{init(){return{prevTransactionOldBlockAttrs:{},currentTransactionOldBlockAttrs:{},updatedBlocks:new Set}},apply(t,i,o,n){if(i.currentTransactionOldBlockAttrs={},i.updatedBlocks.clear(),!t.docChanged||o.doc.eq(n.doc))return i;const r={},a=b.findChildren(o.doc,c=>c.attrs.id),s=new Map(a.map(c=>[c.node.attrs.id,c])),l=b.findChildren(n.doc,c=>c.attrs.id);for(const c of l){const p=s.get(c.node.attrs.id),h=p==null?void 0:p.node.firstChild,m=c.node.firstChild;if(p&&h&&m){const g={index:m.attrs.index,level:m.attrs.level,type:m.type.name,depth:n.doc.resolve(c.pos).depth};let f={index:h.attrs.index,level:h.attrs.level,type:h.type.name,depth:o.doc.resolve(p.pos).depth};r[c.node.attrs.id]=f,t.getMeta("numberedListIndexing")&&(c.node.attrs.id in i.prevTransactionOldBlockAttrs&&(f=i.prevTransactionOldBlockAttrs[c.node.attrs.id]),g.type==="numberedListItem"&&(f.index=g.index)),i.currentTransactionOldBlockAttrs[c.node.attrs.id]=f,JSON.stringify(f)!==JSON.stringify(g)&&(f["depth-change"]=f.depth-g.depth,i.updatedBlocks.add(c.node.attrs.id))}}return i.prevTransactionOldBlockAttrs=r,i}},props:{decorations(t){const i=this.getState(t);if(i.updatedBlocks.size===0)return;const o=[];return t.doc.descendants((n,r)=>{if(!n.attrs.id||!i.updatedBlocks.has(n.attrs.id))return;const a=i.currentTransactionOldBlockAttrs[n.attrs.id],s={};for(const[c,p]of Object.entries(a))s["data-prev-"+In[c]]=p||"none";const l=M.Decoration.node(r,r+n.nodeSize,{...s});o.push(l)}),M.DecorationSet.create(t.doc,o)}}})},An={blockColor:"data-block-color",blockStyle:"data-block-style",id:"data-id",depth:"data-depth",depthChange:"data-depth-change"},Nn=b.Node.create({name:"blockContainer",group:"blockContainer",content:"blockContent blockGroup?",priority:50,defining:!0,parseHTML(){return[{tag:"div",getAttrs:e=>{if(typeof e=="string")return!1;const t={};for(const[i,o]of Object.entries(An))e.getAttribute(o)&&(t[i]=e.getAttribute(o));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[r,a]of Object.entries(e))r!=="class"&&t.setAttribute(r,a);const i={...((n=this.options.domAttributes)==null?void 0:n.block)||{},...e},o=document.createElement("div");o.className=D("bn-block",i.class),o.setAttribute("data-node-type",this.name);for(const[r,a]of Object.entries(i))r!=="class"&&o.setAttribute(r,a);return t.appendChild(o),{dom:t,contentDOM:o}},addCommands(){return{BNCreateBlock:e=>({state:t,dispatch:i})=>{const o=t.schema.nodes.blockContainer.createAndFill();return i&&t.tr.insert(e,o).scrollIntoView(),!0},BNDeleteBlock:e=>({state:t,dispatch:i})=>{const o=v(t.doc,e);if(o===void 0)return!1;const{startPos:n,endPos:r}=o;return i&&t.tr.deleteRange(n,r),!0},BNUpdateBlock:(e,t)=>({state:i,dispatch:o})=>{const n=v(i.doc,e);if(n===void 0)return!1;const{startPos:r,endPos:a,node:s,contentNode:l}=n;if(o){if(t.children!==void 0){const m=[];for(const g of t.children)m.push(N(g,i.schema,this.options.editor.schema.styleSchema));s.childCount===2?i.tr.replace(r+l.nodeSize+1,a-1,new y.Slice(y.Fragment.from(m),0,0)):i.tr.insert(r+l.nodeSize,i.schema.nodes.blockGroup.create({},m))}const c=l.type.name,p=t.type||c;let h="keep";if(t.content)if(typeof t.content=="string")h=z([t.content],i.schema,this.options.editor.schema.styleSchema);else if(Array.isArray(t.content))h=z(t.content,i.schema,this.options.editor.schema.styleSchema);else if(t.content.type==="tableContent")h=ye(t.content,i.schema,this.options.editor.schema.styleSchema);else throw new I(t.content.type);else{const m=i.schema.nodes[c].spec.content,g=i.schema.nodes[p].spec.content;m===""||g!==m&&(h=[])}h==="keep"?i.tr.setNodeMarkup(r,t.type===void 0?void 0:i.schema.nodes[t.type],{...l.attrs,...t.props}):i.tr.replaceWith(r,a,i.schema.nodes[p].create({...l.attrs,...t.props},h)).setSelection(i.schema.nodes[p].spec.content===""?new _.NodeSelection(i.tr.doc.resolve(r)):i.schema.nodes[p].spec.content==="inline*"?new _.TextSelection(i.tr.doc.resolve(r)):new _.TextSelection(i.tr.doc.resolve(r+4))),i.tr.setNodeMarkup(r-1,void 0,{...s.attrs,...t.props})}return!0},BNMergeBlocks:e=>({state:t,dispatch:i})=>{const o=t.doc.resolve(e+1).node().type.name==="blockContainer",n=t.doc.resolve(e-1).node().type.name==="blockContainer";if(!o||!n)return!1;const r=v(t.doc,e+1),{node:a,contentNode:s,startPos:l,endPos:c,depth:p}=r;if(a.childCount===2){const g=t.doc.resolve(l+s.nodeSize+1),f=t.doc.resolve(c-1),k=g.blockRange(f);i&&t.tr.lift(k,p-1)}let h=e-1,m=v(t.doc,h);for(;m.numChildBlocks>0;)if(h--,m=v(t.doc,h),m===void 0)return!1;return i&&(i(t.tr.deleteRange(l,l+s.nodeSize).replace(h-1,l,new y.Slice(s.content,0,0)).scrollIntoView()),t.tr.setSelection(new _.TextSelection(t.doc.resolve(h-1)))),!0},BNSplitBlock:(e,t,i)=>({state:o,dispatch:n})=>{const r=v(o.doc,e);if(r===void 0)return!1;const{contentNode:a,contentType:s,startPos:l,endPos:c,depth:p}=r,h=o.doc.cut(l+1,e),m=o.doc.cut(e,c-1),g=o.schema.nodes.blockContainer.createAndFill(),f=c+1,k=f+2;return n&&(o.tr.insert(f,g),o.tr.replace(k,k+1,m.content.size>0?new y.Slice(y.Fragment.from(m),p+2,p+2):void 0),t&&o.tr.setBlockType(k,k,o.schema.node(s).type,i?a.attrs:void 0),o.tr.setSelection(new _.TextSelection(o.doc.resolve(k))),o.tr.replace(l+1,c-1,h.content.size>0?new y.Slice(y.Fragment.from(h),p+2,p+2):void 0),o.tr.scrollIntoView()),!0}}},addProseMirrorPlugins(){return[Pn(),Ln()]},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.undoInputRule(),()=>o.command(({state:n})=>{const{contentType:r,startPos:a}=v(n.doc,n.selection.from),s=n.selection.from===a+1,l=r.name==="paragraph";return s&&!l?o.BNUpdateBlock(n.selection.from,{type:"paragraph",props:{}}):!1}),()=>o.command(({state:n})=>{const{startPos:r}=v(n.doc,n.selection.from);return n.selection.from===r+1?o.liftListItem("blockContainer"):!1}),()=>o.command(({state:n})=>{const{depth:r,startPos:a}=v(n.doc,n.selection.from),s=n.selection.from===a+1,l=n.selection.empty,c=a===2,p=a-1;return!c&&s&&l&&r===2?o.BNMergeBlocks(p):!1})]),Delete:()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.command(({state:n})=>{const{node:r,depth:a,endPos:s}=v(n.doc,n.selection.from),l=s===n.doc.nodeSize-4,c=n.selection.from===s-1,p=n.selection.empty,h=r.childCount===2;if(!l&&c&&p&&!h){let m=a,g=s+2,f=n.doc.resolve(g).depth;for(;f<m;)m=f,g+=2,f=n.doc.resolve(g).depth;return o.BNMergeBlocks(g-1)}return!1})]),Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.command(({state:n})=>{const{contentNode:r,depth:a}=v(n.doc,n.selection.from),s=n.selection.$anchor.parentOffset===0,l=n.selection.anchor===n.selection.head,c=r.childCount===0,p=a>2;return s&&l&&c&&p?o.liftListItem("blockContainer"):!1}),()=>o.command(({state:n,chain:r})=>{const{contentNode:a,endPos:s}=v(n.doc,n.selection.from),l=n.selection.$anchor.parentOffset===0,c=n.selection.anchor===n.selection.head,p=a.childCount===0;if(l&&c&&p){const h=s+1,m=h+2;return r().BNCreateBlock(h).setTextSelection(m).run(),!0}return!1}),()=>o.command(({state:n,chain:r})=>{const{contentNode:a}=v(n.doc,n.selection.from),s=n.selection.$anchor.parentOffset===0;return a.childCount===0?!1:(r().deleteSelection().BNSplitBlock(n.selection.from,s,s).run(),!0)})]),Tab:()=>{var o,n,r;return(o=this.options.editor.formattingToolbar)!=null&&o.shown||(n=this.options.editor.linkToolbar)!=null&&n.shown||(r=this.options.editor.filePanel)!=null&&r.shown?!1:(this.editor.commands.sinkListItem("blockContainer"),!0)},"Shift-Tab":()=>{var o,n,r;return(o=this.options.editor.formattingToolbar)!=null&&o.shown||(n=this.options.editor.linkToolbar)!=null&&n.shown||(r=this.options.editor.filePanel)!=null&&r.shown?!1:(this.editor.commands.liftListItem("blockContainer"),!0)}}}}),Hn=b.Node.create({name:"blockGroup",group:"blockGroup",content:"blockContainer+",parseHTML(){return[{tag:"div",getAttrs:e=>typeof e=="string"?!1:e.getAttribute("data-node-type")==="blockGroup"?null:!1}]},renderHTML({HTMLAttributes:e}){var o;const t={...((o=this.options.domAttributes)==null?void 0:o.blockGroup)||{},...e},i=document.createElement("div");i.className=D("bn-block-group",t.class),i.setAttribute("data-node-type","blockGroup");for(const[n,r]of Object.entries(t))n!=="class"&&i.setAttribute(n,r);return{dom:i,contentDOM:i}}}),Dn=b.Node.create({name:"doc",topNode:!0,content:"blockGroup"}),fi=e=>{var o;const t=[b.extensions.ClipboardTextSerializer,b.extensions.Commands,b.extensions.Editable,b.extensions.FocusEvents,b.extensions.Tabindex,Oi.Gapcursor,G.configure({types:["blockContainer"]}),Vi.HardBreak.extend({priority:10}),Ki.Text,Fi.Link.extend({addKeyboardShortcuts(){return{"Mod-k":()=>(this.editor.commands.toggleLink({href:""}),!0)}}}),...Object.values(e.styleSpecs).map(n=>n.implementation.mark),Tn,Cn,Sn,b.Extension.create({name:"OverrideEscape",addKeyboardShortcuts(){return{Escape:()=>e.editor.suggestionMenus.shown?!1:this.editor.commands.blur()}}}),Dn,Nn.configure({editor:e.editor,domAttributes:e.domAttributes}),Hn.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(r=>r.configure({editor:e.editor,domAttributes:e.domAttributes})),n.implementation.node.configure({editor:e.editor,domAttributes:e.domAttributes})]),kn(e.editor),En(e.editor),xn(e.editor),Ri.Dropcursor.configure({width:5,color:"#ddeeff"}),...e.trailingBlock===void 0||e.trailingBlock?[Mn]:[]];if(e.collaboration){if(t.push(eo.default.configure({fragment:e.collaboration.fragment})),(o=e.collaboration.provider)!=null&&o.awareness){const n=r=>{const a=document.createElement("span");a.classList.add("collaboration-cursor__caret"),a.setAttribute("style",`border-color: ${r.color}`);const s=document.createElement("span");s.classList.add("collaboration-cursor__label"),s.setAttribute("style",`background-color: ${r.color}`),s.insertBefore(document.createTextNode(r.name),null);const l=document.createTextNode(""),c=document.createTextNode("");return a.insertBefore(l,null),a.insertBefore(s,null),a.insertBefore(c,null),a};t.push(to.default.configure({user:e.collaboration.user,render:e.collaboration.renderCursor||n,provider:e.collaboration.provider}))}}else t.push(zi.History);const i=e.disableExtensions||[];return t.filter(n=>!i.includes(n.name))};function Un(e,t){const i=[];return e.forEach((o,n,r)=>{r!==t&&i.push(o)}),y.Fragment.from(i)}function jn(e,t){let i=y.Fragment.from(e.content);for(let o=0;o<i.childCount;o++)if(i.child(o).type.spec.group==="blockContent"){const n=[i.child(o)];if(o+1<i.childCount&&i.child(o+1).type.spec.group==="blockGroup"){const a=i.child(o+1).child(0).child(0);(a.type.name==="bulletListItem"||a.type.name==="numberedListItem"||a.type.name==="checkListItem")&&(n.push(i.child(o+1)),i=Un(i,o+1))}const r=t.state.schema.nodes.blockContainer.create(void 0,n);i=i.replaceChild(o,r)}return new y.Slice(i,e.openStart,e.openEnd)}function Oe(e){return e&&Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}class he{constructor(t){u(this,"blockSpecs");u(this,"inlineContentSpecs");u(this,"styleSpecs");u(this,"blockSchema");u(this,"inlineContentSchema");u(this,"styleSchema");u(this,"BlockNoteEditor","only for types");u(this,"Block","only for types");u(this,"PartialBlock","only for types");this.blockSpecs=Oe(t==null?void 0:t.blockSpecs)||Ae,this.inlineContentSpecs=Oe(t==null?void 0:t.inlineContentSpecs)||He,this.styleSpecs=Oe(t==null?void 0:t.styleSpecs)||Ne,this.blockSchema=Ce(this.blockSpecs),this.inlineContentSchema=Se(this.inlineContentSpecs),this.styleSchema=Me(this.styleSpecs)}static create(t){return new he(t)}}class gi extends b.Editor{constructor(i,o){super({...i,content:void 0});u(this,"_state");u(this,"mount",i=>{i?(this.options.element=i,this.createViewAlternative()):this.destroy()});const n=this.schema;let r;const a=n.nodes.doc.createAndFill;n.nodes.doc.createAndFill=(...l)=>{if(r)return r;const c=a.apply(n.nodes.doc,l),p=JSON.parse(JSON.stringify(c.toJSON()));return p.content[0].content[0].attrs.id="initialBlockId",r=y.Node.fromJSON(n,p),r};let s;try{const l=i==null?void 0:i.content.map(c=>N(c,this.schema,o).toJSON());s=b.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(i.content))}this._state=_.EditorState.create({doc:s,schema:this.schema})}get state(){return this.view&&(this._state=this.view.state),this._state}dispatch(i){this.view?this.view.dispatch(i):this._state=this.state.apply(i)}createViewAlternative(){queueMicrotask(()=>{this.view=new M.EditorView({mount:this.options.element},{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:this.state});const i=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(i),this.createNodeViews()})}}gi.prototype.createView=()=>{};const Rn=new _.PluginKey("blocknote-placeholder"),On=(e,t)=>new _.Plugin({key:Rn,view:()=>{const i=document.createElement("style"),o=e._tiptapEditor.options.injectNonce;o&&i.setAttribute("nonce",o),e._tiptapEditor.view.root instanceof ShadowRoot?e._tiptapEditor.view.root.append(i):e._tiptapEditor.view.root.head.appendChild(i);const n=i.sheet,r=(s="")=>`.bn-block-content${s} .bn-inline-content:has(> .ProseMirror-trailingBreak:only-child):before`,a=(s,l=!0)=>{const c=l?"[data-is-empty-and-focused]":"";if(s==="default")return r(c);const p=`[data-content-type="${s}"]`;return r(c+p)};for(const[s,l]of Object.entries(t)){const c=s==="default";n.insertRule(`${a(s,c)}{ content: ${JSON.stringify(l)}; }`),c||n.insertRule(`${a(s,!0)}{ content: ${JSON.stringify(l)}; }`)}return{destroy:()=>{e._tiptapEditor.view.root instanceof ShadowRoot?e._tiptapEditor.view.root.removeChild(i):e._tiptapEditor.view.root.head.removeChild(i)}}},props:{decorations:i=>{const{doc:o,selection:n}=i;if(!e.isEditable||!n.empty)return;const r=n.$anchor,a=r.parent;if(a.content.size>0)return null;const s=r.before(),l=M.Decoration.node(s,s+a.nodeSize,{"data-is-empty-and-focused":"true"});return M.DecorationSet.create(o,[l])}}}),Vn={enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!1};class Ve{constructor(t){u(this,"_pmSchema");u(this,"headless",!1);u(this,"_tiptapEditor");u(this,"elementRenderer",null);u(this,"blockCache",new WeakMap);u(this,"dictionary");u(this,"schema");u(this,"blockImplementations");u(this,"inlineContentImplementations");u(this,"styleImplementations");u(this,"formattingToolbar");u(this,"linkToolbar");u(this,"sideMenu");u(this,"suggestionMenus");u(this,"filePanel");u(this,"tableHandles");u(this,"uploadFile");u(this,"resolveFileUrl");u(this,"mount",t=>{this._tiptapEditor.mount(t)});var l,c,p,h,m,g,f;this.options=t;const i=t;if(i.onEditorContentChange)throw new Error("onEditorContentChange initialization option is deprecated, use <BlockNoteView onChange={...} />, the useEditorChange(...) hook, or editor.onChange(...)");if(i.onTextCursorPositionChange)throw new Error("onTextCursorPositionChange initialization option is deprecated, use <BlockNoteView onSelectionChange={...} />, the useEditorSelectionChange(...) hook, or editor.onSelectionChange(...)");if(i.onEditorReady)throw new Error("onEditorReady is deprecated. Editor is immediately ready for use after creation.");if(i.editable)throw new Error("editable initialization option is deprecated, use <BlockNoteView editable={true/false} />, or alternatively editor.isEditable = true/false");this.dictionary=t.dictionary||Ze;const o={defaultStyles:!0,schema:t.schema||he.create(),_headless:!1,...t,placeholders:{...this.dictionary.placeholders,...t.placeholders}};this.schema=o.schema,this.blockImplementations=o.schema.blockSpecs,this.inlineContentImplementations=o.schema.inlineContentSpecs,this.styleImplementations=o.schema.styleSpecs,this.formattingToolbar=new ei(this),this.linkToolbar=new ii(this),this.sideMenu=new si(this),this.suggestionMenus=new li(this),this.filePanel=new Jt(this),B("table",this)&&(this.tableHandles=new ui(this));const n=fi({editor:this,domAttributes:o.domAttributes||{},blockSpecs:this.schema.blockSpecs,styleSpecs:this.schema.styleSpecs,inlineContentSpecs:this.schema.inlineContentSpecs,collaboration:o.collaboration,trailingBlock:o.trailingBlock,disableExtensions:o.disableExtensions}),r=b.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]:[],On(this,o.placeholders)]});n.push(r),this.uploadFile=o.uploadFile,this.resolveFileUrl=o.resolveFileUrl||(async k=>k),this.headless=o._headless,o.collaboration&&o.initialContent&&console.warn("When using Collaboration, initialContent might cause conflicts, because changes should come from the collaboration provider");const a=o.initialContent||(t.collaboration?[{type:"paragraph",id:"initialBlockId"}]:[{type:"paragraph",id:G.options.generateID()}]);if(!Array.isArray(a)||a.length===0)throw new Error("initialContent must be a non-empty array of blocks, received: "+a);const s={...Vn,...o._tiptapOptions,content:a,extensions:[...((l=o._tiptapOptions)==null?void 0:l.extensions)||[],...n],editorProps:{...(c=o._tiptapOptions)==null?void 0:c.editorProps,attributes:{...(h=(p=o._tiptapOptions)==null?void 0:p.editorProps)==null?void 0:h.attributes,...(m=o.domAttributes)==null?void 0:m.editor,class:D("bn-editor",o.defaultStyles?"bn-default-styles":"",((f=(g=o.domAttributes)==null?void 0:g.editor)==null?void 0:f.class)||"")},transformPasted:jn}};this.headless?this._pmSchema=b.getSchema(s.extensions):(this._tiptapEditor=new gi(s,this.schema.styleSchema),this._pmSchema=this._tiptapEditor.schema)}get pmSchema(){return this._pmSchema}static create(t={}){return new Ve(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()}get topLevelBlocks(){return this.document}get document(){const t=[];return this._tiptapEditor.state.doc.firstChild.descendants(i=>(t.push(x(i,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.blockCache)),!1)),t}getBlock(t){const i=typeof t=="string"?t:t.id;let o;return this._tiptapEditor.state.doc.firstChild.descendants(n=>typeof o<"u"?!1:n.type.name!=="blockContainer"||n.attrs.id!==i?!0:(o=x(n,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.blockCache),!1)),o}forEachBlock(t,i=!1){const o=this.document.slice();i&&o.reverse();function n(r){for(const a of r){if(!t(a))return!1;const s=i?a.children.slice().reverse():a.children;if(!n(s))return!1}return!0}n(o)}onEditorContentChange(t){this._tiptapEditor.on("update",t)}onEditorSelectionChange(t){this._tiptapEditor.on("selectionUpdate",t)}getTextCursorPosition(){const{node:t,depth:i,startPos:o,endPos:n}=v(this._tiptapEditor.state.doc,this._tiptapEditor.state.selection.from),r=this._tiptapEditor.state.doc.resolve(n).index(i-1),a=this._tiptapEditor.state.doc.resolve(n+1).node().childCount;let s;r>0&&(s=this._tiptapEditor.state.doc.resolve(o-2).node());let l;return r<a-1&&(l=this._tiptapEditor.state.doc.resolve(n+2).node()),{block:x(t,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.blockCache),prevBlock:s===void 0?void 0:x(s,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.blockCache),nextBlock:l===void 0?void 0:x(l,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.blockCache)}}setTextCursorPosition(t,i="start"){const o=typeof t=="string"?t:t.id,{posBeforeNode:n}=De(o,this._tiptapEditor.state.doc),{startPos:r,contentNode:a}=v(this._tiptapEditor.state.doc,n+2),s=this.schema.blockSchema[a.type.name].content;if(s==="none"){this._tiptapEditor.commands.setNodeSelection(r);return}if(s==="inline")i==="start"?this._tiptapEditor.commands.setTextSelection(r+1):this._tiptapEditor.commands.setTextSelection(r+a.nodeSize-1);else if(s==="table")i==="start"?this._tiptapEditor.commands.setTextSelection(r+4):this._tiptapEditor.commands.setTextSelection(r+a.nodeSize-4);else throw new I(s)}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((i,o)=>i.type.spec.group!=="blockContent"||o+i.nodeSize<this._tiptapEditor.state.selection.from||o>this._tiptapEditor.state.selection.to?!0:(t.push(x(this._tiptapEditor.state.doc.resolve(o).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}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,i,o="before"){return $o(t,i,o,this)}updateBlock(t,i){return Xo(t,i,this)}removeBlocks(t){return Zo(t,this)}replaceBlocks(t,i){return Jo(t,i,this)}insertInlineContent(t){const i=z(t,this.pmSchema,this.schema.styleSchema);Yo({from:this._tiptapEditor.state.selection.from,to:this._tiptapEditor.state.selection.to},i,this)}getActiveStyles(){const t={},i=this._tiptapEditor.state.selection.$to.marks();for(const o of i){const n=this.schema.styleSchema[o.type.name];if(!n){o.type.name!=="link"&&console.warn("mark not found in styleschema",o.type.name);continue}n.propSchema==="boolean"?t[n.type]=!0:t[n.type]=o.attrs.stringValue}return t}addStyles(t){for(const[i,o]of Object.entries(t)){const n=this.schema.styleSchema[i];if(!n)throw new Error(`style ${i} not found in styleSchema`);if(n.propSchema==="boolean")this._tiptapEditor.commands.setMark(i);else if(n.propSchema==="string")this._tiptapEditor.commands.setMark(i,{stringValue:o});else throw new I(n.propSchema)}}removeStyles(t){for(const i of Object.keys(t))this._tiptapEditor.commands.unsetMark(i)}toggleStyles(t){for(const[i,o]of Object.entries(t)){const n=this.schema.styleSchema[i];if(!n)throw new Error(`style ${i} not found in styleSchema`);if(n.propSchema==="boolean")this._tiptapEditor.commands.toggleMark(i);else if(n.propSchema==="string")this._tiptapEditor.commands.toggleMark(i,{stringValue:o});else throw new I(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,i){if(t==="")return;const{from:o,to:n}=this._tiptapEditor.state.selection;i||(i=this._tiptapEditor.state.doc.textBetween(o,n));const r=this.pmSchema.mark("link",{href:t});this.dispatch(this._tiptapEditor.state.tr.insertText(i,o,n).addMark(o,o+i.length,r))}canNestBlock(){const{startPos:t,depth:i}=v(this._tiptapEditor.state.doc,this._tiptapEditor.state.selection.from);return this._tiptapEditor.state.doc.resolve(t).index(i-1)>0}nestBlock(){this._tiptapEditor.commands.sinkListItem("blockContainer")}canUnnestBlock(){const{depth:t}=v(this._tiptapEditor.state.doc,this._tiptapEditor.state.selection.from);return t>2}unnestBlock(){this._tiptapEditor.commands.liftListItem("blockContainer")}async blocksToHTMLLossy(t=this.document){return Y(this.pmSchema,this).exportBlocks(t,{})}async blocksToFullHTML(t){return le(this.pmSchema,this).serializeBlocks(t,{})}async tryParseHTMLToBlocks(t){return Ue(t,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.pmSchema)}async blocksToMarkdownLossy(t=this.document){return Gt(t,this.pmSchema,this,{})}async tryParseMarkdownToBlocks(t){return Xt(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 i=()=>{t(this)};return this._tiptapEditor.on("update",i),()=>{this._tiptapEditor.off("update",i)}}onSelectionChange(t){if(this.headless)return;const i=()=>{t(this)};return this._tiptapEditor.on("selectionUpdate",i),()=>{this._tiptapEditor.off("selectionUpdate",i)}}openSelectionMenu(t){this.prosemirrorView.focus(),this.prosemirrorView.dispatch(this.prosemirrorView.state.tr.scrollIntoView().setMeta(this.suggestionMenus.plugin,{triggerCharacter:t,fromUserInput:!1}))}}let me;async function zn(e,t){if(!zt("text",e))return[];if(!me){me=import("@emoji-mart/data");const n=(await me).default;await Ge.init({data:n})}const i=(await me).default;return(t.trim()===""?Object.values(i.emojis):await Ge.SearchIndex.search(t)).map(n=>({id:n.skins[0].native,onItemClick:()=>e.insertInlineContent(n.skins[0].native+" ")}))}function ze(e=""){return typeof e=="string"?[{type:"text",text:e,styles:{}}]:e}function bi(e){return typeof e=="string"?ze(e):Array.isArray(e)?e.flatMap(t=>typeof t=="string"?ze(t):ke(t)?{...t,content:ze(t.content)}:W(t)?t:{props:{},...t,content:bi(t.content)}):e}function Fn(e,t){return t.map(i=>Fe(e,i))}function Fe(e,t){const i={id:"",type:t.type,props:{},content:e[t.type].content==="inline"?[]:void 0,children:[],...t};return Object.entries(e[t.type].propSchema).forEach(([o,n])=>{i.props[o]===void 0&&(i.props[o]=n.default)}),{...i,content:bi(i.content),children:i.children.map(o=>Fe(e,o))}}function ki(e){e.id||(e.id=G.options.generateID()),e.children&&_i(e.children)}function _i(e){for(const t of e)ki(t)}d.AudioBlock=yt,d.BlockNoteEditor=Ve,d.BlockNoteSchema=he,d.FileBlock=St,d.FilePanelProsemirrorPlugin=Jt,d.FilePanelView=Zt,d.FormattingToolbarProsemirrorPlugin=ei,d.FormattingToolbarView=Yt,d.HTMLToBlocks=Ue,d.ImageBlock=Pt,d.LinkToolbarProsemirrorPlugin=ii,d.SideMenuProsemirrorPlugin=si,d.SideMenuView=ri,d.SuggestionMenuProseMirrorPlugin=li,d.TableHandlesProsemirrorPlugin=ui,d.TableHandlesView=ci,d.UniqueID=G,d.UnreachableCaseError=I,d.VideoBlock=Rt,d.addIdsToBlock=ki,d.addIdsToBlocks=_i,d.addInlineContentAttributes=at,d.addInlineContentKeyboardShortcuts=st,d.addStyleAttributes=pt,d.assertEmpty=ao,d.audioBlockConfig=gt,d.audioParse=kt,d.audioPropSchema=ft,d.audioRender=bt,d.audioToExternalHTML=_t,d.blockToNode=N,d.blocksToMarkdown=Gt,d.camelToDataKebab=Q,d.checkBlockHasDefaultProp=Wo,d.checkBlockIsDefaultType=Ft,d.checkBlockIsFileBlock=Ko,d.checkBlockIsFileBlockWithPlaceholder=Go,d.checkBlockIsFileBlockWithPreview=qo,d.checkBlockTypeHasDefaultProp=Kt,d.checkDefaultBlockTypeInSchema=B,d.checkDefaultInlineContentTypeInSchema=zt,d.cleanHTMLToMarkdown=ue,d.contentNodeToInlineContent=se,d.createAddFileButton=ie,d.createBlockSpec=ee,d.createBlockSpecFromStronglyTypedTiptapNode=K,d.createDefaultFilePreview=te,d.createExternalHTMLExporter=Y,d.createFigureWithCaption=ce,d.createFileAndCaptionWrapper=R,d.createInlineContentSpec=mo,d.createInlineContentSpecFromTipTapNode=dt,d.createInternalBlockSpec=xe,d.createInternalHTMLSerializer=le,d.createInternalInlineContentSpec=lt,d.createInternalStyleSpec=Te,d.createLinkWithCaption=ne,d.createResizeHandlesWrapper=Le,d.createStronglyTypedTiptapNode=U,d.createStyleSpec=fo,d.createStyleSpecFromTipTapMark=j,d.createSuggestionMenu=mn,d.defaultBlockSchema=Ot,d.defaultBlockSpecs=Ae,d.defaultInlineContentSchema=Vt,d.defaultInlineContentSpecs=He,d.defaultProps=E,d.defaultStyleSchema=Fo,d.defaultStyleSpecs=Ne,d.fileBlockConfig=vt,d.fileParse=xt,d.filePropSchema=wt,d.fileRender=Et,d.fileToExternalHTML=Ct,d.filenameFromURL=ho,d.filterSuggestionItems=wn,d.formatKeyboardShortcut=H,d.formattingToolbarPluginKey=Qt,d.getBlockFromPos=nt,d.getBlockNoteExtensions=fi,d.getBlockSchemaFromSpecs=Ce,d.getDefaultEmojiPickerItems=zn,d.getDefaultSlashMenuItems=yn,d.getDraggableBlockFromElement=re,d.getInlineContentParseRules=ct,d.getInlineContentSchemaFromSpecs=Se,d.getParseRules=rt,d.getStyleParseRules=ht,d.getStyleSchemaFromSpecs=Me,d.imageBlockConfig=Mt,d.imageParse=Lt,d.imagePropSchema=Tt,d.imageRender=Bt,d.imageToExternalHTML=It,d.inheritedProps=ve,d.inlineContentToNodes=z,d.insertOrUpdateBlock=T,d.isAppleOS=it,d.isLinkInlineContent=be,d.isPartialLinkInlineContent=ke,d.isSafari=po,d.isStyledTextInlineContent=W,d.linkToolbarPluginKey=ti,d.locales=oo,d.markdownToBlocks=Xt,d.mergeCSSClasses=D,d.nodeToBlock=x,d.nodeToCustomInlineContent=we,d.parseEmbedElement=Be,d.parseFigureElement=oe,d.parseImageElement=Ie,d.partialBlockToBlockForTesting=Fe,d.partialBlocksToBlocksForTesting=Fn,d.propsToAttributes=Ee,d.sideMenuPluginKey=ai,d.stylePropsToAttributes=ut,d.tableContentToNodes=ye,d.tableHandlesPluginKey=J,d.uploadToTmpFilesDotOrg_DEV_ONLY=go,d.videoBlockConfig=Ht,d.videoParse=Ut,d.videoPropSchema=Nt,d.videoRender=Dt,d.videoToExternalHTML=jt,d.wrapInBlockStructure=de,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
8
8
|
//# sourceMappingURL=blocknote.umd.cjs.map
|