smart-webcomponents-angular
Version:
[](https://jqwidgets.com/license/)
6 lines (4 loc) • 319 kB
JavaScript
/* Smart UI v23.1.19 (2025-06-17)
Copyright (c) 2011-2024 jQWidgets.
License: https://htmlelements.com/license/ */ //
Smart("smart-editor",class extends Smart.ContentElement{static get properties(){return{ai:{type:"any",reflectToAttribute:!1,value:{model:{value:"gpt-3.5-turbo",type:"string"},limit:{value:10,type:"number"},maxTokens:{value:250,type:"number"},temperature:{value:.7,type:"number"},url:{value:"",type:"string"},key:{value:"",type:"string"}}},autoLoad:{value:!1,type:"boolean"},autoSave:{value:!1,type:"boolean"},autoFormatting:{value:!0,type:"boolean"},enablePages:{value:!1,type:"boolean"},pageIndex:{value:0,type:"number"},pages:{value:[],type:"array"},autoSaveInterval:{value:1e3,type:"number"},autoExpand:{value:!1,type:"boolean"},charCountFormatFunction:{value:null,type:"function?"},contentFiltering:{value:{attributes:{value:[],type:"array"},attributeFilterMode:{allowedValues:["blackList","whiteList"],value:"blackList",type:"string"},tags:{value:[],type:"array"},tagFilterMode:{allowedValues:["blackList","whiteList"],value:"blackList",type:"string"},styleAttributes:{value:[],type:"array"},styleAttributeFilterMode:{allowedValues:["blackList","whiteList"],value:"blackList",type:"string"}},type:"object"},content_css:{value:"",type:"string"},contextMenu:{allowedValues:["default","browser","none"],value:"default",type:"string"},contextMenuDataSource:{value:null,type:"any",reflectToAttribute:!1},dataExport:{value:{style:{value:null,type:"object"},fileName:{value:"smartEditor",type:"string?"},pageOrientation:{value:"portrait",type:"string"}},type:"object"},disableEditing:{value:!1,type:"boolean"},disableSearchBar:{value:!1,type:"boolean"},editMode:{allowedValues:["html","blockHtml","markdown"],value:"html",defaultReflectToAttribute:!0,type:"string"},sortable:{value:!1,type:"boolean"},addBlock:{defaultReflectToAttribute:!0,value:!1,type:"boolean"},enableHtmlEncode:{value:!1,type:"boolean"},enableTabKey:{value:!1,type:"boolean"},findAndReplaceTimeout:{value:50,type:"number"},hideToolbar:{value:!1,type:"boolean"},hideInlineToolbar:{value:!1,type:"boolean"},imageFormat:{allowedValues:["blob","base64"],value:"base64",type:"string"},imageName:{value:"userfile[]",type:"string"},innerHTML:{type:"string",validator:"_sanitize",reflectToAttribute:!1},inlineToolbarOffset:{value:[0,-5],type:"array"},iframeSettings:{value:{attributes:{value:null,type:"object?"},enabled:{value:!1,type:"boolean"},copyStyles:{value:!0,type:"boolean"},resources:{value:null,type:"object?"}},type:"object"},maxCharCount:{value:null,type:"number?"},messages:{extend:!0,value:{en:{invalidValue:"{{elementType}}: Invalid {{property}} value. {{property}} should be of type {{typeOne}} or {{typeTwo}}.",incorrectArgument:"{{elementType}}: Incorrect argument {{argumentName}} in method {{methodName}}.",permissionsRequired:"{{elementType}}: Permissions are required for the following action {{actionName}}.",timeout:"{{elementType}}: The import request has timed out.",importError:"{{elementType}}: The import request errored with the following status: {{status}}.",exportError:"{{elementType}}: The Export request errored with the following status: {{status}}.",ok:"Ok",cancel:"Cancel",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",alignJustify:"Align Justify",segoeUi:"Segoe UI",arial:"Arial",georgia:"Georgia",impact:"Impact",tahoma:"Tahoma",timesNewRoman:"Times New Roman",verdana:"Verdana",p:"Paragraph",pre:"Code",code:"Code",blockquote:"Quotation",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",orderedlist:"Ordered List",unorderedlist:"Unordered List",checklist:"Check List",subscript:"Subscript",superscript:"Superscript",alignment:"Alignments",fontname:"Font Name",fontsize:"Font Size",formats:"Formats",backgroundcolor:"Background Color",fontcolor:"Font Color",redo:"Redo",undo:"Undo",indent:"Indent",outdent:"Outdent",createlink:"Hyperlink",insertlink:"Insert a hyperlink",hyperlink:"Hyperlink",editlink:"Hyperlink",removelink:"Remove link",openlink:"Open link",image:"Image",video:"Video",table:"Table",lowercase:"Lower Case",uppercase:"Upper Case",print:" Print",cut:" Cut",copy:" Copy",paste:" Paste",clearformat:"Clear Format",fullscreen:"Full Screen",restore:"Restore Screen",sourcecode:"Source Code",preview:"Preview",splitmode:"Split Editor",address:"Web Address",text:"Display Text",addressPlaceholder:"https://example.com",textPlaceholder:"Enter Text",targetPlaceholder:"Select Target",titlePlaceholder:"Enter a Title",urlPlaceholder:"http://example.com/image.png",fileUrlPlaceholder:"http://example.com/file.pdf",srcPlaceholder:"https://www.youtube.com/embed/video_link",thumbnail:"Or provide a URL as a video thumbnail",thumbnailPlaceholder:"https://www.link-to-thumbnail.jpg",videoUrl:"Video URL",videoUrlPlaceholder:"https://www.youtube.com/video_link",captionPlaceholder:"Caption",altPlaceholder:"Alternative Text",widthPlaceholder:"auto",heightPlaceholder:"auto",target:"Open Link in",linkBlankDescr:"New Window",linkSelfDescr:"Same Window",linkParentDescr:"Parent Frame",linkTopDescr:"Full Body of the Window",linkCustomDescr:"Custom Frame Name",title:"Title",fileUrl:"Or provide the URL to a file",url:"Or provide the URL to an image",src:"Or provide the URL to an embed video",width:"Width",height:"Height",alt:"Alternative Text",caption:"Caption",display:"Display",displayPlaceholder:"Display",displayBlock:"Block",displayInline:"Inline",draggable:"Enable Dragging",resizable:"Enable Resizing",browse:"Browse",connectionError:"{{elementType}}: File Upload requires connection to the server.",wrongItemIndex:"{{elementType}}: There is no file with such an index in the list of uploaded files.",tooLongFileName:"{{elementType}}: File name is too long.",totalFiles:"Total files: ",cancelFile:"Cancel File",dashedborders:"Dashed Borders",altrows:"Alternate Rows",insertRowBefore:"Insert Row Before",insertRowAfter:"Insert Row After",deleteRow:"Delete Row",insertColumnLeft:"Insert Column Left",insertColumnRight:"Insert Column Right",deleteColumn:"Delete Column",alignTop:"Align Top",alignMiddle:"Align Middle",alignBottom:"Align Bottom",delete:"Delete",tablerows:"Table Rows",tablecolumns:"Table Columns",tablevalign:"Table Cell Vertical Align",tablestyle:"Table Style",tableheader:"Table Header",buttonLabel:"Custom Table",pasteLabel:"Choose the paste format action:",cols:"Columns",rows:"Rows",alphabet:"abcdefghijklmnopqrstuvwxyz",header:"Header",column:"Column",plainText:"Plain Text",keepFormat:"Keep Format",cleanFormat:"Clean Format",roleDescription:"Text Editor",iframeTitle:"Editor Content is Encloused in it's own DOM inside an iFrame",toolbarButtonAriaLabel:"Toolbar Toggle Button",primaryToolbarAriaLabel:"Primary Toolbar",secondaryToolbarAriaLabel:"Secondary Toolbar",inputAriaLabel:"Enter Text",homeTab:"Home",viewTab:"View",insertTab:"Insert",layoutTab:"Layout",undoGroup:"Undo",clipboardGroup:"Clipboard",fontGroup:"Font",paragraphGroup:"Paragraph",editingGroup:"Editing",tableGroup:"Tables",imageGroup:"Images",videoGroup:"Videos",linkGroup:"Links",viewsGroup:"Views",deleteGroup:"Delete",findandreplace:"Find and Replace",requiredMessage:"The content of the Editor cannot be empty",tableProperties:"Table Properties",imageProperties:"Image Properties",videoProperties:"Video Properties",linkProperties:"Link Properties",selectAll:"Select All",deleteTable:"Delete Table",deleteImage:"Delete Image",deleteVideo:"Delete Video",createLink:"Create Link",deleteLink:"Delete Link",copyImage:"Copy",cutImage:"Cut",copyVideo:"Copy",cutVideo:"Cut",find:"Find",findPlaceholder:"",replace:"Replace",replaceWith:"Replace With",replaceAll:"Replace All",replacePlaceholder:"",results:"Results",resultsPlaceholder:"No match",matchCase:"Match Case",searchPlaceholder:"Search...",newLinePlaceholder:"Write, press ' / ' for commands…",addButton:"Click to add below \nAlt+Click to add above",askQuestion:"Ask AI",file:"File",date:"Date",emoji:"Emoji",user:"User",bulletedList:"Bulleted list",numberedList:"Numbered list",toDoList:"To-do list",toggleList:"Toggle list",callout:"Callout",quote:"Quote",divider:"Divider",askQuestionToAI:"Ask a question to AI",insertAnImage:"Insert an image",insertAVideo:"Insert a video",insertAFile:"Insert a file",insertADate:"Insert a date",insertAnEmoji:"Insert an emoji",insertAUser:"Insert a user",justStartWritingWithPlainText:"Just start writing with plain text",bigSectionHeading:"Main Title",mediumSectionHeading:"Section Heading",smallSectionHeading:"Subsection Heading",verySmallSectionHeading:"Smaller Subsection",extraSmallSectionHeading:"Minor Heading",leastImportantHeading:"Least Important Heading",startABulletedList:"Start a bulleted list",startANumberedList:"Start a numbered list",startAToDoList:"Start a to-do list",togglesCanHideShowContent:"Toggles can hide/show content",makeWritingStandOut:"Make writing stand out",captureAQuote:"Capture a quote",insertATable:"Insert a table",breakUpYourWriting:"Break up your writing",noResults:"No Results",typeToFilter:"Type to filter...",editSelection:"Edit Selection",rewrite:"Rewrite",rewriteDescription:"Rewrite the selected text",continueWriting:"Continue writing",continueWritingDescription:"Extend the content further",fixSpellingGrammar:"Fix spelling & grammar",fixSpellingGrammarDescription:"Correct spelling and grammatical errors",summarize:"Summarize",summarizeDescription:"Generate a concise summary of the text",makeShorter:"Make shorter",makeShorterDescription:"Reduce the length of the text while maintaining meaning",makeLonger:"Make longer",makeLongerDescription:"Expand the text with more details",explain:"Explain",explainDescription:"Provide a clearer or more detailed explanation",changeTone:"Change Tone",concise:"Concise",conciseDescription:"Make the text more brief and to the point",professional:"Professional",professionalDescription:"Adjust the text to sound more formal and business-like",casual:"Casual",casualDescription:"Make the text sound more relaxed and friendly",funny:"Funny",funnyDescription:"Add humor or a lighthearted tone to the text",translate:"Translate",translateEnglish:"Translate to English",translateEnglishDescription:"Translate the text into English",translateSpanish:"Translate to Spanish",translateSpanishDescription:"Translate the text into Spanish",translatePortuguese:"Translate to Portuguese",translatePortugueseDescription:"Translate the text into Portuguese",translateItalian:"Translate to Italian",translateItalianDescription:"Translate the text into Italian",translateDutch:"Translate to Dutch",translateDutchDescription:"Translate the text into Dutch",translateChinese:"Translate to Chinese",translateChineseDescription:"Translate the text into Chinese",translateKorean:"Translate to Korean",translateKoreanDescription:"Translate the text into Korean",translateJapanese:"Translate to Japanese",translateJapaneseDescription:"Translate the text into Japanese",translateRussian:"Translate to Russian",translateRussianDescription:"Translate the text into Russian",processing:"Processing...",typePrompt:"Type your prompt here",keep:"Keep",insertBelow:"Insert below",page:"Link to a page",insertPage:"Organize ideas, tasks, and notes",task:"Task",insertTask:"Insert a task",twoColumns:"2 columns",threeColumns:"3 columns",fourColumns:"4 columns",twoColumnsDescription:"Create 2 of blocks",threeColumnsDescription:"Create 3 of blocks",fourColumnsDescription:"Create 4 of blocks",taskPlaceholder:"Enter Task Name"}}},name:{value:null,type:"string?"},pasteFormat:{allowedValues:["prompt","plainText","keepFormat","cleanFormat"],value:"keepFormat",type:"string"},postData:{value:null,type:"object"},placeholder:{value:"",type:"string"},removeStylesOnClearFormat:{value:!1,type:"boolean"},required:{value:!1,type:"boolean"},sanitized:{value:!1,type:"boolean"},showCharCount:{value:!1,type:"boolean"},compactImageDialog:{value:!1,type:"boolean"},imagePasteWidth:{value:0,type:"number"},imagePasteHeight:{value:0,type:"number"},splitModeRefreshTimeout:{value:100,type:"number"},toolbarItems:{value:["bold","italic","underline","|","formats","alignment","orderedList","unorderedList","|","hyperlink","image","video","|","sourceCode","undo","redo"],reflectToAttribute:!1,type:"array"},toolbarMode:{allowedValues:["menu","singleLineRibbon"],value:"menu",type:"string"},toolbarOnFocus:{value:!1,type:"boolean"},toolbarRibbonConfig:{value:[{name:"homeTab",groups:[{name:"undoGroup",items:["undo","redo"]},{name:"clipboardGroup",items:["cut","copy","paste"]},{name:"fontGroup",items:["fontName","fontSize","backgroundColor","fontColor","clearFormat","formats","bold","italic","underline","strikethrough","superscript","subscript"]},{name:"paragraphGroup",items:["orderedList","unorderedList","indent","outdent","alignment"]},{name:"editingGroup",items:["findAndReplace"]}]},{name:"insertTab",groups:[{name:"tableGroup",items:["table"]},{name:"imageGroup",items:["image"]},{name:"videoGroup",items:["video"]},{name:"linkGroup",items:["createLink","removeLink"]}]},{name:"viewTab",groups:[{name:"viewsGroup",items:["fullScreen","sourceCode","splitMode"]}]},{name:"layoutTab",hidden:!0,groups:[{name:"deleteGroup",items:["delete"]},{name:"tableGroup",items:["table","tableHeader","tableRows","tableColumns","tableVAlign","tableStyle",""]},{name:"imageGroup",items:["image","caption"]},{name:"videoGroup",items:["video","caption"]}]}],type:"array"},toolbarViewMode:{allowedValues:["toggle","multiRow","scroll"],value:"toggle",type:"string"},toolbarSticky:{value:!1,type:"boolean"},spellCheck:{value:!0,type:"boolean"},value:{value:"",type:"string",validator:"_sanitize",reflectToAttribute:!1},validateFile:{value:null,type:"function?",reflectToAttribute:!1},uploadUrl:{value:"",type:"string",reflectToAttribute:!1},removeUrl:{value:"",type:"string",reflectToAttribute:!1},onImageRemove:{value:null,type:"function?"},autoUpload:{value:!0,type:"boolean"},users:{value:[],type:"array",reflectToAttribute:!1},windowCustomizationFunction:{value:null,reflectToAttribute:!1,type:"function?"}}}static get listeners(){return{"document.down":"_documentDownHandler","document.move":"_documentMoveHandler","document.up":"_documentUpHandler","document.dragstart":"_dragStartHandler","document.selectstart":"_selectStartHandler","document.selectionchange":"_selectionChangeHandler","container.dragend":"_dragEndHandler","container.drop":"_dropHandler","container.change":"_changeHandler","container.beforeinput":"_beforeInputHandler","container.input":"_afterInputHandler","contentContainer.contextmenu":"_contextMenuHandler","contentContainer.keydown":"_editableElementKeyDownHandler","contentContainer.keyup":"_updateOnInputChange","contentContainer.paste":"_updateOnInputChange","input.focus":"_editableElementFocusHandler","input.blur":"_editableElementBlurHandler","input.change":"_inputChangeEvent","editableElement.focus":"_editableElementFocusHandler","editableElement.blur":"_editableElementBlurHandler","editableElement.wheel":"_editableElementWheelHandler","editableElement.move":"_editableElementMoveHandler","editableElement.mouseEnter":"_editableElementMouseEnterHandler",touchmove:"_touchmoveHandler",resize:"_resizeHandler",mouseleave:"_mouseLeaveHandler"}}static get requires(){return{"Smart.Button":"smart.button.js","Smart.Window":"smart.window.js","Smart.Tooltip":"smart.tooltip.js"}}static get styleUrls(){return["smart.editor.css"]}template(){return'<div id="container" role="presentation">\n <div id="toolbar" class="smart-editor-toolbar" role="presentation">\n <div id="toolbarItemsPrimary" class="smart-editor-toolbar-items-primary" role="toolbar"></div>\n <div id="toolbarToggleButton" class="smart-editor-toolbar-toggle-button" role="button"></div>\n <div id="toolbarItemsSecondary" class="smart-editor-toolbar-items-secondary" role="toolbar"></div>\n </div>\n <div id="contentContainer" class="smart-editor-content-container" role="presentation">\n <div class="smart-editor-editable" contenteditable="true" id="editableElement" aria-placeholder="[[placeholder]]"\n inner-h-t-m-l="[[innerHTML]]" role="textbox" aria-multiline="true"><content></content></div>\n <textarea name="[[name]]" id="input" class="smart-hidden" placeholder="[[placeholder]]" aria-placeholder="[[placeholder]]"\n spellcheck="[[spellCheck]]" autocapitalize="none" autocomplete="off"></textarea>\n <div class="smart-hidden smart-editor-tabs" id="tabs">\n </div>\n </div>\n </div>'}_editableElementMouseEnterHandler(){this._setSortable()}propertyChangedHandler(e,t,a){const o=this;switch(e){case"contentFiltering":case"contentFiltering_attributes":case"contentFiltering_attributeFilterMode":case"contentFiltering_tags":case"contentFiltering_tagFilterMode":case"contentFiltering_styleAttributes":case"contentFiltering_styleAttributeFilterMode":o._handleContentFiltering();break;case"disabled":case"disableEditing":o.$.input.readonly=a,o.$.editableElement.setAttribute("contenteditable",!a),"disabled"===e&&o._setFocusable();break;case"disableSearchBar":o._closeSearchToolbar();break;case"enableHtmlEncode":{const e=o.$.input;e.classList.contains("smart-hidden")||(e.value=o._getInputValue());break}case"hideToolbar":a&&o._updateToolbarItems(void 0,o.$.toolbar);break;case"sortable":o._setSortable();break;case"users":o._refreshTasks();break;case"innerHTML":case"value":if(""===a)a=" ";else{const e=e=>{let t=e.replace(/\\"/g,'"');return t=t.replace(/\\+/g,""),t=t.replace(/ /g," "),t=t.replace(/"\s*=/g,'="'),t};let t=(e=>{const t=document.createElement("textarea");return t.innerHTML=e,t.value})(a);t=e(t),a=t}if("blockHtml"===o.editMode){const e=o._createEditorBlock(!1,!1,a);o.innerHTML=o.value=a=e.outerHTML}o._handleInputContent(e,a),"blockHtml"===o.editMode?setTimeout((()=>{o._initEditorBlocks(),o._refreshEditorBlockPlaceholder(),o._editorBlocks=o.$.editableElement.querySelectorAll(".smart-editor-block"),o._setSortable(),o._renderPages(),o._refreshTasks()}),100):o._renderPages(),o.$.fireEvent("change",{oldValue:o._value||t,value:o._value=o._getCurrentValue()});break;case"editMode":o._handleEditMode(a);break;case"hideInlineToolbar":{const e=o.$.inlineToolbar;e&&e.visible&&e.classList.contains("smart-editor-inline-toolbar")&&e.close();break}case"toolbarViewMode":o._toggleToolbar("toggle"===a);break;case"pages":case"enablePages":o._renderPages();break;case"toolbarOnFocus":case"toolbarMode":case"toolbarRibbonConfig":o._handleToolbarMode();break;case"locale":delete o._toolbarItemsObj,delete o._inlineToolbarItemsObj,o._refreshToolbarItems(o._getToolbarItems()),o._closeToolbar(),o._closeWindow();break;case"iframeSettings":o._handleInputElement();break;case"maxCharCount":o._handleMaxCharCount(),o._setCharCount();break;case"name":a&&"markdown"!==o.editMode&&(o.$.input.value=o._getInputValue(o.$.editableElement.innerHTML.trim()));break;case"placeholder":o._handlePlaceholder();break;case"pasteFormat":o._closeWindow();break;case"readonly":o.$.input.readonly=a,o.$.editableElement.setAttribute("contenteditable","markdown"!==o.editMode&&!a),o._closePopups(),o._setResizeFrame(),o._closeWindow();break;case"showCharCount":o._setCharCount();break;case"rightToLeft":case"animation":case"theme":o._updateIframeBody();break;case"toolbarItems":o._handleToolbarItems();break;default:super.propertyChangedHandler(e,t,a)}}_mouseLeaveHandler(){const e=this;e.$.headerInsertLine&&(e.$.headerInsertLine.classList.remove("show"),e.$.headerSortable.classList.remove("show"))}addToolbarItem(e){const t=this;t.toolbarItems||(t.toolbarItems=[]),t.toolbarItems.push(e),t._handleToolbarItems()}insertToolbarItem(e,t){const a=this;a.toolbarItems||(a.toolbarItems=[]),a.toolbarItems.splice(t,0,e),a._handleToolbarItems()}removeToolbarItem(e){const t=this;t.toolbarItems||(t.toolbarItems=[]),t.toolbarItems.splice(e,1),t._handleToolbarItems()}_handleToolbarItems(){const e=this,t=e.$.toolbarItemsPrimary,a=e.$.toolbarItemsSecondary;if(t&&a&&(t.innerHTML=a.innerHTML="",delete e._toolbarItemsObj,delete e._inlineToolbarItemsObj,e._refreshToolbarItems(e._getToolbarItems()),"toggle"===e.toolbarViewMode)){const o=e.$.toolbarToggleButton;t.scrollHeight!==t.offsetHeight||a.children.length?o.classList.remove("smart-visibility-hidden"):o.classList.add("smart-visibility-hidden")}}_refreshSortableMenuItems(e){const t=e.querySelectorAll(".smart-editor-context-menu-item");t.forEach((e=>e.classList.remove("smart-hidden")));const a=document.createElement("div");a.classList.add("smart-editor-context-menu-item"),a.setAttribute("role","option"),a.innerHTML=this.localize("noResults"),a.classList.add("smart-hidden"),a.style.whiteSpace="nowrap",a.style.paddingLeft=a.style.paddingBottom=a.style.paddingTop="5px",a.style.paddingRight="7px",a.classList.add("empty-item");let o=!1;return t.forEach((e=>{e.classList.contains("empty-item")&&(o=!0)})),o||e.appendChild(a),[t,a]}_getSortableMenuItems(){const e=this,t=[{label:e.localize("askQuestion"),value:"ai",description:e.localize("askQuestionToAI")}],a=[{label:e.localize("image"),value:"image",description:e.localize("insertAnImage")},{label:e.localize("video"),value:"video",description:e.localize("insertAVideo")},{label:e.localize("file"),value:"file",description:e.localize("insertAFile")},{label:e.localize("date"),value:"date",description:e.localize("insertADate")},{label:e.localize("emoji"),value:"emoji",description:e.localize("insertAnEmoji")}];e.users&&e.users.length>0&&a.push({label:e.localize("user"),value:"user",description:e.localize("insertAUser")});const o=[{label:e.localize("text"),name:"text",value:"text",description:e.localize("justStartWritingWithPlainText")},{label:e.localize("h1"),name:"formats",value:"h1",description:e.localize("bigSectionHeading")},{label:e.localize("h2"),name:"formats",value:"h2",description:e.localize("mediumSectionHeading")},{label:e.localize("h3"),name:"formats",value:"h3",description:e.localize("smallSectionHeading")},{label:e.localize("h4"),name:"formats",value:"h4",description:e.localize("verySmallSectionHeading")},{label:e.localize("h5"),name:"formats",value:"h5",description:e.localize("extraSmallSectionHeading")},{label:e.localize("h6"),name:"formats",value:"h6",description:e.localize("leastImportantHeading")},{label:e.localize("bulletedList"),value:"unorderedlist",description:e.localize("startABulletedList")},{label:e.localize("numberedList"),value:"orderedlist",description:e.localize("startANumberedList")},{label:e.localize("toDoList"),value:"checklist",description:e.localize("startAToDoList")},{label:e.localize("toggleList"),value:"togglelist",description:e.localize("togglesCanHideShowContent")},{label:e.localize("callout"),value:"callout",description:e.localize("makeWritingStandOut")},{label:e.localize("quote"),name:"formats",value:"blockquote",description:e.localize("captureAQuote")},{label:e.localize("createLink"),name:"hyperlink",value:"hyperlink",description:e.localize("insertlink")},{label:e.localize("table"),value:"table",description:e.localize("insertATable")},{label:e.localize("divider"),value:"divider",description:e.localize("breakUpYourWriting")},{label:e.localize("task"),value:"task",description:e.localize("insertTask")}];if(e.enablePages){const t=[{label:e.localize("page"),value:"page",description:e.localize("insertPage")}];o.push(...t)}const i=[{label:e.localize("twoColumns"),value:"twoColumns",description:e.localize("twoColumnsDescription")}];return o.push(...i),e.ai.key&&o.push(...t),o.push(...a),o}_getAIMenuItems(){const e=this;return[{label:e.localize("editSelection","Edit Selection"),value:"category"},{label:e.localize("rewrite","Rewrite"),value:"rewrite",description:e.localize("rewriteDescription","Rewrite the selected text")},{label:e.localize("continueWriting","Continue writing"),value:"continue_writing",description:e.localize("continueWritingDescription","Extend the content further")},{label:e.localize("fixSpellingGrammar","Fix spelling & grammar"),value:"fix_spelling_grammar",description:e.localize("fixSpellingGrammarDescription","Correct spelling and grammatical errors")},{label:e.localize("summarize","Summarize"),value:"summarize",description:e.localize("summarizeDescription","Generate a concise summary of the text")},{label:e.localize("makeShorter","Make shorter"),value:"make_shorter",description:e.localize("makeShorterDescription","Reduce the length of the text while maintaining meaning")},{label:e.localize("makeLonger","Make longer"),value:"make_longer",description:e.localize("makeLongerDescription","Expand the text with more details")},{label:e.localize("explain","Explain"),value:"explain",description:e.localize("explainDescription","Provide a clearer or more detailed explanation")},{label:e.localize("changeTone","Change Tone"),value:"category"},{label:e.localize("concise","Concise"),value:"concise",description:e.localize("conciseDescription","Make the text more brief and to the point")},{label:e.localize("professional","Professional"),value:"professional",description:e.localize("professionalDescription","Adjust the text to sound more formal and business-like")},{label:e.localize("casual","Casual"),value:"casual",description:e.localize("casualDescription","Make the text sound more relaxed and friendly")},{label:e.localize("funny","Funny"),value:"funny",description:e.localize("funnyDescription","Add humor or a lighthearted tone to the text")},{label:e.localize("translate","Translate"),value:"category"},{label:e.localize("translateEnglish","Translate to English"),value:"translate_english",description:e.localize("translateEnglishDescription","Translate the text into English")},{label:e.localize("translateSpanish","Translate to Spanish"),value:"translate_spanish",description:e.localize("translateSpanishDescription","Translate the text into Spanish")},{label:e.localize("translatePortuguese","Translate to Portuguese"),value:"translate_portuguese",description:e.localize("translatePortugueseDescription","Translate the text into Portuguese")},{label:e.localize("translateItalian","Translate to Italian"),value:"translate_italian",description:e.localize("translateItalianDescription","Translate the text into Italian")},{label:e.localize("translateDutch","Translate to Dutch"),value:"translate_dutch",description:e.localize("translateDutchDescription","Translate the text into Dutch")},{label:e.localize("translateChinese","Translate to Chinese"),value:"translate_chinese",description:e.localize("translateChineseDescription","Translate the text into Chinese")},{label:e.localize("translateKorean","Translate to Korean"),value:"translate_korean",description:e.localize("translateKoreanDescription","Translate the text into Korean")},{label:e.localize("translateJapanese","Translate to Japanese"),value:"translate_japanese",description:e.localize("translateJapaneseDescription","Translate the text into Japanese")},{label:e.localize("translateRussian","Translate to Russian"),value:"translate_russian",description:e.localize("translateRussianDescription","Translate the text into Russian")}]}_createCallout(e,t){const a=this;a._callout&&a._callout.remove();const o=document.createElement("div");a._callout=o,o.classList.add("dropdown","smart-editor-callout"),o.innerHTML="\n <div class='categories' id='categories'></div>\n <div class='tabs' id='tabs'></div>\n ";const i=o,n=i.firstElementChild,r=i.lastElementChild;document.body.appendChild(o);const l={General:[{emoji:"💡",title:"Idea"},{emoji:"📌",title:"Pinned Note"},{emoji:"🔥",title:"On Fire"},{emoji:"⚡",title:"Lightning Fast"},{emoji:"💬",title:"Chat"},{emoji:"📅",title:"Calendar"},{emoji:"🔒",title:"Locked & Secure"},{emoji:"⭐",title:"Starred"},{emoji:"🎉",title:"Celebration"},{emoji:"📝",title:"Notes"},{emoji:"📂",title:"Folder"},{emoji:"🔔",title:"Notification"},{emoji:"🌟",title:"Shining Star"},{emoji:"🚀",title:"Rocket Boost"},{emoji:"📈",title:"Growth"},{emoji:"🎯",title:"Target Achieved"},{emoji:"💪",title:"Strength"},{emoji:"⏳",title:"Time Running"},{emoji:"🧠",title:"Brainstorm"},{emoji:"📚",title:"Learning"},{emoji:"🖋️",title:"Writing"},{emoji:"📋",title:"Clipboard"},{emoji:"🗓️",title:"Schedule"},{emoji:"🏆",title:"Trophy"},{emoji:"🎁",title:"Gift"},{emoji:"🎨",title:"Creativity"},{emoji:"⚖️",title:"Balance"},{emoji:"⏲️",title:"Timer"},{emoji:"🌍",title:"Global"},{emoji:"🔍",title:"Search"},{emoji:"🛠️",title:"Tools & Fixes"},{emoji:"📜",title:"Document"},{emoji:"🎵",title:"Music"},{emoji:"📎",title:"Attachment"},{emoji:"🖥️",title:"Computer Work"},{emoji:"📱",title:"Mobile"},{emoji:"💭",title:"Thinking"},{emoji:"✉️",title:"Email"},{emoji:"🔄",title:"Sync & Refresh"},{emoji:"🕒",title:"Time Management"},{emoji:"💰",title:"Finance"},{emoji:"📊",title:"Analytics"},{emoji:"🛒",title:"Shopping"},{emoji:"🔑",title:"Key Info"},{emoji:"⚙️",title:"Settings"},{emoji:"🎬",title:"Video Content"},{emoji:"🗃️",title:"Storage"},{emoji:"🏅",title:"Achievement"},{emoji:"📘",title:"Book"},{emoji:"📤",title:"Sent"},{emoji:"📥",title:"Received"},{emoji:"📍",title:"Location"},{emoji:"✏️",title:"Edit"},{emoji:"🖼️",title:"Image"},{emoji:"📻",title:"Podcast & Radio"},{emoji:"🛎️",title:"Reminder"},{emoji:"🔦",title:"Highlight"},{emoji:"🌈",title:"Inspiration"},{emoji:"🎙️",title:"Recording"},{emoji:"🖌️",title:"Design"}],Productivity:[{emoji:"🧠",title:"Brainstorming"},{emoji:"⏳",title:"Time Management"},{emoji:"🔑",title:"Key"},{emoji:"🗂️",title:"Organizer"},{emoji:"📈",title:"Analytics"},{emoji:"💼",title:"Business"},{emoji:"📋",title:"Checklist"},{emoji:"🖥️",title:"Computer"},{emoji:"📅",title:"Schedule"},{emoji:"📚",title:"Learning"},{emoji:"🚀",title:"Success"},{emoji:"💻",title:"Laptop"},{emoji:"📱",title:"Mobile"},{emoji:"⏰",title:"Alarm Clock"},{emoji:"📂",title:"Documents"},{emoji:"📝",title:"Writing"},{emoji:"✏️",title:"Edit"},{emoji:"🔔",title:"Reminder"},{emoji:"⚡",title:"Quick Action"},{emoji:"💪",title:"Effort"},{emoji:"🛠️",title:"Tools"},{emoji:"📊",title:"Statistics"},{emoji:"💡",title:"Creativity"},{emoji:"🎯",title:"Focus"},{emoji:"📎",title:"Attachment"},{emoji:"📤",title:"Outbox"},{emoji:"📥",title:"Inbox"},{emoji:"🔍",title:"Search"},{emoji:"🗝️",title:"Solution"},{emoji:"🏗️",title:"Building"},{emoji:"🏃♂️",title:"Hustle"},{emoji:"🏅",title:"Achievement"},{emoji:"🌍",title:"Global Work"},{emoji:"💰",title:"Finance"},{emoji:"📢",title:"Announcement"},{emoji:"🔄",title:"Refresh"},{emoji:"✅",title:"Completed Task"},{emoji:"📶",title:"Progress"},{emoji:"🖇️",title:"Connection"},{emoji:"📜",title:"Documentation"},{emoji:"🏆",title:"Success"},{emoji:"🚦",title:"Prioritization"},{emoji:"🎛️",title:"Control Panel"},{emoji:"💳",title:"Payment"},{emoji:"🛎️",title:"Service"},{emoji:"🌐",title:"Online Work"},{emoji:"📍",title:"Location"},{emoji:"🛒",title:"Shopping List"},{emoji:"📜",title:"Agreement"},{emoji:"⚙️",title:"Settings"},{emoji:"📑",title:"Bookmarks"},{emoji:"🛤️",title:"Roadmap"}],Motivation:[{emoji:"🎯",title:"Goal Setting"},{emoji:"💪",title:"Strength"},{emoji:"🚀",title:"Ambition"},{emoji:"🌟",title:"Shining Bright"},{emoji:"🏆",title:"Victory"},{emoji:"🔥",title:"Passion"},{emoji:"⚡",title:"Energy"},{emoji:"🏅",title:"Achievement"},{emoji:"🌱",title:"Growth"},{emoji:"💯",title:"Excellence"},{emoji:"🎉",title:"Celebration"},{emoji:"🎁",title:"Reward"},{emoji:"✨",title:"Inspiration"},{emoji:"💥",title:"Breakthrough"},{emoji:"💫",title:"Momentum"},{emoji:"🌠",title:"Dream Big"},{emoji:"🥇",title:"First Place"},{emoji:"🚀",title:"Sky's the Limit"},{emoji:"💨",title:"Speed"},{emoji:"💡",title:"Bright Ideas"},{emoji:"🏋️♂️",title:"Hard Work"},{emoji:"📈",title:"Progress"},{emoji:"🔝",title:"Top Performance"},{emoji:"👊",title:"Determination"},{emoji:"🕶️",title:"Confidence"},{emoji:"🤩",title:"Excitement"},{emoji:"🚧",title:"Overcoming Challenges"},{emoji:"💎",title:"Value"},{emoji:"🏁",title:"Finish Line"},{emoji:"🌞",title:"Positivity"},{emoji:"🔥",title:"Stay Motivated"},{emoji:"🎵",title:"Power Playlist"},{emoji:"🛤️",title:"Journey to Success"},{emoji:"🤝",title:"Support System"},{emoji:"📅",title:"Daily Wins"},{emoji:"🎙️",title:"Speak Up"},{emoji:"🧗♂️",title:"Keep Climbing"},{emoji:"🏃♂️",title:"Keep Moving"},{emoji:"📢",title:"Encouragement"},{emoji:"💰",title:"Financial Goals"},{emoji:"🎓",title:"Learning & Growth"},{emoji:"🛠️",title:"Building Success"},{emoji:"⚖️",title:"Balance & Focus"},{emoji:"🥂",title:"Milestone Celebration"},{emoji:"🗺️",title:"Vision & Strategy"},{emoji:"🛑",title:"No Excuses"},{emoji:"🚦",title:"Go Mode"},{emoji:"🚀",title:"Unstoppable"}],"Smile Faces":[{emoji:"😀",title:"Big Smile"},{emoji:"😃",title:"Happy Face"},{emoji:"😄",title:"Grinning"},{emoji:"😁",title:"Cheerful"},{emoji:"😆",title:"Laughing Hard"},{emoji:"😅",title:"Relieved Laugh"},{emoji:"😂",title:"Tears of Joy"},{emoji:"🤣",title:"ROFL"},{emoji:"😜",title:"Playful Wink"},{emoji:"😎",title:"Cool & Confident"},{emoji:"😍",title:"Heart Eyes"},{emoji:"😊",title:"Warm Smile"},{emoji:"😉",title:"Wink"},{emoji:"🥰",title:"Feeling Loved"},{emoji:"😚",title:"Kissy Face"},{emoji:"😙",title:"Smooch"},{emoji:"😋",title:"Yummy!"},{emoji:"😛",title:"Tongue Out"},{emoji:"😏",title:"Smirking"},{emoji:"😌",title:"Content & Relaxed"},{emoji:"😗",title:"Kissing Face"},{emoji:"🥳",title:"Party Mode"},{emoji:"🤩",title:"Star-Struck"},{emoji:"🤗",title:"Hugging You"},{emoji:"😇",title:"Angel Mode"},{emoji:"😻",title:"Loving Cat"},{emoji:"😺",title:"Happy Cat"},{emoji:"😽",title:"Cat Kiss"},{emoji:"🤭",title:"Oops, My Bad"},{emoji:"🫠",title:"Melting with Happiness"},{emoji:"🥹",title:"Touched & Emotional"},{emoji:"🫡",title:"Respect"},{emoji:"🤤",title:"Drooling"},{emoji:"😬",title:"Awkward Smile"},{emoji:"🤪",title:"Crazy Fun"},{emoji:"😵💫",title:"Dizzy & Confused"},{emoji:"😯",title:"Surprised & Speechless"},{emoji:"🤠",title:"Yeehaw Mood"},{emoji:"😆",title:"Giggle"},{emoji:"🫢",title:"Oops!"},{emoji:"🙃",title:"Upside Down Fun"},{emoji:"😜",title:"Goofy"},{emoji:"😹",title:"Cat LOL"},{emoji:"😈",title:"Mischievous Grin"},{emoji:"👻",title:"Silly Ghost"},{emoji:"🥴",title:"Woozy"},{emoji:"🫨",title:"Shaking with Excitement"},{emoji:"💃",title:"Dancing Queen"}],People:[{emoji:"👨💻",title:"Man Technologist"},{emoji:"👩💻",title:"Woman Technologist"},{emoji:"👨🎓",title:"Man Student"},{emoji:"👩🎓",title:"Woman Student"},{emoji:"👨🏫",title:"Man Teacher"},{emoji:"👩🏫",title:"Woman Teacher"},{emoji:"👨⚖️",title:"Man Judge"},{emoji:"👩⚖️",title:"Woman Judge"},{emoji:"👨🔬",title:"Man Scientist"},{emoji:"👩🔬",title:"Woman Scientist"},{emoji:"👨🎨",title:"Man Artist"},{emoji:"👩🎨",title:"Woman Artist"},{emoji:"👨🍳",title:"Man Chef"},{emoji:"👩🍳",title:"Woman Chef"},{emoji:"👨🚀",title:"Man Astronaut"},{emoji:"👩🚀",title:"Woman Astronaut"},{emoji:"🧑⚖️",title:"Person Judge"},{emoji:"🧑🔬",title:"Person Scientist"},{emoji:"🧑🎨",title:"Person Artist"},{emoji:"🧑🍳",title:"Person Chef"},{emoji:"🧑🚀",title:"Person Astronaut"},{emoji:"🧑⚖️",title:"Person Lawyer"},{emoji:"👶",title:"Baby"},{emoji:"👧",title:"Girl"},{emoji:"👦",title:"Boy"},{emoji:"👨",title:"Man"},{emoji:"👩",title:"Woman"},{emoji:"🧑",title:"Person"},{emoji:"🧓",title:"Older Person"},{emoji:"👵",title:"Grandmother"},{emoji:"👴",title:"Grandfather"},{emoji:"👮",title:"Police Officer"},{emoji:"👷",title:"Construction Worker"},{emoji:"💂",title:"Guard"},{emoji:"👩⚖️",title:"Female Judge"},{emoji:"👩🍳",title:"Female Chef"},{emoji:"👨⚖️",title:"Male Judge"},{emoji:"👨🍳",title:"Male Chef"},{emoji:"💃",title:"Dancer"},{emoji:"🕺",title:"Man Dancing"},{emoji:"🤦",title:"Facepalm"},{emoji:"🤷",title:"Shrug"},{emoji:"🙋",title:"Person Raising Hand"},{emoji:"🙋♂️",title:"Man Raising Hand"},{emoji:"🙋♀️",title:"Woman Raising Hand"},{emoji:"🙆",title:"Person Gesturing OK"},{emoji:"🙆♂️",title:"Man Gesturing OK"},{emoji:"🙆♀️",title:"Woman Gesturing OK"},{emoji:"💅",title:"Nail Polish"},{emoji:"🧑🦱",title:"Person with Curly Hair"},{emoji:"🧑🦳",title:"Person with White Hair"},{emoji:"🧑🦲",title:"Bald Person"}],"Food & Drink":[{emoji:"🍎",title:"Red Apple"},{emoji:"🍏",title:"Green Apple"},{emoji:"🍐",title:"Pear"},{emoji:"🍊",title:"Orange"},{emoji:"🍋",title:"Lemon"},{emoji:"🍌",title:"Banana"},{emoji:"🍉",title:"Watermelon"},{emoji:"🍇",title:"Grapes"},{emoji:"🍓",title:"Strawberry"},{emoji:"🫐",title:"Blueberry"},{emoji:"🍒",title:"Cherries"},{emoji:"🍑",title:"Peach"},{emoji:"🥭",title:"Mango"},{emoji:"🍍",title:"Pineapple"},{emoji:"🥥",title:"Coconut"},{emoji:"🥝",title:"Kiwi"},{emoji:"🍅",title:"Tomato"},{emoji:"🌶️",title:"Hot Pepper"},{emoji:"🥒",title:"Cucumber"},{emoji:"🥕",title:"Carrot"},{emoji:"🌽",title:"Corn"},{emoji:"🥔",title:"Potato"},{emoji:"🧅",title:"Onion"},{emoji:"🧄",title:"Garlic"},{emoji:"🥑",title:"Avocado"},{emoji:"🥦",title:"Broccoli"},{emoji:"🥬",title:"Lettuce"},{emoji:"🫛",title:"Peas"},{emoji:"🥜",title:"Peanuts"},{emoji:"🌰",title:"Chestnut"},{emoji:"🍞",title:"Bread"},{emoji:"🥖",title:"Baguette"},{emoji:"🥐",title:"Croissant"},{emoji:"🥯",title:"Bagel"},{emoji:"🧇",title:"Waffle"},{emoji:"🥞",title:"Pancakes"},{emoji:"🧀",title:"Cheese"},{emoji:"🍗",title:"Chicken Leg"},{emoji:"🥩",title:"Steak"},{emoji:"🍖",title:"Meat on Bone"},{emoji:"🌭",title:"Hot Dog"},{emoji:"🍔",title:"Burger"},{emoji:"🍕",title:"Pizza"},{emoji:"🥪",title:"Sandwich"},{emoji:"🌮",title:"Taco"},{emoji:"🌯",title:"Burrito"},{emoji:"🥗",title:"Salad"},{emoji:"🍣",title:"Sushi"},{emoji:"🍛",title:"Curry"},{emoji:"🍜",title:"Noodles"},{emoji:"🍲",title:"Soup"},{emoji:"🥘",title:"Paella"},{emoji:"🫕",title:"Fondue"},{emoji:"🍚",title:"Cooked Rice"},{emoji:"🍤",title:"Fried Shrimp"},{emoji:"🥮",title:"Moon Cake"},{emoji:"🍩",title:"Doughnut"},{emoji:"🍪",title:"Cookie"},{emoji:"🍰",title:"Cake"},{emoji:"🎂",title:"Birthday Cake"},{emoji:"🧁",title:"Cupcake"},{emoji:"🍫",title:"Chocolate"},{emoji:"🍬",title:"Candy"},{emoji:"🍭",title:"Lollipop"},{emoji:"🍮",title:"Custard"},{emoji:"🍯",title:"Honey"},{emoji:"🥛",title:"Milk"},{emoji:"🍼",title:"Baby Bottle"},{emoji:"☕",title:"Coffee"},{emoji:"🍵",title:"Tea"},{emoji:"🧃",title:"Juice"},{emoji:"🥤",title:"Soft Drink"},{emoji:"🍹",title:"Cocktail"},{emoji:"🍷",title:"Wine"},{emoji:"🍺",title:"Beer"},{emoji:"🍻",title:"Cheers"},{emoji:"🥂",title:"Champagne"},{emoji:"🥃",title:"Whiskey"}],Symbols:[{emoji:"✅",title:"Check Mark"},{emoji:"❌",title:"Cross Mark"},{emoji:"⚠️",title:"Warning"},{emoji:"ℹ️",title:"Information"},{emoji:"❓",title:"Question"},{emoji:"❗",title:"Exclamation"},{emoji:"🔄",title:"Refresh"},{emoji:"🔃",title:"Reload"},{emoji:"➕",title:"Plus"},{emoji:"➖",title:"Minus"},{emoji:"➗",title:"Division"},{emoji:"✖️",title:"Multiplication"},{emoji:"💲",title:"Dollar Sign"},{emoji:"💱",title:"Currency Exchange"},{emoji:"⚡",title:"Lightning"},{emoji:"🔒",title:"Lock"},{emoji:"🔓",title:"Unlock"},{emoji:"🔑",title:"Key"},{emoji:"🆕",title:"New"},{emoji:"🆙",title:"Up"},{emoji:"🆒",title:"Cool"},{emoji:"🆓",title:"Free"},{emoji:"🆖",title:"No Good"},{emoji:"🈺",title:"Open Business"},{emoji:"🈚",title:"Not Available"},{emoji:"⭕",title:"Circle"},{emoji:"💠",title:"Diamond"},{emoji:"🔷",title:"Blue Diamond"},{emoji:"🔶",title:"Orange Diamond"},{emoji:"🔴",title:"Red Circle"},{emoji:"🟢",title:"Green Circle"},{emoji:"🔵",title:"Blue Circle"},{emoji:"🟡",title:"Yellow Circle"},{emoji:"⚪",title:"White Circle"},{emoji:"⚫",title:"Black Circle"},{emoji:"⬆️",title:"Up Arrow"},{emoji:"⬇️",title:"Down Arrow"},{emoji:"⬅️",title:"Left Arrow"},{emoji:"➡️",title:"Right Arrow"},{emoji:"↔️",title:"Left-Right Arrow"},{emoji:"↕️",title:"Up-Down Arrow"},{emoji:"🔄",title:"Rotate"},{emoji:"♻️",title:"Recycle"},{emoji:"🏳️",title:"White Flag"},{emoji:"🏴",title:"Black Flag"},{emoji:"🏁",title:"Finish Line"},{emoji:"⚜️",title:"Fleur-de-lis"},{emoji:"♾️",title:"Infinity"}],Flags:[{emoji:"🇺🇸",title:"United States"},{emoji:"🇨🇦",title:"Canada"},{emoji:"🇬🇧",title:"United Kingdom"},{emoji:"🇦🇺",title:"Australia"},{emoji:"🇩🇪",title:"Germany"},{emoji:"🇫🇷",title:"France"},{emoji:"🇮🇹",title:"Italy"},{emoji:"🇪🇸",title:"Spain"},{emoji:"🇳🇱",title:"Netherlands"},{emoji:"🇧🇪",title:"Belgium"},{emoji:"🇨🇭",title:"Switzerland"},{emoji:"🇦🇹",title:"Austria"},{emoji:"🇸🇪",title:"Sweden"},{emoji:"🇳🇴",title:"Norway"},{emoji:"🇩🇰",title:"Denmark"},{emoji:"🇫🇮",title:"Finland"},{emoji:"🇮🇪",title:"Ireland"},{emoji:"🇵🇱",title:"Poland"},{emoji:"🇨🇿",title:"Czech Republic"},{emoji:"🇸🇰",title:"Slovakia"},{emoji:"🇭🇺",title:"Hungary"},{emoji:"🇷🇴",title:"Romania"},{emoji:"🇧🇬",title:"Bulgaria"},{emoji:"🇬🇷",title:"Greece"},{emoji:"🇵🇹",title:"Portugal"},{emoji:"🇷🇺",title:"Russia"},{emoji:"🇹🇷",title:"Turkey"},{emoji:"🇨🇳",title:"China"},{emoji:"🇯🇵",title:"Japan"},{emoji:"🇰🇷",title:"South Korea"},{emoji:"🇮🇳",title:"India"},{emoji:"🇧🇷",title:"Brazil"},{emoji:"🇲🇽",title:"Mexico"},{emoji:"🇦🇷",title:"Argentina"},{emoji:"🇨🇴",title:"Colombia"},{emoji:"🇨🇱",title:"Chile"},{emoji:"🇿🇦",title:"South Africa"},{emoji:"🇪🇬",title:"Egypt"},{emoji:"🇦🇪",title:"United Arab Emirates"},{emoji:"🇮🇱",title:"Israel"},{emoji:"🇸🇦",title:"Saudi Arabia"},{emoji:"🇮🇩",title:"Indonesia"},{emoji:"🇲🇾",title:"Malaysia"},{emoji:"🇵🇭",title:"Philippines"},{emoji:"🇹🇭",title:"Thailand"},{emoji:"🇻🇳",title:"Vietnam"},{emoji:"🇸🇬",title:"Singapore"},{emoji:"🇰🇪",title:"Kenya"},{emoji:"🇳🇬",title:"Nigeria"},{emoji:"🇵🇰",title:"Pakistan"},{emoji:"🇳🇿",title:"New Zealand"},{emoji:"🇺🇦",title:"Ukraine"}],Gestures:[{emoji:"👍",title:"Thumbs Up"},{emoji:"👎",title:"Thumbs Down"},{emoji:"👌",title:"OK Hand"},{emoji:"🤞",title:"Fingers Crossed"},{emoji:"✌️",title:"Victory Hand"},{emoji:"🤟",title:"Love-You Gesture"},{emoji:"🤙",title:"Call Me Hand"},{emoji:"👋",title:"Waving Hand"},{emoji:"🖐",title:"Raised Hand"},{emoji:"✋",title:"Stop Hand"},{emoji:"🤚",title:"Raised Backhand"},{emoji:"🤲",title:"Palms Up Together"},{emoji:"👐",title:"Open Hands"},{emoji:"🙌",title:"Raising Hands"},{emoji:"🙋",title:"Person Raising Hand"},{emoji:"🙋♂️",title:"Man Raising Hand"},{emoji:"🙋♀️",title:"Woman Raising Hand"},{emoji:"👈",title:"Backhand Index Pointing Left"},{emoji:"👉",title:"Backhand Index Pointing Right"},{emoji:"👆",title:"Backhand Index Pointing Up"},{emoji:"👇",title:"Backhand Index Pointing Down"},{emoji:"🤚",title:"Raised Backhand"},{emoji:"🖖",title:"Vulcan Salute"},{emoji:"🤜",title:"Right-Facing Fist"},{emoji:"🤛",title:"Left-Facing Fist"},{emoji:"🖐",title:"Five Fingers Raised"},{emoji:"🖖",title:"Vulcan Salute"},{emoji:"✋🏼",title:"Stop Hand Light Skin Tone"},{emoji:"✋🏽",title:"Stop Hand Medium Skin Tone"},{emoji:"✋🏾",title:"Stop Hand Medium-Dark Skin Tone"},{emoji:"✋🏿",title:"Stop Hand Dark Skin Tone"},{emoji:"👌🏼",title:"OK Hand Light Skin Tone"},{emoji:"👌🏽",title:"OK Hand Medium Skin Tone"},{emoji:"👌🏾",title:"OK Hand Medium-Dark Skin Tone"},{emoji:"👌🏿",title:"OK Hand Dark Skin Tone"},{emoji:"🤟🏼",title:"Love-You Gesture Light Skin Tone"},{emoji:"🤟🏽",title:"Love-You Gesture Medium Skin Tone"},{emoji:"🤟🏾",title:"Love-You Gesture Medium-Dark Skin Tone"},{emoji:"🤟🏿",title:"Love-You Gesture Dark Skin Tone"},{emoji:"✋🏻",title:"Stop Hand Light Skin Tone"},{emoji:"👋🏻",title:"Waving Hand Light Skin Tone"},{emoji:"👋🏼",title:"Waving Hand Medium-Light Skin Tone"},{emoji:"👋🏽",title:"Waving Hand Medium Skin Tone"},{emoji:"👋🏾",title:"Waving Hand Medium-Dark Skin Tone"},{emoji:"👋🏿",title:"Waving Hand Dark Skin Tone"},{emoji:"🖐🏻",title:"Raised Hand Light Skin Tone"},{emoji:"🖐🏼",title:"Raised Hand Medium-Light Skin Tone"},{emoji:"🖐🏽",title:"Raised Hand Medium Skin Tone"},{emoji:"🤲🏾",title:"Palms Up Together Medium-Dark Skin Tone"},{emoji:"🤲🏿",title:"Palms Up Together Dark Skin Tone"}]};let s="General";const d={General:"💡",Productivity:"✅",Motivation:"🎯","Smile Faces":"😀",People:"👨💻","Food & Drink":"🍎",Symbols:"✨",Flags:"🏳️",Gestures:"👍"};function c(e){s=e;const a=r.querySelector(".active");a&&a.classList.remove("active"),r.querySelector(`[title='${e}']`).classList.add("active"),function(e){n.innerHTML="",l[e].forEach((e=>{const a=document.createElement("div");a.classList.add("option"),a.innerHTML=`<span title="${e.title}" class='emoji'>${e.emoji}</span>`,a.addEventListener("click",(function(){o.setAttribute("value",e.emoji),i.style.display="none",t(e.emoji,e.title)})),n.appendChild(a)}))}(e)}const m=a.offset(e);i.style.left=m.left+"px",i.style.top=m.top-a.$.editableElement.scrollTop+e.offsetHeight+5+"px",i.style.display="block",setTimeout((()=>{a._adjustPopupBounds(i)}),100),r.innerHTML="",Object.keys(l).forEach((e=>{const t=document.createElement("div");t.classList.add("tab"),t.innerHTML=`${d[e]}`,t.setAttribute("title",e),t.addEventListener("click",(()=>c(e))),r.appendChild(t)})),c(s)}_createDatePopup(e,t){const a=this;a._datePopup&&a._datePopup.remove();const o=document.createElement("div");a._datePopup=o,o.classList.add("dropdown","smart-editor-date-popup"),o.innerHTML="\n ";const i=o;document.body.appendChild(o);const n=a.offset(e);i.style.left=n.left+"px",i.style.top=n.top-a.$.editableElement.scrollTop+e.offsetHeight+5+"px",i.style.display="block",setTimeout((()=>{a._adjustPopupBounds(i)}),100);const r=document.createElement("smart-calendar");r.onchange=e=>{t(e.detail.value)},i.appendChild(r)}_refreshPageLabels(){let e=[...this.querySelectorAll(".smart-editor-tab")];[...this.querySelectorAll(".smart-editor-page-label")].forEach((t=>{const a=t.getAttribute("data-id");if(a){const o=parseInt(a);e[o]&&(t.textContent=e[o].textContent.trim())}}))}_setEditorValue(e,t){const a=this;if(e){if(t.innerHTML=e,a.enablePages){const t=a.pages[a.pageIndex];t&&(t.innerHTML=e)}t.whenRendered((()=>{t._initEditorBlocks(),t._refreshEditorBlockPlaceholder(),t._editorBlocks=t.$.editableElement.querySelectorAll(".smart-editor-block"),t._setSortable(),t._currentBlock=t.querySelector(".smart-editor-block"),a._refreshTasks();const e=document.createRange(),o=window.getSelection();t.$.editableElement.lastChild&&(e.setStartAfter(t.$.editableElement.lastChild),e.collapse(!0),o.removeAllRanges(),o.addRange(e)),a._refreshPageLabels()}))}else t.whenRendered((()=>{t.value||t._createEditorBlock(!1,!1," ")}))}_createAIPopup(e,t,a){const o=this;o._aiPopup&&o._aiPopup.remove();const i=document.createElement("div");o._aiPopup=i,i.classList.add("dropdown","smart-editor-ai-popup"),i.innerHTML="\n ";const n=i;document.body.appendChild(i);const r=o.offset(e);n.style.left=r.left+"px",n.style.top=r.top-o.$.editableElement.scrollTop+e.offsetHeight+5+"px",n.style.display="block";let l=[{label:"Outline",value:"Generate an outline about"},{label:"Email",value:"Write an email about"},{label:"Meeting Agenda",value:"Create a meeting agenda for"},{label:"Blog Post",value:"Write a blog post about"},{label:"Social Media Post",value:"Write a social media post about"},{label:"Press Release",value:"Write a press release about"},{label:"Job Description",value:"Write a job description for"},{label:"Website Copy",value:"Write website copy for"}];t&&(l=[]);let s="";for(let e=0;e<l.length;e++)s+=`<button class="smart-editor-predefined-btn" data-click="${l[e].value}">${l[e].label}</button>`;n.innerHTML=` <div class="smart-editor-container">\n <span class="button-close"></span>\n <div class="smart-editor-input-container">\n <input type="text" id="userPrompt" class="smart-editor-input" placeholder="${o.localize("typePrompt")}" />\n <button class="smart-editor-submit-btn" onclick="getAIResponse()">Ask AI <span class="smart-editor-icon-arrow-up">↑</span></button>\n </div>\n\n <div id="aiResult" class="smart-editor-result-box">\n \x3c!-- AI response will appear here --\x3e\n </div>\n <div id="timeoutMessage" class="smart-editor-timeout-message"></div>\n\n <div class="smart-editor-header"><span class="smart-editor-ai-icon"></span>Draft</div>\n\n \x3c!-- Predefined list buttons --\x3e\n <div class="smart-editor-predefined-container">\n ${s}\n </div>\n\n \x3c!-- Modal Popup for AI response --\x3e\n <button id="keepButton" class="smart-editor-keep-btn" onclick="keepResponse()">${o.localize("keep")}</button>\n <button id="replaceButton" class="smart-editor-replace-btn secondary" onclick="keepResponse()">${o.localize("replace")}</button>\n </div>`;const d=n.querySelector("#userPrompt"),c=n.querySelector("#aiResult"),m=n.querySelector("#timeoutMessage"),u=n.querySelector(".smart-editor-submit-btn"),p=document.querySelector("#keepButton"),b=document.querySelector("#replaceButton"),h=n.querySelector(".smart-editor-header"),g=n.querySelector(".button-close"),f=(()=>{let e=window.getSelection();return e.rangeCount?e.getRangeAt(0).toString():""})();if(t){h.classList.add("smart-hidden"),d.parentElement.classList.add("smart-hidden"),d.value='"'+f+'"',p.textContent=o.localize("insertBelow");const e=[{label:o.localize("editSelection","Edit Selection"),value:"category"},{label:o.localize("rewrite","Rewrite"),value:"rewrite",description:o.localize("rewriteDescription","Rewrite the selected text")},{label:o.localize("continueWriting","Continue writing"),value:"continue_writing",description:o.localize("continueWritingDescription","Extend the content further")},{label:o.localize("fixSpellingGrammar","Fix spelling & grammar"),value:"fix_spelling_grammar",description:o.localize("fixSpellingGrammarDescription","Correct spelling and grammatical errors")},{label:o.localize("summarize","Summarize"),value:"summarize",description:o.localize("summarizeDescription","Generate a concise summary of the text")},{label:o.localize("makeShorter","Make shorter"),value:"make_shorter",description:o.localize("makeShorterDescription","Reduce the length of the text while maintaining meaning")},{label:o.localize("makeLonger","Make longer"),v