@layers-app/editor 0.5.4-optimization → 0.5.5-optimization

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/dist/index.cjs +2 -0
  2. package/dist/index.js +12 -10
  3. package/dist/layers.B10sB-Vy.js +1 -0
  4. package/dist/layers.BDsvvINb.js +6774 -0
  5. package/dist/layers.BFJ7oQiY.js +7723 -0
  6. package/dist/layers.BwyONivc.js +864 -0
  7. package/dist/layers.C2lacXcg.js +2511 -0
  8. package/dist/layers.C69TrYD7.js +7 -0
  9. package/dist/layers.CEMW9z_P.js +4 -0
  10. package/dist/layers.Cwao1pOZ.js +6 -0
  11. package/dist/layers.CzNz0Zya.js +1 -0
  12. package/dist/layers.D0Z-zLAV.js +530 -0
  13. package/dist/layers.DNCgFYS7.js +27 -0
  14. package/dist/layers.EKDSoJm1.js +2227 -0
  15. package/dist/layers.QjAkD17S.js +3677 -0
  16. package/dist/layers.ahDFHQXD.js +341 -0
  17. package/dist/layers.eLiGm-eZ.js +3 -0
  18. package/dist/layers.hgliNTDV.js +2 -0
  19. package/package.json +74 -17
  20. package/dist/layers.0EAb8Ajx.js +0 -65
  21. package/dist/layers.1Mvzm38Y.js +0 -501
  22. package/dist/layers.2wIERhxO.js +0 -41
  23. package/dist/layers.694DrE1_.js +0 -931
  24. package/dist/layers.7JqFgE4-.js +0 -15
  25. package/dist/layers.B-5aeeDH.js +0 -1359
  26. package/dist/layers.B0winug5.js +0 -59
  27. package/dist/layers.B1S8ufDn.js +0 -40
  28. package/dist/layers.B3JNY9Km.js +0 -42
  29. package/dist/layers.B6W2tqC0.js +0 -40
  30. package/dist/layers.B7Olyhe8.js +0 -1089
  31. package/dist/layers.BCuuRSaf.js +0 -37
  32. package/dist/layers.BESPlBGC.js +0 -32
  33. package/dist/layers.BJDrjORS.js +0 -244
  34. package/dist/layers.BJTh7mUo.js +0 -1265
  35. package/dist/layers.BLL-019k.js +0 -39
  36. package/dist/layers.BNJiP8Pw.js +0 -2966
  37. package/dist/layers.BNvAl5dS.js +0 -14
  38. package/dist/layers.BThP74aw.js +0 -32
  39. package/dist/layers.BZ4laUeR.js +0 -40
  40. package/dist/layers.BZByPNdY.js +0 -37
  41. package/dist/layers.B_5zMrI3.js +0 -38
  42. package/dist/layers.B_7N5yjX.js +0 -32
  43. package/dist/layers.BbCfEXyj.js +0 -55
  44. package/dist/layers.BdvfoI4U.js +0 -44
  45. package/dist/layers.BiJ8hfRt.js +0 -1510
  46. package/dist/layers.BiJBOHr0.js +0 -84
  47. package/dist/layers.Bk3_8qR9.js +0 -48146
  48. package/dist/layers.BkPPOKBy.js +0 -32
  49. package/dist/layers.BnZcjRLr.js +0 -32
  50. package/dist/layers.BpilXLfW.js +0 -6
  51. package/dist/layers.BqpcWKH6.js +0 -2479
  52. package/dist/layers.Br7D0wMN.js +0 -39
  53. package/dist/layers.BsAu1GXs.js +0 -42
  54. package/dist/layers.Bv5sK47C.js +0 -769
  55. package/dist/layers.BxEdkUpI.js +0 -1088
  56. package/dist/layers.BxUBbVsO.js +0 -41
  57. package/dist/layers.Bzalhqz_.js +0 -39
  58. package/dist/layers.C-dS7ntQ.js +0 -41
  59. package/dist/layers.C0Lgw_Sx.js +0 -11688
  60. package/dist/layers.C5BFsvzI.js +0 -803
  61. package/dist/layers.C5WLg9ed.js +0 -21763
  62. package/dist/layers.C6lAFlKZ.js +0 -186
  63. package/dist/layers.C8_lu5UH.js +0 -23
  64. package/dist/layers.CGwNL7dH.js +0 -791
  65. package/dist/layers.CI739wqN.js +0 -39
  66. package/dist/layers.CKaj4dG4.js +0 -41
  67. package/dist/layers.CLRiSwgi.js +0 -904
  68. package/dist/layers.CN1QkD6D.js +0 -38
  69. package/dist/layers.CPY6U3g-.js +0 -1034
  70. package/dist/layers.CRSjdIG6.js +0 -1619
  71. package/dist/layers.CUHkTCid.js +0 -6
  72. package/dist/layers.CUPMw0sy.js +0 -40
  73. package/dist/layers.CWb6LiAY.js +0 -40
  74. package/dist/layers.C_XsSNQo.js +0 -42
  75. package/dist/layers.CbmlFoXt.js +0 -33
  76. package/dist/layers.CfGeHh-g.js +0 -36
  77. package/dist/layers.CiJxVu9b.js +0 -36
  78. package/dist/layers.Cj4ezyVr.js +0 -33
  79. package/dist/layers.Cpb-MRZn.js +0 -960
  80. package/dist/layers.CqVTtuYm.js +0 -6
  81. package/dist/layers.CskURloi.js +0 -39
  82. package/dist/layers.CtTD47i4.js +0 -41
  83. package/dist/layers.CxcvEfKe.js +0 -36
  84. package/dist/layers.D-U9uIsP.js +0 -40
  85. package/dist/layers.D10WeKck.js +0 -2235
  86. package/dist/layers.D4T8fTcj.js +0 -1223
  87. package/dist/layers.D4jK2Tet.js +0 -39
  88. package/dist/layers.D7jGxypv.js +0 -8
  89. package/dist/layers.DBosqi2D.js +0 -19
  90. package/dist/layers.DGtETOVJ.js +0 -304
  91. package/dist/layers.DKENAsMv.js +0 -220
  92. package/dist/layers.DLwuMfdd.js +0 -84
  93. package/dist/layers.DN9HoVxI.js +0 -18
  94. package/dist/layers.DOBSfaUM.js +0 -35
  95. package/dist/layers.DOKLQ6A3.js +0 -373
  96. package/dist/layers.DPuVWH3L.js +0 -40
  97. package/dist/layers.DQVXh43C.js +0 -42
  98. package/dist/layers.DSTh89J8.js +0 -42
  99. package/dist/layers.DUsIfvNt.js +0 -46859
  100. package/dist/layers.DVfpGIrv.js +0 -41
  101. package/dist/layers.DWSkLlGf.js +0 -41
  102. package/dist/layers.DX1RI3m3.js +0 -32
  103. package/dist/layers.DdMwmP4m.js +0 -37
  104. package/dist/layers.DhkyREpW.js +0 -793
  105. package/dist/layers.Dj-f1_6N.js +0 -34
  106. package/dist/layers.DjUOC4st.js +0 -16
  107. package/dist/layers.DjhJT1nZ.js +0 -21938
  108. package/dist/layers.Djl9Gz6s.js +0 -282
  109. package/dist/layers.Dn2AP7iE.js +0 -1283
  110. package/dist/layers.Dqbek_0L.js +0 -40
  111. package/dist/layers.DsDjOLHs.js +0 -437
  112. package/dist/layers.DsOaqGXW.js +0 -8
  113. package/dist/layers.DuE1l7lR.js +0 -41
  114. package/dist/layers.DxA6ocdw.js +0 -70
  115. package/dist/layers.DxHlP7Pb.js +0 -39
  116. package/dist/layers.Dy1naDTQ.js +0 -14
  117. package/dist/layers.DyZ5R-vS.js +0 -37
  118. package/dist/layers.H2Kl_PC2.js +0 -40
  119. package/dist/layers.IW4NBP9k.js +0 -39
  120. package/dist/layers.LGx1jmqd.js +0 -40
  121. package/dist/layers.NABwYdw5.js +0 -35
  122. package/dist/layers.NtwvbkGN.js +0 -1580
  123. package/dist/layers.O-bFTk-n.js +0 -268
  124. package/dist/layers.R_udKe_N.js +0 -38
  125. package/dist/layers.TdTDbIzb.js +0 -1126
  126. package/dist/layers.WLeJl9el.js +0 -202
  127. package/dist/layers.b0h5ZBmD.js +0 -61
  128. package/dist/layers.dEHKcy8J.js +0 -320
  129. package/dist/layers.eTredPK_.js +0 -36
  130. package/dist/layers.gIdzfQAa.js +0 -5
  131. package/dist/layers.huV95Ipe.js +0 -295
  132. package/dist/layers.jU4W5PG5.js +0 -9166
  133. package/dist/layers.lCpg7dOn.js +0 -21
  134. package/dist/layers.mQcENPPW.js +0 -802
  135. package/dist/layers.nPQCmYXI.js +0 -423
  136. package/dist/layers.ntC1foLT.js +0 -39
  137. package/dist/layers.uHy1yMbq.js +0 -6
@@ -0,0 +1,3 @@
1
+ "use strict";var ht=Object.defineProperty;var pt=(t,e,o)=>e in t?ht(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var pe=(t,e,o)=>pt(t,typeof e!="symbol"?e+"":e,o);const r=require("react/jsx-runtime"),u=require("react"),De=require("react-i18next"),fe=require("@lexical/html"),gt=require("@lexical/react/LexicalCollaborationPlugin"),ft=require("@lexical/react/LexicalComposer"),je=require("@lexical/react/LexicalHistoryPlugin"),bt=require("@mantine/core"),p=require("lexical"),et=require("y-websocket"),yt=require("i18next"),tt=require("@lexical/react/LexicalComposerContext"),ve=require("@lexical/utils"),ke=require("./layers.Cwao1pOZ.js"),j=require("./layers.CEMW9z_P.js"),E=require("./layers.C69TrYD7.js"),ae=require("yjs"),_t=require("@lexical/react/LexicalClearEditorPlugin"),Ct=require("@lexical/react/LexicalClickableLinkPlugin"),wt=require("@lexical/react/LexicalErrorBoundary"),kt=require("@lexical/react/LexicalHashtagPlugin"),vt=require("@lexical/react/LexicalHorizontalRulePlugin"),St=require("@lexical/react/LexicalOnChangePlugin"),xt=require("@lexical/react/LexicalRichTextPlugin"),Ue=require("react-dom"),Ee=require("@lexical/mark"),Be=require("@lexical/selection"),At=require("lodash-es"),ze=require("@layers-app/shared"),Mt=require("@lexical/yjs"),ge=require("./layers.hgliNTDV.js"),Ce=require("./layers.B10sB-Vy.js"),B=require("./layers.CzNz0Zya.js"),$e=require("@mantine/hooks"),It="0.5.5-optimization",Et={version:It},Nt=JSON.parse(`{"placeholder":"Write something, or press '/' for commands...","heading":{"h1":"Heading 1","h2":"Heading 2","h3":"Heading 3","name":"Heading"},"close":"Close","upload":"Upload","unsavedChanges":{"title":"Unsaved changes","message":"Are you sure you want to close the page? All unsaved data will be lost.","cancel":"Cancel","closeWithoutSaving":"Close without saving"},"menu":{"heading":{"title":"Headings","hintShowCase":"Your Ideas, Documents, and Plans. United. Welcome to {{projectName}} — this is a connected workspace where work becomes better and faster.","h1":{"subtitle":"Large Heading","hintDescription":"H1 is used to create the main heading of a page or section, which sets the overall theme. It is also used to automatically generate the table of contents for a document.","keywords":{"header1":"header1","headerOne":"headerone","h1":"h1"}},"h2":{"subtitle":"Medium Heading","hintDescription":"H2 is used to create a secondary heading of a page or section, which sets a general theme. It is also used to automatically generate the table of contents for a document.","keywords":{"header2":"header2","headerTwo":"headertwo","h2":"h2"}},"h3":{"subtitle":"Small Heading","hintDescription":"H3 is used to create a subheading of a page or section, which sets a general theme. It is also used to automatically generate the table of contents for a document.","keywords":{"header3":"header3","headerThree":"headerthree","h3":"h3"}}},"lists":{"title":"Lists","numberList":{"name":"Numbered List","subtitle":"A simple numbered list","hint":{"firstItem":"First item","secondItem":"Second item","firstSubItem":"First sub-item","secondSubItem":"Second sub-item","firstSubSubItem":"First sub-sub-item","secondSubSubItem":"Second sub-sub-item","description":"This tool creates a list with items that are automatically numbered when new rows are added."}},"bulletList":{"name":"Bulleted List","subtitle":"Automatically marked list","hint":{"firstItem":"First item","secondItem":"Second item","firstSubItem":"First sub-item","secondSubItem":"Second sub-item","firstSubSubItem":"First sub-sub-item","secondSubSubItem":"Second sub-sub-item","description":"This tool creates a list with items that are automatically marked with bullets when new rows are added."}},"checkList":{"name":"Checklist","subtitle":"Easy task management","hint":{"indeterminate":"Indeterminate","unchecked":"Unchecked","checked":"Checked","description":"Creates a task list with the ability to mark completed items and sub-items."}}},"main":{"title":"Basics","paragraph":{"name":"Paragraph","subtitle":"Simply start typing regular text","hint":{"text":"Your Ideas, Documents, and Plans. United. Welcome to {{projectName}} — this is a connected workspace where work becomes better and faster.","description":"A few lines of text, left-aligned, imitating a text block."}},"quote":{"name":"Quote","subtitle":"Write down a quote","hint":{"text":"/quote Your Ideas, Documents, and Plans. United. Welcome to {{projectName}} — this is a connected workspace where work becomes better and faster. Stay focused, stay aligned, and achieve more with Layers.","description":"Used to insert quotes or highlight important text blocks. It is visually separated from the main text."}},"collapse":{"name":"Collapsible","subtitle":"Hide block content","hint":{"firstItemEmpty":"First item is empty","secondItem":"Second item","firstSubItemEmpty":"First sub-item is empty","secondSubItem":"Second sub-item","firstSubSubItemEmpty":"First sub-sub-item is empty","secondSubSubItem":"Second sub-sub-item","description":"Used to create blocks with content that can be hidden or shown when clicked. Almost any other block can be placed inside such a list."}},"horizontal-rule":{"name":"Divider","subtitle":"Visualizes block dividers","hint":{"topText":"Pressed the slash. Then entered something...","bottomText":"The next day, everything became clearer and more understandable. As if what was unknown yesterday became completely familiar and ordinary today. Take, for example...","description":"Used to visually separate sections or blocks of text on a page."}},"table":{"name":"Table","subtitle":"Add a simple table to your page","hint":{"firstRow":"First cell filled with text","secondRow":"And another cell with text","description":"A tool for creating tables with multiple rows and columns to organize data."}},"grid":{"name":"Grid","subtitle":"Up to 4 columns of blocks","hint":{"firstColumn":"The next day, everything became clearer and more understandable. As if what was unknown yesterday became completely familiar and ordinary today. Take, for example...","secondColumn":"Your Ideas, Documents, and Plans. United. Welcome to {{projectName}} — this is a connected workspace where work becomes better and faster.","description":"A tool for dividing a document into multiple columns, into which any blocks can be placed."}},"code":{"name":"Code","subtitle":"Write a code snippet","copy":"Copy code","exitCommandText":"Shift + Enter to exit code block","collapsible":{"hidden":"Collapse code","expand":"Expand code"},"hint":{"description":"A tool for inserting code snippets with syntax highlighting."}},"callout":{"name":"Callout","subtitle":"Make writing stand out","hint":{"description":"-."}}},"callout":{"title":"Callout","default":{"name":"Default","hint":{"description":"A few lines of text aligned to the left, simulating a text block.","body":"/callout Your Ideas, Documents, and Plans. Unified. Welcome to {{projectName}} — a connected workspace where work gets better and faster. Your Ideas and Plans. Unified. Welcome to {{projectName}} — a connected workspace where work gets better and faster. Your Ideas, Documents, and Plans. Unified. Welcome to {{projectName}} — a connected workspace where work gets better and faster."},"keywords":{"callout":"callout","type":"default"},"subtitle":"Default callout"},"success":{"name":"Success","subtitle":"Successful notification","keywords":{"callout":"callout","type":"success"}},"warning":{"name":"Warning","hint":{"description":"A few lines of text aligned to the left, simulating a text block."},"keywords":{"callout":"callout","type":"warning"},"subtitle":"Important notification"},"alert":{"name":"Alert","hint":{"description":"A few lines of text aligned to the left, simulating a text block."},"keywords":{"callout":"callout","type":"alert"},"subtitle":"Critical notification"}},"media":{"title":"Media","photo":{"name":"Image","hint":{"description":"A tool for adding an image to a page."},"subtitle":"Upload and place via link"},"form":{"name":"Form","subtitle":"Add a form"},"video":{"name":"Video","hint":{"description":"A tool for embedding video on a page."},"subtitle":"Add a video"},"file":{"name":"File","hint":{"description":"Upload any files up to 500 MB in size, and they will be available for download to anyone you share the link to this page with."},"subtitle":"Add a file"},"audio":{"name":"Audio","hint":{"description":"Upload any audio files up to 5 MB in size, and they will be available for download and listening to anyone you share the link to this page with."},"subtitle":"Add a audio"},"excalidraw":{"name":"Paint","hint":{"description":"Draw any scheme or kind landscape. Free creativity where everything is in your hands."},"keywords":{"video":"draw"},"subtitle":"Work with vector graphics"}},"other":{"title":"Other","documents":{"empty":"You have no nested documents","name":"Nested Documents","subtitle":"Displays a list of nested documents"},"emoji":{"name":"Emoji","subtitle":"Add emoji"}},"integrations":{"title":"Integrations"}},"toolbar":{"turnInto":"Turn into","bold":"Bold","italic":"Italic","underline":"Underline","strike":"Strikethrough","superscript":"Superscript","subscript":"Subscript","align":"Alignment","left":"Align Left","center":"Align Center","right":"Align Right","justify":"Justify","indent":"Indent","outdent":"Outdent","color":"Color","code":"Code","link":"Add Link","clear":"Clear Formatting","comment":"Comment"},"link":{"linkName":"Link name","link":"Link","save":"Save","remove":"Remove","edit":"Edit","copy":"Copy"},"contextMenu":{"copy":"Copy","cut":"Cut","paste":"Paste","delete":"Delete","add":"Add","selectAll":"Select All","duplicate":"Duplicate","appearance":"Appearance"},"colors":{"lastTimeUsed":"Last Used","color":"Color","background":"Background","theme":"Theme","colors":{"standard":"Standard","gray":"Gray","brown":"Brown","orange":"Orange","yellow":"Yellow","green":"Green","blue":"Blue","purple":"Purple","pink":"Pink","red":"Red"},"callout":{"success":"Success","alert":"Alert","warning":"Warning"}},"video":{"insert":"Embed","apply":"Apply","worksWith":"Works with","add_video":"Add Video"},"swagger":{"insert":"Swagger","worksWith":"Works with","add":"Add Swagger"},"image":{"add_photo":"Add Image","preview":"Preview"},"file":{"add_file":"Add File"},"audio":{"add_audio":"Add Audio"},"mention":{"mark":"Mark someone"},"validation":{"link":"Invalid Link","shouldNotExceed":"File size should not exceed {{maxSize}} MB.","doNotUploadMoreThanSingleFile":"Please upload no more than one file.","swaggerUnavailable":"Swagger documentation is unavailable. Please make sure the URL is correct and the server is responding."},"table":{"background_one":"Cell Background Color","background_other":"Cells background color","settings":"Settings","menu":{"addColAfter":"Add Column Right","addColBefore":"Add Column Left","addRowAbove":"Add Row Above","addRowBelow":"Add Row Below","deleteCol":"Delete Column","deleteRow":"Delete Row","mergeCells":"Merge Cells","disconnectCells":"Disconnect Cells","splitCell":"Split Cell","deleteTable":"Delete Table","insertRow_one":"Insert row","insertRow_other":"Insert {{count}} rows","deleteRow_one":"Delete row","deleteRow_other":"Delete {{count}} rows","insertCol_one":"Insert column","insertCol_other":"Insert {{count}} columns","deleteCol_one":"Delete column","deleteCol_other":"Delete {{count}} columns","headTable_col":"{{value}} row column","headTable_row":"{{value}} row header","below":"Below","above":"Above","left":"Left","right":"Right","row":"Row","rows":"Rows","column":"Column","columns":"Columns"}},"column":{"name":"Insert Grid","insert":"Insert","columns":"Columns","addRight":"Add a column to the right","addLeft":"Add a column to the left","moveLeft":"Move a column to the left","changeColor":"Change the column color","moveRight":"Move a column to the right","deleteColumn":"Delete a column"},"hoverOptions":{"addNewBlockBelow":"Add block below","addNewBlockAbove":"Add block above","drag":"Drag","click":"Click","clickAction":"To open the menu","dragAction":"To move"},"embed":{"placeholder":"Enter a valid embed URL","insert":"Embed","addEmbed":"Add Embed"},"content":"Content","emoji":{"emojis":"Emoji","icons":"Icons","search":"Search","searchResults":"Search result","searchNoResults":"Emoji not found","remove":"Remove","emojiCategory":{"frequent":"Frequently used","people":"Emotions and people","nature":"Animals and nature","foods":"Food and drinks","activity":"Activities","places":"Travel and Places","objects":"Items","symbols":"Symbols","flags":"Flags"}},"form":{"url":"Enter a valid URL."},"noTitle":"No title","gallery":{"download":"Download","close":"Close","errorFile":"Failed to download file"},"emptyPageOptions":{"heading":"A Heading that will automatically generate an interactive table of contents","grid":"The grid will help structure the page horizontally","template":"Create from Template","list":"Numbered list, for easy outlining of the meeting","code":"Code block with syntax support","callout":"Callout for highlighting","table":"Table, to find dependencies in the data","integrations":"Many integrations from third-party services"},"comments":{"title":"Comments","edited":"edited","filter":{"resolved":"Resolved","open":"Open","all":"All","selectUsers":"Filter by users","searchPlaceholder":"Search users","emptyPlaceholder":"No users found","byStatus":"Filter by status","byPerson":"Filter by person"},"generalComment":"Add general comment","addComment":"Add a comment","replyComment":"Enter your reply","inputEditor":{"uploadFiles":"Upload files","sendMessage":"Send message","editMessage":"Edit message","clear":"Clear","clearModal":{"title":"Clear input","description":{"both":"Are you sure you want to delete the text and files?","text":"Are you sure you want to delete the text?","files":"Are you sure you want to delete the files?","empty":"Clear the input field?"}},"discardModal":{"title":"Exit without saving","description":"If you exit now, all unsaved changes will be lost.","labels":{"confirm":"Yes, exit","cancel":"Close"}},"cancelCommentModal":{"description":"If you leave now, your draft comment will be discarded and it won’t be posted."}},"notifications":{"title":"Notify me about:","description":"You will always be notified about mentions","options":{"all":"All comments","replies":"Replies"},"uploadMessages":{"tooManyFiles":"You can upload no more than 10 files!","fileTooLarge":"File(s) larger than 5MB will not be uploaded!","fileLimit":"You have reached the limit of 10 files"}},"actionTooltips":{"resolve":"Resolve","reopen":"Re-open","addReaction":"Add reaction","reactionLimit":"You’ve reached the reaction limit","reply":"Reply"},"menuActions":{"edit":"Edit","delete":"Delete","download":"Download"},"deleteModal":{"title":{"thread":"Delete Thread","general":"Delete General Discussion","comment":"Delete Reply"},"description":{"thread":"Are you sure you want to delete this thread and all its replies?","general":"Are you sure you want to delete this general discussion and all its replies?","comment":"Are you sure you want to delete this reply?"},"actions":{"cancel":"Cancel","remove":"Remove","delete":"Delete"}},"repliesToggle":{"show_one":"Show {{count}} more comment","show_other":"Show {{count}} more comments","hide":"Hide replies"},"emptyState":{"not-resolved":"No open comments","resolved":"No resolved comments","all":"No comments","userFilter":"No comments found for the selected user"}},"ai":{"placeholder":"Custom prompt","copied":"copied","copy":"copy","back":"Back","menu":{"style":{"professional":"Professional","straightforward":"Straightforward","passiveAggressive":"Passive-aggressive","friendly":"Friendly","poetic":"Poetic","passive_aggressive":"Passive aggressive","pirate":"Pirate"},"main":{"modifySelection":"Modify selection","improveWriting":"Improve writing","fixMistakes":"Fix mistakes","simplify":"Simplify","addMoreDetail":"Add more detail","generate":"Generate","summarise":"Summarise","translate":"Translate into...","changeStyle":"Change style to...","explain":"Explain"},"answer":{"replaceSelection":"Replace selection","addTextInline":"Add text inline","addBelowParagraph":"Add below paragraph","modifyFurther":"Modify further","continueWriting":"Continue writing","regenerate":"Regenerate","otherOptions":"Other options","discard":"Discard"},"languages":{"arabic":"Arabic","bengali":"Bengali","chinese":"Chinese","dutch":"Dutch","english":"English","french":"French","german":"German","hindi":"Hindi","japanese":"Japanese","korean":"Korean","nepali":"Nepali","portuguese":"Portuguese","spanish":"Spanish"}}},"actions":{"delete":"Delete","align":"Alignment"},"cancel":"Cancel"}`),Pt={editor:Nt},Rt=JSON.parse(`{"placeholder":"Escribe algo o pulsa '/' para comandos...","heading":{"h1":"Encabezado 1","h2":"Encabezado 2","h3":"Encabezado 3","name":"Encabezado"},"close":"Cerrar","upload":"Subir","unsavedChanges":{"title":"Cambios no guardados","message":"¿Está seguro de que desea cerrar la página? Todos los datos no guardados se perderán.","cancel":"Cancelar","closeWithoutSaving":"Cerrar sin guardar"},"menu":{"heading":{"title":"Encabezados","hintShowCase":"Tus ideas, documentos y planes. Unidos. Bienvenido a {{projectName}}: un espacio de trabajo conectado donde el trabajo mejora y se acelera.","h1":{"subtitle":"Encabezado grande","hintDescription":"H1 se utiliza para crear el encabezado principal de una página o sección, estableciendo el tema general. También se utiliza para generar automáticamente el índice de contenidos del documento.","keywords":{"header1":"encabezado1","headerOne":"encabezadouno","h1":"h1"}},"h2":{"subtitle":"Encabezado mediano","hintDescription":"H2 se utiliza para crear un encabezado secundario de una página o sección, estableciendo un tema general. También se utiliza para generar automáticamente el índice de contenidos.","keywords":{"header2":"encabezado2","headerTwo":"encabezadodos","h2":"h2"}},"h3":{"subtitle":"Encabezado pequeño","hintDescription":"H3 se utiliza para crear un subencabezado de una página o sección. También genera automáticamente el índice de contenidos.","keywords":{"header3":"encabezado3","headerThree":"encabezadotres","h3":"h3"}}},"lists":{"title":"Listas","numberList":{"name":"Lista numerada","subtitle":"Una lista numerada simple","hint":{"firstItem":"Primer elemento","secondItem":"Segundo elemento","firstSubItem":"Primer subelemento","secondSubItem":"Segundo subelemento","firstSubSubItem":"Primer sub-subelemento","secondSubSubItem":"Segundo sub-subelemento","description":"Esta herramienta crea una lista con elementos que se numeran automáticamente al agregar nuevas filas."}},"bulletList":{"name":"Lista con viñetas","subtitle":"Lista con marcadores automáticos","hint":{"firstItem":"Primer elemento","secondItem":"Segundo elemento","firstSubItem":"Primer subelemento","secondSubItem":"Segundo subelemento","firstSubSubItem":"Primer sub-subelemento","secondSubSubItem":"Segundo sub-subelemento","description":"Crea una lista cuyos elementos están marcados automáticamente con viñetas."}},"checkList":{"name":"Lista de tareas","subtitle":"Gestión de tareas fácil","hint":{"indeterminate":"Indeterminado","unchecked":"No marcado","checked":"Marcado","description":"Crea una lista de tareas con opción de marcar como completadas."}}},"main":{"title":"Elementos básicos","paragraph":{"name":"Párrafo","subtitle":"Comienza a escribir texto normal","hint":{"text":"Tus ideas, documentos y planes. Unidos. Bienvenido a {{projectName}}: un espacio de trabajo conectado donde el trabajo mejora y se acelera.","description":"Un bloque de texto alineado a la izquierda."}},"quote":{"name":"Cita","subtitle":"Escribe una cita","hint":{"text":"/quote Tus ideas, documentos y planes. Unidos. Bienvenido a {{projectName}}: un espacio de trabajo conectado donde el trabajo mejora y se acelera.","description":"Inserta citas o destaca bloques de texto importantes."}},"collapse":{"name":"Plegable","subtitle":"Oculta contenido del bloque","hint":{"firstItemEmpty":"Primer elemento vacío","secondItem":"Segundo elemento","firstSubItemEmpty":"Primer subelemento vacío","secondSubItem":"Segundo subelemento","firstSubSubItemEmpty":"Primer sub-subelemento vacío","secondSubSubItem":"Segundo sub-subelemento","description":"Crea bloques cuyo contenido se puede ocultar o mostrar al hacer clic."}},"horizontal-rule":{"name":"Divisor","subtitle":"Visualiza divisores de bloques","hint":{"topText":"Presionó la barra diagonal. Luego ingresó algo...","bottomText":"Al día siguiente, todo quedó más claro. Lo que ayer era desconocido, hoy es familiar. Por ejemplo...","description":"Separa visualmente secciones o bloques de texto."}},"table":{"name":"Tabla","subtitle":"Agrega una tabla simple a la página","hint":{"firstRow":"Primera celda con texto","secondRow":"Otra celda con texto","description":"Crea tablas con múltiples filas y columnas para organizar datos."}},"grid":{"name":"Cuadrícula","subtitle":"Hasta 4 columnas de bloques","hint":{"firstColumn":"Al día siguiente todo fue más claro...","secondColumn":"Tus ideas, documentos y planes. Unidos...","description":"Divide el documento en múltiples columnas que pueden contener bloques."}},"code":{"name":"Código","subtitle":"Escribe un fragmento de código","copy":"Copiar código","exitCommandText":"Shift + Enter para salir del bloque","collapsible":{"hidden":"Colapsar código","expand":"Expandir código"},"hint":{"description":"Inserta fragmentos de código con resaltado de sintaxis."}},"callout":{"name":"Llamado","subtitle":"Destaca un bloque de texto","hint":{"description":"-."}}},"callout":{"title":"Llamado","default":{"name":"Por defecto","hint":{"description":"Bloque de texto alineado a la izquierda.","body":"/callout Tus ideas, documentos y planes. Unidos. Bienvenido a {{projectName}}..."},"keywords":{"callout":"llamado","type":"default"},"subtitle":"Llamado por defecto"},"success":{"name":"Éxito","subtitle":"Notificación de éxito","keywords":{"callout":"llamado","type":"success"}},"warning":{"name":"Advertencia","hint":{"description":"Bloque de texto alineado a la izquierda."},"keywords":{"callout":"llamado","type":"warning"},"subtitle":"Notificación importante"},"alert":{"name":"Alerta","hint":{"description":"Bloque de texto alineado a la izquierda."},"keywords":{"callout":"llamado","type":"alert"},"subtitle":"Notificación crítica"}},"media":{"title":"Multimedia","photo":{"name":"Imagen","hint":{"description":"Agrega una imagen a la página."},"subtitle":"Sube o enlaza una imagen"},"form":{"name":"Formulario","subtitle":"Agrega un formulario"},"video":{"name":"Video","hint":{"description":"Incrusta un video en la página."},"subtitle":"Agrega un video"},"file":{"name":"Archivo","hint":{"description":"Sube archivos de hasta 500 MB para que puedan ser descargados por quienes tengan el enlace."},"subtitle":"Agrega un archivo"},"audio":{"name":"Audio","hint":{"description":"Sube archivos de audio de hasta 5 MB para compartir y escuchar."},"subtitle":"Agrega un audio"},"excalidraw":{"name":"Dibujo","hint":{"description":"Dibuja cualquier esquema o paisaje. Creatividad sin límites."},"keywords":{"video":"dibujo"},"subtitle":"Trabaja con gráficos vectoriales"}},"other":{"title":"Otros","documents":{"empty":"No tienes documentos anidados","name":"Documentos Anidados","subtitle":"Muestra una lista de documentos anidados"},"emoji":{"name":"Emoji","subtitle":"Agrega emoji"}},"integrations":{"title":"Integraciones"}},"toolbar":{"turnInto":"Convertir en","bold":"Negrita","italic":"Cursiva","underline":"Subrayado","strike":"Tachado","superscript":"Superíndice","subscript":"Subíndice","align":"Alineación","left":"Alinear a la izquierda","center":"Alinear al centro","right":"Alinear a la derecha","justify":"Justificar","indent":"Aumentar sangría","outdent":"Disminuir sangría","color":"Color","code":"Código","link":"Agregar enlace","clear":"Quitar formato","comment":"Comentario"},"link":{"linkName":"Nombre del enlace","link":"Enlace","save":"Guardar","remove":"Eliminar","edit":"Editar","copy":"Copiar"},"contextMenu":{"copy":"Copiar","cut":"Cortar","paste":"Pegar","delete":"Eliminar","add":"Agregar","selectAll":"Seleccionar todo","duplicate":"Duplicar","appearance":"Apariencia"},"colors":{"lastTimeUsed":"Último uso","color":"Color","background":"Fondo","theme":"Tema","colors":{"standard":"Estándar","gray":"Gris","brown":"Marrón","orange":"Naranja","yellow":"Amarillo","green":"Verde","blue":"Azul","purple":"Púrpura","pink":"Rosa","red":"Rojo"},"callout":{"success":"Éxito","alert":"Alerta","warning":"Advertencia"}},"video":{"insert":"Insertar","apply":"Aplicar","worksWith":"Funciona con","add_video":"Agregar video"},"swagger":{"insert":"Swagger","worksWith":"Funciona con","add":"Agregar Swagger"},"image":{"add_photo":"Agregar imagen","preview":"Vista previa"},"file":{"add_file":"Agregar archivo"},"audio":{"add_audio":"Agregar audio"},"mention":{"mark":"Mencionar a alguien"},"validation":{"link":"Enlace inválido","shouldNotExceed":"El tamaño del archivo no debe exceder {{maxSize}} MB.","doNotUploadMoreThanSingleFile":"Por favor, no subas más de un archivo.","swaggerUnavailable":"La documentación de Swagger no está disponible. Asegúrese de que la URL sea correcta y que el servidor esté respondiendo."},"table":{"background_one":"Color de fondo de celda","background_other":"Color de fondo de las celdas","settings":"Configuraciones","menu":{"addColAfter":"Agregar columna a la derecha","addColBefore":"Agregar columna a la izquierda","addRowAbove":"Agregar fila arriba","addRowBelow":"Agregar fila abajo","deleteCol":"Eliminar columna","deleteRow":"Eliminar fila","mergeCells":"Combinar celdas","disconnectCells":"Desconectar celdas","splitCell":"Dividir celda","deleteTable":"Eliminar tabla","insertRow_one":"Insertar fila","insertRow_other":"Insertar {{count}} filas","deleteRow_one":"Eliminar fila","deleteRow_other":"Eliminar {{count}} filas","insertCol_one":"Insertar columna","insertCol_other":"Insertar {{count}} columnas","deleteCol_one":"Eliminar columna","deleteCol_other":"Eliminar {{count}} columnas","headTable_col":"Columna de fila {{value}}","headTable_row":"Encabezado de fila {{value}}","below":"Debajo","above":"Arriba","left":"Izquierda","right":"Derecha","row":"Fila","rows":"Filas","column":"Columna","columns":"Columnas"}},"column":{"name":"Insertar cuadrícula","insert":"Insertar","columns":"Columnas","addRight":"Agregar columna a la derecha","addLeft":"Agregar columna a la izquierda","moveLeft":"Mover columna a la izquierda","changeColor":"Cambiar color de la columna","moveRight":"Mover columna a la derecha","deleteColumn":"Eliminar columna"},"hoverOptions":{"addNewBlockBelow":"Agregar bloque debajo","addNewBlockAbove":"Agregar bloque arriba","drag":"Arrastrar","click":"Clic","clickAction":"Para abrir el menú","dragAction":"Para mover"},"embed":{"placeholder":"Introduce una URL válida para incrustar","insert":"Insertar","addEmbed":"Agregar incrustación"},"content":"Contenido","emoji":{"emojis":"Emoji","icons":"Íconos","search":"Buscar","searchResults":"Resultado de búsqueda","searchNoResults":"Emoji no encontrado","remove":"Eliminar","emojiCategory":{"frequent":"Usados frecuentemente","people":"Emociones y personas","nature":"Animales y naturaleza","foods":"Comida y bebidas","activity":"Actividades","places":"Viajes y lugares","objects":"Objetos","symbols":"Símbolos","flags":"Banderas"}},"form":{"url":"Introduce una URL válida."},"noTitle":"Sin título","gallery":{"download":"Descargar","close":"Cerrar","errorFile":"No se pudo descargar el archivo"},"emptyPageOptions":{"heading":"Un encabezado que generará automáticamente un índice interactivo","grid":"La cuadrícula ayuda a estructurar horizontalmente la página","list":"Lista numerada para estructurar fácilmente reuniones","template":"Crear desde plantilla","code":"Bloque de código con resaltado de sintaxis","callout":"Llamado para resaltar información","table":"Tabla para encontrar dependencias en los datos","integrations":"Muchas integraciones de servicios externos"},"comments":{"title":"Comentarios","edited":"editado","filter":{"resolved":"Resueltos","open":"Abiertos","all":"Todos","selectUsers":"Filtrar por usuarios","searchPlaceholder":"Buscar usuarios","emptyPlaceholder":"No se encontraron usuarios","byStatus":"Filtrar por estado","byPerson":"Filtrar por persona"},"generalComment":"Agregar comentario general","addComment":"Agregar comentario","replyComment":"Escribe tu respuesta","inputEditor":{"uploadFiles":"Subir archivos","sendMessage":"Enviar mensaje","editMessage":"Editar mensaje","clear":"Limpiar","clearModal":{"title":"Limpiar entrada","description":{"both":"¿Está seguro de que desea eliminar el texto y los archivos?","text":"¿Está seguro de que desea eliminar el texto?","files":"¿Está seguro de que desea eliminar los archivos?","empty":"¿Limpiar el campo de entrada?"}},"discardModal":{"title":"Salir sin guardar","description":"Si sales ahora, se perderán todos los cambios no guardados.","labels":{"confirm":"Sí, salir","cancel":"Cerrar"}},"cancelCommentModal":{"description":"Si sales ahora, tu borrador de comentario se eliminará y no se publicará."}},"notifications":{"title":"Notificarme sobre:","description":"Siempre recibirás notificaciones sobre menciones","options":{"all":"Todos los comentarios","replies":"Respuestas"},"uploadMessages":{"tooManyFiles":"¡Puedes subir como máximo 10 archivos!","fileTooLarge":"¡Los archivos de más de 5 MB no se subirán!","fileLimit":"Has alcanzado el límite de 10 archivos"}},"actionTooltips":{"resolve":"Resolver","reopen":"Reabrir","addReaction":"Agregar reacción","reactionLimit":"Has alcanzado el límite de reacciones","reply":"Responder"},"menuActions":{"edit":"Editar","delete":"Eliminar","download":"Descargar"},"deleteModal":{"title":{"thread":"Eliminar hilo","general":"Eliminar discusión general","comment":"Eliminar respuesta"},"description":{"thread":"¿Estás seguro de que deseas eliminar este hilo y todas sus respuestas?","general":"¿Estás seguro de que deseas eliminar esta discusión general y todas sus respuestas?","comment":"¿Estás seguro de que deseas eliminar esta respuesta?"},"actions":{"cancel":"Cancelar","remove":"Quitar","delete":"Eliminar"}},"repliesToggle":{"show_one":"Mostrar {{count}} comentario más","show_other":"Mostrar {{count}} comentarios más","hide":"Ocultar respuestas"},"emptyState":{"not-resolved":"No hay comentarios abiertos","resolved":"No hay comentarios resueltos","all":"No hay comentarios","userFilter":"No se encontraron comentarios para el usuario seleccionado"}},"ai":{"placeholder":"Prompt personalizado","copied":"copiado","copy":"copiar","back":"Atrás","menu":{"style":{"professional":"Profesional","straightforward":"Directo","passiveAggressive":"Pasivo-agresivo","friendly":"Amistoso","poetic":"Poético","passive_aggressive":"Pasivo agresivo","pirate":"Pirata"},"main":{"modifySelection":"Modificar selección","improveWriting":"Mejorar redacción","fixMistakes":"Corregir errores","simplify":"Simplificar","addMoreDetail":"Agregar más detalle","generate":"Generar","summarise":"Resumir","translate":"Traducir a...","changeStyle":"Cambiar estilo a...","explain":"Explicar"},"answer":{"replaceSelection":"Reemplazar selección","addTextInline":"Agregar texto en línea","addBelowParagraph":"Agregar debajo del párrafo","modifyFurther":"Modificar más","continueWriting":"Seguir escribiendo","regenerate":"Regenerar","otherOptions":"Otras opciones","discard":"Descartar"},"languages":{"arabic":"Árabe","bengali":"Bengalí","chinese":"Chino","dutch":"Holandés","english":"Inglés","french":"Francés","german":"Alemán","hindi":"Hindi","japanese":"Japonés","korean":"Coreano","nepali":"Nepalí","portuguese":"Portugués","spanish":"Español"}}},"actions":{"delete":"Eliminar","align":"Alineación"},"cancel":"Cancelar"}`),Lt={editor:Rt},Tt=JSON.parse(`{"placeholder":"Напишите что-нибудь, или нажмите '/' для команд...","upload":"Загрузить","heading":{"h1":"Заголовок 1","h2":"Заголовок 2","h3":"Заголовок 3","name":"Заголовок"},"close":"Закрыть","unsavedChanges":{"title":"Несохранённые изменения","message":"Вы действительно хотите закрыть страницу? Все несохранённые данные будут потеряны.","cancel":"Отмена","closeWithoutSaving":"Закрыть без сохранения"},"menu":{"heading":{"title":"Заголовоки","hintShowCase":"Ваши Идеи, Документы и Планы. Объединены. Добро пожаловать в {{projectName}} — это связанное рабочее пространство, где работа становится лучше и быстрее.","h1":{"subtitle":"Большой заголовок","hintDescription":"H1 используется для создания основного заголовка страницы или раздела, который задает общую тему. Так же используется для автоматического формирования содержания документа.","keywords":{"heading":"оглавление","header1":"заголовок1","headerOne":"заголовокодин","h1":"з1"}},"h2":{"subtitle":"средний заголовок","hintDescription":"H2 используется для создания дополнительного заголовка страницы или раздела, который задает общую тему. Так же используется для автоматического формирования содержания документа.","keywords":{"heading":"оглавление","header2":"заголовок2","headerTwo":"заголовокдва","h2":"з2"}},"h3":{"subtitle":"Маленький заголовок","hintDescription":"H3 используется для создания подзаголовка страницы или раздела, который задает общую тему. Так же используется для автоматического формирования содержания документа.","keywords":{"heading":"оглавление","header3":"заголовок3","headerThree":"заголовоктри","h3":"з3"}}},"lists":{"title":"Списки","numberList":{"name":"Нумерованный Список","subtitle":"Простой нумерованный список","hint":{"firstItem":"Первый пункт","secondItem":"Второй пункт","firstSubItem":"Первый подпункт","secondSubItem":"Второй подпункт","firstSubSubItem":"Первый подподпункт","secondSubSubItem":"Второй подподпункт","description":"Этот инструмент создает список с элементами, которые автоматически нумеруются при добавлении новых строк."},"keywords":{"headingList":"нумерованныйсписок","heading":"нумерация","markers":"цифры"}},"bulletList":{"name":"Маркированный список","subtitle":"Автоматически маркированный список","hint":{"firstItem":"Первый пункт","secondItem":"Второй пункт","firstSubItem":"Первый подпункт","secondSubItem":"Второй подпункт","firstSubSubItem":"Первый подподпункт","secondSubSubItem":"Второй подподпункт","description":"Этот инструмент создает список с элементами, которые маркируются автоматически при добавлении новых строк."},"keywords":{"headingList":"маркированныйсписок","heading":"маркеры","markers":"точки","bulletsAlt1":"буллеты","bulletsAlt2":"булеты"}},"checkList":{"name":"Чек-лист","subtitle":"Простое управление задачами","hint":{"indeterminate":"Неопределен","unchecked":"Неотмечен","checked":"Отмечен","description":"Создает список задач с возможностью отметки выполненных пунктов и подпунктов"},"keywords":{"headingList":"списокзадач","heading":"чеклист","markers":"флажки","shoppingList":"списокпокупок"}}},"main":{"title":"Базовые","paragraph":{"name":"Парараграф","subtitle":"Просто начнийте писать обычным текстом","hint":{"text":"Ваши Идеи, Документы и Планы. Объединены. Добро пожаловать в {{projectName}} — это связанное рабочее пространство, где работа становится лучше и быстрее.","description":"Несколько строк текста, выровненных по левому краю, имитирующих текстовый блок"},"keywords":{"paragraph":"параграф","text":"текст"}},"quote":{"name":"Цитата","subtitle":"Запишите цитату","hint":{"text":"/quote Ваши Идеи, Документы и Планы. Объединены. Добро пожаловать в {{projectName}} — это связанное рабочее пространство, где работа становится лучше и быстрее. Оставайтесь сосредоточенными, действуйте слаженно и добивайтесь большего с Layers.","description":"Используется для вставки цитат или выделения важных блоков текста. Визуально выносится отдельно от основного текста"},"keywords":{"quote":"цитата","mark":"кавычки","citation":"цитирование"}},"collapse":{"name":"Сворачиваемый","subtitle":"Прячет содержимое блока","hint":{"firstItemEmpty":"Первый пункт пустой","secondItem":"Второй пункт","firstSubItemEmpty":"Первый подпункт пустой","secondSubItem":"Второй подпункт","firstSubSubItemEmpty":"Первый подподпункт пустой ","secondSubSubItem":"Второй подподпункт","description":"Используется для создания блоков с содержимым, которое можно скрыть или показать при нажатии. Внутри такого списка может быть почти любой другой блок"},"keywords":{"collapsibleList":"сворачиваемыйсписок","expandList":"раскрыть","hideList":"скрыть","turnList":"свернуть"}},"horizontal-rule":{"name":"Разделитель","subtitle":"Визуализирует разделитель блоков","hint":{"topText":"нажал на слэш. Потом что-то ввёл...","bottomText":"На следующий день всё стало яснее и понятнее. Будто то, что ещё вчера было чем-то неизведанным сегодня стало совершенно знакомым и обыденным. Вот взять, к примеру","description":"Используется для визуального разделения разделов или блоков текста на странице"},"keywords":{"divider":"разделитель","horizontalLine":"линия","border":"граница"}},"table":{"name":"Таблица","subtitle":"Добавьте на свою страницу простую таблицу","hint":{"firstRow":"Первая ячейка заполненная текстом","secondRow":"И ещё одна с текстом ячейка","description":"Инструмент для создания таблиц с несколькими строками и столбцами для организации данных"},"keywords":{"table":"таблица"}},"grid":{"name":"Сетка","subtitle":"До 4-х колонок из блоков","hint":{"firstColumn":"На следующий день всё стало яснее и понятнее. Будто то, что ещё вчера было чем-то неизведанным сегодня стало совершенно знакомым и обыденным. Вот взять, к примеру","secondColumn":"Ваши Идеи, Документы и Планы. Объединены. Добро пожаловать в {{projectName}} — это связанное рабочее пространство, где работа становится лучше и быстрее.","description":"Инструмент для разделения докуента на несколько столбцов, в которые можно помещать любые блоки"},"keywords":{"net":"сетка","grid":"грид","columns":"столбцы"}},"code":{"name":"Код","subtitle":"Запишите фрагмент кода","copy":"Копировать код","exitCommandText":"Shift + Enter чтобы выйти из блока кода","collapsible":{"hidden":"Свернуть код","expand":"Развернуть код"},"hint":{"description":"Инструмент для вставки фрагментов программного кода с подсветкой синтаксиса"},"keywords":{"code":"код","snippet":"сниппет"}}},"media":{"title":"Медиа","photo":{"name":"Картинка","hint":{"description":"Инструмент для добавления изображения на страницу"},"keywords":{"picture":"картинка","display":"изображение","meme":"мем","drawing":"иллюстрация","memePic":"пикча"},"subtitle":"Загрузите и разместите с помощью ссылки"},"form":{"name":"Форма","subtitle":"Добавьте форму"},"video":{"name":"Видео","hint":{"description":"Инструмент для вставки видео на страницу"},"keywords":{"video":"видео"},"subtitle":"Добавьте видео"},"file":{"name":"Файл","hint":{"description":"Загружайте любые файлы объёмом до 500 Мб и они будут доступны для скачивания всем, с кем вы поделитесь ссылкой на эту страницу."},"keywords":{"video":"файл"},"subtitle":"Добавьте файл"},"audio":{"name":"Аудио","hint":{"description":"Загружайте любые аудиофайлы объёмом до 5 Мб и они будут доступны для скачивания и прослушивания всем, с кем вы поделитесь ссылкой на эту страницу."},"keywords":{"video":"аудио"},"subtitle":"Добавьте аудио"},"excalidraw":{"name":"Доска для рисования","hint":{"description":"Нарисуй любую схему или концепт. Полная свобода творчества — всё в твоих руках."},"keywords":{"draw":"рисовать","drawing":"рисовалка"},"subtitle":"Работайте с векторной графикой"}},"callout":{"title":"Уведомления","default":{"name":"По умолчанию","hint":{"description":"Несколько строк текста, выровненных по левому краю, имитирующих текстовый блок.","body":"/callout Ваши Идеи, Документы и Планы. Объединены. Добро пожаловать в {{projectName}} — это связанное рабочее пространство, где работа становится лучше и быстрее. Ваши Идеи и Планы. Объединены. Добро пожаловать в {{projectName}} — это связанное рабочее пространство, где работа становится лучше и быстрее. Ваши Идеи, Документы и Планы. Объединены. Добро пожаловать в {{projectName}} — это связанное рабочее пространство, где работа"},"keywords":{"callout":"оповещение","type":"поумолчанию"},"subtitle":"Уведомление по умолчанию"},"success":{"name":"Успех","subtitle":"Успешное уведомления","keywords":{"callout":"оповещение","type":"успех"}},"warning":{"name":"Предупреждение","hint":{"description":"Несколько строк текста, выровненных по левому краю, имитирующих текстовый блок."},"keywords":{"callout":"оповещение","type":"предупреждение"},"subtitle":"Важное уведомления"},"alert":{"name":"Внимание","hint":{"description":"Несколько строк текста, выровненных по левому краю, имитирующих текстовый блок."},"keywords":{"callout":"оповещение","type":"внимание"},"subtitle":"Критическое уведомление"}},"other":{"title":"Прочее","documents":{"empty":"У вас нет вложенных документов","name":"Вложенные документы","subtitle":"Отображает список вложенных документов"},"emoji":{"name":"Эмодзи","subtitle":"Добавьте эмодзи"}},"integrations":{"title":"Интеграции"}},"toolbar":{"turnInto":"Превратить в","bold":"Жирный","italic":"Курсив","underline":"Подчеркнутый","strike":"Зачеркнутый","superscript":"Надстрочный","subscript":"Подстрочный","align":"Выравнивание","left":"По левому краю","center":"По центру","right":"По правому краю","justify":"Выравнивание по ширине","indent":"Отступ","outdent":"Отступ","color":"Цвет","code":"Код","link":"Добавить ссылку","clear":"Очистить формат","comment":"Комментарий"},"link":{"linkName":"Название ссылки","link":"Ссылка","save":"Сохранить","remove":"Удалить","edit":"Редактировать","copy":"Копировать"},"contextMenu":{"copy":"Копировать","cut":"Вырезать","paste":"Вставить","delete":"Удалить","add":"Добавить","selectAll":"Выбрать все","duplicate":"Дублировать","appearance":"Внешний вид"},"colors":{"lastTimeUsed":"Последнее раз использовался","color":"Цвет","background":"Фон","theme":"Темы","colors":{"standard":"Стандартный","gray":"Серый","brown":"Коричневый","orange":"Оранжевый","yellow":"Желтый","green":"Зеленый","blue":"Синий","purple":"Фиолетовый","pink":"Розовый","red":"Красный"},"callout":{"success":"Успех","alert":"Внимание","warning":"Предупреждение"}},"video":{"insert":"Встроить","apply":"Применить","worksWith":"Работает с","add_video":"Добавить видео"},"swagger":{"insert":"Swagger","worksWith":"Works with","add":"Добавить Swagger"},"image":{"add_photo":"Добавить картинку","preview":"Превью"},"file":{"add_file":"Добавить файл"},"audio":{"add_audio":"Добавить аудио"},"mention":{"mark":"Отменить кого-то"},"validation":{"link":"Неверная ссылка","shouldNotExceed":"Размер файла не должен превышать {{maxSize}} МБ.","doNotUploadMoreThanSingleFile":"Пожалуйста, загружайте не более одного файла.","swaggerUnavailable":"Swagger-документация недоступна. Убедитесь, что адрес указан правильно и сервер отвечает."},"table":{"background_one":"Цвет фона ячейки","background_few":"Цвет фона ячеек","background_other":"Цвет фона ячеек","settings":"Настройки","menu":{"addColAfter":"Добавить столбец справа","addColBefore":"Добавить столбец слева","addRowAbove":"Добавить строку выше","addRowBelow":"Добавить строку ниже","deleteCol":"Удалить столбец","deleteRow":"Удалить строку","mergeCells":"Объединить ячейки","disconnectCells":"Разъединить ячейки","splitCell":"Разделить ячейку","deleteTable":"Удалить таблицу","insertRow_one":"Вставить строку","insertRow_few":"Вставить {{count}} строки","insertRow_many":"Вставить {{count}} строк","deleteRow_one":"Удалить строку","deleteRow_few":"Удалить {{count}} строки","deleteRow_many":"Удалить {{count}} строк","insertCol_one":"Вставить столбец","insertCol_few":"Вставить {{count}} столбца","insertCol_many":"Вставить {{count}} столбец","deleteCol_one":"Удалить столбец","deleteCol_few":"Удалить {{count}} столбца","deleteCol_many":"Удалить {{count}} столбец","headTable_col":"{{value}} заголовок столбца","headTable_row":"{{value}} заголовок строки","below":"ниже","above":"выше","left":"слева","right":"справа","row":"cтроку","rows":"cтроки","column":"cтолбец","columns":"cтолбца"}},"column":{"name":"Вставить сетку","insert":"Вставить","columns":"Колонки","addRight":"Добавить колонку справа","addLeft":"Добавить колонку слева","moveLeft":"Переместить колонку влево","moveRight":"Переместить колонку вправо","deleteColumn":"Удалить колонку","changeColor":"Поменять цвет колонки"},"hoverOptions":{"addNewBlockBelow":"Добавить блок выше","addNewBlockAbove":"Добавить блок ниже","drag":"Перетащите","click":"Нажмите","clickAction":"Чтобы открыть меню","dragAction":"Чтобы переместить"},"embed":{"placeholder":"Введите действительный URL-адрес для встраивания","insert":"Встроить","addEmbed":"Встроить внешний контент"},"content":"Содержание","emoji":{"emojis":"Эмодзи","icons":"Иконки","search":"Поиск","searchResults":"Результат поиска","searchNoResults":"Эмодзи не найдено","remove":"Удалить","emojiCategory":{"frequent":"Часто используемые","people":"Эмоции и люди","nature":"Животные и природа","foods":"Еда и напитки","activity":"Активности","places":"Путешествия и места","objects":"Предметы","symbols":"Символы","flags":"Флаги"}},"form":{"url":"Укажите правильный URL."},"noTitle":"Без названия","gallery":{"download":"Загрузить","close":"Закрыть","errorFile":"Не удалось загрузить файл"},"emptyPageOptions":{"heading":"Заголовок, который автоматически создаст интерактивное оглавление","template":"Создать из шаблона","grid":"Сетка поможет структурировать страницу по горизонтали","list":"Нумерованный список для удобного планирования встречи","code":"Блок кода с поддержкой синтаксиса","callout":"Выделенный блок для акцента","table":"Таблица для поиска зависимостей в данных","integrations":"Множество интеграций от сторонних сервисов"},"comments":{"title":"Комментарии","edited":"изменено","filter":{"resolved":"Решённые","open":"Открытые","all":"Все","selectUsers":"Фильтр по пользователю","searchPlaceholder":"Поиск по пользователю","emptyPlaceholder":"Пользователи отсутствуют","byStatus":"Фильтр по статусу","byPerson":"Фильтр по пользователю"},"generalComment":"Добавьте общий комментарий","addComment":"Добавьте комментарий","replyComment":"Введите ответ","inputEditor":{"uploadFiles":"Добавить файлы","sendMessage":"Отправить сообщение","editMessage":"Редактировать сообщение","clear":"Очистить","clearModal":{"title":"Очистить ввод","description":{"both":"Вы уверены, что хотите удалить текст и файлы?","text":"Вы уверены, что хотите удалить текст?","files":"Вы уверены, что хотите удалить файлы?","empty":"Очистить поле ввода?"}},"discardModal":{"title":"Выйти без сохранения","description":"Если вы выйдете сейчас, все несохранённые изменения будут потеряны.","labels":{"confirm":"Да, выйти","cancel":"Закрыть"}},"cancelCommentModal":{"description":"Если вы выйдете сейчас, черновик комментария будет удалён и он не будет опубликован."}},"notifications":{"title":"Уведомлять меня:","description":"Вы всегда будете получать уведомления при упоминаниях","options":{"all":"Все комментарии","replies":"Ответы"},"uploadMessages":{"tooManyFiles":"Можно загрузить не более 10 файлов!","fileTooLarge":"Файл(ы) больше 5MB не будут загружены!","fileLimit":"Вы достигли лимита, 10 файлов"}},"actionTooltips":{"resolve":"Отметить как решённый","reopen":"Открыть снова","addReaction":"Добавить реакцию","reactionLimit":"Вы достигли лимита реакций","reply":"Ответить"},"menuActions":{"edit":"Редактировать","delete":"Удалить","download":"Скачать"},"deleteModal":{"title":{"thread":"Удалить тред","general":"Удалить обсуждение","comment":"Удалить ответ"},"description":{"thread":"Вы уверены, что хотите удалить этот тред и все ответы к нему?","general":"Вы уверены, что хотите удалить это обсуждение и все связанные ответы?","comment":"Вы уверены, что хотите удалить этот ответ?"},"actions":{"cancel":"Отмена","remove":"Удалить","delete":"Удалить"}},"repliesToggle":{"show_one":"Показать ещё {{count}} комментарий","show_other":"Показать ещё {{count}} комментариев","hide":"Скрыть ответы"},"emptyState":{"not-resolved":"Нет открытых комментариев","resolved":"Нет решённых комментариев","all":"Нет комментариев","userFilter":"По выбранному пользователю комментариев не найдено"}},"actions":{"delete":"Удалить","align":"Выравнивание"},"ai":{"placeholder":"Пользовательский запрос","copied":"скопировано","copy":"копировать","back":"Назад","menu":{"style":{"professional":"Профессиональный","straightforward":"Простой и понятный","friendly":"Дружелюбный","poetic":"Поэтический","passiveAggressive":"Пассивно-агрессивный","pirate":"Пиратский"},"main":{"modifySelection":"Изменить выделение","improveWriting":"Улучшить текст","fixMistakes":"Исправить ошибки","simplify":"Упростить","addMoreDetail":"Добавить подробности","generate":"Сгенерировать","summarise":"Резюме","translate":"Перевести на...","changeStyle":"Изменить стиль на...","explain":"Объяснить"},"answer":{"replaceSelection":"Заменить выделение","addTextInline":"Добавить текст в строку","addBelowParagraph":"Добавить под абзацем","modifyFurther":"Дополнительно изменить","continueWriting":"Продолжить написание","regenerate":"Сгенерировать заново","otherOptions":"Другие варианты","discard":"Удалить"},"languages":{"arabic":"Арабский","bengali":"Бенгальский","chinese":"Китайский","dutch":"Голландский","english":"Английский","french":"Французский","german":"Немецкий","hindi":"Хинди","japanese":"Японский","korean":"Корейский","nepali":"Непальский","portuguese":"Португальский","spanish":"Испанский"}}},"cancel":"Отменить"}`),Dt={editor:Tt},jt={color:"Color",background:"Background",colors:{standard:"Standard",gray:"Gray",brown:"Brown",orange:"Orange",yellow:"Yellow",green:"Green",blue:"Blue",purple:"Purple",pink:"Pink",red:"Red"}},Ft={gallery:"Gallery",upload:"Upload",uploadFile:"Upload file",maxFileSize:"Maximum file size - {{maxSize}}MB",link:"Link",pasteLink:"Paste image link...",pasteVideoLink:"Paste video link...",pasteAudioLink:"Paste audio link...",pasteFileLink:"Paste file link...",submitLink:"Apply",worksWithAnyImage:"Works with any image from the Internet",worksWithAnyFile:"Works with any files from the Internet",worksWithAnyVideo:"Works with MP4 video files, as well as YouTube, VK Video, and RuTube",worksWithAnyAudio:"Works with MP3 audio files",searchImage:"Search image...",noResult:"No images found for your query",change:"Change cover",invalidLink:"Invalid link",loadMore:"Load more",dragOrClickToChoose:"Drop file here or click to select",notSupported:"This file type is not supported"},Ot={gallery:"Gallery",link:"Link",search:"Search",upload:"Upload",uploadFile:"Upload file",change:"Change",remove:"Remove",error:"Error",dragOrClickToChoose:"Drag the file here or click to select",maxFileSize:"Maximum file size is {{maxSize}} MB",pasteLink:"Paste the image link...",submitLink:"Apply",worksWithAnyImage:"Works with any images from the Internet",noImages:"No images",errors:{typeIsNotAllowed:"This file type is not supported",shouldNotExceed:"File size should not exceed {{maxSize}} MB.",doNotUploadMoreThanSingleFile:"Please upload no more than one file.",invalidLink:"Invalid link"}},qt={title:"Comments",edited:"edited",filter:{resolved:"Resolved",open:"Open",all:"All",selectUsers:"Filter by users",searchPlaceholder:"Search users",emptyPlaceholder:"No users found",byStatus:"Filter by status",byPerson:"Filter by person"},generalComment:"Add general comment",addComment:"Add a comment",replyComment:"Enter your reply",inputEditor:{uploadFiles:"Upload files",sendMessage:"Send message",editMessage:"Edit message",clear:"Clear",clearModal:{title:"Clear input",description:{both:"Are you sure you want to delete the text and files?",text:"Are you sure you want to delete the text?",files:"Are you sure you want to delete the files?",empty:"Clear the input field?"}},discardModal:{title:"Exit without saving",description:"If you exit now, all unsaved changes will be lost.",labels:{confirm:"Yes, exit",cancel:"Close"}},cancelCommentModal:{description:"If you leave now, your draft comment will be discarded and it won’t be posted."}},notifications:{title:"Notify me about:",description:"You will always be notified about mentions",options:{all:"All comments",replies:"Replies"},uploadMessages:{tooManyFiles:"You can upload no more than 10 files!",fileTooLarge:"File(s) larger than 5MB will not be uploaded!",fileLimit:"You have reached the limit of 10 files"}},actionTooltips:{resolve:"Resolve",reopen:"Re-open",addReaction:"Add reaction",reactionLimit:"You’ve reached the reaction limit",reply:"Reply"},menuActions:{edit:"Edit",delete:"Delete",download:"Download"},deleteModal:{title:{thread:"Delete Thread",general:"Delete General Discussion",comment:"Delete Reply"},description:{thread:"Are you sure you want to delete this thread and all its replies?",general:"Are you sure you want to delete this general discussion and all its replies?",comment:"Are you sure you want to delete this reply?"},actions:{cancel:"Cancel",remove:"Remove",delete:"Delete"}},repliesToggle:{show_one:"Show {{count}} more comment",show_other:"Show {{count}} more comments",hide:"Hide replies"},emptyState:{"not-resolved":"No open comments",resolved:"No resolved comments",all:"No comments",userFilter:"No comments found for the selected user"}},Ut={save:"Save"},Bt={searchResults:"Search results",icons:"Icons",searchNoResults:"No results found",categories:{activity:"Activities",custom:"Custom",flags:"Flags",foods:"Food and drinks",frequent:"Frequently used",nature:"Animals and nature",objects:"Objects",people:"Emotions and people",places:"Travel and places",symbols:"Symbols"}},zt="Emojis",$t="Remove",Wt="Search",Kt="No category",Ht={colorPicker:jt,changeCover:Ft,dropZone:Ot,comments:qt,customDrawer:Ut,emojiPicker:Bt,emojis:zt,remove:$t,search:Wt,noCat:Kt},Vt={color:"Color",background:"Fondo",colors:{standard:"Estándar",gray:"Gris",brown:"Marrón",orange:"Naranja",yellow:"Amarillo",green:"Verde",blue:"Azul",purple:"Morado",pink:"Rosa",red:"Rojo"}},Yt={gallery:"Galería",upload:"Subir",uploadFile:"Subir archivo",maxFileSize:"Tamaño máximo del archivo - {{maxSize}}MB",link:"Enlace",pasteLink:"Pegar enlace de imagen...",pasteVideoLink:"Pegar enlace de video...",pasteAudioLink:"Pegar enlace de audio...",pasteFileLink:"Pegar enlace de archivo...",submitLink:"Aplicar",worksWithAnyImage:"Funciona con cualquier imagen de Internet",worksWithAnyFile:"Funciona con cualquier archivo de Internet",worksWithAnyVideo:"Funciona con archivos MP4, así como con YouTube, VK Video y RuTube",worksWithAnyAudio:"Funciona con archivos de audio MP3",searchImage:"Buscar imagen...",noResult:"No se encontraron imágenes para tu búsqueda",change:"Cambiar portada",invalidLink:"Enlace inválido",loadMore:"Cargar más",dragOrClickToChoose:"Suelta el archivo aquí o haz clic para seleccionarlo",notSupported:"Este tipo de archivo no es compatible"},Jt={gallery:"Galería",link:"Enlace",search:"Buscar",upload:"Subir",uploadFile:"Subir archivo",change:"Cambiar",remove:"Eliminar",error:"Error",dragOrClickToChoose:"Arrastra el archivo aquí o haz clic para seleccionarlo",maxFileSize:"El tamaño máximo del archivo es {{maxSize}} MB",pasteLink:"Pegar enlace de imagen...",submitLink:"Aplicar",worksWithAnyImage:"Funciona con cualquier imagen de Internet",noImages:"No hay imágenes",errors:{typeIsNotAllowed:"Este tipo de archivo no es compatible",shouldNotExceed:"El archivo no debe exceder de {{maxSize}} MB.",doNotUploadMoreThanSingleFile:"Por favor, sube solo un archivo.",invalidLink:"Enlace inválido"}},Gt={title:"Comentarios",edited:"editado",filter:{resolved:"Resueltos",open:"Abiertos",all:"Todos",selectUsers:"Filtrar por usuarios",searchPlaceholder:"Buscar usuarios",emptyPlaceholder:"No se encontraron usuarios",byStatus:"Filtrar por estado",byPerson:"Filtrar por persona"},generalComment:"Agregar comentario general",addComment:"Agregar comentario",replyComment:"Escribe tu respuesta",inputEditor:{uploadFiles:"Subir archivos",sendMessage:"Enviar mensaje",editMessage:"Editar mensaje",clear:"Limpiar",clearModal:{title:"Limpiar entrada",description:{both:"¿Está seguro de que desea eliminar el texto y los archivos?",text:"¿Está seguro de que desea eliminar el texto?",files:"¿Está seguro de que desea eliminar los archivos?",empty:"¿Limpiar el campo de entrada?"}},discardModal:{title:"Salir sin guardar",description:"Si sales ahora, se perderán todos los cambios no guardados.",labels:{confirm:"Sí, salir",cancel:"Cerrar"}},cancelCommentModal:{description:"Si sales ahora, tu borrador de comentario se eliminará y no se publicará."}},notifications:{title:"Notificarme sobre:",description:"Siempre recibirás notificaciones sobre menciones",options:{all:"Todos los comentarios",replies:"Respuestas"},uploadMessages:{tooManyFiles:"¡Puedes subir como máximo 10 archivos!",fileTooLarge:"¡Los archivos de más de 5 MB no se subirán!",fileLimit:"Has alcanzado el límite de 10 archivos"}},actionTooltips:{resolve:"Resolver",reopen:"Reabrir",addReaction:"Agregar reacción",reactionLimit:"Has alcanzado el límite de reacciones",reply:"Responder"},menuActions:{edit:"Editar",delete:"Eliminar",download:"Descargar"},deleteModal:{title:{thread:"Eliminar hilo",general:"Eliminar discusión general",comment:"Eliminar respuesta"},description:{thread:"¿Estás seguro de que deseas eliminar este hilo y todas sus respuestas?",general:"¿Estás seguro de que deseas eliminar esta discusión general y todas sus respuestas?",comment:"¿Estás seguro de que deseas eliminar esta respuesta?"},actions:{cancel:"Cancelar",remove:"Quitar",delete:"Eliminar"}},repliesToggle:{show_one:"Mostrar {{count}} comentario más",show_other:"Mostrar {{count}} comentarios más",hide:"Ocultar respuestas"},emptyState:{"not-resolved":"No hay comentarios abiertos",resolved:"No hay comentarios resueltos",all:"No hay comentarios",userFilter:"No se encontraron comentarios para el usuario seleccionado"}},Zt={save:"Guardar"},Qt={searchResults:"Resultados de búsqueda",icons:"Iconos",searchNoResults:"No se encontraron resultados",categories:{activity:"Actividades",custom:"Personalizado",flags:"Banderas",foods:"Comida y bebidas",frequent:"Usados frecuentemente",nature:"Animales y naturaleza",objects:"Objetos",people:"Emociones y personas",places:"Viajes y lugares",symbols:"Símbolos"}},Xt="Emojis",eo="Eliminar",to="Buscar",oo="Sin categoría",no={colorPicker:Vt,changeCover:Yt,dropZone:Jt,comments:Gt,customDrawer:Zt,emojiPicker:Qt,emojis:Xt,remove:eo,search:to,noCat:oo},ao={color:"Цвет",background:"Подложка",colors:{standard:"Стандартный",gray:"Серый",brown:"Коричневый",orange:"Оранжевый",yellow:"Желтый",green:"Зеленый",blue:"Синий",purple:"Фиолетовый",pink:"Розовый",red:"Красный"}},io={gallery:"Галерея",upload:"Загрузить",uploadFile:"Загрузить файл",maxFileSize:"Максимальный вес файла - {{maxSize}}МБ",link:"Ссылка",pasteLink:"Вставьте ссылку на изображение...",pasteVideoLink:"Вставьте ссылку на видео...",pasteAudioLink:"Вставьте ссылку на аудио...",pasteFileLink:"Вставьте ссылку на файл...",submitLink:"Применить",worksWithAnyImage:"Работает с любыми изображениями из Интернета",worksWithAnyFile:"Работает с любыми файлами из Интернета",worksWithAnyVideo:"Работает с видеофайлами формата mp4, а также с YouTube, VK Video и RuTube",worksWithAnyAudio:"Работает с аудиофайлами формата mp3",searchImage:"Поиск изображения...",noResult:"По вашему запросу изображений не найдено",change:"Изменить обложку",invalidLink:"Неверная ссылка",dragOrClickToChoose:"Перетащите файл сюда или нажмите, чтобы выбрать",loadMore:"Загрузить ещё",notSupported:"Этот тип файла не поддерживается"},so={gallery:"Галерея",link:"Ссылка",search:"Поиск",upload:"Загрузить",uploadFile:"Загрузить файл",change:"Изменить",remove:"Удалить",error:"Ошибка",dragOrClickToChoose:"Перетащите файл сюда или кликните, чтобы выбрать",maxFileSize:"Максимальный размер файла — {{maxSize}} МБ",pasteLink:"Вставьте ссылку на изображение...",submitLink:"Применить",worksWithAnyImage:"Работает с любым изображением из Интернета",noImages:"Нет изображений",errors:{typeIsNotAllowed:"Этот тип файла не поддерживается",shouldNotExceed:"Размер файла не должен превышать {{maxSize}} МБ.",doNotUploadMoreThanSingleFile:"Пожалуйста, загружайте не более одного файла.",invalidLink:"Недопустимая ссылка"}},ro={title:"Комментарии",edited:"изменено",filter:{resolved:"Решённые",open:"Открытые",all:"Все",selectUsers:"Фильтр по пользователю",searchPlaceholder:"Поиск по пользователю",emptyPlaceholder:"Пользователи отсутствуют",byStatus:"Фильтр по статусу",byPerson:"Фильтр по пользователю"},generalComment:"Добавьте общий комментарий",addComment:"Добавьте комментарий",replyComment:"Введите ответ",inputEditor:{uploadFiles:"Добавить файлы",sendMessage:"Отправить сообщение",editMessage:"Редактировать сообщение",clear:"Очистить",clearModal:{title:"Очистить ввод",description:{both:"Вы уверены, что хотите удалить текст и файлы?",text:"Вы уверены, что хотите удалить текст?",files:"Вы уверены, что хотите удалить файлы?",empty:"Очистить поле ввода?"}},discardModal:{title:"Выйти без сохранения",description:"Если вы выйдете сейчас, все несохранённые изменения будут потеряны.",labels:{confirm:"Да, выйти",cancel:"Закрыть"}},cancelCommentModal:{description:"Если вы выйдете сейчас, черновик комментария будет удалён и он не будет опубликован."}},notifications:{title:"Уведомлять меня:",description:"Вы всегда будете получать уведомления при упоминаниях",options:{all:"Все комментарии",replies:"Ответы"},uploadMessages:{tooManyFiles:"Можно загрузить не более 10 файлов!",fileTooLarge:"Файл(ы) больше 5MB не будут загружены!",fileLimit:"Вы достигли лимита, 10 файлов"}},actionTooltips:{resolve:"Отметить как решённый",reopen:"Открыть снова",addReaction:"Добавить реакцию",reactionLimit:"Вы достигли лимита реакций",reply:"Ответить"},menuActions:{edit:"Редактировать",delete:"Удалить",download:"Скачать"},deleteModal:{title:{thread:"Удалить тред",general:"Удалить обсуждение",comment:"Удалить ответ"},description:{thread:"Вы уверены, что хотите удалить этот тред и все ответы к нему?",general:"Вы уверены, что хотите удалить это обсуждение и все связанные ответы?",comment:"Вы уверены, что хотите удалить этот ответ?"},actions:{cancel:"Отмена",remove:"Удалить",delete:"Удалить"}},repliesToggle:{show_one:"Показать ещё {{count}} комментарий",show_other:"Показать ещё {{count}} комментариев",hide:"Скрыть ответы"},emptyState:{"not-resolved":"Нет открытых комментариев",resolved:"Нет решённых комментариев",all:"Нет комментариев",userFilter:"По выбранному пользователю комментариев не найдено"}},lo={save:"Сохранить"},co={searchResults:"Результаты поиска",searchNoResults:"Результаты не найдены",icons:"Иконки",categories:{activity:"Активности",custom:"Свои",flags:"Флаги",foods:"Еда и напитки",frequent:"Часто используемые",nature:"Животные и природа",objects:"Предметы",people:"Эмоции и люди",places:"Путешествия и места",symbols:"Символы"}},uo="Эмодзи",mo="Удалить",ho="Поиск",po="Нет категории",go={colorPicker:ao,changeCover:io,dropZone:so,comments:ro,customDrawer:lo,emojiPicker:co,emojis:uo,remove:mo,search:ho,noCat:po},Pe=yt.createInstance();Pe.use(De.initReactI18next).init({resources:{en:{translation:Pt,ui:Ht},ru:{translation:Dt,ui:go},es:{translation:Lt,ui:no}},lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}}).then(()=>{}).catch(t=>{});const Re={blockCursor:"dsd__theme__blockCursor",characterLimit:"dsd__theme__characterLimit",code:"dsd__theme__code",codeCollapsed:"dsd__theme__code_сollapsed",codeHighlight:{atrule:"dsd__theme__tokenAttr",attr:"dsd__theme__tokenAttr",boolean:"dsd__theme__tokenProperty",builtin:"dsd__theme__tokenSelector",cdata:"dsd__theme__tokenComment",char:"dsd__theme__tokenSelector",class:"dsd__theme__tokenFunction","class-name":"dsd__theme__tokenFunction",comment:"dsd__theme__tokenComment",constant:"dsd__theme__tokenProperty",deleted:"dsd__theme__tokenProperty",doctype:"dsd__theme__tokenComment",entity:"dsd__theme__tokenOperator",function:"dsd__theme__tokenFunction",important:"dsd__theme__tokenVariable",inserted:"dsd__theme__tokenSelector",keyword:"dsd__theme__tokenAttr",namespace:"dsd__theme__tokenVariable",number:"dsd__theme__tokenProperty",operator:"dsd__theme__tokenOperator",prolog:"dsd__theme__tokenComment",property:"dsd__theme__tokenProperty",punctuation:"dsd__theme__tokenPunctuation",regex:"dsd__theme__tokenVariable",selector:"dsd__theme__tokenSelector",string:"dsd__theme__tokenSelector",symbol:"dsd__theme__tokenProperty",tag:"dsd__theme__tokenProperty",url:"dsd__theme__tokenOperator",variable:"dsd__theme__tokenVariable"},embedBlock:{base:"dsd__theme__embedBlock",focus:"dsd__theme__embedBlockFocus"},hashtag:"dsd__theme__hashtag",heading:{h1:"dsd__theme__h1",h2:"dsd__theme__h2",h3:"dsd__theme__h3",h4:"dsd__theme__h4",h5:"dsd__theme__h5",h6:"dsd__theme__h6"},excalidraw:"editor-excalidraw",image:"editor-image",indent:"dsd__theme__indent",inlineImage:"inline-editor-image",layoutContainer:"dsd__theme__layoutContainer",layoutItem:"dsd__theme__layoutItem",layoutDivider:"dsd__theme__layoutDivider",calloutIcon:"dsd__theme__callout-icon",callout:"dsd__theme__callout-container",calloutWrapper:"dsd__theme__callout-wrapper",calloutContainer:"dsd__theme__callout-main-container",link:"dsd__theme__link",list:{checklist:"dsd__theme__checklist",listitem:"dsd__theme__listItem",listitemChecked:"dsd__theme__listItemChecked",listitemUnchecked:"dsd__theme__listItemUnchecked",nested:{listitem:"dsd__theme__nestedListItem"},olDepth:["dsd__theme__ol1","dsd__theme__ol2","dsd__theme__ol3","dsd__theme__ol4","dsd__theme__ol5"],ul:"dsd__theme__ul"},listitemIndeterminate:"dsd__theme__listIndeterminate",mark:"dsd__theme__mark",markOverlap:"dsd__theme__markOverlap",paragraph:"dsd__theme__paragraph",quote:"dsd__theme__quote",rtl:"dsd__theme__rtl",table:"dsd__theme__table",tableAddColumns:"dsd__theme__tableAddColumns",tableAddRows:"dsd__theme__tableAddRows",tableCell:"dsd__theme__tableCell",tableCellActionButton:"dsd__theme__tableCellActionButton",tableCellActionButtonContainer:"dsd__theme__tableCellActionButtonContainer",tableCellEditing:"dsd__theme__tableCellEditing",tableCellHeader:"dsd__theme__tableCellHeader",tableCellPrimarySelected:"dsd__theme__tableCellPrimarySelected",tableCellResizer:"dsd__theme__tableCellResizer",tableCellSelected:"dsd__theme__tableCellSelected",tableCellSortedIndicator:"dsd__theme__tableCellSortedIndicator",tableResizeRuler:"dsd__theme__tableCellResizeRuler",tableSelected:"dsd__theme__tableSelected",tableSelection:"dsd__theme__tableSelection",tableScrollableWrapper:"dsd__theme__table-scrollable-wrapper",text:{bold:"dsd__theme__textBold",code:"dsd__theme__textCode",italic:"dsd__theme__textItalic",strikethrough:"dsd__theme__textStrikethrough",subscript:"dsd__theme__textSubscript",superscript:"dsd__theme__textSuperscript",underline:"dsd__theme__textUnderline",underlineStrikethrough:"dsd__theme__textUnderlineStrikethrough"}},fo=t=>{const e={...Re,text:{...Re.text}};return t==="comment"&&e.text&&(delete e.text.strikethrough,delete e.text.underlineStrikethrough),e},ie=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",bo=ie&&"documentMode"in document?document.documentMode:null;var Xe;const yo=(Xe=navigator.userAgentData)==null?void 0:Xe.platform,ot=ie&&/macOS|iPod|iPhone|iPad/.test(yo);ie&&"InputEvent"in window&&!bo&&"getTargetRanges"in new window.InputEvent("input");const _o=ie&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),nt=u.createContext([t=>()=>{},t=>{}]),Co=({children:t})=>{const e=u.useMemo(()=>{let o=null;const a=new Set;return[i=>(i(o),a.add(i),()=>{a.delete(i)}),i=>{o=i;for(const s of a)s(i)}]},[]);return r.jsx(nt.Provider,{value:e,children:t})},wo=()=>{const[t,e]=u.useContext(nt),[o,a]=u.useState(null);return u.useEffect(()=>t(i=>{a(i)}),[t]),[o,e]};function we(t){if(t&&t.includes("unsplash"))return null;const e=/[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i,o=t==null?void 0:t.match(e);return o&&(t.startsWith("/v1/attachments/")||t.includes(window.location.origin))?o[0]:null}function We(t,e,o){t.update(()=>{const a=p.$getNodeByKey(e);j.$isImageNode(a)||j.$isMusicNode(a)?a.setSrc(o):j.$isVideoNode(a)&&o.trim()&&a.setId(o)},{tag:"historic"})}const Y=new Map;function ko({editor:t}){const{fetchDeleteMedia:e,fetchRestoreMedia:o,commentOptions:a}=u.useContext(se),{pageId:i}=a||{pageId:null};return u.useEffect(()=>()=>{Y.clear()},[i]),u.useEffect(()=>{if(t)return t.getEditorState().read(()=>{var g;const s=((g=t.getDecorators)==null?void 0:g.call(t))||t._decorators,n=new Map;for(const[h,k]of Object.entries(s)){const y=k.props,_=k._self,M=j.$isImageNode(_)||j.$isVideoNode(_)||j.$isFileNode(_)||j.$isMusicNode(_);if(!y&&M)continue;const S=(y==null?void 0:y.src)||(y==null?void 0:y.videoID);if(S!=null&&S.trim()&&!(S!=null&&S.includes("unsplash"))&&we(S)){const L=n.get(S)||[],P=L.includes(h)?L:[...L,h];n.set(S,P)}}for(const[h,k]of n.entries())Y.set(h,{mediaNodeKeys:k})}),t.registerDecoratorListener(s=>{var h;const n=new Map;let g=!1;for(const[k,y]of Object.entries(s)){const _=y==null?void 0:y.props,C=y==null?void 0:y._self,M=j.$isVideoNode(C)||j.$isImageNode(C)||j.$isFileNode(C)||j.$isMusicNode(C);if(M&&((h=_==null?void 0:_.src)!=null&&h.includes("unsplash"))||!_&&M)continue;const S=_.src||_.videoID;if(!S)continue;if(S.trim()==="")return;const L=n.get(S)||[];!L.includes(k)&&we(_==null?void 0:_.src)&&n.set(S,[...L,k])}for(const[k,y]of Y.entries()){const _=n.get(k);if(Array.isArray(y.mediaNodeKeys)&&y.mediaNodeKeys.length>0&&(!_||_.length===0)){const C=we(k);if(C&&e){const M=t.registerCommand(p.UNDO_COMMAND,()=>!0,p.COMMAND_PRIORITY_NORMAL);e(C,()=>{M()}),Y.set(k,{mediaNodeKeys:[]})}}}for(const[k]of Y.entries())n.has(k)||Y.set(k,{mediaNodeKeys:[]});if(Y.size>0)for(const[k,y]of n.entries()){const _=Y.get(k);if(_&&Array.isArray(_.mediaNodeKeys)&&_.mediaNodeKeys.length===0&&y.length>0){We(t,y[0]," "),g=!0;const C=we(k);if(Y.set(k,{mediaNodeKeys:y}),C&&o){const M=t.registerCommand(p.REDO_COMMAND,()=>!0,p.COMMAND_PRIORITY_NORMAL);o(C,()=>{M(),We(t,y[0],k)})}}}if(!g)for(const[k,y]of n.entries())Y.set(k,{mediaNodeKeys:y})})},[t,o,e]),Y}const Ke=window.location.hostname,vo=Ke!=="playground.lexical.dev"&&Ke!=="lexical-playground.vercel.app",So=new URLSearchParams(window.location.search),He=t=>So.get(t)==="true",{isShowTreeView:xo,isMaxLength:Ao}={isShowTreeView:He("showTreeView"),isMaxLength:He("isMaxLength")},be={disableBeforeInput:!1,emptyEditor:vo,isAutocomplete:!1,isCharLimit:!1,isCharLimitUtf8:!1,isCollab:!1,isMaxLength:Ao,isRichText:!0,measureTypingPerf:!1,shouldUseLexicalContextMenu:!1,showNestedEditorTreeView:!1,showTableOfContents:!1,showTreeView:xo,tableCellBackgroundColor:!0,tableCellMerge:!0},Mo={...be},at=u.createContext({setOption:(t,e)=>{},settings:be});function Io(){const t={},e=new URLSearchParams(window.location.search);for(const o of Object.keys(be)){const a=e.get(o);a!==null&&(t[o]=a==="true")}return t}const Eo=({children:t})=>{const[e,o]=u.useState(()=>({...be,...Io()})),a=u.useCallback((s,n)=>{o(g=>({...g,[s]:n})),be[s]===n?Ve(s,null):Ve(s,n)},[]),i=u.useMemo(()=>({setOption:a,settings:e}),[a,e]);return r.jsx(at.Provider,{value:i,children:t})},it=()=>u.useContext(at);function Ve(t,e){const o=new URL(window.location.href),a=new URLSearchParams(o.search);e!==null?a.has(t)?a.set(t,String(e)):a.append(t,String(e)):a.has(t)&&a.delete(t),o.search=a.toString(),window.history.pushState(null,"",o.toString())}const st=u.createContext({}),No=({children:t})=>{const e=u.useMemo(()=>({historyState:je.createEmptyHistoryState()}),[]);return r.jsx(st.Provider,{value:e,children:t})},Fe=()=>u.useContext(st),rt=u.createContext(void 0),Ne={},Po=1e3,Ro=({children:t})=>{const[e,o]=u.useState(Ne),a=u.useCallback((i,s)=>o(i?{duration:s,message:i}:Ne),[]);return u.useEffect(()=>{if(e.message){const i=setTimeout(()=>o(Ne),e.duration??Po);return()=>clearTimeout(i)}},[e]),r.jsxs(rt.Provider,{value:a,children:[t,e.message&&r.jsx(ke.FlashMessage,{children:e.message})]})},Lo=()=>{const t=u.useContext(rt);if(console.log("ctx",t),!t)throw new Error("Missing FlashMessageContext");return t};function Ye(t,e,o,a,i,s){return{authorId:e,text:t,edited:!1,reactions:[],deleted:s===void 0?!1:s,id:o,files:a??[],clientKey:crypto.randomUUID(),timeStamp:i===void 0?performance.timeOrigin+performance.now():i,type:"comment"}}function To(t,e,o,a,i){return{id:o.id,quote:t,deleted:o.deleted??!1,type:"thread",resolution:o.resolution??null,clientKey:crypto.randomUUID(),edited:!1,text:a,reactions:[],files:[],authorId:e,timeStamp:new Date(o.updatedAt).getTime(),children:[]}}const Do=async(t,e,o)=>e.length?(await Promise.all(e.map(i=>new Promise((s,n)=>{o({file:i.file,commentId:t,onSuccess:g=>{s(g)},onError:g=>{console.error(g),n(null)}})})))).filter(i=>i!==null):[];function Je(t,e,o){const a=new Set(e.map(s=>s.id));return[...t.filter(s=>!("id"in s)||!a.has(s.id)),...o]}const Ge=t=>{if(!t)return;const e=document.querySelector(`li[data-id="${t}"]`);e&&e.scrollIntoView({behavior:"smooth",block:"center"})},Le=t=>{const e=t.type.startsWith("image/");return{id:t.id,file:t,isImage:e,src:e?URL.createObjectURL(t):""}};function Ze(t){return t.type==="thread"?{children:Array.from(t.children),id:t.id,clientKey:t.clientKey,deleted:t.deleted,quote:t.quote,type:"thread",timeStamp:t.timeStamp,reactions:t.reactions,edited:t.edited,authorId:t.authorId,text:t.text,resolution:t.resolution,files:t.files}:{children:Array.from(t.children),id:t.id,clientKey:t.clientKey,deleted:t.deleted,edited:t.edited,reactions:t.reactions,type:"general",quote:t.quote,files:t.files,timeStamp:t.timeStamp,authorId:t.authorId,text:t.text,resolution:t.resolution}}async function jo(t,e,o,a,i,s){const n=t.filter(h=>!h.deleted).map(async h=>{const k=e.get(h.id);let y="";if(k)for(const P of k){const U=o.getElementByKey(P);U!=null&&U.textContent&&(y&&(y+=`
2
+ `),y+=U.textContent)}const C=(await s({commentId:h.id})).map(P=>Le(P)),{content:M}=await i({commentId:h.id}),S=await Promise.all(h.children.filter(P=>!P.deleted).map(async P=>{const{content:U}=await i({commentId:P.id}),d=(await s({commentId:P.id})).map($=>Le($));return{...Fo(P),files:d,reactions:U}})),L={id:h.id,authorId:h.authorId,resolution:h.resolution,timeStamp:new Date(h.updatedAt).getTime(),text:h.text,children:S,clientKey:crypto.randomUUID(),reactions:M,files:C};return h.commentType==="REVIEW"?{...L,type:"general",quote:a}:y?{...L,type:"thread",quote:y}:null});return(await Promise.all(n)).filter(Boolean)}function Fo(t){return{authorId:t.authorId,text:t.text,reactions:[],files:[],edited:t.edited,id:t.id,clientKey:crypto.randomUUID(),timeStamp:new Date(t.updatedAt).getTime(),type:"comment",deleted:t.deleted}}function z(t){const e=t._changeListeners;for(const o of e)o()}class Oo{constructor(e){pe(this,"_editor");pe(this,"_comments");pe(this,"_changeListeners");pe(this,"_collabProvider");this._comments=[],this._editor=e,this._collabProvider=null,this._changeListeners=new Set}isCollaborative(){return this._collabProvider!==null}getComments(){return this._comments}addComment(e,o,a){const i=Array.from(this._comments),s=this._getCollabComments();if(o!==void 0&&e.type==="comment")for(let n=0;n<i.length;n++){const g=i[n];if((g.type==="thread"||g.type==="general")&&g.id===o.id){const h=Ze(g);i.splice(n,1,h);const k=a!==void 0?a:h.children.length;if(this.isCollaborative()&&s!==null){const y=s.get(n).get("comments");this._withRemoteTransaction(()=>{const _=this._createCollabSharedMap(e);y.insert(k,[_])})}h.children.splice(k,0,e);break}}else{const n=a!==void 0?a:i.length;this.isCollaborative()&&s!==null&&this._withRemoteTransaction(()=>{const g=this._createCollabSharedMap(e);s.insert(n,[g])}),i.splice(n,0,e)}this._comments=i,z(this)}updateThreadId(e,o,a,i,s,n,g){const h=Array.from(this._comments),k=new Date(i).getTime();if(g)for(let y=0;y<h.length;y++){const _=h[y];if(_.id===g.id&&Array.isArray(_.children)){const C={..._,children:[..._.children]},M=C.children.findIndex(S=>S.id===o||S.tempId===o);if(M!==-1){const S={...C.children[M]};S.id=a,S.timeStamp=k,S.files=n,S.tempId=a,C.children.splice(M,1,S),h.splice(y,1,C)}break}}else{for(let y=0;y<h.length;y++){const _=h[y];if(_.id===o||_.tempId===o){const C={..._};C.id=a,C.timeStamp=k,C.files=n,C.tempId=a,h.splice(y,1,C);break}}s==="thread"&&e.update(()=>{var _;const y=p.$nodesOfType(j.ExtendMarkNode).filter(C=>C.__extendIds.includes(o));for(const C of y)(_=e.getElementByKey(C.__key))==null||_.setAttribute("data-key",a),C.updateExtendId(o,a)})}this._comments=h,z(this)}deleteCommentOrThread(e,o){const a=Array.from(this._comments);let i=null;if(o!==void 0)for(let s=0;s<a.length;s++){const n=a[s];if((n.type==="thread"||n.type==="general")&&n.id===o.id){const g=Ze(n);a.splice(s,1,g);const h=g.children;i=h.indexOf(e),i!==-1&&(h[i].deleted=!0);break}}else i=a.indexOf(e),i!==-1&&(a[i].deleted=!0);return this._comments=a,z(this),null}registerOnChange(e){const o=this._changeListeners;return o.add(e),()=>{o.delete(e)}}updateCurrentContent(e,o,a,i){this._comments=this._comments.map(s=>{const{deletedFile:n,newFiles:g}=o;if(i&&s.id===i&&s.type!=="comment")return{...s,children:s.children.map(h=>{if(h.id!==a)return h;const k=Je(h.files,n,g);return{...h,text:e,edited:!0,files:k}})};if(s.id===a){const h=Je(s.files,n,g);return{...s,text:e,edited:!0,files:h}}return s}),z(this)}updateCurrentQuote(e,o){this._comments=this._comments.map(a=>a.id===o?{...a,quote:e}:a),z(this)}replaceOptimisticPhotos(e,o,a){this._comments=this._comments.map(i=>{const s=i.type!=="comment";if(a&&s&&i.id===a)return{...i,children:i.children.map(n=>{if(n.id!==o)return n;const g=n.files.filter(h=>{var k;return!((k=h.id)!=null&&k.startsWith("temp-"))});return{...n,files:[...g,...e]}})};if(i.id===o){const n=i.files.filter(g=>{var h;return!((h=g.id)!=null&&h.startsWith("temp-"))});return{...i,files:[...n,...e]}}return i}),z(this)}restoreLastDeletedComment(e,o){o?this._comments=this._comments.map(a=>{if(a.id===o){const i=a;if(Array.isArray(i.children))return{...i,children:i.children.map(s=>s.id===e?{...s,deleted:!1}:s)}}return a}):this._comments=this._comments.map(a=>a.id===e?{...a,deleted:!1}:a),z(this)}async initializeComments(e,o,a,i,s,n,g){const h=await jo(e,o,a,i,s,n);this._comments=h.flat(),g(!1),z(this)}_withRemoteTransaction(e){const o=this._collabProvider;o!==null&&o.doc.transact(e,this)}_withLocalTransaction(e){const o=this._collabProvider;try{this._collabProvider=null,e()}finally{this._collabProvider=o}}_getCollabComments(){const e=this._collabProvider;return e!==null?e.doc.get("comments",ae.Array):null}_createCollabSharedMap(e){const o=new ae.Map,a=e.type,i=e.id;if(o.set("type",a),o.set("id",i),a==="comment")o.set("author",e.authorId),o.set("content",e.text),o.set("deleted",e.deleted),o.set("timeStamp",e.timeStamp);else{e.type==="thread"&&o.set("quote",e.quote);const s=new ae.Array;e.children.forEach((n,g)=>{const h=this._createCollabSharedMap(n);s.insert(g,[h])}),o.set("comments",s)}return o}resolveThreat(e,o){this._comments=this._comments.map(a=>a.id===e.id?{...a,resolution:o}:a),z(this)}addReaction(e,o,a){a?this._comments=this._comments.map(i=>i.id===a.id&&"children"in i?{...i,children:i.children.map(s=>s.id===o.id?{...s,reactions:[...s.reactions||[],e]}:s)}:i):this._comments=this._comments.map(i=>i.id===o.id?{...i,reactions:[...i.reactions||[],e]}:i),z(this)}replaceReaction(e,o,a,i){this._comments=this._comments.map(s=>{if(i){if(s.id===i.id&&"children"in s)return{...s,children:s.children.map(n=>{if(n.id!==a.id)return n;const g=(n.reactions||[]).filter(h=>h.id!==e);return{...n,reactions:[...g,o]}})}}else if(s.id===a.id){const n=(s.reactions||[]).filter(g=>g.id!==e);return{...s,reactions:[...n,o]}}return s}),z(this)}removeImageOrPhoto(e,o,a,i){this._comments=this._comments.map(s=>s.id===a?i&&"children"in s?{...s,children:s.children.map(n=>n.id===i?{...n,[e]:n[e].filter(({id:g})=>g!==o)}:n)}:{...s,[e]:s[e].filter(({id:n})=>n!==o)}:s),z(this)}registerCollaboration(e){this._collabProvider=e;const o=this._getCollabComments(),a=()=>{e.connect()},i=()=>{try{e.disconnect()}catch{}},s=this._editor.registerCommand(Mt.TOGGLE_CONNECT_COMMAND,g=>(a!==void 0&&i!==void 0&&(g?(console.log("Comments connected!"),a()):(console.log("Comments disconnected!"),i())),!1),p.COMMAND_PRIORITY_LOW),n=(g,h)=>{if(h.origin!==this)for(let k=0;k<g.length;k++){const y=g[k];if(y instanceof ae.YArrayEvent){const _=y.target,C=y.delta;let M=0;for(let S=0;S<C.length;S++){const L=C[S],P=L.insert,U=L.retain,T=L.delete,d=_.parent,$=_===o?void 0:d instanceof ae.Map&&this._comments.find(O=>O.id===d.get("id"));if(Array.isArray(P))P.slice().reverse().forEach(O=>{const H=O.get("id"),x=O.get("type")==="thread"?To(O.get("quote"),O.get("author"),O.get("comments").toArray().map(m=>Ye(m.get("content"),m.get("author"),m.get("id"),[],m.get("timeStamp"),m.get("deleted"))),H):Ye(O.get("content"),O.get("author"),H,[],O.get("timeStamp"),O.get("deleted"));this._withLocalTransaction(()=>{this.addComment(x,$,M)})});else if(typeof U=="number")M+=U;else if(typeof T=="number")for(let O=0;O<T;O++){const H=$===void 0||$===!1?this._comments[M]:$.children[M];this._withLocalTransaction(()=>{this.deleteCommentOrThread(H,$)}),M++}}}}};return o===null?()=>null:(o.observeDeep(n),a(),()=>{o.unobserveDeep(n),s(),this._collabProvider=null})}}function qo(t){const[e,o]=u.useState(t.getComments());return u.useEffect(()=>t.registerOnChange(()=>{o(t.getComments())}),[t]),e}const lt=p.createCommand("INSERT_INLINE_COMMAND");function Uo(t,e){for(const[o,a]of t.entries())if(a.has(e))return o;return null}function Bo(){const[t]=tt.useLexicalComposerContext(),e=u.useMemo(()=>new Oo(t),[t]),o=u.useRef(null),[a,i]=u.useState([]),[s,n]=u.useState({value:"",files:[]}),[g,h]=u.useState(!1),[k,y]=u.useState(!1),_=u.useRef([]),C=u.useRef([]),{i18n:M}=De.useTranslation(),S=M.language,L=M.getResourceBundle(S,"translation"),[P,U]=u.useState({resolved:"not-resolved",feedback:!1,filteredUsers:[]}),{currentUser:T,commentOptions:d,workspaceMembers:$}=u.useContext(se)??{},O=(d==null?void 0:d.pageId)??"",H=(d==null?void 0:d.workspaceInfo)??{title:"",icon:""},W=(d==null?void 0:d.showComments)??!1,x=(d==null?void 0:d.setShowComments)??(()=>{}),m=(d==null?void 0:d.commentActions)??{},D=qo(e),N=u.useMemo(()=>new Map,[]);u.useEffect(()=>(typeof(m==null?void 0:m.fetchCommentsApi)=="function"&&(y(!0),setTimeout(()=>{m.fetchCommentsApi({pageId:O,onSuccess:async l=>{await e.initializeComments(l,N,t,JSON.stringify(H),m==null?void 0:m.getReactionsApi,m==null?void 0:m.getPhotosApi,y)}})},100)),()=>{x(!1)}),[]),u.useEffect(()=>{const l=setTimeout(()=>{D.forEach(c=>{c.type==="general"&&e.updateCurrentQuote(JSON.stringify(d==null?void 0:d.workspaceInfo),c.id)})},300);return()=>clearTimeout(l)},[d==null?void 0:d.workspaceInfo]);const V=u.useCallback(()=>{t.update(()=>{const l=p.$getSelection();l!==null&&(l.dirty=!0)}),h(!1),n({value:"",files:[]})},[t]),X=u.useCallback(async l=>{const c=l.resolution!=="ACCEPTED"?"ACCEPTED":"REJECTED",f=JSON.parse(JSON.stringify(e._comments));t.update(()=>{p.$nodesOfType(j.ExtendMarkNode).filter(w=>w.__extendIds[0]===l.id).forEach(w=>{"resolveThreat"in w&&w.resolveThreat(c)})}),e.resolveThreat(l,c),await(m==null?void 0:m.resolveCommentApi({threatId:l.id,resolveValue:c,onSuccess:()=>{},onError:()=>{e._comments=f,z(e)}}))},[e,t,N]),G=u.useCallback(async(l,c,f)=>{const b=JSON.parse(JSON.stringify(e._comments)),w="temp-"+Date.now()+"-"+Math.random().toString(36).substring(2,9),A=encodeURIComponent(l),R={id:w,commentId:c.id,userId:(T==null?void 0:T.id)??"",reaction:l,createdAt:new Date().toISOString(),deletedAt:"1970-01-01T00:00:00.000+00:00",version:0,parentType:"COMMENT",parentId:c.id,deleted:!1};e.addReaction(R,c,f);try{await(m==null?void 0:m.commentReactionApi({commentId:c.id,author:(T==null?void 0:T.id)??"",emojiValue:A,onSuccess:async I=>{e.replaceReaction(R.id,I,c,f)},onError:()=>{e._comments=b,z(e)}}))}catch(I){console.error("Unexpected error:",I)}},[e,T,m]),re=u.useCallback(async(l,c,f)=>{const b=JSON.parse(JSON.stringify(e._comments));e.removeImageOrPhoto("reactions",l,c.id,f==null?void 0:f.id);try{await(m==null?void 0:m.deleteReactionApi({reactionId:l,onSuccess:async()=>{},onError:()=>{e._comments=b,z(e)}}))}catch(w){console.log(w)}},[e,t,N]),le=At.debounce((l,c)=>{e.updateCurrentQuote(l,c)},500),ee=u.useCallback(async(l,c)=>{const f=l.id;try{await(m==null?void 0:m.deleteCommentApi({deleteCommentId:f,onSuccess:async()=>{if(l.type==="comment"&&c){const b=e.deleteCommentOrThread(l,c);if(C.current=[{comments:l,id:c.id},...C.current],!b)return;const{markedComment:w,index:A}=b;e.addComment(w,c,A)}else{e.deleteCommentOrThread(l);const b=c!==void 0?c.id:l.id,w=N.get(b);w!==void 0&&setTimeout(()=>{t.update(()=>{for(const A of w){const R=p.$getNodeByKey(A);j.$isExtendMarkNode(R)&&(R.deleteID(b),R.getIDs().length===0&&Ee.$unwrapMarkNode(R))}})})}}}))}catch(b){console.log(b)}},[e,t,N]);function F(l,c,f,b,w,A){e.updateThreadId(t,l,c,f,b,w,A)}const ye=u.useCallback((l,c,f,b)=>{e.addComment(l,f,void 0),c&&(t.update(()=>{if(p.$isRangeSelection(b)){const w=b.isBackward(),A=l.id;Ee.$wrapSelectionInMarkNode(b,w,A,R=>{const I=new j.ExtendMarkNode(R,null);return W||l.type==="thread"&&setTimeout(()=>{t.update(()=>{I.selectStart()})},300),I})}}),h(!1)),P.resolved==="resolved"&&U({...P,resolved:"not-resolved"})},[e,t,P.resolved]);u.useEffect(()=>{const l=[];if(a.length!==0){for(let c=0;c<a.length;c++){const f=a[0],b=N.get(f);if(b!==void 0)for(const w of b){const A=t.getElementByKey(w);if(A!==null){A.classList.add("selected"),l.push(A);const R=A.getAttribute("data-key");if(R){if(W){const I=_.current,q=I.length!==a.length||I.some((K,J)=>K!==a[J]);a.length===1&&q&&Ge(R)}else setTimeout(()=>{Ge(R)},500);x(!0)}}}}return _.current=[...a],()=>{for(let c=0;c<l.length;c++)l[c].classList.remove("selected")}}},[a,t,N]);const Se=async(l,c,f,b)=>{const w=f,A=JSON.parse(JSON.stringify(e._comments));e.updateCurrentContent(l.value,c,f,b),c.deletedFile.map(q=>q.id?de(q.id,f,b):Promise.resolve());const I=(await Do(w,c.newFiles,m==null?void 0:m.uploadCommentFileApi)).map(q=>Le(q));if(e.replaceOptimisticPhotos(I,f,b),l.restore)try{await(m==null?void 0:m.updateCommentTextApi({commentId:w,textValue:l.value,onSuccess:()=>{},onError:()=>{e._comments=A,z(e)}}))}catch(q){console.error(q)}},de=async(l,c,f)=>{try{await(m==null?void 0:m.deleteCommentImageApi({photoToRemove:l,onSuccess:()=>e.removeImageOrPhoto("files",l,c,f)}))}catch(b){console.log(b)}},ce=async(l,c)=>{try{await(m==null?void 0:m.restoreCommentApi({commentId:l,onSuccess:()=>{e.restoreLastDeletedComment(l,c)}}))}catch(f){console.log(f)}};u.useEffect(()=>{if(!W)return;const l=c=>{c.key==="Escape"&&x(!1)};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[W]),u.useEffect(()=>{const l=new Map;return ve.mergeRegister(ve.registerNestedElementResolver(t,j.ExtendMarkNode,c=>j.$createExtendMarkNode(c.getIDs()),(c,f)=>{c.getIDs().forEach(w=>{f.addID(w)})}),t.registerMutationListener(j.ExtendMarkNode,c=>{t.getEditorState().read(()=>{for(const[f,b]of c){const w=p.$getNodeByKey(f);let A=[];const R=Uo(N,f);b==="destroyed"?A=l.get(f)||[]:j.$isExtendMarkNode(w)&&(A=w.getIDs()),b==="created"&&R&&setTimeout(()=>{const I=e.getComments().find(q=>q.id===(w==null?void 0:w.__extendIds[0]));I&&I.deleted&&ce(I.id)},500);for(let I=0;I<A.length;I++){const q=A[I];let K=N.get(q);if(l.set(f,A),b==="destroyed"){let J=!1;for(const[Z,te]of c)if(te==="created"){const oe=p.$getNodeByKey(Z);j.$isExtendMarkNode(oe)&&oe.getIDs().some(Me=>A.includes(Me))&&(J=!0)}if(!J){K!==void 0&&(K.delete(f),K.size===0&&N.delete(q));const Z=e.getComments().find(te=>te.tempId===R||te.id===R);Z&&!Z.deleted&&ee(Z)}}else K===void 0&&(K=new Set,N.set(q,K)),K.has(f)||K.add(f)}}})},{skipInitialization:!1}),t.registerUpdateListener(({editorState:c})=>{c.read(()=>{const f=p.$getSelection();let b=!1;if(p.$isRangeSelection(f)){const w=f.anchor.getNode();if(j.$isExtendedTextNode(w)){const A=Ee.$getMarkIDs(w,f.anchor.offset);if(A!==null){i(I=>I[0]===A[0]?I:A),b=!0;const R=N.get(A[0]);t.update(()=>{if(!R)return;let I="",q=null;for(const K of R){const J=p.$getNodeByKey(K);J instanceof j.ExtendMarkNode&&(I&&(I+=`
3
+ `),I+=J.getTextContent(),q||(q=J.__extendIds[0]))}I&&q&&le(I,q)})}}}b||i(w=>w.length===0?w:[])})}),t.registerCommand(lt,()=>{const c=window.getSelection();return c!==null&&c.removeAllRanges(),h(!0),!0},p.COMMAND_PRIORITY_EDITOR),t.registerCommand(p.COPY_COMMAND,c=>{if(!(c!=null&&c.clipboardData))return!1;c.preventDefault();const f=p.$getSelection();if(!f||!f.getNodes().some(R=>j.$isExtendMarkNode(R)||j.$isExtendMarkNode(R.getParent())))return!1;const A=f.getTextContent();return c.clipboardData.setData("text/plain",A),!0},p.COMMAND_PRIORITY_LOW))},[t,N]);const xe=u.useCallback((l,c,f)=>{t.getEditorState().read(()=>{const b=p.$getSelection();if(p.$isRangeSelection(b)){c.current=b.clone();const w=b.anchor,A=b.focus,R=Be.createDOMRange(t,w.getNode(),w.offset,A.getNode(),A.offset);if(R!==null&&l!==null){const{left:I,bottom:q,top:K,width:J}=R.getBoundingClientRect(),Z=Be.createRectsFromDOMRange(t,R),te=l.offsetHeight||200,oe=window.pageYOffset||document.documentElement.scrollTop,Me=window.innerHeight-q>te+20;let Ie=Z.length===1?I+J/2-125:I-125;Ie<10&&(Ie=10),l.style.left=`${Ie}px`,l.style.top=Me?`${q+10+oe}px`:`${K-te-55+oe}px`;const Oe=Z.length,{container:qe,elements:me}=f,ct=me.length;for(let Q=0;Q<Oe;Q++){const ne=Z[Q];let he=me[Q];he===void 0&&(he=document.createElement("span"),me[Q]=he,qe.appendChild(he));const ut=document.body.scrollHeight>window.innerHeight?0:8,mt="255, 212, 0";he.style.cssText=`position:absolute;top:${ne.top+oe}px;left:${ne.left+ut}px;height:${ne.height}px;width:${ne.width}px;background-color:rgba(${mt}, 0.3);pointer-events:none;z-index:5;`}for(let Q=ct-1;Q>=Oe;Q--){const ne=me[Q];qe.removeChild(ne),me.pop()}}}})},[t]),ue=(l,c)=>{t.update(()=>{const b=Array.from(l).filter(A=>!!p.$getNodeByKey(A))[0],w=p.$getNodeByKey(b);j.$isExtendMarkNode(w)&&w.selectStart()},{onUpdate(){c&&c.focus()}})},_e=l=>t.getEditorState().read(()=>l?l.getTextContent():"")??"",Ae={currentUser:T,workspaceMembers:$,commentOptions:d,selectMarkNode:ue};return r.jsxs(r.Fragment,{children:[g&&Ue.createPortal(r.jsx(ze.CommentComposer,{updateLocation:xe,setCommentValue:n,commentValue:s,handleBlur:V,submitAddComment:ye,getSelectionText:_e,updateThreadId:F,providedUser:T,provideCommentOptions:d,composerLocales:L.editor.comments,children:({editorRef:l})=>r.jsx(Te,{initialContent:"",outputFormat:"html",debounce:1,editorRef:l,mode:"comment",shiftEnterInsertNewLine:!0,onChange:c=>{typeof c=="string"&&n(f=>({...f,value:c}))}})}),document.body),W&&Ue.createPortal(r.jsx(ze.CommentsPanel,{comments:D,submitAddComment:ye,isLoading:k,deleteCommentOrThread:ee,activeIDs:a,restoreComment:ce,deleteCommentImage:de,commentsFilter:P,setCommentsFilter:U,markNodeMap:N,locales:L.editor,listRef:o,addCommentReaction:G,updateCommentTextOrImage:Se,resolveThreat:X,removeCommentReactions:re,updateThreadId:F,storeOptions:Ae,getEditor:({setCommentValue:l,initialContent:c="",editorRef:f})=>r.jsx(Te,{initialContent:c,outputFormat:"html",debounce:1,mode:"comment",shiftEnterInsertNewLine:!0,editorRef:f,onChange:b=>{l==null||l(w=>({...w,value:b}))}})}),document.body)]})}function zo({editor:t,outputFormat:e,debounceMs:o=500,onChange:a,onBlur:i,isCommentVariant:s,checkIsEmpty:n,onChangeCommand:g}){const h=$e.useDebouncedCallback(_=>{g&&_.dispatchCommand(g,!0)},100),k=$e.useDebouncedCallback((_,C)=>{if(e==="html")_.read(()=>{let S=fe.$generateHtmlFromNodes(C,null);const L=p.$getRoot();L&&(n()&&(S=""),L.getChildrenSize()===0&&(C.update(()=>{L.append(p.$createParagraphNode())}),S=""));const P=p.$getRoot().getTextContent();a(S,P)});else{const M=_.toJSON();a(M)}},o),y=(_,C)=>{if(i)if(e==="html")C.update(()=>{const M=fe.$generateHtmlFromNodes(C,null);i(M)});else{const M=_.toJSON();i(M)}};return u.useEffect(()=>t.registerCommand(p.PASTE_COMMAND,C=>{if(!s)return!1;try{const M=C.clipboardData||window.clipboardData;if(!M||!M.getData("application/x-lexical-editor"))return!1;const L=M.getData("text/html");if(!L)return!1;const U=new DOMParser().parseFromString(L,"text/html"),T=fe.$generateNodesFromDOM(t,U);return p.$insertNodes(T),!0}catch{return!1}},p.COMMAND_PRIORITY_LOW),[t,s]),{triggerOnChangeCommand:h,onChangeValue:k,onBlurValue:y}}const $o={toolbar:{comment:!1,default:!0,editor:!1},componentPicker:{comment:!0,default:!0,editor:!0},floatingTextToolbar:{comment:!0,default:!0,editor:!0},floatingLinkEditor:{comment:!0,default:!0,editor:!0},actionMenu:{comment:!1,default:!0,editor:!0},mediaActions:{comment:!1,default:!0,editor:!0},richText:{comment:!0,default:!0,editor:!0},history:{comment:!1,default:!0,editor:!0},treeView:{comment:!1,default:!0,editor:!0},actionsInspector:{comment:!1,default:!0,editor:!0},onChange:{comment:!0,default:!0,editor:!0},blur:{comment:!0,default:!0,editor:!0},focus:{comment:!0,default:!0,editor:!0},autoFocus:{comment:!0,default:!0,editor:!0},placeholder:{comment:!0,default:!0,editor:!0},clearEditor:{comment:!0,default:!1,editor:!1},maxLength:{comment:!1,default:!0,editor:!0},emoji:{comment:!0,default:!0,editor:!0},hashtag:{comment:!1,default:!0,editor:!0},markdownShortcut:{comment:!1,default:!0,editor:!0},extendCode:{comment:!1,default:!0,editor:!0},codeHighlight:{comment:!1,default:!0,editor:!0},list:{comment:!0,default:!0,editor:!0},checkList:{comment:!0,default:!0,editor:!0},listMaxIndent:{comment:!0,default:!0,editor:!0},link:{comment:!0,default:!0,editor:!0},clickableLink:{comment:!0,default:!0,editor:!0},horizontalRule:{comment:!1,default:!0,editor:!0},tabFocus:{comment:!0,default:!0,editor:!0},tabIndentation:{comment:!0,default:!0,editor:!0},collapsible:{comment:!1,default:!0,editor:!0},callout:{comment:!1,default:!0,editor:!0},layout:{comment:!1,default:!0,editor:!0},table:{comment:!1,default:!0,editor:!0},draggableBlock:{comment:!1,default:!0,editor:!0},newParagraph:{comment:!0,default:!0,editor:!0},tableOfContents:{comment:!1,default:!0,editor:!0},embed:{comment:!1,default:!0,editor:!0},swagger:{comment:!1,default:!0,editor:!0},images:{comment:!1,default:!0,editor:!0},video:{comment:!1,default:!0,editor:!0},audio:{comment:!1,default:!0,editor:!0},file:{comment:!1,default:!0,editor:!0},excalidraw:{comment:!1,default:!0,editor:!0},childDocs:{comment:!1,default:!0,editor:!0},comment:{comment:!1,default:!0,editor:!0},form:{comment:!1,default:!0,editor:!0},select:{comment:!1,default:!0,editor:!0}},Qe=u.lazy(()=>Promise.resolve().then(()=>require("./layers.C69TrYD7.js")).then(t=>t.index));function v(t,e){const o=$o[t];return o?o[e]:!0}function Wo(t){const{onRef:e,floatingAnchorElem:o,isSmallWidthViewport:a,maxHeight:i,showTextToolbar:s,mode:n,isLoading:g,editor:h,onBlur:k,onFocus:y,onChange:_,outputFormat:C,debounceMs:M}=t,S=n==="editor",L=n==="comment",[P,U]=u.useState(!1),{excludeNodes:T}=u.useContext(se),{settings:{isRichText:d,showTreeView:$,isMaxLength:O}}=it(),{historyState:H}=Fe(),{triggerOnChangeCommand:W,onChangeValue:x,onBlurValue:m}=zo({editor:h,outputFormat:C,debounceMs:M,onChange:_,onBlur:k,isCommentVariant:L,checkIsEmpty:B.checkIsEmpty,onChangeCommand:B.ON_CHANGE_COMMAND});let D={};i?D={maxHeight:i}:S&&(D={overflowY:"hidden"});const N=S?r.jsx("div",{className:"editor-scroller",style:D,children:r.jsx("div",{className:"editor",ref:e,children:r.jsx("div",{className:"content-editable-wrapper",children:r.jsx("div",{children:r.jsx(ke.LexicalContentEditable,{})})})})}):r.jsx("div",{className:"editor-scroller",style:D,children:r.jsx("div",{className:"editor",ref:e,children:r.jsx(ke.LexicalContentEditable,{})})});return r.jsxs(r.Fragment,{children:[v("toolbar",n)&&!S&&r.jsx(ge.ToolbarPlugin,{mode:n}),v("componentPicker",n)&&r.jsx(E.ComponentPickerMenuPlugin,{mode:n,opened:P,setOpenedMenu:U}),v("history",n)&&r.jsx(je.HistoryPlugin,{externalHistoryState:H}),v("floatingTextToolbar",n)&&o&&!a&&(S?r.jsx(ge.FloatingTextFormatToolbarPlugin,{anchorElem:o,component:r.jsx(ge.ToolbarPlugin,{mode:n,isFloating:!0})}):r.jsx(ge.FloatingTextFormatToolbarPlugin,{anchorElem:o})),r.jsxs("div",{className:`editor-container ${d?"":"plain-text"}`,children:[v("placeholder",n)&&r.jsx(E.CustomPlaceholder,{}),v("autoFocus",n)&&r.jsx(E.CustomAutoFocusPlugin,{isLoading:g}),v("emoji",n)&&r.jsx(E.EmojiPickerPlugin,{}),v("hashtag",n)&&r.jsx(kt.HashtagPlugin,{}),v("clearEditor",n)&&r.jsx(_t.ClearEditorPlugin,{}),v("richText",n)&&r.jsx(xt.RichTextPlugin,{contentEditable:N,ErrorBoundary:wt.LexicalErrorBoundary}),v("markdownShortcut",n)&&r.jsx(E.MarkdownPlugin,{}),v("extendCode",n)&&r.jsx(E.ExtendCodePlugin,{}),v("codeHighlight",n)&&r.jsx(E.CodeHighlightPlugin,{}),v("list",n)&&r.jsx(E.ListPlugin,{}),v("checkList",n)&&r.jsx(E.CheckListPlugin,{}),v("listMaxIndent",n)&&r.jsx(E.ListMaxIndentLevelPlugin,{maxDepth:7}),v("link",n)&&r.jsx(E.LinkPlugin,{}),v("comment",n)&&r.jsx(Bo,{}),Qe&&v("excalidraw",n)&&r.jsx(u.Suspense,{children:r.jsx(Qe,{})}),v("swagger",n)&&r.jsx(E.SwaggerPlugin,{}),v("childDocs",n)&&r.jsx(E.ChildDocsPlugin,{}),v("newParagraph",n)&&r.jsx(E.NewParagraph,{}),v("form",n)&&r.jsx(E.FormPlugin,{}),v("video",n)&&!T.video&&r.jsx(Ce.VideoPlugin,{}),v("audio",n)&&!T.audio&&r.jsx(Ce.MusicPlugin,{}),v("file",n)&&!T.file&&r.jsx(Ce.FilePlugin,{}),v("embed",n)&&r.jsx(E.EmbedPlugin,{}),v("images",n)&&!T.photo&&r.jsx(Ce.FilePlugin$1,{}),v("onChange",n)&&r.jsx(St.OnChangePlugin,{ignoreSelectionChange:!0,onChange:(V,X)=>{x(V,X),W(X)}}),v("maxLength",n)&&O&&r.jsx(E.MaxLengthPlugin,{maxLength:30}),v("blur",n)&&r.jsx(E.BlurPlugin,{onBlur:m}),v("focus",n)&&r.jsx(E.FocusPlugin,{onFocus:y}),v("treeView",n)&&$&&r.jsx(E.TreeViewPlugin,{}),v("actionsInspector",n)&&$&&r.jsx(E.ActionsPlugin,{isRichText:!0,shouldPreserveNewLinesInMarkdown:!0}),v("select",n)&&r.jsx(E.Select,{editor:h}),v("clickableLink",n)&&r.jsx(Ct.ClickableLinkPlugin,{}),v("horizontalRule",n)&&r.jsx(vt.HorizontalRulePlugin,{}),v("tabFocus",n)&&r.jsx(E.TabFocusPlugin,{}),v("tabIndentation",n)&&r.jsx(E.TabIndentationPlugin,{}),v("collapsible",n)&&r.jsx(E.CollapsiblePlugin,{}),v("callout",n)&&r.jsx(E.CalloutPlugin,{}),v("layout",n)&&r.jsx(E.LayoutPlugin,{}),v("table",n)&&o&&(S||!a)&&r.jsx(E.Table,{floatingAnchorElem:o,isSmallWidthViewport:a}),v("draggableBlock",n)&&o&&!a&&r.jsx(ge.DraggableBlockPlugin,{isShowAddButton:!0,anchorElem:o}),o&&r.jsxs(r.Fragment,{children:[v("floatingLinkEditor",n)&&r.jsx(E.FloatingLinkEditorPlugin,{anchorElem:o,showTextToolbar:s}),v("actionMenu",n)&&r.jsx(E.ActionMenuPlugin,{anchorElem:o}),v("mediaActions",n)&&r.jsx(j.MediaActions,{anchorElem:o})]})]}),v("tableOfContents",n)&&(S?T.contents&&r.jsx(E.TableOfContentsPlugin,{}):(T.contents||T.contents===void 0)&&r.jsx(E.TableOfContentsPlugin,{})),v("emptyPage",n)&&S&&r.jsx(ke.EmptyPage,{editor:h})]})}function Ko(t){const{mode:e,maxHeight:o,disable:a,isErrorWs:i,content:s,isLoading:n,imperativeHandleRef:g,editorRef:h,onBlur:k,onFocus:y,onChange:_,outputFormat:C,debounceMs:M}=t,[S,L]=u.useState(null),[P,U]=u.useState(!1),T=u.useRef(!1),[d,...$]=tt.useLexicalComposerContext(),{shiftEnterInsertNewLine:O}=u.useContext(se);ko({editor:d}),u.useEffect(()=>{d&&(d.setEditable(!a),h&&(h.current=d),i&&d.update(()=>{if(typeof s=="string"){p.$getRoot().clear();const D=new DOMParser().parseFromString(s,"text/html"),N=fe.$generateNodesFromDOM(d,D);p.$getRoot().select(),p.$insertNodes(N)}else{const x=d.parseEditorState(JSON.stringify(s));d.setEditorState(x)}}))},[i]),u.useEffect(()=>{function x(){d.dispatchCommand(B.ON_SCROLL_EDITOR,!0)}function m(N){const V=N.target,G=(V.tagName.toLowerCase()==="img"?V.closest("div.resizable-container__inner"):null)||B.findTopParentElement(V);if(!G||V.classList.contains("dsd__theme__table-scrollable-wrapper"))return;(G.classList.contains("selected-block")||G.querySelector(".selected-block"))&&(N.preventDefault(),d.dispatchCommand(B.RIGHT_CLICK_COMMAND,{x:N.clientX,y:N.clientY,target:G}))}window.addEventListener("scroll",x);const D=d.getRootElement();return D==null||D.addEventListener("contextmenu",m),()=>{window.removeEventListener("scroll",x),D==null||D.removeEventListener("contextmenu",m)}},[d]);const H=x=>{x!==null&&L(x)};u.useEffect(()=>{const x=m=>{const D=navigator.platform.toUpperCase().includes("MAC"),N=D&&m.metaKey&&!m.shiftKey&&m.code==="KeyZ"||!D&&m.ctrlKey&&!m.shiftKey&&m.code==="KeyZ",V=D&&m.metaKey&&m.shiftKey&&m.code==="KeyZ"||!D&&m.ctrlKey&&m.shiftKey&&m.code==="KeyZ";N&&(m.preventDefault(),d.dispatchCommand(p.UNDO_COMMAND,void 0)),V&&(m.preventDefault(),d.dispatchCommand(p.REDO_COMMAND,void 0))};return ve.mergeRegister(d.registerCommand(p.BLUR_COMMAND,()=>(window.addEventListener("keydown",x),!1),p.COMMAND_PRIORITY_LOW),d.registerCommand(p.FOCUS_COMMAND,()=>(window.removeEventListener("keydown",x),!1),p.COMMAND_PRIORITY_LOW))},[d]),u.useEffect(()=>{const x=()=>{const m=ie&&window.matchMedia("(max-width: 600px)").matches;m!==P&&U(m)};return x(),window.addEventListener("resize",x),()=>{window.removeEventListener("resize",x)}},[P]),u.useEffect(()=>ve.mergeRegister(d.registerCommand(p.KEY_ENTER_COMMAND,x=>{const m=p.$getSelection();return B.keyEnterListener(d,m,g,x,O)},p.COMMAND_PRIORITY_LOW),d.registerCommand(p.DELETE_CHARACTER_COMMAND,()=>B.deleteCharacterCommand(),p.COMMAND_PRIORITY_LOW),d.registerCommand(p.KEY_ESCAPE_COMMAND,x=>p.$getSelection()?(d.blur(),p.$setSelection(null),B.stopEvent(x),!0):!1,p.COMMAND_PRIORITY_LOW),d.registerCommand(p.KEY_DOWN_COMMAND,x=>B.keyDownCommand(d,x),p.COMMAND_PRIORITY_LOW),d.registerCommand(p.KEY_ARROW_UP_COMMAND,()=>B.keyArrowUpLeft(),p.COMMAND_PRIORITY_LOW),d.registerCommand(p.KEY_ARROW_LEFT_COMMAND,()=>B.keyArrowUpLeft(),p.COMMAND_PRIORITY_LOW),d.registerCommand(p.KEY_ARROW_DOWN_COMMAND,()=>B.keyArrowRightDown(),p.COMMAND_PRIORITY_LOW),d.registerCommand(p.PASTE_COMMAND,x=>B.pasteCommand(x,g),p.COMMAND_PRIORITY_LOW),d.registerCommand(p.DROP_COMMAND,x=>B.dropCommand(x,g),p.COMMAND_PRIORITY_HIGH),d.registerCommand(p.KEY_ARROW_RIGHT_COMMAND,()=>B.keyArrowRightDown(),p.COMMAND_PRIORITY_LOW),d.registerCommand(p.INSERT_PARAGRAPH_COMMAND,()=>{const x=p.$getSelection();x.format=0,x.setStyle("");const m=x.insertParagraph();return m&&(m.__format=0),!0},p.COMMAND_PRIORITY_LOW),d.registerCommand(p.KEY_BACKSPACE_COMMAND,x=>B.KeyBackSpace(d,x,g),p.COMMAND_PRIORITY_HIGH)),[d]);const W={onRef:H,floatingAnchorElem:S,isSmallWidthViewport:P,maxHeight:o,showTextToolbar:T,mode:e,isLoading:n,editor:d,onBlur:k,onFocus:y,onChange:_,outputFormat:C,debounceMs:M};return r.jsx(Wo,{...W})}function Ho(t){const e=new URL(t),o=`${e.origin}${e.pathname}`,a=e.searchParams.get("token");return{baseUrl:o,token:a}}function Vo(t,e,o="http://localhost"){const a=Yo(t,e),{baseUrl:i,token:s}=Ho(o);let n={};return s&&(n={params:{token:s}}),new et.WebsocketProvider(i,t,a,{connect:!1,...n})}function Yo(t,e){let o=e.get(t);return o===void 0?(o=new ae.Doc,e.set(t,o)):o.load(),o}const Jo=ot?"":"os-windows",dt=({children:t})=>r.jsx("div",{className:`doc-space-styles-provider ${Jo}`,children:t}),se=u.createContext({maxFileSize:5,disable:!1,excludeNodes:{},imagePickerSettings:{},pages:[]}),Go=[],Te=({initialContent:t,onChange:e,outputFormat:o,mode:a,maxHeight:i,onBlur:s,onFocus:n,fetchUploadMedia:g,fetchPromptResult:h,fetchDeleteMedia:k,fetchRestoreMedia:y,currentUser:_,commentOptions:C,workspaceMembers:M=Go,maxFileSize:S,contentModalUploadImage:L,maxImageSizeError:P,debounce:U,disable:T,ws:d,excludeNodes:$={},imagePickerSettings:O={},childPages:H,language:W,shiftEnterInsertNewLine:x,editorRef:m})=>{const D=a||"default",N=t||"<p></p>";let V=!!(d!=null&&d.url);const{historyState:X}=Fe(),G=u.useRef({}),re=u.useRef(null),[le,ee]=u.useState("initial"),[F,ye]=u.useState(null),Se=u.useCallback(l=>{l.update(()=>{if(typeof N=="string"){const f=new DOMParser().parseFromString(N,"text/html"),b=fe.$generateNodesFromDOM(l,f);p.$getRoot().select(),p.$insertNodes(b)}})},[]),de=u.useMemo(()=>(window.editorAppVersion=`version @layers-app/editor:${Et.version}`,D==="comment"&&document.body.setAttribute("mode","true"),{editorState:null,namespace:"layers",nodes:j.getPlaygroundNodes(D),onError:l=>{throw l},theme:fo(D)}),[]);u.useEffect(()=>{W&&Pe.changeLanguage(W)},[W]);const ce=()=>typeof N=="string"?Se:JSON.stringify(N),xe=u.useCallback((l,c)=>{const f=Vo(l,c,d==null?void 0:d.url);return f.on("status",b=>{b.status==="connecting"&&ee(b.status)}),setTimeout(()=>ye(f),0),f},[]),ue=u.useCallback(()=>{var b;const l=F.awareness,f=Array.from(l.getStates().entries()).map(([w,A])=>({id:String(w),userId:w,name:A.name,color:A.color,awarenessData:A.awarenessData})).filter((w,A,R)=>A===R.findIndex(I=>I.name===w.name));(b=d==null?void 0:d.getActiveUsers)==null||b.call(d,f)},[F]);u.useEffect(()=>{if(F!=null)return F.awareness.on("update",ue),()=>F.awareness.off("update",ue)},[F,ue]),u.useEffect(()=>{if(F!=null&&F.ws){const l=F.ws;let c=0;l?(l.addEventListener("message",f=>{if(typeof f.data!="string"){c===1&&ee("connected"),c++;return}const b=JSON.parse(f.data);b["active-users"]&&console.log("message",b["active-users"]),b.error&&(b.error==="Unauthorized"?(console.error("Connection unauthorized: You are not authorized to access this WebSocket."),F.disconnect()):b.error==="No token provided"?(console.error("No token provided: You must provide a token."),F.disconnect()):(console.error("Unknown error:",b.error),F.disconnect()),ee("error"))}),l.addEventListener("close",f=>{console.error("WebSocket connection closed:",f),ee("error")})):console.error("WebSocket is not initialized yet.")}},[F==null?void 0:F.ws]),u.useEffect(()=>()=>{F instanceof et.WebsocketProvider&&(F.destroy(),F.disconnect())},[F]),V||(de.editorState=ce());const _e=le==="connecting"&&V,Ae=u.useMemo(()=>{const l={...$};return g||(l.photo=!0,l.video=!0,l.audio=!0,l.file=!0),a!=="editor"&&(l.childDocs=!0),{fetchDeleteMedia:k,fetchUploadMedia:g,fetchRestoreMedia:y,fetchPromptResult:h,currentUser:_,maxFileSize:S||5,contentModalUploadImage:L,maxImageSizeError:P,commentOptions:C,shiftEnterInsertNewLine:x,workspaceMembers:M,disable:T||!1,mode:D,excludeNodes:l,imagePickerSettings:O,imperativeHandleRef:G,maxHeight:i,pages:H||[]}},[_,C,H]);return r.jsx(se.Provider,{value:Ae,children:r.jsx(De.I18nextProvider,{i18n:Pe,children:r.jsx(dt,{children:r.jsxs(Ro,{children:[r.jsx("div",{ref:re}),r.jsxs("div",{className:`doc-space-editor-wrapper ${D}`,children:[r.jsx(bt.LoadingOverlay,{visible:_e,overlayProps:{radius:"sm",blur:2}}),r.jsx(Eo,{children:r.jsxs(ft.LexicalComposer,{initialConfig:de,children:[d&&le!=="error"?r.jsx(gt.CollaborationPlugin,{id:d.id,providerFactory:xe,username:d.user.name,cursorColor:d.user.color,awarenessData:d.user.awarenessData,shouldBootstrap:!0,cursorsContainerRef:re,initialEditorState:ce()}):r.jsx(je.HistoryPlugin,{externalHistoryState:X}),r.jsx(No,{children:r.jsx(E.TableContext,{children:r.jsx(Co,{children:r.jsx("div",{className:"editor-shell",children:r.jsx(Ko,{editorRef:m,maxHeight:i,mode:D,disable:T||!1,isErrorWs:le==="error",content:N,isLoading:_e,imperativeHandleRef:G,onBlur:s,onFocus:n,onChange:e,outputFormat:o,debounceMs:U})})})})})]})})]})]})})})})};exports.CAN_USE_DOM=ie;exports.Context=se;exports.Editor=Te;exports.INITIAL_SETTINGS=Mo;exports.INSERT_INLINE_COMMAND=lt;exports.IS_APPLE=ot;exports.IS_SAFARI=_o;exports.StylesProvider=dt;exports.mediaMap=Y;exports.theme=Re;exports.useFlashMessageContext=Lo;exports.useSettings=it;exports.useSharedAutocompleteContext=wo;exports.useSharedHistoryContext=Fe;
@@ -0,0 +1,2 @@
1
+ "use strict";const Oe=require("@lexical/react/LexicalComposerContext"),n=require("react/jsx-runtime"),l=require("react"),Be=require("react-dom"),Ee=require("react-i18next"),xe=require("@lexical/rich-text"),de=require("@lexical/utils"),u=require("@mantine/core"),$=require("@tabler/icons-react"),c=require("lexical"),Ce=require("./layers.eLiGm-eZ.js"),rt=require("@lexical/code");require("@lexical/hashtag");const Me=require("@lexical/link");require("@lexical/mark");require("@lexical/overflow");require("@lexical/react/LexicalHorizontalRuleNode");const C=require("./layers.CEMW9z_P.js"),ee=require("./layers.C69TrYD7.js"),T=require("./layers.CzNz0Zya.js"),Ne=require("@lexical/selection"),Pe=require("@layers-app/shared"),V=require("./layers.Cwao1pOZ.js"),lt=require("./layers.DNCgFYS7.js"),at=require("@lexical/react/LexicalDecoratorBlockNode"),He=require("@mantine/hooks"),Ke=require("./layers.B10sB-Vy.js"),ct=4,ut=2,dt="draggable-block-menu",ft=16,ze="application/x-lexical-drag-block",De=e=>e?e.match(/(\d*\.?\d+)%/g):[],Ze=e=>e<0?0:e>100?100:e,Je=(e,t,o)=>{let i=0,s=[];e.update(()=>{if(e&&t){const f=e.getElementByKey(t.getKey());if(f){const p=f.style;s=De(p.getPropertyValue("grid-template-columns")).map(m=>m.slice(0,-1)),i=s?s.length:0}}const a=100/(i+1),r=[...s];r.splice(o,0,`${a}%`);let d=a/i;for(let f=0;f<r.length;f++)if(o!==f){const p=Number(r[f])-d;r[f]=`minmax(100px,${Ze(p)}%)`}else r[f]=`minmax(100px,${r[f]})`;t.setTemplateColumns(r.join(" "))})},Re=(e,t,o,i)=>{e.update(()=>{const s=e.getElementByKey(t.getKey());if(!s)return;let a=i;o<i&&(a=i-1);const d=s.style.getPropertyValue("grid-template-columns").match(/minmax\([^)]*\)|\S+/g)||[],f=d.splice(o,1)[0];d.splice(a,0,f),t.setTemplateColumns(d.join(" "))})},Ie=(e,t)=>(e!=null&&e.children?Array.from(e.children):[]).indexOf(t);function mt(e,t,o,i){var f;let s=e.getAttribute("data-direction")==="left",a=e.getAttribute("data-direction")==="right",r=e.getAttribute("data-index"),d=e.getAttribute("data-index-start");if(s||a||r){let p=(f=o.getParent())==null?void 0:f.getParent();if(o instanceof C.LayoutContainerNode&&(p=o),o instanceof C.LayoutDividerNode||o instanceof C.LayoutContainerNode){const m=p==null?void 0:p.getChildren();let N=i instanceof C.LayoutDividerNode;if((m==null?void 0:m.length)>=4&&!N)return!0;t.update(()=>{var _;let g=0;s?g=0:a?g=((_=p==null?void 0:p.getChildren())==null?void 0:_.length)-1:g=Number(r),N?Re(t,p,Number(d),g):Je(t,p,g);let A=null;g!==void 0&&t.update(()=>{if(A=p.getChildren()[g],N)o instanceof C.LayoutContainerNode?A.insertAfter(i.getParent()):A.insertBefore(i.getParent());else if(a)A.insertAfter(C.$createLayoutItemNode().append(i).append(C.$createLayoutDividerNode()));else{const j=i.getParent(),L=j==null?void 0:j.getParent();C.$isLayoutItemNode(j)&&(j==null?void 0:j.getChildrenSize())===2&&C.$isLayoutItemNode(j)&&C.$isLayoutContainerNode(L)&&T.removeNodeKeepContent(t,j,L),A.insertBefore(C.$createLayoutItemNode().append(i).append(C.$createLayoutDividerNode()))}})})}else t.update(()=>{const m=C.$createLayoutContainerNode(ee.GRID_TWO_COL_WITH_GAP);let N;if(C.$isCalloutWrapperNode(o)||ee.$isCollapsibleContainerNode(o)){const g=i.getParent(),A=g==null?void 0:g.getParent();if(C.$isLayoutItemNode(g)&&(g==null?void 0:g.getChildrenSize())===2&&C.$isLayoutContainerNode(A)){const j=A.getParent(),L=j==null?void 0:j.getParent(),F=A.getChildren(),v=F.findIndex(B=>B===g)===0?1:0,P=F[v];if(C.$isLayoutItemNode(P)){const B=P.getChildren()[0];C.$isCalloutWrapperNode(L)&&(L.append(B),A.remove(),N=T.$copyNodeDeep(L))}}else N=T.$copyNodeDeep(o,i)}else N=T.$copyNodeDeep(o);N&&(s?(m.append(C.$createLayoutItemNode().append(i).append(C.$createLayoutDividerNode())),m.append(C.$createLayoutItemNode().append(N).append(C.$createLayoutDividerNode()))):(m.append(C.$createLayoutItemNode().append(N).append(C.$createLayoutDividerNode())),m.append(C.$createLayoutItemNode().append(i).append(C.$createLayoutDividerNode()))),o.insertAfter(m),o.remove(),N.selectStart())});return!0}return!1}function pt(e,t,o="right",i=!1){e.update(()=>{const s=c.$getNearestNodeFromDOMNode(t),a=s==null?void 0:s.getParent();if(a){if(De(a.__templateColumns).length===4)return;let d=Ie(t.parentElement,t);o==="right"&&(d=d+1),Je(e,a,d)}const r=C.$createLayoutItemNode().append(c.$createParagraphNode()).append(C.$createLayoutDividerNode());s&&(o==="right"?i?(s.insertBefore(T.$copyNodeDeep(s)),s.selectStart()):(s.insertAfter(r),r==null||r.selectStart()):(s.insertBefore(r),r.selectStart()))})}const et=(e,t)=>{const o=t==null?void 0:t.getParent();let i=De(o==null?void 0:o.getTemplateColumns());const s=o==null?void 0:o.getChildren();let a=0;if(s&&t){for(let m=0;m<s.length;m++)if(s[m].__key===t.__key){a=m;break}}i.splice(a,1);const r=i.map(m=>parseFloat(m)),d=r.reduce((m,N)=>m+N,0),p=r.map(m=>m/d*100).map(m=>`minmax(50px,${m.toFixed(2)}%)`);o==null||o.setTemplateColumns(p.join(" "))},gt=e=>e.className.includes("editor-image")||e.className.includes("video-container")?e:e.className.includes("editor-excalidraw")?e.firstChild:null,tt=(e,t)=>t!=null&&t.__key&&e!==t.__key?tt(e,t==null?void 0:t.getParent()):e===(t==null?void 0:t.__key),qe=(e,t,o)=>{e.update(()=>{var r,d,f;const i=(r=t==null?void 0:t.getParent())==null?void 0:r.getParent(),s=t==null?void 0:t.getParent(),a=o==="right"?(d=t==null?void 0:t.getParent())==null?void 0:d.getNextSibling():(f=t==null?void 0:t.getParent())==null?void 0:f.getPreviousSibling();if(s&&a&&i instanceof C.LayoutContainerNode){const p=e.getElementByKey(s.getKey()),m=e.getElementByKey(i.getKey()),N=Ie(m,p);s&&i&&a&&(o==="right"&&(Re(e,i,N+1,N),a.insertAfter(s)),o==="left"&&(Re(e,i,N,N+1),a.insertBefore(s)))}})};function ht(e){e&&(e.style.display="none")}function We({blockElement:e,editor:t,isTop:o,isClickedBlockRef:i,setDraggableBlockElem:s}){e&&(i.current=!0,t.update(()=>{const a=c.$getNearestNodeFromDOMNode(e);if(a){const r=c.$createParagraphNode();o?(a.insertBefore(r),setTimeout(()=>{s(t.getElementByKey(r.__key)),t.update(()=>{r.selectStart()})})):(a.insertAfter(r),setTimeout(()=>{s(t.getElementByKey(r.__key)),t.update(()=>{r.selectEnd()})}))}}))}function xt(e){const t=(f,p)=>f?parseFloat(window.getComputedStyle(f)[p]):0,{marginTop:o,marginBottom:i}=window.getComputedStyle(e),s=t(e.previousElementSibling,"marginBottom"),a=t(e.nextElementSibling,"marginTop"),r=Math.max(parseFloat(o),s);return{marginBottom:Math.max(parseFloat(i),a),marginTop:r}}function Ct(e){return!!e.closest(`.${dt}`)}function Ue(e,t,o,i){if(!e){t.style.opacity="0";return}t.style.display="block";let s=null;const a=gt(e);a&&a.style.justifyContent!=="left"&&a.firstChild instanceof HTMLElement?s=a.firstChild.getBoundingClientRect():s=e.getBoundingClientRect();let r=null,d=0,f=!0,p=0;if(s){let F=e.firstChild instanceof HTMLElement&&(e.firstChild.hasAttribute("data-lexical-text")||e.firstChild.tagName==="LI"||e.firstChild.tagName==="A")?e.firstChild:null;if(F&&!F.className.includes("editor-image")&&e.tagName!=="CODE"){const M=window.getComputedStyle(F),v=parseFloat(M.lineHeight),P=parseFloat(M.fontSize);p=Math.ceil(P+(v-P)/2),r=F.getBoundingClientRect()}else if(e.firstChild instanceof HTMLElement&&e.firstChild.tagName==="BR"&&e.tagName!=="CODE"){const M=window.getComputedStyle(e,"::before");p=parseFloat(M.height)||30}else e&&(e.tagName==="HR"||e.matches(":has(audio)")||e.classList.contains("file-container"))?p=e.clientHeight:e.firstChild instanceof HTMLElement&&e.firstChild.tagName==="SUMMARY"?p=e.firstChild.clientHeight:(r=s,f=!1)}const m=o.getBoundingClientRect(),N=(r==null?void 0:r.top)||s.top,g=p||d,A=t.clientHeight,_=g-A;let j=!f||!g?s.top+7-m.top:N+_/2-m.top,L=s.left-m.left-A*2-3;e.tagName==="LI"&&e.getAttribute("role")!=="checkbox"&&(L=L-26,j=j-1),a&&(j=N-m.top+7,(a.style.justifyContent==="center"||a.style.justifyContent==="right")&&(L=L+10)),e.matches(":has(.resizable-container__handle)")&&!e.matches(":has(.hide-padding)")&&(j=N-m.top+27),s.top<0&&(j=j+-s.top),e.className==="dsd__theme__layoutDivider"&&(t.style.display="none",s.top-t.clientHeight<0?e.style.setProperty("--height-column",`${e.clientHeight+s.top-t.clientHeight-7}px`):e.style.setProperty("--height-column",`${e.clientHeight}px`)),t.style.opacity="1",!i&&L>-40&&(t.style.transform=`translate(${L}px, ${j}px)`)}function Ye(e,t){const{transform:o}=t.style;t.style.transform="translateZ(0)",e.setDragImage(t,0,0),setTimeout(()=>{t.style.transform=o})}function yt(e,t){const o=document.createElement("div");o.style.position="absolute",o.style.top="-9999px",o.style.left="-9999px",t.forEach(i=>{const s=i.cloneNode(!0);s.style.position="relative",o.appendChild(s)}),document.body.appendChild(o),e.setDragImage(o,0,0),setTimeout(()=>document.body.removeChild(o),0)}function bt(e,t,o,i,s,a,r){var x;const{top:d,height:f,width:p,left:m}=t.getBoundingClientRect(),{top:N,left:g,width:A}=s==null?void 0:s.getBoundingClientRect(),{marginTop:_,marginBottom:j}=xt(t);let L=d;o>=d?(r.current.isBottom=!0,L+=f+j/2):(r.current.isBottom=!1,L-=_/2);const F=L-N-ut,M=ft-ct,P=a.target.closest(".dsd__theme__layoutDivider");e.setAttribute("data-index",""),e.style.background="deepskyblue";const B=m-g-M;if(i<=m&&!P){if(t.closest(".dsd__theme__layoutItem"))return;e.style.transform=`translate(${B}px, ${d-N}px)`,e.style.width="4px",e.style.height=`${f}px`,e.style.opacity=".4",e.setAttribute("data-direction","left")}else if(i>=A-B&&!P&&!t.closest(".dsd__theme__layoutItem"))t.classList.contains("dsd__theme__layoutContainer")&&!e.getAttribute("data-index-start")&&t&&t.children.length>=4&&(e.style.background="red"),e.style.transform=`translate(${A-B}px, ${d-N}px)`,e.style.width="4px",e.style.height=`${f}px`,e.style.opacity=".4",e.setAttribute("data-direction","right");else if(P){a.preventDefault();const S=(x=P.parentNode)==null?void 0:x.parentNode;(S==null?void 0:S.children.length)===4&&(e.style.background="red");const k=P.parentNode,O=Ie(S,k),R=O?P.getBoundingClientRect().left-g:B+30;e.style.transform=`translate(${R}px, ${d-N}px)`,e.style.width="4px",e.style.height=`${f}px`,e.style.opacity=".4",e.setAttribute("data-index",`${O}`)}else e.style.transform=`translate(${B}px, ${F}px)`,e.style.width=`${p+M}px`,e.style.opacity=".4",e.style.height="4px",e.setAttribute("data-direction","")}function Ge(e){e&&(e.style.opacity="0",e.style.transform="translate(-10000px, -10000px)")}const Tt=({hoveredButton:e,insertNewParagraph:t,currentDraggableBlockRef:o,setHoveredButton:i,isClickedBlockRef:s,setDraggableBlockElem:a,editor:r,t:d})=>n.jsx("div",{className:`icon add-block-menu ${e?"active":""}`,onClick:()=>{t({blockElement:o.current.htmlElement,editor:r,isTop:!1,isClickedBlockRef:s,setDraggableBlockElem:a}),i("both")},onMouseEnter:()=>{i("bottom")},onMouseLeave:()=>{i("both")},children:n.jsx(u.Tooltip,{openDelay:300,label:d("editor.hoverOptions.addNewBlockAbove"),position:"bottom",disabled:s.current||!e,children:n.jsx(u.ActionIcon,{radius:"sm",color:"gray",size:"xs",variant:"subtle","aria-label":"Settings",children:e==="bottom"?n.jsx($.IconPlus,{}):n.jsx($.IconMinus,{})})})}),Mt=({hoveredButton:e,insertNewParagraph:t,currentDraggableBlockRef:o,setHoveredButton:i,isClickedBlockRef:s,setDraggableBlockElem:a,editor:r,t:d})=>n.jsx("div",{className:`icon add-block-menu add-block-menu_top ${e?"active":""}`,onClick:()=>{t({blockElement:o.current.htmlElement,editor:r,isTop:!0,isClickedBlockRef:s,setDraggableBlockElem:a}),i("both")},onMouseEnter:()=>{i("top")},onMouseLeave:()=>{i("both")},children:n.jsx(u.Tooltip,{disabled:s.current||!e,openDelay:300,label:d("editor.hoverOptions.addNewBlockBelow"),position:"top",children:n.jsx(u.ActionIcon,{radius:"sm",color:"gray",size:"xs",variant:"subtle","aria-label":"Settings",children:e==="top"?n.jsx($.IconPlus,{}):n.jsx($.IconMinus,{})})})});function nt(e,t){var a,r;const o=(a=t.exportDOM)==null?void 0:a.call(t,e),i=(o==null?void 0:o.element)??null;if(c.$isElementNode(t)){const d=i??document.createElement("div"),f=((r=t.getChildren)==null?void 0:r.call(t))??[];for(const p of f){const m=nt(e,p);if(m)d.appendChild(m);else{const N=typeof p.getTextContent=="function"?p.getTextContent():"";N&&d.appendChild(document.createTextNode(N))}}return typeof(o==null?void 0:o.after)=="function"&&o.after(d),d}if(i)return typeof(o==null?void 0:o.after)=="function"&&o.after(i),i;const s=typeof t.getTextContent=="function"?t.getTextContent():"";return s?document.createTextNode(s):null}async function Xe(e,t){const o=e.getRootElement(),i=Array.from(o.querySelectorAll(".selected-block"));if(!i.length)return;let s="",a="";e.getEditorState().read(()=>{e.update(()=>{let r=i.map(f=>c.$getNearestNodeFromDOMNode(f)).filter(f=>!!f);s=r.map(f=>typeof f.getTextContent=="function"?f.getTextContent():"").filter(Boolean).join(`
2
+ `);const d=document.createElement("div");r.forEach(f=>{const p=nt(e,f);t==="cut"&&f.remove(),p&&d.appendChild(p)}),a=d.innerHTML})}),(s||a)&&await Nt(s,a)}async function Nt(e,t){if(navigator.clipboard&&"write"in navigator.clipboard&&window.ClipboardItem){const o=new ClipboardItem({"text/plain":new Blob([e],{type:"text/plain"}),...t?{"text/html":new Blob([t],{type:"text/html"})}:{}});await navigator.clipboard.write([o])}}const Ve=(e,t,o,i)=>{if(o)if(i==="layout"){const s=o.getParent(),a=s.getParent();T.removeNodeKeepContent(e,s,a),t("delete")}else{const s=o==null?void 0:o.getParent();if(s instanceof C.LayoutItemNode&&s.getChildren().length===2){const a=s,r=s.getParent();if(o.__type==="image"){a.append(c.$createParagraphNode());return}T.removeNodeKeepContent(e,a,r)}T.deleteNode(e,o),t("delete")}},Qe=e=>{const t=e._rootElement;return Array.from(t.querySelectorAll(".selected-block"))},Fe=(e,t,o,i=!1)=>{t&&e.update(()=>{const s=e.getElementByKey(t.getParent().getKey());pt(e,s,o,i)})},_t=(e,t,o,i)=>{if(i==="layout")Fe(e,o,"right",!0);else{const s=e._rootElement,a=Array.from(s.querySelectorAll(".selected-block")).reverse();a.length&&(e.update(()=>{const r=c.$getNearestNodeFromDOMNode(a[0]);a.forEach(d=>{let f=c.$getNearestNodeFromDOMNode(d);f&&(r==null||r.insertAfter(T.$copyNodeDeep(f))),ee.$removeSelectedHTMLElement(d)})}),t())}},St=({editor:e,onChange:t,currentEditorNode:o,textBlock:i,t:s,isDisabledAddColumnButton:a,disabledMoveColumnButtons:r})=>{const{fetchUploadMedia:d,excludeNodes:f}=l.useContext(Ce.Context),[p,m]=l.useState("inherit"),[N,g]=l.useState("inherit"),[A,_]=l.useState("inherit"),[j,L]=l.useState("");l.useEffect(()=>{const x=o==null?void 0:o.__type;e.read(()=>{var S;((S=o==null?void 0:o.getParent())==null?void 0:S.__type)==="layout-item"?L("layout"):L(x==="callout-wrapper"?x:"block")})},[o==null?void 0:o.__key]);const F=x=>x.split(";").filter(Boolean).reduce((S,k)=>{const[O,R]=k.split(":").map(U=>U.trim());return O&&R&&(S[O]=R),S},{}),M=x=>Object.entries(x).map(([S,k])=>`${S}: ${k}`).join("; "),v=l.useCallback(x=>{e.update(()=>{const S=Qe(e).map(O=>c.$getNearestNodeFromDOMNode(O)).filter(Boolean),k=O=>{if(typeof O.getStyle=="function"&&typeof O.setStyle=="function"){const R=F(O.getStyle());R.color=x.color,R["background-color"]=x.bgColor,O.setStyle(M(R)),m(x.bgColor),_(x.color)}};S.forEach(O=>{if(O instanceof C.ListNode){O.getChildren().forEach(R=>{const U=R.getFirstChild();U instanceof C.ExtendedTextNode&&k(U)});return}if(O instanceof c.ElementNode){const R=O.getFirstChild();R instanceof C.ExtendedTextNode&&k(R)}})})},[m,_]),P=(x,S)=>{const k=S||j;k==="callout-wrapper"&&o instanceof C.CalloutWrapperNode?e.update(()=>{const O=ee.isCalloutValue(x);o.setType(O?x.meta.type:void 0),o.setBackgroundColor(x.value)}):k==="layout-color"?e.update(()=>{const O=o==null?void 0:o.getParent(),R=x.value===N?"inherit":x.value;O instanceof C.LayoutItemNode&&O.setLayoutBackground(R)}):v({color:A,bgColor:p,[x.mode==="background"?"bgColor":x.mode]:x.value})},B=x=>{const S=Qe(e);S.length?S.forEach(k=>{e.update(()=>{let O=c.$getNearestNodeFromDOMNode(k);O&&Ve(e,t,O,x)})}):e.update(()=>{let k=c.$getNearestNodeFromDOMNode(S[0]);Ve(e,t,k,x)})};return l.useEffect(()=>{setTimeout(()=>{e.read(()=>{if(j==="callout-wrapper"&&o instanceof C.CalloutWrapperNode){m(o.__backgroundColor);return}const x=o==null?void 0:o.getParent();x instanceof C.LayoutItemNode&&g(x.__backgroundColor);const S=c.$getSelection();c.$isRangeSelection(S)&&(_(Ne.$getSelectionStyleValueForProperty(S,"color","inherit")),m(Ne.$getSelectionStyleValueForProperty(S,"background-color","inherit")))})})},[]),n.jsxs(n.Fragment,{children:[n.jsx(u.Menu.Item,{onMouseDown:x=>{x.preventDefault(),Xe(e,"copy"),t("copy")},leftSection:n.jsx($.IconClipboard,{style:{width:u.rem(14),height:u.rem(14)}}),children:s("editor.link.copy")}),n.jsx(u.Menu.Item,{onMouseDown:x=>{x.preventDefault(),Xe(e,"cut"),t("cut")},leftSection:n.jsx($.IconCut,{style:{width:u.rem(14),height:u.rem(14)}}),children:s("editor.contextMenu.cut")}),n.jsx(u.Menu.Item,{onClick:()=>B(""),leftSection:n.jsx($.IconTrash,{style:{width:u.rem(14),height:u.rem(14)}}),children:s("editor.contextMenu.delete")}),n.jsx(u.Menu.Item,{disabled:j==="layout"&&a,onClick:()=>_t(e,t,o,j),leftSection:n.jsx($.IconCopy,{style:{width:u.rem(14),height:u.rem(14)}}),children:s("editor.contextMenu.duplicate")}),i==="text"&&j!=="callout-wrapper"&&n.jsxs(n.Fragment,{children:[n.jsx(u.Menu.Divider,{}),n.jsx(ee.BlockFormatMenu,{disabled:!1,blockType:"paragraph",rootType:"root",editor:e,mode:"editor",fetchUploadMedia:d,excludeNodes:f,onChange:t,menuProps:{trigger:"hover",position:"right-start",offset:{mainAxis:0,alignmentAxis:0}},children:n.jsx("div",{children:n.jsx(V.CustomMenuItem,{label:s("editor.toolbar.turnInto"),icon:n.jsx($.IconArrowsRightLeft,{style:{width:u.rem(14),height:u.rem(14)}})})})})]}),(i==="text"||j=="callout-wrapper")&&n.jsxs(n.Fragment,{children:[n.jsx(u.Menu.Divider,{}),n.jsx(Pe.NewColorPicker,{data:{callout:{label:s("editor.colors.theme"),filled:!0,palette:ee.calloutData.map(x=>({label:s(`editor.colors.callout.${x.name}`),value:u.alpha(x.color,.19),icon:x.icon,meta:{type:x.name,emoji:x.emoji}}))}},modes:j==="callout-wrapper"?["callout","background"]:["color","background"],value:{color:A,background:p,callout:p},onChange:x=>{P(x),t(),T.resetSelection(e)},hideInherit:!0,target:n.jsx("div",{children:n.jsx(V.CustomMenuItem,{label:s(j==="callout-wrapper"?"editor.contextMenu.appearance":"editor.toolbar.color"),icon:n.jsx($.IconPaint,{size:14})})}),menuProps:{trigger:"hover",position:"right-start",offset:{mainAxis:0,alignmentAxis:0}}})]}),j==="layout"&&n.jsxs(n.Fragment,{children:[n.jsx(u.Menu.Divider,{}),n.jsx(Pe.NewColorPicker,{modes:["background"],value:{background:N},onChange:x=>{P(x,"layout-color"),t(),T.resetSelection(e)},hideInherit:!0,target:n.jsx("div",{children:n.jsx(V.CustomMenuItem,{label:s("editor.column.changeColor"),icon:n.jsx($.IconPaint,{size:14})})}),menuProps:{trigger:"hover",position:"right-start",offset:{mainAxis:0,alignmentAxis:0}}}),n.jsx(u.Menu.Item,{disabled:a,onClick:()=>{Fe(e,o,"left")},leftSection:n.jsx($.IconColumnInsertLeft,{style:{width:u.rem(14),height:u.rem(14)}}),children:s("editor.column.addLeft")}),n.jsx(u.Menu.Item,{disabled:a,onClick:()=>{Fe(e,o,"right")},leftSection:n.jsx($.IconColumnInsertRight,{style:{width:u.rem(14),height:u.rem(14)}}),children:s("editor.column.addRight")}),n.jsx(u.Menu.Item,{disabled:r.left,onClick:()=>{qe(e,o,"left"),T.resetSelection(e)},leftSection:n.jsx($.IconColumnInsertRight,{style:{width:u.rem(14),height:u.rem(14)}}),children:s("editor.column.moveLeft")}),n.jsx(u.Menu.Item,{disabled:r.right,onClick:()=>{qe(e,o,"right"),T.resetSelection(e)},leftSection:n.jsx($.IconColumnInsertRight,{style:{width:u.rem(14),height:u.rem(14)}}),children:s("editor.column.moveRight")}),n.jsx(u.Menu.Item,{onClick:()=>B("layout"),leftSection:n.jsx($.IconTrash,{style:{width:u.rem(14),height:u.rem(14)}}),children:s("editor.column.deleteColumn")})]})]})};function It(e){if(!e)return window;let t=e;for(;t;){if(t===document.body||t===document.documentElement)return window;const i=getComputedStyle(t).overflowY;if((i==="auto"||i==="scroll"||i==="overlay")&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return window}function jt(e,t){let o=150;const{clientY:i}=e;if(t===window){const s=window.innerHeight;i<o?window.scrollBy(0,Math.max(-15,(i-o)/15)):i>s-o&&window.scrollBy(0,Math.min(15,(i-(s-o))/15))}else{o=100;const s=t.getBoundingClientRect();i<s.top+o?t.scrollTop-=5:i>s.bottom-o&&(t.scrollTop+=5)}}const $t=lt.lodashExports.throttle((e,t)=>{e.preventDefault(),jt(e,t)},16);let ve=null;function kt(e){return e?e.classList.contains("dsd__theme__table-scrollable-wrapper")?e.firstElementChild:e:null}function vt(e,t,o){const i=l.useRef(null),s=l.useRef(null),a=l.useRef(!1),r=l.useRef(!1),d=l.useRef({htmlElement:null,lexicalNode:null,isBottom:!1}),f=l.useRef(null),[p,m]=l.useState(null),{disable:N}=l.useContext(Ce.Context),[g,A]=l.useState(!1),[_,j]=l.useState({opened:!1}),[L,F]=l.useState(""),[M,v]=l.useState(null),[P,B]=l.useState(!1),[x,S]=l.useState({left:!1,right:!1}),[k,O]=l.useState(null),{t:R}=Ee.useTranslation(),U=ee.useDebounce(y=>{const h=y.target;r.current||T.isHTMLElement(h)&&(Ct(h)||e.read(()=>{var X;const w=h.className.includes("content-editable-wrapper"),G=w?c.$getRoot():c.$getNearestNodeFromDOMNode(h),{htmlElement:W,lexicalNode:D}=T.$getBlockNode(G,e,{root:!0,"layout-container":!0,"layout-item":!0,callout:!0,"collapsible-content":!0},y);if((D==null?void 0:D.__type)==="callout"||(D==null?void 0:D.__type)==="callout-image"||((X=D==null?void 0:D.getParent())==null?void 0:X.__type)==="callout"&&(D==null?void 0:D.getPreviousSibling())===null){m(null);return}if(!(w&&D instanceof C.LayoutDividerNode||w&&!D)&&D!=null&&D.__key){if(D.__type==="layout-container"||D.__type==="layout-item"||D.__type==="collapsible-content"){m(null);return}W&&(d.current.htmlElement=W,d.current.lexicalNode=D),(D==null?void 0:D.__type)==="collapsible-title"&&(d.current.htmlElement=(W==null?void 0:W.parentElement)||W,d.current.lexicalNode=D.getParent()),v(null),m(d.current.htmlElement)}}))},20,50);l.useEffect(()=>()=>{ve=null},[]),l.useEffect(()=>{function y(){r.current||m(null)}function h(G){if(!a.current)return!1;const[W]=xe.eventFiles(G);if(W)return!1;const{target:D,dataTransfer:X}=G,te=(X==null?void 0:X.getData(ze))||"";e.update(()=>{var ge;let b=c.$getNodeByKey(te);if(!b||!(T.isHTMLElement(D)||D.closest(".resizable-container")))return!1;const{htmlElement:H,lexicalNode:ie,isBottom:K}=d.current;let z=ie,pe=null;if(z!=null&&z.__key&&(pe=H),!pe||!z)return!1;if(z===b)return!0;if(s.current&&mt(s.current,e,z,b))return!1;if(b.__type==="layout-divider"){if(b=b.getParent(),ie&&(b!=null&&b.isParentOf(ie)))return!1;et(e,b)}if(b.getParent()instanceof C.LayoutItemNode&&((ge=b.getParent())==null?void 0:ge.getChildren().length)===2){const he=b.getParent(),Te=he.getParent();T.removeNodeKeepContent(e,he,Te)}if(H!=null&&H.classList.contains("selected-block"))return;let be;const re=e._rootElement;K?be=Array.from(re.querySelectorAll(".selected-block")).reverse():be=Array.from(re.querySelectorAll(".selected-block")),be.length?be.forEach(he=>{let Te=c.$getNearestNodeFromDOMNode(he);K?z==null||z.insertAfter(Te):z==null||z.insertBefore(Te)}):K?z.insertAfter(b):z.insertBefore(b),m(null)})}function w(G){const{target:W}=G;T.isHTMLElement(W)&&W.className==="ContentEditable__root"&&Ge(s.current)}return t==null||t.addEventListener("mousemove",U),t==null||t.addEventListener("drop",h),t==null||t.addEventListener("mouseleave",y),t==null||t.addEventListener("dragleave",w),()=>{t==null||t.removeEventListener("mousemove",U),t==null||t.addEventListener("drop",h),t==null||t.removeEventListener("mouseleave",y),t==null||t.removeEventListener("dragleave",w)}},[t,e]),l.useEffect(()=>{if(i.current){if(r.current||_.opened)return;Ue(p,i.current,t,_.opened)}},[t,p,r.current,_.opened]),l.useEffect(()=>{function y(h){var K,z;const{clientY:w,target:G,pageX:W}=h;if(!a.current)return!1;const[D]=xe.eventFiles(h);if(D||!T.isHTMLElement(G))return!1;const X=c.$getNearestNodeFromDOMNode(G)||c.$getRoot(),{htmlElement:te,lexicalNode:b}=T.$getBlockNode(X,e,{root:!0,"layout-container":!0,"layout-item":!0,"callout-wrapper":!0,callout:!0,"collapsible-content":!0,"collapsible-container":!0},h);if(h.preventDefault(),(b==null?void 0:b.__type)==="callout"||(b==null?void 0:b.__type)==="collapsible-content"||tt(f.current,b==null?void 0:b.getParent())||(b==null?void 0:b.__type)==="layout-item"&&X.__type!=="root")return!1;te&&(d.current.htmlElement=te,d.current.lexicalNode=b);let H=null;H=d.current.htmlElement||te,H!=null&&H.closest(".dsd__theme__layoutContainer")&&X.__type==="root"&&b&&((b==null?void 0:b.__type)==="layout-item"&&X.__type==="root"?(H=H==null?void 0:H.parentElement,d.current.htmlElement=H,d.current.lexicalNode=b==null?void 0:b.getParent()):(H=(K=H.parentElement)==null?void 0:K.parentElement,d.current.htmlElement=H,d.current.lexicalNode=(z=b.getParent())==null?void 0:z.getParent()));const ie=s.current;return!H&&ie?(ie.style.background="transparent",!1):H===null||ie===null||H!=null&&H.classList.contains("selected-block")?!1:(bt(ie,H,w,W,t,h,d),!0)}return de.mergeRegister(e.registerCommand(T.ON_CHANGE_COMMAND,h=>h==="hide_menu"?(ht(i.current),setTimeout(()=>{r.current=!0},0),!1):h==="show_menu"?(r.current=!1,!1):(h===!0&&!r.current&&m(null),r.current=!1,!1),c.COMMAND_PRIORITY_LOW),e.registerCommand(T.RIGHT_CLICK_COMMAND,h=>((h==null?void 0:h.target)instanceof HTMLElement&&i.current instanceof HTMLElement&&(Z(h),Ue(h.target,i.current,t,_.opened)),!1),c.COMMAND_PRIORITY_LOW),e.registerCommand(c.DRAGOVER_COMMAND,h=>(ve||(ve=It(h.target)),$t(h,ve),y(h)),c.COMMAND_PRIORITY_LOW),e.registerCommand(c.KEY_ARROW_DOWN_COMMAND,()=>(e.dispatchCommand(T.ON_CHANGE_COMMAND,!0),!1),c.COMMAND_PRIORITY_LOW),e.registerCommand(c.KEY_ARROW_UP_COMMAND,()=>(e.dispatchCommand(T.ON_CHANGE_COMMAND,!0),!1),c.COMMAND_PRIORITY_LOW))},[t,e]);function ae(y){var D;const h=y.dataTransfer;(D=s.current)==null||D.setAttribute("data-index-start","");const w=p||d.current.htmlElement;if(!h||!w)return;const G=e._rootElement;if(w!=null&&w.classList.contains("selected-block")){const X=e._rootElement,te=Array.from(X.querySelectorAll(".selected-block"));yt(y.dataTransfer,te)}else ee.$removeSelectedHTMLElements(G),w.className.includes("_layoutDivider")&&w.parentElement?Ye(h,w.parentElement):Ye(h,w);let W="";e.read(()=>{var te,b;const X=c.$getNearestNodeFromDOMNode(w);if(X&&(W=X.getKey()),X instanceof C.LayoutDividerNode){const H=Ie((te=w.parentElement)==null?void 0:te.parentElement,w.parentElement);(b=s.current)==null||b.setAttribute("data-index-start",H.toString())}}),i.current&&(A(!0),i.current.style.opacity="0"),a.current=!0,f.current=W,h.setData(ze,W)}function Y(){a.current=!1,Ge(s.current),A(!1)}if(N)return n.jsx("div",{});function E(){var w;const y=d.current.htmlElement,h=(w=y==null?void 0:y.parentElement)==null?void 0:w.parentElement;if(h!=null&&h.classList.contains("dsd__theme__layoutContainer")&&(h.children.length===4?B(!0):B(!1),y!=null&&y.parentElement)){const G=Ie(h,y==null?void 0:y.parentElement);G?G===h.children.length-1?S({left:!1,right:!0}):S({left:!1,right:!1}):S({left:!0,right:!1})}}function Z(y){r.current=!0;const h=kt((y==null?void 0:y.target)??d.current.htmlElement);if(!h)return;const w=e._rootElement;E(),h.classList.contains("selected-block")||ee.$removeSelectedHTMLElements(w),e.update(()=>{const W=c.$getSelection(),X=((W==null?void 0:W.getNodes())??[]).filter(K=>!c.$isTextNode(K)&&!C.$isListNode(K)&&K.__parent==="root"),te=X.map(K=>{const z=e.getElementByKey(K.getKey());return K.getType()==="table"?z==null?void 0:z.firstElementChild:z}).filter(K=>K!==null),b=X.length&&te.includes(h)?te:[h];if(b.length===1){const K=c.$getNearestNodeFromDOMNode(h);if(!K)return;K.selectStart(),O(K)}else O(null);b.forEach(K=>{ee.$getSelectedHTMLElements(e,{block:K,isCreateEventListener:!1})});const H=Array.from(document.querySelectorAll(".selected-block")).reduce((K,z)=>{const pe=c.$getNearestNodeFromDOMNode(z);return pe&&K.push(pe),K},[]),ie=H.length>0&&H.every(K=>C.$isCalloutWrapperNode(K)||C.$isTableNode(K)||ee.$isCollapsibleContainerNode(K)?!1:c.$isElementNode(K)||c.$isTextNode(K));F(ie?"text":"block")}),T.blockScroll();const G=Number(y==null?void 0:y.y)+240>window.innerHeight?Number(y==null?void 0:y.y)-200:y==null?void 0:y.y;j({opened:!0,x:(y==null?void 0:y.x)??0,y:G??0}),e.dispatchCommand(T.ON_OPEN_KEBAB_MENU,!0)}const oe=()=>{e.update(()=>{const y=T.getCurrentElement();if(r.current=!1,j(h=>({opened:!1,x:h.x,y:h.y})),(y==null?void 0:y.__key)==="root"){const h=c.$createParagraphNode();y.append(h)}})},ce=o?"hide-add-button":"",me=_.x!==0?{position:"fixed",top:0,left:0,transform:`translate(${_.x}px, ${_.y}px)`}:{},_e=()=>{oe(),T.unblockScroll(),ee.onSelectEnd(e),ee.$removeSelectedHTMLElements(e._rootElement)},je=(y=!1)=>{y?e.update(()=>{const h=c.$getSelection();let w=null;c.$isRangeSelection(h)&&(w=h.anchor.getNode().getParent()),_e(),setTimeout(()=>{e.update(()=>{w==null||w.selectEnd()})},100)}):_e()},ye=l.useCallback(y=>{const h=document.querySelector(".draggable-menu");if(!_&&y.button!==2)return;const w=y.target;if(w.closest(".mantine-Menu-dropdown"))return;!((h==null?void 0:h.contains(w))&&w.closest("div.custom-menu-item"))&&y.button!==2&&_.opened&&(y.stopPropagation(),y.preventDefault())},[e,_]);return l.useEffect(()=>(_.opened?document.addEventListener("mousedown",ye):document.removeEventListener("mousedown",ye),()=>{document.removeEventListener("mousedown",ye)}),[_.opened,ye]),Be.createPortal(n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:`draggable-block-container ${ce} ${p?"visible":""}`,ref:i,onMouseEnter:()=>{var y;_||v("both"),(y=i.current)!=null&&y.style&&(i.current.style.opacity="1")},onMouseLeave:()=>{v(null)},children:[n.jsx(Mt,{hoveredButton:M,insertNewParagraph:We,currentDraggableBlockRef:d,setHoveredButton:v,isClickedBlockRef:r,setDraggableBlockElem:m,editor:e,t:R}),n.jsxs(u.Menu,{onOpen:Z,opened:_.opened,styles:{dropdown:me},position:"left-start",width:320,shadow:"md",withinPortal:!0,onClose:()=>{je()},transitionProps:C.animationMenu,children:[n.jsx(u.Menu.Target,{children:n.jsx("div",{className:"icon draggable-block-menu",draggable:!0,onDragStart:ae,onDragEnd:Y,children:n.jsx(u.Tooltip,{openDelay:300,multiline:!0,disabled:g||r.current,label:n.jsxs(n.Fragment,{children:[n.jsxs("span",{children:[n.jsx("strong",{children:R("editor.hoverOptions.drag")}),","," ",R("editor.hoverOptions.dragAction")]}),n.jsx("br",{}),n.jsxs("span",{children:[n.jsx("strong",{children:R("editor.hoverOptions.click")}),","," ",R("editor.hoverOptions.clickAction")]})]}),position:"bottom-start",children:n.jsx(u.ActionIcon,{radius:"sm",color:"gray",size:"sm",variant:"subtle","aria-label":"Settings",children:n.jsx($.IconGripVertical,{size:20})})})})}),n.jsx(Tt,{hoveredButton:M,insertNewParagraph:We,currentDraggableBlockRef:d,setHoveredButton:v,isClickedBlockRef:r,setDraggableBlockElem:m,editor:e,t:R}),n.jsx(u.Menu.Dropdown,{className:"draggable-menu",children:n.jsx(St,{onChange:()=>{je(!0),T.resetSelection(e)},t:R,textBlock:L,currentEditorNode:k,editor:e,isDisabledAddColumnButton:P,disabledMoveColumnButtons:x})})]})]}),n.jsx("div",{className:"draggable-block-target-line",ref:s})]}),t)}function At({anchorElem:e=document.body,isShowAddButton:t=!1}){const[o]=Oe.useLexicalComposerContext();return vt(o,e,t)}function Ot({editor:e,anchorElem:t,isLink:o,isBold:i,isItalic:s,isUnderline:a,isCode:r,isStrikethrough:d,isSubscript:f,isSuperscript:p,component:m,isText:N}){const g=l.useRef(null),A=l.useRef(!1),_=l.useRef(null),j=l.useCallback(()=>{e.dispatchCommand(T.ON_SHOW_LINK_POPUP,"create")},[e,o]);function L(){var M,v;g.current&&(A.current=!0,T.setFloatingElemPosition(((M=_.current)==null?void 0:M.rect)||null,g==null?void 0:g.current,t,(v=_.current)==null?void 0:v.isLink))}l.useEffect(()=>{const M=T.getNativeSelectedText();if(!N&&!(M!=null&&M.length)){let v=function(S){return S instanceof HTMLElement};const P=g.current,B=window.getSelection();let x=!1;B!=null&&B.anchorNode&&v(B.anchorNode)&&B.anchorNode.className==="toolbar"&&(x=!0),P&&!x&&(_.current={rect:null,floatingElem:P,anchorElem:t,isLink:o},T.setFloatingElemPosition(null,P,t,o),A.current=!1)}},[N,e]),l.useEffect(()=>{if(g!=null&&g.current)return document.addEventListener("mouseup",L),()=>{document.removeEventListener("mouseup",L)}},[g]),l.useEffect(()=>{e.registerCommand(c.KEY_DOWN_COMMAND,M=>{var v;return(M.metaKey||M.ctrlKey)&&M.code==="KeyA"?(M.preventDefault(),T.selectCurrentNode(e),T.getCurrentElement(!0)&&(T.isWholeNodeSelected()&&(g!=null&&g.current)?(T.setFloatingElemPosition(null,g==null?void 0:g.current,t,(v=_.current)==null?void 0:v.isLink),c.$selectAll(),ee.$getSelectedHTMLElements(e)):setTimeout(()=>{L()})),!0):!1},c.COMMAND_PRIORITY_LOW),e.registerCommand(T.ON_OPEN_KEBAB_MENU,()=>(setTimeout(()=>{var M;g!=null&&g.current&&T.setFloatingElemPosition(null,g==null?void 0:g.current,t,(M=_.current)==null?void 0:M.isLink)},100),!1),c.COMMAND_PRIORITY_LOW)},[e]);const F=l.useCallback(()=>{const M=c.$getSelection(),v=g.current,P=window.getSelection();if(v===null)return;const B=e.getRootElement();let x=!1;const S=T.getNativeSelectedText();if(S&&S.length>0&&(x=!0),M!==null&&P!==null&&!P.isCollapsed&&B!==null&&B.contains(P.anchorNode)&&x){const k=T.getDOMRangeRect(P,B);if(_.current={rect:k,floatingElem:v,anchorElem:t,isLink:o},c.$isRangeSelection(M)){const R=T.getSelectedNode(M).getParent(),U=R==null?void 0:R.getFormatType();A.current&&U&&g&&e.registerCommand(T.ON_OPEN_KEBAB_MENU,ae=>(ae||setTimeout(()=>{var Y,E;T.setFloatingElemPosition(((Y=_.current)==null?void 0:Y.rect)||null,v,t,(E=_.current)==null?void 0:E.isLink)},100),!1),c.COMMAND_PRIORITY_LOW)}}else _.current={rect:null,floatingElem:v,anchorElem:t,isLink:o}},[e,t,o]);return l.useEffect(()=>{const M=t.parentElement,v=()=>{e.getEditorState().read(()=>{F()})};return window.addEventListener("resize",v),M&&M.addEventListener("scroll",v),()=>{window.removeEventListener("resize",v),M&&M.removeEventListener("scroll",v)}},[e,F,t]),l.useEffect(()=>(e.getEditorState().read(()=>{F()}),de.mergeRegister(e.registerUpdateListener(({editorState:M})=>{M.read(()=>{F()})}),e.registerCommand(c.SELECTION_CHANGE_COMMAND,()=>(F(),!1),c.COMMAND_PRIORITY_LOW))),[e,F]),n.jsx("div",{ref:g,className:`floating-text-format-popup doc-space-editor-wrapper ${N?"":"floating-text-format-popup-hidden"}`,children:n.jsx("div",{children:e.isEditable()&&(m||n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",onClick:()=>{e.dispatchCommand(c.FORMAT_TEXT_COMMAND,"bold")},className:"popup-item spaced "+(i?"active":""),children:n.jsx(V.Icon,{name:"bold",stroke:i?3:2})}),n.jsx("button",{type:"button",onClick:()=>{e.dispatchCommand(c.FORMAT_TEXT_COMMAND,"italic")},className:"popup-item spaced "+(s?"active":""),children:n.jsx(V.Icon,{name:"italic",stroke:s?3:2})}),n.jsx("button",{type:"button",onClick:()=>{e.dispatchCommand(c.FORMAT_TEXT_COMMAND,"underline")},className:"popup-item spaced "+(a?"active":""),children:n.jsx(V.Icon,{name:"underline",stroke:a?3:2})}),n.jsx("button",{type:"button",onClick:()=>{e.dispatchCommand(c.FORMAT_TEXT_COMMAND,"strikethrough")},className:"popup-item spaced "+(d?"active":""),"data-test-id":"toolbar-strikethrough",children:n.jsx(V.Icon,{name:"strikethrough",stroke:d?3:2})}),n.jsx("button",{type:"button",onClick:()=>{e.dispatchCommand(c.FORMAT_TEXT_COMMAND,"subscript")},className:"popup-item spaced "+(f?"active":""),children:n.jsx(V.Icon,{name:"subscript",stroke:f?3:2})}),n.jsx("button",{type:"button",onClick:()=>{e.dispatchCommand(c.FORMAT_TEXT_COMMAND,"superscript")},className:"popup-item spaced "+(p?"active":""),children:n.jsx(V.Icon,{name:"superscript",stroke:p?3:2})}),n.jsx("button",{type:"button",onClick:()=>{e.dispatchCommand(c.FORMAT_TEXT_COMMAND,"code")},className:"popup-item spaced "+(r?"active":""),children:n.jsx(V.Icon,{name:"code"})}),n.jsx("button",{type:"button",onClick:j,className:"popup-item spaced "+(o?"active":""),children:n.jsx(V.Icon,{name:"link"})})]}))})})}function Dt(e,t,o){const[i,s]=l.useState(!1),[a,r]=l.useState(!1),[d,f]=l.useState(!1),[p,m]=l.useState(!1),[N,g]=l.useState(!1),[A,_]=l.useState(!1),[j,L]=l.useState(!1),[F,M]=l.useState(!1),[v,P]=l.useState(!1),B=T.allEditorSelected(),{disable:x}=l.useContext(Ce.Context),S=l.useCallback(()=>{e.getEditorState().read(()=>{var oe,ce,me;if(e.isComposing())return;const k=c.$getSelection(),O=window.getSelection(),R=e.getRootElement();if(O!==null&&(!c.$isRangeSelection(k)||R===null||!R.contains(O.anchorNode))){s(!1);return}if(!c.$isRangeSelection(k))return;const U=T.getSelectedNode(k);f(k.hasFormat("bold")),m(k.hasFormat("italic")),g(k.hasFormat("underline")),_(k.hasFormat("strikethrough")),L(k.hasFormat("subscript")),M(k.hasFormat("superscript")),P(k.hasFormat("code"));const ae=U.getParent();Me.$isLinkNode(ae)||Me.$isLinkNode(U)?r(!0):r(!1);const Y=rt.$isCodeHighlightNode(k.anchor.getNode()),E=(me=(ce=(oe=e.getElementByKey(U.__key))==null?void 0:oe.parentElement)==null?void 0:ce.parentElement)==null?void 0:me.classList.contains("Collapsible__title");!Y&&k.getTextContent()!==""&&!E?s(C.$isExtendedTextNode(U)||c.$isParagraphNode(U)||xe.$isHeadingNode(U)||xe.$isQuoteNode(U)||C.$isListItemNode(U)):s(!1);const Z=k.getTextContent().replace(/\n/g,"");if(!k.isCollapsed()&&Z===""){s(!1);return}})},[e]);return l.useEffect(()=>(document.addEventListener("selectionchange",S),()=>{document.removeEventListener("selectionchange",S)}),[S]),l.useEffect(()=>de.mergeRegister(e.registerUpdateListener(()=>{S()}),e.registerRootListener(()=>{e.getRootElement()===null&&s(!1)})),[e,S]),x?null:Be.createPortal(n.jsx(Ot,{editor:e,anchorElem:t,isLink:a,isBold:d,isItalic:p,isStrikethrough:A,isSubscript:j,isSuperscript:F,isUnderline:N,isCode:v,component:o,isText:i&&!B}),document.body)}function wt({anchorElem:e=document.body,component:t}){const[o]=Oe.useLexicalComposerContext();return Dt(o,e,t)}const Lt=(e,t,o,i)=>{e.update(()=>{if(c.$isRangeSelection(o)){const s=c.$createTextNode(t);o.insertNodes([s]),i()}})},Pt=(e,t,o,i)=>{e.update(()=>{if(c.$isRangeSelection(o)){const s=c.$createTextNode(t);o.insertNodes([]);const a=s.getParent()??o.focus.getNode().getParent();if(a){const r=o.focus.getNode().getNextSibling();r?r.insertBefore(s):a.append(s),i()}}})},Rt=(e,t="",o,i)=>{e.update(()=>{if(!c.$isRangeSelection(o))return;const a=o.anchor.getNode().getTopLevelElementOrThrow(),r=c.$createParagraphNode();t&&r.append(c.$createTextNode(t)),a.insertAfter(r),i()})},Ft=(e,t)=>{e.update(()=>{const o=c.$getSelection();if(c.$isRangeSelection(o)){const i=o.getTextContent();t(i)}})},Bt=({editor:e,response:t,onSubmit:o,setTypeMenu:i,onClose:s,t:a,selection:r})=>n.jsxs(n.Fragment,{children:[n.jsx(u.Menu.Item,{leftSection:n.jsx($.IconArrowNarrowLeft,{size:14}),onClick:()=>i("main"),children:a("editor.ai.back")}),n.jsx(u.Menu.Item,{onClick:()=>{Lt(e,t,r,s)},leftSection:n.jsx($.IconReplace,{size:14}),children:a("editor.ai.menu.answer.replaceSelection")}),n.jsx(u.Menu.Item,{onClick:()=>{Pt(e,` ${t}`,r,s)},leftSection:n.jsx($.IconTextPlus,{size:14}),children:a("editor.ai.menu.answer.addTextInline")}),n.jsx(u.Menu.Item,{onClick:()=>{Rt(e,t,r,s),s()},leftSection:n.jsx($.IconIndentIncrease,{size:14}),children:a("editor.ai.menu.answer.addBelowParagraph")}),n.jsx(u.Menu.Divider,{}),n.jsx(u.Menu.Label,{children:a("editor.ai.menu.answer.modifyFurther")}),n.jsx(u.Menu.Item,{onClick:()=>{o(`Start with this text and continue. Output this text at the start: "${t}"`,!1)},leftSection:n.jsx($.IconPlayerPlay,{size:14}),children:a("editor.ai.menu.answer.continueWriting")}),n.jsx(u.Menu.Item,{onClick:()=>{o("Regenerate this text with another way: ")},leftSection:n.jsx($.IconReload,{size:14}),children:a("editor.ai.menu.answer.regenerate")}),n.jsx(u.Menu.Item,{onClick:s,leftSection:n.jsx($.IconTrash,{size:14}),children:a("editor.ai.menu.answer.discard")})]}),Et=["arabic","bengali","chinese","dutch","english","french","german","hindi","japanese","korean","nepali","portuguese","spanish"],Ht=["professional","straightforward","friendly","poetic","passiveAggressive","pirate"],Kt=[{title:"modifySelection",options:[{title:"improveWriting",prompt:"Improve the quality of the text",icon:n.jsx($.IconWand,{size:14})},{title:"fixMistakes",prompt:"Fix any typos or general errors in the text",icon:n.jsx($.IconTextSpellcheck,{size:14})},{title:"simplify",prompt:"Shorten the text, simplifying it",icon:n.jsx($.IconSortAscending,{size:14})},{title:"addMoreDetail",prompt:"Lengthen the text, going into more detail",icon:n.jsx($.IconSortDescending,{size:14})}]},{title:"generate",options:[{title:"summarise",prompt:"Summarise the text",icon:n.jsx($.IconNotes,{size:14})},{title:"translate",icon:n.jsx($.IconLanguage,{size:14}),type:"language"},{title:"changeStyle",icon:n.jsx($.IconScript,{size:14}),type:"style"},{title:"explain",prompt:"Explain what the text is about",icon:n.jsx($.IconHelpOctagon,{size:14})}]}],zt=({setTypeMenu:e,onSubmit:t,t:o})=>n.jsxs(n.Fragment,{children:[n.jsx(u.Menu.Item,{leftSection:n.jsx($.IconArrowNarrowLeft,{size:14}),onClick:()=>e("main"),children:o("editor.ai.back")}),Et.map(i=>n.jsx(u.Menu.Item,{onClick:()=>{t(`Translate text into the ${i} language`)},children:o(`editor.ai.menu.languages.${i}`)},i))]}),qt=({setTypeMenu:e,onSubmit:t,t:o})=>n.jsx(n.Fragment,{children:Kt.map(i=>n.jsxs("div",{children:[n.jsx(u.Menu.Label,{children:o(`editor.ai.menu.main.${i.title}`)}),i.options.map(s=>n.jsx(u.Menu.Item,{onClick:()=>{if(s.type){e(s.type);return}t(s.prompt||"")},leftSection:s.icon,children:o(`editor.ai.menu.main.${s.title}`)},s.title))]},i.title))}),Wt=({setTypeMenu:e,onSubmit:t,t:o})=>n.jsxs(n.Fragment,{children:[n.jsx(u.Menu.Item,{leftSection:n.jsx($.IconArrowNarrowLeft,{size:14}),onClick:()=>e("main"),children:o("editor.ai.back")}),Ht.map(i=>n.jsx(u.Menu.Item,{onClick:()=>{t(`Change text into ${i} style`)},children:o(`editor.ai.menu.style.${i}`)},i))]}),Ut=({keyType:e,setTypeMenu:t,editor:o,onSubmit:i,response:s,onClose:a,t:r,selection:d})=>{switch(e){case"main":return n.jsx(qt,{t:r,setTypeMenu:t,onSubmit:i});case"answer":return n.jsx(Bt,{t:r,onSubmit:i,editor:o,response:s,setTypeMenu:t,onClose:a,selection:d});case"language":return n.jsx(zt,{t:r,onSubmit:i,setTypeMenu:t});case"style":return n.jsx(Wt,{t:r,onSubmit:i,setTypeMenu:t});default:return null}};function Yt(e,t=40){const[o,i]=l.useState(""),s=l.useRef(0),a=l.useRef(null),r=l.useRef(null);return l.useEffect(()=>{if(a.current&&clearInterval(a.current),i(""),s.current=0,!!e)return a.current=setInterval(()=>{i(d=>{const f=e[s.current];return s.current+=1,s.current>=e.length&&clearInterval(a.current),d+(f||"")})},t),()=>{a.current&&clearInterval(a.current)}},[e,t]),l.useEffect(()=>{r.current&&(r.current.scrollTop=r.current.scrollHeight)},[o]),{displayedText:o,containerRef:r}}const Gt=()=>{var ae;const[e,t]=l.useState({top:"0px",bottom:"auto"}),[o,i]=l.useState(!1),[s,a]=l.useState(!1),[r]=Oe.useLexicalComposerContext(),[d,f]=l.useState("main"),[p,m]=l.useState(""),[N,g]=l.useState(""),[A,_]=l.useState(""),[j,L]=l.useState(null),[F,M]=l.useState(!1),{fetchPromptResult:v}=l.useContext(Ce.Context),{t:P}=Ee.useTranslation(),[B,x]=He.useResizeObserver(),S=()=>{i(!1),a(!1),_(""),f("main"),setTimeout(()=>{t({top:"0px",bottom:"auto"})},200)},k=He.useClickOutside(()=>{S()});l.useEffect(()=>{o?(Ft(r,g),document.documentElement.style.overflow="hidden",r.update(()=>{const Y=c.$getSelection();Y&&L(Y)})):(f("main"),document.documentElement.style.overflow="auto",_(""))},[o]);const{displayedText:O,containerRef:R}=Yt(A,10),U=(Y,E=!0)=>{const Z=Y+` "${E?N:""}"Only return the modified text. Do not include any explanations, introductions, or formatting.`;M(!0),v&&v(Z,oe=>{_(oe),M(!1),f("answer"),m("")},()=>{M(!1)})};return l.useEffect(()=>{var E,Z,oe;const{bottom:Y}=((E=B.current)==null?void 0:E.getBoundingClientRect())||{bottom:0};if(Y>window.innerHeight){const ce=(((oe=(Z=r._rootElement)==null?void 0:Z.getBoundingClientRect())==null?void 0:oe.bottom)||0)-window.innerHeight;t({...e,top:"auto",bottom:`${ce}px`})}},[x.height,o,B.current]),(ae=r._rootElement)!=null&&ae.parentElement?n.jsxs(n.Fragment,{children:[e.top?Be.createPortal(n.jsx(u.Transition,{mounted:!!o,transition:"scale-x",duration:300,timingFunction:"ease",children:Y=>n.jsx(u.Box,{ref:k,style:{position:"absolute",...e,...Y},className:"ai-editor-menu",children:n.jsxs(u.Menu,{opened:!!s,closeOnItemClick:!1,position:"bottom-start",zIndex:99,transitionProps:{transition:"fade",duration:300},styles:{dropdown:{overflow:"auto"}},offset:8,middlewares:{flip:!0,size:{apply({availableHeight:E,elements:Z}){requestAnimationFrame(()=>{Object.assign(Z.floating.style,{maxHeight:`${E>=425?425:E}px`})})}}},disabled:F,children:[n.jsx(u.Menu.Target,{children:n.jsxs(u.Paper,{withBorder:!0,ref:B,shadow:"lg",radius:"md",p:"0",px:"xs",children:[A&&n.jsxs(n.Fragment,{children:[n.jsxs(u.Group,{gap:3,align:"flex-start",style:{overflowY:"auto"},mah:120,ref:R,children:[n.jsx(u.Box,{style:{flex:1},w:"auto",py:"xs",children:O}),n.jsx(u.Box,{w:"auto",mt:"xs",children:n.jsx(u.CopyButton,{value:A,timeout:2e3,children:({copied:E,copy:Z})=>n.jsx(u.Tooltip,{label:E?"Copied":"Copy",withArrow:!0,position:"right",children:n.jsx(u.ActionIcon,{color:E?"teal":"gray",variant:"subtle",onClick:Z,children:E?n.jsx($.IconCheck,{size:16}):n.jsx($.IconCopy,{size:16})})})})})]}),n.jsx(u.Divider,{my:"0"})]}),n.jsx(u.Box,{children:n.jsx(u.Input,{size:"md",placeholder:P("editor.ai.placeholder"),rightSectionPointerEvents:"all",variant:"unstyled",value:p,onKeyDown:E=>{if(E.key==="Enter"){if(F)return;U(p)}},onChange:E=>{m(E.target.value)},rightSection:n.jsx(n.Fragment,{children:F?n.jsx(u.Loader,{color:"violet",size:"16",mr:"xs"}):n.jsx(u.ActionIcon,{color:"violet",disabled:!p,variant:"subtle",onClick:()=>{U(p)},children:n.jsx($.IconSparkles,{size:16})})})})})]})}),n.jsx(u.Menu.Dropdown,{className:"menu-dropdown-ai",onMouseDown:E=>{E.stopPropagation()},children:n.jsx(Ut,{keyType:d,setTypeMenu:f,editor:r,onSubmit:U,response:A,onClose:S,t:P,selection:j})})]})})}),r._rootElement.parentElement):null,n.jsxs("button",{disabled:!1,className:"toolbar-item spaced alignment","aria-label":"Formatting options for text alignment",type:"button",onClick:()=>{const Y=document.querySelector(".floating-text-format-popup");if(Y.style.opacity="0",Y.style.transform="translate(-10000px, -10000px)",Y!=null&&Y.style){const E=window.getSelection();if((E==null?void 0:E.rangeCount)===0)return null;if(E){const oe=E.getRangeAt(0).getBoundingClientRect(),ce=document.querySelector(".content-editable-wrapper"),me=ce.getBoundingClientRect(),_e=oe.top-me.top+ce.scrollTop+oe.height+"px";t({top:_e,bottom:"auto"}),setTimeout(()=>{i(!0)},0),setTimeout(()=>{a(!0)},100)}}},children:[n.jsx($.IconSparkles,{color:"#7950f2",size:18}),n.jsx($.IconAi,{size:21,color:"#7950f2"})]})]}):null},Xt=({editor:e,isEditable:t,t:o})=>{const{fetchUploadMedia:i,imperativeHandleRef:s}=l.useContext(Ce.Context),[a,r]=l.useState(!1);return i?n.jsx(Ke.ImagePicker,{popoverProps:{opened:a,position:"bottom",onChange:r},onUpload:d=>{var f,p;!i||!d.length||(r(!1),(f=s==null?void 0:s.current)!=null&&f.insertImages&&((p=s.current)==null||p.insertImages(d)))},onChange:d=>{e.dispatchCommand(Ke.INSERT_IMAGE_COMMAND,{altText:"",src:d}),r(!1)},children:n.jsx(u.Tooltip,{label:o("editor.image.add_photo"),children:n.jsx("button",{disabled:!t,type:"button",onClick:()=>r(d=>!d),className:"toolbar-item spaced",children:n.jsx(V.Icon,{name:"photo"})})})}):null},Vt={bullet:"Маркированный список",check:"Чек-лист",code:"Кодовый блок",h1:"Заголовок 1",h2:"Заголовок 2",h3:"Заголовок 3",h4:"Заголовок 4",h5:"Заголовок 5",h6:"Заголовок 6",number:"Нумерованный список",paragraph:"Параграф",quote:"Цитата"};function Ae(){return n.jsx("div",{className:"divider"})}function Qt({mode:e,isFloating:t}){const[o]=Oe.useLexicalComposerContext(),[i,s]=l.useState(o),[a,r]=l.useState("paragraph"),[d,f]=l.useState("root"),[p,m]=l.useState(null),[N,g]=l.useState("#000"),[A,_]=l.useState("#fff"),[j,L]=l.useState("left"),[F,M]=l.useState(!1),[v,P]=l.useState(!1),[B,x]=l.useState(!1),[S,k]=l.useState(!1),[O,R]=l.useState(!1),[U,ae]=l.useState(!1),[Y,E]=l.useState(!1),[Z,oe]=l.useState(!1),[ce,me]=l.useState(!1),[_e,je]=l.useState(!1),[ye]=C.useModal(),[y,h]=l.useState(!1),[w,G]=l.useState(!0),[W,D]=l.useState(!0),[X,te]=l.useState(0),[b,H]=l.useState(()=>o.isEditable()),ie=e||"default",{excludeNodes:K,fetchUploadMedia:z,fetchPromptResult:pe,commentOptions:be}=l.useContext(Ce.Context),{t:re}=Ee.useTranslation(),ge=l.useCallback(()=>{const I=c.$getSelection();if(c.$isRangeSelection(I)){const q=I.anchor.getNode(),se=I.focus.getNode(),ne=c.$isRootNode(q)?null:q.getTopLevelElementOrThrow(),fe=c.$isRootNode(se)?null:se.getTopLevelElementOrThrow();let Q=q.getKey()==="root"?q:de.$findMatchingParent(q,ue=>{const ke=ue.getParent();return ke!==null&&c.$isRootOrShadowRoot(ke)});I.getNodes().length===1?G(!0):G(!1),Q===null&&(Q=q.getTopLevelElementOrThrow());const J=Q.getKey(),$e=i.getElementByKey(J);o.update(()=>{P(I.hasFormat("bold")),x(I.hasFormat("italic")),k(I.hasFormat("underline")),R(I.hasFormat("strikethrough")),ae(I.hasFormat("subscript")),E(I.hasFormat("superscript")),oe(I.hasFormat("code"))});const le=T.getSelectedNode(I),Se=le.getParent();Me.$isLinkNode(Se)||Me.$isLinkNode(le)?M(!0):M(!1),g(Ne.$getSelectionStyleValueForProperty(I,"color","inherit")),_(Ne.$getSelectionStyleValueForProperty(I,"background-color","inherit"));let Le;Me.$isLinkNode(Se)&&(Le=de.$findMatchingParent(le,ue=>c.$isElementNode(ue)&&!ue.isInline())),L(c.$isElementNode(Le)?Le.getFormatType():c.$isElementNode(le)?le.getFormatType():(Se==null?void 0:Se.getFormatType())||"left");const it=de.$findMatchingParent(le,C.$isTableNode);if(C.$isTableNode(it)?f("table"):f("root"),$e!==null&&(ne==null?void 0:ne.getKey())===(fe==null?void 0:fe.getKey()))if(m(J),C.$isListNode(Q)){const ue=de.$getNearestNodeOfType(q,C.ListNode),ke=ue?ue.getListType():Q.getListType();r(ke)}else{const ue=xe.$isHeadingNode(Q)?Q.getTag():Q.getType();ue in Vt&&r(ue)}else r("")}},[i,G]);l.useEffect(()=>o.registerCommand(c.SELECTION_CHANGE_COMMAND,(I,q)=>(ge(),s(q),!1),c.COMMAND_PRIORITY_CRITICAL),[o,ge]),l.useEffect(()=>de.mergeRegister(o.registerEditableListener(I=>{H(I)}),i.registerUpdateListener(({editorState:I})=>{I.read(()=>{ge()})}),i.registerCommand(c.CAN_UNDO_COMMAND,I=>(me(I),!1),c.COMMAND_PRIORITY_CRITICAL),i.registerCommand(c.CAN_REDO_COMMAND,I=>(je(I),!1),c.COMMAND_PRIORITY_CRITICAL)),[ge,i,o]),l.useEffect(()=>de.mergeRegister(i.registerCommand(c.KEY_MODIFIER_COMMAND,I=>{const q=I,{code:se,metaKey:ne}=q;if(se==="KeyK"&&ne){q.preventDefault();let fe;return F?fe=null:fe=T.sanitizeUrl("https://"),i.dispatchCommand(Me.TOGGLE_LINK_COMMAND,fe)}return!1},c.COMMAND_PRIORITY_NORMAL),i.registerCommand(c.CLICK_COMMAND,()=>{const I=c.$getSelection();if(c.$isRangeSelection(I)){const q=I.getNodes(),se=q.length>0&&q.every(ne=>C.$isCalloutWrapperNode(ne)||C.$isTableNode(ne)||ee.$isCollapsibleContainerNode(ne)?!1:c.$isElementNode(ne)||c.$isTextNode(ne));D(!se)}return!1},c.COMMAND_PRIORITY_NORMAL)),[i,F]),l.useCallback((I,q)=>{i.update(()=>{const se=c.$getSelection();se!==null&&Ne.$patchStyleText(se,I)},q?{tag:"historic"}:{})},[i]);const he=l.useCallback(()=>{setTimeout(()=>{i.dispatchCommand(c.FORMAT_TEXT_COMMAND,"")}),i.update(()=>{const I=c.$getSelection();if(c.$isRangeSelection(I)){const q=I.anchor,se=I.focus,ne=I.getNodes(),fe=I.extract();if(q.key===se.key&&q.offset===se.offset)return;ne.forEach((Q,we)=>{if(C.$isExtendedTextNode(Q)){let J=Q;we===0&&q.offset!==0&&(J=J.splitText(q.offset)[1]||J),we===ne.length-1&&(J=J.splitText(se.offset)[0]||J);const $e=fe[0];ne.length===1&&C.$isExtendedTextNode($e)&&(J=$e),J.__style!==""&&J.setStyle(""),J.__format!==0&&J.setFormat(0);const le=de.$getNearestBlockElementAncestorOrThrow(J);le.__format!==0&&le.setFormat(""),le.__indent!==0&&le.setIndent(0),Q=J}else xe.$isHeadingNode(Q)||xe.$isQuoteNode(Q)?Q.replace(c.$createParagraphNode(),!0):at.$isDecoratorBlockNode(Q)&&Q.setFormat("")})}})},[i]),Te=I=>{g(I.color),_(I["background-color"]),i.update(()=>{const q=c.$getSelection();q!==null&&Ne.$patchStyleText(q,I)})},ot=l.useCallback(()=>{o.dispatchCommand(T.ON_SHOW_LINK_POPUP,"create"),setTimeout(()=>{H(!0)},1e3)},[o]),st=()=>{o.dispatchCommand(Ce.INSERT_INLINE_COMMAND,void 0),te(I=>I+1)};return n.jsx("div",{className:"toolbar-wrapper",tabIndex:-1,children:n.jsxs("div",{className:"toolbar",children:[n.jsxs(n.Fragment,{children:[n.jsx(ee.BlockFormatMenu,{disabled:W,blockType:a,rootType:d,editor:o,mode:ie,fetchUploadMedia:z,excludeNodes:K}),n.jsx(Ae,{})]}),e==="editor"&&!0&&pe&&n.jsxs(n.Fragment,{children:[n.jsx(l.Suspense,{fallback:null,children:n.jsx(Gt,{})}),n.jsx(Ae,{})]}),n.jsxs(n.Fragment,{children:[n.jsx(u.Tooltip,{label:re("editor.toolbar.bold"),children:n.jsx("button",{disabled:!b,onClick:()=>{i.dispatchCommand(c.FORMAT_TEXT_COMMAND,"bold")},className:"toolbar-item spaced "+(v?"active":""),type:"button","data-test-id":"toolbar-bold",children:n.jsx(V.Icon,{name:"bold"})})}),n.jsx(u.Tooltip,{label:re("editor.toolbar.italic"),children:n.jsx("button",{disabled:!b,onClick:()=>{i.dispatchCommand(c.FORMAT_TEXT_COMMAND,"italic")},className:"toolbar-item spaced "+(B?"active":""),type:"button","data-test-id":"toolbar-italic",children:n.jsx(V.Icon,{name:"italic"})})}),n.jsx(u.Tooltip,{label:re("editor.toolbar.underline"),children:n.jsx("button",{disabled:!b,"data-test-id":"toolbar-underline",onClick:()=>{i.dispatchCommand(c.FORMAT_TEXT_COMMAND,"underline")},className:"toolbar-item spaced "+(S?"active":""),type:"button",children:n.jsx(V.Icon,{name:"underline"})})}),n.jsx(u.Tooltip,{label:re("editor.toolbar.strike"),children:n.jsx("button",{disabled:!b,className:"toolbar-item spaced "+(O?"active":""),"data-test-id":"toolbar-strikethrough",onClick:()=>{i.dispatchCommand(c.FORMAT_TEXT_COMMAND,"strikethrough")},children:n.jsx(V.Icon,{name:"strikethrough"})})}),n.jsx(u.Tooltip,{label:re("editor.toolbar.code"),children:n.jsx("button",{disabled:!b,onClick:()=>{i.dispatchCommand(c.FORMAT_TEXT_COMMAND,"code")},className:"toolbar-item spaced "+(Z?"active":""),type:"button","data-test-id":"toolbar-code",children:n.jsx(V.Icon,{name:"code"})})}),n.jsx(u.Tooltip,{label:re("editor.toolbar.clear"),children:n.jsx("button",{disabled:!b,className:"toolbar-item",onClick:he,"data-test-id":"toolbar-clear-format",children:n.jsx(V.Icon,{name:"сlear-format"})})}),n.jsx(u.Tooltip,{disabled:!b,label:re("editor.toolbar.link"),children:n.jsx("button",{onClick:ot,className:"toolbar-item spaced "+(F?"active":""),onMouseDown:()=>{H(!1)},type:"button","data-test-id":"toolbar-link",children:n.jsx(V.Icon,{name:"link"})})}),be&&e==="editor"&&n.jsx(u.Tooltip,{label:re("editor.toolbar.comment"),children:n.jsx("button",{onClick:st,className:"toolbar-item spaced "+(F?"active":""),type:"button","data-test-id":"toolbar-comment",children:n.jsx(V.Icon,{name:"message"})})},X),n.jsx(Pe.NewColorPicker,{value:{color:N,background:A},menuProps:{closeOnItemClick:!0},onChange:I=>{Te({color:N,"background-color":A,[I.mode==="color"?"color":"background-color"]:I.value})},disabled:!b,modes:["color","background"]})]}),n.jsx(Ae,{}),n.jsx(V.AlignMenu,{disabled:!b,value:j,editor:o,isRTL:y,setElementFormat:L}),e==="default"&&n.jsxs(n.Fragment,{children:[n.jsx(Ae,{}),n.jsx(Xt,{editor:o,t:re,isEditable:b})]}),ye]})})}exports.DraggableBlockPlugin=At;exports.FloatingTextFormatToolbarPlugin=wt;exports.ToolbarPlugin=Qt;exports.getTemplateColumns=De;exports.maxWidthPercent=Ze;exports.setTemplateColumnsAfterDelete=et;