From 708574fbbc16275e20ec62abdc496485f19a78b7 Mon Sep 17 00:00:00 2001 From: David Buros Date: Tue, 30 Apr 2024 17:48:04 +0200 Subject: [PATCH 1/3] fix(js): come back of MonsieurBizRichEditorWysiwyg class for retro-compatibility --- assets/js/app.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/assets/js/app.js b/assets/js/app.js index cf8e47c9..7473025b 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -8,6 +8,21 @@ const initEditors = (target) => { suneditor.init(target); } +// For retro-compatibility we kee the MonsieurBizRichEditorWysiwyg class +// But now it use new initEditors function +global.MonsieurBizRichEditorWysiwyg = class { + constructor(config) {} + load(container) { + initEditors(container); + } + setupEditor(target) { + if (null === target.parent) { + return; + } + initEditors(target.parent); + } +} + document.addEventListener('DOMContentLoaded', function () { const target = document.querySelector('body'); initEditors(target); From 3b5fbebebb54966b750ae9804a228dc1337ce7e5 Mon Sep 17 00:00:00 2001 From: Maxime Leclercq Date: Thu, 2 May 2024 10:31:46 +0200 Subject: [PATCH 2/3] feat: deprecated old functions and add custom event to reload editor --- assets/js/app.js | 1266 ++++++++++++----------- src/Resources/views/Admin/app.html.twig | 11 +- 2 files changed, 641 insertions(+), 636 deletions(-) diff --git a/assets/js/app.js b/assets/js/app.js index 7473025b..f9623529 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -5,133 +5,137 @@ import '../css/app.scss'; import suneditor from "./editors/editors/suneditor"; const initEditors = (target) => { - suneditor.init(target); + suneditor.init(target); } -// For retro-compatibility we kee the MonsieurBizRichEditorWysiwyg class -// But now it use new initEditors function +// For retro-compatibility we keep the MonsieurBizRichEditorWysiwyg class global.MonsieurBizRichEditorWysiwyg = class { - constructor(config) {} - load(container) { - initEditors(container); - } - setupEditor(target) { - if (null === target.parent) { - return; - } - initEditors(target.parent); - } + constructor(config) {} + load(container) { + console.log('Deprecated method MonsieurBizRichEditorWysiwyg.load(), use initEditors(target) instead.'); + } + setupEditor(target) { + console.log('Deprecated method MonsieurBizRichEditorWysiwyg.setupEditor(), use initEditors(target) instead.'); + } } document.addEventListener('DOMContentLoaded', function () { - const target = document.querySelector('body'); - initEditors(target); + const target = document.querySelector('body'); + initEditors(target); }); +document.addEventListener('rich-editor:reload', function (event) { + const target = event.detail.target; + if (target === undefined) { + return; + } + initEditors(target); +}) + global.MonsieurBizRichEditorConfig = class { - constructor( - input, - uielements, - containerHtml, - actionsHtml, - elementHtml, - elementCardHtml, - panelsHtml, - panelsEditHtml, - deletionConfirmation, - createElementFormUrl, - editElementFormUrl, - renderElementsUrl, - defaultUiElement, - defaultUIElementDataField, - errorMessage, - unallowedUiElementMessage - ) { - this.input = input; - this.uielements = uielements; - this.containerHtml = containerHtml; - this.actionsHtml = actionsHtml; - this.elementHtml = elementHtml; - this.elementCardHtml = elementCardHtml; - this.panelsHtml = panelsHtml; - this.panelsEditHtml = panelsEditHtml; - this.deletionConfirmation = deletionConfirmation; - this.createElementFormUrl = createElementFormUrl; - this.editElementFormUrl = editElementFormUrl; - this.renderElementsUrl = renderElementsUrl; - this.defaultUiElement = defaultUiElement; - this.defaultUIElementDataField = defaultUIElementDataField; - this.errorMessage = errorMessage; - this.unallowedUiElementMessage = unallowedUiElementMessage; - this.uid = Math.random().toString(36).substring(2, 11); - } - - findUiElementByCode(code) { - if (this.uielements[code] === undefined) { - return null; - } - return this.uielements[code]; - } + constructor( + input, + uielements, + containerHtml, + actionsHtml, + elementHtml, + elementCardHtml, + panelsHtml, + panelsEditHtml, + deletionConfirmation, + createElementFormUrl, + editElementFormUrl, + renderElementsUrl, + defaultUiElement, + defaultUIElementDataField, + errorMessage, + unallowedUiElementMessage + ) { + this.input = input; + this.uielements = uielements; + this.containerHtml = containerHtml; + this.actionsHtml = actionsHtml; + this.elementHtml = elementHtml; + this.elementCardHtml = elementCardHtml; + this.panelsHtml = panelsHtml; + this.panelsEditHtml = panelsEditHtml; + this.deletionConfirmation = deletionConfirmation; + this.createElementFormUrl = createElementFormUrl; + this.editElementFormUrl = editElementFormUrl; + this.renderElementsUrl = renderElementsUrl; + this.defaultUiElement = defaultUiElement; + this.defaultUIElementDataField = defaultUIElementDataField; + this.errorMessage = errorMessage; + this.unallowedUiElementMessage = unallowedUiElementMessage; + this.uid = Math.random().toString(36).substring(2, 11); + } + + findUiElementByCode(code) { + if (this.uielements[code] === undefined) { + return null; + } + return this.uielements[code]; + } }; global.MonsieurBizRichEditorUiElement = class { - constructor(config, code, data, previewHtml) { - this.config = config; - this.code = code; - this.data = data; - this.previewHtml = previewHtml; - } - - toJSON() { - return { - code: this.code, - data: this.data - }; - } - - get uielement() { - return this.config.findUiElementByCode(this.code); - } - - get enabled() { - return this.uielement.enabled; - } - - get title() { - return this.uielement.title; - } - - get description() { - return this.uielement.description; - } - - get icon() { - return this.uielement.icon; - } - - get manager() { - return this.config.input.manager; - } - - edit() { - this.manager.editUiElement(this); - } - - copy(callback) { - this.manager.saveUiElementToClipboard(this, callback); - } - - up() { - this.manager.moveUp(this); - } - - down() { - this.manager.moveDown(this); - } - - delete() { - this.manager.delete(this); - } + constructor(config, code, data, previewHtml) { + this.config = config; + this.code = code; + this.data = data; + this.previewHtml = previewHtml; + } + + toJSON() { + return { + code: this.code, + data: this.data + }; + } + + get uielement() { + return this.config.findUiElementByCode(this.code); + } + + get enabled() { + return this.uielement.enabled; + } + + get title() { + return this.uielement.title; + } + + get description() { + return this.uielement.description; + } + + get icon() { + return this.uielement.icon; + } + + get manager() { + return this.config.input.manager; + } + + edit() { + this.manager.editUiElement(this); + } + + copy(callback) { + this.manager.saveUiElementToClipboard(this, callback); + } + + up() { + this.manager.moveUp(this); + } + + down() { + this.manager.moveDown(this); + } + + delete() { + this.manager.delete(this); + } }; /** @@ -139,532 +143,532 @@ global.MonsieurBizRichEditorUiElement = class { */ global.MonsieurBizRichEditorManager = class { - /** - * - */ - constructor(config, tags) { - config.input.setAttribute('data-rich-editor-uid', config.uid); - - this.config = config; - - let inputValue = this.input.value.trim(); - - this.tags = tags; - this.tagsAreExclusive = false; - for (let tag of this.tags) { - if (!tag.startsWith('-')) { - this.tagsAreExclusive = true; - break; - } - } - - let initInterfaceCallback = function () { - this.initInterface(); - }.bind(this); - - if (inputValue !== '') { - try { - this.initUiElements(JSON.parse(inputValue), initInterfaceCallback); - } catch (e) { - this.initUiElements( - [{ - "code": this.config.defaultUiElement, - "data": { - [this.config.defaultUIElementDataField]: inputValue + /** + * + */ + constructor(config, tags) { + config.input.setAttribute('data-rich-editor-uid', config.uid); + + this.config = config; + + let inputValue = this.input.value.trim(); + + this.tags = tags; + this.tagsAreExclusive = false; + for (let tag of this.tags) { + if (!tag.startsWith('-')) { + this.tagsAreExclusive = true; + break; } - }], - initInterfaceCallback - ); - } - } else { - this.uiElements = []; - this.initInterface(); - } - } - - initUiElements(stack, initInterfaceCallback) { - this.uiElements = []; - this.requestUiElementsHtml(stack, function () { - // this = req - if (this.status === 200) { - let renderedElements = JSON.parse(this.responseText); - renderedElements.forEach(function (elementHtml, position) { - let element = stack[position]; - if (element.code === undefined && element.type !== undefined) { - element.code = element.type; - element.data = element.fields; - delete element.type; - delete element.fields; - } - let uiElement = this.config.findUiElementByCode(element.code); - if (null !== uiElement) { - this.uiElements.push(new MonsieurBizRichEditorUiElement( - this.config, - uiElement.code, - element.data, - elementHtml - )); - } - }.bind(this.manager)); - initInterfaceCallback(); - } - }); - } - - initInterface() { - this.initUiElementsInterface(); - this.initUiPanelsInterface(); - document.dispatchEvent(new CustomEvent('mbiz:rich-editor:init-interface-complete', { - 'detail': {'editorManager': this} - })); - document.addEventListener('mbiz:rich-editor:uielement:copied', function (e) { - this.container.querySelectorAll('.js-uie-paste').forEach(function (action) { - action.classList.remove('disabled'); - }.bind(this)); - }.bind(this)); - } - - initUiPanelsInterface() { - let panelsWrapper = document.createElement('div'); - panelsWrapper.innerHTML = Mustache.render(this.config.panelsHtml, { uid: this.config.uid }); - document.body.appendChild(panelsWrapper.firstElementChild); - - let panelsEditWrapper = document.createElement('div'); - panelsEditWrapper.innerHTML = Mustache.render(this.config.panelsEditHtml, { - uid: this.config.uid, - }); - document.body.appendChild(panelsEditWrapper.firstElementChild); - - this.selectionPanel = new Dialog('.js-uie-panels-' + this.config.uid, { - labelledby: 'uie-heading-' + this.config.uid, - enableAutoFocus: false, - closingSelector: '.js-uie-panels-close-' + this.config.uid, - }); - this.newPanel = new Dialog('.js-uie-panels-new-' + this.config.uid, { - helperSelector: '.js-uie-panels-selector-' + this.config.uid, - enableAutoFocus: false, - }); - this.editPanel = new Dialog('.js-uie-panels-edit-' + this.config.uid, { - enableAutoFocus: false, - }); - } - - initUiElementsInterface() { - this.input.type = 'hidden'; - // container first - let containerWrapper = document.createElement('div'); - containerWrapper.innerHTML = Mustache.render(this.config.containerHtml, {}); - this.container = containerWrapper.firstElementChild; - this.input.after(this.container); - - // Redraw all elements then (using a write to keep compatibility) - this.write(); - } - - drawUiElements() { - // Elements - let elementsContainer = this.container.querySelector('.js-uie-container'); - elementsContainer.innerHTML = ''; - this.uiElements.forEach(function (element, position) { - elementsContainer.append(this.getActions(position)); - elementsContainer.append(this.getUiElement(element, position)); - }.bind(this)); - elementsContainer.append(this.getActions(this.uiElements.length)); - } - - getActions(position) { - let actionsWrapper = document.createElement('div'); - actionsWrapper.innerHTML = Mustache.render(this.config.actionsHtml, {'position': position}); - - let actions = actionsWrapper.firstElementChild; - - // Add button - actions.querySelector('.js-uie-add').position = position; - actions.querySelector('.js-uie-add').manager = this; - actions.querySelector('.js-uie-add').addEventListener('click', function (e) { - actions.querySelector('.js-uie-add').manager.openSelectionPanel( - actions.querySelector('.js-uie-add').position - ); - }); - - // Paste clipboard button - actions.querySelector('.js-uie-paste').position = position; - actions.querySelector('.js-uie-paste').manager = this; - actions.querySelector('.js-uie-paste').addEventListener('click', function (e) { - actions.querySelector('.js-uie-paste').manager.pasteUiElementFromClipboard( - actions.querySelector('.js-uie-paste').position - ); - }); - // Disabled? - if (!this.isClipboardEmpty()) { - actions.querySelector('.js-uie-paste').classList.remove('disabled'); - } - - return actions; - } - - getUiElement(element, position) { - let elementWrapper = document.createElement('div'); - elementWrapper.innerHTML = Mustache.render(this.config.elementHtml, { - 'title': element.title, - 'icon': element.icon, - 'preview': element.previewHtml, - 'disabled': !element.enabled - }); - let uiElement = elementWrapper.firstElementChild; - uiElement.element = element; - uiElement.position = position; - uiElement.querySelector('.js-uie-delete').addEventListener('click', function () { - if (confirm(this.closest('.js-uie-element').element.config.deletionConfirmation)) { - this.closest('.js-uie-element').element.delete(); - } - }); - if (position === 0) { - uiElement.querySelector('.js-uie-up').remove(); - } else { - uiElement.querySelector('.js-uie-up').addEventListener('click', function () { - this.closest('.js-uie-element').element.up(); - }); - } - if (position === (this.uiElements.length - 1)) { - uiElement.querySelector('.js-uie-down').remove(); - } else { - uiElement.querySelector('.js-uie-down').addEventListener('click', function () { - this.closest('.js-uie-element').element.down(); - }); - } - uiElement.querySelector('.js-uie-edit').addEventListener('click', function () { - this.closest('.js-uie-element').element.edit(); - }); - uiElement.querySelector('.js-uie-copy').addEventListener('click', function (e) { - this.closest('.js-uie-element').element.copy(function () { - const button = e.currentTarget; - const originalText = button.dataset.tooltip; - button.dataset.tooltip = button.dataset.alternateText; - window.setTimeout(function () { - button.dataset.tooltip = originalText; - }, 1000); - }); - }); - return uiElement; - } - - getNewUiElementCard(element, position) { - let cardWrapper = document.createElement('div'); - cardWrapper.innerHTML = Mustache.render(this.config.elementCardHtml, element); - let button = cardWrapper.firstElementChild; - button.element = element; - button.position = position; - button.manager = this; - button.addEventListener('click', function (e) { - let button = e.currentTarget; - button.manager.loadUiElementCreateForm(button.element, function (progress) { - if (this.status === 200) { - let data = JSON.parse(this.responseText); - button.manager.openNewPanel(data['form_html'], button.element, button.position) } - }); - }); - return button; - } - - get input() { - return this.config.input; - } - - openSelectionPanel(position) { - this.selectionPanel.dialog.manager = this; - this.selectionPanel.dialog.position = position; - - // Draw element cards - let cardsContainer = this.selectionPanel.dialog.querySelector('.js-uie-cards-container'); - cardsContainer.innerHTML = ''; - for (let elementCode in this.config.uielements) { - if ( - this.config.uielements[elementCode].ignored // duplicates using aliases - || !this.config.uielements[elementCode].enabled // avoid disabled elements to show up! - ) { - continue; - } - let append = true; - if (this.tags.length > 0) { - append = !this.tagsAreExclusive; - for (let tagIndex in this.tags) { // We proceed tag by tag, excluding and including for every tag, so the order matters! - let realTag = this.tags[tagIndex].replace(/^(-|\+)/, ''); - if (0 <= this.config.uielements[elementCode].tags.indexOf(realTag)) { // The element is tagged - append = !this.tags[tagIndex].startsWith('-'); // Append only if the tag is not excluded - } + + let initInterfaceCallback = function () { + this.initInterface(); + }.bind(this); + + if (inputValue !== '') { + try { + this.initUiElements(JSON.parse(inputValue), initInterfaceCallback); + } catch (e) { + this.initUiElements( + [{ + "code": this.config.defaultUiElement, + "data": { + [this.config.defaultUIElementDataField]: inputValue + } + }], + initInterfaceCallback + ); + } + } else { + this.uiElements = []; + this.initInterface(); } - } - if (append) { - cardsContainer.append(this.getNewUiElementCard(this.config.uielements[elementCode], position)); - } - } - this.newPanel.close(); - this.selectionPanel.open(); - } - - drawNewForm(formHtml, position) { - this.newPanel.dialog.innerHTML = formHtml; - let form = this.newPanel.dialog; - initEditors(form); - this.dispatchInitFormEvent(form, this); - - // Form submit - let formElement = form.querySelector('form'); - formElement.manager = this; - formElement.position = position; - formElement.addEventListener('submit', function (e) { - e.preventDefault(); - - const myForm = e.currentTarget; - myForm.manager.submitUiElementForm(myForm, function () { - if (this.status === 200) { - let data = JSON.parse(this.responseText); - if (data.error) { - this.form.manager.drawNewForm(data.form_html, this.form.position); - } else { - this.form.manager.create(data.code, data.data, data.previewHtml, this.form.position); - this.form.manager.newPanel.close(); - this.form.manager.selectionPanel.close(); - } + } + + initUiElements(stack, initInterfaceCallback) { + this.uiElements = []; + this.requestUiElementsHtml(stack, function () { + // this = req + if (this.status === 200) { + let renderedElements = JSON.parse(this.responseText); + renderedElements.forEach(function (elementHtml, position) { + let element = stack[position]; + if (element.code === undefined && element.type !== undefined) { + element.code = element.type; + element.data = element.fields; + delete element.type; + delete element.fields; + } + let uiElement = this.config.findUiElementByCode(element.code); + if (null !== uiElement) { + this.uiElements.push(new MonsieurBizRichEditorUiElement( + this.config, + uiElement.code, + element.data, + elementHtml + )); + } + }.bind(this.manager)); + initInterfaceCallback(); + } + }); + } + + initInterface() { + this.initUiElementsInterface(); + this.initUiPanelsInterface(); + document.dispatchEvent(new CustomEvent('mbiz:rich-editor:init-interface-complete', { + 'detail': {'editorManager': this} + })); + document.addEventListener('mbiz:rich-editor:uielement:copied', function (e) { + this.container.querySelectorAll('.js-uie-paste').forEach(function (action) { + action.classList.remove('disabled'); + }.bind(this)); + }.bind(this)); + } + + initUiPanelsInterface() { + let panelsWrapper = document.createElement('div'); + panelsWrapper.innerHTML = Mustache.render(this.config.panelsHtml, { uid: this.config.uid }); + document.body.appendChild(panelsWrapper.firstElementChild); + + let panelsEditWrapper = document.createElement('div'); + panelsEditWrapper.innerHTML = Mustache.render(this.config.panelsEditHtml, { + uid: this.config.uid, + }); + document.body.appendChild(panelsEditWrapper.firstElementChild); + + this.selectionPanel = new Dialog('.js-uie-panels-' + this.config.uid, { + labelledby: 'uie-heading-' + this.config.uid, + enableAutoFocus: false, + closingSelector: '.js-uie-panels-close-' + this.config.uid, + }); + this.newPanel = new Dialog('.js-uie-panels-new-' + this.config.uid, { + helperSelector: '.js-uie-panels-selector-' + this.config.uid, + enableAutoFocus: false, + }); + this.editPanel = new Dialog('.js-uie-panels-edit-' + this.config.uid, { + enableAutoFocus: false, + }); + } + + initUiElementsInterface() { + this.input.type = 'hidden'; + // container first + let containerWrapper = document.createElement('div'); + containerWrapper.innerHTML = Mustache.render(this.config.containerHtml, {}); + this.container = containerWrapper.firstElementChild; + this.input.after(this.container); + + // Redraw all elements then (using a write to keep compatibility) + this.write(); + } + + drawUiElements() { + // Elements + let elementsContainer = this.container.querySelector('.js-uie-container'); + elementsContainer.innerHTML = ''; + this.uiElements.forEach(function (element, position) { + elementsContainer.append(this.getActions(position)); + elementsContainer.append(this.getUiElement(element, position)); + }.bind(this)); + elementsContainer.append(this.getActions(this.uiElements.length)); + } + + getActions(position) { + let actionsWrapper = document.createElement('div'); + actionsWrapper.innerHTML = Mustache.render(this.config.actionsHtml, {'position': position}); + + let actions = actionsWrapper.firstElementChild; + + // Add button + actions.querySelector('.js-uie-add').position = position; + actions.querySelector('.js-uie-add').manager = this; + actions.querySelector('.js-uie-add').addEventListener('click', function (e) { + actions.querySelector('.js-uie-add').manager.openSelectionPanel( + actions.querySelector('.js-uie-add').position + ); + }); + + // Paste clipboard button + actions.querySelector('.js-uie-paste').position = position; + actions.querySelector('.js-uie-paste').manager = this; + actions.querySelector('.js-uie-paste').addEventListener('click', function (e) { + actions.querySelector('.js-uie-paste').manager.pasteUiElementFromClipboard( + actions.querySelector('.js-uie-paste').position + ); + }); + // Disabled? + if (!this.isClipboardEmpty()) { + actions.querySelector('.js-uie-paste').classList.remove('disabled'); } - if (this.status !== 200) { - alert(this.form.manager.config.errorMessage); + + return actions; + } + + getUiElement(element, position) { + let elementWrapper = document.createElement('div'); + elementWrapper.innerHTML = Mustache.render(this.config.elementHtml, { + 'title': element.title, + 'icon': element.icon, + 'preview': element.previewHtml, + 'disabled': !element.enabled + }); + let uiElement = elementWrapper.firstElementChild; + uiElement.element = element; + uiElement.position = position; + uiElement.querySelector('.js-uie-delete').addEventListener('click', function () { + if (confirm(this.closest('.js-uie-element').element.config.deletionConfirmation)) { + this.closest('.js-uie-element').element.delete(); + } + }); + if (position === 0) { + uiElement.querySelector('.js-uie-up').remove(); + } else { + uiElement.querySelector('.js-uie-up').addEventListener('click', function () { + this.closest('.js-uie-element').element.up(); + }); } - }); - return false; - }); - - // Buttons - let cancelButton = form.querySelector('.js-uie-cancel'); - cancelButton.panel = this.newPanel; - cancelButton.addEventListener('click', function (e) { - e.currentTarget.panel.close(); - }); - let saveButton = form.querySelector('.js-uie-save'); - saveButton.panel = this.newPanel; - saveButton.addEventListener('click', function (e) { - e.currentTarget.panel.dialog.querySelector('form').dispatchEvent( - new Event('submit', {cancelable: true}) - ); - }); - } - - openNewPanel(formHtml, element, position) { - this.newPanel.dialog.manager = this; - this.newPanel.dialog.position = position; - - // Fill the panel with the form - this.drawNewForm(formHtml, position); - - this.newPanel.open(); - } - - editUiElement(uiElement) { - this.loadUiElementEditForm(uiElement, function (progress) { - if (this.status === 200) { - let data = JSON.parse(this.responseText); - uiElement.manager.openEditPanel(data['form_html'], uiElement) - } - }); - } - - drawEditForm(formHtml, uiElement) { - this.editPanel.dialog.querySelector('.js-uie-content').innerHTML = formHtml; - let form = this.editPanel.dialog; - - initEditors(form); - this.dispatchInitFormEvent(form, this); - - // Form submit - let formElement = form.querySelector('form'); - formElement.manager = this; - formElement.uiElement = uiElement; - formElement.addEventListener('submit', function (e) { - e.preventDefault(); - - const myForm = e.currentTarget; - myForm.manager.submitUiElementForm(myForm, function () { - if (this.status === 200) { - let data = JSON.parse(this.responseText); - if (data.error) { - this.form.manager.drawEditForm(data.form_html, this.form.uiElement); - } else { - this.form.uiElement.data = data.data; - this.form.uiElement.previewHtml = data.previewHtml; - this.form.manager.write(); - this.form.manager.editPanel.close(); - } + if (position === (this.uiElements.length - 1)) { + uiElement.querySelector('.js-uie-down').remove(); + } else { + uiElement.querySelector('.js-uie-down').addEventListener('click', function () { + this.closest('.js-uie-element').element.down(); + }); } - if (this.status !== 200) { - alert(this.config.errorMessage); + uiElement.querySelector('.js-uie-edit').addEventListener('click', function () { + this.closest('.js-uie-element').element.edit(); + }); + uiElement.querySelector('.js-uie-copy').addEventListener('click', function (e) { + this.closest('.js-uie-element').element.copy(function () { + const button = e.currentTarget; + const originalText = button.dataset.tooltip; + button.dataset.tooltip = button.dataset.alternateText; + window.setTimeout(function () { + button.dataset.tooltip = originalText; + }, 1000); + }); + }); + return uiElement; + } + + getNewUiElementCard(element, position) { + let cardWrapper = document.createElement('div'); + cardWrapper.innerHTML = Mustache.render(this.config.elementCardHtml, element); + let button = cardWrapper.firstElementChild; + button.element = element; + button.position = position; + button.manager = this; + button.addEventListener('click', function (e) { + let button = e.currentTarget; + button.manager.loadUiElementCreateForm(button.element, function (progress) { + if (this.status === 200) { + let data = JSON.parse(this.responseText); + button.manager.openNewPanel(data['form_html'], button.element, button.position) + } + }); + }); + return button; + } + + get input() { + return this.config.input; + } + + openSelectionPanel(position) { + this.selectionPanel.dialog.manager = this; + this.selectionPanel.dialog.position = position; + + // Draw element cards + let cardsContainer = this.selectionPanel.dialog.querySelector('.js-uie-cards-container'); + cardsContainer.innerHTML = ''; + for (let elementCode in this.config.uielements) { + if ( + this.config.uielements[elementCode].ignored // duplicates using aliases + || !this.config.uielements[elementCode].enabled // avoid disabled elements to show up! + ) { + continue; + } + let append = true; + if (this.tags.length > 0) { + append = !this.tagsAreExclusive; + for (let tagIndex in this.tags) { // We proceed tag by tag, excluding and including for every tag, so the order matters! + let realTag = this.tags[tagIndex].replace(/^(-|\+)/, ''); + if (0 <= this.config.uielements[elementCode].tags.indexOf(realTag)) { // The element is tagged + append = !this.tags[tagIndex].startsWith('-'); // Append only if the tag is not excluded + } + } + } + if (append) { + cardsContainer.append(this.getNewUiElementCard(this.config.uielements[elementCode], position)); + } } - }); - return false; - }); - - // Buttons - let cancelButton = form.querySelector('.js-uie-cancel'); - cancelButton.panel = this.editPanel; - cancelButton.addEventListener('click', function (e) { - e.currentTarget.panel.close(); - }); - let saveButton = form.querySelector('.js-uie-save'); - saveButton.panel = this.editPanel; - saveButton.addEventListener('click', function (e) { - e.currentTarget.panel.dialog.querySelector('form').dispatchEvent( - new Event('submit', {cancelable: true}) - ); - }); - } - - openEditPanel(formHtml, uiElement) { - this.editPanel.dialog.manager = this; - this.editPanel.dialog.uiElement = uiElement; - - // Fill the panel with the form - this.drawEditForm(formHtml, uiElement); - - this.editPanel.open(); - } - - write() { - this.input.value = (this.uiElements.length > 0) ? JSON.stringify(this.uiElements) : ''; - this.drawUiElements(); - document.dispatchEvent(new CustomEvent('mbiz:rich-editor:write-complete', { - 'detail': {'editorManager': this} - })); - } - - create(code, data, previewHtml, position) { - let uiElement = new MonsieurBizRichEditorUiElement(this.config, code, data, previewHtml); - this.uiElements.splice(position, 0, uiElement); - this.write(); - return uiElement; - } - - moveUp(uiElement) { - let position = this.uiElements.indexOf(uiElement); - if (position === 0) { - return; - } - this.uiElements.splice(position, 1); - this.uiElements.splice(position - 1, 0, uiElement); - this.write(); - } - - moveDown(uiElement) { - let position = this.uiElements.indexOf(uiElement); - if (position === (this.uiElements.length - 1)) { - return; - } - this.uiElements.splice(position, 1); - this.uiElements.splice(position + 1, 0, uiElement); - this.write(); - } - - delete(uiElement) { - let position = this.uiElements.indexOf(uiElement); - this.uiElements.splice(position, 1); - this.write(); - } - - loadUiElementCreateForm(element, callback) { - let req = new XMLHttpRequest(); - req.onload = callback; - let url = this.config.createElementFormUrl; - req.open("get", url.replace('__CODE__', element.code), true); - req.setRequestHeader("X-Requested-With", "XMLHttpRequest"); - req.send(); - } - - loadUiElementEditForm(element, callback) { - let req = new XMLHttpRequest(); - req.onload = callback; - let url = this.config.editElementFormUrl; - req.open("post", url.replace('__CODE__', element.code), true); - req.setRequestHeader("X-Requested-With", "XMLHttpRequest"); - req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - req.send(new URLSearchParams({data: JSON.stringify(element.data)}).toString()); - } - - submitUiElementForm(form, callback) { - let req = new XMLHttpRequest(); - req.onload = callback; - req.form = form; - req.open("post", form.action, true); - req.setRequestHeader("X-Requested-With", "XMLHttpRequest"); - req.send(new FormData(form)); - } - - requestUiElementsHtml(uiElements, callback) { - let req = new XMLHttpRequest(); - req.onload = callback; - req.open("post", this.config.renderElementsUrl, true); - req.setRequestHeader("X-Requested-With", "XMLHttpRequest"); - let data = new FormData(); - data.append('ui_elements', JSON.stringify(uiElements)); - if (this.input.dataset.locale) { - data.append('locale', this.input.dataset.locale); - } - req.uiElements = uiElements; - req.manager = this; - req.send(data); - } - - isClipboardEmpty() { - const clipboard = window.localStorage.getItem('monsieurBizRichEditorClipboard'); - return null === clipboard || '' === clipboard; - } - - saveUiElementToClipboard(uiElement, callback) { - window.localStorage.setItem('monsieurBizRichEditorClipboard', JSON.stringify(uiElement)); - callback(); - document.dispatchEvent(new CustomEvent('mbiz:rich-editor:uielement:copied', {})); - } - - pasteUiElementFromClipboard(futurePosition) { - const clipboard = window.localStorage.getItem('monsieurBizRichEditorClipboard'); - if (null !== clipboard) { - const pastedUiElement = JSON.parse(clipboard); - const manager = this; - manager.requestUiElementsHtml([pastedUiElement], function () { - if (this.status === 200) { - let renderedElements = JSON.parse(this.responseText); - const elementHtml = renderedElements.shift(); - if (pastedUiElement.code === undefined && pastedUiElement.type !== undefined) { - pastedUiElement.code = pastedUiElement.type; - pastedUiElement.data = pastedUiElement.fields; - delete pastedUiElement.type; - delete pastedUiElement.fields; - } - let uiElement = manager.config.findUiElementByCode(pastedUiElement.code); - if (null !== uiElement) { - if (manager.tags.length > 0) { - let copy = false; - for (let tagIndex in manager.tags) { - if (0 <= manager.config.uielements[uiElement.code].tags.indexOf(manager.tags[tagIndex])) { - copy = true; + this.newPanel.close(); + this.selectionPanel.open(); + } + + drawNewForm(formHtml, position) { + this.newPanel.dialog.innerHTML = formHtml; + let form = this.newPanel.dialog; + initEditors(form); + this.dispatchInitFormEvent(form, this); + + // Form submit + let formElement = form.querySelector('form'); + formElement.manager = this; + formElement.position = position; + formElement.addEventListener('submit', function (e) { + e.preventDefault(); + + const myForm = e.currentTarget; + myForm.manager.submitUiElementForm(myForm, function () { + if (this.status === 200) { + let data = JSON.parse(this.responseText); + if (data.error) { + this.form.manager.drawNewForm(data.form_html, this.form.position); + } else { + this.form.manager.create(data.code, data.data, data.previewHtml, this.form.position); + this.form.manager.newPanel.close(); + this.form.manager.selectionPanel.close(); + } + } + if (this.status !== 200) { + alert(this.form.manager.config.errorMessage); } - } - if (copy) { - manager.create(uiElement.code, pastedUiElement.data, elementHtml, futurePosition); - } else { - alert(manager.config.unallowedUiElementMessage); - } - } else { - manager.create(uiElement.code, pastedUiElement.data, elementHtml, futurePosition); + }); + return false; + }); + + // Buttons + let cancelButton = form.querySelector('.js-uie-cancel'); + cancelButton.panel = this.newPanel; + cancelButton.addEventListener('click', function (e) { + e.currentTarget.panel.close(); + }); + let saveButton = form.querySelector('.js-uie-save'); + saveButton.panel = this.newPanel; + saveButton.addEventListener('click', function (e) { + e.currentTarget.panel.dialog.querySelector('form').dispatchEvent( + new Event('submit', {cancelable: true}) + ); + }); + } + + openNewPanel(formHtml, element, position) { + this.newPanel.dialog.manager = this; + this.newPanel.dialog.position = position; + + // Fill the panel with the form + this.drawNewForm(formHtml, position); + + this.newPanel.open(); + } + + editUiElement(uiElement) { + this.loadUiElementEditForm(uiElement, function (progress) { + if (this.status === 200) { + let data = JSON.parse(this.responseText); + uiElement.manager.openEditPanel(data['form_html'], uiElement) } - } + }); + } + + drawEditForm(formHtml, uiElement) { + this.editPanel.dialog.querySelector('.js-uie-content').innerHTML = formHtml; + let form = this.editPanel.dialog; + + initEditors(form); + this.dispatchInitFormEvent(form, this); + + // Form submit + let formElement = form.querySelector('form'); + formElement.manager = this; + formElement.uiElement = uiElement; + formElement.addEventListener('submit', function (e) { + e.preventDefault(); + + const myForm = e.currentTarget; + myForm.manager.submitUiElementForm(myForm, function () { + if (this.status === 200) { + let data = JSON.parse(this.responseText); + if (data.error) { + this.form.manager.drawEditForm(data.form_html, this.form.uiElement); + } else { + this.form.uiElement.data = data.data; + this.form.uiElement.previewHtml = data.previewHtml; + this.form.manager.write(); + this.form.manager.editPanel.close(); + } + } + if (this.status !== 200) { + alert(this.config.errorMessage); + } + }); + return false; + }); + + // Buttons + let cancelButton = form.querySelector('.js-uie-cancel'); + cancelButton.panel = this.editPanel; + cancelButton.addEventListener('click', function (e) { + e.currentTarget.panel.close(); + }); + let saveButton = form.querySelector('.js-uie-save'); + saveButton.panel = this.editPanel; + saveButton.addEventListener('click', function (e) { + e.currentTarget.panel.dialog.querySelector('form').dispatchEvent( + new Event('submit', {cancelable: true}) + ); + }); + } + + openEditPanel(formHtml, uiElement) { + this.editPanel.dialog.manager = this; + this.editPanel.dialog.uiElement = uiElement; + + // Fill the panel with the form + this.drawEditForm(formHtml, uiElement); + + this.editPanel.open(); + } + + write() { + this.input.value = (this.uiElements.length > 0) ? JSON.stringify(this.uiElements) : ''; + this.drawUiElements(); + document.dispatchEvent(new CustomEvent('mbiz:rich-editor:write-complete', { + 'detail': {'editorManager': this} + })); + } + + create(code, data, previewHtml, position) { + let uiElement = new MonsieurBizRichEditorUiElement(this.config, code, data, previewHtml); + this.uiElements.splice(position, 0, uiElement); + this.write(); + return uiElement; + } + + moveUp(uiElement) { + let position = this.uiElements.indexOf(uiElement); + if (position === 0) { + return; + } + this.uiElements.splice(position, 1); + this.uiElements.splice(position - 1, 0, uiElement); + this.write(); + } + + moveDown(uiElement) { + let position = this.uiElements.indexOf(uiElement); + if (position === (this.uiElements.length - 1)) { + return; + } + this.uiElements.splice(position, 1); + this.uiElements.splice(position + 1, 0, uiElement); + this.write(); + } + + delete(uiElement) { + let position = this.uiElements.indexOf(uiElement); + this.uiElements.splice(position, 1); + this.write(); + } + + loadUiElementCreateForm(element, callback) { + let req = new XMLHttpRequest(); + req.onload = callback; + let url = this.config.createElementFormUrl; + req.open("get", url.replace('__CODE__', element.code), true); + req.setRequestHeader("X-Requested-With", "XMLHttpRequest"); + req.send(); + } + + loadUiElementEditForm(element, callback) { + let req = new XMLHttpRequest(); + req.onload = callback; + let url = this.config.editElementFormUrl; + req.open("post", url.replace('__CODE__', element.code), true); + req.setRequestHeader("X-Requested-With", "XMLHttpRequest"); + req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); + req.send(new URLSearchParams({data: JSON.stringify(element.data)}).toString()); + } + + submitUiElementForm(form, callback) { + let req = new XMLHttpRequest(); + req.onload = callback; + req.form = form; + req.open("post", form.action, true); + req.setRequestHeader("X-Requested-With", "XMLHttpRequest"); + req.send(new FormData(form)); + } + + requestUiElementsHtml(uiElements, callback) { + let req = new XMLHttpRequest(); + req.onload = callback; + req.open("post", this.config.renderElementsUrl, true); + req.setRequestHeader("X-Requested-With", "XMLHttpRequest"); + let data = new FormData(); + data.append('ui_elements', JSON.stringify(uiElements)); + if (this.input.dataset.locale) { + data.append('locale', this.input.dataset.locale); + } + req.uiElements = uiElements; + req.manager = this; + req.send(data); + } + + isClipboardEmpty() { + const clipboard = window.localStorage.getItem('monsieurBizRichEditorClipboard'); + return null === clipboard || '' === clipboard; + } + + saveUiElementToClipboard(uiElement, callback) { + window.localStorage.setItem('monsieurBizRichEditorClipboard', JSON.stringify(uiElement)); + callback(); + document.dispatchEvent(new CustomEvent('mbiz:rich-editor:uielement:copied', {})); + } + + pasteUiElementFromClipboard(futurePosition) { + const clipboard = window.localStorage.getItem('monsieurBizRichEditorClipboard'); + if (null !== clipboard) { + const pastedUiElement = JSON.parse(clipboard); + const manager = this; + manager.requestUiElementsHtml([pastedUiElement], function () { + if (this.status === 200) { + let renderedElements = JSON.parse(this.responseText); + const elementHtml = renderedElements.shift(); + if (pastedUiElement.code === undefined && pastedUiElement.type !== undefined) { + pastedUiElement.code = pastedUiElement.type; + pastedUiElement.data = pastedUiElement.fields; + delete pastedUiElement.type; + delete pastedUiElement.fields; + } + let uiElement = manager.config.findUiElementByCode(pastedUiElement.code); + if (null !== uiElement) { + if (manager.tags.length > 0) { + let copy = false; + for (let tagIndex in manager.tags) { + if (0 <= manager.config.uielements[uiElement.code].tags.indexOf(manager.tags[tagIndex])) { + copy = true; + } + } + if (copy) { + manager.create(uiElement.code, pastedUiElement.data, elementHtml, futurePosition); + } else { + alert(manager.config.unallowedUiElementMessage); + } + } else { + manager.create(uiElement.code, pastedUiElement.data, elementHtml, futurePosition); + } + } + } + }); } - }); } - } - dispatchInitFormEvent(form, manager) { - document.dispatchEvent(new CustomEvent('monsieurBizRichEditorInitForm', { - 'detail': {'form': form, 'manager': manager} - })); - } + dispatchInitFormEvent(form, manager) { + document.dispatchEvent(new CustomEvent('monsieurBizRichEditorInitForm', { + 'detail': {'form': form, 'manager': manager} + })); + } }; diff --git a/src/Resources/views/Admin/app.html.twig b/src/Resources/views/Admin/app.html.twig index f10ecbda..34c39da4 100644 --- a/src/Resources/views/Admin/app.html.twig +++ b/src/Resources/views/Admin/app.html.twig @@ -158,11 +158,12 @@ }); // JQuery event triggered by @SyliusUiBundle/Resources/private/js/sylius-form-collection.js - $(document).on('collection-form-add', function(event, children) { - // It returns an array with one object : the new element - children.each(function (index, child) { - wysiwyg.load(child); - }); + $(document).on('collection-form-add', (event, addedElement) => { + document.dispatchEvent(new CustomEvent('rich-editor:reload', { + detail: { + target: addedElement[0], + } + })); }); document.addEventListener('monsieurBizRichEditorInitForm', (e) => { From bd9344f421f8b184c80dd10bc5fcfeac91f373b5 Mon Sep 17 00:00:00 2001 From: Maxime Leclercq Date: Thu, 2 May 2024 10:31:57 +0200 Subject: [PATCH 3/3] chore: generate new js file --- src/Resources/public/js/rich-editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Resources/public/js/rich-editor.js b/src/Resources/public/js/rich-editor.js index 928420a7..37775dde 100644 --- a/src/Resources/public/js/rich-editor.js +++ b/src/Resources/public/js/rich-editor.js @@ -1,2 +1,2 @@ /*! For license information please see rich-editor.js.LICENSE.txt */ -(()=>{var e={237:function(e){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,i=/gecko\/\d/i.test(e),n=/MSIE \d/.test(e),o=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),l=/Edge\/(\d+)/.exec(e),r=n||o||l,s=r&&(n?document.documentMode||6:+(l||o)[1]),a=!l&&/WebKit\//.test(e),c=a&&/Qt\/\d+\.\d+/.test(e),u=!l&&/Chrome\/(\d+)/.exec(e),d=u&&+u[1],h=/Opera\//.test(e),p=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),g=/PhantomJS/.test(e),m=p&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),v=/Android/.test(e),b=m||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=m||/Mac/.test(t),w=/\bCrOS\b/.test(e),_=/win/i.test(t),x=h&&e.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(h=!1,a=!0);var C=y&&(c||h&&(null==x||x<12.11)),k=i||r&&s>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var L,E=function(e,t){var i=e.className,n=S(t).exec(i);if(n){var o=i.slice(n.index+n[0].length);e.className=i.slice(0,n.index)+(o?n[1]+o:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function N(e,t){return T(e).appendChild(t)}function z(e,t,i,n){var o=document.createElement(e);if(i&&(o.className=i),n&&(o.style.cssText=n),"string"==typeof t)o.appendChild(document.createTextNode(t));else if(t)for(var l=0;l=t)return r+(t-l);r+=s-l,r+=i-r%i,l=s+1}}m?O=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:r&&(O=function(e){try{e.select()}catch(e){}});var j=function(){this.id=null,this.f=null,this.time=0,this.handler=V(this.onTimeout,this)};function q(e,t){for(var i=0;i=t)return n+Math.min(r,t-o);if(o+=l-n,n=l+1,(o+=i-o%i)>=t)return n}}var J=[""];function Q(e){for(;J.length<=e;)J.push(ee(J)+" ");return J[e]}function ee(e){return e[e.length-1]}function te(e,t){for(var i=[],n=0;n"€"&&(e.toUpperCase()!=e.toLowerCase()||le.test(e))}function se(e,t){return t?!!(t.source.indexOf("\\w")>-1&&re(e))||t.test(e):re(e)}function ae(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ce=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ue(e){return e.charCodeAt(0)>=768&&ce.test(e)}function de(e,t,i){for(;(i<0?t>0:ti?-1:1;;){if(t==i)return t;var o=(t+i)/2,l=n<0?Math.ceil(o):Math.floor(o);if(l==t)return e(l)?t:i;e(l)?i=l:t=l+n}}function pe(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var o=!1,l=0;lt||t==i&&r.to==t)&&(n(Math.max(r.from,t),Math.min(r.to,i),1==r.level?"rtl":"ltr",l),o=!0)}o||n(t,i,"ltr")}var fe=null;function ge(e,t,i){var n;fe=null;for(var o=0;ot)return o;l.to==t&&(l.from!=l.to&&"before"==i?n=o:fe=o),l.from==t&&(l.from!=l.to&&"before"!=i?n=o:fe=o)}return null!=n?n:fe}var me=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(i){return i<=247?e.charAt(i):1424<=i&&i<=1524?"R":1536<=i&&i<=1785?t.charAt(i-1536):1774<=i&&i<=2220?"r":8192<=i&&i<=8203?"w":8204==i?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,l=/[LRr]/,r=/[Lb1n]/,s=/[1n]/;function a(e,t,i){this.level=e,this.from=t,this.to=i}return function(e,t){var c="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!n.test(e))return!1;for(var u=e.length,d=[],h=0;h-1&&(n[t]=o.slice(0,l).concat(o.slice(l+1)))}}}function xe(e,t){var i=we(e,t);if(i.length)for(var n=Array.prototype.slice.call(arguments,2),o=0;o0}function Le(e){e.prototype.on=function(e,t){ye(this,e,t)},e.prototype.off=function(e,t){_e(this,e,t)}}function Ee(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Te(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ne(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function ze(e){Ee(e),Te(e)}function Ae(e){return e.target||e.srcElement}function Me(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var Be,Re,Ie=function(){if(r&&s<9)return!1;var e=z("div");return"draggable"in e||"dragDrop"in e}();function Oe(e){if(null==Be){var t=z("span","​");N(e,z("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Be=t.offsetWidth<=1&&t.offsetHeight>2&&!(r&&s<8))}var i=Be?z("span","​"):z("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function He(e){if(null!=Re)return Re;var t=N(e,document.createTextNode("AخA")),i=L(t,0,1).getBoundingClientRect(),n=L(t,1,2).getBoundingClientRect();return T(e),!(!i||i.left==i.right)&&(Re=n.right-i.right<3)}var De,Fe=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,i=[],n=e.length;t<=n;){var o=e.indexOf("\n",t);-1==o&&(o=e.length);var l=e.slice(t,"\r"==e.charAt(o-1)?o-1:o),r=l.indexOf("\r");-1!=r?(i.push(l.slice(0,r)),t+=r+1):(i.push(l),t=o+1)}return i}:function(e){return e.split(/\r\n?|\n/)},Pe=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Ve="oncopy"in(De=z("div"))||(De.setAttribute("oncopy","return;"),"function"==typeof De.oncopy),Ue=null;function We(e){if(null!=Ue)return Ue;var t=N(e,z("span","x")),i=t.getBoundingClientRect(),n=L(t,0,1).getBoundingClientRect();return Ue=Math.abs(i.left-n.left)>1}var je={},qe={};function Ze(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),je[e]=t}function Ge(e,t){qe[e]=t}function $e(e){if("string"==typeof e&&qe.hasOwnProperty(e))e=qe[e];else if(e&&"string"==typeof e.name&&qe.hasOwnProperty(e.name)){var t=qe[e.name];"string"==typeof t&&(t={name:t}),(e=oe(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return $e("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return $e("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ye(e,t){t=$e(t);var i=je[t.name];if(!i)return Ye(e,"text/plain");var n=i(e,t);if(Ke.hasOwnProperty(t.name)){var o=Ke[t.name];for(var l in o)o.hasOwnProperty(l)&&(n.hasOwnProperty(l)&&(n["_"+l]=n[l]),n[l]=o[l])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var r in t.modeProps)n[r]=t.modeProps[r];return n}var Ke={};function Xe(e,t){U(t,Ke.hasOwnProperty(e)?Ke[e]:Ke[e]={})}function Je(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var i={};for(var n in t){var o=t[n];o instanceof Array&&(o=o.concat([])),i[n]=o}return i}function Qe(e,t){for(var i;e.innerMode&&(i=e.innerMode(t))&&i.mode!=e;)t=i.state,e=i.mode;return i||{mode:e,state:t}}function et(e,t,i){return!e.startState||e.startState(t,i)}var tt=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};function it(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var n=0;;++n){var o=i.children[n],l=o.chunkSize();if(t=e.first&&ti?ut(i,it(e,i).text.length):bt(t,it(e,t.line).text.length)}function bt(e,t){var i=e.ch;return null==i||i>t?ut(e.line,t):i<0?ut(e.line,0):e}function yt(e,t){for(var i=[],n=0;n=this.string.length},tt.prototype.sol=function(){return this.pos==this.lineStart},tt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},tt.prototype.next=function(){if(this.post},tt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},tt.prototype.skipToEnd=function(){this.pos=this.string.length},tt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},tt.prototype.backUp=function(e){this.pos-=e},tt.prototype.column=function(){return this.lastColumnPos0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var o=function(e){return i?e.toLowerCase():e};if(o(this.string.substr(this.pos,e.length))==o(e))return!1!==t&&(this.pos+=e.length),!0},tt.prototype.current=function(){return this.string.slice(this.start,this.pos)},tt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},tt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},tt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var wt=function(e,t){this.state=e,this.lookAhead=t},_t=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};function xt(e,t,i,n){var o=[e.state.modeGen],l={};At(e,t.text,e.doc.mode,i,(function(e,t){return o.push(e,t)}),l,n);for(var r=i.state,s=function(n){i.baseTokens=o;var s=e.state.overlays[n],a=1,c=0;i.state=!0,At(e,t.text,s.mode,i,(function(e,t){for(var i=a;ce&&o.splice(a,1,e,o[a+1],n),a+=2,c=Math.min(e,n)}if(t)if(s.opaque)o.splice(i,a-i,e,"overlay "+t),a=i+2;else for(;ie.options.maxHighlightLength&&Je(e.doc.mode,n.state),l=xt(e,t,n);o&&(n.state=o),t.stateAfter=n.save(!o),t.styles=l.styles,l.classes?t.styleClasses=l.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function kt(e,t,i){var n=e.doc,o=e.display;if(!n.mode.startState)return new _t(n,!0,t);var l=Mt(e,t,i),r=l>n.first&&it(n,l-1).stateAfter,s=r?_t.fromSaved(n,r,l):new _t(n,et(n.mode),l);return n.iter(l,t,(function(i){St(e,i.text,s);var n=s.line;i.stateAfter=n==t-1||n%5==0||n>=o.viewFrom&&nt.start)return l}throw new Error("Mode "+e.name+" failed to advance stream.")}_t.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},_t.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},_t.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},_t.fromSaved=function(e,t,i){return t instanceof wt?new _t(e,Je(e.mode,t.state),i,t.lookAhead):new _t(e,Je(e.mode,t),i)},_t.prototype.save=function(e){var t=!1!==e?Je(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new wt(t,this.maxLookAhead):t};var Tt=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Nt(e,t,i,n){var o,l,r=e.doc,s=r.mode,a=it(r,(t=vt(r,t)).line),c=kt(e,t.line,i),u=new tt(a.text,e.options.tabSize,c);for(n&&(l=[]);(n||u.pose.options.maxHighlightLength?(s=!1,r&&St(e,t,n,d.pos),d.pos=t.length,a=null):a=zt(Et(i,d,n.state,h),l),h){var p=h[0].name;p&&(a="m-"+(a?p+" "+a:p))}if(!s||u!=a){for(;cr;--s){if(s<=l.first)return l.first;var a=it(l,s-1),c=a.stateAfter;if(c&&(!i||s+(c instanceof wt?c.lookAhead:0)<=l.modeFrontier))return s;var u=W(a.text,null,e.options.tabSize);(null==o||n>u)&&(o=s-1,n=u)}return o}function Bt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontieri;n--){var o=it(e,n).stateAfter;if(o&&(!(o instanceof wt)||n+o.lookAhead=t:l.to>t);(n||(n=[])).push(new Dt(r,l.from,s?null:l.to))}}return n}function Wt(e,t,i){var n;if(e)for(var o=0;o=t:l.to>t)||l.from==t&&"bookmark"==r.type&&(!i||l.marker.insertLeft)){var s=null==l.from||(r.inclusiveLeft?l.from<=t:l.from0&&s)for(var y=0;y0)){var u=[a,1],d=dt(c.from,s.from),h=dt(c.to,s.to);(d<0||!r.inclusiveLeft&&!d)&&u.push({from:c.from,to:s.from}),(h>0||!r.inclusiveRight&&!h)&&u.push({from:s.to,to:c.to}),o.splice.apply(o,u),a+=u.length-3}}return o}function Gt(e){var t=e.markedSpans;if(t){for(var i=0;it)&&(!i||Xt(i,l.marker)<0)&&(i=l.marker)}return i}function ii(e,t,i,n,o){var l=it(e,t),r=It&&l.markedSpans;if(r)for(var s=0;s=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(a.marker.inclusiveRight&&o.inclusiveLeft?dt(c.to,i)>=0:dt(c.to,i)>0)||u>=0&&(a.marker.inclusiveRight&&o.inclusiveLeft?dt(c.from,n)<=0:dt(c.from,n)<0)))return!0}}}function ni(e){for(var t;t=Qt(e);)e=t.find(-1,!0).line;return e}function oi(e){for(var t;t=ei(e);)e=t.find(1,!0).line;return e}function li(e){for(var t,i;t=ei(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function ri(e,t){var i=it(e,t),n=ni(i);return i==n?t:rt(n)}function si(e,t){if(t>e.lastLine())return t;var i,n=it(e,t);if(!ai(e,n))return t;for(;i=ei(n);)n=i.find(1,!0).line;return rt(n)+1}function ai(e,t){var i=It&&t.markedSpans;if(i)for(var n=void 0,o=0;ot.maxLineLength&&(t.maxLineLength=i,t.maxLine=e)}))}var pi=function(e,t,i){this.text=e,$t(this,t),this.height=i?i(this):1};function fi(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Gt(e),$t(e,i);var o=n?n(e):1;o!=e.height&<(e,o)}function gi(e){e.parent=null,Gt(e)}pi.prototype.lineNo=function(){return rt(this)},Le(pi);var mi={},vi={};function bi(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?vi:mi;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function yi(e,t){var i=A("span",null,null,a?"padding-right: .1px":null),n={pre:A("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var l=o?t.rest[o-1]:t.line,r=void 0;n.pos=0,n.addToken=_i,He(e.display.measure)&&(r=ve(l,e.doc.direction))&&(n.addToken=Ci(n.addToken,r)),n.map=[],Si(l,n,Ct(e,l,t!=e.display.externalMeasured&&rt(l))),l.styleClasses&&(l.styleClasses.bgClass&&(n.bgClass=I(l.styleClasses.bgClass,n.bgClass||"")),l.styleClasses.textClass&&(n.textClass=I(l.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(Oe(e.display.measure))),0==o?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(a){var s=n.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return xe(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=I(n.pre.className,n.textClass||"")),n}function wi(e){var t=z("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function _i(e,t,i,n,o,l,a){if(t){var c,u=e.splitSpaces?xi(t,e.trailingSpace):t,d=e.cm.state.specialChars,h=!1;if(d.test(t)){c=document.createDocumentFragment();for(var p=0;;){d.lastIndex=p;var f=d.exec(t),g=f?f.index-p:t.length-p;if(g){var m=document.createTextNode(u.slice(p,p+g));r&&s<9?c.appendChild(z("span",[m])):c.appendChild(m),e.map.push(e.pos,e.pos+g,m),e.col+=g,e.pos+=g}if(!f)break;p+=g+1;var v=void 0;if("\t"==f[0]){var b=e.cm.options.tabSize,y=b-e.col%b;(v=c.appendChild(z("span",Q(y),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=y}else"\r"==f[0]||"\n"==f[0]?((v=c.appendChild(z("span","\r"==f[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",f[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(f[0])).setAttribute("cm-text",f[0]),r&&s<9?c.appendChild(z("span",[v])):c.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),r&&s<9&&(h=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),i||n||o||h||l||a){var w=i||"";n&&(w+=n),o&&(w+=o);var _=z("span",[c],w,l);if(a)for(var x in a)a.hasOwnProperty(x)&&"style"!=x&&"class"!=x&&_.setAttribute(x,a[x]);return e.content.appendChild(_)}e.content.appendChild(c)}}function xi(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",o=0;oc&&d.from<=c);h++);if(d.to>=u)return e(i,n,o,l,r,s,a);e(i,n.slice(0,d.to-c),o,l,null,s,a),l=null,n=n.slice(d.to-c),c=d.to}}}function ki(e,t,i,n){var o=!n&&i.widgetNode;o&&e.map.push(e.pos,e.pos+t,o),!n&&e.cm.display.input.needsContentAttribute&&(o||(o=e.content.appendChild(document.createElement("span"))),o.setAttribute("cm-marker",i.id)),o&&(e.cm.display.input.setUneditable(o),e.content.appendChild(o)),e.pos+=t,e.trailingSpace=!1}function Si(e,t,i){var n=e.markedSpans,o=e.text,l=0;if(n)for(var r,s,a,c,u,d,h,p=o.length,f=0,g=1,m="",v=0;;){if(v==f){a=c=u=s="",h=null,d=null,v=1/0;for(var b=[],y=void 0,w=0;wf||x.collapsed&&_.to==f&&_.from==f)){if(null!=_.to&&_.to!=f&&v>_.to&&(v=_.to,c=""),x.className&&(a+=" "+x.className),x.css&&(s=(s?s+";":"")+x.css),x.startStyle&&_.from==f&&(u+=" "+x.startStyle),x.endStyle&&_.to==v&&(y||(y=[])).push(x.endStyle,_.to),x.title&&((h||(h={})).title=x.title),x.attributes)for(var C in x.attributes)(h||(h={}))[C]=x.attributes[C];x.collapsed&&(!d||Xt(d.marker,x)<0)&&(d=_)}else _.from>f&&v>_.from&&(v=_.from)}if(y)for(var k=0;k=p)break;for(var L=Math.min(p,v);;){if(m){var E=f+m.length;if(!d){var T=E>L?m.slice(0,L-f):m;t.addToken(t,T,r?r+a:a,u,f+T.length==v?c:"",s,h)}if(E>=L){m=m.slice(L-f),f=L;break}f=E,u=""}m=o.slice(l,l=i[g++]),r=bi(i[g++],t.cm.options)}}else for(var N=1;N2&&l.push((a.bottom+c.top)/2-i.top)}}l.push(i.bottom-i.top)}}function nn(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var n=0;ni)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}}function on(e,t){var i=rt(t=ni(t)),n=e.display.externalMeasured=new Li(e.doc,t,i);n.lineN=i;var o=n.built=yi(e,n);return n.text=o.pre,N(e.display.lineMeasure,o.pre),n}function ln(e,t,i,n){return an(e,sn(e,t),i,n)}function rn(e,t){if(t>=e.display.viewFrom&&t=i.lineN&&tt)&&(o=(l=a-s)-1,t>=a&&(r="right")),null!=o){if(n=e[c+2],s==a&&i==(n.insertLeft?"left":"right")&&(r=i),"left"==i&&0==o)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)n=e[2+(c-=3)],r="left";if("right"==i&&o==a-s)for(;c=0&&(i=e[o]).left==i.right;o--);return i}function pn(e,t,i,n){var o,l=dn(t.map,i,n),a=l.node,c=l.start,u=l.end,d=l.collapse;if(3==a.nodeType){for(var h=0;h<4;h++){for(;c&&ue(t.line.text.charAt(l.coverStart+c));)--c;for(;l.coverStart+u0&&(d=n="right"),o=e.options.lineWrapping&&(p=a.getClientRects()).length>1?p["right"==n?p.length-1:0]:a.getBoundingClientRect()}if(r&&s<9&&!c&&(!o||!o.left&&!o.right)){var f=a.parentNode.getClientRects()[0];o=f?{left:f.left,right:f.left+In(e.display),top:f.top,bottom:f.bottom}:un}for(var g=o.top-t.rect.top,m=o.bottom-t.rect.top,v=(g+m)/2,b=t.view.measure.heights,y=0;y=n.text.length?(a=n.text.length,c="before"):a<=0&&(a=0,c="after"),!s)return r("before"==c?a-1:a,"before"==c);function u(e,t,i){return r(i?e-1:e,1==s[t].level!=i)}var d=ge(s,a,c),h=fe,p=u(a,d,"before"==c);return null!=h&&(p.other=u(a,h,"before"!=c)),p}function Sn(e,t){var i=0;t=vt(e.doc,t),e.options.lineWrapping||(i=In(e.display)*t.ch);var n=it(e.doc,t.line),o=ui(n)+Yi(e.display);return{left:i,right:i,top:o,bottom:o+n.height}}function Ln(e,t,i,n,o){var l=ut(e,t,i);return l.xRel=o,n&&(l.outside=n),l}function En(e,t,i){var n=e.doc;if((i+=e.display.viewOffset)<0)return Ln(n.first,0,null,-1,-1);var o=st(n,i),l=n.first+n.size-1;if(o>l)return Ln(n.first+n.size-1,it(n,l).text.length,null,1,1);t<0&&(t=0);for(var r=it(n,o);;){var s=An(e,r,o,t,i),a=ti(r,s.ch+(s.xRel>0||s.outside>0?1:0));if(!a)return s;var c=a.find(1);if(c.line==o)return c;r=it(n,o=c.line)}}function Tn(e,t,i,n){n-=wn(t);var o=t.text.length,l=he((function(t){return an(e,i,t-1).bottom<=n}),o,0);return{begin:l,end:o=he((function(t){return an(e,i,t).top>n}),l,o)}}function Nn(e,t,i,n){return i||(i=sn(e,t)),Tn(e,t,i,_n(e,t,an(e,i,n),"line").top)}function zn(e,t,i,n){return!(e.bottom<=i)&&(e.top>i||(n?e.left:e.right)>t)}function An(e,t,i,n,o){o-=ui(t);var l=sn(e,t),r=wn(t),s=0,a=t.text.length,c=!0,u=ve(t,e.doc.direction);if(u){var d=(e.options.lineWrapping?Bn:Mn)(e,t,i,l,u,n,o);s=(c=1!=d.level)?d.from:d.to-1,a=c?d.to:d.from-1}var h,p,f=null,g=null,m=he((function(t){var i=an(e,l,t);return i.top+=r,i.bottom+=r,!!zn(i,n,o,!1)&&(i.top<=o&&i.left<=n&&(f=t,g=i),!0)}),s,a),v=!1;if(g){var b=n-g.left=w.bottom?1:0}return Ln(i,m=de(t.text,m,1),p,v,n-h)}function Mn(e,t,i,n,o,l,r){var s=he((function(s){var a=o[s],c=1!=a.level;return zn(kn(e,ut(i,c?a.to:a.from,c?"before":"after"),"line",t,n),l,r,!0)}),0,o.length-1),a=o[s];if(s>0){var c=1!=a.level,u=kn(e,ut(i,c?a.from:a.to,c?"after":"before"),"line",t,n);zn(u,l,r,!0)&&u.top>r&&(a=o[s-1])}return a}function Bn(e,t,i,n,o,l,r){var s=Tn(e,t,n,r),a=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,h=0;h=c||p.to<=a)){var f=an(e,n,1!=p.level?Math.min(c,p.to)-1:Math.max(a,p.from)).right,g=fg)&&(u=p,d=g)}}return u||(u=o[o.length-1]),u.fromc&&(u={from:u.from,to:c,level:u.level}),u}function Rn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==cn){cn=z("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)cn.appendChild(document.createTextNode("x")),cn.appendChild(z("br"));cn.appendChild(document.createTextNode("x"))}N(e.measure,cn);var i=cn.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),T(e.measure),i||1}function In(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=z("span","xxxxxxxxxx"),i=z("pre",[t],"CodeMirror-line-like");N(e.measure,i);var n=t.getBoundingClientRect(),o=(n.right-n.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}function On(e){for(var t=e.display,i={},n={},o=t.gutters.clientLeft,l=t.gutters.firstChild,r=0;l;l=l.nextSibling,++r){var s=e.display.gutterSpecs[r].className;i[s]=l.offsetLeft+l.clientLeft+o,n[s]=l.clientWidth}return{fixedPos:Hn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function Hn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Dn(e){var t=Rn(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/In(e.display)-3);return function(o){if(ai(e.doc,o))return 0;var l=0;if(o.widgets)for(var r=0;r0&&(a=it(e.doc,c.line).text).length==c.ch){var u=W(a,a.length,e.options.tabSize)-a.length;c=ut(c.line,Math.max(0,Math.round((l-Xi(e.display).left)/In(e.display))-u))}return c}function Vn(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var i=e.display.view,n=0;nt)&&(o.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=o.viewTo)It&&ri(e.doc,t)o.viewFrom?jn(e):(o.viewFrom+=n,o.viewTo+=n);else if(t<=o.viewFrom&&i>=o.viewTo)jn(e);else if(t<=o.viewFrom){var l=qn(e,i,i+n,1);l?(o.view=o.view.slice(l.index),o.viewFrom=l.lineN,o.viewTo+=n):jn(e)}else if(i>=o.viewTo){var r=qn(e,t,t,-1);r?(o.view=o.view.slice(0,r.index),o.viewTo=r.lineN):jn(e)}else{var s=qn(e,t,t,-1),a=qn(e,i,i+n,1);s&&a?(o.view=o.view.slice(0,s.index).concat(Ei(e,s.lineN,a.lineN)).concat(o.view.slice(a.index)),o.viewTo+=n):jn(e)}var c=o.externalMeasured;c&&(i=o.lineN&&t=n.viewTo)){var l=n.view[Vn(e,t)];if(null!=l.node){var r=l.changes||(l.changes=[]);-1==q(r,i)&&r.push(i)}}}function jn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function qn(e,t,i,n){var o,l=Vn(e,t),r=e.display.view;if(!It||i==e.doc.first+e.doc.size)return{index:l,lineN:i};for(var s=e.display.viewFrom,a=0;a0){if(l==r.length-1)return null;o=s+r[l].size-t,l++}else o=s-t;t+=o,i+=o}for(;ri(e.doc,i)!=i;){if(l==(n<0?0:r.length-1))return null;i+=n*r[l-(n<0?1:0)].size,l+=n}return{index:l,lineN:i}}function Zn(e,t,i){var n=e.display;0==n.view.length||t>=n.viewTo||i<=n.viewFrom?(n.view=Ei(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=Ei(e,t,n.viewFrom).concat(n.view):n.viewFromi&&(n.view=n.view.slice(0,Vn(e,i)))),n.viewTo=i}function Gn(e){for(var t=e.display.view,i=0,n=0;n=e.display.viewTo||a.to().line0?r:e.defaultCharWidth())+"px"}if(n.other){var s=i.appendChild(z("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=n.other.left+"px",s.style.top=n.other.top+"px",s.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function Xn(e,t){return e.top-t.top||e.left-t.left}function Jn(e,t,i){var n=e.display,o=e.doc,l=document.createDocumentFragment(),r=Xi(e.display),s=r.left,a=Math.max(n.sizerWidth,Qi(e)-n.sizer.offsetLeft)-r.right,c="ltr"==o.direction;function u(e,t,i,n){t<0&&(t=0),t=Math.round(t),n=Math.round(n),l.appendChild(z("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==i?a-e:i)+"px;\n height: "+(n-t)+"px"))}function d(t,i,n){var l,r,d=it(o,t),h=d.text.length;function p(i,n){return Cn(e,ut(t,i),"div",d,n)}function f(t,i,n){var o=Nn(e,d,null,t),l="ltr"==i==("after"==n)?"left":"right";return p("after"==n?o.begin:o.end-(/\s/.test(d.text.charAt(o.end-1))?2:1),l)[l]}var g=ve(d,o.direction);return pe(g,i||0,null==n?h:n,(function(e,t,o,d){var m="ltr"==o,v=p(e,m?"left":"right"),b=p(t-1,m?"right":"left"),y=null==i&&0==e,w=null==n&&t==h,_=0==d,x=!g||d==g.length-1;if(b.top-v.top<=3){var C=(c?w:y)&&x,k=(c?y:w)&&_?s:(m?v:b).left,S=C?a:(m?b:v).right;u(k,v.top,S-k,v.bottom)}else{var L,E,T,N;m?(L=c&&y&&_?s:v.left,E=c?a:f(e,o,"before"),T=c?s:f(t,o,"after"),N=c&&w&&x?a:b.right):(L=c?f(e,o,"before"):s,E=!c&&y&&_?a:v.right,T=!c&&w&&x?s:b.left,N=c?f(t,o,"after"):a),u(L,v.top,E-L,v.bottom),v.bottom0?t.blinker=setInterval((function(){e.hasFocus()||no(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function eo(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||io(e))}function to(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&no(e))}),100)}function io(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(xe(e,"focus",e,t),e.state.focused=!0,R(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),a&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Qn(e))}function no(e,t){e.state.delayingBlurEvent||(e.state.focused&&(xe(e,"blur",e,t),e.state.focused=!1,E(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function oo(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=Math.max(0,t.scroller.getBoundingClientRect().top),o=t.lineDiv.getBoundingClientRect().top,l=0,a=0;a.005||g<-.005)&&(oe.display.sizerWidth){var v=Math.ceil(h/In(e.display));v>e.display.maxLineLength&&(e.display.maxLineLength=v,e.display.maxLine=c.line,e.display.maxLineChanged=!0)}}}Math.abs(l)>2&&(t.scroller.scrollTop+=l)}function lo(e){if(e.widgets)for(var t=0;t=r&&(l=st(t,ui(it(t,a))-e.wrapper.clientHeight),r=a)}return{from:l,to:Math.max(r,l+1)}}function so(e,t){if(!Ce(e,"scrollCursorIntoView")){var i=e.display,n=i.sizer.getBoundingClientRect(),o=null,l=i.wrapper.ownerDocument;if(t.top+n.top<0?o=!0:t.bottom+n.top>(l.defaultView.innerHeight||l.documentElement.clientHeight)&&(o=!1),null!=o&&!g){var r=z("div","​",null,"position: absolute;\n top: "+(t.top-i.viewOffset-Yi(e.display))+"px;\n height: "+(t.bottom-t.top+Ji(e)+i.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(r),r.scrollIntoView(o),e.display.lineSpace.removeChild(r)}}}function ao(e,t,i,n){var o;null==n&&(n=0),e.options.lineWrapping||t!=i||(i="before"==t.sticky?ut(t.line,t.ch+1,"before"):t,t=t.ch?ut(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var l=0;l<5;l++){var r=!1,s=kn(e,t),a=i&&i!=t?kn(e,i):s,c=uo(e,o={left:Math.min(s.left,a.left),top:Math.min(s.top,a.top)-n,right:Math.max(s.left,a.left),bottom:Math.max(s.bottom,a.bottom)+n}),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(bo(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(r=!0)),null!=c.scrollLeft&&(wo(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(r=!0)),!r)break}return o}function co(e,t){var i=uo(e,t);null!=i.scrollTop&&bo(e,i.scrollTop),null!=i.scrollLeft&&wo(e,i.scrollLeft)}function uo(e,t){var i=e.display,n=Rn(e.display);t.top<0&&(t.top=0);var o=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:i.scroller.scrollTop,l=en(e),r={};t.bottom-t.top>l&&(t.bottom=t.top+l);var s=e.doc.height+Ki(i),a=t.tops-n;if(t.topo+l){var u=Math.min(t.top,(c?s:t.bottom)-l);u!=o&&(r.scrollTop=u)}var d=e.options.fixedGutter?0:i.gutters.offsetWidth,h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:i.scroller.scrollLeft-d,p=Qi(e)-i.gutters.offsetWidth,f=t.right-t.left>p;return f&&(t.right=t.left+p),t.left<10?r.scrollLeft=0:t.leftp+h-3&&(r.scrollLeft=t.right+(f?0:10)-p),r}function ho(e,t){null!=t&&(mo(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function po(e){mo(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function fo(e,t,i){null==t&&null==i||mo(e),null!=t&&(e.curOp.scrollLeft=t),null!=i&&(e.curOp.scrollTop=i)}function go(e,t){mo(e),e.curOp.scrollToPos=t}function mo(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,vo(e,Sn(e,t.from),Sn(e,t.to),t.margin))}function vo(e,t,i,n){var o=uo(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-n,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+n});fo(e,o.scrollLeft,o.scrollTop)}function bo(e,t){Math.abs(e.doc.scrollTop-t)<2||(i||Yo(e,{top:t}),yo(e,t,!0),i&&Yo(e),Vo(e,100))}function yo(e,t,i){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||i)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function wo(e,t,i,n){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,Qo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function _o(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+Ki(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:n,scrollHeight:n+Ji(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var xo=function(e,t,i){this.cm=i;var n=this.vert=z("div",[z("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=z("div",[z("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=o.tabIndex=-1,e(n),e(o),ye(n,"scroll",(function(){n.clientHeight&&t(n.scrollTop,"vertical")})),ye(o,"scroll",(function(){o.clientWidth&&t(o.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,r&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};xo.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var o=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+o)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var l=e.viewWidth-e.barLeft-(i?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+l)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?n:0,bottom:t?n:0}},xo.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},xo.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},xo.prototype.zeroWidthHack=function(){var e=y&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new j,this.disableVert=new j},xo.prototype.enableZeroWidthBar=function(e,t,i){function n(){var o=e.getBoundingClientRect();("vert"==i?document.elementFromPoint(o.right-1,(o.top+o.bottom)/2):document.elementFromPoint((o.right+o.left)/2,o.bottom-1))!=e?e.style.visibility="hidden":t.set(1e3,n)}e.style.visibility="",t.set(1e3,n)},xo.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Co=function(){};function ko(e,t){t||(t=_o(e));var i=e.display.barWidth,n=e.display.barHeight;So(e,t);for(var o=0;o<4&&i!=e.display.barWidth||n!=e.display.barHeight;o++)i!=e.display.barWidth&&e.options.lineWrapping&&oo(e),So(e,_o(e)),i=e.display.barWidth,n=e.display.barHeight}function So(e,t){var i=e.display,n=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=n.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=n.bottom)+"px",i.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=n.bottom+"px",i.scrollbarFiller.style.width=n.right+"px"):i.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=n.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}Co.prototype.update=function(){return{bottom:0,right:0}},Co.prototype.setScrollLeft=function(){},Co.prototype.setScrollTop=function(){},Co.prototype.clear=function(){};var Lo={native:xo,null:Co};function Eo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Lo[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ye(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,i){"horizontal"==i?wo(e,t):bo(e,t)}),e),e.display.scrollbars.addClass&&R(e.display.wrapper,e.display.scrollbars.addClass)}var To=0;function No(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++To,markArrays:null},Ni(e.curOp)}function zo(e){var t=e.curOp;t&&Ai(t,(function(e){for(var t=0;t=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Wo(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Bo(e){e.updatedDisplay=e.mustUpdate&&Go(e.cm,e.update)}function Ro(e){var t=e.cm,i=t.display;e.updatedDisplay&&oo(t),e.barMeasure=_o(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ln(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+Ji(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Qi(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function Io(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var i=+new Date+e.options.workTime,n=kt(e,t.highlightFrontier),o=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(l){if(n.line>=e.display.viewFrom){var r=l.styles,s=l.text.length>e.options.maxHighlightLength?Je(t.mode,n.state):null,a=xt(e,l,n,!0);s&&(n.state=s),l.styles=a.styles;var c=l.styleClasses,u=a.classes;u?l.styleClasses=u:c&&(l.styleClasses=null);for(var d=!r||r.length!=l.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),h=0;!d&&hi)return Vo(e,e.options.workDelay),!0})),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),o.length&&Ho(e,(function(){for(var t=0;t=i.viewFrom&&t.visible.to<=i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&0==Gn(e))return!1;el(e)&&(jn(e),t.dims=On(e));var o=n.first+n.size,l=Math.max(t.visible.from-e.options.viewportMargin,n.first),r=Math.min(o,t.visible.to+e.options.viewportMargin);i.viewFromr&&i.viewTo-r<20&&(r=Math.min(o,i.viewTo)),It&&(l=ri(e.doc,l),r=si(e.doc,r));var s=l!=i.viewFrom||r!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Zn(e,l,r),i.viewOffset=ui(it(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var a=Gn(e);if(!s&&0==a&&!t.force&&i.renderedView==i.view&&(null==i.updateLineNumbers||i.updateLineNumbers>=i.viewTo))return!1;var c=qo(e);return a>4&&(i.lineDiv.style.display="none"),Ko(e,i.updateLineNumbers,t.dims),a>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,Zo(c),T(i.cursorDiv),T(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,s&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,Vo(e,400)),i.updateLineNumbers=null,!0}function $o(e,t){for(var i=t.viewport,n=!0;;n=!1){if(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Qi(e))n&&(t.visible=ro(e.display,e.doc,i));else if(i&&null!=i.top&&(i={top:Math.min(e.doc.height+Ki(e.display)-en(e),i.top)}),t.visible=ro(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!Go(e,t))break;oo(e);var o=_o(e);$n(e),ko(e,o),Jo(e,o),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Yo(e,t){var i=new Wo(e,t);if(Go(e,i)){oo(e),$o(e,i);var n=_o(e);$n(e),ko(e,n),Jo(e,n),i.finish()}}function Ko(e,t,i){var n=e.display,o=e.options.lineNumbers,l=n.lineDiv,r=l.firstChild;function s(t){var i=t.nextSibling;return a&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),i}for(var c=n.view,u=n.viewFrom,d=0;d-1&&(p=!1),Ii(e,h,u,i)),p&&(T(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(ct(e.options,u)))),r=h.node.nextSibling}else{var f=Wi(e,h,u,i);l.insertBefore(f,r)}u+=h.size}for(;r;)r=s(r)}function Xo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",Bi(e,"gutterChanged",e)}function Jo(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Ji(e)+"px"}function Qo(e){var t=e.display,i=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=Hn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,o=t.gutters.offsetWidth,l=n+"px",r=0;r=105&&(l.wrapper.style.clipPath="inset(0px)"),l.wrapper.setAttribute("translate","no"),r&&s<8&&(l.gutters.style.zIndex=-1,l.scroller.style.paddingRight=0),a||i&&b||(l.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(l.wrapper):e(l.wrapper)),l.viewFrom=l.viewTo=t.first,l.reportedViewFrom=l.reportedViewTo=t.first,l.view=[],l.renderedView=null,l.externalMeasured=null,l.viewOffset=0,l.lastWrapHeight=l.lastWrapWidth=0,l.updateLineNumbers=null,l.nativeBarWidth=l.barHeight=l.barWidth=0,l.scrollbarsClipped=!1,l.lineNumWidth=l.lineNumInnerWidth=l.lineNumChars=null,l.alignWidgets=!1,l.cachedCharWidth=l.cachedTextHeight=l.cachedPaddingH=null,l.maxLine=null,l.maxLineLength=0,l.maxLineChanged=!1,l.wheelDX=l.wheelDY=l.wheelStartX=l.wheelStartY=null,l.shift=!1,l.selForContextMenu=null,l.activeTouch=null,l.gutterSpecs=tl(o.gutters,o.lineNumbers),il(l),n.init(l)}Wo.prototype.signal=function(e,t){Se(e,t)&&this.events.push(arguments)},Wo.prototype.finish=function(){for(var e=0;ec.clientWidth,f=c.scrollHeight>c.clientHeight;if(o&&p||l&&f){if(l&&y&&a)e:for(var g=t.target,m=s.view;g!=c;g=g.parentNode)for(var v=0;v=0&&dt(e,n.to())<=0)return i}return-1};var dl=function(e,t){this.anchor=e,this.head=t};function hl(e,t,i){var n=e&&e.options.selectionsMayTouch,o=t[i];t.sort((function(e,t){return dt(e.from(),t.from())})),i=q(t,o);for(var l=1;l0:a>=0){var c=gt(s.from(),r.from()),u=ft(s.to(),r.to()),d=s.empty()?r.from()==r.head:s.from()==s.head;l<=i&&--i,t.splice(--l,2,new dl(d?u:c,d?c:u))}}return new ul(t,i)}function pl(e,t){return new ul([new dl(e,t||e)],0)}function fl(e){return e.text?ut(e.from.line+e.text.length-1,ee(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function gl(e,t){if(dt(e,t.from)<0)return e;if(dt(e,t.to)<=0)return fl(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=fl(t).ch-t.to.ch),ut(i,n)}function ml(e,t){for(var i=[],n=0;n1&&e.remove(s.line+1,f-1),e.insert(s.line+1,v)}Bi(e,"change",e,t)}function Cl(e,t,i){function n(e,o,l){if(e.linked)for(var r=0;r1&&!e.done[e.done.length-2].ranges?(e.done.pop(),ee(e.done)):void 0}function Al(e,t,i,n){var o=e.history;o.undone.length=0;var l,r,s=+new Date;if((o.lastOp==n||o.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&o.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(l=zl(o,o.lastOp==n)))r=ee(l.changes),0==dt(t.from,t.to)&&0==dt(t.from,r.to)?r.to=fl(t):l.changes.push(Tl(e,t));else{var a=ee(o.done);for(a&&a.ranges||Rl(e.sel,o.done),l={changes:[Tl(e,t)],generation:o.generation},o.done.push(l);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(i),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=s,o.lastOp=o.lastSelOp=n,o.lastOrigin=o.lastSelOrigin=t.origin,r||xe(e,"historyAdded")}function Ml(e,t,i,n){var o=t.charAt(0);return"*"==o||"+"==o&&i.ranges.length==n.ranges.length&&i.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Bl(e,t,i,n){var o=e.history,l=n&&n.origin;i==o.lastSelOp||l&&o.lastSelOrigin==l&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==l||Ml(e,l,ee(o.done),t))?o.done[o.done.length-1]=t:Rl(t,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=l,o.lastSelOp=i,n&&!1!==n.clearRedo&&Nl(o.undone)}function Rl(e,t){var i=ee(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Il(e,t,i,n){var o=t["spans_"+e.id],l=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),(function(i){i.markedSpans&&((o||(o=t["spans_"+e.id]={}))[l]=i.markedSpans),++l}))}function Ol(e){if(!e)return null;for(var t,i=0;i-1&&(ee(s)[d]=c[d],delete c[d])}}}return n}function Pl(e,t,i,n){if(n){var o=e.anchor;if(i){var l=dt(t,o)<0;l!=dt(i,o)<0?(o=t,t=i):l!=dt(t,i)<0&&(t=i)}return new dl(o,t)}return new dl(i||t,t)}function Vl(e,t,i,n,o){null==o&&(o=e.cm&&(e.cm.display.shift||e.extend)),Gl(e,new ul([Pl(e.sel.primary(),t,i,o)],0),n)}function Ul(e,t,i){for(var n=[],o=e.cm&&(e.cm.display.shift||e.extend),l=0;l=t.ch:s.to>t.ch))){if(o&&(xe(a,"beforeCursorEnter"),a.explicitlyCleared)){if(l.markedSpans){--r;continue}break}if(!a.atomic)continue;if(i){var d=a.find(n<0?1:-1),h=void 0;if((n<0?u:c)&&(d=er(e,d,-n,d&&d.line==t.line?l:null)),d&&d.line==t.line&&(h=dt(d,i))&&(n<0?h<0:h>0))return Jl(e,d,t,n,o)}var p=a.find(n<0?-1:1);return(n<0?c:u)&&(p=er(e,p,n,p.line==t.line?l:null)),p?Jl(e,p,t,n,o):null}}return t}function Ql(e,t,i,n,o){var l=n||1,r=Jl(e,t,i,l,o)||!o&&Jl(e,t,i,l,!0)||Jl(e,t,i,-l,o)||!o&&Jl(e,t,i,-l,!0);return r||(e.cantEdit=!0,ut(e.first,0))}function er(e,t,i,n){return i<0&&0==t.ch?t.line>e.first?vt(e,ut(t.line-1)):null:i>0&&t.ch==(n||it(e,t.line)).text.length?t.line=0;--o)or(e,{from:n[o].from,to:n[o].to,text:o?[""]:t.text,origin:t.origin});else or(e,t)}}function or(e,t){if(1!=t.text.length||""!=t.text[0]||0!=dt(t.from,t.to)){var i=ml(e,t);Al(e,t,i,e.cm?e.cm.curOp.id:NaN),sr(e,t,i,jt(e,t));var n=[];Cl(e,(function(e,i){i||-1!=q(n,e.history)||(hr(e.history,t),n.push(e.history)),sr(e,t,null,jt(e,t))}))}}function lr(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(!n||i){for(var o,l=e.history,r=e.sel,s="undo"==t?l.done:l.undone,a="undo"==t?l.undone:l.done,c=0;c=0;--p){var f=h(p);if(f)return f.v}}}}function rr(e,t){if(0!=t&&(e.first+=t,e.sel=new ul(te(e.sel.ranges,(function(e){return new dl(ut(e.anchor.line+t,e.anchor.ch),ut(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){Un(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;ne.lastLine())){if(t.from.linel&&(t={from:t.from,to:ut(l,it(e,l).text.length),text:[t.text[0]],origin:t.origin}),t.removed=nt(e,t.from,t.to),i||(i=ml(e,t)),e.cm?ar(e.cm,t,n):xl(e,t,n),$l(e,i,$),e.cantEdit&&Ql(e,ut(e.firstLine(),0))&&(e.cantEdit=!1)}}function ar(e,t,i){var n=e.doc,o=e.display,l=t.from,r=t.to,s=!1,a=l.line;e.options.lineWrapping||(a=rt(ni(it(n,l.line))),n.iter(a,r.line+1,(function(e){if(e==o.maxLine)return s=!0,!0}))),n.sel.contains(t.from,t.to)>-1&&ke(e),xl(n,t,i,Dn(e)),e.options.lineWrapping||(n.iter(a,l.line+t.text.length,(function(e){var t=di(e);t>o.maxLineLength&&(o.maxLine=e,o.maxLineLength=t,o.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),Bt(n,l.line),Vo(e,400);var c=t.text.length-(r.line-l.line)-1;t.full?Un(e):l.line!=r.line||1!=t.text.length||_l(e.doc,t)?Un(e,l.line,r.line+1,c):Wn(e,l.line,"text");var u=Se(e,"changes"),d=Se(e,"change");if(d||u){var h={from:l,to:r,text:t.text,removed:t.removed,origin:t.origin};d&&Bi(e,"change",e,h),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function cr(e,t,i,n,o){var l;n||(n=i),dt(n,i)<0&&(i=(l=[n,i])[0],n=l[1]),"string"==typeof t&&(t=e.splitLines(t)),nr(e,{from:i,to:n,text:t,origin:o})}function ur(e,t,i,n){i1||!(this.children[0]instanceof fr))){var s=[];this.collapse(s),this.children=[new fr(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var r=o.lines.length%25+25,s=r;s10);e.parent.maybeSpill()}},iterN:function(e,t,i){for(var n=0;n0||0==r&&!1!==l.clearWhenEmpty)return l;if(l.replacedWith&&(l.collapsed=!0,l.widgetNode=A("span",[l.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||l.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(l.widgetNode.insertLeft=!0)),l.collapsed){if(ii(e,t.line,t,i,l)||t.line!=i.line&&ii(e,i.line,t,i,l))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ht()}l.addToHistory&&Al(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var s,a=t.line,c=e.cm;if(e.iter(a,i.line+1,(function(n){c&&l.collapsed&&!c.options.lineWrapping&&ni(n)==c.display.maxLine&&(s=!0),l.collapsed&&a!=t.line&<(n,0),Vt(n,new Dt(l,a==t.line?t.ch:null,a==i.line?i.ch:null),e.cm&&e.cm.curOp),++a})),l.collapsed&&e.iter(t.line,i.line+1,(function(t){ai(e,t)&<(t,0)})),l.clearOnEnter&&ye(l,"beforeCursorEnter",(function(){return l.clear()})),l.readOnly&&(Ot(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),l.collapsed&&(l.id=++yr,l.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),l.collapsed)Un(c,t.line,i.line+1);else if(l.className||l.startStyle||l.endStyle||l.css||l.attributes||l.title)for(var u=t.line;u<=i.line;u++)Wn(c,u,"text");l.atomic&&Kl(c.doc),Bi(c,"markerAdded",c,l)}return l}wr.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&No(e),Se(this,"clear")){var i=this.find();i&&Bi(this,"clear",i.from,i.to)}for(var n=null,o=null,l=0;le.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&Un(e,n,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Kl(e.doc)),e&&Bi(e,"markerCleared",e,this,n,o),t&&zo(e),this.parent&&this.parent.clear()}},wr.prototype.find=function(e,t){var i,n;null==e&&"bookmark"==this.type&&(e=1);for(var o=0;o=0;a--)nr(this,n[a]);s?Zl(this,s):this.cm&&po(this.cm)})),undo:Po((function(){lr(this,"undo")})),redo:Po((function(){lr(this,"redo")})),undoSelection:Po((function(){lr(this,"undo",!0)})),redoSelection:Po((function(){lr(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,n=0;n=e.ch)&&t.push(o.marker.parent||o.marker)}return t},findMarks:function(e,t,i){e=vt(this,e),t=vt(this,t);var n=[],o=e.line;return this.iter(e.line,t.line+1,(function(l){var r=l.markedSpans;if(r)for(var s=0;s=a.to||null==a.from&&o!=e.line||null!=a.from&&o==t.line&&a.from>=t.ch||i&&!i(a.marker)||n.push(a.marker.parent||a.marker)}++o})),n},getAllMarks:function(){var e=[];return this.iter((function(t){var i=t.markedSpans;if(i)for(var n=0;ne)return t=e,!0;e-=l,++i})),vt(this,ut(i,t))},indexFromPos:function(e){var t=(e=vt(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var d=e.dataTransfer.getData("Text");if(d){var h;if(t.state.draggingText&&!t.state.draggingText.copy&&(h=t.listSelections()),$l(t.doc,pl(i,i)),h)for(var p=0;p=0;t--)cr(e.doc,"",n[t].from,n[t].to,"+delete");po(e)}))}function Jr(e,t,i){var n=de(e.text,t+i,i);return n<0||n>e.text.length?null:n}function Qr(e,t,i){var n=Jr(e,t.ch,i);return null==n?null:new ut(t.line,n,i<0?"after":"before")}function es(e,t,i,n,o){if(e){"rtl"==t.doc.direction&&(o=-o);var l=ve(i,t.doc.direction);if(l){var r,s=o<0?ee(l):l[0],a=o<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var c=sn(t,i);r=o<0?i.text.length-1:0;var u=an(t,c,r).top;r=he((function(e){return an(t,c,e).top==u}),o<0==(1==s.level)?s.from:s.to-1,r),"before"==a&&(r=Jr(i,r,1))}else r=o<0?s.to:s.from;return new ut(n,r,a)}}return new ut(n,o<0?i.text.length:0,o<0?"before":"after")}function ts(e,t,i,n){var o=ve(t,e.doc.direction);if(!o)return Qr(t,i,n);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var l=ge(o,i.ch,i.sticky),r=o[l];if("ltr"==e.doc.direction&&r.level%2==0&&(n>0?r.to>i.ch:r.from=r.from&&h>=u.begin)){var p=d?"before":"after";return new ut(i.line,h,p)}}var f=function(e,t,n){for(var l=function(e,t){return t?new ut(i.line,a(e,1),"before"):new ut(i.line,e,"after")};e>=0&&e0==(1!=r.level),c=s?n.begin:a(n.end,-1);if(r.from<=c&&c0?u.end:a(u.begin,-1);return null==m||n>0&&m==t.text.length||!(g=f(n>0?0:o.length-1,n,c(m)))?null:g}Wr.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Wr.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Wr.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Wr.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Wr.default=y?Wr.macDefault:Wr.pcDefault;var is={selectAll:tr,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),$)},killLine:function(e){return Xr(e,(function(t){if(t.empty()){var i=it(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line0)o=new ut(o.line,o.ch+1),e.replaceRange(l.charAt(o.ch-1)+l.charAt(o.ch-2),ut(o.line,o.ch-2),o,"+transpose");else if(o.line>e.doc.first){var r=it(e.doc,o.line-1).text;r&&(o=new ut(o.line,1),e.replaceRange(l.charAt(0)+e.doc.lineSeparator()+r.charAt(r.length-1),ut(o.line-1,r.length-1),o,"+transpose"))}i.push(new dl(o,o))}e.setSelections(i)}))},newlineAndIndent:function(e){return Ho(e,(function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var n=0;n-1&&(dt((o=s.ranges[o]).from(),t)<0||t.xRel>0)&&(dt(o.to(),t)>0||t.xRel<0)?Es(e,n,t,l):Ns(e,n,t,l)}function Es(e,t,i,n){var o=e.display,l=!1,c=Do(e,(function(t){a&&(o.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:to(e)),_e(o.wrapper.ownerDocument,"mouseup",c),_e(o.wrapper.ownerDocument,"mousemove",u),_e(o.scroller,"dragstart",d),_e(o.scroller,"drop",c),l||(Ee(t),n.addNew||Vl(e.doc,i,null,null,n.extend),a&&!p||r&&9==s?setTimeout((function(){o.wrapper.ownerDocument.body.focus({preventScroll:!0}),o.input.focus()}),20):o.input.focus())})),u=function(e){l=l||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return l=!0};a&&(o.scroller.draggable=!0),e.state.draggingText=c,c.copy=!n.moveOnDrag,ye(o.wrapper.ownerDocument,"mouseup",c),ye(o.wrapper.ownerDocument,"mousemove",u),ye(o.scroller,"dragstart",d),ye(o.scroller,"drop",c),e.state.delayingBlurEvent=!0,setTimeout((function(){return o.input.focus()}),20),o.scroller.dragDrop&&o.scroller.dragDrop()}function Ts(e,t,i){if("char"==i)return new dl(t,t);if("word"==i)return e.findWordAt(t);if("line"==i)return new dl(ut(t.line,0),vt(e.doc,ut(t.line+1,0)));var n=i(e,t);return new dl(n.from,n.to)}function Ns(e,t,i,n){r&&to(e);var o=e.display,l=e.doc;Ee(t);var s,a,c=l.sel,u=c.ranges;if(n.addNew&&!n.extend?(a=l.sel.contains(i),s=a>-1?u[a]:new dl(i,i)):(s=l.sel.primary(),a=l.sel.primIndex),"rectangle"==n.unit)n.addNew||(s=new dl(i,i)),i=Pn(e,t,!0,!0),a=-1;else{var d=Ts(e,i,n.unit);s=n.extend?Pl(s,d.anchor,d.head,n.extend):d}n.addNew?-1==a?(a=u.length,Gl(l,hl(e,u.concat([s]),a),{scroll:!1,origin:"*mouse"})):u.length>1&&u[a].empty()&&"char"==n.unit&&!n.extend?(Gl(l,hl(e,u.slice(0,a).concat(u.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),c=l.sel):Wl(l,a,s,Y):(a=0,Gl(l,new ul([s],0),Y),c=l.sel);var h=i;function p(t){if(0!=dt(h,t))if(h=t,"rectangle"==n.unit){for(var o=[],r=e.options.tabSize,u=W(it(l,i.line).text,i.ch,r),d=W(it(l,t.line).text,t.ch,r),p=Math.min(u,d),f=Math.max(u,d),g=Math.min(i.line,t.line),m=Math.min(e.lastLine(),Math.max(i.line,t.line));g<=m;g++){var v=it(l,g).text,b=X(v,p,r);p==f?o.push(new dl(ut(g,b),ut(g,b))):v.length>b&&o.push(new dl(ut(g,b),ut(g,X(v,f,r))))}o.length||o.push(new dl(i,i)),Gl(l,hl(e,c.ranges.slice(0,a).concat(o),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var y,w=s,_=Ts(e,t,n.unit),x=w.anchor;dt(_.anchor,x)>0?(y=_.head,x=gt(w.from(),_.anchor)):(y=_.anchor,x=ft(w.to(),_.head));var C=c.ranges.slice(0);C[a]=zs(e,new dl(vt(l,x),y)),Gl(l,hl(e,C,a),Y)}}var f=o.wrapper.getBoundingClientRect(),g=0;function m(t){var i=++g,r=Pn(e,t,!0,"rectangle"==n.unit);if(r)if(0!=dt(r,h)){e.curOp.focus=B(D(e)),p(r);var s=ro(o,l);(r.line>=s.to||r.linef.bottom?20:0;a&&setTimeout(Do(e,(function(){g==i&&(o.scroller.scrollTop+=a,m(t))})),50)}}function v(t){e.state.selectingText=!1,g=1/0,t&&(Ee(t),o.input.focus()),_e(o.wrapper.ownerDocument,"mousemove",b),_e(o.wrapper.ownerDocument,"mouseup",y),l.history.lastSelOrigin=null}var b=Do(e,(function(e){0!==e.buttons&&Me(e)?m(e):v(e)})),y=Do(e,v);e.state.selectingText=y,ye(o.wrapper.ownerDocument,"mousemove",b),ye(o.wrapper.ownerDocument,"mouseup",y)}function zs(e,t){var i=t.anchor,n=t.head,o=it(e.doc,i.line);if(0==dt(i,n)&&i.sticky==n.sticky)return t;var l=ve(o);if(!l)return t;var r=ge(l,i.ch,i.sticky),s=l[r];if(s.from!=i.ch&&s.to!=i.ch)return t;var a,c=r+(s.from==i.ch==(1!=s.level)?0:1);if(0==c||c==l.length)return t;if(n.line!=i.line)a=(n.line-i.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=ge(l,n.ch,n.sticky),d=u-r||(n.ch-i.ch)*(1==s.level?-1:1);a=u==c-1||u==c?d<0:d>0}var h=l[c+(a?-1:0)],p=a==(1==h.level),f=p?h.from:h.to,g=p?"after":"before";return i.ch==f&&i.sticky==g?t:new dl(new ut(i.line,f,g),n)}function As(e,t,i,n){var o,l;if(t.touches)o=t.touches[0].clientX,l=t.touches[0].clientY;else try{o=t.clientX,l=t.clientY}catch(e){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&Ee(t);var r=e.display,s=r.lineDiv.getBoundingClientRect();if(l>s.bottom||!Se(e,i))return Ne(t);l-=s.top-r.viewOffset;for(var a=0;a=o)return xe(e,i,e,st(e.doc,l),e.display.gutterSpecs[a].className,t),Ne(t)}}function Ms(e,t){return As(e,t,"gutterClick",!0)}function Bs(e,t){$i(e.display,t)||Rs(e,t)||Ce(e,t,"contextmenu")||k||e.display.input.onContextMenu(t)}function Rs(e,t){return!!Se(e,"gutterContextMenu")&&As(e,t,"gutterContextMenu",!1)}function Is(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),vn(e)}_s.prototype.compare=function(e,t,i){return this.time+ws>e&&0==dt(t,this.pos)&&i==this.button};var Os={toString:function(){return"CodeMirror.Init"}},Hs={},Ds={};function Fs(e){var t=e.optionHandlers;function i(i,n,o,l){e.defaults[i]=n,o&&(t[i]=l?function(e,t,i){i!=Os&&o(e,t,i)}:o)}e.defineOption=i,e.Init=Os,i("value","",(function(e,t){return e.setValue(t)}),!0),i("mode",null,(function(e,t){e.doc.modeOption=t,yl(e)}),!0),i("indentUnit",2,yl,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,(function(e){wl(e),vn(e),Un(e)}),!0),i("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var i=[],n=e.doc.first;e.doc.iter((function(e){for(var o=0;;){var l=e.text.indexOf(t,o);if(-1==l)break;o=l+t.length,i.push(ut(n,l))}n++}));for(var o=i.length-1;o>=0;o--)cr(e.doc,t,i[o],ut(i[o].line,i[o].ch+t.length))}})),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,(function(e,t,i){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),i!=Os&&e.refresh()})),i("specialCharPlaceholder",wi,(function(e){return e.refresh()}),!0),i("electricChars",!0),i("inputStyle",b?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),i("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),i("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),i("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),i("rtlMoveVisually",!_),i("wholeLineUpdateBefore",!0),i("theme","default",(function(e){Is(e),nl(e)}),!0),i("keyMap","default",(function(e,t,i){var n=Kr(t),o=i!=Os&&Kr(i);o&&o.detach&&o.detach(e,n),n.attach&&n.attach(e,o||null)})),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Vs,!0),i("gutters",[],(function(e,t){e.display.gutterSpecs=tl(t,e.options.lineNumbers),nl(e)}),!0),i("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?Hn(e.display)+"px":"0",e.refresh()}),!0),i("coverGutterNextToScrollbar",!1,(function(e){return ko(e)}),!0),i("scrollbarStyle","native",(function(e){Eo(e),ko(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),i("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=tl(e.options.gutters,t),nl(e)}),!0),i("firstLineNumber",1,nl,!0),i("lineNumberFormatter",(function(e){return e}),nl,!0),i("showCursorWhenSelecting",!1,$n,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,(function(e,t){"nocursor"==t&&(no(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),i("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),i("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),i("dragDrop",!0,Ps),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,$n,!0),i("singleCursorHeightPerLine",!0,$n,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,wl,!0),i("addModeClass",!1,wl,!0),i("pollInterval",100),i("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),i("historyEventDelay",1250),i("viewportMargin",10,(function(e){return e.refresh()}),!0),i("maxHighlightLength",1e4,wl,!0),i("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),i("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),i("autofocus",null),i("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),i("phrases",null)}function Ps(e,t,i){if(!t!=!(i&&i!=Os)){var n=e.display.dragFunctions,o=t?ye:_e;o(e.display.scroller,"dragstart",n.start),o(e.display.scroller,"dragenter",n.enter),o(e.display.scroller,"dragover",n.over),o(e.display.scroller,"dragleave",n.leave),o(e.display.scroller,"drop",n.drop)}}function Vs(e){e.options.lineWrapping?(R(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(E(e.display.wrapper,"CodeMirror-wrap"),hi(e)),Fn(e),Un(e),vn(e),setTimeout((function(){return ko(e)}),100)}function Us(e,t){var i=this;if(!(this instanceof Us))return new Us(e,t);this.options=t=t?U(t):{},U(Hs,t,!1);var n=t.value;"string"==typeof n?n=new Tr(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var o=new Us.inputStyles[t.inputStyle](this),l=this.display=new ol(e,n,o,t);for(var c in l.wrapper.CodeMirror=this,Is(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Eo(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new j,keySeq:null,specialChars:null},t.autofocus&&!b&&l.input.focus(),r&&s<11&&setTimeout((function(){return i.display.input.reset(!0)}),20),Ws(this),Or(),No(this),this.curOp.forceUpdate=!0,kl(this,n),t.autofocus&&!b||this.hasFocus()?setTimeout((function(){i.hasFocus()&&!i.state.focused&&io(i)}),20):no(this),Ds)Ds.hasOwnProperty(c)&&Ds[c](this,t[c],Os);el(this),t.finishInit&&t.finishInit(this);for(var u=0;u400}ye(t.scroller,"touchstart",(function(o){if(!Ce(e,o)&&!l(o)&&!Ms(e,o)){t.input.ensurePolled(),clearTimeout(i);var r=+new Date;t.activeTouch={start:r,moved:!1,prev:r-n.end<=300?n:null},1==o.touches.length&&(t.activeTouch.left=o.touches[0].pageX,t.activeTouch.top=o.touches[0].pageY)}})),ye(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),ye(t.scroller,"touchend",(function(i){var n=t.activeTouch;if(n&&!$i(t,i)&&null!=n.left&&!n.moved&&new Date-n.start<300){var l,r=e.coordsChar(t.activeTouch,"page");l=!n.prev||a(n,n.prev)?new dl(r,r):!n.prev.prev||a(n,n.prev.prev)?e.findWordAt(r):new dl(ut(r.line,0),vt(e.doc,ut(r.line+1,0))),e.setSelection(l.anchor,l.head),e.focus(),Ee(i)}o()})),ye(t.scroller,"touchcancel",o),ye(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(bo(e,t.scroller.scrollTop),wo(e,t.scroller.scrollLeft,!0),xe(e,"scroll",e))})),ye(t.scroller,"mousewheel",(function(t){return cl(e,t)})),ye(t.scroller,"DOMMouseScroll",(function(t){return cl(e,t)})),ye(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){Ce(e,t)||ze(t)},over:function(t){Ce(e,t)||(Mr(e,t),ze(t))},start:function(t){return Ar(e,t)},drop:Do(e,zr),leave:function(t){Ce(e,t)||Br(e)}};var c=t.input.getField();ye(c,"keyup",(function(t){return ms.call(e,t)})),ye(c,"keydown",Do(e,fs)),ye(c,"keypress",Do(e,vs)),ye(c,"focus",(function(t){return io(e,t)})),ye(c,"blur",(function(t){return no(e,t)}))}Us.defaults=Hs,Us.optionHandlers=Ds;var js=[];function qs(e,t,i,n){var o,l=e.doc;null==i&&(i="add"),"smart"==i&&(l.mode.indent?o=kt(e,t).state:i="prev");var r=e.options.tabSize,s=it(l,t),a=W(s.text,null,r);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==i&&((c=l.mode.indent(o,s.text.slice(u.length),s.text))==G||c>150)){if(!n)return;i="prev"}}else c=0,i="not";"prev"==i?c=t>l.first?W(it(l,t-1).text,null,r):0:"add"==i?c=a+e.options.indentUnit:"subtract"==i?c=a-e.options.indentUnit:"number"==typeof i&&(c=a+i),c=Math.max(0,c);var d="",h=0;if(e.options.indentWithTabs)for(var p=Math.floor(c/r);p;--p)h+=r,d+="\t";if(hr,a=Fe(t),c=null;if(s&&n.ranges.length>1)if(Zs&&Zs.text.join("\n")==t){if(n.ranges.length%Zs.text.length==0){c=[];for(var u=0;u=0;h--){var p=n.ranges[h],f=p.from(),g=p.to();p.empty()&&(i&&i>0?f=ut(f.line,f.ch-i):e.state.overwrite&&!s?g=ut(g.line,Math.min(it(l,g.line).text.length,g.ch+ee(a).length)):s&&Zs&&Zs.lineWise&&Zs.text.join("\n")==a.join("\n")&&(f=g=ut(f.line,0)));var m={from:f,to:g,text:c?c[h%c.length]:a,origin:o||(s?"paste":e.state.cutIncoming>r?"cut":"+input")};nr(e.doc,m),Bi(e,"inputRead",e,m)}t&&!s&&Ks(e,t),po(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ys(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||!t.hasFocus()||Ho(t,(function(){return $s(t,i,0,null,"paste")})),!0}function Ks(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var i=e.doc.sel,n=i.ranges.length-1;n>=0;n--){var o=i.ranges[n];if(!(o.head.ch>100||n&&i.ranges[n-1].head.line==o.head.line)){var l=e.getModeAt(o.head),r=!1;if(l.electricChars){for(var s=0;s-1){r=qs(e,o.head.line,"smart");break}}else l.electricInput&&l.electricInput.test(it(e.doc,o.head.line).text.slice(0,o.head.ch))&&(r=qs(e,o.head.line,"smart"));r&&Bi(e,"electricInput",e,o.head.line)}}}function Xs(e){for(var t=[],i=[],n=0;ni&&(qs(this,o.head.line,e,!0),i=o.head.line,n==this.doc.sel.primIndex&&po(this));else{var l=o.from(),r=o.to(),s=Math.max(i,l.line);i=Math.min(this.lastLine(),r.line-(r.ch?0:1))+1;for(var a=s;a0&&Wl(this.doc,n,new dl(l,c[n].to()),$)}}})),getTokenAt:function(e,t){return Nt(this,e,t)},getLineTokens:function(e,t){return Nt(this,ut(e),t,!0)},getTokenTypeAt:function(e){e=vt(this.doc,e);var t,i=Ct(this,it(this.doc,e.line)),n=0,o=(i.length-1)/2,l=e.ch;if(0==l)t=i[2];else for(;;){var r=n+o>>1;if((r?i[2*r-1]:0)>=l)o=r;else{if(!(i[2*r+1]l&&(e=l,o=!0),n=it(this.doc,e)}else n=e;return _n(this,n,{top:0,left:0},t||"page",i||o).top+(o?this.doc.height-ui(n):0)},defaultTextHeight:function(){return Rn(this.display)},defaultCharWidth:function(){return In(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,i,n,o){var l=this.display,r=(e=kn(this,vt(this.doc,e))).bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==n)r=e.top;else if("above"==n||"near"==n){var a=Math.max(l.wrapper.clientHeight,this.doc.height),c=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>a)&&e.top>t.offsetHeight?r=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=a&&(r=e.bottom),s+t.offsetWidth>c&&(s=c-t.offsetWidth)}t.style.top=r+"px",t.style.left=t.style.right="","right"==o?(s=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==o?s=0:"middle"==o&&(s=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),i&&co(this,{left:s,top:r,right:s+t.offsetWidth,bottom:r+t.offsetHeight})},triggerOnKeyDown:Fo(fs),triggerOnKeyPress:Fo(vs),triggerOnKeyUp:ms,triggerOnMouseDown:Fo(Cs),execCommand:function(e){if(is.hasOwnProperty(e))return is[e].call(null,this)},triggerElectric:Fo((function(e){Ks(this,e)})),findPosH:function(e,t,i,n){var o=1;t<0&&(o=-1,t=-t);for(var l=vt(this.doc,e),r=0;r0&&r(t.charAt(i-1));)--i;for(;n.5||this.options.lineWrapping)&&Fn(this),xe(this,"refresh",this)})),swapDoc:Fo((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),kl(this,e),vn(this),this.display.input.reset(),fo(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Bi(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Le(e),e.registerHelper=function(t,n,o){i.hasOwnProperty(t)||(i[t]=e[t]={_global:[]}),i[t][n]=o},e.registerGlobalHelper=function(t,n,o,l){e.registerHelper(t,n,l),i[t]._global.push({pred:o,val:l})}}function ta(e,t,i,n,o){var l=t,r=i,s=it(e,t.line),a=o&&"rtl"==e.direction?-i:i;function c(){var i=t.line+a;return!(i=e.first+e.size)&&(t=new ut(i,t.ch,t.sticky),s=it(e,i))}function u(l){var r;if("codepoint"==n){var u=s.text.charCodeAt(t.ch+(i>0?0:-1));if(isNaN(u))r=null;else{var d=i>0?u>=55296&&u<56320:u>=56320&&u<57343;r=new ut(t.line,Math.max(0,Math.min(s.text.length,t.ch+i*(d?2:1))),-i)}}else r=o?ts(e.cm,s,t,i):Qr(s,t,i);if(null==r){if(l||!c())return!1;t=es(o,e.cm,s,t.line,a)}else t=r;return!0}if("char"==n||"codepoint"==n)u();else if("column"==n)u(!0);else if("word"==n||"group"==n)for(var d=null,h="group"==n,p=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(i<0)||u(!f);f=!1){var g=s.text.charAt(t.ch)||"\n",m=se(g,p)?"w":h&&"\n"==g?"n":!h||/\s/.test(g)?null:"p";if(!h||f||m||(m="s"),d&&d!=m){i<0&&(i=1,u(),t.sticky="after");break}if(m&&(d=m),i>0&&!u(!f))break}var v=Ql(e,t,l,r,!0);return ht(l,v)&&(v.hitSide=!0),v}function ia(e,t,i,n){var o,l,r=e.doc,s=t.left;if("page"==n){var a=Math.min(e.display.wrapper.clientHeight,P(e).innerHeight||r(e).documentElement.clientHeight),c=Math.max(a-.5*Rn(e.display),3);o=(i>0?t.bottom:t.top)+i*c}else"line"==n&&(o=i>0?t.bottom+3:t.top-3);for(;(l=En(e,s,o)).outside;){if(i<0?o<=0:o>=r.height){l.hitSide=!0;break}o+=5*i}return l}var na=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new j,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function oa(e,t){var i=rn(e,t.line);if(!i||i.hidden)return null;var n=it(e.doc,t.line),o=nn(i,n,t.line),l=ve(n,e.doc.direction),r="left";l&&(r=ge(l,t.ch)%2?"right":"left");var s=dn(o.map,t.ch,r);return s.offset="right"==s.collapse?s.end:s.start,s}function la(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function ra(e,t){return t&&(e.bad=!0),e}function sa(e,t,i,n,o){var l="",r=!1,s=e.doc.lineSeparator(),a=!1;function c(e){return function(t){return t.id==e}}function u(){r&&(l+=s,a&&(l+=s),r=a=!1)}function d(e){e&&(u(),l+=e)}function h(t){if(1==t.nodeType){var i=t.getAttribute("cm-text");if(i)return void d(i);var l,p=t.getAttribute("cm-marker");if(p){var f=e.findMarks(ut(n,0),ut(o+1,0),c(+p));return void(f.length&&(l=f[0].find(0))&&d(nt(e.doc,l.from,l.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var g=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;g&&u();for(var m=0;m=t.display.viewTo||l.line=t.display.viewFrom&&oa(t,o)||{node:a[0].measure.map[2],offset:0},u=l.linen.firstLine()&&(r=ut(r.line-1,it(n.doc,r.line-1).length)),s.ch==it(n.doc,s.line).text.length&&s.lineo.viewTo-1)return!1;r.line==o.viewFrom||0==(e=Vn(n,r.line))?(t=rt(o.view[0].line),i=o.view[0].node):(t=rt(o.view[e].line),i=o.view[e-1].node.nextSibling);var a,c,u=Vn(n,s.line);if(u==o.view.length-1?(a=o.viewTo-1,c=o.lineDiv.lastChild):(a=rt(o.view[u+1].line)-1,c=o.view[u+1].node.previousSibling),!i)return!1;for(var d=n.doc.splitLines(sa(n,i,c,t,a)),h=nt(n.doc,ut(t,0),ut(a,it(n.doc,a).text.length));d.length>1&&h.length>1;)if(ee(d)==ee(h))d.pop(),h.pop(),a--;else{if(d[0]!=h[0])break;d.shift(),h.shift(),t++}for(var p=0,f=0,g=d[0],m=h[0],v=Math.min(g.length,m.length);pr.ch&&b.charCodeAt(b.length-f-1)==y.charCodeAt(y.length-f-1);)p--,f++;d[d.length-1]=b.slice(0,b.length-f).replace(/^\u200b+/,""),d[0]=d[0].slice(p).replace(/\u200b+$/,"");var _=ut(t,p),x=ut(a,h.length?ee(h).length-f:0);return d.length>1||d[0]||dt(_,x)?(cr(n.doc,d,_,x,"+input"),!0):void 0},na.prototype.ensurePolled=function(){this.forceCompositionEnd()},na.prototype.reset=function(){this.forceCompositionEnd()},na.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},na.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},na.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Ho(this.cm,(function(){return Un(e.cm)}))},na.prototype.setUneditable=function(e){e.contentEditable="false"},na.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Do(this.cm,$s)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},na.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},na.prototype.onContextMenu=function(){},na.prototype.resetPosition=function(){},na.prototype.needsContentAttribute=!0;var ua=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new j,this.hasSelection=!1,this.composing=null,this.resetting=!1};function da(e,t){if((t=t?U(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var i=B(F(e));t.autofocus=i==e||null!=e.getAttribute("autofocus")&&i==document.body}function n(){e.value=s.getValue()}var o;if(e.form&&(ye(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var l=e.form;o=l.submit;try{var r=l.submit=function(){n(),l.submit=o,l.submit(),l.submit=r}}catch(e){}}t.finishInit=function(i){i.save=n,i.getTextArea=function(){return e},i.toTextArea=function(){i.toTextArea=isNaN,n(),e.parentNode.removeChild(i.getWrapperElement()),e.style.display="",e.form&&(_e(e.form,"submit",n),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=o))}},e.style.display="none";var s=Us((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s}function ha(e){e.off=_e,e.on=ye,e.wheelEventPixels=al,e.Doc=Tr,e.splitLines=Fe,e.countColumn=W,e.findColumn=X,e.isWordChar=re,e.Pass=G,e.signal=xe,e.Line=pi,e.changeEnd=fl,e.scrollbarModel=Lo,e.Pos=ut,e.cmpPos=dt,e.modes=je,e.mimeModes=qe,e.resolveMode=$e,e.getMode=Ye,e.modeExtensions=Ke,e.extendMode=Xe,e.copyState=Je,e.startState=et,e.innerMode=Qe,e.commands=is,e.keyMap=Wr,e.keyName=Yr,e.isModifierKey=Gr,e.lookupKey=Zr,e.normalizeKeyMap=qr,e.StringStream=tt,e.SharedTextMarker=xr,e.TextMarker=wr,e.LineWidget=mr,e.e_preventDefault=Ee,e.e_stopPropagation=Te,e.e_stop=ze,e.addClass=R,e.contains=M,e.rmClass=E,e.keyNames=Fr}ua.prototype.init=function(e){var t=this,i=this,n=this.cm;this.createField(e);var o=this.textarea;function l(e){if(!Ce(n,e)){if(n.somethingSelected())Gs({lineWise:!1,text:n.getSelections()});else{if(!n.options.lineWiseCopyCut)return;var t=Xs(n);Gs({lineWise:!0,text:t.text}),"cut"==e.type?n.setSelections(t.ranges,null,$):(i.prevInput="",o.value=t.text.join("\n"),O(o))}"cut"==e.type&&(n.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(o.style.width="0px"),ye(o,"input",(function(){r&&s>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()})),ye(o,"paste",(function(e){Ce(n,e)||Ys(e,n)||(n.state.pasteIncoming=+new Date,i.fastPoll())})),ye(o,"cut",l),ye(o,"copy",l),ye(e.scroller,"paste",(function(t){if(!$i(e,t)&&!Ce(n,t)){if(!o.dispatchEvent)return n.state.pasteIncoming=+new Date,void i.focus();var l=new Event("paste");l.clipboardData=t.clipboardData,o.dispatchEvent(l)}})),ye(e.lineSpace,"selectstart",(function(t){$i(e,t)||Ee(t)})),ye(o,"compositionstart",(function(){var e=n.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}})),ye(o,"compositionend",(function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)}))},ua.prototype.createField=function(e){this.wrapper=Qs(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;Js(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},ua.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ua.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=Yn(e);if(e.options.moveInputWithCursor){var o=kn(e,i.sel.primary().head,"div"),l=t.wrapper.getBoundingClientRect(),r=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,o.top+r.top-l.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,o.left+r.left-l.left))}return n},ua.prototype.showSelection=function(e){var t=this.cm.display;N(t.cursorDiv,e.cursors),N(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ua.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&O(this.textarea),r&&s>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",r&&s>=9&&(this.hasSelection=null));this.resetting=!1}},ua.prototype.getField=function(){return this.textarea},ua.prototype.supportsTouch=function(){return!1},ua.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!b||B(F(this.textarea))!=this.textarea))try{this.textarea.focus()}catch(e){}},ua.prototype.blur=function(){this.textarea.blur()},ua.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ua.prototype.receivedFocus=function(){this.slowPoll()},ua.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},ua.prototype.fastPoll=function(){var e=!1,t=this;function i(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,i))}t.pollingFast=!0,t.polling.set(20,i)},ua.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||Pe(i)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var o=i.value;if(o==n&&!t.somethingSelected())return!1;if(r&&s>=9&&this.hasSelection===o||y&&/[\uf700-\uf7ff]/.test(o))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var l=o.charCodeAt(0);if(8203!=l||n||(n="​"),8666==l)return this.reset(),this.cm.execCommand("undo")}for(var a=0,c=Math.min(n.length,o.length);a1e3||o.indexOf("\n")>-1?i.value=e.prevInput="":e.prevInput=o,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},ua.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ua.prototype.onKeyPress=function(){r&&s>=9&&(this.hasSelection=null),this.fastPoll()},ua.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,o=t.textarea;t.contextMenuPending&&t.contextMenuPending();var l=Pn(i,e),c=n.scroller.scrollTop;if(l&&!h){i.options.resetSelectionOnContextMenu&&-1==i.doc.sel.contains(l)&&Do(i,Gl)(i.doc,pl(l),$);var u,d=o.style.cssText,p=t.wrapper.style.cssText,f=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",o.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+"px;\n z-index: 1000; background: "+(r?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",a&&(u=o.ownerDocument.defaultView.scrollY),n.input.focus(),a&&o.ownerDocument.defaultView.scrollTo(null,u),n.input.reset(),i.somethingSelected()||(o.value=t.prevInput=" "),t.contextMenuPending=v,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll),r&&s>=9&&m(),k){ze(e);var g=function(){_e(window,"mouseup",g),setTimeout(v,20)};ye(window,"mouseup",g)}else setTimeout(v,50)}function m(){if(null!=o.selectionStart){var e=i.somethingSelected(),l="​"+(e?o.value:"");o.value="⇚",o.value=l,t.prevInput=e?"":"​",o.selectionStart=1,o.selectionEnd=l.length,n.selForContextMenu=i.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=p,o.style.cssText=d,r&&s<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=c),null!=o.selectionStart)){(!r||r&&s<9)&&m();var e=0,l=function(){n.selForContextMenu==i.doc.sel&&0==o.selectionStart&&o.selectionEnd>0&&"​"==t.prevInput?Do(i,tr)(i):e++<10?n.detectingSelectAll=setTimeout(l,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(l,200)}}},ua.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},ua.prototype.setUneditable=function(){},ua.prototype.needsContentAttribute=!1,Fs(Us),ea(Us);var pa="iter insert remove copy getEditor constructor".split(" ");for(var fa in Tr.prototype)Tr.prototype.hasOwnProperty(fa)&&q(pa,fa)<0&&(Us.prototype[fa]=function(e){return function(){return e.apply(this.doc,arguments)}}(Tr.prototype[fa]));return Le(Tr),Us.inputStyles={textarea:ua,contenteditable:na},Us.defineMode=function(e){Us.defaults.mode||"null"==e||(Us.defaults.mode=e),Ze.apply(this,arguments)},Us.defineMIME=Ge,Us.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Us.defineMIME("text/plain","null"),Us.defineExtension=function(e,t){Us.prototype[e]=t},Us.defineDocExtension=function(e,t){Tr.prototype[e]=t},Us.fromTextArea=da,ha(Us),Us.version="5.65.16",Us}()},656:(e,t,i)=>{!function(e){"use strict";function t(e){for(var t={},i=0;i*\/]/.test(i)?x(null,"select-op"):"."==i&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?x("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(i)?x(null,i):e.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(e.current())&&(t.tokenize=S),x("variable callee","variable")):/[\w\\\-]/.test(i)?(e.eatWhile(/[\w\\\-]/),x("property","word")):x(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),x("number","unit")):e.match(/^-[\w\\\-]*/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?x("variable-2","variable-definition"):x("variable-2","variable")):e.match(/^\w+-/)?x("meta","meta"):void 0}function k(e){return function(t,i){for(var n,o=!1;null!=(n=t.next());){if(n==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==n}return(n==e||!o&&")"!=e)&&(i.tokenize=null),x("string","string")}}function S(e,t){return e.next(),e.match(/^\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=k(")"),x(null,"(")}function L(e,t,i){this.type=e,this.indent=t,this.prev=i}function E(e,t,i,n){return e.context=new L(i,t.indentation()+(!1===n?0:r),e.context),i}function T(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function N(e,t,i){return M[i.context.type](e,t,i)}function z(e,t,i,n){for(var o=n||1;o>0;o--)i.context=i.context.prev;return N(e,t,i)}function A(e){var t=e.current().toLowerCase();l=v.hasOwnProperty(t)?"atom":m.hasOwnProperty(t)?"keyword":"variable"}var M={top:function(e,t,i){if("{"==e)return E(i,t,"block");if("}"==e&&i.context.prev)return T(i);if(w&&/@component/i.test(e))return E(i,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return E(i,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return E(i,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return i.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return E(i,t,"at");if("hash"==e)l="builtin";else if("word"==e)l="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return E(i,t,"interpolation");if(":"==e)return"pseudo";if(b&&"("==e)return E(i,t,"parens")}return i.context.type},block:function(e,t,i){if("word"==e){var n=t.current().toLowerCase();return h.hasOwnProperty(n)?(l="property","maybeprop"):p.hasOwnProperty(n)?(l=_?"string-2":"property","maybeprop"):b?(l=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(l+=" error","maybeprop")}return"meta"==e?"block":b||"hash"!=e&&"qualifier"!=e?M.top(e,t,i):(l="error","block")},maybeprop:function(e,t,i){return":"==e?E(i,t,"prop"):N(e,t,i)},prop:function(e,t,i){if(";"==e)return T(i);if("{"==e&&b)return E(i,t,"propBlock");if("}"==e||"{"==e)return z(e,t,i);if("("==e)return E(i,t,"parens");if("hash"!=e||/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(t.current())){if("word"==e)A(t);else if("interpolation"==e)return E(i,t,"interpolation")}else l+=" error";return"prop"},propBlock:function(e,t,i){return"}"==e?T(i):"word"==e?(l="property","maybeprop"):i.context.type},parens:function(e,t,i){return"{"==e||"}"==e?z(e,t,i):")"==e?T(i):"("==e?E(i,t,"parens"):"interpolation"==e?E(i,t,"interpolation"):("word"==e&&A(t),"parens")},pseudo:function(e,t,i){return"meta"==e?"pseudo":"word"==e?(l="variable-3",i.context.type):N(e,t,i)},documentTypes:function(e,t,i){return"word"==e&&a.hasOwnProperty(t.current())?(l="tag",i.context.type):M.atBlock(e,t,i)},atBlock:function(e,t,i){if("("==e)return E(i,t,"atBlock_parens");if("}"==e||";"==e)return z(e,t,i);if("{"==e)return T(i)&&E(i,t,b?"block":"top");if("interpolation"==e)return E(i,t,"interpolation");if("word"==e){var n=t.current().toLowerCase();l="only"==n||"not"==n||"and"==n||"or"==n?"keyword":c.hasOwnProperty(n)?"attribute":u.hasOwnProperty(n)?"property":d.hasOwnProperty(n)?"keyword":h.hasOwnProperty(n)?"property":p.hasOwnProperty(n)?_?"string-2":"property":v.hasOwnProperty(n)?"atom":m.hasOwnProperty(n)?"keyword":"error"}return i.context.type},atComponentBlock:function(e,t,i){return"}"==e?z(e,t,i):"{"==e?T(i)&&E(i,t,b?"block":"top",!1):("word"==e&&(l="error"),i.context.type)},atBlock_parens:function(e,t,i){return")"==e?T(i):"{"==e||"}"==e?z(e,t,i,2):M.atBlock(e,t,i)},restricted_atBlock_before:function(e,t,i){return"{"==e?E(i,t,"restricted_atBlock"):"word"==e&&"@counter-style"==i.stateArg?(l="variable","restricted_atBlock_before"):N(e,t,i)},restricted_atBlock:function(e,t,i){return"}"==e?(i.stateArg=null,T(i)):"word"==e?(l="@font-face"==i.stateArg&&!f.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==i.stateArg&&!g.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,i){return"word"==e?(l="variable","keyframes"):"{"==e?E(i,t,"top"):N(e,t,i)},at:function(e,t,i){return";"==e?T(i):"{"==e||"}"==e?z(e,t,i):("word"==e?l="tag":"hash"==e&&(l="builtin"),"at")},interpolation:function(e,t,i){return"}"==e?T(i):"{"==e||";"==e?z(e,t,i):("word"==e?l="variable":"variable"!=e&&"("!=e&&")"!=e&&(l="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:n?"block":"top",stateArg:null,context:new L(n?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var i=(t.tokenize||C)(e,t);return i&&"object"==typeof i&&(o=i[1],i=i[0]),l=i,"comment"!=o&&(t.state=M[t.state](o,e,t)),l},indent:function(e,t){var i=e.context,n=t&&t.charAt(0),o=i.indent;return"prop"!=i.type||"}"!=n&&")"!=n||(i=i.prev),i.prev&&("}"!=n||"block"!=i.type&&"top"!=i.type&&"interpolation"!=i.type&&"restricted_atBlock"!=i.type?(")"!=n||"parens"!=i.type&&"atBlock_parens"!=i.type)&&("{"!=n||"at"!=i.type&&"atBlock"!=i.type)||(o=Math.max(0,i.indent-r)):o=(i=i.prev).indent),o},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:y,fold:"brace"}}));var i=["domain","regexp","url","url-prefix"],n=t(i),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],l=t(o),r=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],s=t(r),a=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],c=t(a),u=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],d=t(u),h=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],p=t(h),f=t(["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),g=t(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),m=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],v=t(m),b=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],y=t(b),w=i.concat(o).concat(r).concat(a).concat(u).concat(h).concat(m).concat(b);function _(e,t){for(var i,n=!1;null!=(i=e.next());){if(n&&"/"==i){t.tokenize=null;break}n="*"==i}return["comment","comment"]}e.registerHelper("hintWords","css",w),e.defineMIME("text/css",{documentTypes:n,mediaTypes:l,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:p,fontProperties:f,counterDescriptors:g,colorKeywords:v,valueKeywords:y,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=_,_(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:l,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:v,valueKeywords:y,fontProperties:f,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=_,_(e,t)):["operator","operator"]},":":function(e){return!!e.match(/^\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:l,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:v,valueKeywords:y,fontProperties:f,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=_,_(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:n,mediaTypes:l,mediaFeatures:s,propertyKeywords:d,nonStandardPropertyKeywords:p,fontProperties:f,counterDescriptors:g,colorKeywords:v,valueKeywords:y,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=_,_(e,t))}},name:"css",helperType:"gss"})}(i(237))},520:(e,t,i)=>{!function(e){"use strict";var t={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function i(e,t,i){var n=e.current(),o=n.search(t);return o>-1?e.backUp(n.length-o):n.match(/<\/?$/)&&(e.backUp(n.length),e.match(t,!1)||e.match(n)),i}var n={};function o(e){var t=n[e];return t||(n[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}function l(e,t){var i=e.match(o(t));return i?/^\s*(.*?)\s*$/.exec(i[2])[1]:""}function r(e,t){return new RegExp((t?"^":"")+"","i")}function s(e,t){for(var i in e)for(var n=t[i]||(t[i]=[]),o=e[i],l=o.length-1;l>=0;l--)n.unshift(o[l])}function a(e,t){for(var i=0;i=0;h--)c.script.unshift(["type",d[h].matches,d[h].mode]);function p(t,o){var s,u=l.token(t,o.htmlState),d=/\btag\b/.test(u);if(d&&!/[<>\s\/]/.test(t.current())&&(s=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&c.hasOwnProperty(s))o.inTag=s+" ";else if(o.inTag&&d&&/>$/.test(t.current())){var h=/^([\S]+) (.*)/.exec(o.inTag);o.inTag=null;var f=">"==t.current()&&a(c[h[1]],h[2]),g=e.getMode(n,f),m=r(h[1],!0),v=r(h[1],!1);o.token=function(e,t){return e.match(m,!1)?(t.token=p,t.localState=t.localMode=null,null):i(e,v,t.localMode.token(e,t.localState))},o.localMode=g,o.localState=e.startState(g,l.indent(o.htmlState,"",""))}else o.inTag&&(o.inTag+=t.current(),t.eol()&&(o.inTag+=" "));return u}return{startState:function(){return{token:p,inTag:null,localMode:null,localState:null,htmlState:e.startState(l)}},copyState:function(t){var i;return t.localState&&(i=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:i,htmlState:e.copyState(l,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,i,n){return!t.localMode||/^\s*<\//.test(i)?l.indent(t.htmlState,i,n):t.localMode.indent?t.localMode.indent(t.localState,i,n):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||l}}}}),"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")}(i(237),i(576),i(792),i(656))},792:(e,t,i)=>{!function(e){"use strict";e.defineMode("javascript",(function(t,i){var n,o,l=t.indentUnit,r=i.statementIndent,s=i.jsonld,a=i.json||s,c=!1!==i.trackScope,u=i.typescript,d=i.wordCharacters||/[\w$\xa1-\uffff]/,h=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),i=e("keyword b"),n=e("keyword c"),o=e("keyword d"),l=e("operator"),r={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:i,do:i,try:i,finally:i,return:o,break:o,continue:o,new:e("new"),delete:n,void:n,throw:n,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:l,typeof:l,instanceof:l,true:r,false:r,null:r,undefined:r,NaN:r,Infinity:r,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n}}(),p=/[+\-*&%=<>!?|~^@]/,f=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function g(e){for(var t,i=!1,n=!1;null!=(t=e.next());){if(!i){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}i=!i&&"\\"==t}}function m(e,t,i){return n=e,o=i,t}function v(e,t){var i=e.next();if('"'==i||"'"==i)return t.tokenize=b(i),t.tokenize(e,t);if("."==i&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return m("number","number");if("."==i&&e.match(".."))return m("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(i))return m(i);if("="==i&&e.eat(">"))return m("=>","operator");if("0"==i&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return m("number","number");if(/\d/.test(i))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),m("number","number");if("/"==i)return e.eat("*")?(t.tokenize=y,y(e,t)):e.eat("/")?(e.skipToEnd(),m("comment","comment")):ot(e,t,1)?(g(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),m("regexp","string-2")):(e.eat("="),m("operator","operator",e.current()));if("`"==i)return t.tokenize=w,w(e,t);if("#"==i&&"!"==e.peek())return e.skipToEnd(),m("meta","meta");if("#"==i&&e.eatWhile(d))return m("variable","property");if("<"==i&&e.match("!--")||"-"==i&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),m("comment","comment");if(p.test(i))return">"==i&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=i&&"="!=i||e.eat("="):/[<>*+\-|&?]/.test(i)&&(e.eat(i),">"==i&&e.eat(i))),"?"==i&&e.eat(".")?m("."):m("operator","operator",e.current());if(d.test(i)){e.eatWhile(d);var n=e.current();if("."!=t.lastType){if(h.propertyIsEnumerable(n)){var o=h[n];return m(o.type,o.style,n)}if("async"==n&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return m("async","keyword",n)}return m("variable","variable",n)}}function b(e){return function(t,i){var n,o=!1;if(s&&"@"==t.peek()&&t.match(f))return i.tokenize=v,m("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||o);)o=!o&&"\\"==n;return o||(i.tokenize=v),m("string","string")}}function y(e,t){for(var i,n=!1;i=e.next();){if("/"==i&&n){t.tokenize=v;break}n="*"==i}return m("comment","comment")}function w(e,t){for(var i,n=!1;null!=(i=e.next());){if(!n&&("`"==i||"$"==i&&e.eat("{"))){t.tokenize=v;break}n=!n&&"\\"==i}return m("quasi","string-2",e.current())}var _="([{}])";function x(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var i=e.string.indexOf("=>",e.start);if(!(i<0)){if(u){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,i));n&&(i=n.index)}for(var o=0,l=!1,r=i-1;r>=0;--r){var s=e.string.charAt(r),a=_.indexOf(s);if(a>=0&&a<3){if(!o){++r;break}if(0==--o){"("==s&&(l=!0);break}}else if(a>=3&&a<6)++o;else if(d.test(s))l=!0;else if(/["'\/`]/.test(s))for(;;--r){if(0==r)return;if(e.string.charAt(r-1)==s&&"\\"!=e.string.charAt(r-2)){r--;break}}else if(l&&!o){++r;break}}l&&!o&&(t.fatArrowAt=r)}}var C={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function k(e,t,i,n,o,l){this.indented=e,this.column=t,this.type=i,this.prev=o,this.info=l,null!=n&&(this.align=n)}function S(e,t){if(!c)return!1;for(var i=e.localVars;i;i=i.next)if(i.name==t)return!0;for(var n=e.context;n;n=n.prev)for(i=n.vars;i;i=i.next)if(i.name==t)return!0}function L(e,t,i,n,o){var l=e.cc;for(E.state=e,E.stream=o,E.marked=null,E.cc=l,E.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((l.length?l.pop():a?q:W)(i,n)){for(;l.length&&l[l.length-1].lex;)l.pop()();return E.marked?E.marked:"variable"==i&&S(e,n)?"variable-2":t}}var E={state:null,column:null,marked:null,cc:null};function T(){for(var e=arguments.length-1;e>=0;e--)E.cc.push(arguments[e])}function N(){return T.apply(null,arguments),!0}function z(e,t){for(var i=t;i;i=i.next)if(i.name==e)return!0;return!1}function A(e){var t=E.state;if(E.marked="def",c){if(t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var n=M(e,t.context);if(null!=n)return void(t.context=n)}else if(!z(e,t.localVars))return void(t.localVars=new I(e,t.localVars));i.globalVars&&!z(e,t.globalVars)&&(t.globalVars=new I(e,t.globalVars))}}function M(e,t){if(t){if(t.block){var i=M(e,t.prev);return i?i==t.prev?t:new R(i,t.vars,!0):null}return z(e,t.vars)?t:new R(t.prev,new I(e,t.vars),!1)}return null}function B(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function R(e,t,i){this.prev=e,this.vars=t,this.block=i}function I(e,t){this.name=e,this.next=t}var O=new I("this",new I("arguments",null));function H(){E.state.context=new R(E.state.context,E.state.localVars,!1),E.state.localVars=O}function D(){E.state.context=new R(E.state.context,E.state.localVars,!0),E.state.localVars=null}function F(){E.state.localVars=E.state.context.vars,E.state.context=E.state.context.prev}function P(e,t){var i=function(){var i=E.state,n=i.indented;if("stat"==i.lexical.type)n=i.lexical.indented;else for(var o=i.lexical;o&&")"==o.type&&o.align;o=o.prev)n=o.indented;i.lexical=new k(n,E.stream.column(),e,null,i.lexical,t)};return i.lex=!0,i}function V(){var e=E.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function U(e){function t(i){return i==e?N():";"==e||"}"==i||")"==i||"]"==i?T():N(t)}return t}function W(e,t){return"var"==e?N(P("vardef",t),Te,U(";"),V):"keyword a"==e?N(P("form"),G,W,V):"keyword b"==e?N(P("form"),W,V):"keyword d"==e?E.stream.match(/^\s*$/,!1)?N():N(P("stat"),Y,U(";"),V):"debugger"==e?N(U(";")):"{"==e?N(P("}"),D,he,V,F):";"==e?N():"if"==e?("else"==E.state.lexical.info&&E.state.cc[E.state.cc.length-1]==V&&E.state.cc.pop()(),N(P("form"),G,W,V,Re)):"function"==e?N(De):"for"==e?N(P("form"),D,Ie,W,F,V):"class"==e||u&&"interface"==t?(E.marked="keyword",N(P("form","class"==e?e:t),We,V)):"variable"==e?u&&"declare"==t?(E.marked="keyword",N(W)):u&&("module"==t||"enum"==t||"type"==t)&&E.stream.match(/^\s*\w/,!1)?(E.marked="keyword","enum"==t?N(tt):"type"==t?N(Pe,U("operator"),ve,U(";")):N(P("form"),Ne,U("{"),P("}"),he,V,V)):u&&"namespace"==t?(E.marked="keyword",N(P("form"),q,W,V)):u&&"abstract"==t?(E.marked="keyword",N(W)):N(P("stat"),le):"switch"==e?N(P("form"),G,U("{"),P("}","switch"),D,he,V,V,F):"case"==e?N(q,U(":")):"default"==e?N(U(":")):"catch"==e?N(P("form"),H,j,W,V,F):"export"==e?N(P("stat"),Ge,V):"import"==e?N(P("stat"),Ye,V):"async"==e?N(W):"@"==t?N(q,W):T(P("stat"),q,U(";"),V)}function j(e){if("("==e)return N(Ve,U(")"))}function q(e,t){return $(e,t,!1)}function Z(e,t){return $(e,t,!0)}function G(e){return"("!=e?T():N(P(")"),Y,U(")"),V)}function $(e,t,i){if(E.state.fatArrowAt==E.stream.start){var n=i?te:ee;if("("==e)return N(H,P(")"),ue(Ve,")"),V,U("=>"),n,F);if("variable"==e)return T(H,Ne,U("=>"),n,F)}var o=i?X:K;return C.hasOwnProperty(e)?N(o):"function"==e?N(De,o):"class"==e||u&&"interface"==t?(E.marked="keyword",N(P("form"),Ue,V)):"keyword c"==e||"async"==e?N(i?Z:q):"("==e?N(P(")"),Y,U(")"),V,o):"operator"==e||"spread"==e?N(i?Z:q):"["==e?N(P("]"),et,V,o):"{"==e?de(se,"}",null,o):"quasi"==e?T(J,o):"new"==e?N(ie(i)):N()}function Y(e){return e.match(/[;\}\)\],]/)?T():T(q)}function K(e,t){return","==e?N(Y):X(e,t,!1)}function X(e,t,i){var n=0==i?K:X,o=0==i?q:Z;return"=>"==e?N(H,i?te:ee,F):"operator"==e?/\+\+|--/.test(t)||u&&"!"==t?N(n):u&&"<"==t&&E.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?N(P(">"),ue(ve,">"),V,n):"?"==t?N(q,U(":"),o):N(o):"quasi"==e?T(J,n):";"!=e?"("==e?de(Z,")","call",n):"."==e?N(re,n):"["==e?N(P("]"),Y,U("]"),V,n):u&&"as"==t?(E.marked="keyword",N(ve,n)):"regexp"==e?(E.state.lastType=E.marked="operator",E.stream.backUp(E.stream.pos-E.stream.start-1),N(o)):void 0:void 0}function J(e,t){return"quasi"!=e?T():"${"!=t.slice(t.length-2)?N(J):N(Y,Q)}function Q(e){if("}"==e)return E.marked="string-2",E.state.tokenize=w,N(J)}function ee(e){return x(E.stream,E.state),T("{"==e?W:q)}function te(e){return x(E.stream,E.state),T("{"==e?W:Z)}function ie(e){return function(t){return"."==t?N(e?oe:ne):"variable"==t&&u?N(Se,e?X:K):T(e?Z:q)}}function ne(e,t){if("target"==t)return E.marked="keyword",N(K)}function oe(e,t){if("target"==t)return E.marked="keyword",N(X)}function le(e){return":"==e?N(V,W):T(K,U(";"),V)}function re(e){if("variable"==e)return E.marked="property",N()}function se(e,t){return"async"==e?(E.marked="property",N(se)):"variable"==e||"keyword"==E.style?(E.marked="property","get"==t||"set"==t?N(ae):(u&&E.state.fatArrowAt==E.stream.start&&(i=E.stream.match(/^\s*:\s*/,!1))&&(E.state.fatArrowAt=E.stream.pos+i[0].length),N(ce))):"number"==e||"string"==e?(E.marked=s?"property":E.style+" property",N(ce)):"jsonld-keyword"==e?N(ce):u&&B(t)?(E.marked="keyword",N(se)):"["==e?N(q,pe,U("]"),ce):"spread"==e?N(Z,ce):"*"==t?(E.marked="keyword",N(se)):":"==e?T(ce):void 0;var i}function ae(e){return"variable"!=e?T(ce):(E.marked="property",N(De))}function ce(e){return":"==e?N(Z):"("==e?T(De):void 0}function ue(e,t,i){function n(o,l){if(i?i.indexOf(o)>-1:","==o){var r=E.state.lexical;return"call"==r.info&&(r.pos=(r.pos||0)+1),N((function(i,n){return i==t||n==t?T():T(e)}),n)}return o==t||l==t?N():i&&i.indexOf(";")>-1?T(e):N(U(t))}return function(i,o){return i==t||o==t?N():T(e,n)}}function de(e,t,i){for(var n=3;n"),ve):"quasi"==e?T(_e,ke):void 0}function be(e){if("=>"==e)return N(ve)}function ye(e){return e.match(/[\}\)\]]/)?N():","==e||";"==e?N(ye):T(we,ye)}function we(e,t){return"variable"==e||"keyword"==E.style?(E.marked="property",N(we)):"?"==t||"number"==e||"string"==e?N(we):":"==e?N(ve):"["==e?N(U("variable"),fe,U("]"),we):"("==e?T(Fe,we):e.match(/[;\}\)\],]/)?void 0:N()}function _e(e,t){return"quasi"!=e?T():"${"!=t.slice(t.length-2)?N(_e):N(ve,xe)}function xe(e){if("}"==e)return E.marked="string-2",E.state.tokenize=w,N(_e)}function Ce(e,t){return"variable"==e&&E.stream.match(/^\s*[?:]/,!1)||"?"==t?N(Ce):":"==e?N(ve):"spread"==e?N(Ce):T(ve)}function ke(e,t){return"<"==t?N(P(">"),ue(ve,">"),V,ke):"|"==t||"."==e||"&"==t?N(ve):"["==e?N(ve,U("]"),ke):"extends"==t||"implements"==t?(E.marked="keyword",N(ve)):"?"==t?N(ve,U(":"),ve):void 0}function Se(e,t){if("<"==t)return N(P(">"),ue(ve,">"),V,ke)}function Le(){return T(ve,Ee)}function Ee(e,t){if("="==t)return N(ve)}function Te(e,t){return"enum"==t?(E.marked="keyword",N(tt)):T(Ne,pe,Me,Be)}function Ne(e,t){return u&&B(t)?(E.marked="keyword",N(Ne)):"variable"==e?(A(t),N()):"spread"==e?N(Ne):"["==e?de(Ae,"]"):"{"==e?de(ze,"}"):void 0}function ze(e,t){return"variable"!=e||E.stream.match(/^\s*:/,!1)?("variable"==e&&(E.marked="property"),"spread"==e?N(Ne):"}"==e?T():"["==e?N(q,U("]"),U(":"),ze):N(U(":"),Ne,Me)):(A(t),N(Me))}function Ae(){return T(Ne,Me)}function Me(e,t){if("="==t)return N(Z)}function Be(e){if(","==e)return N(Te)}function Re(e,t){if("keyword b"==e&&"else"==t)return N(P("form","else"),W,V)}function Ie(e,t){return"await"==t?N(Ie):"("==e?N(P(")"),Oe,V):void 0}function Oe(e){return"var"==e?N(Te,He):"variable"==e?N(He):T(He)}function He(e,t){return")"==e?N():";"==e?N(He):"in"==t||"of"==t?(E.marked="keyword",N(q,He)):T(q,He)}function De(e,t){return"*"==t?(E.marked="keyword",N(De)):"variable"==e?(A(t),N(De)):"("==e?N(H,P(")"),ue(Ve,")"),V,ge,W,F):u&&"<"==t?N(P(">"),ue(Le,">"),V,De):void 0}function Fe(e,t){return"*"==t?(E.marked="keyword",N(Fe)):"variable"==e?(A(t),N(Fe)):"("==e?N(H,P(")"),ue(Ve,")"),V,ge,F):u&&"<"==t?N(P(">"),ue(Le,">"),V,Fe):void 0}function Pe(e,t){return"keyword"==e||"variable"==e?(E.marked="type",N(Pe)):"<"==t?N(P(">"),ue(Le,">"),V):void 0}function Ve(e,t){return"@"==t&&N(q,Ve),"spread"==e?N(Ve):u&&B(t)?(E.marked="keyword",N(Ve)):u&&"this"==e?N(pe,Me):T(Ne,pe,Me)}function Ue(e,t){return"variable"==e?We(e,t):je(e,t)}function We(e,t){if("variable"==e)return A(t),N(je)}function je(e,t){return"<"==t?N(P(">"),ue(Le,">"),V,je):"extends"==t||"implements"==t||u&&","==e?("implements"==t&&(E.marked="keyword"),N(u?ve:q,je)):"{"==e?N(P("}"),qe,V):void 0}function qe(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||u&&B(t))&&E.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1)?(E.marked="keyword",N(qe)):"variable"==e||"keyword"==E.style?(E.marked="property",N(Ze,qe)):"number"==e||"string"==e?N(Ze,qe):"["==e?N(q,pe,U("]"),Ze,qe):"*"==t?(E.marked="keyword",N(qe)):u&&"("==e?T(Fe,qe):";"==e||","==e?N(qe):"}"==e?N():"@"==t?N(q,qe):void 0}function Ze(e,t){if("!"==t)return N(Ze);if("?"==t)return N(Ze);if(":"==e)return N(ve,Me);if("="==t)return N(Z);var i=E.state.lexical.prev;return T(i&&"interface"==i.info?Fe:De)}function Ge(e,t){return"*"==t?(E.marked="keyword",N(Qe,U(";"))):"default"==t?(E.marked="keyword",N(q,U(";"))):"{"==e?N(ue($e,"}"),Qe,U(";")):T(W)}function $e(e,t){return"as"==t?(E.marked="keyword",N(U("variable"))):"variable"==e?T(Z,$e):void 0}function Ye(e){return"string"==e?N():"("==e?T(q):"."==e?T(K):T(Ke,Xe,Qe)}function Ke(e,t){return"{"==e?de(Ke,"}"):("variable"==e&&A(t),"*"==t&&(E.marked="keyword"),N(Je))}function Xe(e){if(","==e)return N(Ke,Xe)}function Je(e,t){if("as"==t)return E.marked="keyword",N(Ke)}function Qe(e,t){if("from"==t)return E.marked="keyword",N(q)}function et(e){return"]"==e?N():T(ue(Z,"]"))}function tt(){return T(P("form"),Ne,U("{"),P("}"),ue(it,"}"),V,V)}function it(){return T(Ne,Me)}function nt(e,t){return"operator"==e.lastType||","==e.lastType||p.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function ot(e,t,i){return t.tokenize==v&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(i||0)))}return H.lex=D.lex=!0,F.lex=!0,V.lex=!0,{startState:function(e){var t={tokenize:v,lastType:"sof",cc:[],lexical:new k((e||0)-l,0,"block",!1),localVars:i.localVars,context:i.localVars&&new R(null,null,!1),indented:e||0};return i.globalVars&&"object"==typeof i.globalVars&&(t.globalVars=i.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),x(e,t)),t.tokenize!=y&&e.eatSpace())return null;var i=t.tokenize(e,t);return"comment"==n?i:(t.lastType="operator"!=n||"++"!=o&&"--"!=o?n:"incdec",L(t,i,n,o,e))},indent:function(t,n){if(t.tokenize==y||t.tokenize==w)return e.Pass;if(t.tokenize!=v)return 0;var o,s=n&&n.charAt(0),a=t.lexical;if(!/^\s*else\b/.test(n))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==V)a=a.prev;else if(u!=Re&&u!=F)break}for(;("stat"==a.type||"form"==a.type)&&("}"==s||(o=t.cc[t.cc.length-1])&&(o==K||o==X)&&!/^[,\.=+\-*:?[\(]/.test(n));)a=a.prev;r&&")"==a.type&&"stat"==a.prev.type&&(a=a.prev);var d=a.type,h=s==d;return"vardef"==d?a.indented+("operator"==t.lastType||","==t.lastType?a.info.length+1:0):"form"==d&&"{"==s?a.indented:"form"==d?a.indented+l:"stat"==d?a.indented+(nt(t,n)?r||l:0):"switch"!=a.info||h||0==i.doubleIndentSwitch?a.align?a.column+(h?0:1):a.indented+(h?0:l):a.indented+(/^(?:case|default)\b/.test(n)?l:2*l)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:a?null:"/*",blockCommentEnd:a?null:"*/",blockCommentContinue:a?null:" * ",lineComment:a?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:a?"json":"javascript",jsonldMode:s,jsonMode:a,expressionAllowed:ot,skipExpression:function(t){L(t,"atom","atom","true",new e.StringStream("",2,null))}}})),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/manifest+json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(i(237))},576:(e,t,i)=>{!function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},i={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",(function(n,o){var l,r,s=n.indentUnit,a={},c=o.htmlMode?t:i;for(var u in c)a[u]=c[u];for(var u in o)a[u]=o[u];function d(e,t){function i(i){return t.tokenize=i,i(e,t)}var n=e.next();return"<"==n?e.eat("!")?e.eat("[")?e.match("CDATA[")?i(f("atom","]]>")):null:e.match("--")?i(f("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),i(g(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=f("meta","?>"),"meta"):(l=e.eat("/")?"closeTag":"openTag",t.tokenize=h,"tag bracket"):"&"==n?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function h(e,t){var i=e.next();if(">"==i||"/"==i&&e.eat(">"))return t.tokenize=d,l=">"==i?"endTag":"selfcloseTag","tag bracket";if("="==i)return l="equals",null;if("<"==i){t.tokenize=d,t.state=w,t.tagName=t.tagStart=null;var n=t.tokenize(e,t);return n?n+" tag error":"tag error"}return/[\'\"]/.test(i)?(t.tokenize=p(i),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(e){var t=function(t,i){for(;!t.eol();)if(t.next()==e){i.tokenize=h;break}return"string"};return t.isInAttribute=!0,t}function f(e,t){return function(i,n){for(;!i.eol();){if(i.match(t)){n.tokenize=d;break}i.next()}return e}}function g(e){return function(t,i){for(var n;null!=(n=t.next());){if("<"==n)return i.tokenize=g(e+1),i.tokenize(t,i);if(">"==n){if(1==e){i.tokenize=d;break}return i.tokenize=g(e-1),i.tokenize(t,i)}}return"meta"}}function m(e){return e&&e.toLowerCase()}function v(e,t,i){this.prev=e.context,this.tagName=t||"",this.indent=e.indented,this.startOfLine=i,(a.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function b(e){e.context&&(e.context=e.context.prev)}function y(e,t){for(var i;;){if(!e.context)return;if(i=e.context.tagName,!a.contextGrabbers.hasOwnProperty(m(i))||!a.contextGrabbers[m(i)].hasOwnProperty(m(t)))return;b(e)}}function w(e,t,i){return"openTag"==e?(i.tagStart=t.column(),_):"closeTag"==e?x:w}function _(e,t,i){return"word"==e?(i.tagName=t.current(),r="tag",S):a.allowMissingTagName&&"endTag"==e?(r="tag bracket",S(e,t,i)):(r="error",_)}function x(e,t,i){if("word"==e){var n=t.current();return i.context&&i.context.tagName!=n&&a.implicitlyClosed.hasOwnProperty(m(i.context.tagName))&&b(i),i.context&&i.context.tagName==n||!1===a.matchClosing?(r="tag",C):(r="tag error",k)}return a.allowMissingTagName&&"endTag"==e?(r="tag bracket",C(e,t,i)):(r="error",k)}function C(e,t,i){return"endTag"!=e?(r="error",C):(b(i),w)}function k(e,t,i){return r="error",C(e,t,i)}function S(e,t,i){if("word"==e)return r="attribute",L;if("endTag"==e||"selfcloseTag"==e){var n=i.tagName,o=i.tagStart;return i.tagName=i.tagStart=null,"selfcloseTag"==e||a.autoSelfClosers.hasOwnProperty(m(n))?y(i,n):(y(i,n),i.context=new v(i,n,o==i.indented)),w}return r="error",S}function L(e,t,i){return"equals"==e?E:(a.allowMissing||(r="error"),S(e,t,i))}function E(e,t,i){return"string"==e?T:"word"==e&&a.allowUnquoted?(r="string",S):(r="error",S(e,t,i))}function T(e,t,i){return"string"==e?T:S(e,t,i)}return d.isInText=!0,{startState:function(e){var t={tokenize:d,state:w,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;l=null;var i=t.tokenize(e,t);return(i||l)&&"comment"!=i&&(r=null,t.state=t.state(l||i,e,t),r&&(i="error"==r?i+" error":r)),i},indent:function(t,i,n){var o=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+s;if(o&&o.noIndent)return e.Pass;if(t.tokenize!=h&&t.tokenize!=d)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==a.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+s*(a.multilineTagIndentFactor||1);if(a.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:a.htmlMode?"html":"xml",helperType:a.htmlMode?"html":"xml",skipAttribute:function(e){e.state==E&&(e.state=S)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],i=e.context;i;i=i.prev)t.push(i.tagName);return t.reverse()}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}(i(237))},950:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"ckb",toolbar:{default:"بنه‌ڕه‌ت",save:"پاشه‌كه‌وتكردن",font:"فۆنت",formats:"Formats",fontSize:"قه‌باره‌",bold:"تۆخكردن",underline:"هێڵ به‌ژێردا بێنه‌",italic:"لار",strike:"هێڵ به‌ناودا بێنه‌",subscript:"ژێرسکریپت",superscript:"سەرنووس",removeFormat:"لابردنی فۆرمات",fontColor:"ره‌نگی فۆنت",hiliteColor:"ره‌نگی دیاركراو",indent:"بۆشایی بەجێهێشتن",outdent:"لابردنی بۆشایی",align:"ئاراسته‌",alignLeft:"لای چه‌پ",alignRight:"لای راست",alignCenter:"ناوه‌ند",alignJustify:"به‌رێكی دابه‌ش بكه‌",list:"لیست",orderList:"لیستی ریزكراو",unorderList:"لیستی ریزنه‌كراو",horizontalRule:"هێڵی ئاسۆیی",hr_solid:"پته‌و",hr_dotted:"نوكته‌ نوكته‌",hr_dashed:"داش داش",table:"خشته‌",link:"به‌سته‌ر",math:"بیركاری",image:"وێنه‌",video:"ڤیدیۆ",audio:"ده‌نگ",fullScreen:"پڕ به‌ شاشه‌",showBlocks:"بڵۆك نیشانبده",codeView:"بینینی كۆده‌كان",undo:"وەک خۆی لێ بکەوە",redo:"هەڵگەڕاندنەوە",preview:"پێشبینین",print:"پرینت",tag_p:"په‌ره‌گراف",tag_div:"ی ئاسایی (DIV)",tag_h:"سەرپەڕە",tag_blockquote:"ده‌ق",tag_pre:"كۆد",template:"قاڵب",lineHeight:"بڵندی دێر",paragraphStyle:"ستایلی په‌ره‌گراف",textStyle:"ستایلی نوسین",imageGallery:"گاله‌ری وێنه‌كان",dir_ltr:"من اليسار إلى اليمين",dir_rtl:"من اليمين الى اليسار",mention:"تنويه ب"},dialogBox:{linkBox:{title:"به‌سته‌ر دابنێ",url:"به‌سته‌ر",text:"تێكستی به‌سته‌ر",newWindowCheck:"له‌ په‌نجه‌ره‌یه‌كی نوێ بكه‌ره‌وه‌",downloadLinkCheck:"رابط التحميل",bookmark:"المرجعية"},mathBox:{title:"بیركاری",inputLabel:"نیشانه‌كانی بیركاری",fontSizeLabel:"قه‌باره‌ی فۆنت",previewLabel:"پێشبینین"},imageBox:{title:"وێنه‌یه‌ك دابنێ",file:"فایلێك هه‌ڵبژێره‌",url:"به‌سته‌ری وێنه‌",altText:"نوسینی جێگره‌وه‌"},videoBox:{title:"ڤیدیۆیه‌ك دابنێ",file:"فایلێك هه‌ڵبژێره‌",url:"YouTube/Vimeo به‌سته‌ری له‌ناودانان وه‌ك "},audioBox:{title:"ده‌نگێك دابنێ",file:"فایلێك هه‌ڵبژێره‌",url:"به‌سته‌ری ده‌نگ"},browser:{tags:"تاگه‌كان",search:"گه‌ران"},caption:"پێناسه‌یه‌ك دابنێ",close:"داخستن",submitButton:"ناردن",revertButton:"بیگەڕێنەوە سەر باری سەرەتایی",proportion:"رێژه‌كان وه‌ك خۆی بهێڵه‌وه‌",basic:"سه‌ره‌تایی",left:"چه‌پ",right:"راست",center:"ناوەڕاست",width:"پانی",height:"به‌رزی",size:"قه‌باره‌",ratio:"رێژه‌"},controller:{edit:"دەسکاریکردن",unlink:"سڕینەوەی بەستەر",remove:"سڕینه‌وه‌",insertRowAbove:"ریزك له‌ سه‌ره‌وه‌ زیادبكه‌",insertRowBelow:"ریزێك له‌ خواره‌وه‌ زیادبكه‌",deleteRow:"ریز بسره‌وه‌",insertColumnBefore:"ستونێك له‌ پێشه‌وه‌ زیادبكه‌",insertColumnAfter:"ستونێك له‌ دواوه‌ زیادبكه‌",deleteColumn:"ستونێك بسره‌وه‌",fixedColumnWidth:"پانی ستون نه‌گۆربكه‌",resize100:"قه‌باره‌ بگۆره‌ بۆ ١٠٠%",resize75:"قه‌باره‌ بگۆره‌ بۆ ٧٥%",resize50:"قه‌باره‌ بگۆره‌ بۆ ٥٠%",resize25:"قه‌باره‌ بگۆره‌ بۆ ٢٥%",autoSize:"قه‌باره‌ی خۆكارانه‌",mirrorHorizontal:"هه‌ڵگه‌رێنه‌وه‌ به‌ده‌وری ته‌وه‌ره‌ی ئاسۆیی",mirrorVertical:"هه‌ڵگه‌رێنه‌وه‌ به‌ده‌وری ته‌وه‌ره‌ی ستونی",rotateLeft:"بسوڕێنه‌ به‌لای چه‌پدا",rotateRight:"بسورێنه‌ به‌لای راستدا",maxSize:"گه‌وره‌ترین قه‌باره‌",minSize:"بچوكترین قه‌باره‌",tableHeader:"سه‌ردێری خشته‌ك",mergeCells:"خانه‌كان تێكه‌ڵبكه‌",splitCells:"خانه‌كان لێك جیابكه‌وه‌",HorizontalSplit:"جیاكردنه‌وه‌ی ئاسۆیی",VerticalSplit:"جیاكردنه‌وه‌ی ستونی"},menu:{spaced:"بۆشای هه‌بێت",bordered:"لێواری هه‌بێت",neon:"نیۆن",translucent:"كه‌مێك وه‌ك شووشه‌",shadow:"سێبه‌ر",code:"كۆد"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"ckb",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},31:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"da",toolbar:{default:"Default",save:"Gem",font:"Skrifttype",formats:"Format",fontSize:"Skriftstørrelse",bold:"Fed",underline:"Understreget",italic:"Skråskrift",strike:"Overstreget",subscript:"Sænket skrift",superscript:"Hævet skrift",removeFormat:"Fjern formatering",fontColor:"Skriftfarve",hiliteColor:"Baggrundsfarve",indent:"Ryk ind",outdent:"Ryk ud",align:"Justering",alignLeft:"Venstrejustering",alignRight:"Højrejustering",alignCenter:"Midterjustering",alignJustify:"Tilpas margin",list:"Lister",orderList:"Nummereret liste",unorderList:"Uordnet liste",horizontalRule:"Horisontal linie",hr_solid:"Almindelig",hr_dotted:"Punkteret",hr_dashed:"Streget",table:"Tabel",link:"Link",math:"Math",image:"Billede",video:"Video",audio:"Audio",fullScreen:"Fuld skærm",showBlocks:"Vis blokke",codeView:"Vis koder",undo:"Undo",redo:"Redo",preview:"Preview",print:"Print",tag_p:"Paragraph",tag_div:"Normal (DIV)",tag_h:"Overskrift",tag_blockquote:"Citer",tag_pre:"Code",template:"Schablone",lineHeight:"Linjehøjde",paragraphStyle:"Afsnitstil",textStyle:"Tekststil",imageGallery:"Billedgalleri",dir_ltr:"Venstre til højre",dir_rtl:"Højre til venstre",mention:"Nævne"},dialogBox:{linkBox:{title:"Indsæt link",url:"URL til link",text:"Tekst for link",newWindowCheck:"Åben i nyt faneblad",downloadLinkCheck:"Download link",bookmark:"Bogmærke"},mathBox:{title:"Math",inputLabel:"Matematisk notation",fontSizeLabel:"Skriftstørrelse",previewLabel:"Preview"},imageBox:{title:"Indsæt billede",file:"Indsæt fra fil",url:"Indsæt fra URL",altText:"Alternativ tekst"},videoBox:{title:"Indsæt Video",file:"Indsæt fra fil",url:"Indlejr video / YouTube,Vimeo"},audioBox:{title:"Indsæt Audio",file:"Indsæt fra fil",url:"Indsæt fra URL"},browser:{tags:"Tags",search:"Søg"},caption:"Indsæt beskrivelse",close:"Luk",submitButton:"Gennemfør",revertButton:"Gendan",proportion:"Bevar proportioner",basic:"Basis",left:"Venstre",right:"Højre",center:"Center",width:"Bredde",height:"Højde",size:"Størrelse",ratio:"Forhold"},controller:{edit:"Rediger",unlink:"Fjern link",remove:"Fjern",insertRowAbove:"Indsæt række foroven",insertRowBelow:"Indsæt række nedenfor",deleteRow:"Slet række",insertColumnBefore:"Indsæt kolonne før",insertColumnAfter:"Indsæt kolonne efter",deleteColumn:"Slet kolonne",fixedColumnWidth:"Fast søjlebredde",resize100:"Forstør 100%",resize75:"Forstør 75%",resize50:"Forstør 50%",resize25:"Forstør 25%",autoSize:"Auto størrelse",mirrorHorizontal:"Spejling, horisontal",mirrorVertical:"Spejling, vertikal",rotateLeft:"Roter til venstre",rotateRight:"Toter til højre",maxSize:"Max størrelse",minSize:"Min størrelse",tableHeader:"Tabel overskrift",mergeCells:"Sammenlæg celler (merge)",splitCells:"Opdel celler",HorizontalSplit:"Opdel horisontalt",VerticalSplit:"Opdel vertikalt"},menu:{spaced:"Brev Afstand",bordered:"Afgrænsningslinje",neon:"Neon",translucent:"Gennemsigtig",shadow:"Skygge",code:"Code"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"da",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},523:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"de",toolbar:{default:"Standard",save:"Speichern",font:"Schriftart",formats:"Format",fontSize:"Schriftgröße",bold:"Fett",underline:"Unterstrichen",italic:"Kursiv",strike:"Durchgestrichen",subscript:"Tiefgestellt",superscript:"Hochgestellt",removeFormat:"Format entfernen",fontColor:"Schriftfarbe",hiliteColor:"Farbe für Hervorhebungen",indent:"Einzug vergrößern",outdent:"Einzug verkleinern",align:"Ausrichtung",alignLeft:"Links ausrichten",alignRight:"Rechts ausrichten",alignCenter:"Zentriert ausrichten",alignJustify:"Blocksatz",list:"Liste",orderList:"Nummerierte Liste",unorderList:"Aufzählung",horizontalRule:"Horizontale Linie",hr_solid:"Strich",hr_dotted:"Gepunktet",hr_dashed:"Gestrichelt",table:"Tabelle",link:"Link",math:"Mathematik",image:"Bild",video:"Video",audio:"Audio",fullScreen:"Vollbild",showBlocks:"Blockformatierungen anzeigen",codeView:"Quelltext anzeigen",undo:"Rückgängig",redo:"Wiederholen",preview:"Vorschau",print:"Drucken",tag_p:"Absatz",tag_div:"Normal (DIV)",tag_h:"Header",tag_blockquote:"Zitat",tag_pre:"Quellcode",template:"Vorlage",lineHeight:"Zeilenhöhe",paragraphStyle:"Absatzstil",textStyle:"Textstil",imageGallery:"Bildergalerie",dir_ltr:"Links nach rechts",dir_rtl:"Rechts nach links",mention:"Erwähnen"},dialogBox:{linkBox:{title:"Link einfügen",url:"Link-URL",text:"Link-Text",newWindowCheck:"In neuem Fenster anzeigen",downloadLinkCheck:"Download-Link",bookmark:"Lesezeichen"},mathBox:{title:"Mathematik",inputLabel:"Mathematische Notation",fontSizeLabel:"Schriftgröße",previewLabel:"Vorschau"},imageBox:{title:"Bild einfügen",file:"Datei auswählen",url:"Bild-URL",altText:"Alternativer Text"},videoBox:{title:"Video einfügen",file:"Datei auswählen",url:"Video-URL, YouTube/Vimeo"},audioBox:{title:"Audio einfügen",file:"Datei auswählen",url:"Audio-URL"},browser:{tags:"Stichworte",search:"Suche"},caption:"Beschreibung eingeben",close:"Schließen",submitButton:"Übernehmen",revertButton:"Rückgängig",proportion:"Seitenverhältnis beibehalten",basic:"Standard",left:"Links",right:"Rechts",center:"Zentriert",width:"Breite",height:"Höhe",size:"Größe",ratio:"Verhältnis"},controller:{edit:"Bearbeiten",unlink:"Link entfernen",remove:"Löschen",insertRowAbove:"Zeile oberhalb einfügen",insertRowBelow:"Zeile unterhalb einfügen",deleteRow:"Zeile löschen",insertColumnBefore:"Spalte links einfügen",insertColumnAfter:"Spalte rechts einfügen",deleteColumn:"Spalte löschen",fixedColumnWidth:"Feste Spaltenbreite",resize100:"Zoom 100%",resize75:"Zoom 75%",resize50:"Zoom 50%",resize25:"Zoom 25%",autoSize:"Automatische Größenanpassung",mirrorHorizontal:"Horizontal spiegeln",mirrorVertical:"Vertikal spiegeln",rotateLeft:"Nach links drehen",rotateRight:"Nach rechts drehen",maxSize:"Maximale Größe",minSize:"Mindestgröße",tableHeader:"Tabellenüberschrift",mergeCells:"Zellen verbinden",splitCells:"Zellen teilen",HorizontalSplit:"Horizontal teilen",VerticalSplit:"Vertikal teilen"},menu:{spaced:"Buchstabenabstand",bordered:"Umrandet",neon:"Neon",translucent:"Durchscheinend",shadow:"Schatten",code:"Quellcode"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"de",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},791:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"en",toolbar:{default:"Default",save:"Save",font:"Font",formats:"Formats",fontSize:"Size",bold:"Bold",underline:"Underline",italic:"Italic",strike:"Strike",subscript:"Subscript",superscript:"Superscript",removeFormat:"Remove Format",fontColor:"Font Color",hiliteColor:"Highlight Color",indent:"Indent",outdent:"Outdent",align:"Align",alignLeft:"Align left",alignRight:"Align right",alignCenter:"Align center",alignJustify:"Align justify",list:"List",orderList:"Ordered list",unorderList:"Unordered list",horizontalRule:"Horizontal line",hr_solid:"Solid",hr_dotted:"Dotted",hr_dashed:"Dashed",table:"Table",link:"Link",math:"Math",image:"Image",video:"Video",audio:"Audio",fullScreen:"Full screen",showBlocks:"Show blocks",codeView:"Code view",undo:"Undo",redo:"Redo",preview:"Preview",print:"print",tag_p:"Paragraph",tag_div:"Normal (DIV)",tag_h:"Header",tag_blockquote:"Quote",tag_pre:"Code",template:"Template",lineHeight:"Line height",paragraphStyle:"Paragraph style",textStyle:"Text style",imageGallery:"Image gallery",dir_ltr:"Left to right",dir_rtl:"Right to left",mention:"Mention"},dialogBox:{linkBox:{title:"Insert Link",url:"URL to link",text:"Text to display",newWindowCheck:"Open in new window",downloadLinkCheck:"Download link",bookmark:"Bookmark"},mathBox:{title:"Math",inputLabel:"Mathematical Notation",fontSizeLabel:"Font Size",previewLabel:"Preview"},imageBox:{title:"Insert image",file:"Select from files",url:"Image URL",altText:"Alternative text"},videoBox:{title:"Insert Video",file:"Select from files",url:"Media embed URL, YouTube/Vimeo"},audioBox:{title:"Insert Audio",file:"Select from files",url:"Audio URL"},browser:{tags:"Tags",search:"Search"},caption:"Insert description",close:"Close",submitButton:"Submit",revertButton:"Revert",proportion:"Constrain proportions",basic:"Basic",left:"Left",right:"Right",center:"Center",width:"Width",height:"Height",size:"Size",ratio:"Ratio"},controller:{edit:"Edit",unlink:"Unlink",remove:"Remove",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",deleteRow:"Delete row",insertColumnBefore:"Insert column before",insertColumnAfter:"Insert column after",deleteColumn:"Delete column",fixedColumnWidth:"Fixed column width",resize100:"Resize 100%",resize75:"Resize 75%",resize50:"Resize 50%",resize25:"Resize 25%",autoSize:"Auto size",mirrorHorizontal:"Mirror, Horizontal",mirrorVertical:"Mirror, Vertical",rotateLeft:"Rotate left",rotateRight:"Rotate right",maxSize:"Max size",minSize:"Min size",tableHeader:"Table header",mergeCells:"Merge cells",splitCells:"Split Cells",HorizontalSplit:"Horizontal split",VerticalSplit:"Vertical split"},menu:{spaced:"Spaced",bordered:"Bordered",neon:"Neon",translucent:"Translucent",shadow:"Shadow",code:"Code"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"en",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},284:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"es",toolbar:{default:"Valor por defecto",save:"Guardar",font:"Fuente",formats:"Formato",fontSize:"Tamaño de fuente",bold:"Negrita",underline:"Subrayado",italic:"Cursiva",strike:"Tachado",subscript:"Subíndice",superscript:"Superíndice",removeFormat:"Eliminar formato",fontColor:"Color de fuente",hiliteColor:"Color de resaltado",indent:"Más tabulación",outdent:"Menos tabulación",align:"Alinear",alignLeft:"Alinear a la izquierda",alignRight:"Alinear a la derecha",alignCenter:"Alinear al centro",alignJustify:"Justificar",list:"Lista",orderList:"Lista ordenada",unorderList:"Lista desordenada",horizontalRule:"Horizontal line",hr_solid:"Línea horizontal solida",hr_dotted:"Línea horizontal punteada",hr_dashed:"Línea horizontal discontinua",table:"Tabla",link:"Link",math:"Matemáticas",image:"Imagen",video:"Video",audio:"Audio",fullScreen:"Pantalla completa",showBlocks:"Ver bloques",codeView:"Ver código fuente",undo:"UndoDeshacer última acción",redo:"Rehacer última acción",preview:"Vista previa",print:"Imprimir",tag_p:"Párrafo",tag_div:"Normal (DIV)",tag_h:"Header",tag_blockquote:"Cita",tag_pre:"Código",template:"Plantilla",lineHeight:"Altura de la línea",paragraphStyle:"Estilo del parrafo",textStyle:"Estilo del texto",imageGallery:"Galería de imágenes",dir_ltr:"De izquierda a derecha",dir_rtl:"De derecha a izquierda",mention:"Mencionar"},dialogBox:{linkBox:{title:"Insertar Link",url:"¿Hacia que URL lleva el link?",text:"Texto para mostrar",newWindowCheck:"Abrir en una nueva ventana",downloadLinkCheck:"Enlace de descarga",bookmark:"Marcador"},mathBox:{title:"Matemáticas",inputLabel:"Notación Matemática",fontSizeLabel:"Tamaño de fuente",previewLabel:"Vista previa"},imageBox:{title:"Insertar imagen",file:"Seleccionar desde los archivos",url:"URL de la imagen",altText:"Texto alternativo"},videoBox:{title:"Insertar Video",file:"Seleccionar desde los archivos",url:"¿URL del vídeo? Youtube/Vimeo"},audioBox:{title:"Insertar Audio",file:"Seleccionar desde los archivos",url:"URL de la audio"},browser:{tags:"Etiquetas",search:"Buscar"},caption:"Insertar descripción",close:"Cerrar",submitButton:"Enviar",revertButton:"revertir",proportion:"Restringir las proporciones",basic:"Basico",left:"Izquierda",right:"derecha",center:"Centro",width:"Ancho",height:"Alto",size:"Tamaño",ratio:"Proporción"},controller:{edit:"Editar",unlink:"Desvincular",remove:"RemoveQuitar",insertRowAbove:"Insertar fila arriba",insertRowBelow:"Insertar fila debajo",deleteRow:"Eliminar fila",insertColumnBefore:"Insertar columna antes",insertColumnAfter:"Insertar columna después",deleteColumn:"Eliminar columna",fixedColumnWidth:"Ancho de columna fijo",resize100:"Redimensionar 100%",resize75:"Redimensionar 75%",resize50:"Redimensionar 50%",resize25:"Redimensionar 25%",autoSize:"Tamaño automático",mirrorHorizontal:"Espejo, Horizontal",mirrorVertical:"Espejo, Vertical",rotateLeft:"Girar a la izquierda",rotateRight:"Girar a la derecha",maxSize:"Tamaño máximo",minSize:"Tamaño minímo",tableHeader:"Encabezado de tabla",mergeCells:"Combinar celdas",splitCells:"Dividir celdas",HorizontalSplit:"División horizontal",VerticalSplit:"División vertical"},menu:{spaced:"Espaciado",bordered:"Bordeado",neon:"Neón",translucent:"Translúcido",shadow:"Sombreado",code:"Código"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"es",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},664:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"fr",toolbar:{default:"Défaut",save:"Sauvegarder",font:"Police",formats:"Formats",fontSize:"Taille",bold:"Gras",underline:"Souligné",italic:"Italique",strike:"Barré",subscript:"Indice",superscript:"Exposant",removeFormat:"Effacer le formatage",fontColor:"Couleur du texte",hiliteColor:"Couleur en arrière plan",indent:"Indenter",outdent:"Désindenter",align:"Alignement",alignLeft:"À gauche",alignRight:"À droite",alignCenter:"Centré",alignJustify:"Justifié",list:"Liste",orderList:"Ordonnée",unorderList:"Non-ordonnée",horizontalRule:"Ligne horizontale",hr_solid:"Solide",hr_dotted:"Points",hr_dashed:"Tirets",table:"Table",link:"Lien",math:"Math",image:"Image",video:"Video",audio:"Audio",fullScreen:"Plein écran",showBlocks:"Voir les blocs",codeView:"Voir le code",undo:"Annuler",redo:"Rétablir",preview:"Prévisualiser",print:"Imprimer",tag_p:"Paragraphe",tag_div:"Normal (DIV)",tag_h:"Titre",tag_blockquote:"Citation",tag_pre:"Code",template:"Template",lineHeight:"Hauteur de la ligne",paragraphStyle:"Style de paragraphe",textStyle:"Style de texte",imageGallery:"Galerie d'images",dir_ltr:"De gauche à droite",dir_rtl:"De droite à gauche",mention:"Mention"},dialogBox:{linkBox:{title:"Insérer un lien",url:"Adresse URL du lien",text:"Texte à afficher",newWindowCheck:"Ouvrir dans une nouvelle fenêtre",downloadLinkCheck:"Lien de téléchargement",bookmark:"Signet"},mathBox:{title:"Math",inputLabel:"Notation mathématique",fontSizeLabel:"Taille",previewLabel:"Prévisualiser"},imageBox:{title:"Insérer une image",file:"Sélectionner le fichier",url:"Adresse URL du fichier",altText:"Texte Alternatif"},videoBox:{title:"Insérer une vidéo",file:"Sélectionner le fichier",url:"URL d’intégration du média, YouTube/Vimeo"},audioBox:{title:"Insérer un fichier audio",file:"Sélectionner le fichier",url:"Adresse URL du fichier"},browser:{tags:"Mots clés",search:"Chercher"},caption:"Insérer une description",close:"Fermer",submitButton:"Appliquer",revertButton:"Revenir en arrière",proportion:"Maintenir le rapport hauteur/largeur",basic:"Basique",left:"Gauche",right:"Droite",center:"Centré",width:"Largeur",height:"Hauteur",size:"Taille",ratio:"Rapport"},controller:{edit:"Modifier",unlink:"Supprimer un lien",remove:"Effacer",insertRowAbove:"Insérer une ligne en dessous",insertRowBelow:"Insérer une ligne au dessus",deleteRow:"Effacer la ligne",insertColumnBefore:"Insérer une colonne avant",insertColumnAfter:"Insérer une colonne après",deleteColumn:"Effacer la colonne",fixedColumnWidth:"Largeur de colonne fixe",resize100:"Redimensionner à 100%",resize75:"Redimensionner à 75%",resize50:"Redimensionner à 50%",resize25:"Redimensionner à 25%",autoSize:"Taille automatique",mirrorHorizontal:"Mirroir, Horizontal",mirrorVertical:"Mirroir, Vertical",rotateLeft:"Rotation à gauche",rotateRight:"Rotation à droite",maxSize:"Taille max",minSize:"Taille min",tableHeader:"En-tête de table",mergeCells:"Fusionner les cellules",splitCells:"Diviser les Cellules",HorizontalSplit:"Scission horizontale",VerticalSplit:"Scission verticale"},menu:{spaced:"Espacement",bordered:"Ligne de démarcation",neon:"Néon",translucent:"Translucide",shadow:"Ombre",code:"Code"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"fr",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},559:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"he",toolbar:{default:"ברירת מחדל",save:"שמור",font:"גופן",formats:"עיצוב",fontSize:"גודל",bold:"מודגש",underline:"קו תחתון",italic:"נטוי",strike:"קו חוצה",subscript:"עילי",superscript:"תחתי",removeFormat:"הסר עיצוב",fontColor:"צבע גופן",hiliteColor:"צבע קו תחתון",indent:"הגדל כניסה",outdent:"הקטן כניסה",align:"יישור",alignLeft:"יישר לשמאל",alignRight:"יישר לימין",alignCenter:"מרכז",alignJustify:"יישר לשני הצדדים",list:"רשימה",orderList:"מספור",unorderList:"תבליטים",horizontalRule:"קו אופקי",hr_solid:"קו",hr_dotted:"נקודות",hr_dashed:"מקפים",table:"טבלה",link:"קישור",math:"מתמטיקה",image:"תמונה",video:"חוזי",audio:"שמע",fullScreen:"מסך מלא",showBlocks:"הצג גושים",codeView:"הצג קוד",undo:"בטל",redo:"חזור",preview:"תצוגה מקדימה",print:"הדפס",tag_p:"פסקה",tag_div:"רגילה (DIV)",tag_h:"כותרת",tag_blockquote:"ציטוט",tag_pre:"קוד",template:"תבנית",lineHeight:"גובה השורה",paragraphStyle:"סגנון פסקה",textStyle:"סגנון גופן",imageGallery:"גלרית תמונות",dir_ltr:"משמאל לימין",dir_rtl:"מימין לשמאל",mention:"הזכר"},dialogBox:{linkBox:{title:"הכנס קשור",url:"כתובת קשור",text:"תיאור",newWindowCheck:"פתח בחלון חדש",downloadLinkCheck:"קישור להורדה",bookmark:"סמניה"},mathBox:{title:"נוסחה",inputLabel:"סימנים מתמטים",fontSizeLabel:"גודל גופן",previewLabel:"תצוגה מקדימה"},imageBox:{title:"הכנס תמונה",file:"בחר מקובץ",url:"כתובת URL תמונה",altText:"תיאור (תגית alt)"},videoBox:{title:"הכנס סרטון",file:"בחר מקובץ",url:"כתובת הטמעה YouTube/Vimeo"},audioBox:{title:"הכנס שמע",file:"בחר מקובץ",url:"כתובת URL שמע"},browser:{tags:"תג",search:"חפש"},caption:"הכנס תיאור",close:"סגור",submitButton:"שלח",revertButton:"בטל",proportion:"שמר יחס",basic:"בסיסי",left:"שמאל",right:"ימין",center:"מרכז",width:"רוחב",height:"גובה",size:"גודל",ratio:"יחס"},controller:{edit:"ערוך",unlink:"הסר קישורים",remove:"הסר",insertRowAbove:"הכנס שורה מעל",insertRowBelow:"הכנס שורה מתחת",deleteRow:"מחק שורה",insertColumnBefore:"הכנס עמודה לפני",insertColumnAfter:"הכנס עמודה אחרי",deleteColumn:"מחק עמודה",fixedColumnWidth:"קבע רוחב עמודות",resize100:"ללא הקטנה",resize75:"הקטן 75%",resize50:"הקטן 50%",resize25:"הקטן 25%",autoSize:"הקטן אוטומטית",mirrorHorizontal:"הפוך לרוחב",mirrorVertical:"הפוך לגובה",rotateLeft:"סובב שמאלה",rotateRight:"סובב ימינה",maxSize:"גודל מרבי",minSize:"גודל מזערי",tableHeader:"כותרת טבלה",mergeCells:"מזג תאים",splitCells:"פצל תא",HorizontalSplit:"פצל לגובה",VerticalSplit:"פצל לרוחב"},menu:{spaced:"מרווח",bordered:"בעל מיתאר",neon:"זוהר",translucent:"שקוף למחצה",shadow:"צל",code:"קוד"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"he",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},789:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"it",toolbar:{default:"Predefinita",save:"Salva",font:"Font",formats:"Formato",fontSize:"Grandezza",bold:"Grassetto",underline:"Sottolineato",italic:"Corsivo",strike:"Barrato",subscript:"Apice",superscript:"Pedice",removeFormat:"Rimuovi formattazione",fontColor:"Colore testo",hiliteColor:"Colore sottolineatura",indent:"Aumenta rientro",outdent:"Riduci rientro",align:"Allinea",alignLeft:"Allinea a sinistra",alignRight:"Allinea a destra",alignCenter:"Allinea al centro",alignJustify:"Giustifica testo",list:"Elenco",orderList:"Elenco numerato",unorderList:"Elenco puntato",horizontalRule:"Linea orizzontale",hr_solid:"Linea continua",hr_dotted:"Puntini",hr_dashed:"Trattini",table:"Tabella",link:"Collegamento ipertestuale",math:"Formula matematica",image:"Immagine",video:"Video",audio:"Audio",fullScreen:"A tutto schermo",showBlocks:"Visualizza blocchi",codeView:"Visualizza codice",undo:"Annulla",redo:"Ripristina",preview:"Anteprima",print:"Stampa",tag_p:"Paragrafo",tag_div:"Normale (DIV)",tag_h:"Titolo",tag_blockquote:"Citazione",tag_pre:"Codice",template:"Modello",lineHeight:"Interlinea",paragraphStyle:"Stile paragrafo",textStyle:"Stile testo",imageGallery:"Galleria di immagini",dir_ltr:"Da sinistra a destra",dir_rtl:"Da destra a sinistra",mention:"Menzione"},dialogBox:{linkBox:{title:"Inserisci un link",url:"Indirizzo",text:"Testo da visualizzare",newWindowCheck:"Apri in una nuova finestra",downloadLinkCheck:"Link per scaricare",bookmark:"Segnalibro"},mathBox:{title:"Matematica",inputLabel:"Notazione matematica",fontSizeLabel:"Grandezza testo",previewLabel:"Anteprima"},imageBox:{title:"Inserisci immagine",file:"Seleziona da file",url:"Indirizzo immagine",altText:"Testo alternativo (ALT)"},videoBox:{title:"Inserisci video",file:"Seleziona da file",url:"Indirizzo video di embed, YouTube/Vimeo"},audioBox:{title:"Inserisci audio",file:"Seleziona da file",url:"Indirizzo audio"},browser:{tags:"tag",search:"Ricerca"},caption:"Inserisci didascalia",close:"Chiudi",submitButton:"Invia",revertButton:"Annulla",proportion:"Proporzionale",basic:"Da impostazione",left:"Sinistra",right:"Destra",center:"Centrato",width:"Larghezza",height:"Altezza",size:"Dimensioni",ratio:"Rapporto"},controller:{edit:"Modifica",unlink:"Elimina link",remove:"Rimuovi",insertRowAbove:"Inserisci riga sopra",insertRowBelow:"Inserisci riga sotto",deleteRow:"Cancella riga",insertColumnBefore:"Inserisci colonna prima",insertColumnAfter:"Inserisci colonna dopo",deleteColumn:"Cancella colonna",fixedColumnWidth:"Larghezza delle colonne fissa",resize100:"Ridimensiona 100%",resize75:"Ridimensiona 75%",resize50:"Ridimensiona 50%",resize25:"Ridimensiona 25%",autoSize:"Ridimensione automatica",mirrorHorizontal:"Capovolgi orizzontalmente",mirrorVertical:"Capovolgi verticalmente",rotateLeft:"Ruota a sinistra",rotateRight:"Ruota a destra",maxSize:"Dimensione massima",minSize:"Dimensione minima",tableHeader:"Intestazione tabella",mergeCells:"Unisci celle",splitCells:"Dividi celle",HorizontalSplit:"Separa orizontalmente",VerticalSplit:"Separa verticalmente"},menu:{spaced:"Spaziato",bordered:"Bordato",neon:"Luminoso",translucent:"Traslucido",shadow:"Ombra",code:"Codice"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"it",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG una finestra con un documento");return i(e)}:i(t)},173:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"ja",toolbar:{default:"デフォルト",save:"保存",font:"フォント",formats:"段落形式",fontSize:"サイズ",bold:"太字",underline:"下線",italic:"イタリック",strike:"取り消し線",subscript:"下付き",superscript:"上付き",removeFormat:"形式を削除",fontColor:"文字色",hiliteColor:"文字の背景色",indent:"インデント",outdent:"インデント",align:"ソート",alignLeft:"左揃え",alignRight:"右揃え",alignCenter:"中央揃え",alignJustify:"両端揃え",list:"リスト",orderList:"数値ブリット",unorderList:"円形ブリット",horizontalRule:"水平線を挿入",hr_solid:"実線",hr_dotted:"点線",hr_dashed:"ダッシュ",table:"テーブル",link:"リンク",math:"数学",image:"画像",video:"動画",audio:"オーディオ",fullScreen:"フルスクリーン",showBlocks:"ブロック表示",codeView:"HTMLの編集",undo:"元に戻す",redo:"再実行",preview:"プレビュー",print:"印刷",tag_p:"本文",tag_div:"基本(DIV)",tag_h:"タイトル",tag_blockquote:"引用",tag_pre:"コード",template:"テンプレート",lineHeight:"行の高さ",paragraphStyle:"段落スタイル",textStyle:"テキストスタイル",imageGallery:"イメージギャラリー",dir_ltr:"左から右へ",dir_rtl:"右から左に",mention:"言及する"},dialogBox:{linkBox:{title:"リンクの挿入",url:"インターネットアドレス",text:"画面のテキスト",newWindowCheck:"別ウィンドウで開く",downloadLinkCheck:"ダウンロードリンク",bookmark:"ブックマーク"},mathBox:{title:"数学",inputLabel:"数学表記",fontSizeLabel:"サイズ",previewLabel:"プレビュー"},imageBox:{title:"画像の挿入",file:"ファイルの選択",url:"イメージアドレス",altText:"置換文字列"},videoBox:{title:"動画を挿入",file:"ファイルの選択",url:"メディア埋め込みアドレス, YouTube/Vimeo"},audioBox:{title:"オーディオを挿入",file:"ファイルの選択",url:"オーディオアドレス"},browser:{tags:"タグ",search:"探す"},caption:"説明付け",close:"閉じる",submitButton:"確認",revertButton:"元に戻す",proportion:"の割合カスタマイズ",basic:"基本",left:"左",right:"右",center:"中央",width:"横",height:"縦",size:"サイズ",ratio:"比率"},controller:{edit:"編集",unlink:"リンク解除",remove:"削除",insertRowAbove:"上に行を挿入",insertRowBelow:"下に行を挿入",deleteRow:"行の削除",insertColumnBefore:"左に列を挿入",insertColumnAfter:"右に列を挿入",deleteColumn:"列を削除する",fixedColumnWidth:"固定列幅",resize100:"100% サイズ",resize75:"75% サイズ",resize50:"50% サイズ",resize25:"25% サイズ",autoSize:"自動サイズ",mirrorHorizontal:"左右反転",mirrorVertical:"上下反転",rotateLeft:"左に回転",rotateRight:"右に回転",maxSize:"最大サイズ",minSize:"最小サイズ",tableHeader:"表のヘッダー",mergeCells:"セルの結合",splitCells:"セルを分割",HorizontalSplit:"横分割",VerticalSplit:"垂直分割"},menu:{spaced:"文字間隔",bordered:"境界線",neon:"ネオン",translucent:"半透明",shadow:"影",code:"コード"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"ja",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},786:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"ko",toolbar:{default:"기본값",save:"저장",font:"글꼴",formats:"문단 형식",fontSize:"크기",bold:"굵게",underline:"밑줄",italic:"기울임",strike:"취소선",subscript:"아래 첨자",superscript:"위 첨자",removeFormat:"형식 제거",fontColor:"글자색",hiliteColor:"배경색",indent:"들여쓰기",outdent:"내어쓰기",align:"정렬",alignLeft:"왼쪽 정렬",alignRight:"오른쪽 정렬",alignCenter:"가운데 정렬",alignJustify:"양쪽 정렬",list:"리스트",orderList:"숫자형 리스트",unorderList:"원형 리스트",horizontalRule:"가로 줄 삽입",hr_solid:"실선",hr_dotted:"점선",hr_dashed:"대시",table:"테이블",link:"링크",math:"수식",image:"이미지",video:"동영상",audio:"오디오",fullScreen:"전체 화면",showBlocks:"블록 보기",codeView:"HTML 편집",undo:"실행 취소",redo:"다시 실행",preview:"미리보기",print:"인쇄",tag_p:"본문",tag_div:"기본 (DIV)",tag_h:"제목",tag_blockquote:"인용문",tag_pre:"코드",template:"템플릿",lineHeight:"줄 높이",paragraphStyle:"문단 스타일",textStyle:"글자 스타일",imageGallery:"이미지 갤러리",dir_ltr:"왼쪽에서 오른쪽",dir_rtl:"오른쪽에서 왼쪽",mention:"멘션"},dialogBox:{linkBox:{title:"링크 삽입",url:"인터넷 주소",text:"화면 텍스트",newWindowCheck:"새창으로 열기",downloadLinkCheck:"다운로드 링크",bookmark:"북마크"},mathBox:{title:"수식",inputLabel:"수학적 표기법",fontSizeLabel:"글자 크기",previewLabel:"미리보기"},imageBox:{title:"이미지 삽입",file:"파일 선택",url:"이미지 주소",altText:"대체 문자열"},videoBox:{title:"동영상 삽입",file:"파일 선택",url:"미디어 임베드 주소, 유튜브/비메오"},audioBox:{title:"오디오 삽입",file:"파일 선택",url:"오디오 파일 주소"},browser:{tags:"태그",search:"검색"},caption:"설명 넣기",close:"닫기",submitButton:"확인",revertButton:"되돌리기",proportion:"비율 맞춤",basic:"기본",left:"왼쪽",right:"오른쪽",center:"가운데",width:"가로",height:"세로",size:"크기",ratio:"비율"},controller:{edit:"편집",unlink:"링크 해제",remove:"삭제",insertRowAbove:"위에 행 삽입",insertRowBelow:"아래에 행 삽입",deleteRow:"행 삭제",insertColumnBefore:"왼쪽에 열 삽입",insertColumnAfter:"오른쪽에 열 삽입",deleteColumn:"열 삭제",fixedColumnWidth:"고정 된 열 너비",resize100:"100% 크기",resize75:"75% 크기",resize50:"50% 크기",resize25:"25% 크기",autoSize:"자동 크기",mirrorHorizontal:"좌우 반전",mirrorVertical:"상하 반전",rotateLeft:"왼쪽으로 회전",rotateRight:"오른쪽으로 회전",maxSize:"최대화",minSize:"최소화",tableHeader:"테이블 제목",mergeCells:"셀 병합",splitCells:"셀 분할",HorizontalSplit:"가로 분할",VerticalSplit:"세로 분할"},menu:{spaced:"글자 간격",bordered:"경계선",neon:"네온",translucent:"반투명",shadow:"그림자",code:"코드"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"ko",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},782:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"lv",toolbar:{default:"Noklusējuma",save:"Saglabāt",font:"Fonts",formats:"Formāti",fontSize:"Fonta lielums",bold:"Treknraksts",underline:"Pasvītrot",italic:"Slīpraksts",strike:"Pārsvītrojums",subscript:"Apakšraksts",superscript:"Augšraksts",removeFormat:"Noņemt formātu",fontColor:"Fonta krāsa",hiliteColor:"Teksta iezīmēšanas krāsa",indent:"Palielināt atkāpi",outdent:"Samazināt atkāpi",align:"Izlīdzināt",alignLeft:"Līdzināt pa kreisi",alignRight:"Līdzināt pa labi",alignCenter:"Centrēt",alignJustify:"Taisnot",list:"Saraksts",orderList:"Numerācija",unorderList:"Aizzimes",horizontalRule:"Horizontāla līnija",hr_solid:"Ciets",hr_dotted:"Punktiņš",hr_dashed:"Braša",table:"Tabula",link:"Saite",math:"Matemātika",image:"Attēls",video:"Video",audio:"Audio",fullScreen:"Pilnekrāna režīms",showBlocks:"Parādit blokus",codeView:"Koda skats",undo:"Atsaukt",redo:"Atkārtot",preview:"Priekšskatījums",print:"Drukāt",tag_p:"Paragrāfs",tag_div:"Normāli (DIV)",tag_h:"Galvene",tag_blockquote:"Citāts",tag_pre:"Kods",template:"Veidne",lineHeight:"Līnijas augstums",paragraphStyle:"Paragrāfa stils",textStyle:"Teksta stils",imageGallery:"Attēlu galerija",dir_ltr:"No kreisās uz labo",dir_rtl:"No labās uz kreiso",mention:"Pieminēt"},dialogBox:{linkBox:{title:"Ievietot saiti",url:"Saites URL",text:"Parādāmais teksts",newWindowCheck:"Atvērt jaunā logā",downloadLinkCheck:"Lejupielādes saite",bookmark:"Grāmatzīme"},mathBox:{title:"Matemātika",inputLabel:"Matemātiskā notācija",fontSizeLabel:"Fonta lielums",previewLabel:"Priekšskatījums"},imageBox:{title:"Ievietot attēlu",file:"Izvēlieties no failiem",url:"Attēla URL",altText:"Alternatīvs teksts"},videoBox:{title:"Ievietot video",file:"Izvēlieties no failiem",url:"Multivides iegulšanas URL, YouTube/Vimeo"},audioBox:{title:"Ievietot audio",file:"Izvēlieties no failiem",url:"Audio URL"},browser:{tags:"Tagi",search:"Meklēt"},caption:"Ievietot aprakstu",close:"Aizvērt",submitButton:"Iesniegt",revertButton:"Atjaunot",proportion:"Ierobežo proporcijas",basic:"Nav iesaiņojuma",left:"Pa kreisi",right:"Labajā pusē",center:"Centrs",width:"Platums",height:"Augstums",size:"Izmērs",ratio:"Attiecība"},controller:{edit:"Rediģēt",unlink:"Atsaistīt",remove:"Noņemt",insertRowAbove:"Ievietot rindu virs",insertRowBelow:"Ievietot rindu zemāk",deleteRow:"Dzēst rindu",insertColumnBefore:"Ievietot kolonnu pirms",insertColumnAfter:"Ievietot kolonnu aiz",deleteColumn:"Dzēst kolonnu",fixColumnWidth:"Fiksēts kolonnas platums",resize100:"Mainīt izmēru 100%",resize75:"Mainīt izmēru 75%",resize50:"Mainīt izmēru 50%",resize25:"Mainīt izmēru 25%",autoSize:"Automātiskais izmērs",mirrorHorizontal:"Spogulis, horizontāls",mirrorVertical:"Spogulis, vertikāls",rotateLeft:"Pagriezt pa kreisi",rotateRight:"Pagriezt pa labi",maxSize:"Maksimālais izmērs",minSize:"Minimālais izmērs",tableHeader:"Tabulas galvene",mergeCells:"Apvienot šūnas",splitCells:"Sadalīt šūnas",HorizontalSplit:"Horizontāls sadalījums",VerticalSplit:"Vertikāls sadalījums"},menu:{spaced:"Ar atstarpi",bordered:"Robežojās",neon:"Neona",translucent:"Caurspīdīgs",shadow:"Ēna",code:"Kods"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"lv",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},430:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"nl",toolbar:{default:"Standaard",save:"Opslaan",font:"Lettertype",formats:"Formaten",fontSize:"Lettergrootte",bold:"Vetgedrukt",underline:"Onderstrepen",italic:"Cursief",strike:"Doorstrepen",subscript:"Subscript",superscript:"Superscript",removeFormat:"Opmaak verwijderen",fontColor:"Tekstkleur",hiliteColor:"Tekst markeren",indent:"Inspringen",outdent:"Inspringen ongedaan maken",align:"Uitlijnen",alignLeft:"Links uitlijnen",alignRight:"Rechts uitlijnen",alignCenter:"In het midden uitlijnen",alignJustify:"Uitvullen",list:"Lijst",orderList:"Geordende lijst",unorderList:"Ongeordende lijst",horizontalRule:"Horizontale regel",hr_solid:"Standaard",hr_dotted:"Gestippeld",hr_dashed:"Gestreept",table:"Tabel",link:"Link",math:"Wiskunde",image:"Afbeelding",video:"Video",audio:"Audio",fullScreen:"Volledig scherm",showBlocks:"Blokken tonen",codeView:"Broncode weergeven",undo:"Ongedaan maken",redo:"Ongedaan maken herstellen",preview:"Voorbeeldweergave",print:"Printen",tag_p:"Alinea",tag_div:"Normaal (div)",tag_h:"Kop",tag_blockquote:"Citaat",tag_pre:"Code",template:"Sjabloon",lineHeight:"Lijnhoogte",paragraphStyle:"Alineastijl",textStyle:"Tekststijl",imageGallery:"Galerij",dir_ltr:"Van links naar rechts",dir_rtl:"Rechts naar links",mention:"Vermelding"},dialogBox:{linkBox:{title:"Link invoegen",url:"URL",text:"Tekst van de link",newWindowCheck:"In een nieuw tabblad openen",downloadLinkCheck:"Downloadlink",bookmark:"Bladwijzer"},mathBox:{title:"Wiskunde",inputLabel:"Wiskundige notatie",fontSizeLabel:"Lettergrootte",previewLabel:"Voorbeeld"},imageBox:{title:"Afbeelding invoegen",file:"Selecteer een bestand van uw apparaat",url:"URL",altText:"Alt-tekst"},videoBox:{title:"Video invoegen",file:"Selecteer een bestand van uw apparaat",url:"Embedded URL (YouTube/Vimeo)"},audioBox:{title:"Audio invoegen",file:"Selecteer een bestand van uw apparaat",url:"URL"},browser:{tags:"Tags",search:"Zoeken"},caption:"Omschrijving toevoegen",close:"Sluiten",submitButton:"Toepassen",revertButton:"Standaardwaarden herstellen",proportion:"Verhouding behouden",basic:"Standaard",left:"Links",right:"Rechts",center:"Midden",width:"Breedte",height:"Hoogte",size:"Grootte",ratio:"Verhouding"},controller:{edit:"Bewerken",unlink:"Ontkoppelen",remove:"Verwijderen",insertRowAbove:"Rij hierboven invoegen",insertRowBelow:"Rij hieronder invoegen",deleteRow:"Rij verwijderen",insertColumnBefore:"Kolom links invoegen",insertColumnAfter:"Kolom rechts invoegen",deleteColumn:"Kolom verwijderen",fixedColumnWidth:"Vaste kolombreedte",resize100:"Formaat wijzigen: 100%",resize75:"Formaat wijzigen: 75%",resize50:"Formaat wijzigen: 50%",resize25:"Formaat wijzigen: 25%",autoSize:"Automatische grootte",mirrorHorizontal:"Horizontaal spiegelen",mirrorVertical:"Verticaal spiegelen",rotateLeft:"Naar links draaien",rotateRight:"Naar rechts draaien",maxSize:"Maximale grootte",minSize:"Minimale grootte",tableHeader:"Tabelkoppen",mergeCells:"Cellen samenvoegen",splitCells:"Cellen splitsen",HorizontalSplit:"Horizontaal splitsen",VerticalSplit:"Verticaal splitsen"},menu:{spaced:"Uit elkaar",bordered:"Omlijnd",neon:"Neon",translucent:"Doorschijnend",shadow:"Schaduw",code:"Code"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"nl",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},168:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"pl",toolbar:{default:"Domyślne",save:"Zapisz",font:"Czcionka",formats:"Formaty",fontSize:"Rozmiar",bold:"Pogrubienie",underline:"Podkreślenie",italic:"Kursywa",strike:"Przekreślenie",subscript:"Indeks dolny",superscript:"Indeks górny",removeFormat:"Wyczyść formatowanie",fontColor:"Kolor tekstu",hiliteColor:"Kolor tła tekstu",indent:"Zwiększ wcięcie",outdent:"Zmniejsz wcięcie",align:"Wyrównaj",alignLeft:"Do lewej",alignRight:"Do prawej",alignCenter:"Do środka",alignJustify:"Wyjustuj",list:"Lista",orderList:"Lista numerowana",unorderList:"Lista wypunktowana",horizontalRule:"Pozioma linia",hr_solid:"Ciągła",hr_dotted:"Kropkowana",hr_dashed:"Przerywana",table:"Tabela",link:"Odnośnik",math:"Matematyczne",image:"Obraz",video:"Wideo",audio:"Audio",fullScreen:"Pełny ekran",showBlocks:"Pokaż bloki",codeView:"Widok kodu",undo:"Cofnij",redo:"Ponów",preview:"Podgląd",print:"Drukuj",tag_p:"Akapit",tag_div:"Blok (DIV)",tag_h:"Nagłówek H",tag_blockquote:"Cytat",tag_pre:"Kod",template:"Szablon",lineHeight:"Odstęp między wierszami",paragraphStyle:"Styl akapitu",textStyle:"Styl tekstu",imageGallery:"Galeria obrazów",dir_ltr:"Od lewej do prawej",dir_rtl:"Od prawej do lewej",mention:"Wzmianka"},dialogBox:{linkBox:{title:"Wstaw odnośnik",url:"Adres URL",text:"Tekst do wyświetlenia",newWindowCheck:"Otwórz w nowym oknie",downloadLinkCheck:"Link do pobrania",bookmark:"Zakładka"},mathBox:{title:"Matematyczne",inputLabel:"Zapis matematyczny",fontSizeLabel:"Rozmiar czcionki",previewLabel:"Podgląd"},imageBox:{title:"Wstaw obraz",file:"Wybierz plik",url:"Adres URL obrazka",altText:"Tekst alternatywny"},videoBox:{title:"Wstaw wideo",file:"Wybierz plik",url:"Adres URL video, np. YouTube/Vimeo"},audioBox:{title:"Wstaw audio",file:"Wybierz plik",url:"Adres URL audio"},browser:{tags:"Tagi",search:"Szukaj"},caption:"Wstaw opis",close:"Zamknij",submitButton:"Zatwierdź",revertButton:"Cofnij zmiany",proportion:"Ogranicz proporcje",basic:"Bez wyrównania",left:"Do lewej",right:"Do prawej",center:"Do środka",width:"Szerokość",height:"Wysokość",size:"Rozmiar",ratio:"Proporcje"},controller:{edit:"Edycja",unlink:"Usuń odnośnik",remove:"Usuń",insertRowAbove:"Wstaw wiersz powyżej",insertRowBelow:"Wstaw wiersz poniżej",deleteRow:"Usuń wiersz",insertColumnBefore:"Wstaw kolumnę z lewej",insertColumnAfter:"Wstaw kolumnę z prawej",deleteColumn:"Usuń kolumnę",fixedColumnWidth:"Stała szerokość kolumny",resize100:"Zmień rozmiar - 100%",resize75:"Zmień rozmiar - 75%",resize50:"Zmień rozmiar - 50%",resize25:"Zmień rozmiar - 25%",autoSize:"Rozmiar automatyczny",mirrorHorizontal:"Odbicie lustrzane w poziomie",mirrorVertical:"Odbicie lustrzane w pionie",rotateLeft:"Obróć w lewo",rotateRight:"Obróć w prawo",maxSize:"Maksymalny rozmiar",minSize:"Minimalny rozmiar",tableHeader:"Nagłówek tabeli",mergeCells:"Scal komórki",splitCells:"Podziel komórki",HorizontalSplit:"Podział poziomy",VerticalSplit:"Podział pionowy"},menu:{spaced:"Rozstawiony",bordered:"Z obwódką",neon:"Neon",translucent:"Półprzezroczysty",shadow:"Cień",code:"Kod"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"pl",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},55:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"pt_br",toolbar:{default:"Padrão",save:"Salvar",font:"Fonte",formats:"Formatos",fontSize:"Tamanho",bold:"Negrito",underline:"Sublinhado",italic:"Itálico",strike:"Riscado",subscript:"Subescrito",superscript:"Sobrescrito",removeFormat:"Remover Formatação",fontColor:"Cor da Fonte",hiliteColor:"Cor de destaque",indent:"Recuo",outdent:"Avançar",align:"Alinhar",alignLeft:"Alinhar à esquerda",alignRight:"Alinhar à direita",alignCenter:"Centralizar",alignJustify:"Justificar",list:"Lista",orderList:"Lista ordenada",unorderList:"Lista desordenada",horizontalRule:"Linha horizontal",hr_solid:"sólida",hr_dotted:"pontilhada",hr_dashed:"tracejada",table:"Tabela",link:"Link",math:"Matemática",image:"Imagem",video:"Vídeo",audio:"Áudio",fullScreen:"Tela cheia",showBlocks:"Mostrar blocos",codeView:"Mostrar códigos",undo:"Voltar",redo:"Refazer",preview:"Prever",print:"Imprimir",tag_p:"Paragráfo",tag_div:"(DIV) Normal",tag_h:"Cabeçalho",tag_blockquote:"Citar",tag_pre:"Código",template:"Modelo",lineHeight:"Altura da linha",paragraphStyle:"Estilo do parágrafo",textStyle:"Estilo do texto",imageGallery:"Galeria de imagens",dir_ltr:"Esquerda para direita",dir_rtl:"Direita para esquerda",mention:"Menção"},dialogBox:{linkBox:{title:"Inserir link",url:"URL para link",text:"Texto a mostrar",newWindowCheck:"Abrir em nova guia",downloadLinkCheck:"Link para Download",bookmark:"marcar páginas"},mathBox:{title:"Matemática",inputLabel:"Notação matemática",fontSizeLabel:"Tamanho",previewLabel:"Prever"},imageBox:{title:"Inserir imagens",file:"Selecionar arquivos",url:"URL da imagem",altText:"Texto alternativo"},videoBox:{title:"Inserir vídeo",file:"Selecionar arquivos",url:"URL do YouTube/Vimeo"},audioBox:{title:"Inserir áudio",file:"Selecionar arquivos",url:"URL da áudio"},browser:{tags:"Tag",search:"Procurar"},caption:"Inserir descrição",close:"Fechar",submitButton:"Enviar",revertButton:"Reverter",proportion:"Restringir proporções",basic:"Básico",left:"Esquerda",right:"Direita",center:"Centro",width:"Largura",height:"Altura",size:"Tamanho",ratio:"Proporções"},controller:{edit:"Editar",unlink:"Remover link",remove:"Remover",insertRowAbove:"Inserir linha acima",insertRowBelow:"Inserir linha abaixo",deleteRow:"Deletar linha",insertColumnBefore:"Inserir coluna antes",insertColumnAfter:"Inserir coluna depois",deleteColumn:"Deletar coluna",fixedColumnWidth:"Largura fixa da coluna",resize100:"Redimensionar para 100%",resize75:"Redimensionar para 75%",resize50:"Redimensionar para 50%",resize25:"Redimensionar para 25%",autoSize:"Tamanho automático",mirrorHorizontal:"Espelho, Horizontal",mirrorVertical:"Espelho, Vertical",rotateLeft:"Girar para esquerda",rotateRight:"Girar para direita",maxSize:"Tam máx",minSize:"Tam mín",tableHeader:"Cabeçalho da tabela",mergeCells:"Mesclar células",splitCells:"Dividir células",HorizontalSplit:"Divisão horizontal",VerticalSplit:"Divisão vertical"},menu:{spaced:"Espaçado",bordered:"Com borda",neon:"Neon",translucent:"Translúcido",shadow:"Sombreado",code:"Código"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"pt_br",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},71:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"ro",toolbar:{default:"Default",save:"Salvează",font:"Font",formats:"Format",fontSize:"Dimensiune",bold:"Îngroșat",underline:"Subliniat",italic:"Înclinat",strike:"Tăiat",subscript:"Subscript",superscript:"Superscript",removeFormat:"Șterge formatare",fontColor:"Culoare font",hiliteColor:"Culoare de evidențiere",indent:"Indentează",outdent:"Fără indentare",align:"Aliniere",alignLeft:"Aliniere la stânga",alignRight:"Aliniere la dreapta",alignCenter:"Aliniere la centru",alignJustify:"Aliniere stânga - dreapta",list:"Listă",orderList:"Listă ordonată",unorderList:"Listă neordonată",horizontalRule:"Linie orizontală",hr_solid:"Solid",hr_dotted:"Punctat",hr_dashed:"Punctate",table:"Tabel",link:"Link",math:"Matematică",image:"Imagine",video:"Video",audio:"Audio",fullScreen:"Tot ecranul",showBlocks:"Arată blocuri",codeView:"Vizualizare cod",undo:"Anulează",redo:"Refă",preview:"Previzualizare",print:"printează",tag_p:"Paragraf",tag_div:"Normal (DIV)",tag_h:"Antet",tag_blockquote:"Quote",tag_pre:"Citat",template:"Template",lineHeight:"Înălțime linie",paragraphStyle:"Stil paragraf",textStyle:"Stil text",imageGallery:"Galerie de imagini",dir_ltr:"De la stânga la dreapta",dir_rtl:"De la dreapta la stanga",mention:"Mentiune"},dialogBox:{linkBox:{title:"Inserează Link",url:"Adresă link",text:"Text de afișat",newWindowCheck:"Deschide în fereastră nouă",downloadLinkCheck:"Link de descărcare",bookmark:"Marcaj"},mathBox:{title:"Matematică",inputLabel:"Notație matematică",fontSizeLabel:"Dimensiune font",previewLabel:"Previzualizare"},imageBox:{title:"Inserează imagine",file:"Selectează",url:"URL imagine",altText:"text alternativ"},videoBox:{title:"Inserează video",file:"Selectează",url:"Include URL, youtube/vimeo"},audioBox:{title:"Inserează Audio",file:"Selectează",url:"URL Audio"},browser:{tags:"Etichete",search:"Căutareim"},caption:"Inserează descriere",close:"Închide",submitButton:"Salvează",revertButton:"Revenire",proportion:"Constrânge proporțiile",basic:"De bază",left:"Stânga",right:"Dreapta",center:"Centru",width:"Lățime",height:"Înălțime",size:"Dimensiune",ratio:"Ratie"},controller:{edit:"Editează",unlink:"Scoate link",remove:"Elimină",insertRowAbove:"Inserează rând deasupra",insertRowBelow:"Inserează rând dedesupt",deleteRow:"Șterge linie",insertColumnBefore:"Inserează coloană înainte",insertColumnAfter:"Inserează coloană după",deleteColumn:"Șterge coloană",fixedColumnWidth:"Lățime fixă coloană",resize100:"Redimensionare 100%",resize75:"Redimensionare 75%",resize50:"Redimensionare 50%",resize25:"Redimensionare 25%",autoSize:"Dimensiune automată",mirrorHorizontal:"Oglindă, orizontal",mirrorVertical:"Oglindă, vertical",rotateLeft:"Rotește la stânga",rotateRight:"Rotește la dreapta",maxSize:"Dimensiune maximă",minSize:"Dimensiune minimă",tableHeader:"Antet tabel",mergeCells:"Îmbină celule",splitCells:"Divizează celule",HorizontalSplit:"Despicare orizontală",VerticalSplit:"Despicare verticală"},menu:{spaced:"Spațiat",bordered:"Mărginit",neon:"Neon",translucent:"Translucent",shadow:"Umbră",code:"Citat"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"ro",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},993:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"ru",toolbar:{default:"По умолчанию",save:"Сохранить",font:"Шрифт",formats:"Стиль абзаца",fontSize:"Размер шрифта",bold:"Полужирный",underline:"Подчёркнутый",italic:"Курсив",strike:"Зачеркнутый",subscript:"Нижний индекс",superscript:"Верхний индекс",removeFormat:"Очистить форматирование",fontColor:"Цвет текста",hiliteColor:"Цвет фона",indent:"Увеличить отступ",outdent:"Уменьшить отступ",align:"Выравнивание",alignLeft:"Слева",alignRight:"Справа",alignCenter:"По центру",alignJustify:"По ширине",list:"Списки",orderList:"Нумерованный",unorderList:"Маркированный",horizontalRule:"Горизонтальная линия",hr_solid:"Сплошная",hr_dotted:"Пунктир",hr_dashed:"Штриховая",table:"Таблица",link:"Ссылка",math:"математический",image:"Изображение",video:"Видео",audio:"Аудио",fullScreen:"Полный экран",showBlocks:"Блочный вид",codeView:"Редактировать HTML",undo:"Отменить",redo:"Вернуть",preview:"Предварительный просмотр",print:"Печать",tag_p:"Текст",tag_div:"Базовый",tag_h:"Заголовок",tag_blockquote:"Цитата",tag_pre:"Код",template:"Шаблон",lineHeight:"Высота линии",paragraphStyle:"Стиль абзаца",textStyle:"Стиль текста",imageGallery:"Галерея",dir_ltr:"Слева направо",dir_rtl:"Справа налево",mention:"Упоминание"},dialogBox:{linkBox:{title:"Вставить ссылку",url:"Ссылка",text:"Текст",newWindowCheck:"Открывать в новом окне",downloadLinkCheck:"Ссылка для скачивания",bookmark:"Закладка"},mathBox:{title:"математический",inputLabel:"Математическая запись",fontSizeLabel:"Кегль",previewLabel:"Предварительный просмотр"},imageBox:{title:"Вставить изображение",file:"Выберите файл",url:"Адрес изображения",altText:"Текстовое описание изображения"},videoBox:{title:"Вставить видео",file:"Выберите файл",url:"Ссылка на видео, Youtube,Vimeo"},audioBox:{title:"Вставить аудио",file:"Выберите файл",url:"Адрес аудио"},browser:{tags:"Теги",search:"Поиск"},caption:"Добавить подпись",close:"Закрыть",submitButton:"Подтвердить",revertButton:"Сбросить",proportion:"Сохранить пропорции",basic:"Без обтекания",left:"Слева",right:"Справа",center:"По центру",width:"Ширина",height:"Высота",size:"Размер",ratio:"Соотношение"},controller:{edit:"Изменить",unlink:"Убрать ссылку",remove:"Удалить",insertRowAbove:"Вставить строку выше",insertRowBelow:"Вставить строку ниже",deleteRow:"Удалить строку",insertColumnBefore:"Вставить столбец слева",insertColumnAfter:"Вставить столбец справа",deleteColumn:"Удалить столбец",fixedColumnWidth:"Фиксированная ширина столбца",resize100:"Размер 100%",resize75:"Размер 75%",resize50:"Размер 50%",resize25:"Размер 25%",autoSize:"Авто размер",mirrorHorizontal:"Отразить по горизонтали",mirrorVertical:"Отразить по вертикали",rotateLeft:"Повернуть против часовой стрелки",rotateRight:"Повернуть по часовой стрелке",maxSize:"Ширина по размеру страницы",minSize:"Ширина по содержимому",tableHeader:"Строка заголовков",mergeCells:"Объединить ячейки",splitCells:"Разделить ячейку",HorizontalSplit:"Разделить горизонтально",VerticalSplit:"Разделить вертикально"},menu:{spaced:"интервал",bordered:"Граничная Линия",neon:"неон",translucent:"полупрозрачный",shadow:"Тень",code:"Код"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"ru",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},744:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"se",toolbar:{default:"Default",save:"Spara",font:"Typsnitt",formats:"Format",fontSize:"Textstorlek",bold:"Fet",underline:"Understruket",italic:"Kursiv",strike:"Överstruket",subscript:"Sänkt skrift",superscript:"Höjd skrift",removeFormat:"Ta bort formattering",fontColor:"Textfärg",hiliteColor:"Bakgrundsfärg",indent:"Minska indrag",outdent:"Öka indrag",align:"Justering",alignLeft:"Vänsterjustering",alignRight:"Högerjustering",alignCenter:"Mittenjusteirng",alignJustify:"Justera indrag",list:"Listor",orderList:"Numrerad lista",unorderList:"Oordnad lista",horizontalRule:"Horisontell linje",hr_solid:"Solid",hr_dotted:"Punkter",hr_dashed:"Prickad",table:"Tabell",link:"Länk",math:"Math",image:"Bild",video:"Video",audio:"Ljud",fullScreen:"Helskärm",showBlocks:"Visa block",codeView:"Visa koder",undo:"Ångra",redo:"Gör om",preview:"Preview",print:"Print",tag_p:"Paragraf",tag_div:"Normal (DIV)",tag_h:"Rubrik",tag_blockquote:"Citer",tag_pre:"Kod",template:"Mall",lineHeight:"Linjehöjd",paragraphStyle:"Stil på stycke",textStyle:"Textstil",imageGallery:"Bildgalleri",dir_ltr:"Vänster till höger",dir_rtl:"Höger till vänster",mention:"Namn"},dialogBox:{linkBox:{title:"Lägg till länk",url:"URL till länk",text:"Länktext",newWindowCheck:"Öppna i nytt fönster",downloadLinkCheck:"Nedladdningslänk",bookmark:"Bokmärke"},mathBox:{title:"Math",inputLabel:"Matematisk notation",fontSizeLabel:"Textstorlek",previewLabel:"Preview"},imageBox:{title:"Lägg till bild",file:"Lägg till från fil",url:"Lägg till från URL",altText:"Alternativ text"},videoBox:{title:"Lägg till video",file:"Lägg till från fil",url:"Bädda in video / YouTube,Vimeo"},audioBox:{title:"Lägg till ljud",file:"Lägg till från fil",url:"Lägg till från URL"},browser:{tags:"Tags",search:"Sök"},caption:"Lägg till beskrivning",close:"Stäng",submitButton:"Skicka",revertButton:"Återgå",proportion:"Spara proportioner",basic:"Basic",left:"Vänster",right:"Höger",center:"Center",width:"Bredd",height:"Höjd",size:"Storlek",ratio:"Förhållande"},controller:{edit:"Redigera",unlink:"Ta bort länk",remove:"Ta bort",insertRowAbove:"Lägg till rad över",insertRowBelow:"Lägg till rad under",deleteRow:"Ta bort rad",insertColumnBefore:"Lägg till kolumn före",insertColumnAfter:"Lägg till kolumn efter",deleteColumn:"Ta bort kolumner",fixedColumnWidth:"Fast kolumnbredd",resize100:"Förstora 100%",resize75:"Förstora 75%",resize50:"Förstora 50%",resize25:"Förstora 25%",autoSize:"Autostorlek",mirrorHorizontal:"Spegling, horisontell",mirrorVertical:"Spegling, vertikal",rotateLeft:"Rotera till vänster",rotateRight:"Rotera till höger",maxSize:"Maxstorlek",minSize:"Minsta storlek",tableHeader:"Rubrik tabell",mergeCells:"Sammanfoga celler (merge)",splitCells:"Separera celler",HorizontalSplit:"Separera horisontalt",VerticalSplit:"Separera vertikalt"},menu:{spaced:"Avstånd",bordered:"Avgränsningslinje",neon:"Neon",translucent:"Genomskinlig",shadow:"Skugga",code:"Kod"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"se",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},302:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"ua",toolbar:{default:"По замовчуванням",save:"Зберегти",font:"Шрифт",formats:"Стиль абзацу",fontSize:"Розмір шрифту",bold:"Жирний",underline:"Підкреслений",italic:"Курсив",strike:"Перекреслити",subscript:"Нижній індекс",superscript:"Верхній індекс",removeFormat:"Очистити форматування",fontColor:"Колір тексту",hiliteColor:"Колір виділення",indent:"Збільшити відступ",outdent:"Зменшити відступ",align:"Вирівнювання",alignLeft:"За лівим краєм",alignRight:"За правим краєм",alignCenter:"По центру",alignJustify:"За шириною",list:"Список",orderList:"Нумерований",unorderList:"Маркований",horizontalRule:"Горизонтальна лінія",hr_solid:"Суцільна",hr_dotted:"Пунктирна",hr_dashed:"Штрихова",table:"Таблиця",link:"Посилання",math:"Формула",image:"Зображення",video:"Відео",audio:"Аудіо",fullScreen:"Повний екран",showBlocks:"Показати блоки",codeView:"Редагувати як HTML",undo:"Скасувати",redo:"Виконати знову",preview:"Попередній перегляд",print:"Друк",tag_p:"Абзац",tag_div:"Базовий",tag_h:"Заголовок",tag_blockquote:"Цитата",tag_pre:"Код",template:"Шаблон",lineHeight:"Висота лінії",paragraphStyle:"Стиль абзацу",textStyle:"Стиль тексту",imageGallery:"Галерея",dir_ltr:"Зліва направо",dir_rtl:"Справа наліво",mention:"Згадати"},dialogBox:{linkBox:{title:"Вставити посилання",url:"Посилання",text:"Текст",newWindowCheck:"Відкривати в новому вікні",downloadLinkCheck:"Посилання для завантаження",bookmark:"Закладка"},mathBox:{title:"Формула",inputLabel:"Математична запис",fontSizeLabel:"Розмір шрифту",previewLabel:"Попередній перегляд"},imageBox:{title:"Вставити зображення",file:"Виберіть файл",url:"Посилання на зображення",altText:"Текстовий опис зображення"},videoBox:{title:"Вставити відео",file:"Виберіть файл",url:"Посилання на відео, Youtube, Vimeo"},audioBox:{title:"Вставити аудіо",file:"Виберіть файл",url:"Посилання на аудіо"},browser:{tags:"Теги",search:"Пошук"},caption:"Додати підпис",close:"Закрити",submitButton:"Підтвердити",revertButton:"Скинути",proportion:"Зберегти пропорції",basic:"Без обтікання",left:"Зліва",right:"Справа",center:"По центру",width:"Ширина",height:"Висота",size:"Розмір",ratio:"Співвідношення"},controller:{edit:"Змінити",unlink:"Прибрати посилання",remove:"Видалити",insertRowAbove:"Вставити рядок вище",insertRowBelow:"Вставити рядок нижче",deleteRow:"Видалити рядок",insertColumnBefore:"Вставити стовпець зліва",insertColumnAfter:"Вставити стовпець справа",deleteColumn:"Видалити стовпець",fixedColumnWidth:"Фіксована ширина стовпця",resize100:"Розмір 100%",resize75:"Розмір 75%",resize50:"Розмір 50%",resize25:"Розмір 25%",autoSize:"Авто розмір",mirrorHorizontal:"Відобразити по горизонталі",mirrorVertical:"Відобразити по вертикалі",rotateLeft:"Повернути проти годинникової стрілки",rotateRight:"Повернути за годинниковою стрілкою",maxSize:"Ширина за розміром сторінки",minSize:"Ширина за вмістом",tableHeader:"Заголовок таблиці",mergeCells:"Об'єднати клітинки",splitCells:"Розділити клітинку",HorizontalSplit:"Розділити горизонтально",VerticalSplit:"Розділити вертикально"},menu:{spaced:"Інтервал",bordered:"З лініями",neon:"Неон",translucent:"Напівпрозорий",shadow:"Тінь",code:"Код"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"ua",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},835:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"ur",toolbar:{default:"طے شدہ",save:"محفوظ کریں",font:"فونٹ",formats:"فارمیٹس",fontSize:"سائز",bold:"بولڈ",underline:"انڈر لائن",italic:"ترچھا",strike:"لکیرہ کردہ",subscript:"ذیلی",superscript:"انتہائی",removeFormat:"فارمیٹ کو حذف دیں",fontColor:"لکھائی کا رنگ",hiliteColor:"نمایاں رنگ",indent:"حاشیہ",outdent:"ہاشیہ واپس",align:"رخ",alignLeft:"بائیں طرف",alignRight:"دائیں طرف",alignCenter:"مرکز میں طرف",alignJustify:"ہر طرف برابر",list:"فہرست",orderList:"ترتیب شدہ فہرست",unorderList:"غیر ترتیب شدہ فہرست",horizontalRule:"لکیر",hr_solid:"ٹھوس",hr_dotted:"نقطے دار",hr_dashed:"ڈیشڈ",table:"میز",link:"لنک",math:"ریاضی",image:"تصویر",video:"ویڈیو",audio:"آواز",fullScreen:"پوری اسکرین",showBlocks:"ڈبے دکھائیں",codeView:"کوڈ کا نظارہ",undo:"واپس کریں",redo:"دوبارہ کریں",preview:"پیشنظر",print:"پرنٹ کریں",tag_p:"پیراگراف",tag_div:"عام (div)",tag_h:"ہیڈر",tag_blockquote:"اقتباس",tag_pre:"کوڈ",template:"سانچہ",lineHeight:"لکیر کی اونچائی",paragraphStyle:"عبارت کا انداز",textStyle:"متن کا انداز",imageGallery:"تصویری نگارخانہ",dir_ltr:"بائیں سے دائیں",dir_rtl:"دائیں سے بائیں",mention:"تذکرہ"},dialogBox:{linkBox:{title:"لنک داخل کریں",url:"لنک کرنے کے لیے URL",text:"ظاہر کرنے کے لیے متن",newWindowCheck:"نئی ونڈو میں کھولیں",downloadLinkCheck:"ڈاؤن لوڈ لنک",bookmark:"بک مارک"},mathBox:{title:"ریاضی",inputLabel:"ریاضیاتی اشارے",fontSizeLabel:"حرف کا سائز",previewLabel:"پیش نظارہ"},imageBox:{title:"تصویر داخل کریں",file:"فائلوں سے منتخب کریں",url:"تصویری URL",altText:"متبادل متن"},videoBox:{title:"ویڈیو داخل کریں",file:"فائلوں سے منتخب کریں",url:"ذرائع ابلاغ کا یو آر ایل، یوٹیوب/ویمیو"},audioBox:{title:"آواز داخل کریں",file:"فائلوں سے منتخب کریں",url:"آواز URL"},browser:{tags:"ٹیگز",search:"تلاش کریں"},caption:"عنوان",close:"بند کریں",submitButton:"بھیجیں",revertButton:"واپس",proportion:"تناسب کو محدود کریں",basic:"بنیادی",left:"بائیں",right:"دائیں",center:"مرکز",width:"چوڑائی",height:"اونچائی",size:"حجم",ratio:"تناسب"},controller:{edit:"ترمیم",unlink:"لنک ختم کریں",remove:"حذف",insertRowAbove:"اوپر قطار شامل کریں",insertRowBelow:"نیچے قطار شامل کریں",deleteRow:"قطار کو حذف کریں",insertColumnBefore:"پہلے ستون شامل کریں",insertColumnAfter:"اس کے بعد ستون شامل کریں",deleteColumn:"ستون حذف کریں",fixedColumnWidth:"مقررہ ستون کی چوڑائی",resize100:"100% کا حجم تبدیل کریں",resize75:"75% کا حجم تبدیل کریں",resize50:"50% کا حجم تبدیل کریں",resize25:"25% کا حجم تبدیل کریں",autoSize:"ازخود حجم",mirrorHorizontal:"آئینہ، افقی",mirrorVertical:"آئینہ، عمودی",rotateLeft:"بائیں گھومو",rotateRight:"دائیں گھمائیں",maxSize:"زیادہ سے زیادہ سائز",minSize:"کم از کم سائز",tableHeader:"میز کی سرخی",mergeCells:"حجروں کو ضم کریں",splitCells:"حجروں کو علیدہ کرو",HorizontalSplit:"افقی تقسیم",VerticalSplit:"عمودی تقسیم"},menu:{spaced:"فاصلہ",bordered:"سرحدی",neon:"نیین",translucent:"پارباسی",shadow:"سایہ",code:"کوڈ"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"ur",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},456:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"zh_cn",toolbar:{default:"默认",save:"保存",font:"字体",formats:"格式",fontSize:"字号",bold:"粗体",underline:"下划线",italic:"斜体",strike:"删除线",subscript:"下标",superscript:"上标",removeFormat:"清除格式",fontColor:"字体颜色",hiliteColor:"背景颜色",indent:"增加缩进",outdent:"减少缩进",align:"对齐方式",alignLeft:"左对齐",alignRight:"右对齐",alignCenter:"居中",alignJustify:"两端对齐",list:"列表",orderList:"有序列表",unorderList:"无序列表",horizontalRule:"水平线",hr_solid:"实线",hr_dotted:"点线",hr_dashed:"虚线",table:"表格",link:"超链接",math:"数学",image:"图片",video:"视频",audio:"音讯",fullScreen:"全屏",showBlocks:"显示块区域",codeView:"代码视图",undo:"撤消",redo:"恢复",preview:"预览",print:"打印",tag_p:"段落",tag_div:"正文 (DIV)",tag_h:"标题",tag_blockquote:"引用",tag_pre:"代码",template:"模板",lineHeight:"行高",paragraphStyle:"段落样式",textStyle:"文字样式",imageGallery:"图片库",dir_ltr:"左到右",dir_rtl:"右到左",mention:"提到"},dialogBox:{linkBox:{title:"插入超链接",url:"网址",text:"要显示的文字",newWindowCheck:"在新标签页中打开",downloadLinkCheck:"下载链接",bookmark:"书签"},mathBox:{title:"数学",inputLabel:"数学符号",fontSizeLabel:"字号",previewLabel:"预览"},imageBox:{title:"插入图片",file:"上传图片",url:"图片网址",altText:"替换文字"},videoBox:{title:"插入视频",file:"上传图片",url:"嵌入网址, Youtube,Vimeo"},audioBox:{title:"插入音频",file:"上传图片",url:"音频网址"},browser:{tags:"标签",search:"搜索"},caption:"标题",close:"取消",submitButton:"确定",revertButton:"恢复",proportion:"比例",basic:"基本",left:"左",right:"右",center:"居中",width:"宽度",height:"高度",size:"尺寸",ratio:"比"},controller:{edit:"编辑",unlink:"去除链接",remove:"删除",insertRowAbove:"在上方插入",insertRowBelow:"在下方插入",deleteRow:"删除行",insertColumnBefore:"在左侧插入",insertColumnAfter:"在右侧插入",deleteColumn:"删除列",fixedColumnWidth:"固定列宽",resize100:"放大 100%",resize75:"放大 75%",resize50:"放大 50%",resize25:"放大 25%",mirrorHorizontal:"翻转左右",mirrorVertical:"翻转上下",rotateLeft:"向左旋转",rotateRight:"向右旋转",maxSize:"最大尺寸",minSize:"最小尺寸",tableHeader:"表格标题",mergeCells:"合并单元格",splitCells:"分割单元格",HorizontalSplit:"水平分割",VerticalSplit:"垂直分割"},menu:{spaced:"间隔开",bordered:"边界线",neon:"霓虹灯",translucent:"半透明",shadow:"阴影",code:"代码"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"zh_cn",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},315:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={name:"component",set_container:function(e,t){const i=this.util.createElement("DIV");return i.className="se-component "+t,i.appendChild(e),i},set_cover:function(e){const t=this.util.createElement("FIGURE");return t.appendChild(e),t},create_caption:function(){const e=this.util.createElement("FIGCAPTION");return e.innerHTML="
"+this.lang.dialogBox.caption+"
",e}};return void 0===t&&(e.SUNEDITOR_MODULES||Object.defineProperty(e,"SUNEDITOR_MODULES",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_MODULES,"component",{enumerable:!0,writable:!1,configurable:!1,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_MODULES a window with a document");return i(e)}:i(t)},350:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={name:"dialog",add:function(e){const t=e.context;t.dialog={kind:"",updateModal:!1,_closeSignal:!1};let i=e.util.createElement("DIV");i.className="se-dialog sun-editor-common";let n=e.util.createElement("DIV");n.className="se-dialog-back",n.style.display="none";let o=e.util.createElement("DIV");o.className="se-dialog-inner",o.style.display="none",i.appendChild(n),i.appendChild(o),t.dialog.modalArea=i,t.dialog.back=n,t.dialog.modal=o,t.dialog.modal.addEventListener("mousedown",this._onMouseDown_dialog.bind(e)),t.dialog.modal.addEventListener("click",this._onClick_dialog.bind(e)),t.element.relative.appendChild(i),i=null,n=null,o=null},_onMouseDown_dialog:function(e){/se-dialog-inner/.test(e.target.className)?this.context.dialog._closeSignal=!0:this.context.dialog._closeSignal=!1},_onClick_dialog:function(e){(/close/.test(e.target.getAttribute("data-command"))||this.context.dialog._closeSignal)&&this.plugins.dialog.close.call(this)},open:function(e,t){if(this.modalForm)return!1;this.plugins.dialog._bindClose&&(this._d.removeEventListener("keydown",this.plugins.dialog._bindClose),this.plugins.dialog._bindClose=null),this.plugins.dialog._bindClose=function(e){/27/.test(e.keyCode)&&this.plugins.dialog.close.call(this)}.bind(this),this._d.addEventListener("keydown",this.plugins.dialog._bindClose),this.context.dialog.updateModal=t,"full"===this.options.popupDisplay?this.context.dialog.modalArea.style.position="fixed":this.context.dialog.modalArea.style.position="absolute",this.context.dialog.kind=e,this.modalForm=this.context[e].modal;const i=this.context[e].focusElement;"function"==typeof this.plugins[e].on&&this.plugins[e].on.call(this,t),this.context.dialog.modalArea.style.display="block",this.context.dialog.back.style.display="block",this.context.dialog.modal.style.display="block",this.modalForm.style.display="block",i&&i.focus()},_bindClose:null,close:function(){this.plugins.dialog._bindClose&&(this._d.removeEventListener("keydown",this.plugins.dialog._bindClose),this.plugins.dialog._bindClose=null);const e=this.context.dialog.kind;this.modalForm.style.display="none",this.context.dialog.back.style.display="none",this.context.dialog.modalArea.style.display="none",this.context.dialog.updateModal=!1,"function"==typeof this.plugins[e].init&&this.plugins[e].init.call(this),this.context.dialog.kind="",this.modalForm=null,this.focus()}};return void 0===t&&(e.SUNEDITOR_MODULES||Object.defineProperty(e,"SUNEDITOR_MODULES",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_MODULES,"dialog",{enumerable:!0,writable:!1,configurable:!1,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_MODULES a window with a document");return i(e)}:i(t)},438:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={name:"fileBrowser",_xmlHttp:null,_loading:null,add:function(e){const t=e.context;t.fileBrowser={_closeSignal:!1,area:null,header:null,tagArea:null,body:null,list:null,tagElements:null,items:[],selectedTags:[],selectorHandler:null,contextPlugin:"",columnSize:4};let i=e.util.createElement("DIV");i.className="se-file-browser sun-editor-common";let n=e.util.createElement("DIV");n.className="se-file-browser-back";let o=e.util.createElement("DIV");o.className="se-file-browser-inner",o.innerHTML=this.set_browser(e),i.appendChild(n),i.appendChild(o),this._loading=i.querySelector(".se-loading-box"),t.fileBrowser.area=i,t.fileBrowser.header=o.querySelector(".se-file-browser-header"),t.fileBrowser.titleArea=o.querySelector(".se-file-browser-title"),t.fileBrowser.tagArea=o.querySelector(".se-file-browser-tags"),t.fileBrowser.body=o.querySelector(".se-file-browser-body"),t.fileBrowser.list=o.querySelector(".se-file-browser-list"),t.fileBrowser.tagArea.addEventListener("click",this.onClickTag.bind(e)),t.fileBrowser.list.addEventListener("click",this.onClickFile.bind(e)),o.addEventListener("mousedown",this._onMouseDown_browser.bind(e)),o.addEventListener("click",this._onClick_browser.bind(e)),t.element.relative.appendChild(i),i=null,n=null,o=null},set_browser:function(e){const t=e.lang;return'
'},_onMouseDown_browser:function(e){/se-file-browser-inner/.test(e.target.className)?this.context.fileBrowser._closeSignal=!0:this.context.fileBrowser._closeSignal=!1},_onClick_browser:function(e){e.stopPropagation(),(/close/.test(e.target.getAttribute("data-command"))||this.context.fileBrowser._closeSignal)&&this.plugins.fileBrowser.close.call(this)},open:function(e,t){this.plugins.fileBrowser._bindClose&&(this._d.removeEventListener("keydown",this.plugins.fileBrowser._bindClose),this.plugins.fileBrowser._bindClose=null),this.plugins.fileBrowser._bindClose=function(e){/27/.test(e.keyCode)&&this.plugins.fileBrowser.close.call(this)}.bind(this),this._d.addEventListener("keydown",this.plugins.fileBrowser._bindClose);const i=this.context.fileBrowser;i.contextPlugin=e,i.selectorHandler=t;const n=this.context[e],o=n.listClass;this.util.hasClass(i.list,o)||(i.list.className="se-file-browser-list "+o),"full"===this.options.popupDisplay?i.area.style.position="fixed":i.area.style.position="absolute",i.titleArea.textContent=n.title,i.area.style.display="block",this.plugins.fileBrowser._drawFileList.call(this,this.context[e].url,this.context[e].header)},_bindClose:null,close:function(){const e=this.plugins.fileBrowser;e._xmlHttp&&e._xmlHttp.abort(),e._bindClose&&(this._d.removeEventListener("keydown",e._bindClose),e._bindClose=null);const t=this.context.fileBrowser;t.area.style.display="none",t.selectorHandler=null,t.selectedTags=[],t.items=[],t.list.innerHTML=t.tagArea.innerHTML=t.titleArea.textContent="","function"==typeof this.plugins[t.contextPlugin].init&&this.plugins[t.contextPlugin].init.call(this),t.contextPlugin=""},showBrowserLoading:function(){this._loading.style.display="block"},closeBrowserLoading:function(){this._loading.style.display="none"},_drawFileList:function(e,t){const i=this.plugins.fileBrowser,n=i._xmlHttp=this.util.getXMLHttpRequest();if(n.onreadystatechange=i._callBackGet.bind(this,n),n.open("get",e,!0),null!==t&&"object"==typeof t&&this._w.Object.keys(t).length>0)for(let e in t)n.setRequestHeader(e,t[e]);n.send(null),this.plugins.fileBrowser.showBrowserLoading()},_callBackGet:function(e){if(4===e.readyState)if(this.plugins.fileBrowser._xmlHttp=null,200===e.status)try{const t=JSON.parse(e.responseText);t.result.length>0?this.plugins.fileBrowser._drawListItem.call(this,t.result,!0):t.nullMessage&&(this.context.fileBrowser.list.innerHTML=t.nullMessage)}catch(e){throw Error('[SUNEDITOR.fileBrowser.drawList.fail] cause : "'+e.message+'"')}finally{this.plugins.fileBrowser.closeBrowserLoading(),this.context.fileBrowser.body.style.maxHeight=this._w.innerHeight-this.context.fileBrowser.header.offsetHeight-50+"px"}else if(this.plugins.fileBrowser.closeBrowserLoading(),0!==e.status){const t=e.responseText?JSON.parse(e.responseText):e,i="[SUNEDITOR.fileBrowser.get.serverException] status: "+e.status+", response: "+(t.errorMessage||e.responseText);throw Error(i)}},_drawListItem:function(e,t){const i=this.context.fileBrowser,n=this.context[i.contextPlugin],o=[],l=e.length,r=n.columnSize||i.columnSize,s=r<=1?1:Math.round(l/r)||1,a=n.itemTemplateHandler;let c="",u='
',d=1;for(let i,n,h=0;h
'),t&&n.length>0)for(let e,t=0,i=n.length;t'+e+"");u+="
",i.list.innerHTML=u,t&&(i.items=e,i.tagArea.innerHTML=c,i.tagElements=i.tagArea.querySelectorAll("A"))},onClickTag:function(e){const t=e.target;if(!this.util.isAnchor(t))return;const i=t.textContent,n=this.plugins.fileBrowser,o=this.context.fileBrowser,l=o.tagArea.querySelector('a[title="'+i+'"]'),r=o.selectedTags,s=r.indexOf(i);s>-1?(r.splice(s,1),this.util.removeClass(l,"on")):(r.push(i),this.util.addClass(l,"on")),n._drawListItem.call(this,0===r.length?o.items:o.items.filter((function(e){return e.tag.some((function(e){return r.indexOf(e)>-1}))})),!1)},onClickFile:function(e){e.preventDefault(),e.stopPropagation();const t=this.context.fileBrowser,i=t.list;let n=e.target,o=null;if(n!==i){for(;i!==n.parentNode&&(o=n.getAttribute("data-command"),!o);)n=n.parentNode;o&&((t.selectorHandler||this.context[t.contextPlugin].selectorHandler)(n,n.parentNode.querySelector(".__se__img_name").textContent),this.plugins.fileBrowser.close.call(this))}}};return void 0===t&&(e.SUNEDITOR_MODULES||Object.defineProperty(e,"SUNEDITOR_MODULES",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_MODULES,"fileBrowser",{enumerable:!0,writable:!1,configurable:!1,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_MODULES a window with a document");return i(e)}:i(t)},913:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={name:"fileManager",_xmlHttp:null,_checkMediaComponent:function(e){return!/IMG/i.test(e)||!/FIGURE/i.test(e.parentElement.nodeName)||!/FIGURE/i.test(e.parentElement.parentElement.nodeName)},upload:function(e,t,i,n,o){this.showLoading();const l=this.plugins.fileManager,r=l._xmlHttp=this.util.getXMLHttpRequest();if(r.onreadystatechange=l._callBackUpload.bind(this,r,n,o),r.open("post",e,!0),null!==t&&"object"==typeof t&&this._w.Object.keys(t).length>0)for(let e in t)r.setRequestHeader(e,t[e]);r.send(i)},_callBackUpload:function(e,t,i){if(4===e.readyState)if(200===e.status)try{t(e)}catch(e){throw Error('[SUNEDITOR.fileManager.upload.callBack.fail] cause : "'+e.message+'"')}finally{this.closeLoading()}else{this.closeLoading();const t=e.responseText?JSON.parse(e.responseText):e;if("function"!=typeof i||i("",t,this)){const i="[SUNEDITOR.fileManager.upload.serverException] status: "+e.status+", response: "+(t.errorMessage||e.responseText);throw this.functions.noticeOpen(i),Error(i)}}},checkInfo:function(e,t,i,n,o){let l=[];for(let e=0,i=t.length;e0;){const t=l.shift();this.util.getParentElement(t,this.util.isMediaComponent)&&r._checkMediaComponent(t)?!t.getAttribute("data-index")||h.indexOf(1*t.getAttribute("data-index"))<0?(d.push(s._infoIndex),t.removeAttribute("data-index"),c(e,t,i,null,o)):d.push(1*t.getAttribute("data-index")):(d.push(s._infoIndex),n(t))}for(let e,t=0;t-1||(a.splice(t,1),"function"==typeof i&&i(null,e,"delete",null,0,this),t--);o&&(this.context.resizing._resize_plugin=u)},setInfo:function(e,t,i,n,o){const l=o?this.context.resizing._resize_plugin:"";o&&(this.context.resizing._resize_plugin=e);const r=this.plugins[e],s=this.context[e],a=s._infoList;let c=t.getAttribute("data-index"),u=null,d="";if(n||(n={name:t.getAttribute("data-file-name")||("string"==typeof t.src?t.src.split("/").pop():""),size:t.getAttribute("data-file-size")||0}),!c||this._componentsInfoInit)d="create",c=s._infoIndex++,t.setAttribute("data-index",c),t.setAttribute("data-file-name",n.name),t.setAttribute("data-file-size",n.size),u={src:t.src,index:1*c,name:n.name,size:n.size},a.push(u);else{d="update",c*=1;for(let e=0,t=a.length;e=0){const n=this.context[e]._infoList;for(let e=0,o=n.length;e
",n},_module_getSizeX:function(e,t,i,n){return t||(t=e._element),i||(i=e._cover),n||(n=e._container),t?/%$/.test(t.style.width)?(n&&this.util.getNumber(n.style.width,2)||100)+"%":t.style.width:""},_module_getSizeY:function(e,t,i,n){return t||(t=e._element),i||(i=e._cover),n||(n=e._container),n&&i?this.util.getNumber(i.style.paddingBottom,0)>0&&!this.context.resizing._rotateVertical?i.style.height:/%$/.test(t.style.height)&&/%$/.test(t.style.width)?(n&&this.util.getNumber(n.style.height,2)||100)+"%":t.style.height:t&&t.style.height||""},_module_setModifyInputSize:function(e,t){const i=e._onlyPercentage&&this.context.resizing._rotateVertical;e.proportion.checked=e._proportionChecked="false"!==e._element.getAttribute("data-proportion");let n=i?"":this.plugins.resizing._module_getSizeX.call(this,e);if(n===e._defaultSizeX&&(n=""),e._onlyPercentage&&(n=this.util.getNumber(n,2)),e.inputX.value=n,t.setInputSize.call(this,"x"),!e._onlyPercentage){let t=i?"":this.plugins.resizing._module_getSizeY.call(this,e);t===e._defaultSizeY&&(t=""),e._onlyPercentage&&(t=this.util.getNumber(t,2)),e.inputY.value=t}e.inputX.disabled=!!i,e.inputY.disabled=!!i,e.proportion.disabled=!!i,t.setRatio.call(this)},_module_setInputSize:function(e,t){if(e._onlyPercentage)"x"===t&&e.inputX.value>100&&(e.inputX.value=100);else if(e.proportion.checked&&e._ratio&&/\d/.test(e.inputX.value)&&/\d/.test(e.inputY.value)){const i=e.inputX.value.replace(/\d+|\./g,"")||e.sizeUnit,n=e.inputY.value.replace(/\d+|\./g,"")||e.sizeUnit;if(i!==n)return;const o="%"===i?2:0;"x"===t?e.inputY.value=this.util.getNumber(e._ratioY*this.util.getNumber(e.inputX.value,o),o)+n:e.inputX.value=this.util.getNumber(e._ratioX*this.util.getNumber(e.inputY.value,o),o)+i}},_module_setRatio:function(e){const t=e.inputX.value,i=e.inputY.value;if(e.proportion.checked&&/\d+/.test(t)&&/\d+/.test(i)){if((t.replace(/\d+|\./g,"")||e.sizeUnit)!==(i.replace(/\d+|\./g,"")||e.sizeUnit))e._ratio=!1;else if(!e._ratio){const n=this.util.getNumber(t,0),o=this.util.getNumber(i,0);e._ratio=!0,e._ratioX=n/o,e._ratioY=o/n}}else e._ratio=!1},_module_sizeRevert:function(e){e._onlyPercentage?e.inputX.value=e._origin_w>100?100:e._origin_w:(e.inputX.value=e._origin_w,e.inputY.value=e._origin_h)},_module_saveCurrentSize:function(e){const t=this.plugins.resizing._module_getSizeX.call(this,e),i=this.plugins.resizing._module_getSizeY.call(this,e);e._element.setAttribute("data-size",t+","+i),e._videoRatio&&(e._videoRatio=i)},call_controller_resize:function(e,t){const i=this.context.resizing,n=this.context[t];i._resize_plugin=t;const o=i.resizeContainer,l=i.resizeDiv,r=this.util.getOffset(e,this.context.element.wysiwygFrame),s=i._rotateVertical=/^(90|270)$/.test(Math.abs(e.getAttribute("data-rotate")).toString()),a=s?e.offsetHeight:e.offsetWidth,c=s?e.offsetWidth:e.offsetHeight,u=r.top,d=r.left-this.context.element.wysiwygFrame.scrollLeft;o.style.top=u+"px",o.style.left=d+"px",o.style.width=a+"px",o.style.height=c+"px",l.style.top="0px",l.style.left="0px",l.style.width=a+"px",l.style.height=c+"px";let h=e.getAttribute("data-align")||"basic";h="none"===h?"basic":h;const p=this.util.getParentElement(e,this.util.isComponent),f=this.util.getParentElement(e,"FIGURE"),g=this.plugins.resizing._module_getSizeX.call(this,n,e,f,p)||"auto",m=n._onlyPercentage&&"image"===t?"":", "+(this.plugins.resizing._module_getSizeY.call(this,n,e,f,p)||"auto");this.util.changeTxt(i.resizeDisplay,this.lang.dialogBox[h]+" ("+g+m+")"),i.resizeButtonGroup.style.display=n._resizing?"":"none";const v=!n._resizing||n._resizeDotHide||n._onlyPercentage?"none":"flex",b=i.resizeHandles;for(let e=0,t=b.length;e=360?0:u;r.setAttribute("data-rotate",d),c._rotateVertical=/^(90|270)$/.test(this._w.Math.abs(d).toString()),this.plugins.resizing.setTransformSize.call(this,r,null,null),this.selectComponent(r,o);break;case"onalign":return void this.plugins.resizing.openAlignMenu.call(this);case"align":const h="basic"===n?"none":n;s.setAlign.call(this,h,null,null,null),this.selectComponent(r,o);break;case"caption":const p=!l._captionChecked;if(s.openModify.call(this,!0),l._captionChecked=l.captionCheckEl.checked=p,s.update_image.call(this,!1,!1,!1),p){const e=this.util.getChildElement(l._caption,(function(e){return 3===e.nodeType}));e?this.setRange(e,0,e,e.textContent.length):l._caption.focus(),this.controllersOff()}else this.selectComponent(r,o),s.openModify.call(this,!0);break;case"revert":s.setOriginSize.call(this),this.selectComponent(r,o);break;case"update":s.openModify.call(this),this.controllersOff();break;case"delete":s.destroy.call(this)}this.history.push(!1)}},resetTransform:function(e){const t=(e.getAttribute("data-size")||e.getAttribute("data-origin")||"").split(",");this.context.resizing._rotateVertical=!1,e.style.maxWidth="",e.style.transform="",e.style.transformOrigin="",e.setAttribute("data-rotate",""),e.setAttribute("data-rotateX",""),e.setAttribute("data-rotateY",""),this.plugins[this.context.resizing._resize_plugin].setSize.call(this,t[0]?t[0]:"auto",t[1]?t[1]:"",!0)},setTransformSize:function(e,t,i){let n=e.getAttribute("data-percentage");const o=this.context.resizing._rotateVertical,l=1*e.getAttribute("data-rotate");let r="";if(n&&!o)n=n.split(","),"auto"===n[0]&&"auto"===n[1]?this.plugins[this.context.resizing._resize_plugin].setAutoSize.call(this):this.plugins[this.context.resizing._resize_plugin].setPercentSize.call(this,n[0],n[1]);else{const n=this.util.getParentElement(e,"FIGURE"),s=t||e.offsetWidth,a=i||e.offsetHeight,c=(o?a:s)+"px",u=(o?s:a)+"px";this.plugins[this.context.resizing._resize_plugin].cancelPercentAttr.call(this),this.plugins[this.context.resizing._resize_plugin].setSize.call(this,s+"px",a+"px",!0),n.style.width=c,n.style.height=this.context[this.context.resizing._resize_plugin]._caption?"":u,o&&(r=90===l||-270===l?a/2+"px "+a/2+"px 0":s/2+"px "+s/2+"px 0")}e.style.transformOrigin=r,this.plugins.resizing._setTransForm(e,l.toString(),e.getAttribute("data-rotateX")||"",e.getAttribute("data-rotateY")||""),e.style.maxWidth=o?"none":"",this.plugins.resizing.setCaptionPosition.call(this,e)},_setTransForm:function(e,t,i,n){let o=(e.offsetWidth-e.offsetHeight)*(/-/.test(t)?1:-1),l="";if(/[1-9]/.test(t)&&(i||n))switch(l=i?"Y":"X",t){case"90":l=i&&n?"X":n?l:"";break;case"270":o*=-1,l=i&&n?"Y":i?l:"";break;case"-90":l=i&&n?"Y":i?l:"";break;case"-270":o*=-1,l=i&&n?"X":n?l:"";break;default:l=""}t%180==0&&(e.style.maxWidth=""),e.style.transform="rotate("+t+"deg)"+(i?" rotateX("+i+"deg)":"")+(n?" rotateY("+n+"deg)":"")+(l?" translate"+l+"("+o+"px)":"")},setCaptionPosition:function(e){const t=this.util.getChildElement(this.util.getParentElement(e,"FIGURE"),"FIGCAPTION");t&&(t.style.marginTop=(this.context.resizing._rotateVertical?e.offsetWidth-e.offsetHeight:0)+"px")},onMouseDown_resize_handle:function(e){e.stopPropagation(),e.preventDefault();const t=this.context.resizing,i=t._resize_direction=e.target.classList[0];t._resizeClientX=e.clientX,t._resizeClientY=e.clientY,this.context.element.resizeBackground.style.display="block",t.resizeButton.style.display="none",t.resizeDiv.style.float=/l/.test(i)?"right":/r/.test(i)?"left":"none";const n=function(e){if("keydown"===e.type&&27!==e.keyCode)return;const l=t._isChange;t._isChange=!1,this.removeDocEvent("mousemove",o),this.removeDocEvent("mouseup",n),this.removeDocEvent("keydown",n),"keydown"===e.type?(this.controllersOff(),this.context.element.resizeBackground.style.display="none",this.plugins[this.context.resizing._resize_plugin].init.call(this)):(this.plugins.resizing.cancel_controller_resize.call(this,i),l&&this.history.push(!1))}.bind(this),o=this.plugins.resizing.resizing_element.bind(this,t,i,this.context[t._resize_plugin]);this.addDocEvent("mousemove",o),this.addDocEvent("mouseup",n),this.addDocEvent("keydown",n)},resizing_element:function(e,t,i,n){const o=n.clientX,l=n.clientY;let r=i._element_w,s=i._element_h;const a=i._element_w+(/r/.test(t)?o-e._resizeClientX:e._resizeClientX-o),c=i._element_h+(/b/.test(t)?l-e._resizeClientY:e._resizeClientY-l),u=i._element_h/i._element_w*a;/t/.test(t)&&(e.resizeDiv.style.top=i._element_h-(/h/.test(t)?c:u)+"px"),/l/.test(t)&&(e.resizeDiv.style.left=i._element_w-a+"px"),/r|l/.test(t)&&(e.resizeDiv.style.width=a+"px",r=a),/^(t|b)[^h]$/.test(t)?(e.resizeDiv.style.height=u+"px",s=u):/^(t|b)h$/.test(t)&&(e.resizeDiv.style.height=c+"px",s=c),e._resize_w=r,e._resize_h=s,this.util.changeTxt(e.resizeDisplay,this._w.Math.round(r)+" x "+this._w.Math.round(s)),e._isChange=!0},cancel_controller_resize:function(e){const t=this.context.resizing._rotateVertical;this.controllersOff(),this.context.element.resizeBackground.style.display="none";let i=this._w.Math.round(t?this.context.resizing._resize_h:this.context.resizing._resize_w),n=this._w.Math.round(t?this.context.resizing._resize_w:this.context.resizing._resize_h);if(!t&&!/%$/.test(i)){const e=16,t=this.context.element.wysiwygFrame.clientWidth-2*e-2;this.util.getNumber(i,0)>t&&(n=this._w.Math.round(n/i*t),i=t)}const o=this.context.resizing._resize_plugin;this.plugins[o].setSize.call(this,i,n,!1,e),t&&this.plugins.resizing.setTransformSize.call(this,this.context[this.context.resizing._resize_plugin]._element,i,n),this.selectComponent(this.context[o]._element,o)}};return void 0===t&&(e.SUNEDITOR_MODULES||Object.defineProperty(e,"SUNEDITOR_MODULES",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_MODULES,"resizing",{enumerable:!0,writable:!1,configurable:!1,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_MODULES a window with a document");return i(e)}:i(t)}},t={};function i(n){var o=t[n];if(void 0!==o)return o.exports;var l=t[n]={exports:{}};return e[n].call(l.exports,l,l.exports,i),l.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e={documentSelector:".js-document",documentDisabledClass:"is-disabled",openingTriggerActiveClass:"is-active",delay:200},t=['[href]:not([tabindex^="-"])','input:not([disabled]):not([type="hidden"]):not([tabindex^="-"]):not([type="radio"])','input[type="radio"]:checked','select:not([disabled]):not([tabindex^="-"])','textarea:not([disabled]):not([tabindex^="-"])','button:not([disabled]):not([tabindex^="-"])','[tabindex]:not([tabindex^="-"])','[contenteditable="true"]:not([tabindex^="-"])'],n="Escape",o="Tab",l="F6";function r(e,t){let i=e;for(;i!==t&&i;)i=i.parentNode;return!!i}const s=Symbol("onClick"),a=Symbol("onKeydown"),c=Symbol("addEventDelegation"),u=Symbol("addEventListeners"),d=Symbol("removeEventListeners"),h=Symbol("addAttributes"),p=Symbol("removeAttributes"),f=Symbol("setAttributes"),g=Symbol("setFocusableElements"),m=Symbol("setFocus"),v=Symbol("restoreFocus"),b=Symbol("switchFocus"),y=Symbol("maintainFocus"),w=Symbol("addObserver"),_=Symbol("removeObserver");let x=e;const C=class{constructor(e,{onOpen:t=(()=>{}),onClose:i=(()=>{}),openingSelector:n,closingSelector:o,backdropSelector:l,helperSelector:r,labelledby:u,describedby:d,isModal:h=!0,isTooltip:p=!1,isOpen:f=!1,isCreated:m=!0,disableScroll:v=!0,enableAutoFocus:y=!0,openingTriggerActiveClass:w=x.openingTriggerActiveClass,delay:_=x.delay}={}){document.querySelector(e)?(this.config={dialogSelector:e,onOpen:t,onClose:i,openingSelector:n,closingSelector:o,backdropSelector:l,helperSelector:r,labelledby:u,describedby:d,isModal:h,isTooltip:p,isCreated:m,isOpen:f,disableScroll:v,enableAutoFocus:y,documentSelector:x.documentSelector,documentDisabledClass:x.documentDisabledClass,openingTriggerActiveClass:w,delay:_},this.dialog=document.querySelector(e),this.dialogArea=`${e}, ${n}`,this.openingTriggers=document.querySelectorAll(n),this.backdropTrigger=document.querySelector(l),this.helpers=document.querySelectorAll(r),this.document=document.querySelector(this.config.documentSelector)||document.querySelector("html"),this.documentIsAlreadyDisabled=!1,this.focusableElements=[],this.firstFocusableElement=null,this.lastFocusableElement=null,this.openingTrigger=null,this.closingTrigger=null,this.isCreated=!1,this.isOpen=!1,this.close=this.close.bind(this),this.toggle=this.toggle.bind(this),this[s]=this[s].bind(this),this[a]=this[a].bind(this),this[c]=this[c].bind(this),this[b]=this[b].bind(this),this.observer=new MutationObserver((e=>e.forEach((()=>this[g]())))),this.isInitialized=!0,m&&this.create()):this.isInitialized=!1}[s](e){this.config.isTooltip&&!e.target.closest(this.dialogArea)&&this.close(e),e.target===this.backdropTrigger&&this.close(e)}[a](e){switch(e.key){case n:e.stopPropagation(),this.close(e);break;case l:this.config.isModal||(this.config.isTooltip?this.close(e):this[v]());break;case o:this[y](e)}}[c](e){document.querySelectorAll(this.config.openingSelector).forEach((t=>{r(e.target,t)&&(this.openingTrigger=t,this.toggle(e))})),document.querySelectorAll(this.config.closingSelector).forEach((t=>{r(e.target,t)&&(this.closingTrigger=t,this.close())}))}[u](){document.addEventListener("click",this[s],{capture:!0}),this.dialog.addEventListener("keydown",this[a])}[d](){document.removeEventListener("click",this[s],{capture:!0}),this.dialog.removeEventListener("keydown",this[a]),this.openingTrigger&&this.openingTrigger.removeEventListener("keydown",this[b])}[h](){this.dialog.setAttribute("role","dialog"),this.dialog.setAttribute("tabindex",-1),this.dialog.setAttribute("aria-hidden",!0),this.config.labelledby&&this.dialog.setAttribute("aria-labelledby",this.config.labelledby),this.config.describedby&&this.dialog.setAttribute("aria-describedby",this.config.describedby),this.config.isModal&&this.dialog.setAttribute("aria-modal",!0),this.openingTriggers.forEach((e=>e.setAttribute("aria-haspopup","dialog")))}[p](){this.dialog.removeAttribute("role"),this.dialog.removeAttribute("tabindex"),this.dialog.removeAttribute("aria-hidden"),this.dialog.removeAttribute("aria-labelledby"),this.dialog.removeAttribute("aria-describedby"),this.dialog.removeAttribute("aria-modal"),this.config.disableScroll&&this.isOpen&&!this.documentIsAlreadyDisabled&&this.document.classList.remove(this.config.documentDisabledClass),this.openingTriggers.forEach((e=>e.removeAttribute("aria-haspopup"))),this.openingTrigger&&this.openingTrigger.classList.remove(this.config.openingTriggerActiveClass),this.helpers.forEach((e=>e.classList.remove(this.config.openingTriggerActiveClass)))}[f](){this.dialog.setAttribute("aria-hidden",!this.isOpen),this.config.disableScroll&&!this.documentIsAlreadyDisabled&&(this.isOpen?this.document.classList.add(this.config.documentDisabledClass):this.document.classList.remove(this.config.documentDisabledClass)),this.openingTrigger&&(this.isOpen?this.openingTrigger.classList.add(this.config.openingTriggerActiveClass):this.openingTrigger.classList.remove(this.config.openingTriggerActiveClass)),this.helpers.forEach((e=>{this.isOpen?e.classList.add(this.config.openingTriggerActiveClass):e.classList.remove(this.config.openingTriggerActiveClass)}))}[g](){const e=function(e){const t=[];return e.forEach((e=>{const i=e.getBoundingClientRect();(i.width>0||i.height>0)&&t.push(e)})),t}(this.dialog.querySelectorAll(t)),i=function(e,t,i){const n=e.querySelectorAll(t),o=[];let l=!1;return 0===n.length?i:(i.forEach((e=>{n.forEach((t=>{t.contains(e)&&(l=!0)})),l||o.push(e),l=!1})),o)}(this.dialog,'[role="dialog"]',e);this.focusableElements=i.length>0?i:[this.dialog],[this.firstFocusableElement]=this.focusableElements,this.lastFocusableElement=this.focusableElements[this.focusableElements.length-1]}[m](){this.config.enableAutoFocus&&window.setTimeout((()=>this.firstFocusableElement.focus()),this.config.delay)}[v](){this.config.enableAutoFocus&&window.setTimeout((()=>this.openingTrigger.focus()),this.config.delay),this.isOpen&&this.openingTrigger.addEventListener("keydown",this[b])}[b](e){e.key===l&&(this.openingTrigger.removeEventListener("keydown",this[b]),this[m]())}[y](e){e.shiftKey&&e.target===this.firstFocusableElement&&(e.preventDefault(),this.lastFocusableElement.focus()),e.shiftKey||e.target!==this.lastFocusableElement||(e.preventDefault(),this.firstFocusableElement.focus())}[w](){this.observer.observe(this.dialog,{childList:!0,attributes:!0,subtree:!0})}[_](){this.observer.disconnect()}open(){this.isInitialized&&this.isCreated&&!this.isOpen&&(this.isOpen=!0,this.documentIsAlreadyDisabled=this.document.classList.contains(this.config.documentDisabledClass),this[f](),this[u](),this[m](),this.config.onOpen(this.dialog,this.openingTrigger))}close(e){this.isInitialized&&this.isCreated&&this.isOpen&&(this.isOpen=!1,e&&e.preventDefault(),this[f](),this[d](),this.openingTrigger&&(!this.config.isTooltip||this.config.isTooltip&&e&&"click"!==e.type)&&this[v](),this.config.onClose(this.dialog,this.closingTrigger))}toggle(e){this.isInitialized&&this.isCreated&&(e&&e.preventDefault(),this.isOpen?this.close():this.open())}create(){this.isInitialized&&!this.isCreated&&(this.isCreated=!0,this[h](),this[g](),this[w](),this.config.isOpen&&this.open(),document.addEventListener("click",this[c],{capture:!0}))}destroy(){this.isInitialized&&this.isCreated&&(this.close(),this.isCreated=!1,this[p](),this[d](),this[_](),document.removeEventListener("click",this[c],{capture:!0}))}};var k=Object.prototype.toString,S=Array.isArray||function(e){return"[object Array]"===k.call(e)};function L(e){return"function"==typeof e}function E(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function T(e,t){return null!=e&&"object"==typeof e&&t in e}var N=RegExp.prototype.test;var z=/\S/;function A(e){return!function(e,t){return N.call(e,t)}(z,e)}var M={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};var B=/\s*/,R=/\s+/,I=/\s*=/,O=/\s*\}/,H=/#|\^|\/|>|\{|&|=|!/;function D(e){this.string=e,this.tail=e,this.pos=0}function F(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function P(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}D.prototype.eos=function(){return""===this.tail},D.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var i=t[0];return this.tail=this.tail.substring(i.length),this.pos+=i.length,i},D.prototype.scanUntil=function(e){var t,i=this.tail.search(e);switch(i){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,i),this.tail=this.tail.substring(i)}return this.pos+=t.length,t},F.prototype.push=function(e){return new F(e,this)},F.prototype.lookup=function(e){var t,i,n,o=this.cache;if(o.hasOwnProperty(e))t=o[e];else{for(var l,r,s,a=this,c=!1;a;){if(e.indexOf(".")>0)for(l=a.view,r=e.split("."),s=0;null!=l&&s0?o[o.length-1][4]:i;break;default:n.push(t)}return i}(function(e){for(var t,i,n=[],o=0,l=e.length;o"===r?s=this.renderPartial(l,t,i,o):"&"===r?s=this.unescapedValue(l,t):"name"===r?s=this.escapedValue(l,t,o):"text"===r&&(s=this.rawValue(l)),void 0!==s&&(a+=s);return a},P.prototype.renderSection=function(e,t,i,n,o){var l=this,r="",s=t.lookup(e[1]);if(s){if(S(s))for(var a=0,c=s.length;a0||!i)&&(o[l]=n+o[l]);return o.join("\n")},P.prototype.renderPartial=function(e,t,i,n){if(i){var o=this.getConfigTags(n),l=L(i)?i(e[1]):i[e[1]];if(null!=l){var r=e[6],s=e[5],a=e[4],c=l;0==s&&a&&(c=this.indentPartial(l,a,r));var u=this.parse(c,o);return this.renderTokens(u,t,i,c,n)}}},P.prototype.unescapedValue=function(e,t){var i=t.lookup(e[1]);if(null!=i)return i},P.prototype.escapedValue=function(e,t,i){var n=this.getConfigEscape(i)||V.escape,o=t.lookup(e[1]);if(null!=o)return"number"==typeof o&&n===V.escape?String(o):n(o)},P.prototype.rawValue=function(e){return e[1]},P.prototype.getConfigTags=function(e){return S(e)?e:e&&"object"==typeof e?e.tags:void 0},P.prototype.getConfigEscape=function(e){return e&&"object"==typeof e&&!S(e)?e.escape:void 0};var V={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){U.templateCache=e},get templateCache(){return U.templateCache}},U=new P;V.clearCache=function(){return U.clearCache()},V.parse=function(e,t){return U.parse(e,t)},V.render=function(e,t,i,n){if("string"!=typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+((S(o=e)?"array":typeof o)+'" was given as the first argument for mustache#render(template, view, partials)'));var o;return U.render(e,t,i,n)},V.escape=function(e){return String(e).replace(/[&<>"'`=\/]/g,(function(e){return M[e]}))},V.Scanner=D,V.Context=F,V.Writer=P;const W=V,j={rtl:{italic:'',indent:'',outdent:'',list_bullets:'',list_number:'',link:'',unlink:''},redo:'',undo:'',bold:'',underline:'',italic:'',strike:'',subscript:'',superscript:'',erase:'',indent:'',outdent:'',expansion:'',reduction:'',code_view:'',preview:'',print:'',template:'',line_height:'',paragraph_style:'',text_style:'',save:'',blockquote:'',arrow_down:'',align_justify:'',align_left:'',align_right:'',align_center:'',font_color:'',highlight_color:'',list_bullets:'',list_number:'',table:'',horizontal_rule:'',show_blocks:'',cancel:'',image:'',video:'',link:'',math:'',unlink:'',table_header:'',merge_cell:'',split_cell:'',caption:'',edit:'',delete:'',modify:'',revert:'',auto_size:'',insert_row_below:'',insert_row_above:'',insert_column_left:'',insert_column_right:'',delete_row:'',delete_column:'',fixed_column_width:'',rotate_left:'',rotate_right:'',mirror_horizontal:'',mirror_vertical:'',checked:'',line_break:'',audio:'',image_gallery:'',bookmark:'',download:'',dir_ltr:'',dir_rtl:'',alert_outline:'',more_text:'',more_paragraph:'',more_plus:'',more_horizontal:'',more_vertical:'',attachment:'',map:'',magic_stick:'',empty_file:''};var q=i(791),Z=i.n(q);const G={_d:null,_w:null,isIE:null,isIE_Edge:null,isOSX_IOS:null,isChromium:null,isResizeObserverSupported:null,_propertiesInit:function(){this._d||(this._d=document,this._w=window,this.isIE=navigator.userAgent.indexOf("Trident")>-1,this.isIE_Edge=navigator.userAgent.indexOf("Trident")>-1||navigator.appVersion.indexOf("Edge")>-1,this.isOSX_IOS=/(Mac|iPhone|iPod|iPad)/.test(navigator.platform),this.isChromium=!!window.chrome,this.isResizeObserverSupported="function"==typeof ResizeObserver)},_allowedEmptyNodeList:".se-component, pre, blockquote, hr, li, table, img, iframe, video, audio, canvas",_HTMLConvertor:function(e){const t={"&":"&"," ":" ","'":"'",'"':""","<":"<",">":">"};return e.replace(/&|\u00A0|'|"|<|>/g,(function(e){return"string"==typeof t[e]?t[e]:e}))},zeroWidthSpace:String.fromCharCode(8203),zeroWidthRegExp:new RegExp(String.fromCharCode(8203),"g"),onlyZeroWidthRegExp:new RegExp("^"+String.fromCharCode(8203)+"+$"),fontValueMap:{"xx-small":1,"x-small":2,small:3,medium:4,large:5,"x-large":6,"xx-large":7},onlyZeroWidthSpace:function(e){return null!=e&&("string"!=typeof e&&(e=e.textContent),""===e||this.onlyZeroWidthRegExp.test(e))},getXMLHttpRequest:function(){if(!this._w.ActiveXObject)return this._w.XMLHttpRequest?new XMLHttpRequest:null;try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){return null}}},getValues:function(e){return e?this._w.Object.keys(e).map((function(t){return e[t]})):[]},camelToKebabCase:function(e){return"string"==typeof e?e.replace(/[A-Z]/g,(function(e){return"-"+e.toLowerCase()})):e.map((function(e){return G.camelToKebabCase(e)}))},kebabToCamelCase:function(e){return"string"==typeof e?e.replace(/-[a-zA-Z]/g,(function(e){return e.replace("-","").toUpperCase()})):e.map((function(e){return G.camelToKebabCase(e)}))},createElement:function(e){return this._d.createElement(e)},createTextNode:function(e){return this._d.createTextNode(e||"")},HTMLEncoder:function(e){const t={"<":"$lt;",">":"$gt;"};return e.replace(/<|>/g,(function(e){return"string"==typeof t[e]?t[e]:e}))},HTMLDecoder:function(e){const t={"$lt;":"<","$gt;":">"};return e.replace(/\$lt;|\$gt;/g,(function(e){return"string"==typeof t[e]?t[e]:e}))},hasOwn:function(e,t){return this._hasOwn.call(e,t)},_hasOwn:Object.prototype.hasOwnProperty,getIncludePath:function(e,t){let i="";const n=[],o="js"===t?"script":"link",l="js"===t?"src":"href";let r="(?:";for(let t=0,i=e.length;t0?n[0][l]:""),-1===i.indexOf(":/")&&"//"!==i.slice(0,2)&&(i=0===i.indexOf("/")?location.href.match(/^.*?:\/\/[^\/]*/)[0]+i:location.href.match(/^[^\?]*\/(?:)/)[0]+i),!i)throw"[SUNEDITOR.util.getIncludePath.fail] The SUNEDITOR installation path could not be automatically detected. (name: +"+name+", extension: "+t+")";return i},getPageStyle:function(e){let t="";const i=(e||this._d).styleSheets;for(let e,n=0,o=i.length;n-1||(n+=i[e].name+'="'+i[e].value+'" ');return n},getByteLength:function(e){if(!e||!e.toString)return 0;e=e.toString();const t=this._w.encodeURIComponent;let i,n;return this.isIE_Edge?(n=this._w.unescape(t(e)).length,i=0,null!==t(e).match(/(%0A|%0D)/gi)&&(i=t(e).match(/(%0A|%0D)/gi).length),n+i):(n=new this._w.TextEncoder("utf-8").encode(e).length,i=0,null!==t(e).match(/(%0A|%0D)/gi)&&(i=t(e).match(/(%0A|%0D)/gi).length),n+i)},isWysiwygDiv:function(e){return e&&1===e.nodeType&&(this.hasClass(e,"se-wrapper-wysiwyg")||/^BODY$/i.test(e.nodeName))},isNonEditable:function(e){return e&&1===e.nodeType&&"false"===e.getAttribute("contenteditable")},isTextStyleElement:function(e){return e&&3!==e.nodeType&&/^(strong|span|font|b|var|i|em|u|ins|s|strike|del|sub|sup|mark|a|label|code|summary)$/i.test(e.nodeName)},isInputElement:function(e){return e&&1===e.nodeType&&/^(INPUT|TEXTAREA)$/i.test(e.nodeName)},isFormatElement:function(e){return e&&1===e.nodeType&&(/^(P|DIV|H[1-6]|PRE|LI|TH|TD|DETAILS)$/i.test(e.nodeName)||this.hasClass(e,"(\\s|^)__se__format__replace_.+(\\s|$)|(\\s|^)__se__format__free_.+(\\s|$)"))&&!this.isComponent(e)&&!this.isWysiwygDiv(e)},isRangeFormatElement:function(e){return e&&1===e.nodeType&&(/^(BLOCKQUOTE|OL|UL|FIGCAPTION|TABLE|THEAD|TBODY|TR|TH|TD|DETAILS)$/i.test(e.nodeName)||this.hasClass(e,"(\\s|^)__se__format__range_.+(\\s|$)"))},isClosureRangeFormatElement:function(e){return e&&1===e.nodeType&&(/^(TH|TD)$/i.test(e.nodeName)||this.hasClass(e,"(\\s|^)__se__format__range__closure_.+(\\s|$)"))},isFreeFormatElement:function(e){return e&&1===e.nodeType&&(/^PRE$/i.test(e.nodeName)||this.hasClass(e,"(\\s|^)__se__format__free_.+(\\s|$)"))&&!this.isComponent(e)&&!this.isWysiwygDiv(e)},isClosureFreeFormatElement:function(e){return e&&1===e.nodeType&&this.hasClass(e,"(\\s|^)__se__format__free__closure_.+(\\s|$)")},isComponent:function(e){return e&&(/se-component/.test(e.className)||/^(TABLE|HR)$/.test(e.nodeName))},isUneditableComponent:function(e){return e&&this.hasClass(e,"__se__uneditable")},isMediaComponent:function(e){return e&&/se-component/.test(e.className)},isNotCheckingNode:function(e){return e&&/katex|__se__tag/.test(e.className)},getFormatElement:function(e,t){if(!e)return null;for(t||(t=function(){return!0});e;){if(this.isWysiwygDiv(e))return null;if(this.isRangeFormatElement(e)&&e.firstElementChild,this.isFormatElement(e)&&t(e))return e;e=e.parentNode}return null},getRangeFormatElement:function(e,t){if(!e)return null;for(t||(t=function(){return!0});e;){if(this.isWysiwygDiv(e))return null;if(this.isRangeFormatElement(e)&&!/^(THEAD|TBODY|TR)$/i.test(e.nodeName)&&t(e))return e;e=e.parentNode}return null},getFreeFormatElement:function(e,t){if(!e)return null;for(t||(t=function(){return!0});e;){if(this.isWysiwygDiv(e))return null;if(this.isFreeFormatElement(e)&&t(e))return e;e=e.parentNode}return null},getClosureFreeFormatElement:function(e,t){if(!e)return null;for(t||(t=function(){return!0});e;){if(this.isWysiwygDiv(e))return null;if(this.isClosureFreeFormatElement(e)&&t(e))return e;e=e.parentNode}return null},copyTagAttributes:function(e,t,i){if(t.style.cssText){const i=t.style;for(let t=0,n=i.length;t-1||!n[o].value?e.removeAttribute(t):"style"!==t&&e.setAttribute(n[o].name,n[o].value)},copyFormatAttributes:function(e,t){(t=t.cloneNode(!1)).className=t.className.replace(/(\s|^)__se__format__[^\s]+/g,""),this.copyTagAttributes(e,t)},getArrayItem:function(e,t,i){if(!e||0===e.length)return null;t=t||function(){return!0};const n=[];for(let o,l=0,r=e.length;lr?1:l0&&!this.isBreak(e);)e=e.firstChild;for(;t&&1===t.nodeType&&t.childNodes.length>0&&!this.isBreak(t);)t=t.lastChild;return{sc:e,ec:t||e}}},getOffset:function(e,t){let i=0,n=0,o=3===e.nodeType?e.parentElement:e;const l=this.getParentElement(e,this.isWysiwygDiv.bind(this));for(;o&&!this.hasClass(o,"se-container")&&o!==l;)i+=o.offsetLeft,n+=o.offsetTop,o=o.offsetParent;const r=t&&/iframe/i.test(t.nodeName);return{left:i+(r?t.parentElement.offsetLeft:0),top:n-(l?l.scrollTop:0)+(r?t.parentElement.offsetTop:0)}},getOverlapRangeAtIndex:function(e,t,i,n){if(e<=n?ti)return 0;const o=(e>i?e:i)-(t0?" ":"")+t)},removeClass:function(e,t){if(!e)return;const i=new this._w.RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(i," ").trim(),e.className.trim()||e.removeAttribute("class")},toggleClass:function(e,t){if(!e)return;let i=!1;const n=new this._w.RegExp("(\\s|^)"+t+"(\\s|$)");return n.test(e.className)?e.className=e.className.replace(n," ").trim():(e.className+=" "+t,i=!0),e.className.trim()||e.removeAttribute("class"),i},isImportantDisabled:function(e){return e.hasAttribute("data-important-disabled")},setDisabledButtons:function(e,t,i){for(let n=0,o=t.length;nn))continue;l.appendChild(i[e])}e--,t--,n--}return o.childNodes.length>0&&e.parentNode.insertBefore(o,e),l.childNodes.length>0&&e.parentNode.insertBefore(l,e.nextElementSibling),e}const n=e.parentNode;let o,l,r,s=0,a=1,c=!0;if((!i||i<0)&&(i=0),3===e.nodeType){if(s=this.getPositionIndex(e),t>=0&&e.length!==t){e.splitText(t);const i=this.getNodeFromPath([s+1],n);this.onlyZeroWidthSpace(i)&&(i.data=this.zeroWidthSpace)}}else if(1===e.nodeType){if(0===t){for(;e.firstChild;)e=e.firstChild;if(3===e.nodeType){const t=this.createTextNode(this.zeroWidthSpace);e.parentNode.insertBefore(t,e),e=t}}e.previousSibling?e=e.previousSibling:this.getElementDepth(e)===i&&(c=!1)}1===e.nodeType&&(a=0);let u=e;for(;this.getElementDepth(u)>i;)for(s=this.getPositionIndex(u)+a,u=u.parentNode,r=o,o=u.cloneNode(!1),l=u.childNodes,r&&(this.isListCell(o)&&this.isList(r)&&r.firstElementChild?(o.innerHTML=r.firstElementChild.innerHTML,G.removeItem(r.firstElementChild),r.children.length>0&&o.appendChild(r)):o.appendChild(r));l[s];)o.appendChild(l[s]);u.childNodes.length<=1&&(!u.firstChild||0===u.firstChild.textContent.length)&&(u.innerHTML="
");const d=u.parentNode;return c&&(u=u.nextSibling),o?(this.mergeSameTags(o,null,!1),this.mergeNestedTags(o,function(e){return this.isList(e)}.bind(this)),o.childNodes.length>0?d.insertBefore(o,u):o=u,this.isListCell(o)&&o.children&&this.isList(o.children[0])&&o.insertBefore(this.createElement("BR"),o.children[0]),0===n.childNodes.length&&this.removeItem(n),o):u},mergeSameTags:function(e,t,i){const n=this,o=t?t.length:0;let l=null;return o&&(l=this._w.Array.apply(null,new this._w.Array(o)).map(this._w.Number.prototype.valueOf,0)),function e(r,s,a){const c=r.childNodes;for(let u,d,h=0,p=c.length;h=0;){if(n.getArrayIndex(l.childNodes,i)!==e[a]){c=!1;break}i=u.parentNode,l=i.parentNode,a--}c&&(e.splice(s,1),e[s]=h)}}n.copyTagAttributes(u,r),r.parentNode.insertBefore(u,r),n.removeItem(r)}if(!d){1===u.nodeType&&e(u,s+1,h);break}if(u.nodeName===d.nodeName&&n.isSameAttributes(u,d)&&u.href===d.href){const e=u.childNodes;let i=0;for(let t=0,n=e.length;t0&&i++;const r=u.lastChild,c=d.firstChild;let p=0;if(r&&c){const e=3===r.nodeType&&3===c.nodeType;p=r.textContent.length;let n=r.previousSibling;for(;n&&3===n.nodeType;)p+=n.textContent.length,n=n.previousSibling;if(i>0&&3===r.nodeType&&3===c.nodeType&&(r.textContent.length>0||c.textContent.length>0)&&i--,o){let n=null;for(let u=0;uh){if(s>0&&n[s-1]!==a)continue;n[s]-=1,n[s+1]>=0&&n[s]===h&&(n[s+1]+=i,e&&r&&3===r.nodeType&&c&&3===c.nodeType&&(l[u]+=p))}}}if(3===u.nodeType){if(p=u.textContent.length,u.textContent+=d.textContent,o){let e=null;for(let n=0;nh){if(s>0&&e[s-1]!==a)continue;e[s]-=1,e[s+1]>=0&&e[s]===h&&(e[s+1]+=i,l[n]+=p)}}}else u.innerHTML+=d.innerHTML;n.removeItem(d),h--}else 1===u.nodeType&&e(u,s+1,h)}}(e,0,0),l},mergeNestedTags:function(e,t){"string"==typeof t?t=function(e){return this.test(e.tagName)}.bind(new this._w.RegExp("^("+(t||".+")+")$","i")):"function"!=typeof t&&(t=function(){return!0}),function e(i){let n=i.children;if(1===n.length&&n[0].nodeName===i.nodeName&&t(i)){const e=n[0];for(n=e.children;n[0];)i.appendChild(n[0]);i.removeChild(e)}for(let t=0,n=i.children.length;t")},htmlRemoveWhiteSpace:function(e){return e?e.trim().replace(/<\/?(?!strong|span|font|b|var|i|em|u|ins|s|strike|del|sub|sup|mark|a|label|code|summary)[^>^<]+>\s+(?=<)/gi,(function(e){return e.replace(/\n/g,"").replace(/\s+/," ")})):""},htmlCompress:function(e){return e.replace(/\n/g,"").replace(/(>)(?:\s+)(<)/g,"$1$2")},sortByDepth:function(e,t){const i=t?1:-1,n=-1*i;e.sort(function(e,t){return this.isListCell(e)&&this.isListCell(t)?(e=this.getElementDepth(e))>(t=this.getElementDepth(t))?i:e]*>","gi")},createTagsBlacklist:function(e){return new RegExp("<\\/?\\b(?:\\b"+(e||"^").replace(/\|/g,"\\b|\\b")+"\\b)[^>]*>","gi")},_consistencyCheckOfHTML:function(e,t,i,n){const o=[],l=[],r=[],s=[],a=this.getListChildNodes(e,function(a){if(1!==a.nodeType)return this.isList(a.parentElement)&&o.push(a),!1;if(i.test(a.nodeName)||!t.test(a.nodeName)&&0===a.childNodes.length&&this.isNotCheckingNode(a))return o.push(a),!1;const c=!this.getParentElement(a,this.isNotCheckingNode);if(!this.isTable(a)&&!this.isListCell(a)&&!this.isAnchor(a)&&(this.isFormatElement(a)||this.isRangeFormatElement(a)||this.isTextStyleElement(a))&&0===a.childNodes.length&&c)return l.push(a),!1;if(this.isList(a.parentNode)&&!this.isList(a)&&!this.isListCell(a))return r.push(a),!1;if(this.isCell(a)){const e=a.firstElementChild;if(!this.isFormatElement(e)&&!this.isRangeFormatElement(e)&&!this.isComponent(e))return s.push(a),!1}if(c&&a.className){const e=new this._w.Array(a.classList).map(n).join(" ").trim();e?a.className=e:a.removeAttribute("class")}return a.parentNode!==e&&c&&(this.isListCell(a)&&!this.isList(a.parentNode)||(this.isFormatElement(a)||this.isComponent(a))&&!this.isRangeFormatElement(a.parentNode)&&!this.getParentElement(a,this.isComponent))}.bind(this));for(let e=0,t=o.length;e=0;o--)t.insertBefore(e,i[o]);c.push(e)}else t.parentNode.insertBefore(e,t),c.push(t);for(let e,t=0,i=c.length;t":e.innerHTML,e.innerHTML=t.outerHTML},_setDefaultOptionStyle:function(e,t){let i="";e.height&&(i+="height:"+e.height+";"),e.minHeight&&(i+="min-height:"+e.minHeight+";"),e.maxHeight&&(i+="max-height:"+e.maxHeight+";"),e.position&&(i+="position:"+e.position+";"),e.width&&(i+="width:"+e.width+";"),e.minWidth&&(i+="min-width:"+e.minWidth+";"),e.maxWidth&&(i+="max-width:"+e.maxWidth+";");let n="",o="",l="";const r=(t=i+t).split(";");for(let t,i=0,s=r.length;i'+this._setIframeCssTags(t),e.contentDocument.body.className=t._editableClass,e.contentDocument.body.setAttribute("contenteditable",!0)},_setIframeCssTags:function(e){const t=e.iframeCSSFileName,i=this._w.RegExp;let n="";for(let e,o=0,l=t.length;o'}return n+("auto"===e.height?"":"")}},$=G,Y={init:function(e,t){"object"!=typeof t&&(t={});const i=document;this._initOptions(e,t);const n=i.createElement("DIV");n.className="sun-editor"+(t.rtl?" se-rtl":""),e.id&&(n.id="suneditor_"+e.id);const o=i.createElement("DIV");o.className="se-container";const l=this._createToolBar(i,t.buttonList,t.plugins,t),r=l.element.cloneNode(!1);r.className+=" se-toolbar-shadow",l.element.style.visibility="hidden",l.pluginCallButtons.math&&this._checkKatexMath(t.katex);const s=i.createElement("DIV");s.className="se-arrow";const a=i.createElement("DIV");a.className="se-toolbar-sticky-dummy";const c=i.createElement("DIV");c.className="se-wrapper";const u=this._initElements(t,n,l.element,s),d=u.bottomBar,h=u.wysiwygFrame,p=u.placeholder;let f=u.codeView;const g=d.resizingBar,m=d.navigation,v=d.charWrapper,b=d.charCounter,y=i.createElement("DIV");y.className="se-loading-box sun-editor-common",y.innerHTML='
';const w=i.createElement("DIV");w.className="se-line-breaker",w.innerHTML='";const _=i.createElement("DIV");_.className+="se-line-breaker-component";const x=_.cloneNode(!0);_.innerHTML=x.innerHTML=t.icons.line_break;const C=i.createElement("DIV");C.className="se-resizing-back";const k=t.toolbarContainer;k&&(k.appendChild(l.element),k.appendChild(r));const S=t.resizingBarContainer;return g&&S&&S.appendChild(g),c.appendChild(f),p&&c.appendChild(p),k||(o.appendChild(l.element),o.appendChild(r)),o.appendChild(a),o.appendChild(c),o.appendChild(C),o.appendChild(y),o.appendChild(w),o.appendChild(_),o.appendChild(x),g&&!S&&o.appendChild(g),n.appendChild(o),f=this._checkCodeMirror(t,f),{constructed:{_top:n,_relative:o,_toolBar:l.element,_toolbarShadow:r,_menuTray:l._menuTray,_editorArea:c,_wysiwygArea:h,_codeArea:f,_placeholder:p,_resizingBar:g,_navigation:m,_charWrapper:v,_charCounter:b,_loading:y,_lineBreaker:w,_lineBreaker_t:_,_lineBreaker_b:x,_resizeBack:C,_stickyDummy:a,_arrow:s},options:t,plugins:l.plugins,pluginCallButtons:l.pluginCallButtons,_responsiveButtons:l.responsiveButtons}},_checkCodeMirror:function(e,t){if(e.codeMirror){const i=[{mode:"htmlmixed",htmlMode:!0,lineNumbers:!0,lineWrapping:!0},e.codeMirror.options||{}].reduce((function(e,t){for(let i in t)$.hasOwn(t,i)&&(e[i]=t[i]);return e}),{});"auto"===e.height&&(i.viewportMargin=1/0,i.height="auto");const n=e.codeMirror.src.fromTextArea(t,i);n.display.wrapper.style.cssText=t.style.cssText,e.codeMirrorEditor=n,(t=n.display.wrapper).className+=" se-wrapper-code-mirror"}return t},_checkKatexMath:function(e){if(!e)throw Error('[SUNEDITOR.create.fail] To use the math button you need to add a "katex" object to the options.');const t=[{throwOnError:!1},e.options||{}].reduce((function(e,t){for(let i in t)$.hasOwn(t,i)&&(e[i]=t[i]);return e}),{});e.options=t},_setOptions:function(e,t,i){this._initOptions(t.element.originElement,e);const n=t.element,o=n.relative,l=n.editorArea,r=e.toolbarContainer&&e.toolbarContainer!==i.toolbarContainer,s=e.lang!==i.lang||e.buttonList!==i.buttonList||e.mode!==i.mode||r,a=this._createToolBar(document,s?e.buttonList:i.buttonList,e.plugins,e);a.pluginCallButtons.math&&this._checkKatexMath(e.katex);const c=document.createElement("DIV");c.className="se-arrow",s&&(a.element.style.visibility="hidden",r?(e.toolbarContainer.appendChild(a.element),n.toolbar.parentElement.removeChild(n.toolbar)):n.toolbar.parentElement.replaceChild(a.element,n.toolbar),n.toolbar=a.element,n._menuTray=a._menuTray,n._arrow=c);const u=this._initElements(e,n.topArea,s?a.element:n.toolbar,c),d=u.bottomBar,h=u.wysiwygFrame,p=u.placeholder;let f=u.codeView;return n.resizingBar&&$.removeItem(n.resizingBar),d.resizingBar&&(e.resizingBarContainer&&e.resizingBarContainer!==i.resizingBarContainer?e.resizingBarContainer.appendChild(d.resizingBar):o.appendChild(d.resizingBar)),l.innerHTML="",l.appendChild(f),p&&l.appendChild(p),f=this._checkCodeMirror(e,f),n.resizingBar=d.resizingBar,n.navigation=d.navigation,n.charWrapper=d.charWrapper,n.charCounter=d.charCounter,n.wysiwygFrame=h,n.code=f,n.placeholder=p,e.rtl?$.addClass(n.topArea,"se-rtl"):$.removeClass(n.topArea,"se-rtl"),{callButtons:a.pluginCallButtons,plugins:a.plugins,toolbar:a}},_initElements:function(e,t,i,n){t.style.cssText=e._editorStyles.top,/inline/i.test(e.mode)?(i.className+=" se-toolbar-inline",i.style.width=e.toolbarWidth):/balloon/i.test(e.mode)&&(i.className+=" se-toolbar-balloon",i.style.width=e.toolbarWidth,i.appendChild(n));const o=document.createElement(e.iframe?"IFRAME":"DIV");if(o.className="se-wrapper-inner se-wrapper-wysiwyg",e.iframe)o.allowFullscreen=!0,o.frameBorder=0,o.style.cssText=e._editorStyles.frame,o.className+=e.className;else{o.setAttribute("contenteditable",!0),o.setAttribute("scrolling","auto");for(let t in e.iframeAttributes)o.setAttribute(t,e.iframeAttributes[t]);o.className+=" "+e._editableClass,o.style.cssText=e._editorStyles.frame+e._editorStyles.editor,o.className+=e.className}const l=document.createElement("TEXTAREA");l.className="se-wrapper-inner se-wrapper-code"+e.className,l.style.cssText=e._editorStyles.frame,l.style.display="none","auto"===e.height&&(l.style.overflow="hidden");let r=null,s=null,a=null,c=null;if(e.resizingBar&&(r=document.createElement("DIV"),r.className="se-resizing-bar sun-editor-common",s=document.createElement("DIV"),s.className="se-navigation sun-editor-common",r.appendChild(s),e.charCounter)){if(a=document.createElement("DIV"),a.className="se-char-counter-wrapper",e.charCounterLabel){const t=document.createElement("SPAN");t.className="se-char-label",t.textContent=e.charCounterLabel,a.appendChild(t)}if(c=document.createElement("SPAN"),c.className="se-char-counter",c.textContent="0",a.appendChild(c),e.maxCharCount>0){const t=document.createElement("SPAN");t.textContent=" / "+e.maxCharCount,a.appendChild(t)}r.appendChild(a)}let u=null;return e.placeholder&&(u=document.createElement("SPAN"),u.className="se-placeholder",u.innerText=e.placeholder),{bottomBar:{resizingBar:r,navigation:s,charWrapper:a,charCounter:c},wysiwygFrame:o,codeView:l,placeholder:u}},_initOptions:function(e,t){const i={};if(t.plugins){const e=t.plugins,n=e.length?e:Object.keys(e).map((function(t){return e[t]}));for(let e,t=0,o=n.length;t0?t.defaultTag:"p";const n=t.textTags=[{bold:"STRONG",underline:"U",italic:"EM",strike:"DEL",sub:"SUB",sup:"SUP"},t.textTags||{}].reduce((function(e,t){for(let i in t)e[i]=t[i];return e}),{});t._textTagsMap={strong:n.bold.toLowerCase(),b:n.bold.toLowerCase(),u:n.underline.toLowerCase(),ins:n.underline.toLowerCase(),em:n.italic.toLowerCase(),i:n.italic.toLowerCase(),del:n.strike.toLowerCase(),strike:n.strike.toLowerCase(),s:n.strike.toLowerCase(),sub:n.sub.toLowerCase(),sup:n.sup.toLowerCase()},t._defaultCommand={bold:t.textTags.bold,underline:t.textTags.underline,italic:t.textTags.italic,strike:t.textTags.strike,subscript:t.textTags.sub,superscript:t.textTags.sup},t.__allowedScriptTag=!0===t.__allowedScriptTag;t.tagsBlacklist=t.tagsBlacklist||"",t._defaultTagsWhitelist=("string"==typeof t._defaultTagsWhitelist?t._defaultTagsWhitelist:"br|p|div|pre|blockquote|h1|h2|h3|h4|h5|h6|ol|ul|li|hr|figure|figcaption|img|iframe|audio|video|source|table|thead|tbody|tr|th|td|a|b|strong|var|i|em|u|ins|s|span|strike|del|sub|sup|code|svg|path|details|summary")+(t.__allowedScriptTag?"|script":""),t._editorTagsWhitelist="*"===t.addTagsWhitelist?"*":this._setWhitelist(t._defaultTagsWhitelist+("string"==typeof t.addTagsWhitelist&&t.addTagsWhitelist.length>0?"|"+t.addTagsWhitelist:""),t.tagsBlacklist),t.pasteTagsBlacklist=t.tagsBlacklist+(t.tagsBlacklist&&t.pasteTagsBlacklist?"|"+t.pasteTagsBlacklist:t.pasteTagsBlacklist||""),t.pasteTagsWhitelist="*"===t.pasteTagsWhitelist?"*":this._setWhitelist("string"==typeof t.pasteTagsWhitelist?t.pasteTagsWhitelist:t._editorTagsWhitelist,t.pasteTagsBlacklist),t.attributesWhitelist=t.attributesWhitelist&&"object"==typeof t.attributesWhitelist?t.attributesWhitelist:null,t.attributesBlacklist=t.attributesBlacklist&&"object"==typeof t.attributesBlacklist?t.attributesBlacklist:null,t.mode=t.mode||"classic",t.rtl=!!t.rtl,t.lineAttrReset=["id"].concat(t.lineAttrReset&&"string"==typeof t.lineAttrReset?t.lineAttrReset.toLowerCase().split("|"):[]),t._editableClass="sun-editor-editable"+(t.rtl?" se-rtl":""),t._printClass="string"==typeof t._printClass?t._printClass:null,t.toolbarWidth=t.toolbarWidth?$.isNumber(t.toolbarWidth)?t.toolbarWidth+"px":t.toolbarWidth:"auto",t.toolbarContainer="string"==typeof t.toolbarContainer?document.querySelector(t.toolbarContainer):t.toolbarContainer,t.stickyToolbar=/balloon/i.test(t.mode)||t.toolbarContainer?-1:void 0===t.stickyToolbar?0:/^\d+/.test(t.stickyToolbar)?$.getNumber(t.stickyToolbar,0):-1,t.hideToolbar=!!t.hideToolbar,t.fullScreenOffset=void 0===t.fullScreenOffset?0:/^\d+/.test(t.fullScreenOffset)?$.getNumber(t.fullScreenOffset,0):0,t.fullPage=!!t.fullPage,t.iframe=t.fullPage||!!t.iframe,t.iframeAttributes=t.iframeAttributes||{},t.iframeCSSFileName=t.iframe?"string"==typeof t.iframeCSSFileName?[t.iframeCSSFileName]:t.iframeCSSFileName||["suneditor"]:null,t.previewTemplate="string"==typeof t.previewTemplate?t.previewTemplate:null,t.printTemplate="string"==typeof t.printTemplate?t.printTemplate:null,t.codeMirror=t.codeMirror?t.codeMirror.src?t.codeMirror:{src:t.codeMirror}:null,t.katex=t.katex?t.katex.src?t.katex:{src:t.katex}:null,t.mathFontSize=t.mathFontSize?t.mathFontSize:[{text:"1",value:"1em"},{text:"1.5",value:"1.5em"},{text:"2",value:"2em"},{text:"2.5",value:"2.5em"}],t.position="string"==typeof t.position?t.position:null,t.display=t.display||("none"!==e.style.display&&e.style.display?e.style.display:"block"),t.popupDisplay=t.popupDisplay||"full",t.resizingBar=void 0===t.resizingBar?!/inline|balloon/i.test(t.mode):t.resizingBar,t.showPathLabel=!!t.resizingBar&&("boolean"!=typeof t.showPathLabel||t.showPathLabel),t.resizeEnable=void 0===t.resizeEnable||!!t.resizeEnable,t.resizingBarContainer="string"==typeof t.resizingBarContainer?document.querySelector(t.resizingBarContainer):t.resizingBarContainer,t.charCounter=t.maxCharCount>0||"boolean"==typeof t.charCounter&&t.charCounter,t.charCounterType="string"==typeof t.charCounterType?t.charCounterType:"char",t.charCounterLabel="string"==typeof t.charCounterLabel?t.charCounterLabel.trim():null,t.maxCharCount=$.isNumber(t.maxCharCount)&&t.maxCharCount>-1?1*t.maxCharCount:null,t.width=t.width?$.isNumber(t.width)?t.width+"px":t.width:e.clientWidth?e.clientWidth+"px":"100%",t.minWidth=($.isNumber(t.minWidth)?t.minWidth+"px":t.minWidth)||"",t.maxWidth=($.isNumber(t.maxWidth)?t.maxWidth+"px":t.maxWidth)||"",t.height=t.height?$.isNumber(t.height)?t.height+"px":t.height:e.clientHeight?e.clientHeight+"px":"auto",t.minHeight=($.isNumber(t.minHeight)?t.minHeight+"px":t.minHeight)||"",t.maxHeight=($.isNumber(t.maxHeight)?t.maxHeight+"px":t.maxHeight)||"",t.className="string"==typeof t.className&&t.className.length>0?" "+t.className:"",t.defaultStyle="string"==typeof t.defaultStyle?t.defaultStyle:"",t.font=t.font?t.font:["Arial","Comic Sans MS","Courier New","Impact","Georgia","tahoma","Trebuchet MS","Verdana"],t.fontSize=t.fontSize?t.fontSize:null,t.formats=t.formats?t.formats:null,t.colorList=t.colorList?t.colorList:null,t.lineHeights=t.lineHeights?t.lineHeights:null,t.paragraphStyles=t.paragraphStyles?t.paragraphStyles:null,t.textStyles=t.textStyles?t.textStyles:null,t.fontSizeUnit="string"==typeof t.fontSizeUnit&&t.fontSizeUnit.trim().toLowerCase()||"px",t.alignItems="object"==typeof t.alignItems?t.alignItems:t.rtl?["right","center","left","justify"]:["left","center","right","justify"],t.imageResizing=void 0===t.imageResizing||t.imageResizing,t.imageHeightShow=void 0===t.imageHeightShow||!!t.imageHeightShow,t.imageAlignShow=void 0===t.imageAlignShow||!!t.imageAlignShow,t.imageWidth=t.imageWidth?$.isNumber(t.imageWidth)?t.imageWidth+"px":t.imageWidth:"auto",t.imageHeight=t.imageHeight?$.isNumber(t.imageHeight)?t.imageHeight+"px":t.imageHeight:"auto",t.imageSizeOnlyPercentage=!!t.imageSizeOnlyPercentage,t._imageSizeUnit=t.imageSizeOnlyPercentage?"%":"px",t.imageRotation=void 0!==t.imageRotation?t.imageRotation:!(t.imageSizeOnlyPercentage||!t.imageHeightShow),t.imageFileInput=void 0===t.imageFileInput||t.imageFileInput,t.imageUrlInput=void 0===t.imageUrlInput||!t.imageFileInput||t.imageUrlInput,t.imageUploadHeader=t.imageUploadHeader||null,t.imageUploadUrl="string"==typeof t.imageUploadUrl?t.imageUploadUrl:null,t.imageUploadSizeLimit=/\d+/.test(t.imageUploadSizeLimit)?$.getNumber(t.imageUploadSizeLimit,0):null,t.imageMultipleFile=!!t.imageMultipleFile,t.imageAccept="string"!=typeof t.imageAccept||"*"===t.imageAccept.trim()?"image/*":t.imageAccept.trim()||"image/*",t.imageGalleryUrl="string"==typeof t.imageGalleryUrl?t.imageGalleryUrl:null,t.imageGalleryHeader=t.imageGalleryHeader||null,t.videoResizing=void 0===t.videoResizing||t.videoResizing,t.videoHeightShow=void 0===t.videoHeightShow||!!t.videoHeightShow,t.videoAlignShow=void 0===t.videoAlignShow||!!t.videoAlignShow,t.videoRatioShow=void 0===t.videoRatioShow||!!t.videoRatioShow,t.videoWidth=t.videoWidth&&$.getNumber(t.videoWidth,0)?$.isNumber(t.videoWidth)?t.videoWidth+"px":t.videoWidth:"",t.videoHeight=t.videoHeight&&$.getNumber(t.videoHeight,0)?$.isNumber(t.videoHeight)?t.videoHeight+"px":t.videoHeight:"",t.videoSizeOnlyPercentage=!!t.videoSizeOnlyPercentage,t._videoSizeUnit=t.videoSizeOnlyPercentage?"%":"px",t.videoRotation=void 0!==t.videoRotation?t.videoRotation:!(t.videoSizeOnlyPercentage||!t.videoHeightShow),t.videoRatio=$.getNumber(t.videoRatio,4)||.5625,t.videoRatioList=t.videoRatioList?t.videoRatioList:null,t.youtubeQuery=(t.youtubeQuery||"").replace("?",""),t.videoFileInput=!!t.videoFileInput,t.videoUrlInput=void 0===t.videoUrlInput||!t.videoFileInput||t.videoUrlInput,t.videoUploadHeader=t.videoUploadHeader||null,t.videoUploadUrl="string"==typeof t.videoUploadUrl?t.videoUploadUrl:null,t.videoUploadSizeLimit=/\d+/.test(t.videoUploadSizeLimit)?$.getNumber(t.videoUploadSizeLimit,0):null,t.videoMultipleFile=!!t.videoMultipleFile,t.videoTagAttrs=t.videoTagAttrs||null,t.videoIframeAttrs=t.videoIframeAttrs||null,t.videoAccept="string"!=typeof t.videoAccept||"*"===t.videoAccept.trim()?"video/*":t.videoAccept.trim()||"video/*",t.audioWidth=t.audioWidth?$.isNumber(t.audioWidth)?t.audioWidth+"px":t.audioWidth:"",t.audioHeight=t.audioHeight?$.isNumber(t.audioHeight)?t.audioHeight+"px":t.audioHeight:"",t.audioFileInput=!!t.audioFileInput,t.audioUrlInput=void 0===t.audioUrlInput||!t.audioFileInput||t.audioUrlInput,t.audioUploadHeader=t.audioUploadHeader||null,t.audioUploadUrl="string"==typeof t.audioUploadUrl?t.audioUploadUrl:null,t.audioUploadSizeLimit=/\d+/.test(t.audioUploadSizeLimit)?$.getNumber(t.audioUploadSizeLimit,0):null,t.audioMultipleFile=!!t.audioMultipleFile,t.audioTagAttrs=t.audioTagAttrs||null,t.audioAccept="string"!=typeof t.audioAccept||"*"===t.audioAccept.trim()?"audio/*":t.audioAccept.trim()||"audio/*",t.tableCellControllerPosition="string"==typeof t.tableCellControllerPosition?t.tableCellControllerPosition.toLowerCase():"cell",t.linkTargetNewWindow=!!t.linkTargetNewWindow,t.linkProtocol="string"==typeof t.linkProtocol?t.linkProtocol:null,t.linkRel=Array.isArray(t.linkRel)?t.linkRel:[],t.linkRelDefault=t.linkRelDefault||{},t.tabDisable=!!t.tabDisable,t.shortcutsDisable=Array.isArray(t.shortcutsDisable)?t.shortcutsDisable:[],t.shortcutsHint=void 0===t.shortcutsHint||!!t.shortcutsHint,t.callBackSave=t.callBackSave?t.callBackSave:null,t.templates=t.templates?t.templates:null,t.placeholder="string"==typeof t.placeholder?t.placeholder:null,t.mediaAutoSelect=void 0===t.mediaAutoSelect||!!t.mediaAutoSelect,t.buttonList=t.buttonList?t.buttonList:[["undo","redo"],["bold","underline","italic","strike","subscript","superscript"],["removeFormat"],["outdent","indent"],["fullScreen","showBlocks","codeView"],["preview","print"]],t.rtl&&(t.buttonList=t.buttonList.reverse()),t.icons=t.icons&&"object"==typeof t.icons?[j,t.icons].reduce((function(e,t){for(let i in t)$.hasOwn(t,i)&&(e[i]=t[i]);return e}),{}):j,t.icons=t.rtl?[t.icons,t.icons.rtl].reduce((function(e,t){for(let i in t)$.hasOwn(t,i)&&(e[i]=t[i]);return e}),{}):t.icons,t.__listCommonStyle=t.__listCommonStyle||["fontSize","color","fontFamily","fontWeight","fontStyle"],t._editorStyles=$._setDefaultOptionStyle(t,t.defaultStyle)},_setWhitelist:function(e,t){if("string"!=typeof t)return e;t=t.split("|"),e=e.split("|");for(let i,n=0,o=t.length;n-1&&e.splice(i,1);return e.join("|")},_defaultButtons:function(e){const t=e.icons,i=e.lang,n=$.isOSX_IOS?"⌘":"CTRL",o=$.isOSX_IOS?"⇧":"+SHIFT",l=e.shortcutsHint?e.shortcutsDisable:["bold","strike","underline","italic","undo","indent","save"],r=e.rtl?["[","]"]:["]","["],s=e.rtl?[t.outdent,t.indent]:[t.indent,t.outdent];return{bold:["",i.toolbar.bold+''+(l.indexOf("bold")>-1?"":n+'+B')+"","bold","",t.bold],underline:["",i.toolbar.underline+''+(l.indexOf("underline")>-1?"":n+'+U')+"","underline","",t.underline],italic:["",i.toolbar.italic+''+(l.indexOf("italic")>-1?"":n+'+I')+"","italic","",t.italic],strike:["",i.toolbar.strike+''+(l.indexOf("strike")>-1?"":n+o+'+S')+"","strike","",t.strike],subscript:["",i.toolbar.subscript,"SUB","",t.subscript],superscript:["",i.toolbar.superscript,"SUP","",t.superscript],removeFormat:["",i.toolbar.removeFormat,"removeFormat","",t.erase],indent:["",i.toolbar.indent+''+(l.indexOf("indent")>-1?"":n+'+'+r[0]+"")+"","indent","",s[0]],outdent:["",i.toolbar.outdent+''+(l.indexOf("indent")>-1?"":n+'+'+r[1]+"")+"","outdent","",s[1]],fullScreen:["se-code-view-enabled se-resizing-enabled",i.toolbar.fullScreen,"fullScreen","",t.expansion],showBlocks:["",i.toolbar.showBlocks,"showBlocks","",t.show_blocks],codeView:["se-code-view-enabled se-resizing-enabled",i.toolbar.codeView,"codeView","",t.code_view],undo:["",i.toolbar.undo+''+(l.indexOf("undo")>-1?"":n+'+Z')+"","undo","",t.undo],redo:["",i.toolbar.redo+''+(l.indexOf("undo")>-1?"":n+'+Y / '+n+o+'+Z')+"","redo","",t.redo],preview:["se-resizing-enabled",i.toolbar.preview,"preview","",t.preview],print:["se-resizing-enabled",i.toolbar.print,"print","",t.print],dir:["",i.toolbar[e.rtl?"dir_ltr":"dir_rtl"],"dir","",t[e.rtl?"dir_ltr":"dir_rtl"]],dir_ltr:["",i.toolbar.dir_ltr,"dir_ltr","",t.dir_ltr],dir_rtl:["",i.toolbar.dir_rtl,"dir_rtl","",t.dir_rtl],save:["se-resizing-enabled",i.toolbar.save+''+(l.indexOf("save")>-1?"":n+'+S')+"","save","",t.save],blockquote:["",i.toolbar.tag_blockquote,"blockquote","command",t.blockquote],font:["se-btn-select se-btn-tool-font",i.toolbar.font,"font","submenu",''+i.toolbar.font+""+t.arrow_down],formatBlock:["se-btn-select se-btn-tool-format",i.toolbar.formats,"formatBlock","submenu",''+i.toolbar.formats+""+t.arrow_down],fontSize:["se-btn-select se-btn-tool-size",i.toolbar.fontSize,"fontSize","submenu",''+i.toolbar.fontSize+""+t.arrow_down],fontColor:["",i.toolbar.fontColor,"fontColor","submenu",t.font_color],hiliteColor:["",i.toolbar.hiliteColor,"hiliteColor","submenu",t.highlight_color],align:["se-btn-align",i.toolbar.align,"align","submenu",e.rtl?t.align_right:t.align_left],list:["",i.toolbar.list,"list","submenu",t.list_number],horizontalRule:["btn_line",i.toolbar.horizontalRule,"horizontalRule","submenu",t.horizontal_rule],table:["",i.toolbar.table,"table","submenu",t.table],lineHeight:["",i.toolbar.lineHeight,"lineHeight","submenu",t.line_height],template:["",i.toolbar.template,"template","submenu",t.template],paragraphStyle:["",i.toolbar.paragraphStyle,"paragraphStyle","submenu",t.paragraph_style],textStyle:["",i.toolbar.textStyle,"textStyle","submenu",t.text_style],link:["",i.toolbar.link,"link","dialog",t.link],image:["",i.toolbar.image,"image","dialog",t.image],video:["",i.toolbar.video,"video","dialog",t.video],audio:["",i.toolbar.audio,"audio","dialog",t.audio],math:["",i.toolbar.math,"math","dialog",t.math],imageGallery:["",i.toolbar.imageGallery,"imageGallery","fileBrowser",t.image_gallery]}},_createModuleGroup:function(){const e=$.createElement("DIV");e.className="se-btn-module se-btn-module-border";const t=$.createElement("UL");return t.className="se-menu-list",e.appendChild(t),{div:e,ul:t}},_createButton:function(e,t,i,n,o,l,r){const s=$.createElement("LI"),a=$.createElement("BUTTON"),c=t||i;return a.setAttribute("type","button"),a.setAttribute("class","se-btn"+(e?" "+e:"")+" se-tooltip"),a.setAttribute("data-command",i),a.setAttribute("data-display",n),a.setAttribute("aria-label",c.replace(//,"")),a.setAttribute("tabindex","-1"),o||(o='!'),/^default\./i.test(o)&&(o=r[o.replace(/^default\./i,"")]),/^text\./i.test(o)&&(o=o.replace(/^text\./i,""),a.className+=" se-btn-more-text"),o+=''+c+"",l&&a.setAttribute("disabled",!0),a.innerHTML=o,s.appendChild(a),{li:s,button:a}},_createToolBar:function(e,t,i,n){const o=e.createElement("DIV");o.className="se-toolbar-separator-vertical";const l=e.createElement("DIV");l.className="se-toolbar sun-editor-common";const r=e.createElement("DIV");r.className="se-btn-tray",l.appendChild(r),t=JSON.parse(JSON.stringify(t));const s=n.icons,a=this._defaultButtons(n),c={},u=[];let d=null,h=null,p=null,f=null,g="",m=!1;const v=$.createElement("DIV");v.className="se-toolbar-more-layer";e:for(let n,l,b,y,w,_=0;_",v.appendChild(l),l=l.firstElementChild.firstElementChild)}if(m){const e=o.cloneNode(!1);r.appendChild(e)}r.appendChild(p.div),m=!0}else if(/^\/$/.test(y)){const t=e.createElement("DIV");t.className="se-btn-module-enter",r.appendChild(t),m=!1}switch(r.children.length){case 0:r.style.display="none";break;case 1:$.removeClass(r.firstElementChild,"se-btn-module-border");break;default:if(n.rtl){const e=o.cloneNode(!1);e.style.float=r.lastElementChild.style.float,r.appendChild(e)}}u.length>0&&u.unshift(t),v.children.length>0&&r.appendChild(v);const b=e.createElement("DIV");b.className="se-menu-tray",l.appendChild(b);const y=e.createElement("DIV");return y.className="se-toolbar-cover",l.appendChild(y),n.hideToolbar&&(l.style.display="none"),{element:l,plugins:i,pluginCallButtons:c,responsiveButtons:u,_menuTray:b,_buttonTray:r}}},K=function(e,t,i){return{element:{originElement:e,topArea:t._top,relative:t._relative,toolbar:t._toolBar,_toolbarShadow:t._toolbarShadow,_buttonTray:t._toolBar.querySelector(".se-btn-tray"),_menuTray:t._menuTray,resizingBar:t._resizingBar,navigation:t._navigation,charWrapper:t._charWrapper,charCounter:t._charCounter,editorArea:t._editorArea,wysiwygFrame:t._wysiwygArea,wysiwyg:t._wysiwygArea,code:t._codeArea,placeholder:t._placeholder,loading:t._loading,lineBreaker:t._lineBreaker,lineBreaker_t:t._lineBreaker_t,lineBreaker_b:t._lineBreaker_b,resizeBackground:t._resizeBack,_stickyDummy:t._stickyDummy,_arrow:t._arrow},tool:{cover:t._toolBar.querySelector(".se-toolbar-cover"),bold:t._toolBar.querySelector('[data-command="bold"]'),underline:t._toolBar.querySelector('[data-command="underline"]'),italic:t._toolBar.querySelector('[data-command="italic"]'),strike:t._toolBar.querySelector('[data-command="strike"]'),sub:t._toolBar.querySelector('[data-command="SUB"]'),sup:t._toolBar.querySelector('[data-command="SUP"]'),undo:t._toolBar.querySelector('[data-command="undo"]'),redo:t._toolBar.querySelector('[data-command="redo"]'),save:t._toolBar.querySelector('[data-command="save"]'),outdent:t._toolBar.querySelector('[data-command="outdent"]'),indent:t._toolBar.querySelector('[data-command="indent"]'),fullScreen:t._toolBar.querySelector('[data-command="fullScreen"]'),showBlocks:t._toolBar.querySelector('[data-command="showBlocks"]'),codeView:t._toolBar.querySelector('[data-command="codeView"]'),dir:t._toolBar.querySelector('[data-command="dir"]'),dir_ltr:t._toolBar.querySelector('[data-command="dir_ltr"]'),dir_rtl:t._toolBar.querySelector('[data-command="dir_rtl"]')},options:i,option:i}};const X={name:"notice",add:function(e){const t=e.context;t.notice={};let i=e.util.createElement("DIV"),n=e.util.createElement("SPAN"),o=e.util.createElement("BUTTON");i.className="se-notice",o.className="close",o.setAttribute("aria-label","Close"),o.setAttribute("title",e.lang.dialogBox.close),o.innerHTML=e.icons.cancel,i.appendChild(n),i.appendChild(o),t.notice.modal=i,t.notice.message=n,o.addEventListener("click",this.onClick_cancel.bind(e)),t.element.editorArea.appendChild(i),i=null},onClick_cancel:function(e){e.preventDefault(),e.stopPropagation(),this.plugins.notice.close.call(this)},open:function(e){this.context.notice.message.textContent=e,this.context.notice.modal.style.display="block"},close:function(){this.context.notice.modal.style.display="none"}};const J={init:function(e){return{create:function(t,i){return this.create(t,i,e)}.bind(this)}},create:function(e,t,i){$._propertiesInit(),"object"!=typeof t&&(t={}),i&&(t=[i,t].reduce((function(e,t){for(let i in t)if($.hasOwn(t,i))if("plugins"===i&&t[i]&&e[i]){let n=e[i],o=t[i];n=n.length?n:Object.keys(n).map((function(e){return n[e]})),o=o.length?o:Object.keys(o).map((function(e){return o[e]})),e[i]=o.filter((function(e){return-1===n.indexOf(e)})).concat(n)}else e[i]=t[i];return e}),{}));const n="string"==typeof e?document.getElementById(e):e;if(!n){if("string"==typeof e)throw Error('[SUNEDITOR.create.fail] The element for that id was not found (ID:"'+e+'")');throw Error("[SUNEDITOR.create.fail] suneditor requires textarea's element or id value")}const o=Y.init(n,t);if(o.constructed._top.id&&document.getElementById(o.constructed._top.id))throw Error('[SUNEDITOR.create.fail] The ID of the suneditor you are trying to create already exists (ID:"'+o.constructed._top.id+'")');return function(e,t,i,n,o,l){const r=e.element.originElement.ownerDocument||document,s=r.defaultView||window,a=$,c=o.icons,u={_d:r,_w:s,_parser:new s.DOMParser,_prevRtl:o.rtl,_editorHeight:0,_editorHeightPadding:0,_listCamel:o.__listCommonStyle,_listKebab:a.camelToKebabCase(o.__listCommonStyle),_wd:null,_ww:null,_shadowRoot:null,_shadowRootControllerEventTarget:null,util:a,functions:null,options:null,wwComputedStyle:null,notice:X,icons:c,history:null,context:e,pluginCallButtons:t,plugins:i||{},initPlugins:{},_targetPlugins:{},_menuTray:{},lang:n,effectNode:null,submenu:null,container:null,_submenuName:"",_bindedSubmenuOff:null,_bindedContainerOff:null,submenuActiveButton:null,containerActiveButton:null,controllerArray:[],currentControllerName:"",currentControllerTarget:null,currentFileComponentInfo:null,codeViewDisabledButtons:[],resizingDisabledButtons:[],_moreLayerActiveButton:null,_htmlCheckWhitelistRegExp:null,_htmlCheckBlacklistRegExp:null,_disallowedTextTagsRegExp:null,editorTagsWhitelistRegExp:null,editorTagsBlacklistRegExp:null,pasteTagsWhitelistRegExp:null,pasteTagsBlacklistRegExp:null,hasFocus:!1,isDisabled:!1,isReadOnly:!1,_attributesWhitelistRegExp:null,_attributesWhitelistRegExp_all_data:null,_attributesBlacklistRegExp:null,_attributesTagsWhitelist:null,_attributesTagsBlacklist:null,_bindControllersOff:null,_isInline:null,_isBalloon:null,_isBalloonAlways:null,_inlineToolbarAttr:{top:"",width:"",isShow:!1},_notHideToolbar:!1,_sticky:!1,_antiBlur:!1,_lineBreaker:null,_lineBreakerButton:null,_componentsInfoInit:!0,_componentsInfoReset:!1,activePlugins:null,managedTagsInfo:null,_charTypeHTML:!1,_fileInfoPluginsCheck:null,_fileInfoPluginsReset:null,_fileManager:{tags:null,regExp:null,queryString:null,pluginRegExp:null,pluginMap:null},commandMap:{},_commandMapStyles:{STRONG:["font-weight"],U:["text-decoration"],EM:["font-style"],DEL:["text-decoration"]},_styleCommandMap:null,_cleanStyleRegExp:{span:new s.RegExp("\\s*[^-a-zA-Z](font-family|font-size|color|background-color)\\s*:[^;]+(?!;)*","ig"),format:new s.RegExp("\\s*[^-a-zA-Z](text-align|margin-left|margin-right)\\s*:[^;]+(?!;)*","ig"),fontSizeUnit:new s.RegExp("\\d+"+o.fontSizeUnit+"$","i")},_variable:{isChanged:!1,isCodeView:!1,isFullScreen:!1,innerHeight_fullScreen:0,resizeClientY:0,tabSize:4,codeIndent:2,minResizingSize:a.getNumber(e.element.wysiwygFrame.style.minHeight||"65",0),currentNodes:[],currentNodesMap:[],_range:null,_selectionNode:null,_originCssText:e.element.topArea.style.cssText,_bodyOverflow:"",_editorAreaOriginCssText:"",_wysiwygOriginCssText:"",_codeOriginCssText:"",_fullScreenAttrs:{sticky:!1,balloon:!1,inline:!1},_lineBreakComp:null,_lineBreakDir:""},_formatAttrsTemp:null,_saveButtonStates:function(){this.allCommandButtons||(this.allCommandButtons={});const e=this.context.element._buttonTray.querySelectorAll(".se-menu-list button[data-display]");for(let t,i,n=0;ne?c-e:0,o=n>0?0:e-c;i.style.left=u-n+o+"px",r.left>d._getEditorOffsets(i).left&&(i.style.left="0px")}else{const e=l<=c?0:l-(u+c);i.style.left=e<0?u+e+"px":u+"px"}let h=0,p=t;for(;p&&p!==n;)h+=p.offsetTop,p=p.offsetParent;const f=h;this._isBalloon?h+=n.offsetTop+t.offsetHeight:h-=t.offsetHeight;const g=r.top,m=i.offsetHeight,v=this.getGlobalScrollOffset().top,b=s.innerHeight-(g-v+f+t.parentElement.offsetHeight);if(bb?(i.style.height=o+"px",e=-1*(o-f+3)):(i.style.height=b+"px",e=f+t.parentElement.offsetHeight),i.style.top=e+"px"}else i.style.top=f+t.parentElement.offsetHeight+"px";i.style.visibility=""},controllersOn:function(){this._bindControllersOff&&this._bindControllersOff(),this.controllerArray=[];for(let e,t=0;t0)for(let e=0;e0){for(let e=0;ed?u-d:0,n=i>0?0:d-u;t.style.left=c-i+n+"px",i>0&&h&&(h.style.left=(u-14<10+i?u-14:10+i)+"px");const o=e.element.wysiwygFrame.offsetLeft-t.offsetLeft;o>0&&(t.style.left="0px",h&&(h.style.left=o+"px"))}else{t.style.left=c+"px";const i=e.element.wysiwygFrame.offsetWidth-(t.offsetLeft+u);i<0?(t.style.left=t.offsetLeft+i+"px",h&&(h.style.left=20-i+"px")):h&&(h.style.left="20px")}t.style.visibility=""},execCommand:function(e,t,i){this._wd.execCommand(e,t,"formatBlock"===e?"<"+i+">":i),this.history.push(!0)},nativeFocus:function(){this.__focus(),this._editorRange()},__focus:function(){const t=a.getParentElement(this.getSelectionNode(),"figcaption");t?t.focus():e.element.wysiwyg.focus()},focus:function(){if("none"!==e.element.wysiwygFrame.style.display){if(o.iframe)this.nativeFocus();else try{const t=this.getRange();if(t.startContainer===t.endContainer&&a.isWysiwygDiv(t.startContainer)){const i=t.commonAncestorContainer.children[t.startOffset];if(!a.isFormatElement(i)&&!a.isComponent(i)){const t=a.createElement(o.defaultTag),n=a.createElement("BR");return t.appendChild(n),e.element.wysiwyg.insertBefore(t,i),void this.setRange(n,0,n,0)}}this.setRange(t.startContainer,t.startOffset,t.endContainer,t.endOffset)}catch(e){this.nativeFocus()}d._applyTagEffects(),this._isBalloon&&d._toggleToolbarBalloon()}},focusEdge:function(t){t||(t=e.element.wysiwyg.lastElementChild);const i=this.getFileComponent(t);i?this.selectComponent(i.target,i.pluginName):t?(t=a.getChildElement(t,(function(e){return 0===e.childNodes.length||3===e.nodeType}),!0))?this.setRange(t,t.textContent.length,t,t.textContent.length):this.nativeFocus():this.focus()},blur:function(){o.iframe?e.element.wysiwygFrame.blur():e.element.wysiwyg.blur()},setRange:function(e,t,i,n){if(!e||!i)return;t>e.textContent.length&&(t=e.textContent.length),n>i.textContent.length&&(n=i.textContent.length),a.isFormatElement(e)&&(e=e.childNodes[t]||e.childNodes[t-1]||e,t=t>0?1===e.nodeType?1:e.textContent?e.textContent.length:0:0),a.isFormatElement(i)&&(i=i.childNodes[n]||i.childNodes[n-1]||i,n=n>0?1===i.nodeType?1:i.textContent?i.textContent.length:0:0);const l=this._wd.createRange();try{l.setStart(e,t),l.setEnd(i,n)}catch(e){return console.warn("[SUNEDITOR.core.focus.error] "+e),void this.nativeFocus()}const r=this.getSelection();return r.removeAllRanges&&r.removeAllRanges(),r.addRange(l),this._rangeInfo(l,this.getSelection()),o.iframe&&this.__focus(),l},removeRange:function(){this._variable._range=null,this._variable._selectionNode=null,this.hasFocus&&this.getSelection().removeAllRanges(),this._setKeyEffect([])},getRange:function(){const t=this._variable._range||this._createDefaultRange(),i=this.getSelection();if(t.collapsed===i.isCollapsed||!e.element.wysiwyg.contains(i.focusNode))return t;if(i.rangeCount>0)return this._variable._range=i.getRangeAt(0),this._variable._range;{const e=i.anchorNode,t=i.focusNode,n=i.anchorOffset,o=i.focusOffset,l=a.compareElements(e,t),r=l.ancestor&&(0===l.result?n<=o:l.result>1);return this.setRange(r?e:t,r?n:o,r?t:e,r?o:n)}},getRange_addLine:function(t,i){if(this._selectionVoid(t)){const n=e.element.wysiwyg,l=a.createElement(o.defaultTag);l.innerHTML="
",n.insertBefore(l,i&&i!==n?i.nextElementSibling:n.firstElementChild),this.setRange(l.firstElementChild,0,l.firstElementChild,1),t=this._variable._range}return t},getSelection:function(){const t=this._shadowRoot&&this._shadowRoot.getSelection?this._shadowRoot.getSelection():this._ww.getSelection();return this._variable._range||e.element.wysiwyg.contains(t.focusNode)||(t.removeAllRanges(),t.addRange(this._createDefaultRange())),t},getSelectionNode:function(){if(e.element.wysiwyg.contains(this._variable._selectionNode)||this._editorRange(),!this._variable._selectionNode){const t=a.getChildElement(e.element.wysiwyg.firstChild,(function(e){return 0===e.childNodes.length||3===e.nodeType}),!1);if(t)return this._variable._selectionNode=t,t;this._editorRange()}return this._variable._selectionNode},_editorRange:function(){const e=this._wd.activeElement;if(a.isInputElement(e))return this._variable._selectionNode=e,e;const t=this.getSelection();if(!t)return null;let i=null;i=t.rangeCount>0?t.getRangeAt(0):this._createDefaultRange(),this._rangeInfo(i,t)},_rangeInfo:function(e,t){let i=null;this._variable._range=e,i=e.collapsed?a.isWysiwygDiv(e.commonAncestorContainer)&&e.commonAncestorContainer.children[e.startOffset]||e.commonAncestorContainer:t.extentNode||t.anchorNode,this._variable._selectionNode=i},_createDefaultRange:function(){const t=e.element.wysiwyg,i=this._wd.createRange();let n=t.firstElementChild,l=null;return n?(l=n.firstChild,l||(l=a.createElement("BR"),n.appendChild(l))):(n=a.createElement(o.defaultTag),l=a.createElement("BR"),n.appendChild(l),t.appendChild(n)),i.setStart(l,0),i.setEnd(l,0),i},_selectionVoid:function(e){const t=e.commonAncestorContainer;return a.isWysiwygDiv(e.startContainer)&&a.isWysiwygDiv(e.endContainer)||/FIGURE/i.test(t.nodeName)||this._fileManager.regExp.test(t.nodeName)||a.isMediaComponent(t)},_resetRangeToTextNode:function(){const t=this.getRange();if(this._selectionVoid(t))return!1;let i,n,l,r=t.startContainer,s=t.startOffset,c=t.endContainer,u=t.endOffset;if(a.isFormatElement(r))for(r.childNodes[s]?(r=r.childNodes[s]||r,s=0):(r=r.lastChild||r,s=r.textContent.length);r&&1===r.nodeType&&r.firstChild;)r=r.firstChild||r,s=0;if(a.isFormatElement(c)){for(c=c.childNodes[u]||c.lastChild||c;c&&1===c.nodeType&&c.lastChild;)c=c.lastChild;u=c.textContent.length}if(i=a.isWysiwygDiv(r)?e.element.wysiwyg.firstChild:r,n=s,a.isBreak(i)||1===i.nodeType&&i.childNodes.length>0){const e=a.isBreak(i);if(!e){for(;i&&!a.isBreak(i)&&1===i.nodeType;)i=i.childNodes[n]||i.nextElementSibling||i.nextSibling,n=0;let e=a.getFormatElement(i,null);e===a.getRangeFormatElement(e,null)&&(e=a.createElement(a.getParentElement(i,a.isCell)?"DIV":o.defaultTag),i.parentNode.insertBefore(e,i),e.appendChild(i))}if(a.isBreak(i)){const t=a.createTextNode(a.zeroWidthSpace);i.parentNode.insertBefore(t,i),i=t,e&&r===c&&(c=i,u=1)}}if(r=i,s=n,i=a.isWysiwygDiv(c)?e.element.wysiwyg.lastChild:c,n=u,a.isBreak(i)||1===i.nodeType&&i.childNodes.length>0){const e=a.isBreak(i);if(!e){for(;i&&!a.isBreak(i)&&1===i.nodeType&&(l=i.childNodes,0!==l.length);)i=l[n>0?n-1:n]||!/FIGURE/i.test(l[0].nodeName)?l[0]:i.previousElementSibling||i.previousSibling||r,n=n>0?i.textContent.length:n;let e=a.getFormatElement(i,null);e===a.getRangeFormatElement(e,null)&&(e=a.createElement(a.isCell(e)?"DIV":o.defaultTag),i.parentNode.insertBefore(e,i),e.appendChild(i))}if(a.isBreak(i)){const t=a.createTextNode(a.zeroWidthSpace);i.parentNode.insertBefore(t,i),i=t,n=1,e&&!i.previousSibling&&a.removeItem(c)}}return c=i,u=n,this.setRange(r,s,c,u),!0},getSelectedElements:function(t){if(!this._resetRangeToTextNode())return[];let i=this.getRange();if(a.isWysiwygDiv(i.startContainer)){const t=e.element.wysiwyg.children;if(0===t.length)return[];this.setRange(t[0],0,t[t.length-1],t[t.length-1].textContent.trim().length),i=this.getRange()}const n=i.startContainer,o=i.endContainer,l=i.commonAncestorContainer,r=a.getListChildren(l,(function(e){return t?t(e):a.isFormatElement(e)}));if(a.isWysiwygDiv(l)||a.isRangeFormatElement(l)||r.unshift(a.getFormatElement(l,null)),n===o||1===r.length)return r;let s=a.getFormatElement(n,null),c=a.getFormatElement(o,null),u=null,d=null;const h=function(e){return!a.isTable(e)||/^TABLE$/i.test(e.nodeName)};let p=a.getRangeFormatElement(s,h),f=a.getRangeFormatElement(c,h);a.isTable(p)&&a.isListCell(p.parentNode)&&(p=p.parentNode),a.isTable(f)&&a.isListCell(f.parentNode)&&(f=f.parentNode);const g=p===f;for(let e,t=0,i=r.length;t=0;i--)if(n[i].contains(n[e])){n.splice(e,1),e--,t--;break}return n},isEdgePoint:function(e,t,i){return"end"!==i&&0===t||(!i||"front"!==i)&&!e.nodeValue&&1===t||(!i||"end"===i)&&!!e.nodeValue&&t===e.nodeValue.length},_isEdgeFormat:function(e,t,i){if(!this.isEdgePoint(e,t,i))return!1;const n=[];for(i="front"===i?"previousSibling":"nextSibling";e&&!a.isFormatElement(e)&&!a.isWysiwygDiv(e);){if(e[i]&&(!a.isBreak(e[i])||e[i][i]))return null;1===e.nodeType&&n.push(e.cloneNode(!1)),e=e.parentNode}return n},showLoading:function(){e.element.loading.style.display="block"},closeLoading:function(){e.element.loading.style.display="none"},appendFormatTag:function(e,t){if(!e||!e.parentNode)return null;const i=a.getFormatElement(this.getSelectionNode(),null);let n=null;if(!a.isFormatElement(e)&&a.isFreeFormatElement(i||e.parentNode))n=a.createElement("BR");else{const e=t?"string"==typeof t?t:t.nodeName:!a.isFormatElement(i)||a.isRangeFormatElement(i)||a.isFreeFormatElement(i)?o.defaultTag:i.nodeName;n=a.createElement(e),n.innerHTML="
",(t&&"string"!=typeof t||!t&&a.isFormatElement(i))&&a.copyTagAttributes(n,t||i,["id"])}return a.isCell(e)?e.insertBefore(n,e.nextElementSibling):e.parentNode.insertBefore(n,e.nextElementSibling),n},insertComponent:function(e,t,i,n){if(this.isReadOnly||i&&!this.checkCharCount(e,null))return null;const o=this.removeNode();this.getRange_addLine(this.getRange(),o.container);let l=null,r=this.getSelectionNode(),s=a.getFormatElement(r,null);if(a.isListCell(s))this.insertNode(e,r===s?null:o.container.nextSibling,!1),e.nextSibling||e.parentNode.appendChild(a.createElement("BR"));else{if(this.getRange().collapsed&&(3===o.container.nodeType||a.isBreak(o.container))){const e=a.getParentElement(o.container,function(e){return this.isRangeFormatElement(e)}.bind(a));l=a.splitElement(o.container,o.offset,e?a.getElementDepth(e)+1:0),l&&(s=l.previousSibling)}this.insertNode(e,a.isRangeFormatElement(s)?null:s,!1),s&&a.onlyZeroWidthSpace(s)&&a.removeItem(s)}if(!n){this.setRange(e,0,e,0);const t=this.getFileComponent(e);t?this.selectComponent(t.target,t.pluginName):l&&(l=a.getEdgeChildNodes(l,null).sc||l,this.setRange(l,0,l,0))}return t||this.history.push(1),l||e},getFileComponent:function(e){if(!this._fileManager.queryString||!e)return null;let t,i;return(/^FIGURE$/i.test(e.nodeName)||/se-component/.test(e.className))&&(t=e.querySelector(this._fileManager.queryString)),!t&&e.nodeName&&this._fileManager.regExp.test(e.nodeName)&&(t=e),t&&(i=this._fileManager.pluginMap[t.nodeName.toLowerCase()],i)?{target:t,component:a.getParentElement(t,a.isComponent),pluginName:i}:null},selectComponent:function(e,t){if(a.isUneditableComponent(a.getParentElement(e,a.isComponent))||a.isUneditableComponent(e))return!1;this.hasFocus||this.focus();const i=this.plugins[t];i&&s.setTimeout(function(){"function"==typeof i.select&&this.callPlugin(t,i.select.bind(this,e),null),this._setComponentLineBreaker(e)}.bind(this))},_setComponentLineBreaker:function(t){this._lineBreaker.style.display="none";const i=a.getParentElement(t,a.isComponent),n=e.element.lineBreaker_t.style,o=e.element.lineBreaker_b.style,l="block"===this.context.resizing.resizeContainer.style.display?this.context.resizing.resizeContainer:t,r=a.isListCell(i.parentNode);let s,c,u;(r?i.previousSibling:a.isFormatElement(i.previousElementSibling))?n.display="none":(this._variable._lineBreakComp=i,c=e.element.wysiwyg.scrollTop,s=a.getOffset(t,e.element.wysiwygFrame).top+c,u=l.offsetWidth/2/2,n.top=s-c-12+"px",n.left=a.getOffset(l).left+u+"px",n.display="block"),(r?i.nextSibling:a.isFormatElement(i.nextElementSibling))?o.display="none":(s||(this._variable._lineBreakComp=i,c=e.element.wysiwyg.scrollTop,s=a.getOffset(t,e.element.wysiwygFrame).top+c,u=l.offsetWidth/2/2),o.top=s+l.offsetHeight-c-12+"px",o.left=a.getOffset(l).left+l.offsetWidth-u-24+"px",o.display="block")},_checkDuplicateNode:function(e,t){!function e(i){u._dupleCheck(i,t);const n=i.childNodes;for(let t=0,i=n.length;t-1&&i.splice(e,1);for(let t=0,i=l.classList.length;tv?g.splitText(v):g.nextSibling;else if(a.isBreak(l))i=l,l=l.parentNode;else{let e=l.childNodes[m];const n=e&&3===e.nodeType&&a.onlyZeroWidthSpace(e)&&a.isBreak(e.nextSibling)?e.nextSibling:e;n?!n.nextSibling&&a.isBreak(n)?(l.removeChild(n),i=null):i=a.isBreak(n)&&!a.isBreak(t)?n:n.nextSibling:i=null}else if(y===w){i=this.isEdgePoint(w,v)?w.nextSibling:w.splitText(v);let e=y;this.isEdgePoint(y,m)||(e=y.splitText(m)),l.removeChild(e),0===l.childNodes.length&&f&&(l.innerHTML="
")}else{const e=this.removeNode(),n=e.container,r=e.prevContainer;if(n&&0===n.childNodes.length&&f&&(a.isFormatElement(n)?n.innerHTML="
":a.isRangeFormatElement(n)&&(n.innerHTML="<"+o.defaultTag+">
")),a.isListCell(n)&&3===t.nodeType)l=n,i=null;else if(!f&&r)if(l=3===r.nodeType?r.parentNode:r,l.contains(n)){let e=!0;for(i=n;i.parentNode&&i.parentNode!==l;)i=i.parentNode,e=!1;e&&n===r&&(i=i.nextSibling)}else i=null;else a.isWysiwygDiv(n)&&!a.isFormatElement(t)?(l=n.appendChild(a.createElement(o.defaultTag)),i=null):l=(i=f?w:n===r?n.nextSibling:n)&&i.parentNode?i.parentNode:g;for(;i&&!a.isFormatElement(i)&&i.parentNode!==g;)i=i.parentNode}try{if(!d){if((a.isWysiwygDiv(i)||l===e.element.wysiwyg.parentNode)&&(l=e.element.wysiwyg,i=null),a.isFormatElement(t)||a.isRangeFormatElement(t)||!a.isListCell(l)&&a.isComponent(t)){const e=l;if(a.isList(i))l=i,i=null;else if(a.isListCell(i))l=i.previousElementSibling||i;else if(!r&&!i){const e=this.removeNode(),t=3===e.container.nodeType?a.isListCell(a.getFormatElement(e.container,null))?e.container:a.getFormatElement(e.container,null)||e.container.parentNode:e.container,n=a.isWysiwygDiv(t)||a.isRangeFormatElement(t);l=n?t:t.parentNode,i=n?null:t.nextSibling}0===e.childNodes.length&&l!==e&&a.removeItem(e)}if(!f||p||a.isRangeFormatElement(l)||a.isListCell(l)||a.isWysiwygDiv(l)||(i=l.nextElementSibling,l=l.parentNode),a.isWysiwygDiv(l)&&(3===t.nodeType||a.isBreak(t))){const e=a.createElement(o.defaultTag);e.appendChild(t),t=e}}if(d?h.parentNode?(l=h,i=s):(l=e.element.wysiwyg,i=null):i=l===i?l.lastChild:i,a.isListCell(t)&&!a.isList(l)){if(a.isListCell(l))i=l.nextElementSibling,l=l.parentNode;else{const e=a.createElement("ol");l.insertBefore(e,i),l=e,i=null}d=!0}if(this._checkDuplicateNode(t,l),l.insertBefore(t,i),d)if(a.onlyZeroWidthSpace(u.textContent.trim()))a.removeItem(u),t=t.lastChild;else{const e=a.getArrayItem(u.children,a.isList);e&&(t!==e?(t.appendChild(e),t=e.previousSibling):(l.appendChild(t),t=l),a.onlyZeroWidthSpace(u.textContent.trim())&&a.removeItem(u))}}catch(e){l.appendChild(t),console.warn("[SUNEDITOR.insertNode.warn] "+e)}finally{const e=l.querySelectorAll("[data-se-duple]");if(e.length>0)for(let i,n,o,l,r=0,s=e.length;r0&&(t.textContent=n+t.textContent,a.removeItem(e)),i&&i.length>0&&(t.textContent+=o,a.removeItem(i));const l={container:t,startOffset:n.length,endOffset:t.textContent.length-o.length};return this.setRange(t,l.startOffset,t,l.endOffset),l}if(!a.isBreak(t)&&!a.isListCell(t)&&a.isFormatElement(l)){let i=null;t.previousSibling&&!a.isBreak(t.previousSibling)||(i=a.createTextNode(a.zeroWidthSpace),t.parentNode.insertBefore(i,t)),t.nextSibling&&!a.isBreak(t.nextSibling)||(i=a.createTextNode(a.zeroWidthSpace),t.parentNode.insertBefore(i,t.nextSibling)),a._isIgnoreNodeChange(t)&&(t=t.nextSibling,e=0)}this.setRange(t,e,t,e)}return this.history.push(!0),t}},_setIntoFreeFormat:function(e){const t=e.parentNode;let i,n;for(;a.isFormatElement(e)||a.isRangeFormatElement(e);){for(i=e.childNodes,n=null;i[0];)if(n=i[0],a.isFormatElement(n)||a.isRangeFormatElement(n)){if(this._setIntoFreeFormat(n),!e.parentNode)break;i=e.childNodes}else t.insertBefore(n,e);0===e.childNodes.length&&a.removeItem(e),e=a.createElement("BR"),t.insertBefore(e,n.nextSibling)}return e},removeNode:function(){this._resetRangeToTextNode();const t=this.getRange(),i=0===t.startOffset,n=u.isEdgePoint(t.endContainer,t.endOffset,"end");let o=null,l=null,r=null;i&&(l=a.getFormatElement(t.startContainer),o=l.previousElementSibling,l=l?o:l),n&&(r=a.getFormatElement(t.endContainer),r=r?r.nextElementSibling:r);let s,c=0,d=t.startContainer,h=t.endContainer,p=t.startOffset,f=t.endOffset;const g=3===t.commonAncestorContainer.nodeType&&t.commonAncestorContainer.parentNode===d.parentNode?d.parentNode:t.commonAncestorContainer;if(g===d&&g===h&&(d=g.children[p],h=g.children[f],p=f=0),!d||!h)return{container:g,offset:0};if(d===h&&t.collapsed&&d.textContent&&a.onlyZeroWidthSpace(d.textContent.substr(p)))return{container:d,offset:p,prevContainer:d&&d.parentNode?d:null};let m=null,v=null;const b=a.getListChildNodes(g,null);let y=a.getArrayIndex(b,d),w=a.getArrayIndex(b,h);if(b.length>0&&y>-1&&w>-1){for(let e=y+1,t=d;e>=0;e--)b[e]===t.parentNode&&b[e].firstChild===t&&0===p&&(y=e,t=t.parentNode);for(let e=w-1,t=h;e>y;e--)b[e]===t.parentNode&&1===b[e].nodeType&&(b.splice(e,1),t=t.parentNode,--w)}else{if(0===b.length){if(a.isFormatElement(g)||a.isRangeFormatElement(g)||a.isWysiwygDiv(g)||a.isBreak(g)||a.isMedia(g))return{container:g,offset:0};if(3===g.nodeType)return{container:g,offset:f};b.push(g),d=h=g}else if(d=h=b[0],a.isBreak(d)||a.onlyZeroWidthSpace(d))return{container:a.isMedia(g)?g:d,offset:0};y=w=0}for(let e=y;e<=w;e++){const t=b[e];if(0===t.length||3===t.nodeType&&void 0===t.data)this._nodeRemoveListItem(t);else if(t!==d)if(t!==h)this._nodeRemoveListItem(t);else{if(1===h.nodeType){if(a.isComponent(h))continue;v=a.createTextNode(h.textContent)}else v=a.createTextNode(h.substringData(f,h.length-f));v.length>0?h.data=v.data:this._nodeRemoveListItem(h)}else{if(1===d.nodeType){if(a.isComponent(d))continue;m=a.createTextNode(d.textContent)}else t===h?(m=a.createTextNode(d.substringData(0,p)+h.substringData(f,h.length-f)),c=p):m=a.createTextNode(d.substringData(0,p));if(m.length>0?d.data=m.data:this._nodeRemoveListItem(d),t===h)break}}const _=a.getParentElement(h,"ul"),x=a.getParentElement(d,"li");if(_&&x&&x.contains(_)?(s=_.previousSibling,c=s.textContent.length):(s=h&&h.parentNode?h:d&&d.parentNode?d:t.endContainer||t.startContainer,c=i||n?n?s.textContent.length:0:c),!a.isWysiwygDiv(s)&&0===s.childNodes.length){const t=a.removeItemAllParents(s,null,null);t&&(s=t.sc||t.ec||e.element.wysiwyg)}return a.getFormatElement(s)||d&&d.parentNode||(r?(s=r,c=0):l&&(s=l,c=1)),this.setRange(s,c,s,c),this.history.push(!0),{container:s,offset:c,prevContainer:o}},_nodeRemoveListItem:function(e){const t=a.getFormatElement(e,null);a.removeItem(e),a.isListCell(t)&&(a.removeItemAllParents(t,null,null),t&&a.isList(t.firstChild)&&t.insertBefore(a.createTextNode(a.zeroWidthSpace),t.firstChild))},applyRangeFormatElement:function(e){this.getRange_addLine(this.getRange(),null);const t=this.getSelectedElementsAndComponents(!1);if(!t||0===t.length)return;e:for(let e,i,n,o,l,r,s=0,c=t.length;s-1&&(o=i.lastElementChild,t.indexOf(o)>-1))){let e=null;for(;e=o.lastElementChild;)if(a.isList(e)){if(!(t.indexOf(e.lastElementChild)>-1))continue e;o=e.lastElementChild}n=i.firstElementChild,l=t.indexOf(n),r=t.indexOf(o),t.splice(l,r-l+1),c=t.length}let i,n,o,l=t[t.length-1];i=a.isRangeFormatElement(l)||a.isFormatElement(l)?l:a.getRangeFormatElement(l,null)||a.getFormatElement(l,null),a.isCell(i)?(n=null,o=i):(n=i.nextSibling,o=i.parentNode);let r=a.getElementDepth(i),s=null;const c=[],u=function(e,t,i){let n=null;if(e!==t&&!a.isTable(t)){if(t&&a.getElementDepth(e)===a.getElementDepth(t))return i;n=a.removeItemAllParents(t,null,e)}return n?n.ec:i};for(let i,l,d,h,p,f,g,m=0,v=t.length;m=d?(r=d,o=v.cc,n=u(o,l,v.ec),n&&(o=n.parentNode)):o===v.cc&&(n=v.ec),o!==v.cc&&(h=u(o,v.cc,h),n=void 0!==h?h:v.cc);for(let e=0,t=v.removeArray.length;e=d&&(r=d,o=l,n=i.nextSibling),e.appendChild(i),o!==l&&(h=u(o,l),void 0!==h&&(n=h));if(this.effectNode=null,a.mergeSameTags(e,null,!1),a.mergeNestedTags(e,function(e){return this.isList(e)}.bind(a)),n&&a.getElementDepth(n)>0&&(a.isList(n.parentNode)||a.isList(n.parentNode.parentNode))){const t=a.getParentElement(n,function(e){return this.isRangeFormatElement(e)&&!this.isList(e)}.bind(a)),i=a.splitElement(n,null,t?a.getElementDepth(t)+1:0);i.parentNode.insertBefore(e,i)}else o.insertBefore(e,n),u(e,n);const d=a.getEdgeChildNodes(e.firstElementChild,e.lastElementChild);t.length>1?this.setRange(d.sc,0,d.ec,d.ec.textContent.length):this.setRange(d.ec,d.ec.textContent.length,d.ec,d.ec.textContent.length),this.history.push(!1)},detachRangeFormatElement:function(e,t,i,n,l){const r=this.getRange();let s=r.startOffset,c=r.endOffset,u=a.getListChildNodes(e,(function(t){return t.parentNode===e})),d=e.parentNode,h=null,p=null,f=e.cloneNode(!1);const g=[],m=a.isList(i);let v=!1,b=!1,y=!1;function w(t,i,n,o){if(a.onlyZeroWidthSpace(i)&&(i.innerHTML=a.zeroWidthSpace,s=c=1),3===i.nodeType)return t.insertBefore(i,n),i;const l=(y?i:o).childNodes;let r=i.cloneNode(!1),u=null,d=null;for(;l[0];)d=l[0],!a._notTextNode(d)||a.isBreak(d)||a.isListCell(r)?r.appendChild(d):(r.childNodes.length>0&&(u||(u=r),t.insertBefore(r,n),r=i.cloneNode(!1)),t.insertBefore(d,n),u||(u=d));if(r.childNodes.length>0){if(a.isListCell(t)&&a.isListCell(r)&&a.isList(n))if(m){for(u=n;n;)r.appendChild(n),n=n.nextSibling;t.parentNode.insertBefore(r,t.nextElementSibling)}else{const t=o.nextElementSibling,i=a.detachNestedList(o,!1);if(e!==i||t!==o.nextElementSibling){const t=r.childNodes;for(;t[0];)o.appendChild(t[0]);e=i,b=!0}}else t.insertBefore(r,n);u||(u=r)}return u}for(let l,r,s,c=0,_=u.length;c<_;c++)if(l=u[c],3!==l.nodeType||!a.isList(f))if(y=!1,n&&0===c&&(h=t&&t.length!==_&&t[0]!==l?f:e.previousSibling),t&&(r=t.indexOf(l)),t&&-1===r)f||(f=e.cloneNode(!1)),f.appendChild(l);else{if(t&&(s=t[r+1]),f&&f.children.length>0&&(d.insertBefore(f,e),f=null),!m&&a.isListCell(l))if(s&&a.getElementDepth(l)!==a.getElementDepth(s)&&(a.isListCell(d)||a.getArrayItem(l.children,a.isList,!1))){const t=l.nextElementSibling,i=a.detachNestedList(l,!1);e===i&&t===l.nextElementSibling||(e=i,b=!0)}else{const t=l;l=a.createElement(n?t.nodeName:a.isList(e.parentNode)||a.isListCell(e.parentNode)?"LI":a.isCell(e.parentNode)?"DIV":o.defaultTag);const i=a.isListCell(l),r=t.childNodes;for(;r[0]&&(!a.isList(r[0])||i);)l.appendChild(r[0]);a.copyFormatAttributes(l,t),y=!0}else l=l.cloneNode(!1);if(!b&&(n?(g.push(l),a.removeItem(u[c])):(i?(v||(d.insertBefore(i,e),v=!0),l=w(i,l,null,u[c])):l=w(d,l,e,u[c]),b||(t?(p=l,h||(h=l)):h||(h=p=l))),b)){b=y=!1,u=a.getListChildNodes(e,(function(t){return t.parentNode===e})),f=e.cloneNode(!1),d=e.parentNode,c=-1,_=u.length;continue}}const _=e.parentNode;let x=e.nextSibling;f&&f.children.length>0&&_.insertBefore(f,x),i?h=i.previousSibling:h||(h=e.previousSibling),x=e.nextSibling!==f?e.nextSibling:f?f.nextSibling:null,0===e.children.length||0===e.textContent.length?a.removeItem(e):a.removeEmptyNode(e,null,!1);let C=null;if(n)C={cc:_,sc:h,so:s,ec:x,eo:c,removeArray:g};else{h||(h=p),p||(p=h);const e=a.getEdgeChildNodes(h,p.parentNode?h:p);C={cc:(e.sc||e.ec).parentNode,sc:e.sc,so:s,ec:e.ec,eo:c,removeArray:null}}if(this.effectNode=null,l)return C;!n&&C&&(t?this.setRange(C.sc,s,C.ec,c):this.setRange(C.sc,0,C.sc,0)),this.history.push(!1)},detachList:function(e,t){let i={},n=!1,o=!1,l=null,r=null;const s=function(e){return!this.isComponent(e)}.bind(a);for(let c,u,d,h,p=0,f=e.length;p0)&&t,i=!!(i&&i.length>0)&&i;const l=!e,r=l&&!i&&!t;let c=o.startContainer,u=o.startOffset,d=o.endContainer,h=o.endOffset;if(r&&o.collapsed&&a.isFormatElement(c.parentNode)||c===d&&1===c.nodeType&&a.isNonEditable(c)){const e=c.parentNode;if(!a.isListCell(e)||!a.getValues(e.style).some(function(e){return this._listKebab.indexOf(e)>-1}.bind(this)))return}if(o.collapsed&&!r&&1===c.nodeType&&!a.isBreak(c)&&!a.isComponent(c)){let e=null;const t=c.childNodes[u];t&&(e=t.nextSibling?a.isBreak(t)?t:t.nextSibling:null);const i=a.createTextNode(a.zeroWidthSpace);c.insertBefore(i,e),this.setRange(i,1,i,1),o=this.getRange(),c=o.startContainer,u=o.startOffset,d=o.endContainer,h=o.endOffset}a.isFormatElement(c)&&(c=c.childNodes[u]||c.firstChild,u=0),a.isFormatElement(d)&&(d=d.childNodes[h]||d.lastChild,h=d.textContent.length),l&&(e=a.createElement("DIV"));const p=s.RegExp,f=e.nodeName;if(!r&&c===d&&!i&&e){let t=c,i=0;const n=[],o=e.style;for(let e=0,t=o.length;e0){for(;!a.isFormatElement(t)&&!a.isWysiwygDiv(t);){for(let o=0;o=n.length)return}}let g,m={},v={},b="",y="",w="";if(t){for(let e,i=0,n=t.length;i0&&(s=o.replace(b,"").trim(),s!==o&&(x.v=!0));const c=t.className;let u="";return y&&c.length>0&&(u=c.replace(y,"").trim(),u!==c&&(x.v=!0)),(!l||!y&&c||!b&&o||s||u||!i)&&(s||u||t.nodeName!==f||_(b)!==_(o)||_(y)!==_(c))?(b&&o.length>0&&(t.style.cssText=s),t.style.cssText||t.removeAttribute("style"),y&&c.length>0&&(t.className=u.trim()),t.className.trim()||t.removeAttribute("class"),t.style.cssText||t.className||t.nodeName!==f&&!i?t:(x.v=!0,null)):(x.v=!0,null)},k=this.getSelectedElements(null);o=this.getRange(),c=o.startContainer,u=o.startOffset,d=o.endContainer,h=o.endOffset,a.getFormatElement(c,null)||(c=a.getChildElement(k[0],(function(e){return 3===e.nodeType}),!1),u=0),a.getFormatElement(d,null)||(d=a.getChildElement(k[k.length-1],(function(e){return 3===e.nodeType}),!1),h=d.textContent.length);const S=a.getFormatElement(c,null)===a.getFormatElement(d,null),L=k.length-(S?0:1);g=e.cloneNode(!1);const E=r||l&&function(e){for(let t=0,i=e.length;t0&&this._resetCommonListCell(k[L],t)&&(i=!0),this._resetCommonListCell(k[0],t)&&(i=!0),i&&this.setRange(c,u,d,h),L>0&&(g=e.cloneNode(!1),v=this._nodeChange_endLine(k[L],g,C,d,h,r,l,x,N,z));for(let i,n=L-1;n>0;n--)this._resetCommonListCell(k[n],t),g=e.cloneNode(!1),i=this._nodeChange_middleLine(k[n],g,C,r,l,x,v.container),i.endContainer&&i.ancestor.contains(i.endContainer)&&(v.ancestor=null,v.container=i.endContainer),this._setCommonListStyle(i.ancestor,null);g=e.cloneNode(!1),m=this._nodeChange_startLine(k[0],g,C,c,u,r,l,x,N,z,v.container),m.endContainer&&(v.ancestor=null,v.container=m.endContainer),L<=0?v=m:v.container||(v.ancestor=null,v.container=m.container,v.offset=m.container.textContent.length),this._setCommonListStyle(m.ancestor,null),this._setCommonListStyle(v.ancestor||a.getFormatElement(v.container),null)}this.controllersOff(),this.setRange(m.container,m.offset,v.container,v.offset),this.history.push(!1)},_resetCommonListCell:function(e,t){if(!a.isListCell(e))return;t||(t=this._listKebab);const i=a.getArrayItem(e.childNodes,(function(e){return!a.isBreak(e)}),!0),n=e.style,l=[],r=[],s=a.getValues(n);for(let e=0,i=this._listKebab.length;e-1&&t.indexOf(this._listKebab[e])>-1&&(l.push(this._listCamel[e]),r.push(this._listKebab[e]));if(!l.length)return;const c=a.createElement("SPAN");for(let e=0,t=l.length;e0&&(e.insertBefore(u,d),u=c.cloneNode(!1),d=null,h=!0));return u.childNodes.length>0&&(e.insertBefore(u,d),h=!0),n.length||e.removeAttribute("style"),h},_setCommonListStyle:function(e,t){if(!a.isListCell(e))return;const i=a.getArrayItem((t||e).childNodes,(function(e){return!a.isBreak(e)}),!0);if(!(t=i[0])||i.length>1||1!==t.nodeType)return;const n=t.style,l=e.style,r=t.nodeName.toLowerCase();let s=!1;o._textTagsMap[r]===o._defaultCommand.bold.toLowerCase()&&(l.fontWeight="bold"),o._textTagsMap[r]===o._defaultCommand.italic.toLowerCase()&&(l.fontStyle="italic");const c=a.getValues(n);if(c.length>0)for(let e=0,t=this._listCamel.length;e-1&&(l[this._listCamel[e]]=n[this._listCamel[e]],n.removeProperty(this._listKebab[e]),s=!0);if(this._setCommonListStyle(e,t),s&&!n.length){const e=t.childNodes,i=t.parentNode,n=t.nextSibling;for(;e.length>0;)i.insertBefore(e[0],n);a.removeItem(t)}},_stripRemoveNode:function(e){const t=e.parentNode;if(!e||3===e.nodeType||!t)return;const i=e.childNodes;for(;i[0];)t.insertBefore(i[0],e);t.removeChild(e)},_util_getMaintainedNode:function(e,t,i){return!i||e?null:this.getParentElement(i,this._isMaintainedNode.bind(this))||(t?null:this.getParentElement(i,this._isSizeNode.bind(this)))},_util_isMaintainedNode:function(e,t,i){if(!i||e||1!==i.nodeType)return!1;const n=this._isMaintainedNode(i);return this.getParentElement(i,this._isMaintainedNode.bind(this))?n:n||!t&&this._isSizeNode(i)},_nodeChange_oneLine:function(e,t,i,n,o,l,r,c,u,d,h,p,f){let g=n.parentNode;for(;!(g.nextSibling||g.previousSibling||a.isFormatElement(g.parentNode)||a.isWysiwygDiv(g.parentNode))&&g.nodeName!==t.nodeName;)g=g.parentNode;if(!u&&g===l.parentNode&&g.nodeName===t.nodeName&&a.onlyZeroWidthSpace(n.textContent.slice(0,o))&&a.onlyZeroWidthSpace(l.textContent.slice(r))){const i=g.childNodes;let s=!0;for(let e,t,o,r,c=0,u=i.length;c0&&(i=t.test(e.style.cssText)),!i}if(function e(n,o){const l=n.childNodes;for(let n,r=0,s=l.length;r=L?T-L:S.data.length-L));if(k){const t=p(o);if(t&&t.parentNode!==e){let i=t,n=null;for(;i.parentNode!==e;){for(o=n=i.parentNode.cloneNode(!1);i.childNodes[0];)n.appendChild(i.childNodes[0]);i.appendChild(n),i=i.parentNode}i.parentNode.appendChild(t)}k=k.cloneNode(!1)}a.onlyZeroWidthSpace(l)||o.appendChild(l);const c=p(o);for(c&&(k=c),k&&(e=k),_=s,w=[],C="";_!==e&&_!==m&&null!==_;)n=f(_)?null:i(_),n&&1===_.nodeType&&M(_)&&(w.push(n),C+=_.style.cssText.substr(0,_.style.cssText.indexOf(":"))+"|"),_=_.parentNode;const u=w.pop()||r;for(x=_=u;w.length>0;)_=w.pop(),x.appendChild(_),x=_;if(t.appendChild(u),e.appendChild(t),k&&!p(E)&&(t=t.cloneNode(!1),b.appendChild(t),v.push(t)),S=r,L=0,N=!0,_!==r&&_.appendChild(S),!y)continue}if(z||s!==E){if(N){if(1===s.nodeType&&!a.isBreak(s)){a._isIgnoreNodeChange(s)?(b.appendChild(s.cloneNode(!0)),d||(t=t.cloneNode(!1),b.appendChild(t),v.push(t))):e(s,s);continue}_=s,w=[],C="";const l=[];for(;null!==_.parentNode&&_!==m&&_!==t;)n=z?_.cloneNode(!1):i(_),1===_.nodeType&&!a.isBreak(s)&&n&&M(_)&&(f(_)?k||l.push(n):w.push(n),C+=_.style.cssText.substr(0,_.style.cssText.indexOf(":"))+"|"),_=_.parentNode;w=w.concat(l);const r=w.pop()||s;for(x=_=r;w.length>0;)_=w.pop(),x.appendChild(_),x=_;if(!f(t.parentNode)||f(r)||a.onlyZeroWidthSpace(t)||(t=t.cloneNode(!1),b.appendChild(t),v.push(t)),z||k||!f(r))r===s?o=z?b:t:z?(b.appendChild(r),o=_):(t.appendChild(r),o=_);else{t=t.cloneNode(!1);const e=r.childNodes;for(let i=0,n=e.length;i0?_:t}if(k&&3===s.nodeType)if(p(s)){const e=a.getParentElement(o,function(e){return this._isMaintainedNode(e.parentNode)||e.parentNode===b}.bind(a));k.appendChild(e),t=e.cloneNode(!1),v.push(t),b.appendChild(t)}else k=null}u=s.cloneNode(!1),o.appendChild(u),1!==s.nodeType||a.isBreak(s)||(h=u),e(s,h)}else{k=p(s);const e=a.createTextNode(1===E.nodeType?"":E.substringData(T,E.length-T)),o=a.createTextNode(y||1===E.nodeType?"":E.substringData(0,T));if(k?k=k.cloneNode(!1):f(t.parentNode)&&!k&&(t=t.cloneNode(!1),b.appendChild(t),v.push(t)),!a.onlyZeroWidthSpace(e)){_=s,C="",w=[];const t=[];for(;_!==b&&_!==m&&null!==_;)1===_.nodeType&&M(_)&&(f(_)?t.push(_.cloneNode(!1)):w.push(_.cloneNode(!1)),C+=_.style.cssText.substr(0,_.style.cssText.indexOf(":"))+"|"),_=_.parentNode;for(w=w.concat(t),u=x=_=w.pop()||e;w.length>0;)_=w.pop(),x.appendChild(_),x=_;b.appendChild(u),_.textContent=e.data}if(k&&u){const e=p(u);e&&(k=e)}for(_=s,w=[],C="";_!==b&&_!==m&&null!==_;)n=f(_)?null:i(_),n&&1===_.nodeType&&M(_)&&(w.push(n),C+=_.style.cssText.substr(0,_.style.cssText.indexOf(":"))+"|"),_=_.parentNode;const l=w.pop()||o;for(x=_=l;w.length>0;)_=w.pop(),x.appendChild(_),x=_;k?((t=t.cloneNode(!1)).appendChild(l),k.insertBefore(t,k.firstChild),b.appendChild(k),v.push(t),k=null):t.appendChild(l),E=o,T=o.data.length,z=!0,!c&&d&&(t=o,o.textContent=a.zeroWidthSpace),_!==o&&_.appendChild(E)}}}(e,b),u&&!c&&!h.v)return{ancestor:e,startContainer:n,startOffset:o,endContainer:l,endOffset:r};if(c=c&&u)for(let e=0;e0,w=m.pop()||h;for(b=v=w;m.length>0;)v=m.pop(),b.appendChild(v),b=v;if(u(t.parentNode)&&!u(w)&&(t=t.cloneNode(!1),g.appendChild(t),f.push(t)),!y&&u(w)){t=t.cloneNode(!1);const e=w.childNodes;for(let i=0,n=e.length;i0;)v=m.pop(),b.appendChild(v),b=v;u!==o?(t.appendChild(u),o=v):o=t,a.isBreak(h)&&t.appendChild(h.cloneNode(!1)),e.appendChild(t),w=r,_=0,x=!0,o.appendChild(w)}}}(e,g),r&&!l&&!s.v)return{ancestor:e,container:n,offset:o,endContainer:d};if(l=l&&r)for(let e=0;e0&&u===d)return e.innerHTML=n.innerHTML,{ancestor:e,endContainer:i?a.getNodeFromPath(i,e):null}}l.v=!1;const s=e.cloneNode(!1),c=[t];let u=!0;if(function e(n,o){const l=n.childNodes;for(let n,d,h=0,p=l.length;h0&&(s.appendChild(t),t=t.cloneNode(!1)),d=p.cloneNode(!0),s.appendChild(d),s.appendChild(t),c.push(t),o=t,r&&p.contains(r)){const e=a.getNodePath(r,p);r=a.getNodeFromPath(e,d)}}}(e,t),u||o&&!n&&!l.v)return{ancestor:e,endContainer:r};if(s.appendChild(t),n&&o)for(let e=0;e0,d=g.pop()||s;for(v=m=d;g.length>0;)m=g.pop(),v.appendChild(m),v=m;if(u(t.parentNode)&&!u(d)&&(t=t.cloneNode(!1),f.insertBefore(t,f.firstChild),p.push(t)),!b&&u(d)){t=t.cloneNode(!1);const e=d.childNodes;for(let i=0,n=e.length;i0?m:t}else r?(t.insertBefore(d,t.firstChild),o=m):o=t;if(b&&3===s.nodeType)if(c(s)){const e=a.getParentElement(o,function(e){return this._isMaintainedNode(e.parentNode)||e.parentNode===f}.bind(a));b.appendChild(e),t=e.cloneNode(!1),p.push(t),f.insertBefore(t,f.firstChild)}else b=null}if(_||s!==y)n=_?i(s):s.cloneNode(!1),n&&(o.insertBefore(n,o.firstChild),1!==s.nodeType||a.isBreak(s)||(d=n)),e(s,d);else{b=c(s);const e=a.createTextNode(1===y.nodeType?"":y.substringData(w,y.length-w)),l=a.createTextNode(1===y.nodeType?"":y.substringData(0,w));if(b){b=b.cloneNode(!1);const e=c(o);if(e&&e.parentNode!==f){let t=e,i=null;for(;t.parentNode!==f;){for(o=i=t.parentNode.cloneNode(!1);t.childNodes[0];)i.appendChild(t.childNodes[0]);t.appendChild(i),t=t.parentNode}t.parentNode.insertBefore(e,t.parentNode.firstChild)}b=b.cloneNode(!1)}else u(t.parentNode)&&!b&&(t=t.cloneNode(!1),f.appendChild(t),p.push(t));for(a.onlyZeroWidthSpace(e)||o.insertBefore(e,o.firstChild),m=o,g=[];m!==f&&null!==m;)n=u(m)?null:i(m),n&&1===m.nodeType&&g.push(n),m=m.parentNode;const r=g.pop()||o;for(v=m=r;g.length>0;)m=g.pop(),v.appendChild(m),v=m;r!==o?(t.insertBefore(r,t.firstChild),o=m):o=t,a.isBreak(s)&&t.appendChild(s.cloneNode(!1)),b?(b.insertBefore(t,b.firstChild),f.insertBefore(b,f.firstChild),b=null):f.insertBefore(t,f.firstChild),y=l,w=l.data.length,_=!0,o.insertBefore(y,o.firstChild)}}}(e,f),r&&!l&&!s.v)return{ancestor:e,container:n,offset:o};if(l=l&&r)for(let e=0;e-1?null:a.createElement(i);let u=i;/^SUB$/i.test(i)&&s.indexOf("SUP")>-1?u="SUP":/^SUP$/i.test(i)&&s.indexOf("SUB")>-1&&(u="SUB"),this.nodeChange(c,this._commandMapStyles[i]||null,[u],!1),this.focus()}},removeFormat:function(){this.nodeChange(null,null,null,null)},indent:function(e){const t=this.getRange(),i=this.getSelectedElements(null),n=[],l="indent"!==e,r=o.rtl?"marginRight":"marginLeft";let s=t.startContainer,c=t.endContainer,u=t.startOffset,d=t.endOffset;for(let e,t,o=0,s=i.length;o0&&this.plugins.list.editInsideList.call(this,l,n),this.effectNode=null,this.setRange(s,u,c,d),this.history.push(!1)},toggleDisplayBlocks:function(){const t=e.element.wysiwyg;a.toggleClass(t,"se-show-block"),a.hasClass(t,"se-show-block")?a.addClass(this._styleCommandMap.showBlocks,"active"):a.removeClass(this._styleCommandMap.showBlocks,"active"),this._resourcesStateChange()},toggleCodeView:function(){const t=this._variable.isCodeView;this.controllersOff(),a.setDisabledButtons(!t,this.codeViewDisabledButtons),t?(a.isNonEditable(e.element.wysiwygFrame)||this._setCodeDataToEditor(),e.element.wysiwygFrame.scrollTop=0,e.element.code.style.display="none",e.element.wysiwygFrame.style.display="block",this._variable._codeOriginCssText=this._variable._codeOriginCssText.replace(/(\s?display(\s+)?:(\s+)?)[a-zA-Z]+(?=;)/,"display: none"),this._variable._wysiwygOriginCssText=this._variable._wysiwygOriginCssText.replace(/(\s?display(\s+)?:(\s+)?)[a-zA-Z]+(?=;)/,"display: block"),"auto"!==o.height||o.codeMirrorEditor||(e.element.code.style.height="0px"),this._variable.isCodeView=!1,this._variable.isFullScreen||(this._notHideToolbar=!1,/balloon|balloon-always/i.test(o.mode)&&(e.element._arrow.style.display="",this._isInline=!1,this._isBalloon=!0,d._hideToolbar())),this.nativeFocus(),a.removeClass(this._styleCommandMap.codeView,"active"),a.isNonEditable(e.element.wysiwygFrame)||(this.history.push(!1),this.history._resetCachingButton())):(this._setEditorDataToCodeView(),this._variable._codeOriginCssText=this._variable._codeOriginCssText.replace(/(\s?display(\s+)?:(\s+)?)[a-zA-Z]+(?=;)/,"display: block"),this._variable._wysiwygOriginCssText=this._variable._wysiwygOriginCssText.replace(/(\s?display(\s+)?:(\s+)?)[a-zA-Z]+(?=;)/,"display: none"),this._variable.isFullScreen?e.element.code.style.height="100%":"auto"!==o.height||o.codeMirrorEditor||(e.element.code.style.height=e.element.code.scrollHeight>0?e.element.code.scrollHeight+"px":"auto"),o.codeMirrorEditor&&o.codeMirrorEditor.refresh(),this._variable.isCodeView=!0,this._variable.isFullScreen||(this._notHideToolbar=!0,this._isBalloon&&(e.element._arrow.style.display="none",e.element.toolbar.style.left="",this._isInline=!0,this._isBalloon=!1,d._showToolbarInline())),this._variable._range=null,e.element.code.focus(),a.addClass(this._styleCommandMap.codeView,"active")),this._checkPlaceholder(),this.isReadOnly&&a.setDisabledButtons(!0,this.resizingDisabledButtons),"function"==typeof h.toggleCodeView&&h.toggleCodeView(this._variable.isCodeView,this)},_setCodeDataToEditor:function(){const t=this._getCodeView();if(o.fullPage){const e=this._parser.parseFromString(t,"text/html");if(!this.options.__allowedScriptTag){const t=e.head.children;for(let i=0,n=t.length;i0?this.convertContentsForEditor(t):"<"+o.defaultTag+">
"},_setEditorDataToCodeView:function(){const t=this.convertHTMLForCodeView(e.element.wysiwyg,!1);let i="";if(o.fullPage){const e=a.getAttributesToString(this._wd.body,null);i="\n\n"+this._wd.head.outerHTML.replace(/>(?!\n)/g,">\n")+"\n"+t+"\n"}else i=t;e.element.code.style.display="block",e.element.wysiwygFrame.style.display="none",this._setCodeView(i)},toggleFullScreen:function(t){const i=e.element.topArea,n=e.element.toolbar,l=e.element.editorArea,u=e.element.wysiwygFrame,p=e.element.code,f=this._variable;this.controllersOff();const g="none"===n.style.display||this._isInline&&!this._inlineToolbarAttr.isShow;f.isFullScreen?(f.isFullScreen=!1,u.style.cssText=f._wysiwygOriginCssText,p.style.cssText=f._codeOriginCssText,n.style.cssText="",l.style.cssText=f._editorAreaOriginCssText,i.style.cssText=f._originCssText,r.body.style.overflow=f._bodyOverflow,"auto"!==o.height||o.codeMirrorEditor||d._codeViewAutoHeight(),o.toolbarContainer&&o.toolbarContainer.appendChild(n),o.stickyToolbar>-1&&a.removeClass(n,"se-toolbar-sticky"),f._fullScreenAttrs.sticky&&!o.toolbarContainer&&(f._fullScreenAttrs.sticky=!1,e.element._stickyDummy.style.display="block",a.addClass(n,"se-toolbar-sticky")),this._isInline=f._fullScreenAttrs.inline,this._isBalloon=f._fullScreenAttrs.balloon,this._isInline&&d._showToolbarInline(),o.toolbarContainer&&a.removeClass(n,"se-toolbar-balloon"),d.onScroll_window(),t&&a.changeElement(t.firstElementChild,c.expansion),e.element.topArea.style.marginTop="",a.removeClass(this._styleCommandMap.fullScreen,"active")):(f.isFullScreen=!0,f._fullScreenAttrs.inline=this._isInline,f._fullScreenAttrs.balloon=this._isBalloon,(this._isInline||this._isBalloon)&&(this._isInline=!1,this._isBalloon=!1),o.toolbarContainer&&e.element.relative.insertBefore(n,l),i.style.position="fixed",i.style.top="0",i.style.left="0",i.style.width="100%",i.style.maxWidth="100%",i.style.height="100%",i.style.zIndex="2147483647",""!==e.element._stickyDummy.style.display&&(f._fullScreenAttrs.sticky=!0,e.element._stickyDummy.style.display="none",a.removeClass(n,"se-toolbar-sticky")),f._bodyOverflow=r.body.style.overflow,r.body.style.overflow="hidden",f._editorAreaOriginCssText=l.style.cssText,f._wysiwygOriginCssText=u.style.cssText,f._codeOriginCssText=p.style.cssText,l.style.cssText=n.style.cssText="",u.style.cssText=(u.style.cssText.match(/\s?display(\s+)?:(\s+)?[a-zA-Z]+;/)||[""])[0]+o._editorStyles.editor,p.style.cssText=(p.style.cssText.match(/\s?display(\s+)?:(\s+)?[a-zA-Z]+;/)||[""])[0],n.style.width=u.style.height=p.style.height="100%",n.style.position="relative",n.style.display="block",f.innerHeight_fullScreen=s.innerHeight-n.offsetHeight,l.style.height=f.innerHeight_fullScreen-o.fullScreenOffset+"px",t&&a.changeElement(t.firstElementChild,c.reduction),o.iframe&&"auto"===o.height&&(l.style.overflow="auto",this._iframeAutoHeight()),e.element.topArea.style.marginTop=o.fullScreenOffset+"px",a.addClass(this._styleCommandMap.fullScreen,"active")),g&&h.toolbar.hide(),"function"==typeof h.toggleFullScreen&&h.toggleFullScreen(this._variable.isFullScreen,this)},print:function(){const e=a.createElement("IFRAME");e.style.display="none",r.body.appendChild(e);const t=o.printTemplate?o.printTemplate.replace(/\{\{\s*contents\s*\}\}/i,this.getContents(!0)):this.getContents(!0),i=a.getIframeDocument(e),n=this._wd;if(o.iframe){const e=null!==o._printClass?'class="'+o._printClass+'"':o.fullPage?a.getAttributesToString(n.body,["contenteditable"]):'class="'+o._editableClass+'"';i.write(""+n.head.innerHTML+""+t+"")}else{const e=r.head.getElementsByTagName("link"),n=r.head.getElementsByTagName("style");let l="";for(let t=0,i=e.length;t"+l+''+t+"")}this.showLoading(),s.setTimeout((function(){try{if(e.focus(),a.isIE_Edge||a.isChromium||r.documentMode||s.StyleMedia)try{e.contentWindow.document.execCommand("print",!1,null)}catch(t){e.contentWindow.print()}else e.contentWindow.print()}catch(e){throw Error("[SUNEDITOR.core.print.fail] error: "+e)}finally{u.closeLoading(),a.removeItem(e)}}),1e3)},preview:function(){u.submenuOff(),u.containerOff(),u.controllersOff();const e=o.previewTemplate?o.previewTemplate.replace(/\{\{\s*contents\s*\}\}/i,this.getContents(!0)):this.getContents(!0),t=s.open("","_blank");t.mimeType="text/html";const i=this._wd;if(o.iframe){const n=null!==o._printClass?'class="'+o._printClass+'"':o.fullPage?a.getAttributesToString(i.body,["contenteditable"]):'class="'+o._editableClass+'"';t.document.write(""+i.head.innerHTML+""+e+"")}else{const i=r.head.getElementsByTagName("link"),l=r.head.getElementsByTagName("style");let s="";for(let e=0,t=i.length;e'+n.toolbar.preview+""+s+''+e+"")}},setDir:function(t){const i="rtl"===t,l=this._prevRtl!==i;this._prevRtl=o.rtl=i,l&&(this.plugins.align&&this.plugins.align.exchangeDir.call(this),e.tool.indent&&a.changeElement(e.tool.indent.firstElementChild,c.indent),e.tool.outdent&&a.changeElement(e.tool.outdent.firstElementChild,c.outdent));const r=e.element;i?(a.addClass(r.topArea,"se-rtl"),a.addClass(r.wysiwygFrame,"se-rtl")):(a.removeClass(r.topArea,"se-rtl"),a.removeClass(r.wysiwygFrame,"se-rtl"));const s=a.getListChildren(r.wysiwyg,(function(e){return a.isFormatElement(e)&&(e.style.marginRight||e.style.marginLeft||e.style.textAlign)}));for(let e,t,i,n=0,o=s.length;n"+this._wd.head.outerHTML+""+n.innerHTML+""}return n.innerHTML},getFullContents:function(e){return'
'+this.getContents(e)+"
"},_makeLine:function(e,t){const i=o.defaultTag;if(1===e.nodeType){if(this.__disallowedTagNameRegExp.test(e.nodeName))return"";if(/__se__tag/.test(e.className))return e.outerHTML;const n=a.getListChildNodes(e,(function(e){return a.isSpanWithoutAttr(e)&&!a.getParentElement(e,a.isNotCheckingNode)}))||[];for(let e=n.length-1;e>=0;e--)n[e].outerHTML=n[e].innerHTML;return!t||a.isFormatElement(e)||a.isRangeFormatElement(e)||a.isComponent(e)||a.isMedia(e)||a.isAnchor(e)&&a.isMedia(e.firstElementChild)?a.isSpanWithoutAttr(e)?e.innerHTML:e.outerHTML:"<"+i+">"+(a.isSpanWithoutAttr(e)?e.innerHTML:e.outerHTML)+""}if(3===e.nodeType){if(!t)return a._HTMLConvertor(e.textContent);const n=e.textContent.split(/\n/g);let o="";for(let e,t=0,l=n.length;t0&&(o+="<"+i+">"+a._HTMLConvertor(e)+"");return o}return 8===e.nodeType&&this._allowHTMLComments?"\x3c!--"+e.textContent.trim()+"--\x3e":""},_tagConvertor:function(e){if(!this._disallowedTextTagsRegExp)return e;const t=o._textTagsMap;return e.replace(this._disallowedTextTagsRegExp,(function(e,i,n,o){return i+("string"==typeof t[n]?t[n]:n)+(o?" "+o:"")}))},_deleteDisallowedTags:function(e){return e=e.replace(this.__disallowedTagsRegExp,"").replace(/<[a-z0-9]+\:[a-z0-9]+[^>^\/]*>[^>]*<\/[a-z0-9]+\:[a-z0-9]+>/gi,""),/\bfont\b/i.test(this.options._editorTagsWhitelist)||(e=e.replace(/(<\/?)font(\s?)/gi,"$1span$2")),e.replace(this.editorTagsWhitelistRegExp,"").replace(this.editorTagsBlacklistRegExp,"")},_convertFontSize:function(e,t){const i=this._w.Math,n=t.match(/(\d+(?:\.\d+)?)(.+)/),o=n?1*n[1]:a.fontValueMap[t],l=n?n[2]:"rem";let r=o;switch(/em/.test(l)?r=i.round(o/.0625):"pt"===l?r=i.round(1.333*o):"%"===l&&(r=o/100),e){case"em":case"rem":case"%":return(.0625*r).toFixed(2)+e;case"pt":return i.floor(r/1.333)+e;default:return r+e}},_cleanStyle:function(e,t,i){let n=(e.match(/style\s*=\s*(?:"|')[^"']*(?:"|')/)||[])[0];if(/span/i.test(i)&&!n&&(e.match(/0&&t.push('style="'+i.join(";")+'"')}}return t},_cleanTags:function(e,t,i){if(/^<[a-z0-9]+\:[a-z0-9]+/i.test(t))return t;let n=null;const o=i.match(/(?!<)[a-zA-Z0-9\-]+/)[0].toLowerCase(),l=this._attributesTagsBlacklist[o];t=t.replace(/\s(?:on[a-z]+)\s*=\s*(")[^"]*\1/gi,""),t=l?t.replace(l,""):t.replace(this._attributesBlacklistRegExp,"");const r=this._attributesTagsWhitelist[o];if(n=r?t.match(r):t.match(e?this._attributesWhitelistRegExp:this._attributesWhitelistRegExp_all_data),e||"span"===o)if("a"===o){const e=t.match(/(?:(?:id|name)\s*=\s*(?:"|')[^"']*(?:"|'))/g);e&&(n||(n=[]),n.push(e[0]))}else n&&/style=/i.test(n.toString())||("span"===o?n=this._cleanStyle(t,n,"span"):/^(P|DIV|H[1-6]|PRE)$/i.test(o)&&(n=this._cleanStyle(t,n,"format")));else{const e=t.match(/style\s*=\s*(?:"|')[^"']*(?:"|')/);e&&!n?n=[e[0]]:e&&!n.some((function(e){return/^style/.test(e.trim())}))&&n.push(e[0])}if(a.isFigures(o)){const e=t.match(/style\s*=\s*(?:"|')[^"']*(?:"|')/);n||(n=[]),e&&n.push(e[0])}if(n)for(let e,t=0,o=n.length;t"+(i.innerHTML.trim()||"
")+"":a.isRangeFormatElement(i)&&!a.isTable(i)?t+=this._convertListCell(i):t+="
  • "+i.outerHTML+"
  • ":t+="
  • "+(i.textContent||"
    ")+"
  • ";return t},_isFormatData:function(e){let t=!1;for(let i,n=0,o=e.length;n]*(?=>)/g,this._cleanTags.bind(this,!0)).replace(/$/i,"");const n=r.createRange().createContextualFragment(e);try{a._consistencyCheckOfHTML(n,this._htmlCheckWhitelistRegExp,this._htmlCheckBlacklistRegExp,this._classNameFilter)}catch(e){console.warn("[SUNEDITOR.cleanHTML.consistencyCheck.fail] "+e)}if(this.managedTagsInfo&&this.managedTagsInfo.query){const e=n.querySelectorAll(this.managedTagsInfo.query);for(let t,i,n=0,o=e.length;n]*(?=>)/g,this._cleanTags.bind(this,!0));const t=r.createRange().createContextualFragment(e);try{a._consistencyCheckOfHTML(t,this._htmlCheckWhitelistRegExp,this._htmlCheckBlacklistRegExp,this._classNameFilter)}catch(e){console.warn("[SUNEDITOR.convertContentsForEditor.consistencyCheck.fail] "+e)}if(this.managedTagsInfo&&this.managedTagsInfo.query){const e=t.querySelectorAll(this.managedTagsInfo.query);for(let t,i,n=0,o=e.length;n
    ":(n=a.htmlRemoveWhiteSpace(n),this._tagConvertor(n))},convertHTMLForCodeView:function(e,t){let i="";const n=s.RegExp,o=new n("^(BLOCKQUOTE|PRE|TABLE|THEAD|TBODY|TR|TH|TD|OL|UL|IMG|IFRAME|VIDEO|AUDIO|FIGURE|FIGCAPTION|HR|BR|CANVAS|SELECT)$","i"),l="string"==typeof e?r.createRange().createContextualFragment(e):e,c=function(e){return this.isFormatElement(e)||this.isComponent(e)}.bind(a),u=t?"":"\n";let d=t?0:1*this._variable.codeIndent;return d=d>0?new s.Array(d+1).join(" "):"",function e(t,l){const r=t.childNodes,h=o.test(t.nodeName),p=h?l:"";for(let f,g,m,v,b,y,w=0,_=r.length;w<_;w++)f=r[w],v=o.test(f.nodeName),g=v?u:"",m=!c(f)||h||/^(TH|TD)$/i.test(t.nodeName)?"":u,8!==f.nodeType?3!==f.nodeType?0!==f.childNodes.length?f.outerHTML?(b=f.nodeName.toLowerCase(),y=p||v?l:"",i+=(m||(h?"":g))+y+f.outerHTML.match(n("<"+b+"[^>]*>","i"))[0]+g,e(f,l+d),i+=(/\n$/.test(i)?y:"")+""+(m||g||h||/^(TH|TD)$/i.test(f.nodeName)?u:"")):i+=(new s.XMLSerializer).serializeToString(f):i+=(/^HR$/i.test(f.nodeName)?u:"")+(/^PRE$/i.test(f.parentElement.nodeName)&&/^BR$/i.test(f.nodeName)?"":p)+f.outerHTML+g:a.isList(f.parentElement)||(i+=a._HTMLConvertor(/^\n+$/.test(f.data)?"":f.data)):i+="\n\x3c!-- "+f.textContent.trim()+" --\x3e"+g}(l,""),i.trim()+u},addDocEvent:function(e,t,i){r.addEventListener(e,t,i),o.iframe&&this._wd.addEventListener(e,t)},removeDocEvent:function(e,t){r.removeEventListener(e,t),o.iframe&&this._wd.removeEventListener(e,t)},_charCount:function(e){const t=o.maxCharCount,i=o.charCounterType;let n=0;if(e&&(n=this.getCharLength(e,i)),this._setCharCount(),t>0){let e=!1;const o=h.getCharCount(i);if(o>t){if(e=!0,n>0){this._editorRange();const e=this.getRange(),i=e.endOffset-1,n=this.getSelectionNode().textContent,l=e.endOffset-(o-t);this.getSelectionNode().textContent=n.slice(0,l<0?0:l)+n.slice(e.endOffset,n.length),this.setRange(e.endContainer,i,e.endContainer,i)}}else o+n>t&&(e=!0);if(e&&(this._callCounterBlink(),n>0))return!1}return!0},checkCharCount:function(e,t){if(o.maxCharCount){const i=t||o.charCounterType,n=this.getCharLength("string"==typeof e?e:this._charTypeHTML&&1===e.nodeType?e.outerHTML:e.textContent,i);if(n>0&&n+h.getCharCount(i)>o.maxCharCount)return this._callCounterBlink(),!1}return!0},getCharLength:function(e,t){return/byte/.test(t)?a.getByteLength(e):e.length},resetResponsiveToolbar:function(){u.controllersOff();const t=d._responsiveButtonSize;if(t){let i=0;i=(u._isBalloon||u._isInline)&&"auto"===o.toolbarWidth?e.element.topArea.offsetWidth:e.element.toolbar.offsetWidth;let n="default";for(let e=1,o=t.length;e-1||!a.hasOwn(t,o)||(n.indexOf(o)>-1?i[o].active.call(this,null):t.OUTDENT&&/^OUTDENT$/i.test(o)?a.isImportantDisabled(t.OUTDENT)||t.OUTDENT.setAttribute("disabled",!0):t.INDENT&&/^INDENT$/i.test(o)?a.isImportantDisabled(t.INDENT)||t.INDENT.removeAttribute("disabled"):a.removeClass(t[o],"active"))},_init:function(n,l){const c=s.RegExp;this._ww=o.iframe?e.element.wysiwygFrame.contentWindow:s,this._wd=r,this._charTypeHTML="byte-html"===o.charCounterType,this.wwComputedStyle=s.getComputedStyle(e.element.wysiwyg),this._editorHeight=e.element.wysiwygFrame.offsetHeight,this._editorHeightPadding=a.getNumber(this.wwComputedStyle.getPropertyValue("padding-top"))+a.getNumber(this.wwComputedStyle.getPropertyValue("padding-bottom")),this._classNameFilter=function(e){return this.test(e)?e:""}.bind(o.allowedClassNames);const u=o.__allowedScriptTag?"":"script|";if(this.__scriptTagRegExp=new c("<(script)[^>]*>([\\s\\S]*?)<\\/\\1>|]*\\/?>","gi"),this.__disallowedTagsRegExp=new c("<("+u+"style)[^>]*>([\\s\\S]*?)<\\/\\1>|<("+u+"style)[^>]*\\/?>","gi"),this.__disallowedTagNameRegExp=new c("^("+u+"meta|link|style|[a-z]+:[a-z]+)$","i"),this.__allowedScriptRegExp=new c("^"+(o.__allowedScriptTag?"script":"")+"$","i"),!o.iframe&&"function"==typeof s.ShadowRoot){let t=e.element.wysiwygFrame;for(;t;){if(t.shadowRoot){this._shadowRoot=t.shadowRoot;break}if(t instanceof s.ShadowRoot){this._shadowRoot=t;break}t=t.parentNode}this._shadowRoot&&(this._shadowRootControllerEventTarget=[])}const d=s.Object.keys(o._textTagsMap),h=o.addTagsWhitelist?o.addTagsWhitelist.split("|").filter((function(e){return/b|i|ins|s|strike/i.test(e)})):[];for(let e=0;e^<]+)?\\s*(?=>)","gi");const p=function(e,t){return e?"*"===e?"[a-z-]+":t?e+"|"+t:e:"^"},f="contenteditable|colspan|rowspan|target|href|download|rel|src|alt|class|type|controls|origin-size";this._allowHTMLComments=o._editorTagsWhitelist.indexOf("//")>-1||"*"===o._editorTagsWhitelist,this._htmlCheckWhitelistRegExp=new c("^("+p(o._editorTagsWhitelist.replace("|//",""),"")+")$","i"),this._htmlCheckBlacklistRegExp=new c("^("+(o.tagsBlacklist||"^")+")$","i"),this.editorTagsWhitelistRegExp=a.createTagsWhitelist(p(o._editorTagsWhitelist.replace("|//","|\x3c!--|--\x3e"),"")),this.editorTagsBlacklistRegExp=a.createTagsBlacklist(o.tagsBlacklist.replace("|//","|\x3c!--|--\x3e")),this.pasteTagsWhitelistRegExp=a.createTagsWhitelist(p(o.pasteTagsWhitelist,"")),this.pasteTagsBlacklistRegExp=a.createTagsBlacklist(o.pasteTagsBlacklist);const g='\\s*=\\s*(")[^"]*\\1',m=o.attributesWhitelist;let v={},b="";if(m)for(let e in m)a.hasOwn(m,e)&&!/^on[a-z]+$/i.test(m[e])&&("all"===e?b=p(m[e],f):v[e]=new c("\\s(?:"+p(m[e],"")+")"+g,"ig"));this._attributesWhitelistRegExp=new c("\\s(?:"+(b||f+"|data-format|data-size|data-file-size|data-file-name|data-origin|data-align|data-image-link|data-rotate|data-proportion|data-percentage|data-exp|data-font-size")+")"+g,"ig"),this._attributesWhitelistRegExp_all_data=new c("\\s(?:"+(b||f)+"|data-[a-z0-9\\-]+)"+g,"ig"),this._attributesTagsWhitelist=v;const y=o.attributesBlacklist;if(v={},b="",y)for(let e in y)a.hasOwn(y,e)&&("all"===e?b=p(y[e],""):v[e]=new c("\\s(?:"+p(y[e],"")+")"+g,"ig"));this._attributesBlacklistRegExp=new c("\\s(?:"+(b||"^")+")"+g,"ig"),this._attributesTagsBlacklist=v,this._isInline=/inline/i.test(o.mode),this._isBalloon=/balloon|balloon-always/i.test(o.mode),this._isBalloonAlways=/balloon-always/i.test(o.mode),this._cachingButtons(),this._fileInfoPluginsCheck=[],this._fileInfoPluginsReset=[],this.managedTagsInfo={query:"",map:{}};const w=[];this.activePlugins=[],this._fileManager.tags=[],this._fileManager.pluginMap={};let _,x,C=[];for(let e in i)if(a.hasOwn(i,e)){if(_=i[e],x=t[e],(_.active||_.action)&&x&&this.callPlugin(e,null,x),"function"==typeof _.checkFileInfo&&"function"==typeof _.resetFileInfo&&(this.callPlugin(e,null,x),this._fileInfoPluginsCheck.push(_.checkFileInfo.bind(this)),this._fileInfoPluginsReset.push(_.resetFileInfo.bind(this))),s.Array.isArray(_.fileTags)){const t=_.fileTags;this.callPlugin(e,null,x),this._fileManager.tags=this._fileManager.tags.concat(t),C.push(e);for(let i=0,n=t.length;ic&&(u=u.slice(0,c),s&&s.setAttribute("disabled",!0)),u[c]=o?{contents:i,s:{path:n.getNodePath(o.startContainer,null,null),offset:o.startOffset},e:{path:n.getNodePath(o.endContainer,null,null),offset:o.endOffset}}:{contents:i,s:{path:[0,0],offset:[0,0]},e:{path:0,offset:0}},1===c&&r&&r.removeAttribute("disabled"),e._setCharCount(),t()}return{stack:u,push:function(t){i.setTimeout(e._resourcesStateChange.bind(e));const n="number"==typeof t?t>0?t:0:t?o:0;n&&!a||(i.clearTimeout(a),n)?a=i.setTimeout((function(){i.clearTimeout(a),a=null,h()}),n):h()},undo:function(){c>0&&(c--,d())},redo:function(){u.length-1>c&&(c++,d())},go:function(e){c=e<0?u.length-1:e,d()},getCurrentIndex:function(){return c},reset:function(i){r&&r.setAttribute("disabled",!0),s&&s.setAttribute("disabled",!0),e._variable.isChanged=!1,e.context.tool.save&&e.context.tool.save.setAttribute("disabled",!0),u.splice(0),c=0,u[c]={contents:e.getContents(!0),s:{path:[0,0],offset:0},e:{path:[0,0],offset:0}},i||t()},_resetCachingButton:function(){l=e.context.element,r=e.context.tool.undo,s=e.context.tool.redo,0===c?(r&&r.setAttribute("disabled",!0),s&&c===u.length-1&&s.setAttribute("disabled",!0),e._variable.isChanged=!1,e.context.tool.save&&e.context.tool.save.setAttribute("disabled",!0)):c===u.length-1&&s&&s.setAttribute("disabled",!0)},_destroy:function(){a&&i.clearTimeout(a),u=null}}}(this,this._onChange_historyStack.bind(this)),this.addModule([X]),o.iframe&&(this._wd=e.element.wysiwygFrame.contentDocument,e.element.wysiwyg=this._wd.body,o._editorStyles.editor&&(e.element.wysiwyg.style.cssText=o._editorStyles.editor),"auto"===o.height&&(this._iframeAuto=this._wd.body)),this._initWysiwygArea(n,l)},_cachingButtons:function(){this.codeViewDisabledButtons=e.element._buttonTray.querySelectorAll('.se-menu-list button[data-display]:not([class~="se-code-view-enabled"]):not([data-display="MORE"])'),this.resizingDisabledButtons=e.element._buttonTray.querySelectorAll('.se-menu-list button[data-display]:not([class~="se-resizing-enabled"]):not([data-display="MORE"])');const t=e.tool,i=this.commandMap;i.INDENT=t.indent,i.OUTDENT=t.outdent,i[o.textTags.bold.toUpperCase()]=t.bold,i[o.textTags.underline.toUpperCase()]=t.underline,i[o.textTags.italic.toUpperCase()]=t.italic,i[o.textTags.strike.toUpperCase()]=t.strike,i[o.textTags.sub.toUpperCase()]=t.subscript,i[o.textTags.sup.toUpperCase()]=t.superscript,this._styleCommandMap={fullScreen:t.fullScreen,showBlocks:t.showBlocks,codeView:t.codeView},this._saveButtonStates()},_initWysiwygArea:function(t,i){e.element.wysiwyg.innerHTML=t?i:this.convertContentsForEditor(("string"==typeof i?i:/^TEXTAREA$/i.test(e.element.originElement.nodeName)?e.element.originElement.value:e.element.originElement.innerHTML)||"")},_resourcesStateChange:function(){this._iframeAutoHeight(),this._checkPlaceholder()},_onChange_historyStack:function(){this.hasFocus&&d._applyTagEffects(),this._variable.isChanged=!0,e.tool.save&&e.tool.save.removeAttribute("disabled"),h.onChange&&h.onChange(this.getContents(!0),this),"block"===e.element.toolbar.style.display&&d._showToolbarBalloon()},_iframeAutoHeight:function(){this._iframeAuto?s.setTimeout((function(){const t=u._iframeAuto.offsetHeight;e.element.wysiwygFrame.style.height=t+"px",a.isResizeObserverSupported||u.__callResizeFunction(t,null)})):a.isResizeObserverSupported||u.__callResizeFunction(e.element.wysiwygFrame.offsetHeight,null)},__callResizeFunction:function(e,t){e=-1===e?t.borderBoxSize&&t.borderBoxSize[0]?t.borderBoxSize[0].blockSize:t.contentRect.height+this._editorHeightPadding:e,this._editorHeight!==e&&("function"==typeof h.onResizeEditor&&h.onResizeEditor(e,this._editorHeight,u,t),this._editorHeight=e)},_checkPlaceholder:function(){if(this._placeholder){if(this._variable.isCodeView)return void(this._placeholder.style.display="none");const t=e.element.wysiwyg;!a.onlyZeroWidthSpace(t.textContent)||t.querySelector(a._allowedEmptyNodeList)||(t.innerText.match(/\n/g)||"").length>1?this._placeholder.style.display="none":this._placeholder.style.display="block"}},_setDefaultFormat:function(e){if(this._fileManager.pluginRegExp.test(this.currentControllerName))return;const t=this.getRange(),i=t.commonAncestorContainer,n=t.startContainer,l=a.getRangeFormatElement(i,null);let r,s,c;const u=a.getParentElement(i,a.isComponent);if(!u||a.isTable(u)){if(1===i.nodeType&&"true"===i.getAttribute("data-se-embed")){let e=i.nextElementSibling;return a.isFormatElement(e)||(e=this.appendFormatTag(i,o.defaultTag)),void this.setRange(e.firstChild,0,e.firstChild,0)}if(!a.isRangeFormatElement(n)&&!a.isWysiwygDiv(n)||!a.isComponent(n.children[t.startOffset])&&!a.isComponent(n.children[t.startOffset-1])){if(a.getParentElement(i,a.isNotCheckingNode))return null;if(l)return c=a.createElement(e||o.defaultTag),c.innerHTML=l.innerHTML,0===c.childNodes.length&&(c.innerHTML=a.zeroWidthSpace),l.innerHTML=c.outerHTML,c=l.firstChild,r=a.getEdgeChildNodes(c,null).sc,r||(r=a.createTextNode(a.zeroWidthSpace),c.insertBefore(r,c.firstChild)),s=r.textContent.length,void this.setRange(r,s,r,s);if(a.isRangeFormatElement(i)&&i.childNodes.length<=1){let e=null;return 1===i.childNodes.length&&a.isBreak(i.firstChild)?e=i.firstChild:(e=a.createTextNode(a.zeroWidthSpace),i.appendChild(e)),void this.setRange(e,1,e,1)}if(this.execCommand("formatBlock",!1,e||o.defaultTag),r=a.getEdgeChildNodes(i,i),r=r?r.ec:i,c=a.getFormatElement(r,null),!c)return this.removeRange(),void this._editorRange();if(a.isBreak(c.nextSibling)&&a.removeItem(c.nextSibling),a.isBreak(c.previousSibling)&&a.removeItem(c.previousSibling),a.isBreak(r)){const e=a.createTextNode(a.zeroWidthSpace);r.parentNode.insertBefore(e,r),r=e}this.effectNode=null,this.nativeFocus()}}},_setOptionsInit:function(t,i){this.context=e=K(t.originElement,this._getConstructed(t),o),this._componentsInfoReset=!0,this._editorInit(!0,i)},_editorInit:function(t,i){this._init(t,i),d._addEvent(),this._setCharCount(),d._offStickyToolbar(),d.onResize_window(),e.element.toolbar.style.visibility="";const n=o.frameAttrbutes;for(let t in n)e.element.wysiwyg.setAttribute(t,n[t]);this._checkComponents(),this._componentsInfoInit=!1,this._componentsInfoReset=!1,this.history.reset(!0),s.setTimeout((function(){"function"==typeof u._resourcesStateChange&&(d._resizeObserver&&d._resizeObserver.observe(e.element.wysiwygFrame),d._toolbarObserver&&d._toolbarObserver.observe(e.element._toolbarShadow),u._resourcesStateChange(),"function"==typeof h.onload&&h.onload(u,t))}))},_getConstructed:function(e){return{_top:e.topArea,_relative:e.relative,_toolBar:e.toolbar,_toolbarShadow:e._toolbarShadow,_menuTray:e._menuTray,_editorArea:e.editorArea,_wysiwygArea:e.wysiwygFrame,_codeArea:e.code,_placeholder:e.placeholder,_resizingBar:e.resizingBar,_navigation:e.navigation,_charCounter:e.charCounter,_charWrapper:e.charWrapper,_loading:e.loading,_lineBreaker:e.lineBreaker,_lineBreaker_t:e.lineBreaker_t,_lineBreaker_b:e.lineBreaker_b,_resizeBack:e.resizeBackground,_stickyDummy:e._stickyDummy,_arrow:e._arrow}}},d={_IEisComposing:!1,_lineBreakerBind:null,_responsiveCurrentSize:"default",_responsiveButtonSize:null,_responsiveButtons:null,_cursorMoveKeyCode:new s.RegExp("^(8|3[2-9]|40|46)$"),_directionKeyCode:new s.RegExp("^(8|13|3[2-9]|40|46)$"),_nonTextKeyCode:new s.RegExp("^(8|13|1[6-9]|20|27|3[3-9]|40|45|46|11[2-9]|12[0-3]|144|145)$"),_historyIgnoreKeyCode:new s.RegExp("^(1[6-9]|20|27|3[3-9]|40|45|11[2-9]|12[0-3]|144|145)$"),_onButtonsCheck:new s.RegExp("^("+s.Object.keys(o._textTagsMap).join("|")+")$","i"),_frontZeroWidthReg:new s.RegExp(a.zeroWidthSpace+"+",""),_keyCodeShortcut:{65:"A",66:"B",83:"S",85:"U",73:"I",89:"Y",90:"Z",219:"[",221:"]"},_shortcutCommand:function(e,t){let i=null;const n=d._keyCodeShortcut[e];switch(n){case"A":i="selectAll";break;case"B":-1===o.shortcutsDisable.indexOf("bold")&&(i="bold");break;case"S":t&&-1===o.shortcutsDisable.indexOf("strike")?i="strike":t||-1!==o.shortcutsDisable.indexOf("save")||(i="save");break;case"U":-1===o.shortcutsDisable.indexOf("underline")&&(i="underline");break;case"I":-1===o.shortcutsDisable.indexOf("italic")&&(i="italic");break;case"Z":-1===o.shortcutsDisable.indexOf("undo")&&(i=t?"redo":"undo");break;case"Y":-1===o.shortcutsDisable.indexOf("undo")&&(i="redo");break;case"[":-1===o.shortcutsDisable.indexOf("indent")&&(i=o.rtl?"indent":"outdent");break;case"]":-1===o.shortcutsDisable.indexOf("indent")&&(i=o.rtl?"outdent":"indent")}return i?(u.commandHandler(u.commandMap[i],i),!0):!!n},_applyTagEffects:function(){let t=u.getSelectionNode();if(t===u.effectNode)return;u.effectNode=t;const n=o.rtl?"marginRight":"marginLeft",l=u.commandMap,r=d._onButtonsCheck,s=[],c=[],h=u.activePlugins,p=h.length;let f="";for(;t.firstChild;)t=t.firstChild;for(let e=t;!a.isWysiwygDiv(e)&&e;e=e.parentNode)if(1===e.nodeType&&!a.isBreak(e)){if(f=e.nodeName.toUpperCase(),c.push(f),!u.isReadOnly)for(let t,n=0;n0)&&(s.push("OUTDENT"),l.OUTDENT.removeAttribute("disabled")),-1===s.indexOf("INDENT")&&l.INDENT&&!a.isImportantDisabled(l.INDENT)&&(s.push("INDENT"),a.isListCell(e)&&!e.previousElementSibling?l.INDENT.setAttribute("disabled",!0):l.INDENT.removeAttribute("disabled"))):r&&r.test(f)&&(s.push(f),a.addClass(l[f],"active"))}u._setKeyEffect(s),u._variable.currentNodes=c.reverse(),u._variable.currentNodesMap=s,o.showPathLabel&&(e.element.navigation.textContent=u._variable.currentNodes.join(" > "))},_buttonsEventHandler:function(e){let t=e.target;if(u._bindControllersOff&&e.stopPropagation(),/^(input|textarea|select|option)$/i.test(t.nodeName)?u._antiBlur=!1:e.preventDefault(),a.getParentElement(t,".se-submenu"))e.stopPropagation(),u._notHideToolbar=!0;else{let i=t.getAttribute("data-command"),n=t.className;for(;!i&&!/se-menu-list/.test(n)&&!/sun-editor-common/.test(n);)t=t.parentNode,i=t.getAttribute("data-command"),n=t.className;i!==u._submenuName&&i!==u._containerName||e.stopPropagation()}},onClick_toolbar:function(e){let t=e.target,i=t.getAttribute("data-display"),n=t.getAttribute("data-command"),o=t.className;for(u.controllersOff();t.parentNode&&!n&&!/se-menu-list/.test(o)&&!/se-toolbar/.test(o);)t=t.parentNode,n=t.getAttribute("data-command"),i=t.getAttribute("data-display"),o=t.className;(n||i)&&(t.disabled||u.actionCall(n,i,t))},onMouseDown_wysiwyg:function(t){if(u.isReadOnly||a.isNonEditable(e.element.wysiwyg))return;if(a._isExcludeSelectionElement(t.target))return void t.preventDefault();if(s.setTimeout(u._editorRange.bind(u)),"function"==typeof h.onMouseDown&&!1===h.onMouseDown(t,u))return;const i=a.getParentElement(t.target,a.isCell);if(i){const e=u.plugins.table;e&&i!==e._fixedCell&&!e._shift&&u.callPlugin("table",(function(){e.onTableCellMultiSelect.call(u,i,!1)}),null)}u._isBalloon&&d._hideToolbar()},onClick_wysiwyg:function(t){const i=t.target;if(u.isReadOnly)return t.preventDefault(),a.isAnchor(i)&&s.open(i.href,i.target),!1;if(a.isNonEditable(e.element.wysiwyg))return;if("function"==typeof h.onClick&&!1===h.onClick(t,u))return;const n=u.getFileComponent(i);if(n)return t.preventDefault(),void u.selectComponent(n.target,n.pluginName);const l=a.getParentElement(i,"FIGCAPTION");if(l&&a.isNonEditable(l)&&(t.preventDefault(),l.focus(),u._isInline&&!u._inlineToolbarAttr.isShow)){d._showToolbarInline();const e=function(){d._hideToolbar(),l.removeEventListener("blur",e)};l.addEventListener("blur",e)}if(u._editorRange(),3===t.detail){let e=u.getRange();a.isFormatElement(e.endContainer)&&0===e.endOffset&&(e=u.setRange(e.startContainer,e.startOffset,e.startContainer,e.startContainer.length),u._rangeInfo(e,u.getSelection()))}const r=u.getSelectionNode(),c=a.getFormatElement(r,null),p=a.getRangeFormatElement(r,null);if(c||a.isNonEditable(i)||a.isList(p))d._applyTagEffects();else{const e=u.getRange();if(a.getFormatElement(e.startContainer)===a.getFormatElement(e.endContainer))if(a.isList(p)){t.preventDefault();const e=a.createElement("LI"),i=r.nextElementSibling;e.appendChild(r),p.insertBefore(e,i),u.focus()}else a.isWysiwygDiv(r)||a.isComponent(r)||a.isTable(r)&&!a.isCell(r)||null===u._setDefaultFormat(a.isRangeFormatElement(p)?"DIV":o.defaultTag)?d._applyTagEffects():(t.preventDefault(),u.focus())}u._isBalloon&&s.setTimeout(d._toggleToolbarBalloon)},_balloonDelay:null,_showToolbarBalloonDelay:function(){d._balloonDelay&&s.clearTimeout(d._balloonDelay),d._balloonDelay=s.setTimeout(function(){s.clearTimeout(this._balloonDelay),this._balloonDelay=null,this._showToolbarBalloon()}.bind(d),350)},_toggleToolbarBalloon:function(){u._editorRange();const e=u.getRange();u._bindControllersOff||!u._isBalloonAlways&&e.collapsed?d._hideToolbar():d._showToolbarBalloon(e)},_showToolbarBalloon:function(t){if(!u._isBalloon)return;const i=t||u.getRange(),n=e.element.toolbar,l=e.element.topArea,r=u.getSelection();let c;if(u._isBalloonAlways&&i.collapsed)c=!0;else if(r.focusNode===r.anchorNode)c=r.focusOffset0&&d._getPageBottomSpace()<_?(t=!0,w=!0):t&&r.documentElement.offsetTop>_&&(t=!1,w=!0),w&&(b=(t?i.top-g-p:i.bottom+p)-(i.noText?0:h)+u),n.style.left=s.Math.floor(y)+"px",n.style.top=s.Math.floor(b)+"px",t?(a.removeClass(e.element._arrow,"se-arrow-up"),a.addClass(e.element._arrow,"se-arrow-down"),e.element._arrow.style.top=g+"px"):(a.removeClass(e.element._arrow,"se-arrow-down"),a.addClass(e.element._arrow,"se-arrow-up"),e.element._arrow.style.top=-p+"px");const x=s.Math.floor(f/2+(m-y));e.element._arrow.style.left=(x+p>n.offsetWidth?n.offsetWidth-p:x";const e=m.attributes;for(;e[0];)m.removeAttribute(e[0].name)}else{const e=a.createElement(o.defaultTag);e.innerHTML="
    ",m.parentElement.replaceChild(e,m)}return u.nativeFocus(),!1}}const n=p.startContainer;if(m&&!m.previousElementSibling&&0===p.startOffset&&3===n.nodeType&&!a.isFormatElement(n.parentNode)){let e=n.parentNode.previousSibling;const t=n.parentNode.nextSibling;e||(t?e=t:(e=a.createElement("BR"),m.appendChild(e)));let i=n;for(;m.contains(i)&&!i.previousSibling;)i=i.parentNode;if(!m.contains(i)){n.textContent="",a.removeItemAllParents(n,null,m);break}}if(d._isUneditableNode(p,!0)){t.preventDefault(),t.stopPropagation();break}!f&&u._isEdgeFormat(p.startContainer,p.startOffset,"start")&&a.isFormatElement(m.previousElementSibling)&&(u._formatAttrsTemp=m.previousElementSibling.attributes);const b=p.commonAncestorContainer;if(m=a.getFormatElement(p.startContainer,null),v=a.getRangeFormatElement(m,null),v&&m&&!a.isCell(v)&&!/^FIGCAPTION$/i.test(v.nodeName)){if(a.isListCell(m)&&a.isList(v)&&(a.isListCell(v.parentNode)||m.previousElementSibling)&&(i===m||3===i.nodeType&&(!i.previousSibling||a.isList(i.previousSibling)))&&(a.getFormatElement(p.startContainer,null)!==a.getFormatElement(p.endContainer,null)?v.contains(p.startContainer):0===p.startOffset&&p.collapsed)){if(p.startContainer!==p.endContainer)t.preventDefault(),u.removeNode(),3===p.startContainer.nodeType&&u.setRange(p.startContainer,p.startContainer.textContent.length,p.startContainer,p.startContainer.textContent.length),u.history.push(!0);else{let e=m.previousElementSibling||v.parentNode;if(a.isListCell(e)){t.preventDefault();let i=e;if(!e.contains(m)&&a.isListCell(i)&&a.isList(i.lastElementChild)){for(i=i.lastElementChild.lastElementChild;a.isListCell(i)&&a.isList(i.lastElementChild);)i=i.lastElementChild&&i.lastElementChild.lastElementChild;e=i}let n=e===v.parentNode?v.previousSibling:e.lastChild;n||(n=a.createTextNode(a.zeroWidthSpace),v.parentNode.insertBefore(n,v.parentNode.firstChild));const o=3===n.nodeType?n.textContent.length:1,l=m.childNodes;let r=n,s=l[0];for(;s=l[0];)e.insertBefore(s,r.nextSibling),r=s;a.removeItem(m),0===v.children.length&&a.removeItem(v),u.setRange(n,o,n,o),u.history.push(!0)}}break}if(!f&&0===p.startOffset){let e=!0,i=b;for(;i&&i!==v&&!a.isWysiwygDiv(i);){if(i.previousSibling&&(1===i.previousSibling.nodeType||!a.onlyZeroWidthSpace(i.previousSibling.textContent.trim()))){e=!1;break}i=i.parentNode}if(e&&v.parentNode){t.preventDefault(),u.detachRangeFormatElement(v,a.isListCell(m)?[m]:null,null,!1,!1),u.history.push(!0);break}}}if(!f&&m&&(0===p.startOffset||i===m&&m.childNodes[p.startOffset])){const e=i===m?m.childNodes[p.startOffset]:i,n=m.previousSibling,o=(3===b.nodeType||a.isBreak(b))&&!b.previousSibling&&0===p.startOffset;if(e&&!e.previousSibling&&(b&&a.isComponent(b.previousSibling)||o&&a.isComponent(n))){const e=u.getFileComponent(n);e?(t.preventDefault(),t.stopPropagation(),0===m.textContent.length&&a.removeItem(m),!1===u.selectComponent(e.target,e.pluginName)&&u.blur()):a.isComponent(n)&&(t.preventDefault(),t.stopPropagation(),a.removeItem(n));break}if(e&&a.isNonEditable(e.previousSibling)){t.preventDefault(),t.stopPropagation(),a.removeItem(e.previousSibling);break}}break;case 46:if(g){t.preventDefault(),t.stopPropagation(),u.plugins[g].destroy.call(u);break}if(f&&d._hardDelete()){t.preventDefault(),t.stopPropagation();break}if(d._isUneditableNode(p,!1)){t.preventDefault(),t.stopPropagation();break}if((a.isFormatElement(i)||null===i.nextSibling||a.onlyZeroWidthSpace(i.nextSibling)&&null===i.nextSibling.nextSibling)&&p.startOffset===i.textContent.length){const e=m.nextElementSibling;if(!e)break;if(a.isComponent(e)){if(t.preventDefault(),a.onlyZeroWidthSpace(m)&&(a.removeItem(m),a.isTable(e))){let t=a.getChildElement(e,a.isCell,!1);t=t.firstElementChild||t,u.setRange(t,0,t,0);break}const i=u.getFileComponent(e);i?(t.stopPropagation(),!1===u.selectComponent(i.target,i.pluginName)&&u.blur()):a.isComponent(e)&&(t.stopPropagation(),a.removeItem(e));break}}if(!f&&(u.isEdgePoint(p.endContainer,p.endOffset)||i===m&&m.childNodes[p.startOffset])){const e=i===m&&m.childNodes[p.startOffset]||i;if(e&&a.isNonEditable(e.nextSibling)){t.preventDefault(),t.stopPropagation(),a.removeItem(e.nextSibling);break}if(a.isComponent(e)){t.preventDefault(),t.stopPropagation(),a.removeItem(e);break}}if(!f&&u._isEdgeFormat(p.endContainer,p.endOffset,"end")&&a.isFormatElement(m.nextElementSibling)&&(u._formatAttrsTemp=m.attributes),m=a.getFormatElement(p.startContainer,null),v=a.getRangeFormatElement(m,null),a.isListCell(m)&&a.isList(v)&&(i===m||3===i.nodeType&&(!i.nextSibling||a.isList(i.nextSibling))&&(a.getFormatElement(p.startContainer,null)!==a.getFormatElement(p.endContainer,null)?v.contains(p.endContainer):p.endOffset===i.textContent.length&&p.collapsed))){p.startContainer!==p.endContainer&&u.removeNode();let e=a.getArrayItem(m.children,a.isList,!1);if(e=e||m.nextElementSibling||v.parentNode.nextElementSibling,e&&(a.isList(e)||a.getArrayItem(e.children,a.isList,!1))){let i,n;if(t.preventDefault(),a.isList(e)){const t=e.firstElementChild;for(n=t.childNodes,i=n[0];n[0];)m.insertBefore(n[0],e);a.removeItem(t)}else{for(i=e.firstChild,n=e.childNodes;n[0];)m.appendChild(n[0]);a.removeItem(e)}u.setRange(i,0,i,0),u.history.push(!0)}break}break;case 9:if(g||o.tabDisable)break;if(t.preventDefault(),r||c||a.isWysiwygDiv(i))break;const y=!p.collapsed||u.isEdgePoint(p.startContainer,p.startOffset),w=u.getSelectedElements(null);i=u.getSelectionNode();const _=[];let x=[],C=a.isListCell(w[0]),k=a.isListCell(w[w.length-1]),S={sc:p.startContainer,so:p.startOffset,ec:p.endContainer,eo:p.endOffset};for(let e,t=0,i=w.length;t0&&y&&u.plugins.list)S=u.plugins.list.editInsideList.call(u,l,_);else{const e=a.getParentElement(i,a.isCell);if(e&&y){const t=a.getParentElement(e,"table"),i=a.getListChildren(t,a.isCell);let n=l?a.prevIdx(i,e):a.nextIdx(i,e);n!==i.length||l||(n=0),-1===n&&l&&(n=i.length-1);let o=i[n];if(!o)break;o=o.firstElementChild||o,u.setRange(o,0,o,0);break}x=x.concat(_),C=k=null}if(x.length>0)if(l){const e=x.length-1;for(let t,i=0;i<=e;i++){t=x[i].childNodes;for(let e,i=0,n=t.length;i":"<"+m.nodeName+">
    ",!u.checkCharCount(e,"byte-html"))return t.preventDefault(),!1}if(!l){const n=u._isEdgeFormat(p.endContainer,p.endOffset,"end"),l=u._isEdgeFormat(p.startContainer,p.startOffset,"start");if(n&&(/^H[1-6]$/i.test(m.nodeName)||/^HR$/i.test(m.nodeName))){t.preventDefault();let e=null;const i=u.appendFormatTag(m,o.defaultTag);if(n&&n.length>0){e=n.pop();const t=e;for(;n.length>0;)e=e.appendChild(n.pop());i.appendChild(t)}e=e?e.appendChild(i.firstChild):i.firstChild,u.setRange(e,0,e,0);break}if(v&&m&&!a.isCell(v)&&!/^FIGCAPTION$/i.test(v.nodeName)){const e=u.getRange();if(u.isEdgePoint(e.endContainer,e.endOffset)&&a.isList(i.nextSibling)){t.preventDefault();const e=a.createElement("LI"),n=a.createElement("BR");e.appendChild(n),m.parentNode.insertBefore(e,m.nextElementSibling),e.appendChild(i.nextSibling),u.setRange(n,1,n,1);break}if((3!==e.commonAncestorContainer.nodeType||!e.commonAncestorContainer.nextElementSibling)&&a.onlyZeroWidthSpace(m.innerText.trim())&&!a.isListCell(m.nextElementSibling)){t.preventDefault();let e=null;if(a.isListCell(v.parentNode)){if(v=m.parentNode.parentNode.parentNode,e=a.splitElement(m,null,a.getElementDepth(m)-2),!e){const t=a.createElement("LI");t.innerHTML="
    ",a.copyTagAttributes(t,m,o.lineAttrReset),v.insertBefore(t,e),e=t}}else{const t=a.isCell(v.parentNode)?"DIV":a.isList(v.parentNode)?"LI":a.isFormatElement(v.nextElementSibling)&&!a.isRangeFormatElement(v.nextElementSibling)?v.nextElementSibling.nodeName:a.isFormatElement(v.previousElementSibling)&&!a.isRangeFormatElement(v.previousElementSibling)?v.previousElementSibling.nodeName:o.defaultTag;e=a.createElement(t),a.copyTagAttributes(e,m,o.lineAttrReset);const i=u.detachRangeFormatElement(v,[m],null,!0,!0);i.cc.insertBefore(e,i.ec)}e.innerHTML="
    ",a.removeItemAllParents(m,null,null),u.setRange(e,1,e,1);break}}if(L){t.preventDefault();const e=i===L,n=u.getSelection(),o=i.childNodes,l=n.focusOffset,r=i.previousElementSibling,s=i.nextSibling;if(!a.isClosureFreeFormatElement(L)&&o&&(e&&p.collapsed&&o.length-1<=l+1&&a.isBreak(o[l])&&(!o[l+1]||(!o[l+2]||a.onlyZeroWidthSpace(o[l+2].textContent))&&3===o[l+1].nodeType&&a.onlyZeroWidthSpace(o[l+1].textContent))&&l>0&&a.isBreak(o[l-1])||!e&&a.onlyZeroWidthSpace(i.textContent)&&a.isBreak(r)&&(a.isBreak(r.previousSibling)||!a.onlyZeroWidthSpace(r.previousSibling.textContent))&&(!s||!a.isBreak(s)&&a.onlyZeroWidthSpace(s.textContent)))){e?a.removeItem(o[l-1]):a.removeItem(i);const t=u.appendFormatTag(L,a.isFormatElement(L.nextElementSibling)&&!a.isRangeFormatElement(L.nextElementSibling)?L.nextElementSibling:null);a.copyFormatAttributes(t,L),u.setRange(t,1,t,1);break}if(e){h.insertHTML(p.collapsed&&a.isBreak(p.startContainer.childNodes[p.startOffset-1])?"
    ":"

    ",!0,!1);let e=n.focusNode;const t=n.focusOffset;L===e&&(e=e.childNodes[t-l>1?t-1:t]),u.setRange(e,1,e,1)}else{const e=n.focusNode.nextSibling,t=a.createElement("BR");u.insertNode(t,null,!1);const i=t.previousSibling,o=t.nextSibling;a.isBreak(e)||a.isBreak(i)||o&&!a.onlyZeroWidthSpace(o)?u.setRange(o,0,o,0):(t.parentNode.insertBefore(t.cloneNode(!1),t),u.setRange(t,1,t,1))}d._onShortcutKey=!0;break}if(p.collapsed&&(l||n)){t.preventDefault();const e=a.createElement("BR"),r=a.createElement(m.nodeName);a.copyTagAttributes(r,m,o.lineAttrReset);let s=e;do{if(!a.isBreak(i)&&1===i.nodeType){const e=i.cloneNode(!1);e.appendChild(s),s=e}i=i.parentNode}while(m!==i&&m.contains(i));r.appendChild(s),m.parentNode.insertBefore(r,l&&!n?m:m.nextElementSibling),n&&u.setRange(e,1,e,1);break}if(m){let i;t.stopPropagation();let r=0;if(p.collapsed)i=a.onlyZeroWidthSpace(m)?u.appendFormatTag(m,m.cloneNode(!1)):a.splitElement(p.endContainer,p.endOffset,a.getElementDepth(m));else{const s=a.getFormatElement(p.startContainer,null)!==a.getFormatElement(p.endContainer,null),c=m.cloneNode(!1);c.innerHTML="
    ";const d=u.removeNode();if(i=a.getFormatElement(d.container,null),!i){a.isWysiwygDiv(d.container)&&(t.preventDefault(),e.element.wysiwyg.appendChild(c),i=c,a.copyTagAttributes(i,m,o.lineAttrReset),u.setRange(i,r,i,r));break}const h=a.getRangeFormatElement(d.container);if(i=i.contains(h)?a.getChildElement(h,a.getFormatElement.bind(a)):i,s){if(n&&!l)i.parentNode.insertBefore(c,d.prevContainer&&d.container!==d.prevContainer?i:i.nextElementSibling),i=c,r=0;else if(r=d.offset,l){const e=i.parentNode.insertBefore(c,i);n&&(i=e,r=0)}}else n&&l?(i.parentNode.insertBefore(c,d.prevContainer&&d.container===d.prevContainer?i.nextElementSibling:i),i=c,r=0):i=a.splitElement(d.container,d.offset,a.getElementDepth(m))}t.preventDefault(),a.copyTagAttributes(i,m,o.lineAttrReset),u.setRange(i,r,i,r);break}}if(f)break;if(v&&a.getParentElement(v,"FIGCAPTION")&&a.getParentElement(v,a.isList)&&(t.preventDefault(),m=u.appendFormatTag(m,null),u.setRange(m,0,m,0)),g){t.preventDefault(),t.stopPropagation();const i=e[g],n=i._container,l=n.previousElementSibling||n.nextElementSibling;let r=null;a.isListCell(n.parentNode)?r=a.createElement("BR"):(r=a.createElement(a.isFormatElement(l)&&!a.isRangeFormatElement(l)?l.nodeName:o.defaultTag),r.innerHTML="
    "),n.parentNode.insertBefore(r,n),u.callPlugin(g,(function(){!1===u.selectComponent(i._element,g)&&u.blur()}),null)}break;case 27:if(g)return t.preventDefault(),t.stopPropagation(),u.controllersOff(),!1}if(l&&16===n){t.preventDefault(),t.stopPropagation();const e=u.plugins.table;if(e&&!e._shift&&!e._ref){const t=a.getParentElement(m,a.isCell);if(t)return void e.onTableCellMultiSelect.call(u,t,!0)}}else if(l&&(a.isOSX_IOS?c:r)&&32===n){t.preventDefault(),t.stopPropagation();const e=u.insertNode(a.createTextNode(" "));if(e&&e.container)return void u.setRange(e.container,e.endOffset,e.container,e.endOffset)}if(a.isIE&&!r&&!c&&!f&&!d._nonTextKeyCode.test(n)&&a.isBreak(p.commonAncestorContainer)){const e=a.createTextNode(a.zeroWidthSpace);u.insertNode(e,null,!1),u.setRange(e,1,e,1)}d._directionKeyCode.test(n)&&(u._editorRange(),d._applyTagEffects())},onKeyUp_wysiwyg:function(e){if(d._onShortcutKey)return;u._editorRange();const t=e.keyCode,i=e.ctrlKey||e.metaKey||91===t||92===t||224===t,n=e.altKey;if(u.isReadOnly)return void(!i&&d._cursorMoveKeyCode.test(t)&&d._applyTagEffects());const l=u.getRange();let r=u.getSelectionNode();if(u._isBalloon&&(u._isBalloonAlways&&27!==t||!l.collapsed)){if(!u._isBalloonAlways)return void d._showToolbarBalloon();27!==t&&d._showToolbarBalloonDelay()}if(8===t&&a.isWysiwygDiv(r)&&""===r.textContent&&0===r.children.length){e.preventDefault(),e.stopPropagation(),r.innerHTML="";const t=a.createElement(a.isFormatElement(u._variable.currentNodes[0])?u._variable.currentNodes[0]:o.defaultTag);return t.innerHTML="
    ",r.appendChild(t),u.setRange(t,0,t,0),d._applyTagEffects(),void u.history.push(!1)}const s=a.getFormatElement(r,null),c=a.getRangeFormatElement(r,null),p=u._formatAttrsTemp;if(p){for(let e=0,i=p.length;e0?n-l-e.element.toolbar.offsetHeight:0;n=i+l?(u._sticky||d._onStickyToolbar(s),t.toolbar.style.top=s+i+l+o.stickyToolbar-n-u._variable.minResizingSize+"px"):n>=l&&d._onStickyToolbar(s)},_getEditorOffsets:function(t){let i=t||e.element.topArea,n=0,o=0,l=0;for(;i;)n+=i.offsetTop,o+=i.offsetLeft,l+=i.scrollTop,i=i.offsetParent;return{top:n,left:o,scroll:l}},_getPageBottomSpace:function(){return r.documentElement.scrollHeight-(d._getEditorOffsets(null).top+e.element.topArea.offsetHeight)},_onStickyToolbar:function(t){const i=e.element;u._isInline||o.toolbarContainer||(i._stickyDummy.style.height=i.toolbar.offsetHeight+"px",i._stickyDummy.style.display="block"),i.toolbar.style.top=o.stickyToolbar+t+"px",i.toolbar.style.width=u._isInline?u._inlineToolbarAttr.width:i.toolbar.offsetWidth+"px",a.addClass(i.toolbar,"se-toolbar-sticky"),u._sticky=!0},_offStickyToolbar:function(){const t=e.element;t._stickyDummy.style.display="none",t.toolbar.style.top=u._isInline?u._inlineToolbarAttr.top:"",t.toolbar.style.width=u._isInline?u._inlineToolbarAttr.width:"",t.editorArea.style.marginTop="",a.removeClass(t.toolbar,"se-toolbar-sticky"),u._sticky=!1},_codeViewAutoHeight:function(){u._variable.isFullScreen||(e.element.code.style.height=e.element.code.scrollHeight+"px")},_hardDelete:function(){const e=u.getRange(),t=e.startContainer,i=e.endContainer,n=a.getRangeFormatElement(t),o=a.getRangeFormatElement(i),l=a.isCell(n),r=a.isCell(o),s=e.commonAncestorContainer;if((l&&!n.previousElementSibling&&!n.parentElement.previousElementSibling||r&&!o.nextElementSibling&&!o.parentElement.nextElementSibling)&&n!==o)if(l){if(r)return a.removeItem(a.getParentElement(n,(function(e){return s===e.parentNode}))),u.nativeFocus(),!0;a.removeItem(a.getParentElement(n,(function(e){return s===e.parentNode})))}else a.removeItem(a.getParentElement(o,(function(e){return s===e.parentNode})));const c=1===t.nodeType?a.getParentElement(t,".se-component"):null,d=1===i.nodeType?a.getParentElement(i,".se-component"):null;return c&&a.removeItem(c),d&&a.removeItem(d),!1},onPaste_wysiwyg:function(e){const t=a.isIE?s.clipboardData:e.clipboardData;return!t||d._dataTransferAction("paste",e,t)},_setClipboardComponent:function(e,t,i){e.preventDefault(),e.stopPropagation(),i.setData("text/html",t.component.outerHTML)},onCopy_wysiwyg:function(e){const t=a.isIE?s.clipboardData:e.clipboardData;if("function"==typeof h.onCopy&&!1===h.onCopy(e,t,u))return e.preventDefault(),e.stopPropagation(),!1;const i=u.currentFileComponentInfo;i&&!a.isIE&&(d._setClipboardComponent(e,i,t),a.addClass(i.component,"se-component-copy"),s.setTimeout((function(){a.removeClass(i.component,"se-component-copy")}),150))},onSave_wysiwyg:function(e){"function"!=typeof h.onSave||h.onSave(e,u)},onCut_wysiwyg:function(e){const t=a.isIE?s.clipboardData:e.clipboardData;if("function"==typeof h.onCut&&!1===h.onCut(e,t,u))return e.preventDefault(),e.stopPropagation(),!1;const i=u.currentFileComponentInfo;i&&!a.isIE&&(d._setClipboardComponent(e,i,t),a.removeItem(i.component),u.controllersOff()),s.setTimeout((function(){u.history.push(!1)}))},onDrop_wysiwyg:function(e){if(u.isReadOnly||a.isIE)return e.preventDefault(),e.stopPropagation(),!1;const t=e.dataTransfer;return!t||(u.removeNode(),d._setDropLocationSelection(e),d._dataTransferAction("drop",e,t))},_setDropLocationSelection:function(e){if(e.rangeParent)u.setRange(e.rangeParent,e.rangeOffset,e.rangeParent,e.rangeOffset);else if(u._wd.caretRangeFromPoint){const t=u._wd.caretRangeFromPoint(e.clientX,e.clientY);u.setRange(t.startContainer,t.startOffset,t.endContainer,t.endOffset)}else{const e=u.getRange();u.setRange(e.startContainer,e.startOffset,e.endContainer,e.endOffset)}},_dataTransferAction:function(t,i,n){let o,l;if(a.isIE){o=n.getData("Text");const r=u.getRange(),c=a.createElement("DIV"),h={sc:r.startContainer,so:r.startOffset,ec:r.endContainer,eo:r.endOffset};return c.setAttribute("contenteditable",!0),c.style.cssText="position:absolute; top:0; left:0; width:1px; height:1px; overflow:hidden;",e.element.relative.appendChild(c),c.focus(),s.setTimeout((function(){l=c.innerHTML,a.removeItem(c),u.setRange(h.sc,h.so,h.ec,h.eo),d._setClipboardData(t,i,o,l,n)})),!0}if(o=n.getData("text/plain"),l=n.getData("text/html"),!1===d._setClipboardData(t,i,o,l,n))return i.preventDefault(),i.stopPropagation(),!1},_setClipboardData:function(e,t,i,n,o){const l=/class=["']*Mso(Normal|List)/i.test(n)||/content=["']*Word.Document/i.test(n)||/content=["']*OneNote.File/i.test(n)||/content=["']*Excel.Sheet/i.test(n);n?(n=n.replace(/^\r?\n?\r?\n?\x3C!--StartFragment--\>|\x3C!--EndFragment-->\r?\n?<\/body\>\r?\n?<\/html>$/g,""),l&&(n=n.replace(/\n/g," "),i=i.replace(/\n/g," ")),n=u.cleanHTML(n,u.pasteTagsWhitelistRegExp,u.pasteTagsBlacklistRegExp)):n=a._HTMLConvertor(i).replace(/\n/g,"
    ");const r=u._charCount(u._charTypeHTML?n:i);if("paste"===e&&"function"==typeof h.onPaste){const e=h.onPaste(t,n,r,u);if(!1===e)return!1;if("string"==typeof e){if(!e)return!1;n=e}}if("drop"===e&&"function"==typeof h.onDrop){const e=h.onDrop(t,n,r,u);if(!1===e)return!1;if("string"==typeof e){if(!e)return!1;n=e}}const s=o.files;return s.length>0&&!l?(/^image/.test(s[0].type)&&u.plugins.image&&h.insertImage(s),!1):!!r&&(n?(h.insertHTML(n,!0,!1),!1):void 0)},onMouseMove_wysiwyg:function(t){if(u.isDisabled||u.isReadOnly)return!1;const i=a.getParentElement(t.target,a.isComponent),n=u._lineBreaker.style;if(i&&!u.currentControllerName){const l=e.element;let r=0,s=l.wysiwyg;do{r+=s.scrollTop,s=s.parentElement}while(s&&!/^(BODY|HTML)$/i.test(s.nodeName));const c=l.wysiwyg.scrollTop,h=d._getEditorOffsets(null),p=a.getOffset(i,l.wysiwygFrame).top+c,f=t.pageY+r+(o.iframe&&!o.toolbarContainer?l.toolbar.offsetHeight:0),g=p+(o.iframe?r:h.top),m=a.isListCell(i.parentNode);let v="",b="";if((m?!i.previousSibling:!a.isFormatElement(i.previousElementSibling))&&fg+i.offsetHeight-20))return void(n.display="none");b=p+i.offsetHeight,v="b"}u._variable._lineBreakComp=i,u._variable._lineBreakDir=v,n.top=b-c+"px",u._lineBreakerButton.style.left=a.getOffset(i).left+i.offsetWidth/2-15+"px",n.display="block"}else"none"!==n.display&&(n.display="none")},_onMouseDown_lineBreak:function(e){e.preventDefault()},_onLineBreak:function(e){e.preventDefault();const t=u._variable._lineBreakComp,i=this?this:u._variable._lineBreakDir,n=a.isListCell(t.parentNode),l=a.createElement(n?"BR":a.isCell(t.parentNode)?"DIV":o.defaultTag);if(n||(l.innerHTML="
    "),u._charTypeHTML&&!u.checkCharCount(l.outerHTML,"byte-html"))return;t.parentNode.insertBefore(l,"t"===i?t:t.nextSibling),u._lineBreaker.style.display="none",u._variable._lineBreakComp=null;const r=n?l:l.firstChild;u.setRange(r,1,r,1),u.history.push(!1)},_resizeObserver:null,_toolbarObserver:null,_addEvent:function(){const t=o.iframe?u._ww:e.element.wysiwyg;a.isResizeObserverSupported&&(this._resizeObserver=new s.ResizeObserver((function(e){u.__callResizeFunction(-1,e[0])}))),e.element.toolbar.addEventListener("mousedown",d._buttonsEventHandler,!1),e.element._menuTray.addEventListener("mousedown",d._buttonsEventHandler,!1),e.element.toolbar.addEventListener("click",d.onClick_toolbar,!1),t.addEventListener("mousedown",d.onMouseDown_wysiwyg,!1),t.addEventListener("click",d.onClick_wysiwyg,!1),t.addEventListener(a.isIE?"textinput":"input",d.onInput_wysiwyg,!1),t.addEventListener("keydown",d.onKeyDown_wysiwyg,!1),t.addEventListener("keyup",d.onKeyUp_wysiwyg,!1),t.addEventListener("paste",d.onPaste_wysiwyg,!1),t.addEventListener("copy",d.onCopy_wysiwyg,!1),t.addEventListener("cut",d.onCut_wysiwyg,!1),t.addEventListener("drop",d.onDrop_wysiwyg,!1),t.addEventListener("scroll",d.onScroll_wysiwyg,!1),t.addEventListener("focus",d.onFocus_wysiwyg,!1),t.addEventListener("blur",d.onBlur_wysiwyg,!1),d._lineBreakerBind={a:d._onLineBreak.bind(""),t:d._onLineBreak.bind("t"),b:d._onLineBreak.bind("b")},t.addEventListener("mousemove",d.onMouseMove_wysiwyg,!1),u._lineBreakerButton.addEventListener("mousedown",d._onMouseDown_lineBreak,!1),u._lineBreakerButton.addEventListener("click",d._lineBreakerBind.a,!1),e.element.lineBreaker_t.addEventListener("mousedown",d._lineBreakerBind.t,!1),e.element.lineBreaker_b.addEventListener("mousedown",d._lineBreakerBind.b,!1),t.addEventListener("touchstart",d.onMouseDown_wysiwyg,{passive:!0,useCapture:!1}),t.addEventListener("touchend",d.onClick_wysiwyg,{passive:!0,useCapture:!1}),"auto"!==o.height||o.codeMirrorEditor||(e.element.code.addEventListener("keydown",d._codeViewAutoHeight,!1),e.element.code.addEventListener("keyup",d._codeViewAutoHeight,!1),e.element.code.addEventListener("paste",d._codeViewAutoHeight,!1)),e.element.resizingBar&&(/\d+/.test(o.height)&&o.resizeEnable?e.element.resizingBar.addEventListener("mousedown",d.onMouseDown_resizingBar,!1):a.addClass(e.element.resizingBar,"se-resizing-none")),d._setResponsiveToolbar(),a.isResizeObserverSupported&&(this._toolbarObserver=new s.ResizeObserver(u.resetResponsiveToolbar)),s.addEventListener("resize",d.onResize_window,!1),o.stickyToolbar>-1&&s.addEventListener("scroll",d.onScroll_window,!1)},_removeEvent:function(){const t=o.iframe?u._ww:e.element.wysiwyg;e.element.toolbar.removeEventListener("mousedown",d._buttonsEventHandler),e.element._menuTray.removeEventListener("mousedown",d._buttonsEventHandler),e.element.toolbar.removeEventListener("click",d.onClick_toolbar),t.removeEventListener("mousedown",d.onMouseDown_wysiwyg),t.removeEventListener("click",d.onClick_wysiwyg),t.removeEventListener(a.isIE?"textinput":"input",d.onInput_wysiwyg),t.removeEventListener("keydown",d.onKeyDown_wysiwyg),t.removeEventListener("keyup",d.onKeyUp_wysiwyg),t.removeEventListener("paste",d.onPaste_wysiwyg),t.removeEventListener("copy",d.onCopy_wysiwyg),t.removeEventListener("cut",d.onCut_wysiwyg),t.removeEventListener("drop",d.onDrop_wysiwyg),t.removeEventListener("scroll",d.onScroll_wysiwyg),t.removeEventListener("mousemove",d.onMouseMove_wysiwyg),u._lineBreakerButton.removeEventListener("mousedown",d._onMouseDown_lineBreak),u._lineBreakerButton.removeEventListener("click",d._lineBreakerBind.a),e.element.lineBreaker_t.removeEventListener("mousedown",d._lineBreakerBind.t),e.element.lineBreaker_b.removeEventListener("mousedown",d._lineBreakerBind.b),d._lineBreakerBind=null,t.removeEventListener("touchstart",d.onMouseDown_wysiwyg,{passive:!0,useCapture:!1}),t.removeEventListener("touchend",d.onClick_wysiwyg,{passive:!0,useCapture:!1}),t.removeEventListener("focus",d.onFocus_wysiwyg),t.removeEventListener("blur",d.onBlur_wysiwyg),e.element.code.removeEventListener("keydown",d._codeViewAutoHeight),e.element.code.removeEventListener("keyup",d._codeViewAutoHeight),e.element.code.removeEventListener("paste",d._codeViewAutoHeight),e.element.resizingBar&&e.element.resizingBar.removeEventListener("mousedown",d.onMouseDown_resizingBar),d._resizeObserver&&(d._resizeObserver.unobserve(e.element.wysiwygFrame),d._resizeObserver=null),d._toolbarObserver&&(d._toolbarObserver.unobserve(e.element._toolbarShadow),d._toolbarObserver=null),s.removeEventListener("resize",d.onResize_window),s.removeEventListener("scroll",d.onScroll_window)},_setResponsiveToolbar:function(){if(0===l.length)return void(l=null);d._responsiveCurrentSize="default";const e=d._responsiveButtonSize=[],t=d._responsiveButtons={default:l[0]};for(let i,n,o=1,r=l.length;o';for(let e,i=0,n=o.length;i0&&(r+='
    '+t(l)+"
    ",l=[]),"object"==typeof e&&(r+='
    '+t(e)+"
    ")));return r+='
    ",r},_makeColorList:function(e){let t="";t+='
      ';for(let i,n=0,o=e.length;n');return t+="
    ",t},init:function(e,t){const i=this.plugins.colorPicker;let n=t||(i.getColorInNode.call(this,e)||this.context.colorPicker._defaultColor);n=i.isHexColor(n)?n:i.rgb2hex(n)||n;const o=this.context.colorPicker._colorList;if(o)for(let e=0,t=o.length;e=3&&"#"+((1<<24)+(i[0]<<16)+(i[1]<<8)+i[2]).toString(16).substr(1)}},Fe={name:"fontColor",display:"submenu",add:function(e,t){e.addModule([De]);const i=e.context;i.fontColor={previewEl:null,colorInput:null,colorList:null};let n=this.setSubmenu(e);i.fontColor.colorInput=n.querySelector("._se_color_picker_input"),i.fontColor.colorInput.addEventListener("keyup",this.onChangeInput.bind(e)),n.querySelector("._se_color_picker_submit").addEventListener("click",this.submit.bind(e)),n.querySelector("._se_color_picker_remove").addEventListener("click",this.remove.bind(e)),n.addEventListener("click",this.pickup.bind(e)),i.fontColor.colorList=n.querySelectorAll("li button"),e.initMenuTarget(this.name,t,n),n=null},setSubmenu:function(e){const t=e.context.colorPicker.colorListHTML,i=e.util.createElement("DIV");return i.className="se-submenu se-list-layer",i.innerHTML=t,i},on:function(){const e=this.context.colorPicker,t=this.context.fontColor;e._colorInput=t.colorInput;const i=this.wwComputedStyle.color;e._defaultColor=i?this.plugins.colorPicker.isHexColor(i)?i:this.plugins.colorPicker.rgb2hex(i):"#333333",e._styleProperty="color",e._colorList=t.colorList,this.plugins.colorPicker.init.call(this,this.getSelectionNode(),null)},onChangeInput:function(e){this.plugins.colorPicker.setCurrentColor.call(this,e.target.value)},submit:function(){this.plugins.fontColor.applyColor.call(this,this.context.colorPicker._currentColor)},pickup:function(e){e.preventDefault(),e.stopPropagation(),this.plugins.fontColor.applyColor.call(this,e.target.getAttribute("data-value"))},remove:function(){this.nodeChange(null,["color"],["span"],!0),this.submenuOff()},applyColor:function(e){if(!e)return;const t=this.util.createElement("SPAN");t.style.color=e,this.nodeChange(t,["color"],null,null),this.submenuOff()}},Pe={name:"hiliteColor",display:"submenu",add:function(e,t){e.addModule([De]);const i=e.context;i.hiliteColor={previewEl:null,colorInput:null,colorList:null};let n=this.setSubmenu(e);i.hiliteColor.colorInput=n.querySelector("._se_color_picker_input"),i.hiliteColor.colorInput.addEventListener("keyup",this.onChangeInput.bind(e)),n.querySelector("._se_color_picker_submit").addEventListener("click",this.submit.bind(e)),n.querySelector("._se_color_picker_remove").addEventListener("click",this.remove.bind(e)),n.addEventListener("click",this.pickup.bind(e)),i.hiliteColor.colorList=n.querySelectorAll("li button"),e.initMenuTarget(this.name,t,n),n=null},setSubmenu:function(e){const t=e.context.colorPicker.colorListHTML,i=e.util.createElement("DIV");return i.className="se-submenu se-list-layer",i.innerHTML=t,i},on:function(){const e=this.context.colorPicker,t=this.context.hiliteColor;e._colorInput=t.colorInput;const i=this.wwComputedStyle.backgroundColor;e._defaultColor=i?this.plugins.colorPicker.isHexColor(i)?i:this.plugins.colorPicker.rgb2hex(i):"#ffffff",e._styleProperty="backgroundColor",e._colorList=t.colorList,this.plugins.colorPicker.init.call(this,this.getSelectionNode(),null)},onChangeInput:function(e){this.plugins.colorPicker.setCurrentColor.call(this,e.target.value)},submit:function(){this.plugins.hiliteColor.applyColor.call(this,this.context.colorPicker._currentColor)},pickup:function(e){e.preventDefault(),e.stopPropagation(),this.plugins.hiliteColor.applyColor.call(this,e.target.getAttribute("data-value"))},remove:function(){this.nodeChange(null,["background-color"],["span"],!0),this.submenuOff()},applyColor:function(e){if(!e)return;const t=this.util.createElement("SPAN");t.style.backgroundColor=e,this.nodeChange(t,["background-color"],null,null),this.submenuOff()}},Ve={name:"template",display:"submenu",add:function(e,t){e.context.template={selectedIndex:-1};let i=this.setSubmenu(e);i.querySelector("ul").addEventListener("click",this.pickup.bind(e)),e.initMenuTarget(this.name,t,i),i=null},setSubmenu:function(e){const t=e.options.templates;if(!t||0===t.length)throw Error('[SUNEDITOR.plugins.template.fail] To use the "template" plugin, please define the "templates" option.');const i=e.util.createElement("DIV");i.className="se-list-layer";let n='
      ';for(let e,i=0,o=t.length;i";return n+="
    ",i.innerHTML=n,i},pickup:function(e){if(!/^BUTTON$/i.test(e.target.tagName))return!1;e.preventDefault(),e.stopPropagation(),this.context.template.selectedIndex=1*e.target.getAttribute("data-value");const t=this.options.templates[this.context.template.selectedIndex];if(!t.html)throw this.submenuOff(),Error('[SUNEDITOR.template.fail] cause : "templates[i].html not found"');this.setContents(t.html),this.submenuOff()}};var Ue=i(350),We=i.n(Ue);const je={name:"selectMenu",add:function(e){e.context.selectMenu={caller:{},callerContext:null}},setForm:function(){return'
    '},createList:function(e,t,i){e.form.innerHTML="
      "+i+"
    ",e.items=t,e.menus=e.form.querySelectorAll("li")},initEvent:function(e,t){const i=t.querySelector(".se-select-list"),n=this.context.selectMenu.caller[e]={form:i,items:[],menus:[],index:-1,item:null,clickMethod:null,callerName:e};i.addEventListener("mousedown",this.plugins.selectMenu.onMousedown_list),i.addEventListener("mousemove",this.plugins.selectMenu.onMouseMove_list.bind(this,n)),i.addEventListener("click",this.plugins.selectMenu.onClick_list.bind(this,n))},onMousedown_list:function(e){e.preventDefault(),e.stopPropagation()},onMouseMove_list:function(e,t){this.util.addClass(e.form,"__se_select-menu-mouse-move");const i=t.target.getAttribute("data-index");i&&(e.index=1*i)},onClick_list:function(e,t){const i=t.target.getAttribute("data-index");i&&e.clickMethod.call(this,e.items[i])},moveItem:function(e,t){this.util.removeClass(e.form,"__se_select-menu-mouse-move"),t=e.index+t;const i=e.menus,n=i.length,o=e.index=t>=n?0:t<0?n-1:t;for(let e=0;e
    "+e.plugins.selectMenu.setForm()+'
    '+o.bookmark+''+o.download+'
    ",l.innerHTML=r,l},initEvent:function(e,t){const i=this.plugins.anchor,n=this.context.anchor.caller[e]={modal:t,urlInput:null,linkDefaultRel:this.options.linkRelDefault,defaultRel:this.options.linkRelDefault.default||"",currentRel:[],linkAnchor:null,linkValue:"",_change:!1,callerName:e};"string"==typeof n.linkDefaultRel.default&&(n.linkDefaultRel.default=n.linkDefaultRel.default.trim()),"string"==typeof n.linkDefaultRel.check_new_window&&(n.linkDefaultRel.check_new_window=n.linkDefaultRel.check_new_window.trim()),"string"==typeof n.linkDefaultRel.check_bookmark&&(n.linkDefaultRel.check_bookmark=n.linkDefaultRel.check_bookmark.trim()),n.urlInput=t.querySelector(".se-input-url"),n.anchorText=t.querySelector("._se_anchor_text"),n.newWindowCheck=t.querySelector("._se_anchor_check"),n.downloadCheck=t.querySelector("._se_anchor_download"),n.download=t.querySelector("._se_anchor_download_icon"),n.preview=t.querySelector(".se-link-preview"),n.bookmark=t.querySelector("._se_anchor_bookmark_icon"),n.bookmarkButton=t.querySelector("._se_bookmark_button"),this.plugins.selectMenu.initEvent.call(this,e,t);const o=this.context.selectMenu.caller[e];this.options.linkRel.length>0&&(n.relButton=t.querySelector(".se-anchor-rel-btn"),n.relList=t.querySelector(".se-list-layer"),n.relPreview=t.querySelector(".se-anchor-rel-preview"),n.relButton.addEventListener("click",i.onClick_relButton.bind(this,n)),n.relList.addEventListener("click",i.onClick_relList.bind(this,n))),n.newWindowCheck.addEventListener("change",i.onChange_newWindowCheck.bind(this,n)),n.downloadCheck.addEventListener("change",i.onChange_downloadCheck.bind(this,n)),n.anchorText.addEventListener("input",i.onChangeAnchorText.bind(this,n)),n.urlInput.addEventListener("input",i.onChangeUrlInput.bind(this,n)),n.urlInput.addEventListener("keydown",i.onKeyDownUrlInput.bind(this,o)),n.urlInput.addEventListener("focus",i.onFocusUrlInput.bind(this,n,o)),n.urlInput.addEventListener("blur",i.onBlurUrlInput.bind(this,o)),n.bookmarkButton.addEventListener("click",i.onClick_bookmarkButton.bind(this,n))},on:function(e,t){const i=this.plugins.anchor;if(t){if(e.linkAnchor){this.context.dialog.updateModal=!0;const t=e.linkAnchor.getAttribute("href");e.linkValue=e.preview.textContent=e.urlInput.value=i.selfPathBookmark.call(this,t)?t.substr(t.lastIndexOf("#")):t,e.anchorText.value=e.linkAnchor.textContent,e.newWindowCheck.checked=!!/_blank/i.test(e.linkAnchor.target),e.downloadCheck.checked=e.linkAnchor.download}}else i.init.call(this,e),e.anchorText.value=this.getSelection().toString().trim(),e.newWindowCheck.checked=this.options.linkTargetNewWindow;this.context.anchor.callerContext=e,i.setRel.call(this,e,t&&e.linkAnchor?e.linkAnchor.rel:e.defaultRel),i.setLinkPreview.call(this,e,e.linkValue),this.plugins.selectMenu.on.call(this,e.callerName,this.plugins.anchor.setHeaderBookmark)},selfPathBookmark:function(e){const t=this._w.location.href.replace(/\/$/,"");return 0===e.indexOf("#")||0===e.indexOf(t)&&e.indexOf("#")===(-1===t.indexOf("#")?t.length:t.substr(0,t.indexOf("#")).length)},_closeRelMenu:null,toggleRelList:function(e,t){if(t){const t=e.relButton,i=e.relList;this.util.addClass(t,"active"),i.style.visibility="hidden",i.style.display="block",this.options.rtl?i.style.left=t.offsetLeft-i.offsetWidth-1+"px":i.style.left=t.offsetLeft+t.offsetWidth+1+"px",i.style.top=t.offsetTop+t.offsetHeight/2-i.offsetHeight/2+"px",i.style.visibility="",this.plugins.anchor._closeRelMenu=function(e,t,i){i&&(e.relButton.contains(i.target)||e.relList.contains(i.target))||(this.util.removeClass(t,"active"),e.relList.style.display="none",this.modalForm.removeEventListener("click",this.plugins.anchor._closeRelMenu),this.plugins.anchor._closeRelMenu=null)}.bind(this,e,t),this.modalForm.addEventListener("click",this.plugins.anchor._closeRelMenu)}else this.plugins.anchor._closeRelMenu&&this.plugins.anchor._closeRelMenu()},onClick_relButton:function(e,t){this.plugins.anchor.toggleRelList.call(this,e,!this.util.hasClass(t.target,"active"))},onClick_relList:function(e,t){const i=t.target,n=i.getAttribute("data-command");if(!n)return;const o=e.currentRel,l=this.util.toggleClass(i,"se-checked"),r=o.indexOf(n);l?-1===r&&o.push(n):r>-1&&o.splice(r,1),e.relPreview.title=e.relPreview.textContent=o.join(" ")},setRel:function(e,t){const i=e.relList,n=e.currentRel=t?t.split(" "):[];if(!i)return;const o=i.querySelectorAll("button");for(let e,t=0,i=o.length;t-1?this.util.addClass(o[t],"se-checked"):this.util.removeClass(o[t],"se-checked");e.relPreview.title=e.relPreview.textContent=n.join(" ")},createHeaderList:function(e,t,i){const n=this.util.getListChildren(this.context.element.wysiwyg,(function(e){return/h[1-6]/i.test(e.nodeName)}));if(0===n.length)return;const o=new this._w.RegExp("^"+i.replace(/^#/,""),"i"),l=[];let r="";for(let e,t=0,i=n.length;t'+e.textContent+"");0===l.length?this.plugins.selectMenu.close.call(this,t):(this.plugins.selectMenu.createList(t,l,r),this.plugins.selectMenu.open.call(this,t,this.plugins.anchor._setMenuListPosition.bind(this,e)))},_setMenuListPosition:function(e,t){t.style.top=e.urlInput.offsetHeight+1+"px"},onKeyDownUrlInput:function(e,t){switch(t.keyCode){case 38:t.preventDefault(),t.stopPropagation(),this.plugins.selectMenu.moveItem.call(this,e,-1);break;case 40:t.preventDefault(),t.stopPropagation(),this.plugins.selectMenu.moveItem.call(this,e,1);break;case 13:e.index>-1&&(t.preventDefault(),t.stopPropagation(),this.plugins.anchor.setHeaderBookmark.call(this,this.plugins.selectMenu.getItem(e,null)))}},setHeaderBookmark:function(e){const t=this.context.anchor.callerContext,i=e.id||"h_"+this._w.Math.random().toString().replace(/.+\./,"");e.id=i,t.urlInput.value="#"+i,t.anchorText.value.trim()&&t._change||(t.anchorText.value=e.textContent),this.plugins.anchor.setLinkPreview.call(this,t,t.urlInput.value),this.plugins.selectMenu.close.call(this,this.context.selectMenu.callerContext),this.context.anchor.callerContext.urlInput.focus()},onChangeAnchorText:function(e,t){e._change=!!t.target.value.trim()},onChangeUrlInput:function(e,t){const i=t.target.value.trim();this.plugins.anchor.setLinkPreview.call(this,e,i),this.plugins.anchor.selfPathBookmark.call(this,i)?this.plugins.anchor.createHeaderList.call(this,e,this.context.selectMenu.callerContext,i):this.plugins.selectMenu.close.call(this,this.context.selectMenu.callerContext)},onFocusUrlInput:function(e,t){const i=e.urlInput.value;this.plugins.anchor.selfPathBookmark.call(this,i)&&this.plugins.anchor.createHeaderList.call(this,e,t,i)},onBlurUrlInput:function(e){this.plugins.selectMenu.close.call(this,e)},setLinkPreview:function(e,t){const i=e.preview,n=this.options.linkProtocol,o=this.options.linkNoPrefix,l=/^(mailto\:|tel\:|sms\:|https*\:\/\/|#)/.test(t)||0===t.indexOf(n),r=!!n&&this._w.RegExp("^"+t.substr(0,n.length)).test(n);t=e.linkValue=i.textContent=t?o?t:!n||l||r?l?t:/^www\./.test(t)?"http://"+t:this.context.anchor.host+(/^\//.test(t)?"":"/")+t:n+t:"",this.plugins.anchor.selfPathBookmark.call(this,t)?(e.bookmark.style.display="block",this.util.addClass(e.bookmarkButton,"active")):(e.bookmark.style.display="none",this.util.removeClass(e.bookmarkButton,"active")),!this.plugins.anchor.selfPathBookmark.call(this,t)&&e.downloadCheck.checked?e.download.style.display="block":e.download.style.display="none"},setCtx:function(e,t){e&&(t.linkAnchor=e,t.linkValue=e.href,t.currentRel=e.rel.split(" "))},updateAnchor:function(e,t,i,n,o){!this.plugins.anchor.selfPathBookmark.call(this,t)&&n.downloadCheck.checked?e.setAttribute("download",i||t):e.removeAttribute("download"),n.newWindowCheck.checked?e.target="_blank":e.removeAttribute("target");const l=n.currentRel.join(" ");l?e.rel=l:e.removeAttribute("rel"),e.href=t,o?0===e.children.length&&(e.textContent=""):e.textContent=i},createAnchor:function(e,t){if(0===e.linkValue.length)return null;const i=e.linkValue,n=e.anchorText,o=0===n.value.length?i:n.value,l=e.linkAnchor||this.util.createElement("A");return this.plugins.anchor.updateAnchor.call(this,l,i,o,e,t),e.linkValue=e.preview.textContent=e.urlInput.value=e.anchorText.value="",l},onClick_bookmarkButton:function(e){let t=e.urlInput.value;this.plugins.anchor.selfPathBookmark.call(this,t)?(t=t.substr(1),e.bookmark.style.display="none",this.util.removeClass(e.bookmarkButton,"active"),this.plugins.selectMenu.close.call(this,this.context.selectMenu.callerContext)):(t="#"+t,e.bookmark.style.display="block",this.util.addClass(e.bookmarkButton,"active"),e.downloadCheck.checked=!1,e.download.style.display="none",this.plugins.anchor.createHeaderList.call(this,e,this.context.selectMenu.callerContext,t)),e.urlInput.value=t,this.plugins.anchor.setLinkPreview.call(this,e,t),e.urlInput.focus()},onChange_newWindowCheck:function(e,t){"string"==typeof e.linkDefaultRel.check_new_window&&(t.target.checked?this.plugins.anchor.setRel.call(this,e,this.plugins.anchor._relMerge.call(this,e,e.linkDefaultRel.check_new_window)):this.plugins.anchor.setRel.call(this,e,this.plugins.anchor._relDelete.call(this,e,e.linkDefaultRel.check_new_window)))},onChange_downloadCheck:function(e,t){t.target.checked?(e.download.style.display="block",e.bookmark.style.display="none",this.util.removeClass(e.bookmarkButton,"active"),e.linkValue=e.preview.textContent=e.urlInput.value=e.urlInput.value.replace(/^\#+/,""),"string"==typeof e.linkDefaultRel.check_bookmark&&this.plugins.anchor.setRel.call(this,e,this.plugins.anchor._relMerge.call(this,e,e.linkDefaultRel.check_bookmark))):(e.download.style.display="none","string"==typeof e.linkDefaultRel.check_bookmark&&this.plugins.anchor.setRel.call(this,e,this.plugins.anchor._relDelete.call(this,e,e.linkDefaultRel.check_bookmark)))},_relMerge:function(e,t){const i=e.currentRel;if(!t)return i.join(" ");if(/^only\:/.test(t))return t=t.replace(/^only\:/,"").trim(),e.currentRel=t.split(" "),t;const n=t.split(" ");for(let e,t=0,o=n.length;t'+n.cancel+''+t.dialogBox.linkBox.title+""+e.context.anchor.forms.innerHTML+'";return i.innerHTML=o,i},setController_LinkButton:function(e){const t=e.lang,i=e.icons,n=e.util.createElement("DIV");return n.className="se-controller se-controller-link",n.innerHTML='
    ",n},open:function(){this.plugins.dialog.open.call(this,"link","link"===this.currentControllerName)},submit:function(e){this.showLoading(),e.preventDefault(),e.stopPropagation();try{const e=this.plugins.anchor.createAnchor.call(this,this.context.anchor.caller.link,!1);if(null===e)return;if(this.context.dialog.updateModal){const e=this.context.link._linkAnchor.childNodes[0];this.setRange(e,0,e,e.textContent.length)}else{const t=this.getSelectedElements();if(t.length>1){const i=this.util.createElement(t[0].nodeName);if(i.appendChild(e),!this.insertNode(i,null,!0))return}else if(!this.insertNode(e,null,!0))return;this.setRange(e.childNodes[0],0,e.childNodes[0],e.textContent.length)}}finally{this.plugins.dialog.close.call(this),this.closeLoading(),this.history.push(!1)}return!1},active:function(e){if(e){if(this.util.isAnchor(e)&&null===e.getAttribute("data-image-link"))return this.controllerArray.indexOf(this.context.link.linkController)<0&&this.plugins.link.call_controller.call(this,e),!0}else this.controllerArray.indexOf(this.context.link.linkController)>-1&&this.controllersOff();return!1},on:function(e){this.plugins.anchor.on.call(this,this.context.anchor.caller.link,e)},call_controller:function(e){this.editLink=this.context.link._linkAnchor=this.context.anchor.caller.link.linkAnchor=e;const t=this.context.link.linkController,i=t.querySelector("a");i.href=e.href,i.title=e.textContent,i.textContent=e.textContent,this.util.addClass(e,"on"),this.setControllerPosition(t,e,"bottom",{left:0,top:0}),this.controllersOn(t,e,"link",this.util.removeClass.bind(this.util,this.context.link._linkAnchor,"on"))},onClick_linkController:function(e){e.stopPropagation();const t=e.target.getAttribute("data-command")||e.target.parentNode.getAttribute("data-command");if(t){if(e.preventDefault(),/update/.test(t))this.plugins.dialog.open.call(this,"link",!0);else if(/unlink/.test(t)){const e=this.util.getChildElement(this.context.link._linkAnchor,(function(e){return 0===e.childNodes.length||3===e.nodeType}),!1),t=this.util.getChildElement(this.context.link._linkAnchor,(function(e){return 0===e.childNodes.length||3===e.nodeType}),!0);this.setRange(e,0,t,t.textContent.length),this.nodeChange(null,null,["A"],!1)}else this.util.removeItem(this.context.link._linkAnchor),this.context.anchor.caller.link.linkAnchor=null,this.focus(),this.history.push(!1);this.controllersOff()}},init:function(){this.context.link.linkController.style.display="none",this.plugins.anchor.init.call(this,this.context.anchor.caller.link)}};var Ge=i(315),$e=i.n(Ge),Ye=i(345),Ke=i.n(Ye),Xe=i(913),Je=i.n(Xe);const Qe={name:"image",display:"dialog",add:function(e){e.addModule([We(),qe,$e(),Ke(),Je()]);const t=e.options,i=e.context,n=i.image={_infoList:[],_infoIndex:0,_uploadFileLength:0,focusElement:null,sizeUnit:t._imageSizeUnit,_linkElement:"",_altText:"",_align:"none",_floatClassRegExp:"__se__float\\-[a-z]+",_v_src:{_linkValue:""},svgDefaultSize:"30%",base64RenderIndex:0,_element:null,_cover:null,_container:null,inputX:null,inputY:null,_element_w:1,_element_h:1,_element_l:0,_element_t:0,_defaultSizeX:"auto",_defaultSizeY:"auto",_origin_w:"auto"===t.imageWidth?"":t.imageWidth,_origin_h:"auto"===t.imageHeight?"":t.imageHeight,_proportionChecked:!0,_resizing:t.imageResizing,_resizeDotHide:!t.imageHeightShow,_rotation:t.imageRotation,_alignHide:!t.imageAlignShow,_onlyPercentage:t.imageSizeOnlyPercentage,_ratio:!1,_ratioX:1,_ratioY:1,_captionShow:!0,_captionChecked:!1,_caption:null,captionCheckEl:null};let o=this.setDialog(e);n.modal=o,n.imgInputFile=o.querySelector("._se_image_file"),n.imgUrlFile=o.querySelector("._se_image_url"),n.focusElement=n.imgInputFile||n.imgUrlFile,n.altText=o.querySelector("._se_image_alt"),n.captionCheckEl=o.querySelector("._se_image_check_caption"),n.previewSrc=o.querySelector("._se_tab_content_image .se-link-preview"),o.querySelector(".se-dialog-tabs").addEventListener("click",this.openTab.bind(e)),o.querySelector("form").addEventListener("submit",this.submit.bind(e)),n.imgInputFile&&o.querySelector(".se-file-remove").addEventListener("click",this._removeSelectedFiles.bind(n.imgInputFile,n.imgUrlFile,n.previewSrc)),n.imgUrlFile&&n.imgUrlFile.addEventListener("input",this._onLinkPreview.bind(n.previewSrc,n._v_src,t.linkProtocol)),n.imgInputFile&&n.imgUrlFile&&n.imgInputFile.addEventListener("change",this._fileInputChange.bind(n));const l=o.querySelector(".__se__gallery");l&&l.addEventListener("click",this._openGallery.bind(e)),n.proportion={},n.inputX={},n.inputY={},t.imageResizing&&(n.proportion=o.querySelector("._se_image_check_proportion"),n.inputX=o.querySelector("._se_image_size_x"),n.inputY=o.querySelector("._se_image_size_y"),n.inputX.value=t.imageWidth,n.inputY.value=t.imageHeight,n.inputX.addEventListener("keyup",this.setInputSize.bind(e,"x")),n.inputY.addEventListener("keyup",this.setInputSize.bind(e,"y")),n.inputX.addEventListener("change",this.setRatio.bind(e)),n.inputY.addEventListener("change",this.setRatio.bind(e)),n.proportion.addEventListener("change",this.setRatio.bind(e)),o.querySelector(".se-dialog-btn-revert").addEventListener("click",this.sizeRevert.bind(e))),i.dialog.modal.appendChild(o),e.plugins.anchor.initEvent.call(e,"image",o.querySelector("._se_tab_content_url")),n.anchorCtx=e.context.anchor.caller.image,o=null},setDialog:function(e){const t=e.options,i=e.lang,n=e.util.createElement("DIV");n.className="se-dialog-content se-dialog-image",n.style.display="none";let o='
    '+i.dialogBox.imageBox.title+'
    ';if(t.imageFileInput&&(o+='
    "),t.imageUrlInput&&(o+='
    '+(t.imageGalleryUrl&&e.plugins.imageGallery?'":"")+'
    '),o+='
    ',t.imageResizing){const n=t.imageSizeOnlyPercentage,l=n?' style="display: none !important;"':"",r=t.imageHeightShow?"":' style="display: none !important;"';o+='
    ',n||!t.imageHeightShow?o+='
    ":o+='
    ",o+=' '+i.dialogBox.proportion+'
    "}return o+='
    ",n.innerHTML=o,n},_fileInputChange:function(){this.imgInputFile.value?(this.imgUrlFile.setAttribute("disabled",!0),this.previewSrc.style.textDecoration="line-through"):(this.imgUrlFile.removeAttribute("disabled"),this.previewSrc.style.textDecoration="")},_removeSelectedFiles:function(e,t){this.value="",e&&(e.removeAttribute("disabled"),t.style.textDecoration="")},_openGallery:function(){this.callPlugin("imageGallery",this.plugins.imageGallery.open.bind(this,this.plugins.image._setUrlInput.bind(this.context.image)),null)},_setUrlInput:function(e){this.altText.value=e.alt,this._v_src._linkValue=this.previewSrc.textContent=this.imgUrlFile.value=e.src,this.imgUrlFile.focus()},_onLinkPreview:function(e,t,i){const n=i.target.value.trim();e._linkValue=this.textContent=n?t&&-1===n.indexOf("://")&&0!==n.indexOf("#")?t+n:-1===n.indexOf("://")?"/"+n:n:""},fileTags:["img"],select:function(e){this.plugins.image.onModifyMode.call(this,e,this.plugins.resizing.call_controller_resize.call(this,e,"image"))},destroy:function(e){const t=e||this.context.image._element,i=this.util.getParentElement(t,this.util.isMediaComponent)||t,n=1*t.getAttribute("data-index");let o=i.previousElementSibling||i.nextElementSibling;const l=i.parentNode;this.util.removeItem(i),this.plugins.image.init.call(this),this.controllersOff(),l!==this.context.element.wysiwyg&&this.util.removeItemAllParents(l,(function(e){return 0===e.childNodes.length}),null),this.focusEdge(o),this.plugins.fileManager.deleteInfo.call(this,"image",n,this.functions.onImageUpload),this.history.push(!1)},on:function(e){const t=this.context.image;e?t.imgInputFile&&this.options.imageMultipleFile&&t.imgInputFile.removeAttribute("multiple"):(t.inputX.value=t._origin_w=this.options.imageWidth===t._defaultSizeX?"":this.options.imageWidth,t.inputY.value=t._origin_h=this.options.imageHeight===t._defaultSizeY?"":this.options.imageHeight,t.imgInputFile&&this.options.imageMultipleFile&&t.imgInputFile.setAttribute("multiple","multiple")),this.plugins.anchor.on.call(this,t.anchorCtx,e)},open:function(){this.plugins.dialog.open.call(this,"image","image"===this.currentControllerName)},openTab:function(e){const t=this.context.image.modal,i="init"===e?t.querySelector("._se_tab_link"):e.target;if(!/^BUTTON$/i.test(i.tagName))return!1;const n=i.getAttribute("data-tab-link"),o="_se_tab_content";let l,r,s;for(r=t.getElementsByClassName(o),l=0;l0?(this.showLoading(),i.submitAction.call(this,this.context.image.imgInputFile.files)):t.imgUrlFile&&t._v_src._linkValue.length>0&&(this.showLoading(),i.onRender_imgUrl.call(this,t._v_src._linkValue))}catch(e){throw this.closeLoading(),Error('[SUNEDITOR.image.submit.fail] cause : "'+e.message+'"')}finally{this.plugins.dialog.close.call(this)}return!1},submitAction:function(e){if(0===e.length)return;let t=0,i=[];for(let n=0,o=e.length;n0){let e=0;const i=this.context.image._infoList;for(let t=0,n=i.length;tn){this.closeLoading();const i="[SUNEDITOR.imageUpload.fail] Size of uploadable total images: "+n/1e3+"KB";return void(("function"!=typeof this.functions.onImageUploadError||this.functions.onImageUploadError(i,{limitSize:n,currentSize:e,uploadSize:t},this))&&this.functions.noticeOpen(i))}}const o=this.context.image;o._uploadFileLength=i.length;const l={anchor:this.plugins.anchor.createAnchor.call(this,o.anchorCtx,!0),inputWidth:o.inputX.value,inputHeight:o.inputY.value,align:o._align,isUpdate:this.context.dialog.updateModal,alt:o._altText,element:o._element};if("function"==typeof this.functions.onImageUploadBefore){const e=this.functions.onImageUploadBefore(i,l,this,function(e){e&&this._w.Array.isArray(e.result)?this.plugins.image.register.call(this,l,e):this.plugins.image.upload.call(this,l,e)}.bind(this));if(void 0===e)return;if(!e)return void this.closeLoading();this._w.Array.isArray(e)&&e.length>0&&(i=e)}this.plugins.image.upload.call(this,l,i)},error:function(e,t){if(this.closeLoading(),"function"!=typeof this.functions.onImageUploadError||this.functions.onImageUploadError(e,t,this))throw this.functions.noticeOpen(e),Error("[SUNEDITOR.plugin.image.error] response: "+e)},upload:function(e,t){if(!t)return void this.closeLoading();if("string"==typeof t)return void this.plugins.image.error.call(this,t,null);const i=this.options.imageUploadUrl,n=this.context.dialog.updateModal?1:t.length;if("string"==typeof i&&i.length>0){const o=new FormData;for(let e=0;e'+e.icons.cancel+''+i.dialogBox.videoBox.title+'
    ';if(t.videoFileInput&&(o+='
    "),t.videoUrlInput&&(o+='
    '),t.videoResizing){const n=t.videoRatioList||[{name:"16:9",value:.5625},{name:"4:3",value:.75},{name:"21:9",value:.4285}],l=t.videoRatio,r=t.videoSizeOnlyPercentage,s=r?' style="display: none !important;"':"",a=t.videoHeightShow?"":' style="display: none !important;"',c=t.videoRatioShow?"":' style="display: none !important;"',u=r||t.videoHeightShow||t.videoRatioShow?"":' style="display: none !important;"';o+='
    "}return o+='
    ",n.innerHTML=o,n},_fileInputChange:function(){this.videoInputFile.value?(this.videoUrlFile.setAttribute("disabled",!0),this.preview.style.textDecoration="line-through"):(this.videoUrlFile.removeAttribute("disabled"),this.preview.style.textDecoration="")},_removeSelectedFiles:function(e,t){this.value="",e&&(e.removeAttribute("disabled"),t.style.textDecoration="")},_onLinkPreview:function(e,t,i){const n=i.target.value.trim();/^$/.test(n)?(e._linkValue=n,this.textContent=''):e._linkValue=this.textContent=n?t&&-1===n.indexOf("://")&&0!==n.indexOf("#")?t+n:-1===n.indexOf("://")?"/"+n:n:""},_setTagAttrs:function(e){e.setAttribute("controls",!0);const t=this.options.videoTagAttrs;if(t)for(let i in t)this.util.hasOwn(t,i)&&e.setAttribute(i,t[i])},createVideoTag:function(){const e=this.util.createElement("VIDEO");return this.plugins.video._setTagAttrs.call(this,e),e},_setIframeAttrs:function(e){e.frameBorder="0",e.allowFullscreen=!0;const t=this.options.videoIframeAttrs;if(t)for(let i in t)this.util.hasOwn(t,i)&&e.setAttribute(i,t[i])},createIframeTag:function(){const e=this.util.createElement("IFRAME");return this.plugins.video._setIframeAttrs.call(this,e),e},fileTags:["iframe","video"],select:function(e){this.plugins.video.onModifyMode.call(this,e,this.plugins.resizing.call_controller_resize.call(this,e,"video"))},destroy:function(e){const t=e||this.context.video._element,i=this.context.video._container,n=1*t.getAttribute("data-index");let o=i.previousElementSibling||i.nextElementSibling;const l=i.parentNode;this.util.removeItem(i),this.plugins.video.init.call(this),this.controllersOff(),l!==this.context.element.wysiwyg&&this.util.removeItemAllParents(l,(function(e){return 0===e.childNodes.length}),null),this.focusEdge(o),this.plugins.fileManager.deleteInfo.call(this,"video",n,this.functions.onVideoUpload),this.history.push(!1)},on:function(e){const t=this.context.video;e?t.videoInputFile&&this.options.videoMultipleFile&&t.videoInputFile.removeAttribute("multiple"):(t.inputX.value=t._origin_w=this.options.videoWidth===t._defaultSizeX?"":this.options.videoWidth,t.inputY.value=t._origin_h=this.options.videoHeight===t._defaultSizeY?"":this.options.videoHeight,t.proportion.disabled=!0,t.videoInputFile&&this.options.videoMultipleFile&&t.videoInputFile.setAttribute("multiple","multiple")),t._resizing&&this.plugins.video.setVideoRatioSelect.call(this,t._origin_h||t._defaultRatio)},open:function(){this.plugins.dialog.open.call(this,"video","video"===this.currentControllerName)},setVideoRatio:function(e){const t=this.context.video,i=e.target.options[e.target.selectedIndex].value;t._defaultSizeY=t._videoRatio=i?100*i+"%":t._defaultSizeY,t.inputY.placeholder=i?100*i+"%":"",t.inputY.value=""},setInputSize:function(e,t){if(t&&32===t.keyCode)return void t.preventDefault();const i=this.context.video;this.plugins.resizing._module_setInputSize.call(this,i,e),"y"===e&&this.plugins.video.setVideoRatioSelect.call(this,t.target.value||i._defaultRatio)},setRatio:function(){this.plugins.resizing._module_setRatio.call(this,this.context.video)},submit:function(e){const t=this.context.video,i=this.plugins.video;e.preventDefault(),e.stopPropagation(),t._align=t.modal.querySelector('input[name="suneditor_video_radio"]:checked').value;try{t.videoInputFile&&t.videoInputFile.files.length>0?(this.showLoading(),i.submitAction.call(this,this.context.video.videoInputFile.files)):t.videoUrlFile&&t._linkValue.length>0&&(this.showLoading(),i.setup_url.call(this,t._linkValue))}catch(e){throw this.closeLoading(),Error('[SUNEDITOR.video.submit.fail] cause : "'+e.message+'"')}finally{this.plugins.dialog.close.call(this)}return!1},submitAction:function(e){if(0===e.length)return;let t=0,i=[];for(let n=0,o=e.length;n0){let e=0;const i=this.context.video._infoList;for(let t=0,n=i.length;tn){this.closeLoading();const i="[SUNEDITOR.videoUpload.fail] Size of uploadable total videos: "+n/1e3+"KB";return void(("function"!=typeof this.functions.onVideoUploadError||this.functions.onVideoUploadError(i,{limitSize:n,currentSize:e,uploadSize:t},this))&&this.functions.noticeOpen(i))}}const o=this.context.video;o._uploadFileLength=i.length;const l={inputWidth:o.inputX.value,inputHeight:o.inputY.value,align:o._align,isUpdate:this.context.dialog.updateModal,element:o._element};if("function"==typeof this.functions.onVideoUploadBefore){const e=this.functions.onVideoUploadBefore(i,l,this,function(e){e&&this._w.Array.isArray(e.result)?this.plugins.video.register.call(this,l,e):this.plugins.video.upload.call(this,l,e)}.bind(this));if(void 0===e)return;if(!e)return void this.closeLoading();"object"==typeof e&&e.length>0&&(i=e)}this.plugins.video.upload.call(this,l,i)},error:function(e,t){if(this.closeLoading(),"function"!=typeof this.functions.onVideoUploadError||this.functions.onVideoUploadError(e,t,this))throw this.functions.noticeOpen(e),Error("[SUNEDITOR.plugin.video.error] response: "+e)},upload:function(e,t){if(!t)return void this.closeLoading();if("string"==typeof t)return void this.plugins.video.error.call(this,t,null);const i=this.options.videoUploadUrl,n=this.context.dialog.updateModal?1:t.length;if(!("string"==typeof i&&i.length>0))throw Error('[SUNEDITOR.videoUpload.fail] cause : There is no "videoUploadUrl" option.');{const o=new FormData;for(let e=0;e$/.test(e)){if(0===(e=(new this._w.DOMParser).parseFromString(e,"text/html").querySelector("iframe").src).length)return!1}if(/youtu\.?be/.test(e)){if(/^http/.test(e)||(e="https://"+e),e=e.replace("watch?v=",""),/^\/\/.+\/embed\//.test(e)||(e=e.replace(e.match(/\/\/.+\//)[0],"//www.youtube.com/embed/").replace("&","?&")),t._youtubeQuery.length>0)if(/\?/.test(e)){const i=e.split("?");e=i[0]+"?"+t._youtubeQuery+"&"+i[1]}else e+="?"+t._youtubeQuery}else/vimeo\.com/.test(e)&&(e.endsWith("/")&&(e=e.slice(0,-1)),e="https://player.vimeo.com/video/"+e.slice(e.lastIndexOf("/")+1));this.plugins.video.create_video.call(this,this.plugins.video[/embed|iframe|player|\/e\/|\.php|\.html?/.test(e)||/vimeo\.com/.test(e)?"createIframeTag":"createVideoTag"].call(this),e,t.inputX.value,t.inputY.value,t._align,null,this.context.dialog.updateModal)}catch(e){throw Error('[SUNEDITOR.video.upload.fail] cause : "'+e.message+'"')}finally{this.closeLoading()}},create_video:function(e,t,i,n,o,l,r){this.context.resizing._resize_plugin="video";const s=this.context.video;let a=null,c=null,u=!1;if(r){if((e=s._element).src!==t){u=!0;const i=/youtu\.?be/.test(t),n=/vimeo\.com/.test(t);if(!i&&!n||/^iframe$/i.test(e.nodeName))if(i||n||/^videoo$/i.test(e.nodeName))e.src=t;else{const i=this.plugins.video.createVideoTag.call(this);i.src=t,e.parentNode.replaceChild(i,e),s._element=e=i}else{const i=this.plugins.video.createIframeTag.call(this);i.src=t,e.parentNode.replaceChild(i,e),s._element=e=i}}c=s._container,a=this.util.getParentElement(e,"FIGURE")}else u=!0,e.src=t,s._element=e,a=this.plugins.component.set_cover.call(this,e),c=this.plugins.component.set_container.call(this,a,"se-video-container");s._cover=a,s._container=c;const d=this.plugins.resizing._module_getSizeX.call(this,s)!==(i||s._defaultSizeX)||this.plugins.resizing._module_getSizeY.call(this,s)!==(n||s._videoRatio),h=!r||d;s._resizing&&(this.context.video._proportionChecked=s.proportion.checked,e.setAttribute("data-proportion",s._proportionChecked));let p=!1;h&&(p=this.plugins.video.applySize.call(this)),p&&"center"===o||this.plugins.video.setAlign.call(this,null,e,a,c);let f=!0;if(r)s._resizing&&this.context.resizing._rotateVertical&&h&&this.plugins.resizing.setTransformSize.call(this,e,null,null);else if(f=this.insertComponent(c,!1,!0,!this.options.mediaAutoSelect),!this.options.mediaAutoSelect){const e=this.appendFormatTag(c,null);e&&this.setRange(e,0,e,0)}f&&(u&&this.plugins.fileManager.setInfo.call(this,"video",e,this.functions.onVideoUpload,l,!0),r&&(this.selectComponent(e,"video"),this.history.push(!1))),this.context.resizing._resize_plugin=""},_update_videoCover:function(e){if(!e)return;const t=this.context.video;/^video$/i.test(e.nodeName)?this.plugins.video._setTagAttrs.call(this,e):this.plugins.video._setIframeAttrs.call(this,e);let i=this.util.isRangeFormatElement(e.parentNode)||this.util.isWysiwygDiv(e.parentNode)?e:this.util.getFormatElement(e)||e;const n=e;t._element=e=e.cloneNode(!0);const o=t._cover=this.plugins.component.set_cover.call(this,e),l=t._container=this.plugins.component.set_container.call(this,o,"se-video-container");try{const r=i.querySelector("figcaption");let s=null;r&&(s=this.util.createElement("DIV"),s.innerHTML=r.innerHTML,this.util.removeItem(r));const a=(e.getAttribute("data-size")||e.getAttribute("data-origin")||"").split(",");this.plugins.video.applySize.call(this,a[0]||n.style.width||n.width||"",a[1]||n.style.height||n.height||"");const c=this.util.getFormatElement(n);if(c&&(t._align=c.style.textAlign||c.style.float),this.plugins.video.setAlign.call(this,null,e,o,l),this.util.getParentElement(n,this.util.isNotCheckingNode))n.parentNode.replaceChild(l,n);else if(this.util.isListCell(i)){const e=this.util.getParentElement(n,(function(e){return e.parentNode===i}));i.insertBefore(l,e),this.util.removeItem(n),this.util.removeEmptyNode(e,null,!0)}else if(this.util.isFormatElement(i)){const e=this.util.getParentElement(n,(function(e){return e.parentNode===i}));i=this.util.splitElement(i,e),i.parentNode.insertBefore(l,i),this.util.removeItem(n),this.util.removeEmptyNode(i,null,!0),0===i.children.length&&(i.innerHTML=this.util.htmlRemoveWhiteSpace(i.innerHTML))}else i.parentNode.replaceChild(l,i);s&&i.parentNode.insertBefore(s,l.nextElementSibling)}catch(e){console.warn("[SUNEDITOR.video.error] Maybe the video tag is nested.",e)}this.plugins.fileManager.setInfo.call(this,"video",e,this.functions.onVideoUpload,null,!0),this.plugins.video.init.call(this)},onModifyMode:function(e,t){const i=this.context.video;i._element=e,i._cover=this.util.getParentElement(e,"FIGURE"),i._container=this.util.getParentElement(e,this.util.isMediaComponent),i._align=e.style.float||e.getAttribute("data-align")||"none",e.style.float="",t&&(i._element_w=t.w,i._element_h=t.h,i._element_t=t.t,i._element_l=t.l);let n,o,l=i._element.getAttribute("data-size")||i._element.getAttribute("data-origin");l?(l=l.split(","),n=l[0],o=l[1]):t&&(n=t.w,o=t.h),i._origin_w=n||e.style.width||e.width||"",i._origin_h=o||e.style.height||e.height||""},openModify:function(e){const t=this.context.video;if(t.videoUrlFile&&(t._linkValue=t.preview.textContent=t.videoUrlFile.value=t._element.src||(t._element.querySelector("source")||"").src||""),(t.modal.querySelector('input[name="suneditor_video_radio"][value="'+t._align+'"]')||t.modal.querySelector('input[name="suneditor_video_radio"][value="none"]')).checked=!0,t._resizing){this.plugins.resizing._module_setModifyInputSize.call(this,t,this.plugins.video);const e=t._videoRatio=this.plugins.resizing._module_getSizeY.call(this,t);this.plugins.video.setVideoRatioSelect.call(this,e)||(t.inputY.value=t._onlyPercentage?this.util.getNumber(e,2):e)}e||this.plugins.dialog.open.call(this,"video",!0)},setVideoRatioSelect:function(e){let t=!1;const i=this.context.video,n=i.videoRatioOption.options;/%$/.test(e)||i._onlyPercentage?e=this.util.getNumber(e,2)/100+"":(!this.util.isNumber(e)||1*e>=1)&&(e=""),i.inputY.placeholder="";for(let o=0,l=n.length;o'+e.icons.cancel+''+i.dialogBox.audioBox.title+'
    ';return t.audioFileInput&&(o+='
    "),t.audioUrlInput&&(o+='
    '),o+='
    ",n.innerHTML=o,n},setController:function(e){const t=e.lang,i=e.icons,n=e.util.createElement("DIV");return n.className="se-controller se-controller-link",n.innerHTML='
    ",n},_fileInputChange:function(){this.audioInputFile.value?(this.audioUrlFile.setAttribute("disabled",!0),this.preview.style.textDecoration="line-through"):(this.audioUrlFile.removeAttribute("disabled"),this.preview.style.textDecoration="")},_removeSelectedFiles:function(e,t){this.value="",e&&(e.removeAttribute("disabled"),t.style.textDecoration="")},_createAudioTag:function(){const e=this.util.createElement("AUDIO");this.plugins.audio._setTagAttrs.call(this,e);const t=this.context.audio._origin_w,i=this.context.audio._origin_h;return e.setAttribute("origin-size",t+","+i),e.style.cssText=(t?"width:"+t+"; ":"")+(i?"height:"+i+";":""),e},_setTagAttrs:function(e){e.setAttribute("controls",!0);const t=this.options.audioTagAttrs;if(t)for(let i in t)this.util.hasOwn(t,i)&&e.setAttribute(i,t[i])},_onLinkPreview:function(e,t,i){const n=i.target.value.trim();e._linkValue=this.textContent=n?t&&-1===n.indexOf("://")&&0!==n.indexOf("#")?t+n:-1===n.indexOf("://")?"/"+n:n:""},fileTags:["audio"],select:function(e){this.plugins.audio.onModifyMode.call(this,e)},destroy:function(e){e=e||this.context.audio._element;const t=this.util.getParentElement(e,this.util.isComponent)||e,i=1*e.getAttribute("data-index"),n=t.previousElementSibling||t.nextElementSibling,o=t.parentNode;this.util.removeItem(t),this.plugins.audio.init.call(this),this.controllersOff(),o!==this.context.element.wysiwyg&&this.util.removeItemAllParents(o,(function(e){return 0===e.childNodes.length}),null),this.focusEdge(n),this.plugins.fileManager.deleteInfo.call(this,"audio",i,this.functions.onAudioUpload),this.history.push(!1)},checkFileInfo:function(){this.plugins.fileManager.checkInfo.call(this,"audio",["audio"],this.functions.onAudioUpload,this.plugins.audio.updateCover.bind(this),!1)},resetFileInfo:function(){this.plugins.fileManager.resetInfo.call(this,"audio",this.functions.onAudioUpload)},on:function(e){const t=this.context.audio;e?t._element?(this.context.dialog.updateModal=!0,t._linkValue=t.preview.textContent=t.audioUrlFile.value=t._element.src,t.audioInputFile&&this.options.audioMultipleFile&&t.audioInputFile.removeAttribute("multiple")):t.audioInputFile&&this.options.audioMultipleFile&&t.audioInputFile.removeAttribute("multiple"):(this.plugins.audio.init.call(this),t.audioInputFile&&this.options.audioMultipleFile&&t.audioInputFile.setAttribute("multiple","multiple"))},open:function(){this.plugins.dialog.open.call(this,"audio","audio"===this.currentControllerName)},submit:function(e){const t=this.context.audio;e.preventDefault(),e.stopPropagation();try{t.audioInputFile&&t.audioInputFile.files.length>0?(this.showLoading(),this.plugins.audio.submitAction.call(this,t.audioInputFile.files)):t.audioUrlFile&&t._linkValue.length>0&&(this.showLoading(),this.plugins.audio.setupUrl.call(this,t._linkValue))}catch(e){throw this.closeLoading(),Error('[SUNEDITOR.audio.submit.fail] cause : "'+e.message+'"')}finally{this.plugins.dialog.close.call(this)}return!1},submitAction:function(e){if(0===e.length)return;let t=0,i=[];for(let n=0,o=e.length;n0){let e=0;const i=this.context.audio._infoList;for(let t=0,n=i.length;tn){this.closeLoading();const i="[SUNEDITOR.audioUpload.fail] Size of uploadable total audios: "+n/1e3+"KB";return void(("function"!=typeof this.functions.onAudioUploadError||this.functions.onAudioUploadError(i,{limitSize:n,currentSize:e,uploadSize:t},this))&&this.functions.noticeOpen(i))}}const o=this.context.audio;o._uploadFileLength=i.length;const l={isUpdate:this.context.dialog.updateModal,element:o._element};if("function"==typeof this.functions.onAudioUploadBefore){const e=this.functions.onAudioUploadBefore(i,l,this,function(e){e&&this._w.Array.isArray(e.result)?this.plugins.audio.register.call(this,l,e):this.plugins.audio.upload.call(this,l,e)}.bind(this));if(void 0===e)return;if(!e)return void this.closeLoading();"object"==typeof e&&e.length>0&&(i=e)}this.plugins.audio.upload.call(this,l,i)},error:function(e,t){if(this.closeLoading(),"function"!=typeof this.functions.onAudioUploadError||this.functions.onAudioUploadError(e,t,this))throw this.functions.noticeOpen(e),Error("[SUNEDITOR.plugin.audio.exception] response: "+e)},upload:function(e,t){if(!t)return void this.closeLoading();if("string"==typeof t)return void this.plugins.audio.error.call(this,t,null);const i=this.options.audioUploadUrl,n=this.context.dialog.updateModal?1:t.length,o=new FormData;for(let e=0;e'+e.icons.cancel+''+t.dialogBox.mathBox.title+'

    ",e.context.math.defaultFontSize=o,i.innerHTML=l,i},setController_MathButton:function(e){const t=e.lang,i=e.util.createElement("DIV");return i.className="se-controller se-controller-link",i.innerHTML='
    ",i},open:function(){this.plugins.dialog.open.call(this,"math","math"===this.currentControllerName)},managedTags:function(){return{className:"katex",method:function(e){if(!e.getAttribute("data-exp")||!this.options.katex)return;const t=this._d.createRange().createContextualFragment(this.plugins.math._renderer.call(this,this.util.HTMLDecoder(e.getAttribute("data-exp"))));e.innerHTML=t.querySelector(".katex").innerHTML,e.setAttribute("contenteditable",!1)}}},_renderer:function(e){let t="";try{this.util.removeClass(this.context.math.focusElement,"se-error"),t=this.options.katex.src.renderToString(e,{throwOnError:!0,displayMode:!0})}catch(e){this.util.addClass(this.context.math.focusElement,"se-error"),t='Katex syntax error. (Refer KaTeX)',console.warn("[SUNEDITOR.math.Katex.error] ",e)}return t},_renderMathExp:function(e,t){e.previewElement.innerHTML=this.plugins.math._renderer.call(this,t.target.value)},submit:function(e){this.showLoading(),e.preventDefault(),e.stopPropagation();const t=function(){if(0===this.context.math.focusElement.value.trim().length)return!1;const e=this.context.math,t=e.focusElement.value,i=e.previewElement.querySelector(".katex");if(!i)return!1;if(i.className="__se__katex "+i.className,i.setAttribute("contenteditable",!1),i.setAttribute("data-exp",this.util.HTMLEncoder(t)),i.setAttribute("data-font-size",e.fontSizeElement.value),i.style.fontSize=e.fontSizeElement.value,this.context.dialog.updateModal){const t=this.util.getParentElement(e._mathExp,".katex");t.parentNode.replaceChild(i,t),this.setRange(i,0,i,1)}else{const e=this.getSelectedElements();if(e.length>1){const t=this.util.createElement(e[0].nodeName);if(t.appendChild(i),!this.insertNode(t,null,!0))return!1}else if(!this.insertNode(i,null,!0))return!1;const t=this.util.createTextNode(this.util.zeroWidthSpace);i.parentNode.insertBefore(t,i.nextSibling),this.setRange(i,0,i,1)}return e.focusElement.value="",e.fontSizeElement.value="1em",e.previewElement.style.fontSize="1em",e.previewElement.innerHTML="",!0}.bind(this);try{t()&&(this.plugins.dialog.close.call(this),this.history.push(!1))}catch(e){this.plugins.dialog.close.call(this)}finally{this.closeLoading()}return!1},active:function(e){if(e){if(e.getAttribute("data-exp"))return this.controllerArray.indexOf(this.context.math.mathController)<0&&(this.setRange(e,0,e,1),this.plugins.math.call_controller.call(this,e)),!0}else this.controllerArray.indexOf(this.context.math.mathController)>-1&&this.controllersOff();return!1},on:function(e){if(e){const e=this.context.math;if(e._mathExp){const t=this.util.HTMLDecoder(e._mathExp.getAttribute("data-exp")),i=e._mathExp.getAttribute("data-font-size")||"1em";this.context.dialog.updateModal=!0,e.focusElement.value=t,e.fontSizeElement.value=i,e.previewElement.innerHTML=this.plugins.math._renderer.call(this,t),e.previewElement.style.fontSize=i}}else this.plugins.math.init.call(this)},call_controller:function(e){this.context.math._mathExp=e;const t=this.context.math.mathController;this.setControllerPosition(t,e,"bottom",{left:0,top:0}),this.controllersOn(t,e,"math")},onClick_mathController:function(e){e.stopPropagation();const t=e.target.getAttribute("data-command")||e.target.parentNode.getAttribute("data-command");t&&(e.preventDefault(),/update/.test(t)?(this.context.math.focusElement.value=this.util.HTMLDecoder(this.context.math._mathExp.getAttribute("data-exp")),this.plugins.dialog.open.call(this,"math",!0)):(this.util.removeItem(this.context.math._mathExp),this.context.math._mathExp=null,this.focus(),this.history.push(!1)),this.controllersOff())},init:function(){const e=this.context.math;e.mathController.style.display="none",e._mathExp=null,e.focusElement.value="",e.previewElement.innerHTML=""}};var ot=i(438),lt=i.n(ot);const rt={name:"imageGallery",add:function(e){e.addModule([lt()]);e.context.imageGallery={title:e.lang.toolbar.imageGallery,url:e.options.imageGalleryUrl,header:e.options.imageGalleryHeader,listClass:"se-image-list",itemTemplateHandler:this.drawItems,selectorHandler:this.setImage.bind(e),columnSize:4}},open:function(e){this.plugins.fileBrowser.open.call(this,"imageGallery",e)},drawItems:function(e){const t=e.src.split("/").pop();return'
    '+(e.alt||t)+'
    '+(e.name||t)+"
    "},setImage:function(e,t){this.callPlugin("image",function(){const i={name:t,size:0};this.plugins.image.create_image.call(this,e.getAttribute("data-value"),null,this.context.image._origin_w,this.context.image._origin_h,"none",i,e.alt)}.bind(this),null)}},st={blockquote:{name:"blockquote",display:"command",add:function(e,t){e.context.blockquote={targetButton:t,tag:e.util.createElement("BLOCKQUOTE")}},active:function(e){if(e){if(/blockquote/i.test(e.nodeName))return this.util.addClass(this.context.blockquote.targetButton,"active"),!0}else this.util.removeClass(this.context.blockquote.targetButton,"active");return!1},action:function(){const e=this.util.getParentElement(this.getSelectionNode(),"blockquote");e?this.detachRangeFormatElement(e,null,null,!1,!1):this.applyRangeFormatElement(this.context.blockquote.tag.cloneNode(!1))}},align:{name:"align",display:"submenu",add:function(e,t){const i=e.icons,n=e.context;n.align={targetButton:t,_itemMenu:null,_alignList:null,currentAlign:"",defaultDir:e.options.rtl?"right":"left",icons:{justify:i.align_justify,left:i.align_left,right:i.align_right,center:i.align_center}};let o=this.setSubmenu(e),l=n.align._itemMenu=o.querySelector("ul");l.addEventListener("click",this.pickup.bind(e)),n.align._alignList=l.querySelectorAll("li button"),e.initMenuTarget(this.name,t,o),o=null,l=null},setSubmenu:function(e){const t=e.lang,i=e.icons,n=e.util.createElement("DIV"),o=e.options.alignItems;let l="";for(let e,n,r=0;r";return n.className="se-submenu se-list-layer se-list-align",n.innerHTML='
      '+l+"
    ",n},active:function(e){const t=this.context.align,i=t.targetButton,n=i.firstElementChild;if(e){if(this.util.isFormatElement(e)){const o=e.style.textAlign;if(o)return this.util.changeElement(n,t.icons[o]||t.icons[t.defaultDir]),i.setAttribute("data-focus",o),!0}}else this.util.changeElement(n,t.icons[t.defaultDir]),i.removeAttribute("data-focus");return!1},on:function(){const e=this.context.align,t=e._alignList,i=e.targetButton.getAttribute("data-focus")||e.defaultDir;if(i!==e.currentAlign){for(let e=0,n=t.length;e
    • ";for(l=0,r=s.length;l";return a+="
    ",i.innerHTML=a,i},active:function(e){const t=this.context.font.targetText,i=this.context.font.targetTooltip;if(e){if(e.style&&e.style.fontFamily.length>0){const n=e.style.fontFamily.replace(/["']/g,"");return this.util.changeTxt(t,n),this.util.changeTxt(i,this.lang.toolbar.font+" ("+n+")"),!0}}else{const e=this.hasFocus?this.wwComputedStyle.fontFamily:this.lang.toolbar.font;this.util.changeTxt(t,e),this.util.changeTxt(i,this.hasFocus?this.lang.toolbar.font+(e?" ("+e+")":""):e)}return!1},on:function(){const e=this.context.font,t=e._fontList,i=e.targetText.textContent;if(i!==e.currentFont){for(let e=0,n=t.length;e('+i.toolbar.default+")";for(let e,i=0,n=t.fontSizeUnit,r=o.length;i";return l+="",n.innerHTML=l,n},active:function(e){if(e){if(e.style&&e.style.fontSize.length>0)return this.util.changeTxt(this.context.fontSize.targetText,this._convertFontSize.call(this,this.options.fontSizeUnit,e.style.fontSize)),!0}else this.util.changeTxt(this.context.fontSize.targetText,this.hasFocus?this._convertFontSize.call(this,this.options.fontSizeUnit,this.wwComputedStyle.fontSize):this.lang.toolbar.fontSize);return!1},on:function(){const e=this.context.fontSize,t=e._sizeList,i=e.targetText.textContent;if(i!==e.currentSize){for(let e=0,n=t.length;e";return i.className="se-submenu se-list-layer se-list-line",i.innerHTML='
      '+o+"
    ",i},active:function(e){if(e){if(/HR/i.test(e.nodeName))return this.context.horizontalRule.currentHR=e,this.util.hasClass(e,"on")||(this.util.addClass(e,"on"),this.controllersOn("hr",this.util.removeClass.bind(this.util,e,"on"))),!0}else this.util.hasClass(this.context.horizontalRule.currentHR,"on")&&this.controllersOff();return!1},appendHr:function(e){return this.focus(),this.insertComponent(e.cloneNode(!1),!1,!0,!1)},horizontalRulePick:function(e){e.preventDefault(),e.stopPropagation();let t=e.target,i=t.getAttribute("data-command");for(;!i&&!/UL/i.test(t.tagName);)t=t.parentNode,i=t.getAttribute("data-command");if(!i)return;const n=this.plugins.horizontalRule.appendHr.call(this,t.firstElementChild);n&&(this.setRange(n,0,n,0),this.submenuOff())}},list:{name:"list",display:"submenu",add:function(e,t){const i=e.context;i.list={targetButton:t,_list:null,currentList:"",icons:{bullets:e.icons.list_bullets,number:e.icons.list_number}};let n=this.setSubmenu(e),o=n.querySelector("ul");o.addEventListener("click",this.pickup.bind(e)),i.list._list=o.querySelectorAll("li button"),e.initMenuTarget(this.name,t,n),n=null,o=null},setSubmenu:function(e){const t=e.lang,i=e.util.createElement("DIV");return i.className="se-submenu se-list-layer",i.innerHTML='
    ",i},active:function(e){const t=this.context.list.targetButton,i=t.firstElementChild,n=this.util;if(n.isList(e)){const o=e.nodeName;return t.setAttribute("data-focus",o),n.addClass(t,"active"),/UL/i.test(o)?n.changeElement(i,this.context.list.icons.bullets):n.changeElement(i,this.context.list.icons.number),!0}return t.removeAttribute("data-focus"),n.changeElement(i,this.context.list.icons.number),n.removeClass(t,"active"),!1},on:function(){const e=this.context.list,t=e._list,i=e.targetButton.getAttribute("data-focus")||"";if(i!==e.currentList){for(let e=0,n=t.length;e"),t.innerHTML+=i.outerHTML,e&&(t.innerHTML+="
    ")}else{const e=i.childNodes;for(;e[0];)t.appendChild(e[0])}s.appendChild(t),a||(h=s),a&&m===f&&!l.isRangeFormatElement(v)||(u||(u=s),n&&a&&m===f||a&&l.isList(f)&&f===c||s.parentNode!==m&&m.insertBefore(s,v)),l.removeItem(i),n&&null===p&&(p=s.children.length-1),a&&(l.getRangeFormatElement(f,g)!==l.getRangeFormatElement(c,g)||l.isList(f)&&l.isList(c)&&l.getElementDepth(f)!==l.getElementDepth(c))&&(s=l.createElement(e)),b&&0===b.children.length&&l.removeItem(b)}else l.removeItem(i);p&&(u=u.children[p]),r&&(f=s.children.length-1,s.innerHTML+=c.innerHTML,h=s.children[f],l.removeItem(c))}else{if(i)for(let e=0,t=o.length;e=0;i--)if(o[i].contains(o[e])){o.splice(e,1),e--,t--;break}const t=l.getRangeFormatElement(r),n=t&&t.tagName===e;let s,a;const c=function(e){return!this.isComponent(e)}.bind(l);n||(a=l.createElement(e));for(let t,r,u=0,d=o.length;u0){const e=o.cloneNode(!1),t=o.childNodes,l=this.util.getPositionIndex(n);for(;t[l];)e.appendChild(t[l]);i.appendChild(e)}0===o.children.length&&this.util.removeItem(o),this.util.mergeSameTags(r);const s=this.util.getEdgeChildNodes(t,i);return{cc:t.parentNode,sc:s.sc,ec:s.ec}},editInsideList:function(e,t){const i=(t=t||this.getSelectedElements().filter(function(e){return this.isListCell(e)}.bind(this.util))).length;if(0===i||!e&&!this.util.isListCell(t[0].previousElementSibling)&&!this.util.isListCell(t[i-1].nextElementSibling))return{sc:t[0],so:0,ec:t[i-1],eo:1};let n=t[0].parentNode,o=t[i-1],l=null;if(e){if(n!==o.parentNode&&this.util.isList(o.parentNode.parentNode)&&o.nextElementSibling)for(o=o.nextElementSibling;o;)t.push(o),o=o.nextElementSibling;l=this.plugins.list.editList.call(this,n.nodeName.toUpperCase(),t,!0)}else{let e=this.util.createElement(n.nodeName),r=t[0].previousElementSibling,s=o.nextElementSibling;const a={s:null,e:null,sl:n,el:n};for(let o,l=0,c=i;l span > span"),n.columnFixedButton=r.querySelector("._se_table_fixed_column"),n.headerButton=r.querySelector("._se_table_header");let s=this.setController_tableEditor(e,n.cellControllerTop);n.resizeDiv=s,n.splitMenu=s.querySelector(".se-btn-group-sub"),n.mergeButton=s.querySelector("._se_table_merge_button"),n.splitButton=s.querySelector("._se_table_split_button"),n.insertRowAboveButton=s.querySelector("._se_table_insert_row_a"),n.insertRowBelowButton=s.querySelector("._se_table_insert_row_b"),l.addEventListener("mousemove",this.onMouseMove_tablePicker.bind(e,n)),l.addEventListener("click",this.appendTable.bind(e)),s.addEventListener("click",this.onClick_tableController.bind(e)),r.addEventListener("click",this.onClick_tableController.bind(e)),e.initMenuTarget(this.name,t,o),i.element.relative.appendChild(s),i.element.relative.appendChild(r),o=null,l=null,s=null,r=null,n=null},setSubmenu:function(e){const t=e.util.createElement("DIV");return t.className="se-submenu se-selector-table",t.innerHTML='
    1 x 1
    ',t},setController_table:function(e){const t=e.lang,i=e.icons,n=e.util.createElement("DIV");return n.className="se-controller se-controller-table",n.innerHTML='
    ",n},setController_tableEditor:function(e,t){const i=e.lang,n=e.icons,o=e.util.createElement("DIV");return o.className="se-controller se-controller-table-cell",o.innerHTML=(t?"":'
    ')+'
    • '+i.controller.VerticalSplit+'
    • '+i.controller.HorizontalSplit+"
    ",o},appendTable:function(){const e=this.util.createElement("TABLE"),t=this.plugins.table.createCells,i=this.context.table._tableXY[0];let n=this.context.table._tableXY[1],o="";for(;n>0;)o+=""+t.call(this,"td",i)+"",--n;o+="",e.innerHTML=o;if(this.insertComponent(e,!1,!0,!1)){const t=e.querySelector("td div");this.setRange(t,0,t,0),this.plugins.table.reset_table_picker.call(this)}},createCells:function(e,t,i){if(e=e.toLowerCase(),i){const t=this.util.createElement(e);return t.innerHTML="

    ",t}{let i="";for(;t>0;)i+="<"+e+">

    ",t--;return i}},onMouseMove_tablePicker:function(e,t){t.stopPropagation();let i=this._w.Math.ceil(t.offsetX/18),n=this._w.Math.ceil(t.offsetY/18);i=i<1?1:i,n=n<1?1:n,e._rtl&&(e.tableHighlight.style.left=18*i-13+"px",i=11-i),e.tableHighlight.style.width=i+"em",e.tableHighlight.style.height=n+"em",this.util.changeTxt(e.tableDisplay,i+" x "+n),e._tableXY=[i,n]},reset_table_picker:function(){if(!this.context.table.tableHighlight)return;const e=this.context.table.tableHighlight.style,t=this.context.table.tableUnHighlight.style;e.width="1em",e.height="1em",t.width="10em",t.height="10em",this.util.changeTxt(this.context.table.tableDisplay,"1 x 1"),this.submenuOff()},init:function(){const e=this.context.table,t=this.plugins.table;if(t._removeEvents.call(this),t._selectedTable){const e=t._selectedTable.querySelectorAll(".se-table-selected-cell");for(let t=0,i=e.length;t0)for(let e,t=0;tl||(d>=e.index?(n+=e.cs,d+=e.cs,e.rs-=1,e.row=l+1,e.rs<1&&(a.splice(t,1),t--)):h===p-1&&(e.rs-=1,e.row=l+1,e.rs<1&&(a.splice(t,1),t--)));if(l===r&&h===o){i._logical_cellIndex=d;break}u>0&&s.push({index:d,cs:c+1,rs:u,row:-1}),n+=c}a=a.concat(s).sort((function(e,t){return e.index-t.index})),s=[]}s=null,a=null}},editTable:function(e,t){const i=this.plugins.table,n=this.context.table,o=n._element,l="row"===e;if(l){const e=n._trElement.parentNode;if(/^THEAD$/i.test(e.nodeName)){if("up"===t)return;if(!e.nextElementSibling||!/^TBODY$/i.test(e.nextElementSibling.nodeName))return void(o.innerHTML+=""+i.createCells.call(this,"td",n._logical_cellCnt,!1)+"")}}if(i._ref){const e=n._tdElement,o=i._selectedCells;if(l)if(t)i.setCellInfo.call(this,"up"===t?o[0]:o[o.length-1],!0),i.editRow.call(this,t,e);else{let e=o[0].parentNode;const n=[o[0]];for(let t,i=1,l=o.length;ir&&r>t&&(e[o].rowSpan=i+s,c-=n)}if(n){const e=a[l+1];if(e){const t=[];let i=a[l].cells,n=0;for(let e,o,l=0,r=i.length;l1&&(e.rowSpan-=1,t.push({cell:e.cloneNode(!1),index:o}));if(t.length>0){let o=t.shift();i=e.cells,n=0;for(let l,r,s=0,a=i.length;s=o.index)||(s--,n--,n+=o.cell.colSpan-1,e.insertBefore(o.cell,l),o=t.shift(),o));s++);if(o){e.appendChild(o.cell);for(let i=0,n=t.length;i0){const e=!l[b+1];for(let t,i=0;iv||(f>=t.index?(m+=t.cs,f=b+m,t.rs-=1,t.row=v+1,t.rs<1&&(u.splice(i,1),i--)):e&&(t.rs-=1,t.row=v+1,t.rs<1&&(u.splice(i,1),i--)))}i>0&&c.push({rs:i,cs:a+1,index:f,row:-1}),f>=t&&f+a<=t+r?h.push(e):f<=t+r&&f+a>=t?e.colSpan-=n.getOverlapRangeAtIndex(s,s+r,f,f+a):i>0&&(ft+r)&&p.push({cell:e,i:v,rs:v+i}),m+=a}else{if(b>=t)break;if(a>0){if(d<1&&a+b>=t){e.colSpan+=1,t=null,d=i+1;break}t-=a}if(!g){for(let e,i=0;i0){d-=1;continue}null!==t&&l.length>0&&(f=this.plugins.table.createCells.call(this,l[0].nodeName,0,!0),f=e.insertBefore(f,l[t]))}}if(o){let e,t;for(let i,o=0,l=h.length;o1)c.colSpan=this._w.Math.floor(e/2),o.colSpan=e-c.colSpan,r.insertBefore(c,o.nextElementSibling);else{let t=[],i=[];for(let r,a,c=0,u=n._rowCnt;c0)for(let e,t=0;tc||(d>=e.index?(a+=e.cs,d+=e.cs,e.rs-=1,e.row=c+1,e.rs<1&&(i.splice(t,1),t--)):h===p-1&&(e.rs-=1,e.row=c+1,e.rs<1&&(i.splice(t,1),t--)));if(d<=s&&u>0&&t.push({index:d,cs:l+1,rs:u,row:-1}),n!==o&&d<=s&&d+l>=s+e-1){n.colSpan+=1;break}if(d>s)break;a+=l}i=i.concat(t).sort((function(e,t){return e.index-t.index})),t=[]}r.insertBefore(c,o.nextElementSibling)}}else{const e=o.rowSpan;if(c.colSpan=o.colSpan,e>1){c.rowSpan=this._w.Math.floor(e/2);const i=e-c.rowSpan,n=[],a=t.getArrayIndex(l,r)+i;for(let e,t,i=0;i=s));c++)o=e[c],l=o.rowSpan-1,l>0&&l+i>=a&&r=h.index&&(a+=h.cs,o+=h.cs,h=n.shift()),o>=s||l===r-1){u.insertBefore(c,e.nextElementSibling);break}a+=t}o.rowSpan=i}else{c.rowSpan=o.rowSpan;const e=t.createElement("TR");e.appendChild(c);for(let e,t=0;t=a&&(e[i].rowSpan+=1)}const i=n._physical_cellIndex,s=r.cells;for(let e=0,t=s.length;e0&&r+l>=n&&(e.rowSpan-=i.getOverlapRangeAtIndex(n,o,r,r+l));else l.push(e[r]);for(let e=0,t=l.length;e"+this.plugins.table.createCells.call(this,"th",this.context.table._logical_cellCnt,!1)+"",n.insertBefore(t,n.firstElementChild)}e.toggleClass(t,"active"),/TH/i.test(this.context.table._tdElement.nodeName)?this.controllersOff():this.plugins.table.setPositionControllerDiv.call(this,this.context.table._tdElement,!1)},setTableStyle:function(e){const t=this.context.table,i=t._element;let n,o,l,r;e.indexOf("width")>-1&&(n=t.resizeButton.firstElementChild,o=t.resizeText,t._maxWidth?(l=t.icons.reduction,r=t.minText,t.columnFixedButton.style.display="block",this.util.removeClass(i,"se-table-size-auto"),this.util.addClass(i,"se-table-size-100")):(l=t.icons.expansion,r=t.maxText,t.columnFixedButton.style.display="none",this.util.removeClass(i,"se-table-size-100"),this.util.addClass(i,"se-table-size-auto")),this.util.changeElement(n,l),this.util.changeTxt(o,r)),e.indexOf("column")>-1&&(t._fixedColumn?(this.util.removeClass(i,"se-table-layout-auto"),this.util.addClass(i,"se-table-layout-fixed"),this.util.addClass(t.columnFixedButton,"active")):(this.util.removeClass(i,"se-table-layout-fixed"),this.util.addClass(i,"se-table-layout-auto"),this.util.removeClass(t.columnFixedButton,"active")))},setActiveButton:function(e,t){const i=this.context.table;/^TH$/i.test(e.nodeName)?(i.insertRowAboveButton.setAttribute("disabled",!0),i.insertRowBelowButton.setAttribute("disabled",!0)):(i.insertRowAboveButton.removeAttribute("disabled"),i.insertRowBelowButton.removeAttribute("disabled")),t&&e!==t?(i.splitButton.setAttribute("disabled",!0),i.mergeButton.removeAttribute("disabled")):(i.splitButton.removeAttribute("disabled"),i.mergeButton.setAttribute("disabled",!0))},_bindOnSelect:null,_bindOffSelect:null,_bindOffShift:null,_selectedCells:null,_shift:!1,_fixedCell:null,_fixedCellName:null,_selectedCell:null,_selectedTable:null,_ref:null,_toggleEditor:function(e){this.context.element.wysiwyg.setAttribute("contenteditable",e),e?this.util.removeClass(this.context.element.wysiwyg,"se-disabled"):this.util.addClass(this.context.element.wysiwyg,"se-disabled")},_offCellMultiSelect:function(e){e.stopPropagation();const t=this.plugins.table;t._shift?t._initBind&&(this._wd.removeEventListener("touchmove",t._initBind),t._initBind=null):(t._removeEvents.call(this),t._toggleEditor.call(this,!0)),t._fixedCell&&t._selectedTable&&(t.setActiveButton.call(this,t._fixedCell,t._selectedCell),t.call_controller_tableEdit.call(this,t._selectedCell||t._fixedCell),t._selectedCells=t._selectedTable.querySelectorAll(".se-table-selected-cell"),t._selectedCell&&t._fixedCell&&this.focusEdge(t._selectedCell),t._shift||(t._fixedCell=null,t._selectedCell=null,t._fixedCellName=null))},_onCellMultiSelect:function(e){this._antiBlur=!0;const t=this.plugins.table,i=this.util.getParentElement(e.target,this.util.isCell);if(t._shift)i===t._fixedCell?t._toggleEditor.call(this,!0):t._toggleEditor.call(this,!1);else if(!t._ref){if(i===t._fixedCell)return;t._toggleEditor.call(this,!1)}i&&i!==t._selectedCell&&t._fixedCellName===i.nodeName&&t._selectedTable===this.util.getParentElement(i,"TABLE")&&(t._selectedCell=i,t._setMultiCells.call(this,t._fixedCell,i))},_setMultiCells:function(e,t){const i=this.plugins.table,n=i._selectedTable.rows,o=this.util,l=i._selectedTable.querySelectorAll(".se-table-selected-cell");for(let e=0,t=l.length;e0)for(let e,t=0;tu||(d>=e.index?(l+=e.cs,d+=e.cs,e.rs-=1,e.row=u+1,e.rs<1&&(s.splice(t,1),t--)):f===g-1&&(e.rs-=1,e.row=u+1,e.rs<1&&(s.splice(t,1),t--)));if(r){if(n!==e&&n!==t||(c.cs=null!==c.cs&&c.csd+h?c.ce:d+h,c.rs=null!==c.rs&&c.rsu+p?c.re:u+p,c._i+=1),2===c._i){r=!1,s=[],a=[],u=-1;break}}else if(o.getOverlapRangeAtIndex(c.cs,c.ce,d,d+h)&&o.getOverlapRangeAtIndex(c.rs,c.re,u,u+p)){const e=c.csd+h?c.ce:d+h,i=c.rsu+p?c.re:u+p;if(c.cs!==e||c.ce!==t||c.rs!==i||c.re!==l){c.cs=e,c.ce=t,c.rs=i,c.re=l,u=-1,s=[],a=[];break}o.addClass(n,"se-table-selected-cell")}p>0&&a.push({index:d,cs:h+1,rs:p,row:-1}),l+=n.colSpan-1}s=s.concat(a).sort((function(e,t){return e.index-t.index})),a=[]}},_removeEvents:function(){const e=this.plugins.table;e._initBind&&(this._wd.removeEventListener("touchmove",e._initBind),e._initBind=null),e._bindOnSelect&&(this._wd.removeEventListener("mousedown",e._bindOnSelect),this._wd.removeEventListener("mousemove",e._bindOnSelect),e._bindOnSelect=null),e._bindOffSelect&&(this._wd.removeEventListener("mouseup",e._bindOffSelect),e._bindOffSelect=null),e._bindOffShift&&(this._wd.removeEventListener("keyup",e._bindOffShift),e._bindOffShift=null)},_initBind:null,onTableCellMultiSelect:function(e,t){const i=this.plugins.table;i._removeEvents.call(this),this.controllersOff(),i._shift=t,i._fixedCell=e,i._fixedCellName=e.nodeName,i._selectedTable=this.util.getParentElement(e,"TABLE");const n=i._selectedTable.querySelectorAll(".se-table-selected-cell");for(let e=0,t=n.length;e-1?(t=e.toLowerCase(),n="blockquote"===t?"range":"pre"===t?"free":"replace",a=/^h/.test(t)?t.match(/\d+/)[0]:"",s=i["tag_"+(a?"h":t)]+a,u="",c=""):(t=e.tag.toLowerCase(),n=e.command,s=e.name||t,u=e.class,c=u?' class="'+u+'"':""),r+='
  • ";return r+="",n.innerHTML=r,n},active:function(e){let t=this.lang.toolbar.formats;const i=this.context.formatBlock.targetText;if(e){if(this.util.isFormatElement(e)){const n=this.context.formatBlock._formatList,o=e.nodeName.toLowerCase(),l=(e.className.match(/(\s|^)__se__format__[^\s]+/)||[""])[0].trim();for(let e,i=0,r=n.length;i=0;d--)if(n=f[d],n!==(f[d+1]?f[d+1].parentNode:null)){if(u=a.isComponent(n),l=u?"":n.innerHTML.replace(/(?!>)\s+(?=<)|\n/g," "),r=a.getParentElement(n,(function(e){return e.parentNode===t})),(t!==n.parentNode||u)&&(a.isFormatElement(t)?(t.parentNode.insertBefore(i,t.nextSibling),t=t.parentNode):(t.insertBefore(i,r?r.nextSibling:null),t=n.parentNode),s=i.nextSibling,s&&i.nodeName===s.nodeName&&a.isSameAttributes(i,s)&&(i.innerHTML+="
    "+s.innerHTML,a.removeItem(s)),i=o.cloneNode(!1),h=!0),c=i.innerHTML,i.innerHTML=(h||!l||!c||/
    $/i.test(l)?l:l+"
    ")+c,0===d){t.insertBefore(i,n),s=n.nextSibling,s&&i.nodeName===s.nodeName&&a.isSameAttributes(i,s)&&(i.innerHTML+="
    "+s.innerHTML,a.removeItem(s));const e=i.previousSibling;e&&i.nodeName===e.nodeName&&a.isSameAttributes(i,e)&&(e.innerHTML+="
    "+i.innerHTML,a.removeItem(i))}u||a.removeItem(n),l&&(h=!1)}this.setRange(n,0,n,0)}else{for(let e,t,i=0,r=f.length;i('+i.toolbar.default+")";for(let e,t=0,i=o.length;t";return l+="",n.innerHTML=l,n},on:function(){const e=this.context.lineHeight,t=e._sizeList,i=this.util.getFormatElement(this.getSelectionNode()),n=i?i.style.lineHeight+"":"";if(n!==e.currentSize){for(let e=0,i=t.length;e"}return r+="",i.innerHTML=r,i},on:function(){const e=this.context.paragraphStyle._classList,t=this.util.getFormatElement(this.getSelectionNode());for(let i=0,n=e.length;i"}return l+="",i.innerHTML=l,i},on:function(){const e=this.util,t=this.context.textStyle._styleList,i=this.getSelectionNode();for(let n,o,l,r=0,s=t.length;r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,r=!0,s=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return r=e.done,e},e:function(e){s=!0,l=e},f:function(){try{r||null==i.return||i.return()}finally{if(s)throw l}}}}function vt(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i0)for(var o in n=!this.tagsAreExclusive,this.tags){var l=this.tags[o].replace(/^(-|\+)/,"");0<=this.config.uielements[i].tags.indexOf(l)&&(n=!this.tags[o].startsWith("-"))}n&&t.append(this.getNewUiElementCard(this.config.uielements[i],e))}this.newPanel.close(),this.selectionPanel.open()}},{key:"drawNewForm",value:function(e,t){this.newPanel.dialog.innerHTML=e;var i=this.newPanel.dialog;xt(i),this.dispatchInitFormEvent(i,this);var n=i.querySelector("form");n.manager=this,n.position=t,n.addEventListener("submit",(function(e){e.preventDefault();var t=e.currentTarget;return t.manager.submitUiElementForm(t,(function(){if(200===this.status){var e=JSON.parse(this.responseText);e.error?this.form.manager.drawNewForm(e.form_html,this.form.position):(this.form.manager.create(e.code,e.data,e.previewHtml,this.form.position),this.form.manager.newPanel.close(),this.form.manager.selectionPanel.close())}200!==this.status&&alert(this.form.manager.config.errorMessage)})),!1}));var o=i.querySelector(".js-uie-cancel");o.panel=this.newPanel,o.addEventListener("click",(function(e){e.currentTarget.panel.close()}));var l=i.querySelector(".js-uie-save");l.panel=this.newPanel,l.addEventListener("click",(function(e){e.currentTarget.panel.dialog.querySelector("form").dispatchEvent(new Event("submit",{cancelable:!0}))}))}},{key:"openNewPanel",value:function(e,t,i){this.newPanel.dialog.manager=this,this.newPanel.dialog.position=i,this.drawNewForm(e,i),this.newPanel.open()}},{key:"editUiElement",value:function(e){this.loadUiElementEditForm(e,(function(t){if(200===this.status){var i=JSON.parse(this.responseText);e.manager.openEditPanel(i.form_html,e)}}))}},{key:"drawEditForm",value:function(e,t){this.editPanel.dialog.querySelector(".js-uie-content").innerHTML=e;var i=this.editPanel.dialog;xt(i),this.dispatchInitFormEvent(i,this);var n=i.querySelector("form");n.manager=this,n.uiElement=t,n.addEventListener("submit",(function(e){e.preventDefault();var t=e.currentTarget;return t.manager.submitUiElementForm(t,(function(){if(200===this.status){var e=JSON.parse(this.responseText);e.error?this.form.manager.drawEditForm(e.form_html,this.form.uiElement):(this.form.uiElement.data=e.data,this.form.uiElement.previewHtml=e.previewHtml,this.form.manager.write(),this.form.manager.editPanel.close())}200!==this.status&&alert(this.config.errorMessage)})),!1}));var o=i.querySelector(".js-uie-cancel");o.panel=this.editPanel,o.addEventListener("click",(function(e){e.currentTarget.panel.close()}));var l=i.querySelector(".js-uie-save");l.panel=this.editPanel,l.addEventListener("click",(function(e){e.currentTarget.panel.dialog.querySelector("form").dispatchEvent(new Event("submit",{cancelable:!0}))}))}},{key:"openEditPanel",value:function(e,t){this.editPanel.dialog.manager=this,this.editPanel.dialog.uiElement=t,this.drawEditForm(e,t),this.editPanel.open()}},{key:"write",value:function(){this.input.value=this.uiElements.length>0?JSON.stringify(this.uiElements):"",this.drawUiElements(),document.dispatchEvent(new CustomEvent("mbiz:rich-editor:write-complete",{detail:{editorManager:this}}))}},{key:"create",value:function(e,t,i,n){var o=new MonsieurBizRichEditorUiElement(this.config,e,t,i);return this.uiElements.splice(n,0,o),this.write(),o}},{key:"moveUp",value:function(e){var t=this.uiElements.indexOf(e);0!==t&&(this.uiElements.splice(t,1),this.uiElements.splice(t-1,0,e),this.write())}},{key:"moveDown",value:function(e){var t=this.uiElements.indexOf(e);t!==this.uiElements.length-1&&(this.uiElements.splice(t,1),this.uiElements.splice(t+1,0,e),this.write())}},{key:"delete",value:function(e){var t=this.uiElements.indexOf(e);this.uiElements.splice(t,1),this.write()}},{key:"loadUiElementCreateForm",value:function(e,t){var i=new XMLHttpRequest;i.onload=t;var n=this.config.createElementFormUrl;i.open("get",n.replace("__CODE__",e.code),!0),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.send()}},{key:"loadUiElementEditForm",value:function(e,t){var i=new XMLHttpRequest;i.onload=t;var n=this.config.editElementFormUrl;i.open("post",n.replace("__CODE__",e.code),!0),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.send(new URLSearchParams({data:JSON.stringify(e.data)}).toString())}},{key:"submitUiElementForm",value:function(e,t){var i=new XMLHttpRequest;i.onload=t,i.form=e,i.open("post",e.action,!0),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.send(new FormData(e))}},{key:"requestUiElementsHtml",value:function(e,t){var i=new XMLHttpRequest;i.onload=t,i.open("post",this.config.renderElementsUrl,!0),i.setRequestHeader("X-Requested-With","XMLHttpRequest");var n=new FormData;n.append("ui_elements",JSON.stringify(e)),this.input.dataset.locale&&n.append("locale",this.input.dataset.locale),i.uiElements=e,i.manager=this,i.send(n)}},{key:"isClipboardEmpty",value:function(){var e=window.localStorage.getItem("monsieurBizRichEditorClipboard");return null===e||""===e}},{key:"saveUiElementToClipboard",value:function(e,t){window.localStorage.setItem("monsieurBizRichEditorClipboard",JSON.stringify(e)),t(),document.dispatchEvent(new CustomEvent("mbiz:rich-editor:uielement:copied",{}))}},{key:"pasteUiElementFromClipboard",value:function(e){var t=window.localStorage.getItem("monsieurBizRichEditorClipboard");if(null!==t){var i=JSON.parse(t),n=this;n.requestUiElementsHtml([i],(function(){if(200===this.status){var t=JSON.parse(this.responseText).shift();void 0===i.code&&void 0!==i.type&&(i.code=i.type,i.data=i.fields,delete i.type,delete i.fields);var o=n.config.findUiElementByCode(i.code);if(null!==o)if(n.tags.length>0){var l=!1;for(var r in n.tags)0<=n.config.uielements[o.code].tags.indexOf(n.tags[r])&&(l=!0);l?n.create(o.code,i.data,t,e):alert(n.config.unallowedUiElementMessage)}else n.create(o.code,i.data,t,e)}}))}}},{key:"dispatchInitFormEvent",value:function(e,t){document.dispatchEvent(new CustomEvent("monsieurBizRichEditorInitForm",{detail:{form:e,manager:t}}))}}])}()})()})(); \ No newline at end of file +(()=>{var e={237:function(e){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,i=/gecko\/\d/i.test(e),n=/MSIE \d/.test(e),o=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),l=/Edge\/(\d+)/.exec(e),r=n||o||l,s=r&&(n?document.documentMode||6:+(l||o)[1]),a=!l&&/WebKit\//.test(e),c=a&&/Qt\/\d+\.\d+/.test(e),u=!l&&/Chrome\/(\d+)/.exec(e),d=u&&+u[1],h=/Opera\//.test(e),p=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),g=/PhantomJS/.test(e),m=p&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),v=/Android/.test(e),b=m||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=m||/Mac/.test(t),w=/\bCrOS\b/.test(e),_=/win/i.test(t),x=h&&e.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(h=!1,a=!0);var C=y&&(c||h&&(null==x||x<12.11)),k=i||r&&s>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var L,E=function(e,t){var i=e.className,n=S(t).exec(i);if(n){var o=i.slice(n.index+n[0].length);e.className=i.slice(0,n.index)+(o?n[1]+o:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function N(e,t){return T(e).appendChild(t)}function z(e,t,i,n){var o=document.createElement(e);if(i&&(o.className=i),n&&(o.style.cssText=n),"string"==typeof t)o.appendChild(document.createTextNode(t));else if(t)for(var l=0;l=t)return r+(t-l);r+=s-l,r+=i-r%i,l=s+1}}m?O=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:r&&(O=function(e){try{e.select()}catch(e){}});var j=function(){this.id=null,this.f=null,this.time=0,this.handler=V(this.onTimeout,this)};function q(e,t){for(var i=0;i=t)return n+Math.min(r,t-o);if(o+=l-n,n=l+1,(o+=i-o%i)>=t)return n}}var J=[""];function Q(e){for(;J.length<=e;)J.push(ee(J)+" ");return J[e]}function ee(e){return e[e.length-1]}function te(e,t){for(var i=[],n=0;n"€"&&(e.toUpperCase()!=e.toLowerCase()||le.test(e))}function se(e,t){return t?!!(t.source.indexOf("\\w")>-1&&re(e))||t.test(e):re(e)}function ae(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ce=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ue(e){return e.charCodeAt(0)>=768&&ce.test(e)}function de(e,t,i){for(;(i<0?t>0:ti?-1:1;;){if(t==i)return t;var o=(t+i)/2,l=n<0?Math.ceil(o):Math.floor(o);if(l==t)return e(l)?t:i;e(l)?i=l:t=l+n}}function pe(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var o=!1,l=0;lt||t==i&&r.to==t)&&(n(Math.max(r.from,t),Math.min(r.to,i),1==r.level?"rtl":"ltr",l),o=!0)}o||n(t,i,"ltr")}var fe=null;function ge(e,t,i){var n;fe=null;for(var o=0;ot)return o;l.to==t&&(l.from!=l.to&&"before"==i?n=o:fe=o),l.from==t&&(l.from!=l.to&&"before"!=i?n=o:fe=o)}return null!=n?n:fe}var me=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(i){return i<=247?e.charAt(i):1424<=i&&i<=1524?"R":1536<=i&&i<=1785?t.charAt(i-1536):1774<=i&&i<=2220?"r":8192<=i&&i<=8203?"w":8204==i?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,l=/[LRr]/,r=/[Lb1n]/,s=/[1n]/;function a(e,t,i){this.level=e,this.from=t,this.to=i}return function(e,t){var c="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!n.test(e))return!1;for(var u=e.length,d=[],h=0;h-1&&(n[t]=o.slice(0,l).concat(o.slice(l+1)))}}}function xe(e,t){var i=we(e,t);if(i.length)for(var n=Array.prototype.slice.call(arguments,2),o=0;o0}function Le(e){e.prototype.on=function(e,t){ye(this,e,t)},e.prototype.off=function(e,t){_e(this,e,t)}}function Ee(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Te(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ne(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function ze(e){Ee(e),Te(e)}function Ae(e){return e.target||e.srcElement}function Be(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var Me,Re,Ie=function(){if(r&&s<9)return!1;var e=z("div");return"draggable"in e||"dragDrop"in e}();function Oe(e){if(null==Me){var t=z("span","​");N(e,z("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Me=t.offsetWidth<=1&&t.offsetHeight>2&&!(r&&s<8))}var i=Me?z("span","​"):z("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function He(e){if(null!=Re)return Re;var t=N(e,document.createTextNode("AخA")),i=L(t,0,1).getBoundingClientRect(),n=L(t,1,2).getBoundingClientRect();return T(e),!(!i||i.left==i.right)&&(Re=n.right-i.right<3)}var De,Fe=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,i=[],n=e.length;t<=n;){var o=e.indexOf("\n",t);-1==o&&(o=e.length);var l=e.slice(t,"\r"==e.charAt(o-1)?o-1:o),r=l.indexOf("\r");-1!=r?(i.push(l.slice(0,r)),t+=r+1):(i.push(l),t=o+1)}return i}:function(e){return e.split(/\r\n?|\n/)},Pe=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Ve="oncopy"in(De=z("div"))||(De.setAttribute("oncopy","return;"),"function"==typeof De.oncopy),Ue=null;function We(e){if(null!=Ue)return Ue;var t=N(e,z("span","x")),i=t.getBoundingClientRect(),n=L(t,0,1).getBoundingClientRect();return Ue=Math.abs(i.left-n.left)>1}var je={},qe={};function Ze(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),je[e]=t}function Ge(e,t){qe[e]=t}function $e(e){if("string"==typeof e&&qe.hasOwnProperty(e))e=qe[e];else if(e&&"string"==typeof e.name&&qe.hasOwnProperty(e.name)){var t=qe[e.name];"string"==typeof t&&(t={name:t}),(e=oe(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return $e("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return $e("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ke(e,t){t=$e(t);var i=je[t.name];if(!i)return Ke(e,"text/plain");var n=i(e,t);if(Ye.hasOwnProperty(t.name)){var o=Ye[t.name];for(var l in o)o.hasOwnProperty(l)&&(n.hasOwnProperty(l)&&(n["_"+l]=n[l]),n[l]=o[l])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var r in t.modeProps)n[r]=t.modeProps[r];return n}var Ye={};function Xe(e,t){U(t,Ye.hasOwnProperty(e)?Ye[e]:Ye[e]={})}function Je(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var i={};for(var n in t){var o=t[n];o instanceof Array&&(o=o.concat([])),i[n]=o}return i}function Qe(e,t){for(var i;e.innerMode&&(i=e.innerMode(t))&&i.mode!=e;)t=i.state,e=i.mode;return i||{mode:e,state:t}}function et(e,t,i){return!e.startState||e.startState(t,i)}var tt=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};function it(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var n=0;;++n){var o=i.children[n],l=o.chunkSize();if(t=e.first&&ti?ut(i,it(e,i).text.length):bt(t,it(e,t.line).text.length)}function bt(e,t){var i=e.ch;return null==i||i>t?ut(e.line,t):i<0?ut(e.line,0):e}function yt(e,t){for(var i=[],n=0;n=this.string.length},tt.prototype.sol=function(){return this.pos==this.lineStart},tt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},tt.prototype.next=function(){if(this.post},tt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},tt.prototype.skipToEnd=function(){this.pos=this.string.length},tt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},tt.prototype.backUp=function(e){this.pos-=e},tt.prototype.column=function(){return this.lastColumnPos0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var o=function(e){return i?e.toLowerCase():e};if(o(this.string.substr(this.pos,e.length))==o(e))return!1!==t&&(this.pos+=e.length),!0},tt.prototype.current=function(){return this.string.slice(this.start,this.pos)},tt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},tt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},tt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var wt=function(e,t){this.state=e,this.lookAhead=t},_t=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};function xt(e,t,i,n){var o=[e.state.modeGen],l={};At(e,t.text,e.doc.mode,i,(function(e,t){return o.push(e,t)}),l,n);for(var r=i.state,s=function(n){i.baseTokens=o;var s=e.state.overlays[n],a=1,c=0;i.state=!0,At(e,t.text,s.mode,i,(function(e,t){for(var i=a;ce&&o.splice(a,1,e,o[a+1],n),a+=2,c=Math.min(e,n)}if(t)if(s.opaque)o.splice(i,a-i,e,"overlay "+t),a=i+2;else for(;ie.options.maxHighlightLength&&Je(e.doc.mode,n.state),l=xt(e,t,n);o&&(n.state=o),t.stateAfter=n.save(!o),t.styles=l.styles,l.classes?t.styleClasses=l.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function kt(e,t,i){var n=e.doc,o=e.display;if(!n.mode.startState)return new _t(n,!0,t);var l=Bt(e,t,i),r=l>n.first&&it(n,l-1).stateAfter,s=r?_t.fromSaved(n,r,l):new _t(n,et(n.mode),l);return n.iter(l,t,(function(i){St(e,i.text,s);var n=s.line;i.stateAfter=n==t-1||n%5==0||n>=o.viewFrom&&nt.start)return l}throw new Error("Mode "+e.name+" failed to advance stream.")}_t.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},_t.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},_t.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},_t.fromSaved=function(e,t,i){return t instanceof wt?new _t(e,Je(e.mode,t.state),i,t.lookAhead):new _t(e,Je(e.mode,t),i)},_t.prototype.save=function(e){var t=!1!==e?Je(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new wt(t,this.maxLookAhead):t};var Tt=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Nt(e,t,i,n){var o,l,r=e.doc,s=r.mode,a=it(r,(t=vt(r,t)).line),c=kt(e,t.line,i),u=new tt(a.text,e.options.tabSize,c);for(n&&(l=[]);(n||u.pose.options.maxHighlightLength?(s=!1,r&&St(e,t,n,d.pos),d.pos=t.length,a=null):a=zt(Et(i,d,n.state,h),l),h){var p=h[0].name;p&&(a="m-"+(a?p+" "+a:p))}if(!s||u!=a){for(;cr;--s){if(s<=l.first)return l.first;var a=it(l,s-1),c=a.stateAfter;if(c&&(!i||s+(c instanceof wt?c.lookAhead:0)<=l.modeFrontier))return s;var u=W(a.text,null,e.options.tabSize);(null==o||n>u)&&(o=s-1,n=u)}return o}function Mt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontieri;n--){var o=it(e,n).stateAfter;if(o&&(!(o instanceof wt)||n+o.lookAhead=t:l.to>t);(n||(n=[])).push(new Dt(r,l.from,s?null:l.to))}}return n}function Wt(e,t,i){var n;if(e)for(var o=0;o=t:l.to>t)||l.from==t&&"bookmark"==r.type&&(!i||l.marker.insertLeft)){var s=null==l.from||(r.inclusiveLeft?l.from<=t:l.from0&&s)for(var y=0;y0)){var u=[a,1],d=dt(c.from,s.from),h=dt(c.to,s.to);(d<0||!r.inclusiveLeft&&!d)&&u.push({from:c.from,to:s.from}),(h>0||!r.inclusiveRight&&!h)&&u.push({from:s.to,to:c.to}),o.splice.apply(o,u),a+=u.length-3}}return o}function Gt(e){var t=e.markedSpans;if(t){for(var i=0;it)&&(!i||Xt(i,l.marker)<0)&&(i=l.marker)}return i}function ii(e,t,i,n,o){var l=it(e,t),r=It&&l.markedSpans;if(r)for(var s=0;s=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(a.marker.inclusiveRight&&o.inclusiveLeft?dt(c.to,i)>=0:dt(c.to,i)>0)||u>=0&&(a.marker.inclusiveRight&&o.inclusiveLeft?dt(c.from,n)<=0:dt(c.from,n)<0)))return!0}}}function ni(e){for(var t;t=Qt(e);)e=t.find(-1,!0).line;return e}function oi(e){for(var t;t=ei(e);)e=t.find(1,!0).line;return e}function li(e){for(var t,i;t=ei(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function ri(e,t){var i=it(e,t),n=ni(i);return i==n?t:rt(n)}function si(e,t){if(t>e.lastLine())return t;var i,n=it(e,t);if(!ai(e,n))return t;for(;i=ei(n);)n=i.find(1,!0).line;return rt(n)+1}function ai(e,t){var i=It&&t.markedSpans;if(i)for(var n=void 0,o=0;ot.maxLineLength&&(t.maxLineLength=i,t.maxLine=e)}))}var pi=function(e,t,i){this.text=e,$t(this,t),this.height=i?i(this):1};function fi(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Gt(e),$t(e,i);var o=n?n(e):1;o!=e.height&<(e,o)}function gi(e){e.parent=null,Gt(e)}pi.prototype.lineNo=function(){return rt(this)},Le(pi);var mi={},vi={};function bi(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?vi:mi;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function yi(e,t){var i=A("span",null,null,a?"padding-right: .1px":null),n={pre:A("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var l=o?t.rest[o-1]:t.line,r=void 0;n.pos=0,n.addToken=_i,He(e.display.measure)&&(r=ve(l,e.doc.direction))&&(n.addToken=Ci(n.addToken,r)),n.map=[],Si(l,n,Ct(e,l,t!=e.display.externalMeasured&&rt(l))),l.styleClasses&&(l.styleClasses.bgClass&&(n.bgClass=I(l.styleClasses.bgClass,n.bgClass||"")),l.styleClasses.textClass&&(n.textClass=I(l.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(Oe(e.display.measure))),0==o?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(a){var s=n.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return xe(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=I(n.pre.className,n.textClass||"")),n}function wi(e){var t=z("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function _i(e,t,i,n,o,l,a){if(t){var c,u=e.splitSpaces?xi(t,e.trailingSpace):t,d=e.cm.state.specialChars,h=!1;if(d.test(t)){c=document.createDocumentFragment();for(var p=0;;){d.lastIndex=p;var f=d.exec(t),g=f?f.index-p:t.length-p;if(g){var m=document.createTextNode(u.slice(p,p+g));r&&s<9?c.appendChild(z("span",[m])):c.appendChild(m),e.map.push(e.pos,e.pos+g,m),e.col+=g,e.pos+=g}if(!f)break;p+=g+1;var v=void 0;if("\t"==f[0]){var b=e.cm.options.tabSize,y=b-e.col%b;(v=c.appendChild(z("span",Q(y),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=y}else"\r"==f[0]||"\n"==f[0]?((v=c.appendChild(z("span","\r"==f[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",f[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(f[0])).setAttribute("cm-text",f[0]),r&&s<9?c.appendChild(z("span",[v])):c.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),r&&s<9&&(h=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),i||n||o||h||l||a){var w=i||"";n&&(w+=n),o&&(w+=o);var _=z("span",[c],w,l);if(a)for(var x in a)a.hasOwnProperty(x)&&"style"!=x&&"class"!=x&&_.setAttribute(x,a[x]);return e.content.appendChild(_)}e.content.appendChild(c)}}function xi(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",o=0;oc&&d.from<=c);h++);if(d.to>=u)return e(i,n,o,l,r,s,a);e(i,n.slice(0,d.to-c),o,l,null,s,a),l=null,n=n.slice(d.to-c),c=d.to}}}function ki(e,t,i,n){var o=!n&&i.widgetNode;o&&e.map.push(e.pos,e.pos+t,o),!n&&e.cm.display.input.needsContentAttribute&&(o||(o=e.content.appendChild(document.createElement("span"))),o.setAttribute("cm-marker",i.id)),o&&(e.cm.display.input.setUneditable(o),e.content.appendChild(o)),e.pos+=t,e.trailingSpace=!1}function Si(e,t,i){var n=e.markedSpans,o=e.text,l=0;if(n)for(var r,s,a,c,u,d,h,p=o.length,f=0,g=1,m="",v=0;;){if(v==f){a=c=u=s="",h=null,d=null,v=1/0;for(var b=[],y=void 0,w=0;wf||x.collapsed&&_.to==f&&_.from==f)){if(null!=_.to&&_.to!=f&&v>_.to&&(v=_.to,c=""),x.className&&(a+=" "+x.className),x.css&&(s=(s?s+";":"")+x.css),x.startStyle&&_.from==f&&(u+=" "+x.startStyle),x.endStyle&&_.to==v&&(y||(y=[])).push(x.endStyle,_.to),x.title&&((h||(h={})).title=x.title),x.attributes)for(var C in x.attributes)(h||(h={}))[C]=x.attributes[C];x.collapsed&&(!d||Xt(d.marker,x)<0)&&(d=_)}else _.from>f&&v>_.from&&(v=_.from)}if(y)for(var k=0;k=p)break;for(var L=Math.min(p,v);;){if(m){var E=f+m.length;if(!d){var T=E>L?m.slice(0,L-f):m;t.addToken(t,T,r?r+a:a,u,f+T.length==v?c:"",s,h)}if(E>=L){m=m.slice(L-f),f=L;break}f=E,u=""}m=o.slice(l,l=i[g++]),r=bi(i[g++],t.cm.options)}}else for(var N=1;N2&&l.push((a.bottom+c.top)/2-i.top)}}l.push(i.bottom-i.top)}}function nn(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var n=0;ni)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}}function on(e,t){var i=rt(t=ni(t)),n=e.display.externalMeasured=new Li(e.doc,t,i);n.lineN=i;var o=n.built=yi(e,n);return n.text=o.pre,N(e.display.lineMeasure,o.pre),n}function ln(e,t,i,n){return an(e,sn(e,t),i,n)}function rn(e,t){if(t>=e.display.viewFrom&&t=i.lineN&&tt)&&(o=(l=a-s)-1,t>=a&&(r="right")),null!=o){if(n=e[c+2],s==a&&i==(n.insertLeft?"left":"right")&&(r=i),"left"==i&&0==o)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)n=e[2+(c-=3)],r="left";if("right"==i&&o==a-s)for(;c=0&&(i=e[o]).left==i.right;o--);return i}function pn(e,t,i,n){var o,l=dn(t.map,i,n),a=l.node,c=l.start,u=l.end,d=l.collapse;if(3==a.nodeType){for(var h=0;h<4;h++){for(;c&&ue(t.line.text.charAt(l.coverStart+c));)--c;for(;l.coverStart+u0&&(d=n="right"),o=e.options.lineWrapping&&(p=a.getClientRects()).length>1?p["right"==n?p.length-1:0]:a.getBoundingClientRect()}if(r&&s<9&&!c&&(!o||!o.left&&!o.right)){var f=a.parentNode.getClientRects()[0];o=f?{left:f.left,right:f.left+In(e.display),top:f.top,bottom:f.bottom}:un}for(var g=o.top-t.rect.top,m=o.bottom-t.rect.top,v=(g+m)/2,b=t.view.measure.heights,y=0;y=n.text.length?(a=n.text.length,c="before"):a<=0&&(a=0,c="after"),!s)return r("before"==c?a-1:a,"before"==c);function u(e,t,i){return r(i?e-1:e,1==s[t].level!=i)}var d=ge(s,a,c),h=fe,p=u(a,d,"before"==c);return null!=h&&(p.other=u(a,h,"before"!=c)),p}function Sn(e,t){var i=0;t=vt(e.doc,t),e.options.lineWrapping||(i=In(e.display)*t.ch);var n=it(e.doc,t.line),o=ui(n)+Ki(e.display);return{left:i,right:i,top:o,bottom:o+n.height}}function Ln(e,t,i,n,o){var l=ut(e,t,i);return l.xRel=o,n&&(l.outside=n),l}function En(e,t,i){var n=e.doc;if((i+=e.display.viewOffset)<0)return Ln(n.first,0,null,-1,-1);var o=st(n,i),l=n.first+n.size-1;if(o>l)return Ln(n.first+n.size-1,it(n,l).text.length,null,1,1);t<0&&(t=0);for(var r=it(n,o);;){var s=An(e,r,o,t,i),a=ti(r,s.ch+(s.xRel>0||s.outside>0?1:0));if(!a)return s;var c=a.find(1);if(c.line==o)return c;r=it(n,o=c.line)}}function Tn(e,t,i,n){n-=wn(t);var o=t.text.length,l=he((function(t){return an(e,i,t-1).bottom<=n}),o,0);return{begin:l,end:o=he((function(t){return an(e,i,t).top>n}),l,o)}}function Nn(e,t,i,n){return i||(i=sn(e,t)),Tn(e,t,i,_n(e,t,an(e,i,n),"line").top)}function zn(e,t,i,n){return!(e.bottom<=i)&&(e.top>i||(n?e.left:e.right)>t)}function An(e,t,i,n,o){o-=ui(t);var l=sn(e,t),r=wn(t),s=0,a=t.text.length,c=!0,u=ve(t,e.doc.direction);if(u){var d=(e.options.lineWrapping?Mn:Bn)(e,t,i,l,u,n,o);s=(c=1!=d.level)?d.from:d.to-1,a=c?d.to:d.from-1}var h,p,f=null,g=null,m=he((function(t){var i=an(e,l,t);return i.top+=r,i.bottom+=r,!!zn(i,n,o,!1)&&(i.top<=o&&i.left<=n&&(f=t,g=i),!0)}),s,a),v=!1;if(g){var b=n-g.left=w.bottom?1:0}return Ln(i,m=de(t.text,m,1),p,v,n-h)}function Bn(e,t,i,n,o,l,r){var s=he((function(s){var a=o[s],c=1!=a.level;return zn(kn(e,ut(i,c?a.to:a.from,c?"before":"after"),"line",t,n),l,r,!0)}),0,o.length-1),a=o[s];if(s>0){var c=1!=a.level,u=kn(e,ut(i,c?a.from:a.to,c?"after":"before"),"line",t,n);zn(u,l,r,!0)&&u.top>r&&(a=o[s-1])}return a}function Mn(e,t,i,n,o,l,r){var s=Tn(e,t,n,r),a=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,h=0;h=c||p.to<=a)){var f=an(e,n,1!=p.level?Math.min(c,p.to)-1:Math.max(a,p.from)).right,g=fg)&&(u=p,d=g)}}return u||(u=o[o.length-1]),u.fromc&&(u={from:u.from,to:c,level:u.level}),u}function Rn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==cn){cn=z("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)cn.appendChild(document.createTextNode("x")),cn.appendChild(z("br"));cn.appendChild(document.createTextNode("x"))}N(e.measure,cn);var i=cn.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),T(e.measure),i||1}function In(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=z("span","xxxxxxxxxx"),i=z("pre",[t],"CodeMirror-line-like");N(e.measure,i);var n=t.getBoundingClientRect(),o=(n.right-n.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}function On(e){for(var t=e.display,i={},n={},o=t.gutters.clientLeft,l=t.gutters.firstChild,r=0;l;l=l.nextSibling,++r){var s=e.display.gutterSpecs[r].className;i[s]=l.offsetLeft+l.clientLeft+o,n[s]=l.clientWidth}return{fixedPos:Hn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function Hn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Dn(e){var t=Rn(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/In(e.display)-3);return function(o){if(ai(e.doc,o))return 0;var l=0;if(o.widgets)for(var r=0;r0&&(a=it(e.doc,c.line).text).length==c.ch){var u=W(a,a.length,e.options.tabSize)-a.length;c=ut(c.line,Math.max(0,Math.round((l-Xi(e.display).left)/In(e.display))-u))}return c}function Vn(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var i=e.display.view,n=0;nt)&&(o.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=o.viewTo)It&&ri(e.doc,t)o.viewFrom?jn(e):(o.viewFrom+=n,o.viewTo+=n);else if(t<=o.viewFrom&&i>=o.viewTo)jn(e);else if(t<=o.viewFrom){var l=qn(e,i,i+n,1);l?(o.view=o.view.slice(l.index),o.viewFrom=l.lineN,o.viewTo+=n):jn(e)}else if(i>=o.viewTo){var r=qn(e,t,t,-1);r?(o.view=o.view.slice(0,r.index),o.viewTo=r.lineN):jn(e)}else{var s=qn(e,t,t,-1),a=qn(e,i,i+n,1);s&&a?(o.view=o.view.slice(0,s.index).concat(Ei(e,s.lineN,a.lineN)).concat(o.view.slice(a.index)),o.viewTo+=n):jn(e)}var c=o.externalMeasured;c&&(i=o.lineN&&t=n.viewTo)){var l=n.view[Vn(e,t)];if(null!=l.node){var r=l.changes||(l.changes=[]);-1==q(r,i)&&r.push(i)}}}function jn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function qn(e,t,i,n){var o,l=Vn(e,t),r=e.display.view;if(!It||i==e.doc.first+e.doc.size)return{index:l,lineN:i};for(var s=e.display.viewFrom,a=0;a0){if(l==r.length-1)return null;o=s+r[l].size-t,l++}else o=s-t;t+=o,i+=o}for(;ri(e.doc,i)!=i;){if(l==(n<0?0:r.length-1))return null;i+=n*r[l-(n<0?1:0)].size,l+=n}return{index:l,lineN:i}}function Zn(e,t,i){var n=e.display;0==n.view.length||t>=n.viewTo||i<=n.viewFrom?(n.view=Ei(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=Ei(e,t,n.viewFrom).concat(n.view):n.viewFromi&&(n.view=n.view.slice(0,Vn(e,i)))),n.viewTo=i}function Gn(e){for(var t=e.display.view,i=0,n=0;n=e.display.viewTo||a.to().line0?r:e.defaultCharWidth())+"px"}if(n.other){var s=i.appendChild(z("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=n.other.left+"px",s.style.top=n.other.top+"px",s.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function Xn(e,t){return e.top-t.top||e.left-t.left}function Jn(e,t,i){var n=e.display,o=e.doc,l=document.createDocumentFragment(),r=Xi(e.display),s=r.left,a=Math.max(n.sizerWidth,Qi(e)-n.sizer.offsetLeft)-r.right,c="ltr"==o.direction;function u(e,t,i,n){t<0&&(t=0),t=Math.round(t),n=Math.round(n),l.appendChild(z("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==i?a-e:i)+"px;\n height: "+(n-t)+"px"))}function d(t,i,n){var l,r,d=it(o,t),h=d.text.length;function p(i,n){return Cn(e,ut(t,i),"div",d,n)}function f(t,i,n){var o=Nn(e,d,null,t),l="ltr"==i==("after"==n)?"left":"right";return p("after"==n?o.begin:o.end-(/\s/.test(d.text.charAt(o.end-1))?2:1),l)[l]}var g=ve(d,o.direction);return pe(g,i||0,null==n?h:n,(function(e,t,o,d){var m="ltr"==o,v=p(e,m?"left":"right"),b=p(t-1,m?"right":"left"),y=null==i&&0==e,w=null==n&&t==h,_=0==d,x=!g||d==g.length-1;if(b.top-v.top<=3){var C=(c?w:y)&&x,k=(c?y:w)&&_?s:(m?v:b).left,S=C?a:(m?b:v).right;u(k,v.top,S-k,v.bottom)}else{var L,E,T,N;m?(L=c&&y&&_?s:v.left,E=c?a:f(e,o,"before"),T=c?s:f(t,o,"after"),N=c&&w&&x?a:b.right):(L=c?f(e,o,"before"):s,E=!c&&y&&_?a:v.right,T=!c&&w&&x?s:b.left,N=c?f(t,o,"after"):a),u(L,v.top,E-L,v.bottom),v.bottom0?t.blinker=setInterval((function(){e.hasFocus()||no(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function eo(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||io(e))}function to(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&no(e))}),100)}function io(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(xe(e,"focus",e,t),e.state.focused=!0,R(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),a&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Qn(e))}function no(e,t){e.state.delayingBlurEvent||(e.state.focused&&(xe(e,"blur",e,t),e.state.focused=!1,E(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function oo(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=Math.max(0,t.scroller.getBoundingClientRect().top),o=t.lineDiv.getBoundingClientRect().top,l=0,a=0;a.005||g<-.005)&&(oe.display.sizerWidth){var v=Math.ceil(h/In(e.display));v>e.display.maxLineLength&&(e.display.maxLineLength=v,e.display.maxLine=c.line,e.display.maxLineChanged=!0)}}}Math.abs(l)>2&&(t.scroller.scrollTop+=l)}function lo(e){if(e.widgets)for(var t=0;t=r&&(l=st(t,ui(it(t,a))-e.wrapper.clientHeight),r=a)}return{from:l,to:Math.max(r,l+1)}}function so(e,t){if(!Ce(e,"scrollCursorIntoView")){var i=e.display,n=i.sizer.getBoundingClientRect(),o=null,l=i.wrapper.ownerDocument;if(t.top+n.top<0?o=!0:t.bottom+n.top>(l.defaultView.innerHeight||l.documentElement.clientHeight)&&(o=!1),null!=o&&!g){var r=z("div","​",null,"position: absolute;\n top: "+(t.top-i.viewOffset-Ki(e.display))+"px;\n height: "+(t.bottom-t.top+Ji(e)+i.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(r),r.scrollIntoView(o),e.display.lineSpace.removeChild(r)}}}function ao(e,t,i,n){var o;null==n&&(n=0),e.options.lineWrapping||t!=i||(i="before"==t.sticky?ut(t.line,t.ch+1,"before"):t,t=t.ch?ut(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var l=0;l<5;l++){var r=!1,s=kn(e,t),a=i&&i!=t?kn(e,i):s,c=uo(e,o={left:Math.min(s.left,a.left),top:Math.min(s.top,a.top)-n,right:Math.max(s.left,a.left),bottom:Math.max(s.bottom,a.bottom)+n}),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(bo(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(r=!0)),null!=c.scrollLeft&&(wo(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(r=!0)),!r)break}return o}function co(e,t){var i=uo(e,t);null!=i.scrollTop&&bo(e,i.scrollTop),null!=i.scrollLeft&&wo(e,i.scrollLeft)}function uo(e,t){var i=e.display,n=Rn(e.display);t.top<0&&(t.top=0);var o=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:i.scroller.scrollTop,l=en(e),r={};t.bottom-t.top>l&&(t.bottom=t.top+l);var s=e.doc.height+Yi(i),a=t.tops-n;if(t.topo+l){var u=Math.min(t.top,(c?s:t.bottom)-l);u!=o&&(r.scrollTop=u)}var d=e.options.fixedGutter?0:i.gutters.offsetWidth,h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:i.scroller.scrollLeft-d,p=Qi(e)-i.gutters.offsetWidth,f=t.right-t.left>p;return f&&(t.right=t.left+p),t.left<10?r.scrollLeft=0:t.leftp+h-3&&(r.scrollLeft=t.right+(f?0:10)-p),r}function ho(e,t){null!=t&&(mo(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function po(e){mo(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function fo(e,t,i){null==t&&null==i||mo(e),null!=t&&(e.curOp.scrollLeft=t),null!=i&&(e.curOp.scrollTop=i)}function go(e,t){mo(e),e.curOp.scrollToPos=t}function mo(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,vo(e,Sn(e,t.from),Sn(e,t.to),t.margin))}function vo(e,t,i,n){var o=uo(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-n,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+n});fo(e,o.scrollLeft,o.scrollTop)}function bo(e,t){Math.abs(e.doc.scrollTop-t)<2||(i||Ko(e,{top:t}),yo(e,t,!0),i&&Ko(e),Vo(e,100))}function yo(e,t,i){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||i)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function wo(e,t,i,n){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,Qo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function _o(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+Yi(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:n,scrollHeight:n+Ji(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var xo=function(e,t,i){this.cm=i;var n=this.vert=z("div",[z("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=z("div",[z("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=o.tabIndex=-1,e(n),e(o),ye(n,"scroll",(function(){n.clientHeight&&t(n.scrollTop,"vertical")})),ye(o,"scroll",(function(){o.clientWidth&&t(o.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,r&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};xo.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var o=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+o)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var l=e.viewWidth-e.barLeft-(i?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+l)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?n:0,bottom:t?n:0}},xo.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},xo.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},xo.prototype.zeroWidthHack=function(){var e=y&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new j,this.disableVert=new j},xo.prototype.enableZeroWidthBar=function(e,t,i){function n(){var o=e.getBoundingClientRect();("vert"==i?document.elementFromPoint(o.right-1,(o.top+o.bottom)/2):document.elementFromPoint((o.right+o.left)/2,o.bottom-1))!=e?e.style.visibility="hidden":t.set(1e3,n)}e.style.visibility="",t.set(1e3,n)},xo.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Co=function(){};function ko(e,t){t||(t=_o(e));var i=e.display.barWidth,n=e.display.barHeight;So(e,t);for(var o=0;o<4&&i!=e.display.barWidth||n!=e.display.barHeight;o++)i!=e.display.barWidth&&e.options.lineWrapping&&oo(e),So(e,_o(e)),i=e.display.barWidth,n=e.display.barHeight}function So(e,t){var i=e.display,n=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=n.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=n.bottom)+"px",i.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=n.bottom+"px",i.scrollbarFiller.style.width=n.right+"px"):i.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=n.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}Co.prototype.update=function(){return{bottom:0,right:0}},Co.prototype.setScrollLeft=function(){},Co.prototype.setScrollTop=function(){},Co.prototype.clear=function(){};var Lo={native:xo,null:Co};function Eo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Lo[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ye(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,i){"horizontal"==i?wo(e,t):bo(e,t)}),e),e.display.scrollbars.addClass&&R(e.display.wrapper,e.display.scrollbars.addClass)}var To=0;function No(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++To,markArrays:null},Ni(e.curOp)}function zo(e){var t=e.curOp;t&&Ai(t,(function(e){for(var t=0;t=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Wo(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Mo(e){e.updatedDisplay=e.mustUpdate&&Go(e.cm,e.update)}function Ro(e){var t=e.cm,i=t.display;e.updatedDisplay&&oo(t),e.barMeasure=_o(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ln(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+Ji(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Qi(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function Io(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var i=+new Date+e.options.workTime,n=kt(e,t.highlightFrontier),o=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(l){if(n.line>=e.display.viewFrom){var r=l.styles,s=l.text.length>e.options.maxHighlightLength?Je(t.mode,n.state):null,a=xt(e,l,n,!0);s&&(n.state=s),l.styles=a.styles;var c=l.styleClasses,u=a.classes;u?l.styleClasses=u:c&&(l.styleClasses=null);for(var d=!r||r.length!=l.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),h=0;!d&&hi)return Vo(e,e.options.workDelay),!0})),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),o.length&&Ho(e,(function(){for(var t=0;t=i.viewFrom&&t.visible.to<=i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&0==Gn(e))return!1;el(e)&&(jn(e),t.dims=On(e));var o=n.first+n.size,l=Math.max(t.visible.from-e.options.viewportMargin,n.first),r=Math.min(o,t.visible.to+e.options.viewportMargin);i.viewFromr&&i.viewTo-r<20&&(r=Math.min(o,i.viewTo)),It&&(l=ri(e.doc,l),r=si(e.doc,r));var s=l!=i.viewFrom||r!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Zn(e,l,r),i.viewOffset=ui(it(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var a=Gn(e);if(!s&&0==a&&!t.force&&i.renderedView==i.view&&(null==i.updateLineNumbers||i.updateLineNumbers>=i.viewTo))return!1;var c=qo(e);return a>4&&(i.lineDiv.style.display="none"),Yo(e,i.updateLineNumbers,t.dims),a>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,Zo(c),T(i.cursorDiv),T(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,s&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,Vo(e,400)),i.updateLineNumbers=null,!0}function $o(e,t){for(var i=t.viewport,n=!0;;n=!1){if(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Qi(e))n&&(t.visible=ro(e.display,e.doc,i));else if(i&&null!=i.top&&(i={top:Math.min(e.doc.height+Yi(e.display)-en(e),i.top)}),t.visible=ro(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!Go(e,t))break;oo(e);var o=_o(e);$n(e),ko(e,o),Jo(e,o),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Ko(e,t){var i=new Wo(e,t);if(Go(e,i)){oo(e),$o(e,i);var n=_o(e);$n(e),ko(e,n),Jo(e,n),i.finish()}}function Yo(e,t,i){var n=e.display,o=e.options.lineNumbers,l=n.lineDiv,r=l.firstChild;function s(t){var i=t.nextSibling;return a&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),i}for(var c=n.view,u=n.viewFrom,d=0;d-1&&(p=!1),Ii(e,h,u,i)),p&&(T(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(ct(e.options,u)))),r=h.node.nextSibling}else{var f=Wi(e,h,u,i);l.insertBefore(f,r)}u+=h.size}for(;r;)r=s(r)}function Xo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",Mi(e,"gutterChanged",e)}function Jo(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Ji(e)+"px"}function Qo(e){var t=e.display,i=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=Hn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,o=t.gutters.offsetWidth,l=n+"px",r=0;r=105&&(l.wrapper.style.clipPath="inset(0px)"),l.wrapper.setAttribute("translate","no"),r&&s<8&&(l.gutters.style.zIndex=-1,l.scroller.style.paddingRight=0),a||i&&b||(l.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(l.wrapper):e(l.wrapper)),l.viewFrom=l.viewTo=t.first,l.reportedViewFrom=l.reportedViewTo=t.first,l.view=[],l.renderedView=null,l.externalMeasured=null,l.viewOffset=0,l.lastWrapHeight=l.lastWrapWidth=0,l.updateLineNumbers=null,l.nativeBarWidth=l.barHeight=l.barWidth=0,l.scrollbarsClipped=!1,l.lineNumWidth=l.lineNumInnerWidth=l.lineNumChars=null,l.alignWidgets=!1,l.cachedCharWidth=l.cachedTextHeight=l.cachedPaddingH=null,l.maxLine=null,l.maxLineLength=0,l.maxLineChanged=!1,l.wheelDX=l.wheelDY=l.wheelStartX=l.wheelStartY=null,l.shift=!1,l.selForContextMenu=null,l.activeTouch=null,l.gutterSpecs=tl(o.gutters,o.lineNumbers),il(l),n.init(l)}Wo.prototype.signal=function(e,t){Se(e,t)&&this.events.push(arguments)},Wo.prototype.finish=function(){for(var e=0;ec.clientWidth,f=c.scrollHeight>c.clientHeight;if(o&&p||l&&f){if(l&&y&&a)e:for(var g=t.target,m=s.view;g!=c;g=g.parentNode)for(var v=0;v=0&&dt(e,n.to())<=0)return i}return-1};var dl=function(e,t){this.anchor=e,this.head=t};function hl(e,t,i){var n=e&&e.options.selectionsMayTouch,o=t[i];t.sort((function(e,t){return dt(e.from(),t.from())})),i=q(t,o);for(var l=1;l0:a>=0){var c=gt(s.from(),r.from()),u=ft(s.to(),r.to()),d=s.empty()?r.from()==r.head:s.from()==s.head;l<=i&&--i,t.splice(--l,2,new dl(d?u:c,d?c:u))}}return new ul(t,i)}function pl(e,t){return new ul([new dl(e,t||e)],0)}function fl(e){return e.text?ut(e.from.line+e.text.length-1,ee(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function gl(e,t){if(dt(e,t.from)<0)return e;if(dt(e,t.to)<=0)return fl(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=fl(t).ch-t.to.ch),ut(i,n)}function ml(e,t){for(var i=[],n=0;n1&&e.remove(s.line+1,f-1),e.insert(s.line+1,v)}Mi(e,"change",e,t)}function Cl(e,t,i){function n(e,o,l){if(e.linked)for(var r=0;r1&&!e.done[e.done.length-2].ranges?(e.done.pop(),ee(e.done)):void 0}function Al(e,t,i,n){var o=e.history;o.undone.length=0;var l,r,s=+new Date;if((o.lastOp==n||o.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&o.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(l=zl(o,o.lastOp==n)))r=ee(l.changes),0==dt(t.from,t.to)&&0==dt(t.from,r.to)?r.to=fl(t):l.changes.push(Tl(e,t));else{var a=ee(o.done);for(a&&a.ranges||Rl(e.sel,o.done),l={changes:[Tl(e,t)],generation:o.generation},o.done.push(l);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(i),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=s,o.lastOp=o.lastSelOp=n,o.lastOrigin=o.lastSelOrigin=t.origin,r||xe(e,"historyAdded")}function Bl(e,t,i,n){var o=t.charAt(0);return"*"==o||"+"==o&&i.ranges.length==n.ranges.length&&i.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Ml(e,t,i,n){var o=e.history,l=n&&n.origin;i==o.lastSelOp||l&&o.lastSelOrigin==l&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==l||Bl(e,l,ee(o.done),t))?o.done[o.done.length-1]=t:Rl(t,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=l,o.lastSelOp=i,n&&!1!==n.clearRedo&&Nl(o.undone)}function Rl(e,t){var i=ee(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Il(e,t,i,n){var o=t["spans_"+e.id],l=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),(function(i){i.markedSpans&&((o||(o=t["spans_"+e.id]={}))[l]=i.markedSpans),++l}))}function Ol(e){if(!e)return null;for(var t,i=0;i-1&&(ee(s)[d]=c[d],delete c[d])}}}return n}function Pl(e,t,i,n){if(n){var o=e.anchor;if(i){var l=dt(t,o)<0;l!=dt(i,o)<0?(o=t,t=i):l!=dt(t,i)<0&&(t=i)}return new dl(o,t)}return new dl(i||t,t)}function Vl(e,t,i,n,o){null==o&&(o=e.cm&&(e.cm.display.shift||e.extend)),Gl(e,new ul([Pl(e.sel.primary(),t,i,o)],0),n)}function Ul(e,t,i){for(var n=[],o=e.cm&&(e.cm.display.shift||e.extend),l=0;l=t.ch:s.to>t.ch))){if(o&&(xe(a,"beforeCursorEnter"),a.explicitlyCleared)){if(l.markedSpans){--r;continue}break}if(!a.atomic)continue;if(i){var d=a.find(n<0?1:-1),h=void 0;if((n<0?u:c)&&(d=er(e,d,-n,d&&d.line==t.line?l:null)),d&&d.line==t.line&&(h=dt(d,i))&&(n<0?h<0:h>0))return Jl(e,d,t,n,o)}var p=a.find(n<0?-1:1);return(n<0?c:u)&&(p=er(e,p,n,p.line==t.line?l:null)),p?Jl(e,p,t,n,o):null}}return t}function Ql(e,t,i,n,o){var l=n||1,r=Jl(e,t,i,l,o)||!o&&Jl(e,t,i,l,!0)||Jl(e,t,i,-l,o)||!o&&Jl(e,t,i,-l,!0);return r||(e.cantEdit=!0,ut(e.first,0))}function er(e,t,i,n){return i<0&&0==t.ch?t.line>e.first?vt(e,ut(t.line-1)):null:i>0&&t.ch==(n||it(e,t.line)).text.length?t.line=0;--o)or(e,{from:n[o].from,to:n[o].to,text:o?[""]:t.text,origin:t.origin});else or(e,t)}}function or(e,t){if(1!=t.text.length||""!=t.text[0]||0!=dt(t.from,t.to)){var i=ml(e,t);Al(e,t,i,e.cm?e.cm.curOp.id:NaN),sr(e,t,i,jt(e,t));var n=[];Cl(e,(function(e,i){i||-1!=q(n,e.history)||(hr(e.history,t),n.push(e.history)),sr(e,t,null,jt(e,t))}))}}function lr(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(!n||i){for(var o,l=e.history,r=e.sel,s="undo"==t?l.done:l.undone,a="undo"==t?l.undone:l.done,c=0;c=0;--p){var f=h(p);if(f)return f.v}}}}function rr(e,t){if(0!=t&&(e.first+=t,e.sel=new ul(te(e.sel.ranges,(function(e){return new dl(ut(e.anchor.line+t,e.anchor.ch),ut(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){Un(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;ne.lastLine())){if(t.from.linel&&(t={from:t.from,to:ut(l,it(e,l).text.length),text:[t.text[0]],origin:t.origin}),t.removed=nt(e,t.from,t.to),i||(i=ml(e,t)),e.cm?ar(e.cm,t,n):xl(e,t,n),$l(e,i,$),e.cantEdit&&Ql(e,ut(e.firstLine(),0))&&(e.cantEdit=!1)}}function ar(e,t,i){var n=e.doc,o=e.display,l=t.from,r=t.to,s=!1,a=l.line;e.options.lineWrapping||(a=rt(ni(it(n,l.line))),n.iter(a,r.line+1,(function(e){if(e==o.maxLine)return s=!0,!0}))),n.sel.contains(t.from,t.to)>-1&&ke(e),xl(n,t,i,Dn(e)),e.options.lineWrapping||(n.iter(a,l.line+t.text.length,(function(e){var t=di(e);t>o.maxLineLength&&(o.maxLine=e,o.maxLineLength=t,o.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),Mt(n,l.line),Vo(e,400);var c=t.text.length-(r.line-l.line)-1;t.full?Un(e):l.line!=r.line||1!=t.text.length||_l(e.doc,t)?Un(e,l.line,r.line+1,c):Wn(e,l.line,"text");var u=Se(e,"changes"),d=Se(e,"change");if(d||u){var h={from:l,to:r,text:t.text,removed:t.removed,origin:t.origin};d&&Mi(e,"change",e,h),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function cr(e,t,i,n,o){var l;n||(n=i),dt(n,i)<0&&(i=(l=[n,i])[0],n=l[1]),"string"==typeof t&&(t=e.splitLines(t)),nr(e,{from:i,to:n,text:t,origin:o})}function ur(e,t,i,n){i1||!(this.children[0]instanceof fr))){var s=[];this.collapse(s),this.children=[new fr(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var r=o.lines.length%25+25,s=r;s10);e.parent.maybeSpill()}},iterN:function(e,t,i){for(var n=0;n0||0==r&&!1!==l.clearWhenEmpty)return l;if(l.replacedWith&&(l.collapsed=!0,l.widgetNode=A("span",[l.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||l.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(l.widgetNode.insertLeft=!0)),l.collapsed){if(ii(e,t.line,t,i,l)||t.line!=i.line&&ii(e,i.line,t,i,l))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ht()}l.addToHistory&&Al(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var s,a=t.line,c=e.cm;if(e.iter(a,i.line+1,(function(n){c&&l.collapsed&&!c.options.lineWrapping&&ni(n)==c.display.maxLine&&(s=!0),l.collapsed&&a!=t.line&<(n,0),Vt(n,new Dt(l,a==t.line?t.ch:null,a==i.line?i.ch:null),e.cm&&e.cm.curOp),++a})),l.collapsed&&e.iter(t.line,i.line+1,(function(t){ai(e,t)&<(t,0)})),l.clearOnEnter&&ye(l,"beforeCursorEnter",(function(){return l.clear()})),l.readOnly&&(Ot(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),l.collapsed&&(l.id=++yr,l.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),l.collapsed)Un(c,t.line,i.line+1);else if(l.className||l.startStyle||l.endStyle||l.css||l.attributes||l.title)for(var u=t.line;u<=i.line;u++)Wn(c,u,"text");l.atomic&&Yl(c.doc),Mi(c,"markerAdded",c,l)}return l}wr.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&No(e),Se(this,"clear")){var i=this.find();i&&Mi(this,"clear",i.from,i.to)}for(var n=null,o=null,l=0;le.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&Un(e,n,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Yl(e.doc)),e&&Mi(e,"markerCleared",e,this,n,o),t&&zo(e),this.parent&&this.parent.clear()}},wr.prototype.find=function(e,t){var i,n;null==e&&"bookmark"==this.type&&(e=1);for(var o=0;o=0;a--)nr(this,n[a]);s?Zl(this,s):this.cm&&po(this.cm)})),undo:Po((function(){lr(this,"undo")})),redo:Po((function(){lr(this,"redo")})),undoSelection:Po((function(){lr(this,"undo",!0)})),redoSelection:Po((function(){lr(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,n=0;n=e.ch)&&t.push(o.marker.parent||o.marker)}return t},findMarks:function(e,t,i){e=vt(this,e),t=vt(this,t);var n=[],o=e.line;return this.iter(e.line,t.line+1,(function(l){var r=l.markedSpans;if(r)for(var s=0;s=a.to||null==a.from&&o!=e.line||null!=a.from&&o==t.line&&a.from>=t.ch||i&&!i(a.marker)||n.push(a.marker.parent||a.marker)}++o})),n},getAllMarks:function(){var e=[];return this.iter((function(t){var i=t.markedSpans;if(i)for(var n=0;ne)return t=e,!0;e-=l,++i})),vt(this,ut(i,t))},indexFromPos:function(e){var t=(e=vt(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var d=e.dataTransfer.getData("Text");if(d){var h;if(t.state.draggingText&&!t.state.draggingText.copy&&(h=t.listSelections()),$l(t.doc,pl(i,i)),h)for(var p=0;p=0;t--)cr(e.doc,"",n[t].from,n[t].to,"+delete");po(e)}))}function Jr(e,t,i){var n=de(e.text,t+i,i);return n<0||n>e.text.length?null:n}function Qr(e,t,i){var n=Jr(e,t.ch,i);return null==n?null:new ut(t.line,n,i<0?"after":"before")}function es(e,t,i,n,o){if(e){"rtl"==t.doc.direction&&(o=-o);var l=ve(i,t.doc.direction);if(l){var r,s=o<0?ee(l):l[0],a=o<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var c=sn(t,i);r=o<0?i.text.length-1:0;var u=an(t,c,r).top;r=he((function(e){return an(t,c,e).top==u}),o<0==(1==s.level)?s.from:s.to-1,r),"before"==a&&(r=Jr(i,r,1))}else r=o<0?s.to:s.from;return new ut(n,r,a)}}return new ut(n,o<0?i.text.length:0,o<0?"before":"after")}function ts(e,t,i,n){var o=ve(t,e.doc.direction);if(!o)return Qr(t,i,n);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var l=ge(o,i.ch,i.sticky),r=o[l];if("ltr"==e.doc.direction&&r.level%2==0&&(n>0?r.to>i.ch:r.from=r.from&&h>=u.begin)){var p=d?"before":"after";return new ut(i.line,h,p)}}var f=function(e,t,n){for(var l=function(e,t){return t?new ut(i.line,a(e,1),"before"):new ut(i.line,e,"after")};e>=0&&e0==(1!=r.level),c=s?n.begin:a(n.end,-1);if(r.from<=c&&c0?u.end:a(u.begin,-1);return null==m||n>0&&m==t.text.length||!(g=f(n>0?0:o.length-1,n,c(m)))?null:g}Wr.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Wr.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Wr.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Wr.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Wr.default=y?Wr.macDefault:Wr.pcDefault;var is={selectAll:tr,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),$)},killLine:function(e){return Xr(e,(function(t){if(t.empty()){var i=it(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line0)o=new ut(o.line,o.ch+1),e.replaceRange(l.charAt(o.ch-1)+l.charAt(o.ch-2),ut(o.line,o.ch-2),o,"+transpose");else if(o.line>e.doc.first){var r=it(e.doc,o.line-1).text;r&&(o=new ut(o.line,1),e.replaceRange(l.charAt(0)+e.doc.lineSeparator()+r.charAt(r.length-1),ut(o.line-1,r.length-1),o,"+transpose"))}i.push(new dl(o,o))}e.setSelections(i)}))},newlineAndIndent:function(e){return Ho(e,(function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var n=0;n-1&&(dt((o=s.ranges[o]).from(),t)<0||t.xRel>0)&&(dt(o.to(),t)>0||t.xRel<0)?Es(e,n,t,l):Ns(e,n,t,l)}function Es(e,t,i,n){var o=e.display,l=!1,c=Do(e,(function(t){a&&(o.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:to(e)),_e(o.wrapper.ownerDocument,"mouseup",c),_e(o.wrapper.ownerDocument,"mousemove",u),_e(o.scroller,"dragstart",d),_e(o.scroller,"drop",c),l||(Ee(t),n.addNew||Vl(e.doc,i,null,null,n.extend),a&&!p||r&&9==s?setTimeout((function(){o.wrapper.ownerDocument.body.focus({preventScroll:!0}),o.input.focus()}),20):o.input.focus())})),u=function(e){l=l||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return l=!0};a&&(o.scroller.draggable=!0),e.state.draggingText=c,c.copy=!n.moveOnDrag,ye(o.wrapper.ownerDocument,"mouseup",c),ye(o.wrapper.ownerDocument,"mousemove",u),ye(o.scroller,"dragstart",d),ye(o.scroller,"drop",c),e.state.delayingBlurEvent=!0,setTimeout((function(){return o.input.focus()}),20),o.scroller.dragDrop&&o.scroller.dragDrop()}function Ts(e,t,i){if("char"==i)return new dl(t,t);if("word"==i)return e.findWordAt(t);if("line"==i)return new dl(ut(t.line,0),vt(e.doc,ut(t.line+1,0)));var n=i(e,t);return new dl(n.from,n.to)}function Ns(e,t,i,n){r&&to(e);var o=e.display,l=e.doc;Ee(t);var s,a,c=l.sel,u=c.ranges;if(n.addNew&&!n.extend?(a=l.sel.contains(i),s=a>-1?u[a]:new dl(i,i)):(s=l.sel.primary(),a=l.sel.primIndex),"rectangle"==n.unit)n.addNew||(s=new dl(i,i)),i=Pn(e,t,!0,!0),a=-1;else{var d=Ts(e,i,n.unit);s=n.extend?Pl(s,d.anchor,d.head,n.extend):d}n.addNew?-1==a?(a=u.length,Gl(l,hl(e,u.concat([s]),a),{scroll:!1,origin:"*mouse"})):u.length>1&&u[a].empty()&&"char"==n.unit&&!n.extend?(Gl(l,hl(e,u.slice(0,a).concat(u.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),c=l.sel):Wl(l,a,s,K):(a=0,Gl(l,new ul([s],0),K),c=l.sel);var h=i;function p(t){if(0!=dt(h,t))if(h=t,"rectangle"==n.unit){for(var o=[],r=e.options.tabSize,u=W(it(l,i.line).text,i.ch,r),d=W(it(l,t.line).text,t.ch,r),p=Math.min(u,d),f=Math.max(u,d),g=Math.min(i.line,t.line),m=Math.min(e.lastLine(),Math.max(i.line,t.line));g<=m;g++){var v=it(l,g).text,b=X(v,p,r);p==f?o.push(new dl(ut(g,b),ut(g,b))):v.length>b&&o.push(new dl(ut(g,b),ut(g,X(v,f,r))))}o.length||o.push(new dl(i,i)),Gl(l,hl(e,c.ranges.slice(0,a).concat(o),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var y,w=s,_=Ts(e,t,n.unit),x=w.anchor;dt(_.anchor,x)>0?(y=_.head,x=gt(w.from(),_.anchor)):(y=_.anchor,x=ft(w.to(),_.head));var C=c.ranges.slice(0);C[a]=zs(e,new dl(vt(l,x),y)),Gl(l,hl(e,C,a),K)}}var f=o.wrapper.getBoundingClientRect(),g=0;function m(t){var i=++g,r=Pn(e,t,!0,"rectangle"==n.unit);if(r)if(0!=dt(r,h)){e.curOp.focus=M(D(e)),p(r);var s=ro(o,l);(r.line>=s.to||r.linef.bottom?20:0;a&&setTimeout(Do(e,(function(){g==i&&(o.scroller.scrollTop+=a,m(t))})),50)}}function v(t){e.state.selectingText=!1,g=1/0,t&&(Ee(t),o.input.focus()),_e(o.wrapper.ownerDocument,"mousemove",b),_e(o.wrapper.ownerDocument,"mouseup",y),l.history.lastSelOrigin=null}var b=Do(e,(function(e){0!==e.buttons&&Be(e)?m(e):v(e)})),y=Do(e,v);e.state.selectingText=y,ye(o.wrapper.ownerDocument,"mousemove",b),ye(o.wrapper.ownerDocument,"mouseup",y)}function zs(e,t){var i=t.anchor,n=t.head,o=it(e.doc,i.line);if(0==dt(i,n)&&i.sticky==n.sticky)return t;var l=ve(o);if(!l)return t;var r=ge(l,i.ch,i.sticky),s=l[r];if(s.from!=i.ch&&s.to!=i.ch)return t;var a,c=r+(s.from==i.ch==(1!=s.level)?0:1);if(0==c||c==l.length)return t;if(n.line!=i.line)a=(n.line-i.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=ge(l,n.ch,n.sticky),d=u-r||(n.ch-i.ch)*(1==s.level?-1:1);a=u==c-1||u==c?d<0:d>0}var h=l[c+(a?-1:0)],p=a==(1==h.level),f=p?h.from:h.to,g=p?"after":"before";return i.ch==f&&i.sticky==g?t:new dl(new ut(i.line,f,g),n)}function As(e,t,i,n){var o,l;if(t.touches)o=t.touches[0].clientX,l=t.touches[0].clientY;else try{o=t.clientX,l=t.clientY}catch(e){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&Ee(t);var r=e.display,s=r.lineDiv.getBoundingClientRect();if(l>s.bottom||!Se(e,i))return Ne(t);l-=s.top-r.viewOffset;for(var a=0;a=o)return xe(e,i,e,st(e.doc,l),e.display.gutterSpecs[a].className,t),Ne(t)}}function Bs(e,t){return As(e,t,"gutterClick",!0)}function Ms(e,t){$i(e.display,t)||Rs(e,t)||Ce(e,t,"contextmenu")||k||e.display.input.onContextMenu(t)}function Rs(e,t){return!!Se(e,"gutterContextMenu")&&As(e,t,"gutterContextMenu",!1)}function Is(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),vn(e)}_s.prototype.compare=function(e,t,i){return this.time+ws>e&&0==dt(t,this.pos)&&i==this.button};var Os={toString:function(){return"CodeMirror.Init"}},Hs={},Ds={};function Fs(e){var t=e.optionHandlers;function i(i,n,o,l){e.defaults[i]=n,o&&(t[i]=l?function(e,t,i){i!=Os&&o(e,t,i)}:o)}e.defineOption=i,e.Init=Os,i("value","",(function(e,t){return e.setValue(t)}),!0),i("mode",null,(function(e,t){e.doc.modeOption=t,yl(e)}),!0),i("indentUnit",2,yl,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,(function(e){wl(e),vn(e),Un(e)}),!0),i("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var i=[],n=e.doc.first;e.doc.iter((function(e){for(var o=0;;){var l=e.text.indexOf(t,o);if(-1==l)break;o=l+t.length,i.push(ut(n,l))}n++}));for(var o=i.length-1;o>=0;o--)cr(e.doc,t,i[o],ut(i[o].line,i[o].ch+t.length))}})),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,(function(e,t,i){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),i!=Os&&e.refresh()})),i("specialCharPlaceholder",wi,(function(e){return e.refresh()}),!0),i("electricChars",!0),i("inputStyle",b?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),i("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),i("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),i("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),i("rtlMoveVisually",!_),i("wholeLineUpdateBefore",!0),i("theme","default",(function(e){Is(e),nl(e)}),!0),i("keyMap","default",(function(e,t,i){var n=Yr(t),o=i!=Os&&Yr(i);o&&o.detach&&o.detach(e,n),n.attach&&n.attach(e,o||null)})),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Vs,!0),i("gutters",[],(function(e,t){e.display.gutterSpecs=tl(t,e.options.lineNumbers),nl(e)}),!0),i("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?Hn(e.display)+"px":"0",e.refresh()}),!0),i("coverGutterNextToScrollbar",!1,(function(e){return ko(e)}),!0),i("scrollbarStyle","native",(function(e){Eo(e),ko(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),i("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=tl(e.options.gutters,t),nl(e)}),!0),i("firstLineNumber",1,nl,!0),i("lineNumberFormatter",(function(e){return e}),nl,!0),i("showCursorWhenSelecting",!1,$n,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,(function(e,t){"nocursor"==t&&(no(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),i("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),i("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),i("dragDrop",!0,Ps),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,$n,!0),i("singleCursorHeightPerLine",!0,$n,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,wl,!0),i("addModeClass",!1,wl,!0),i("pollInterval",100),i("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),i("historyEventDelay",1250),i("viewportMargin",10,(function(e){return e.refresh()}),!0),i("maxHighlightLength",1e4,wl,!0),i("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),i("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),i("autofocus",null),i("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),i("phrases",null)}function Ps(e,t,i){if(!t!=!(i&&i!=Os)){var n=e.display.dragFunctions,o=t?ye:_e;o(e.display.scroller,"dragstart",n.start),o(e.display.scroller,"dragenter",n.enter),o(e.display.scroller,"dragover",n.over),o(e.display.scroller,"dragleave",n.leave),o(e.display.scroller,"drop",n.drop)}}function Vs(e){e.options.lineWrapping?(R(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(E(e.display.wrapper,"CodeMirror-wrap"),hi(e)),Fn(e),Un(e),vn(e),setTimeout((function(){return ko(e)}),100)}function Us(e,t){var i=this;if(!(this instanceof Us))return new Us(e,t);this.options=t=t?U(t):{},U(Hs,t,!1);var n=t.value;"string"==typeof n?n=new Tr(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var o=new Us.inputStyles[t.inputStyle](this),l=this.display=new ol(e,n,o,t);for(var c in l.wrapper.CodeMirror=this,Is(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Eo(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new j,keySeq:null,specialChars:null},t.autofocus&&!b&&l.input.focus(),r&&s<11&&setTimeout((function(){return i.display.input.reset(!0)}),20),Ws(this),Or(),No(this),this.curOp.forceUpdate=!0,kl(this,n),t.autofocus&&!b||this.hasFocus()?setTimeout((function(){i.hasFocus()&&!i.state.focused&&io(i)}),20):no(this),Ds)Ds.hasOwnProperty(c)&&Ds[c](this,t[c],Os);el(this),t.finishInit&&t.finishInit(this);for(var u=0;u400}ye(t.scroller,"touchstart",(function(o){if(!Ce(e,o)&&!l(o)&&!Bs(e,o)){t.input.ensurePolled(),clearTimeout(i);var r=+new Date;t.activeTouch={start:r,moved:!1,prev:r-n.end<=300?n:null},1==o.touches.length&&(t.activeTouch.left=o.touches[0].pageX,t.activeTouch.top=o.touches[0].pageY)}})),ye(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),ye(t.scroller,"touchend",(function(i){var n=t.activeTouch;if(n&&!$i(t,i)&&null!=n.left&&!n.moved&&new Date-n.start<300){var l,r=e.coordsChar(t.activeTouch,"page");l=!n.prev||a(n,n.prev)?new dl(r,r):!n.prev.prev||a(n,n.prev.prev)?e.findWordAt(r):new dl(ut(r.line,0),vt(e.doc,ut(r.line+1,0))),e.setSelection(l.anchor,l.head),e.focus(),Ee(i)}o()})),ye(t.scroller,"touchcancel",o),ye(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(bo(e,t.scroller.scrollTop),wo(e,t.scroller.scrollLeft,!0),xe(e,"scroll",e))})),ye(t.scroller,"mousewheel",(function(t){return cl(e,t)})),ye(t.scroller,"DOMMouseScroll",(function(t){return cl(e,t)})),ye(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){Ce(e,t)||ze(t)},over:function(t){Ce(e,t)||(Br(e,t),ze(t))},start:function(t){return Ar(e,t)},drop:Do(e,zr),leave:function(t){Ce(e,t)||Mr(e)}};var c=t.input.getField();ye(c,"keyup",(function(t){return ms.call(e,t)})),ye(c,"keydown",Do(e,fs)),ye(c,"keypress",Do(e,vs)),ye(c,"focus",(function(t){return io(e,t)})),ye(c,"blur",(function(t){return no(e,t)}))}Us.defaults=Hs,Us.optionHandlers=Ds;var js=[];function qs(e,t,i,n){var o,l=e.doc;null==i&&(i="add"),"smart"==i&&(l.mode.indent?o=kt(e,t).state:i="prev");var r=e.options.tabSize,s=it(l,t),a=W(s.text,null,r);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==i&&((c=l.mode.indent(o,s.text.slice(u.length),s.text))==G||c>150)){if(!n)return;i="prev"}}else c=0,i="not";"prev"==i?c=t>l.first?W(it(l,t-1).text,null,r):0:"add"==i?c=a+e.options.indentUnit:"subtract"==i?c=a-e.options.indentUnit:"number"==typeof i&&(c=a+i),c=Math.max(0,c);var d="",h=0;if(e.options.indentWithTabs)for(var p=Math.floor(c/r);p;--p)h+=r,d+="\t";if(hr,a=Fe(t),c=null;if(s&&n.ranges.length>1)if(Zs&&Zs.text.join("\n")==t){if(n.ranges.length%Zs.text.length==0){c=[];for(var u=0;u=0;h--){var p=n.ranges[h],f=p.from(),g=p.to();p.empty()&&(i&&i>0?f=ut(f.line,f.ch-i):e.state.overwrite&&!s?g=ut(g.line,Math.min(it(l,g.line).text.length,g.ch+ee(a).length)):s&&Zs&&Zs.lineWise&&Zs.text.join("\n")==a.join("\n")&&(f=g=ut(f.line,0)));var m={from:f,to:g,text:c?c[h%c.length]:a,origin:o||(s?"paste":e.state.cutIncoming>r?"cut":"+input")};nr(e.doc,m),Mi(e,"inputRead",e,m)}t&&!s&&Ys(e,t),po(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ks(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||!t.hasFocus()||Ho(t,(function(){return $s(t,i,0,null,"paste")})),!0}function Ys(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var i=e.doc.sel,n=i.ranges.length-1;n>=0;n--){var o=i.ranges[n];if(!(o.head.ch>100||n&&i.ranges[n-1].head.line==o.head.line)){var l=e.getModeAt(o.head),r=!1;if(l.electricChars){for(var s=0;s-1){r=qs(e,o.head.line,"smart");break}}else l.electricInput&&l.electricInput.test(it(e.doc,o.head.line).text.slice(0,o.head.ch))&&(r=qs(e,o.head.line,"smart"));r&&Mi(e,"electricInput",e,o.head.line)}}}function Xs(e){for(var t=[],i=[],n=0;ni&&(qs(this,o.head.line,e,!0),i=o.head.line,n==this.doc.sel.primIndex&&po(this));else{var l=o.from(),r=o.to(),s=Math.max(i,l.line);i=Math.min(this.lastLine(),r.line-(r.ch?0:1))+1;for(var a=s;a0&&Wl(this.doc,n,new dl(l,c[n].to()),$)}}})),getTokenAt:function(e,t){return Nt(this,e,t)},getLineTokens:function(e,t){return Nt(this,ut(e),t,!0)},getTokenTypeAt:function(e){e=vt(this.doc,e);var t,i=Ct(this,it(this.doc,e.line)),n=0,o=(i.length-1)/2,l=e.ch;if(0==l)t=i[2];else for(;;){var r=n+o>>1;if((r?i[2*r-1]:0)>=l)o=r;else{if(!(i[2*r+1]l&&(e=l,o=!0),n=it(this.doc,e)}else n=e;return _n(this,n,{top:0,left:0},t||"page",i||o).top+(o?this.doc.height-ui(n):0)},defaultTextHeight:function(){return Rn(this.display)},defaultCharWidth:function(){return In(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,i,n,o){var l=this.display,r=(e=kn(this,vt(this.doc,e))).bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==n)r=e.top;else if("above"==n||"near"==n){var a=Math.max(l.wrapper.clientHeight,this.doc.height),c=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>a)&&e.top>t.offsetHeight?r=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=a&&(r=e.bottom),s+t.offsetWidth>c&&(s=c-t.offsetWidth)}t.style.top=r+"px",t.style.left=t.style.right="","right"==o?(s=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==o?s=0:"middle"==o&&(s=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),i&&co(this,{left:s,top:r,right:s+t.offsetWidth,bottom:r+t.offsetHeight})},triggerOnKeyDown:Fo(fs),triggerOnKeyPress:Fo(vs),triggerOnKeyUp:ms,triggerOnMouseDown:Fo(Cs),execCommand:function(e){if(is.hasOwnProperty(e))return is[e].call(null,this)},triggerElectric:Fo((function(e){Ys(this,e)})),findPosH:function(e,t,i,n){var o=1;t<0&&(o=-1,t=-t);for(var l=vt(this.doc,e),r=0;r0&&r(t.charAt(i-1));)--i;for(;n.5||this.options.lineWrapping)&&Fn(this),xe(this,"refresh",this)})),swapDoc:Fo((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),kl(this,e),vn(this),this.display.input.reset(),fo(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Mi(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Le(e),e.registerHelper=function(t,n,o){i.hasOwnProperty(t)||(i[t]=e[t]={_global:[]}),i[t][n]=o},e.registerGlobalHelper=function(t,n,o,l){e.registerHelper(t,n,l),i[t]._global.push({pred:o,val:l})}}function ta(e,t,i,n,o){var l=t,r=i,s=it(e,t.line),a=o&&"rtl"==e.direction?-i:i;function c(){var i=t.line+a;return!(i=e.first+e.size)&&(t=new ut(i,t.ch,t.sticky),s=it(e,i))}function u(l){var r;if("codepoint"==n){var u=s.text.charCodeAt(t.ch+(i>0?0:-1));if(isNaN(u))r=null;else{var d=i>0?u>=55296&&u<56320:u>=56320&&u<57343;r=new ut(t.line,Math.max(0,Math.min(s.text.length,t.ch+i*(d?2:1))),-i)}}else r=o?ts(e.cm,s,t,i):Qr(s,t,i);if(null==r){if(l||!c())return!1;t=es(o,e.cm,s,t.line,a)}else t=r;return!0}if("char"==n||"codepoint"==n)u();else if("column"==n)u(!0);else if("word"==n||"group"==n)for(var d=null,h="group"==n,p=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(i<0)||u(!f);f=!1){var g=s.text.charAt(t.ch)||"\n",m=se(g,p)?"w":h&&"\n"==g?"n":!h||/\s/.test(g)?null:"p";if(!h||f||m||(m="s"),d&&d!=m){i<0&&(i=1,u(),t.sticky="after");break}if(m&&(d=m),i>0&&!u(!f))break}var v=Ql(e,t,l,r,!0);return ht(l,v)&&(v.hitSide=!0),v}function ia(e,t,i,n){var o,l,r=e.doc,s=t.left;if("page"==n){var a=Math.min(e.display.wrapper.clientHeight,P(e).innerHeight||r(e).documentElement.clientHeight),c=Math.max(a-.5*Rn(e.display),3);o=(i>0?t.bottom:t.top)+i*c}else"line"==n&&(o=i>0?t.bottom+3:t.top-3);for(;(l=En(e,s,o)).outside;){if(i<0?o<=0:o>=r.height){l.hitSide=!0;break}o+=5*i}return l}var na=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new j,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function oa(e,t){var i=rn(e,t.line);if(!i||i.hidden)return null;var n=it(e.doc,t.line),o=nn(i,n,t.line),l=ve(n,e.doc.direction),r="left";l&&(r=ge(l,t.ch)%2?"right":"left");var s=dn(o.map,t.ch,r);return s.offset="right"==s.collapse?s.end:s.start,s}function la(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function ra(e,t){return t&&(e.bad=!0),e}function sa(e,t,i,n,o){var l="",r=!1,s=e.doc.lineSeparator(),a=!1;function c(e){return function(t){return t.id==e}}function u(){r&&(l+=s,a&&(l+=s),r=a=!1)}function d(e){e&&(u(),l+=e)}function h(t){if(1==t.nodeType){var i=t.getAttribute("cm-text");if(i)return void d(i);var l,p=t.getAttribute("cm-marker");if(p){var f=e.findMarks(ut(n,0),ut(o+1,0),c(+p));return void(f.length&&(l=f[0].find(0))&&d(nt(e.doc,l.from,l.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var g=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;g&&u();for(var m=0;m=t.display.viewTo||l.line=t.display.viewFrom&&oa(t,o)||{node:a[0].measure.map[2],offset:0},u=l.linen.firstLine()&&(r=ut(r.line-1,it(n.doc,r.line-1).length)),s.ch==it(n.doc,s.line).text.length&&s.lineo.viewTo-1)return!1;r.line==o.viewFrom||0==(e=Vn(n,r.line))?(t=rt(o.view[0].line),i=o.view[0].node):(t=rt(o.view[e].line),i=o.view[e-1].node.nextSibling);var a,c,u=Vn(n,s.line);if(u==o.view.length-1?(a=o.viewTo-1,c=o.lineDiv.lastChild):(a=rt(o.view[u+1].line)-1,c=o.view[u+1].node.previousSibling),!i)return!1;for(var d=n.doc.splitLines(sa(n,i,c,t,a)),h=nt(n.doc,ut(t,0),ut(a,it(n.doc,a).text.length));d.length>1&&h.length>1;)if(ee(d)==ee(h))d.pop(),h.pop(),a--;else{if(d[0]!=h[0])break;d.shift(),h.shift(),t++}for(var p=0,f=0,g=d[0],m=h[0],v=Math.min(g.length,m.length);pr.ch&&b.charCodeAt(b.length-f-1)==y.charCodeAt(y.length-f-1);)p--,f++;d[d.length-1]=b.slice(0,b.length-f).replace(/^\u200b+/,""),d[0]=d[0].slice(p).replace(/\u200b+$/,"");var _=ut(t,p),x=ut(a,h.length?ee(h).length-f:0);return d.length>1||d[0]||dt(_,x)?(cr(n.doc,d,_,x,"+input"),!0):void 0},na.prototype.ensurePolled=function(){this.forceCompositionEnd()},na.prototype.reset=function(){this.forceCompositionEnd()},na.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},na.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},na.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Ho(this.cm,(function(){return Un(e.cm)}))},na.prototype.setUneditable=function(e){e.contentEditable="false"},na.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Do(this.cm,$s)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},na.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},na.prototype.onContextMenu=function(){},na.prototype.resetPosition=function(){},na.prototype.needsContentAttribute=!0;var ua=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new j,this.hasSelection=!1,this.composing=null,this.resetting=!1};function da(e,t){if((t=t?U(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var i=M(F(e));t.autofocus=i==e||null!=e.getAttribute("autofocus")&&i==document.body}function n(){e.value=s.getValue()}var o;if(e.form&&(ye(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var l=e.form;o=l.submit;try{var r=l.submit=function(){n(),l.submit=o,l.submit(),l.submit=r}}catch(e){}}t.finishInit=function(i){i.save=n,i.getTextArea=function(){return e},i.toTextArea=function(){i.toTextArea=isNaN,n(),e.parentNode.removeChild(i.getWrapperElement()),e.style.display="",e.form&&(_e(e.form,"submit",n),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=o))}},e.style.display="none";var s=Us((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s}function ha(e){e.off=_e,e.on=ye,e.wheelEventPixels=al,e.Doc=Tr,e.splitLines=Fe,e.countColumn=W,e.findColumn=X,e.isWordChar=re,e.Pass=G,e.signal=xe,e.Line=pi,e.changeEnd=fl,e.scrollbarModel=Lo,e.Pos=ut,e.cmpPos=dt,e.modes=je,e.mimeModes=qe,e.resolveMode=$e,e.getMode=Ke,e.modeExtensions=Ye,e.extendMode=Xe,e.copyState=Je,e.startState=et,e.innerMode=Qe,e.commands=is,e.keyMap=Wr,e.keyName=Kr,e.isModifierKey=Gr,e.lookupKey=Zr,e.normalizeKeyMap=qr,e.StringStream=tt,e.SharedTextMarker=xr,e.TextMarker=wr,e.LineWidget=mr,e.e_preventDefault=Ee,e.e_stopPropagation=Te,e.e_stop=ze,e.addClass=R,e.contains=B,e.rmClass=E,e.keyNames=Fr}ua.prototype.init=function(e){var t=this,i=this,n=this.cm;this.createField(e);var o=this.textarea;function l(e){if(!Ce(n,e)){if(n.somethingSelected())Gs({lineWise:!1,text:n.getSelections()});else{if(!n.options.lineWiseCopyCut)return;var t=Xs(n);Gs({lineWise:!0,text:t.text}),"cut"==e.type?n.setSelections(t.ranges,null,$):(i.prevInput="",o.value=t.text.join("\n"),O(o))}"cut"==e.type&&(n.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(o.style.width="0px"),ye(o,"input",(function(){r&&s>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()})),ye(o,"paste",(function(e){Ce(n,e)||Ks(e,n)||(n.state.pasteIncoming=+new Date,i.fastPoll())})),ye(o,"cut",l),ye(o,"copy",l),ye(e.scroller,"paste",(function(t){if(!$i(e,t)&&!Ce(n,t)){if(!o.dispatchEvent)return n.state.pasteIncoming=+new Date,void i.focus();var l=new Event("paste");l.clipboardData=t.clipboardData,o.dispatchEvent(l)}})),ye(e.lineSpace,"selectstart",(function(t){$i(e,t)||Ee(t)})),ye(o,"compositionstart",(function(){var e=n.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}})),ye(o,"compositionend",(function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)}))},ua.prototype.createField=function(e){this.wrapper=Qs(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;Js(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},ua.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ua.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=Kn(e);if(e.options.moveInputWithCursor){var o=kn(e,i.sel.primary().head,"div"),l=t.wrapper.getBoundingClientRect(),r=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,o.top+r.top-l.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,o.left+r.left-l.left))}return n},ua.prototype.showSelection=function(e){var t=this.cm.display;N(t.cursorDiv,e.cursors),N(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ua.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&O(this.textarea),r&&s>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",r&&s>=9&&(this.hasSelection=null));this.resetting=!1}},ua.prototype.getField=function(){return this.textarea},ua.prototype.supportsTouch=function(){return!1},ua.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!b||M(F(this.textarea))!=this.textarea))try{this.textarea.focus()}catch(e){}},ua.prototype.blur=function(){this.textarea.blur()},ua.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ua.prototype.receivedFocus=function(){this.slowPoll()},ua.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},ua.prototype.fastPoll=function(){var e=!1,t=this;function i(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,i))}t.pollingFast=!0,t.polling.set(20,i)},ua.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||Pe(i)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var o=i.value;if(o==n&&!t.somethingSelected())return!1;if(r&&s>=9&&this.hasSelection===o||y&&/[\uf700-\uf7ff]/.test(o))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var l=o.charCodeAt(0);if(8203!=l||n||(n="​"),8666==l)return this.reset(),this.cm.execCommand("undo")}for(var a=0,c=Math.min(n.length,o.length);a1e3||o.indexOf("\n")>-1?i.value=e.prevInput="":e.prevInput=o,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},ua.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ua.prototype.onKeyPress=function(){r&&s>=9&&(this.hasSelection=null),this.fastPoll()},ua.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,o=t.textarea;t.contextMenuPending&&t.contextMenuPending();var l=Pn(i,e),c=n.scroller.scrollTop;if(l&&!h){i.options.resetSelectionOnContextMenu&&-1==i.doc.sel.contains(l)&&Do(i,Gl)(i.doc,pl(l),$);var u,d=o.style.cssText,p=t.wrapper.style.cssText,f=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",o.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+"px;\n z-index: 1000; background: "+(r?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",a&&(u=o.ownerDocument.defaultView.scrollY),n.input.focus(),a&&o.ownerDocument.defaultView.scrollTo(null,u),n.input.reset(),i.somethingSelected()||(o.value=t.prevInput=" "),t.contextMenuPending=v,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll),r&&s>=9&&m(),k){ze(e);var g=function(){_e(window,"mouseup",g),setTimeout(v,20)};ye(window,"mouseup",g)}else setTimeout(v,50)}function m(){if(null!=o.selectionStart){var e=i.somethingSelected(),l="​"+(e?o.value:"");o.value="⇚",o.value=l,t.prevInput=e?"":"​",o.selectionStart=1,o.selectionEnd=l.length,n.selForContextMenu=i.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=p,o.style.cssText=d,r&&s<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=c),null!=o.selectionStart)){(!r||r&&s<9)&&m();var e=0,l=function(){n.selForContextMenu==i.doc.sel&&0==o.selectionStart&&o.selectionEnd>0&&"​"==t.prevInput?Do(i,tr)(i):e++<10?n.detectingSelectAll=setTimeout(l,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(l,200)}}},ua.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},ua.prototype.setUneditable=function(){},ua.prototype.needsContentAttribute=!1,Fs(Us),ea(Us);var pa="iter insert remove copy getEditor constructor".split(" ");for(var fa in Tr.prototype)Tr.prototype.hasOwnProperty(fa)&&q(pa,fa)<0&&(Us.prototype[fa]=function(e){return function(){return e.apply(this.doc,arguments)}}(Tr.prototype[fa]));return Le(Tr),Us.inputStyles={textarea:ua,contenteditable:na},Us.defineMode=function(e){Us.defaults.mode||"null"==e||(Us.defaults.mode=e),Ze.apply(this,arguments)},Us.defineMIME=Ge,Us.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Us.defineMIME("text/plain","null"),Us.defineExtension=function(e,t){Us.prototype[e]=t},Us.defineDocExtension=function(e,t){Tr.prototype[e]=t},Us.fromTextArea=da,ha(Us),Us.version="5.65.16",Us}()},656:(e,t,i)=>{!function(e){"use strict";function t(e){for(var t={},i=0;i*\/]/.test(i)?x(null,"select-op"):"."==i&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?x("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(i)?x(null,i):e.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(e.current())&&(t.tokenize=S),x("variable callee","variable")):/[\w\\\-]/.test(i)?(e.eatWhile(/[\w\\\-]/),x("property","word")):x(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),x("number","unit")):e.match(/^-[\w\\\-]*/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?x("variable-2","variable-definition"):x("variable-2","variable")):e.match(/^\w+-/)?x("meta","meta"):void 0}function k(e){return function(t,i){for(var n,o=!1;null!=(n=t.next());){if(n==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==n}return(n==e||!o&&")"!=e)&&(i.tokenize=null),x("string","string")}}function S(e,t){return e.next(),e.match(/^\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=k(")"),x(null,"(")}function L(e,t,i){this.type=e,this.indent=t,this.prev=i}function E(e,t,i,n){return e.context=new L(i,t.indentation()+(!1===n?0:r),e.context),i}function T(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function N(e,t,i){return B[i.context.type](e,t,i)}function z(e,t,i,n){for(var o=n||1;o>0;o--)i.context=i.context.prev;return N(e,t,i)}function A(e){var t=e.current().toLowerCase();l=v.hasOwnProperty(t)?"atom":m.hasOwnProperty(t)?"keyword":"variable"}var B={top:function(e,t,i){if("{"==e)return E(i,t,"block");if("}"==e&&i.context.prev)return T(i);if(w&&/@component/i.test(e))return E(i,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return E(i,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return E(i,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return i.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return E(i,t,"at");if("hash"==e)l="builtin";else if("word"==e)l="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return E(i,t,"interpolation");if(":"==e)return"pseudo";if(b&&"("==e)return E(i,t,"parens")}return i.context.type},block:function(e,t,i){if("word"==e){var n=t.current().toLowerCase();return h.hasOwnProperty(n)?(l="property","maybeprop"):p.hasOwnProperty(n)?(l=_?"string-2":"property","maybeprop"):b?(l=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(l+=" error","maybeprop")}return"meta"==e?"block":b||"hash"!=e&&"qualifier"!=e?B.top(e,t,i):(l="error","block")},maybeprop:function(e,t,i){return":"==e?E(i,t,"prop"):N(e,t,i)},prop:function(e,t,i){if(";"==e)return T(i);if("{"==e&&b)return E(i,t,"propBlock");if("}"==e||"{"==e)return z(e,t,i);if("("==e)return E(i,t,"parens");if("hash"!=e||/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(t.current())){if("word"==e)A(t);else if("interpolation"==e)return E(i,t,"interpolation")}else l+=" error";return"prop"},propBlock:function(e,t,i){return"}"==e?T(i):"word"==e?(l="property","maybeprop"):i.context.type},parens:function(e,t,i){return"{"==e||"}"==e?z(e,t,i):")"==e?T(i):"("==e?E(i,t,"parens"):"interpolation"==e?E(i,t,"interpolation"):("word"==e&&A(t),"parens")},pseudo:function(e,t,i){return"meta"==e?"pseudo":"word"==e?(l="variable-3",i.context.type):N(e,t,i)},documentTypes:function(e,t,i){return"word"==e&&a.hasOwnProperty(t.current())?(l="tag",i.context.type):B.atBlock(e,t,i)},atBlock:function(e,t,i){if("("==e)return E(i,t,"atBlock_parens");if("}"==e||";"==e)return z(e,t,i);if("{"==e)return T(i)&&E(i,t,b?"block":"top");if("interpolation"==e)return E(i,t,"interpolation");if("word"==e){var n=t.current().toLowerCase();l="only"==n||"not"==n||"and"==n||"or"==n?"keyword":c.hasOwnProperty(n)?"attribute":u.hasOwnProperty(n)?"property":d.hasOwnProperty(n)?"keyword":h.hasOwnProperty(n)?"property":p.hasOwnProperty(n)?_?"string-2":"property":v.hasOwnProperty(n)?"atom":m.hasOwnProperty(n)?"keyword":"error"}return i.context.type},atComponentBlock:function(e,t,i){return"}"==e?z(e,t,i):"{"==e?T(i)&&E(i,t,b?"block":"top",!1):("word"==e&&(l="error"),i.context.type)},atBlock_parens:function(e,t,i){return")"==e?T(i):"{"==e||"}"==e?z(e,t,i,2):B.atBlock(e,t,i)},restricted_atBlock_before:function(e,t,i){return"{"==e?E(i,t,"restricted_atBlock"):"word"==e&&"@counter-style"==i.stateArg?(l="variable","restricted_atBlock_before"):N(e,t,i)},restricted_atBlock:function(e,t,i){return"}"==e?(i.stateArg=null,T(i)):"word"==e?(l="@font-face"==i.stateArg&&!f.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==i.stateArg&&!g.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,i){return"word"==e?(l="variable","keyframes"):"{"==e?E(i,t,"top"):N(e,t,i)},at:function(e,t,i){return";"==e?T(i):"{"==e||"}"==e?z(e,t,i):("word"==e?l="tag":"hash"==e&&(l="builtin"),"at")},interpolation:function(e,t,i){return"}"==e?T(i):"{"==e||";"==e?z(e,t,i):("word"==e?l="variable":"variable"!=e&&"("!=e&&")"!=e&&(l="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:n?"block":"top",stateArg:null,context:new L(n?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var i=(t.tokenize||C)(e,t);return i&&"object"==typeof i&&(o=i[1],i=i[0]),l=i,"comment"!=o&&(t.state=B[t.state](o,e,t)),l},indent:function(e,t){var i=e.context,n=t&&t.charAt(0),o=i.indent;return"prop"!=i.type||"}"!=n&&")"!=n||(i=i.prev),i.prev&&("}"!=n||"block"!=i.type&&"top"!=i.type&&"interpolation"!=i.type&&"restricted_atBlock"!=i.type?(")"!=n||"parens"!=i.type&&"atBlock_parens"!=i.type)&&("{"!=n||"at"!=i.type&&"atBlock"!=i.type)||(o=Math.max(0,i.indent-r)):o=(i=i.prev).indent),o},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:y,fold:"brace"}}));var i=["domain","regexp","url","url-prefix"],n=t(i),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],l=t(o),r=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],s=t(r),a=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],c=t(a),u=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],d=t(u),h=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],p=t(h),f=t(["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),g=t(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),m=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],v=t(m),b=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],y=t(b),w=i.concat(o).concat(r).concat(a).concat(u).concat(h).concat(m).concat(b);function _(e,t){for(var i,n=!1;null!=(i=e.next());){if(n&&"/"==i){t.tokenize=null;break}n="*"==i}return["comment","comment"]}e.registerHelper("hintWords","css",w),e.defineMIME("text/css",{documentTypes:n,mediaTypes:l,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:p,fontProperties:f,counterDescriptors:g,colorKeywords:v,valueKeywords:y,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=_,_(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:l,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:v,valueKeywords:y,fontProperties:f,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=_,_(e,t)):["operator","operator"]},":":function(e){return!!e.match(/^\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:l,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:v,valueKeywords:y,fontProperties:f,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=_,_(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:n,mediaTypes:l,mediaFeatures:s,propertyKeywords:d,nonStandardPropertyKeywords:p,fontProperties:f,counterDescriptors:g,colorKeywords:v,valueKeywords:y,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=_,_(e,t))}},name:"css",helperType:"gss"})}(i(237))},520:(e,t,i)=>{!function(e){"use strict";var t={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function i(e,t,i){var n=e.current(),o=n.search(t);return o>-1?e.backUp(n.length-o):n.match(/<\/?$/)&&(e.backUp(n.length),e.match(t,!1)||e.match(n)),i}var n={};function o(e){var t=n[e];return t||(n[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}function l(e,t){var i=e.match(o(t));return i?/^\s*(.*?)\s*$/.exec(i[2])[1]:""}function r(e,t){return new RegExp((t?"^":"")+"","i")}function s(e,t){for(var i in e)for(var n=t[i]||(t[i]=[]),o=e[i],l=o.length-1;l>=0;l--)n.unshift(o[l])}function a(e,t){for(var i=0;i=0;h--)c.script.unshift(["type",d[h].matches,d[h].mode]);function p(t,o){var s,u=l.token(t,o.htmlState),d=/\btag\b/.test(u);if(d&&!/[<>\s\/]/.test(t.current())&&(s=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&c.hasOwnProperty(s))o.inTag=s+" ";else if(o.inTag&&d&&/>$/.test(t.current())){var h=/^([\S]+) (.*)/.exec(o.inTag);o.inTag=null;var f=">"==t.current()&&a(c[h[1]],h[2]),g=e.getMode(n,f),m=r(h[1],!0),v=r(h[1],!1);o.token=function(e,t){return e.match(m,!1)?(t.token=p,t.localState=t.localMode=null,null):i(e,v,t.localMode.token(e,t.localState))},o.localMode=g,o.localState=e.startState(g,l.indent(o.htmlState,"",""))}else o.inTag&&(o.inTag+=t.current(),t.eol()&&(o.inTag+=" "));return u}return{startState:function(){return{token:p,inTag:null,localMode:null,localState:null,htmlState:e.startState(l)}},copyState:function(t){var i;return t.localState&&(i=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:i,htmlState:e.copyState(l,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,i,n){return!t.localMode||/^\s*<\//.test(i)?l.indent(t.htmlState,i,n):t.localMode.indent?t.localMode.indent(t.localState,i,n):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||l}}}}),"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")}(i(237),i(576),i(792),i(656))},792:(e,t,i)=>{!function(e){"use strict";e.defineMode("javascript",(function(t,i){var n,o,l=t.indentUnit,r=i.statementIndent,s=i.jsonld,a=i.json||s,c=!1!==i.trackScope,u=i.typescript,d=i.wordCharacters||/[\w$\xa1-\uffff]/,h=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),i=e("keyword b"),n=e("keyword c"),o=e("keyword d"),l=e("operator"),r={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:i,do:i,try:i,finally:i,return:o,break:o,continue:o,new:e("new"),delete:n,void:n,throw:n,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:l,typeof:l,instanceof:l,true:r,false:r,null:r,undefined:r,NaN:r,Infinity:r,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n}}(),p=/[+\-*&%=<>!?|~^@]/,f=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function g(e){for(var t,i=!1,n=!1;null!=(t=e.next());){if(!i){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}i=!i&&"\\"==t}}function m(e,t,i){return n=e,o=i,t}function v(e,t){var i=e.next();if('"'==i||"'"==i)return t.tokenize=b(i),t.tokenize(e,t);if("."==i&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return m("number","number");if("."==i&&e.match(".."))return m("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(i))return m(i);if("="==i&&e.eat(">"))return m("=>","operator");if("0"==i&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return m("number","number");if(/\d/.test(i))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),m("number","number");if("/"==i)return e.eat("*")?(t.tokenize=y,y(e,t)):e.eat("/")?(e.skipToEnd(),m("comment","comment")):ot(e,t,1)?(g(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),m("regexp","string-2")):(e.eat("="),m("operator","operator",e.current()));if("`"==i)return t.tokenize=w,w(e,t);if("#"==i&&"!"==e.peek())return e.skipToEnd(),m("meta","meta");if("#"==i&&e.eatWhile(d))return m("variable","property");if("<"==i&&e.match("!--")||"-"==i&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),m("comment","comment");if(p.test(i))return">"==i&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=i&&"="!=i||e.eat("="):/[<>*+\-|&?]/.test(i)&&(e.eat(i),">"==i&&e.eat(i))),"?"==i&&e.eat(".")?m("."):m("operator","operator",e.current());if(d.test(i)){e.eatWhile(d);var n=e.current();if("."!=t.lastType){if(h.propertyIsEnumerable(n)){var o=h[n];return m(o.type,o.style,n)}if("async"==n&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return m("async","keyword",n)}return m("variable","variable",n)}}function b(e){return function(t,i){var n,o=!1;if(s&&"@"==t.peek()&&t.match(f))return i.tokenize=v,m("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||o);)o=!o&&"\\"==n;return o||(i.tokenize=v),m("string","string")}}function y(e,t){for(var i,n=!1;i=e.next();){if("/"==i&&n){t.tokenize=v;break}n="*"==i}return m("comment","comment")}function w(e,t){for(var i,n=!1;null!=(i=e.next());){if(!n&&("`"==i||"$"==i&&e.eat("{"))){t.tokenize=v;break}n=!n&&"\\"==i}return m("quasi","string-2",e.current())}var _="([{}])";function x(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var i=e.string.indexOf("=>",e.start);if(!(i<0)){if(u){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,i));n&&(i=n.index)}for(var o=0,l=!1,r=i-1;r>=0;--r){var s=e.string.charAt(r),a=_.indexOf(s);if(a>=0&&a<3){if(!o){++r;break}if(0==--o){"("==s&&(l=!0);break}}else if(a>=3&&a<6)++o;else if(d.test(s))l=!0;else if(/["'\/`]/.test(s))for(;;--r){if(0==r)return;if(e.string.charAt(r-1)==s&&"\\"!=e.string.charAt(r-2)){r--;break}}else if(l&&!o){++r;break}}l&&!o&&(t.fatArrowAt=r)}}var C={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function k(e,t,i,n,o,l){this.indented=e,this.column=t,this.type=i,this.prev=o,this.info=l,null!=n&&(this.align=n)}function S(e,t){if(!c)return!1;for(var i=e.localVars;i;i=i.next)if(i.name==t)return!0;for(var n=e.context;n;n=n.prev)for(i=n.vars;i;i=i.next)if(i.name==t)return!0}function L(e,t,i,n,o){var l=e.cc;for(E.state=e,E.stream=o,E.marked=null,E.cc=l,E.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((l.length?l.pop():a?q:W)(i,n)){for(;l.length&&l[l.length-1].lex;)l.pop()();return E.marked?E.marked:"variable"==i&&S(e,n)?"variable-2":t}}var E={state:null,column:null,marked:null,cc:null};function T(){for(var e=arguments.length-1;e>=0;e--)E.cc.push(arguments[e])}function N(){return T.apply(null,arguments),!0}function z(e,t){for(var i=t;i;i=i.next)if(i.name==e)return!0;return!1}function A(e){var t=E.state;if(E.marked="def",c){if(t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var n=B(e,t.context);if(null!=n)return void(t.context=n)}else if(!z(e,t.localVars))return void(t.localVars=new I(e,t.localVars));i.globalVars&&!z(e,t.globalVars)&&(t.globalVars=new I(e,t.globalVars))}}function B(e,t){if(t){if(t.block){var i=B(e,t.prev);return i?i==t.prev?t:new R(i,t.vars,!0):null}return z(e,t.vars)?t:new R(t.prev,new I(e,t.vars),!1)}return null}function M(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function R(e,t,i){this.prev=e,this.vars=t,this.block=i}function I(e,t){this.name=e,this.next=t}var O=new I("this",new I("arguments",null));function H(){E.state.context=new R(E.state.context,E.state.localVars,!1),E.state.localVars=O}function D(){E.state.context=new R(E.state.context,E.state.localVars,!0),E.state.localVars=null}function F(){E.state.localVars=E.state.context.vars,E.state.context=E.state.context.prev}function P(e,t){var i=function(){var i=E.state,n=i.indented;if("stat"==i.lexical.type)n=i.lexical.indented;else for(var o=i.lexical;o&&")"==o.type&&o.align;o=o.prev)n=o.indented;i.lexical=new k(n,E.stream.column(),e,null,i.lexical,t)};return i.lex=!0,i}function V(){var e=E.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function U(e){function t(i){return i==e?N():";"==e||"}"==i||")"==i||"]"==i?T():N(t)}return t}function W(e,t){return"var"==e?N(P("vardef",t),Te,U(";"),V):"keyword a"==e?N(P("form"),G,W,V):"keyword b"==e?N(P("form"),W,V):"keyword d"==e?E.stream.match(/^\s*$/,!1)?N():N(P("stat"),K,U(";"),V):"debugger"==e?N(U(";")):"{"==e?N(P("}"),D,he,V,F):";"==e?N():"if"==e?("else"==E.state.lexical.info&&E.state.cc[E.state.cc.length-1]==V&&E.state.cc.pop()(),N(P("form"),G,W,V,Re)):"function"==e?N(De):"for"==e?N(P("form"),D,Ie,W,F,V):"class"==e||u&&"interface"==t?(E.marked="keyword",N(P("form","class"==e?e:t),We,V)):"variable"==e?u&&"declare"==t?(E.marked="keyword",N(W)):u&&("module"==t||"enum"==t||"type"==t)&&E.stream.match(/^\s*\w/,!1)?(E.marked="keyword","enum"==t?N(tt):"type"==t?N(Pe,U("operator"),ve,U(";")):N(P("form"),Ne,U("{"),P("}"),he,V,V)):u&&"namespace"==t?(E.marked="keyword",N(P("form"),q,W,V)):u&&"abstract"==t?(E.marked="keyword",N(W)):N(P("stat"),le):"switch"==e?N(P("form"),G,U("{"),P("}","switch"),D,he,V,V,F):"case"==e?N(q,U(":")):"default"==e?N(U(":")):"catch"==e?N(P("form"),H,j,W,V,F):"export"==e?N(P("stat"),Ge,V):"import"==e?N(P("stat"),Ke,V):"async"==e?N(W):"@"==t?N(q,W):T(P("stat"),q,U(";"),V)}function j(e){if("("==e)return N(Ve,U(")"))}function q(e,t){return $(e,t,!1)}function Z(e,t){return $(e,t,!0)}function G(e){return"("!=e?T():N(P(")"),K,U(")"),V)}function $(e,t,i){if(E.state.fatArrowAt==E.stream.start){var n=i?te:ee;if("("==e)return N(H,P(")"),ue(Ve,")"),V,U("=>"),n,F);if("variable"==e)return T(H,Ne,U("=>"),n,F)}var o=i?X:Y;return C.hasOwnProperty(e)?N(o):"function"==e?N(De,o):"class"==e||u&&"interface"==t?(E.marked="keyword",N(P("form"),Ue,V)):"keyword c"==e||"async"==e?N(i?Z:q):"("==e?N(P(")"),K,U(")"),V,o):"operator"==e||"spread"==e?N(i?Z:q):"["==e?N(P("]"),et,V,o):"{"==e?de(se,"}",null,o):"quasi"==e?T(J,o):"new"==e?N(ie(i)):N()}function K(e){return e.match(/[;\}\)\],]/)?T():T(q)}function Y(e,t){return","==e?N(K):X(e,t,!1)}function X(e,t,i){var n=0==i?Y:X,o=0==i?q:Z;return"=>"==e?N(H,i?te:ee,F):"operator"==e?/\+\+|--/.test(t)||u&&"!"==t?N(n):u&&"<"==t&&E.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?N(P(">"),ue(ve,">"),V,n):"?"==t?N(q,U(":"),o):N(o):"quasi"==e?T(J,n):";"!=e?"("==e?de(Z,")","call",n):"."==e?N(re,n):"["==e?N(P("]"),K,U("]"),V,n):u&&"as"==t?(E.marked="keyword",N(ve,n)):"regexp"==e?(E.state.lastType=E.marked="operator",E.stream.backUp(E.stream.pos-E.stream.start-1),N(o)):void 0:void 0}function J(e,t){return"quasi"!=e?T():"${"!=t.slice(t.length-2)?N(J):N(K,Q)}function Q(e){if("}"==e)return E.marked="string-2",E.state.tokenize=w,N(J)}function ee(e){return x(E.stream,E.state),T("{"==e?W:q)}function te(e){return x(E.stream,E.state),T("{"==e?W:Z)}function ie(e){return function(t){return"."==t?N(e?oe:ne):"variable"==t&&u?N(Se,e?X:Y):T(e?Z:q)}}function ne(e,t){if("target"==t)return E.marked="keyword",N(Y)}function oe(e,t){if("target"==t)return E.marked="keyword",N(X)}function le(e){return":"==e?N(V,W):T(Y,U(";"),V)}function re(e){if("variable"==e)return E.marked="property",N()}function se(e,t){return"async"==e?(E.marked="property",N(se)):"variable"==e||"keyword"==E.style?(E.marked="property","get"==t||"set"==t?N(ae):(u&&E.state.fatArrowAt==E.stream.start&&(i=E.stream.match(/^\s*:\s*/,!1))&&(E.state.fatArrowAt=E.stream.pos+i[0].length),N(ce))):"number"==e||"string"==e?(E.marked=s?"property":E.style+" property",N(ce)):"jsonld-keyword"==e?N(ce):u&&M(t)?(E.marked="keyword",N(se)):"["==e?N(q,pe,U("]"),ce):"spread"==e?N(Z,ce):"*"==t?(E.marked="keyword",N(se)):":"==e?T(ce):void 0;var i}function ae(e){return"variable"!=e?T(ce):(E.marked="property",N(De))}function ce(e){return":"==e?N(Z):"("==e?T(De):void 0}function ue(e,t,i){function n(o,l){if(i?i.indexOf(o)>-1:","==o){var r=E.state.lexical;return"call"==r.info&&(r.pos=(r.pos||0)+1),N((function(i,n){return i==t||n==t?T():T(e)}),n)}return o==t||l==t?N():i&&i.indexOf(";")>-1?T(e):N(U(t))}return function(i,o){return i==t||o==t?N():T(e,n)}}function de(e,t,i){for(var n=3;n"),ve):"quasi"==e?T(_e,ke):void 0}function be(e){if("=>"==e)return N(ve)}function ye(e){return e.match(/[\}\)\]]/)?N():","==e||";"==e?N(ye):T(we,ye)}function we(e,t){return"variable"==e||"keyword"==E.style?(E.marked="property",N(we)):"?"==t||"number"==e||"string"==e?N(we):":"==e?N(ve):"["==e?N(U("variable"),fe,U("]"),we):"("==e?T(Fe,we):e.match(/[;\}\)\],]/)?void 0:N()}function _e(e,t){return"quasi"!=e?T():"${"!=t.slice(t.length-2)?N(_e):N(ve,xe)}function xe(e){if("}"==e)return E.marked="string-2",E.state.tokenize=w,N(_e)}function Ce(e,t){return"variable"==e&&E.stream.match(/^\s*[?:]/,!1)||"?"==t?N(Ce):":"==e?N(ve):"spread"==e?N(Ce):T(ve)}function ke(e,t){return"<"==t?N(P(">"),ue(ve,">"),V,ke):"|"==t||"."==e||"&"==t?N(ve):"["==e?N(ve,U("]"),ke):"extends"==t||"implements"==t?(E.marked="keyword",N(ve)):"?"==t?N(ve,U(":"),ve):void 0}function Se(e,t){if("<"==t)return N(P(">"),ue(ve,">"),V,ke)}function Le(){return T(ve,Ee)}function Ee(e,t){if("="==t)return N(ve)}function Te(e,t){return"enum"==t?(E.marked="keyword",N(tt)):T(Ne,pe,Be,Me)}function Ne(e,t){return u&&M(t)?(E.marked="keyword",N(Ne)):"variable"==e?(A(t),N()):"spread"==e?N(Ne):"["==e?de(Ae,"]"):"{"==e?de(ze,"}"):void 0}function ze(e,t){return"variable"!=e||E.stream.match(/^\s*:/,!1)?("variable"==e&&(E.marked="property"),"spread"==e?N(Ne):"}"==e?T():"["==e?N(q,U("]"),U(":"),ze):N(U(":"),Ne,Be)):(A(t),N(Be))}function Ae(){return T(Ne,Be)}function Be(e,t){if("="==t)return N(Z)}function Me(e){if(","==e)return N(Te)}function Re(e,t){if("keyword b"==e&&"else"==t)return N(P("form","else"),W,V)}function Ie(e,t){return"await"==t?N(Ie):"("==e?N(P(")"),Oe,V):void 0}function Oe(e){return"var"==e?N(Te,He):"variable"==e?N(He):T(He)}function He(e,t){return")"==e?N():";"==e?N(He):"in"==t||"of"==t?(E.marked="keyword",N(q,He)):T(q,He)}function De(e,t){return"*"==t?(E.marked="keyword",N(De)):"variable"==e?(A(t),N(De)):"("==e?N(H,P(")"),ue(Ve,")"),V,ge,W,F):u&&"<"==t?N(P(">"),ue(Le,">"),V,De):void 0}function Fe(e,t){return"*"==t?(E.marked="keyword",N(Fe)):"variable"==e?(A(t),N(Fe)):"("==e?N(H,P(")"),ue(Ve,")"),V,ge,F):u&&"<"==t?N(P(">"),ue(Le,">"),V,Fe):void 0}function Pe(e,t){return"keyword"==e||"variable"==e?(E.marked="type",N(Pe)):"<"==t?N(P(">"),ue(Le,">"),V):void 0}function Ve(e,t){return"@"==t&&N(q,Ve),"spread"==e?N(Ve):u&&M(t)?(E.marked="keyword",N(Ve)):u&&"this"==e?N(pe,Be):T(Ne,pe,Be)}function Ue(e,t){return"variable"==e?We(e,t):je(e,t)}function We(e,t){if("variable"==e)return A(t),N(je)}function je(e,t){return"<"==t?N(P(">"),ue(Le,">"),V,je):"extends"==t||"implements"==t||u&&","==e?("implements"==t&&(E.marked="keyword"),N(u?ve:q,je)):"{"==e?N(P("}"),qe,V):void 0}function qe(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||u&&M(t))&&E.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1)?(E.marked="keyword",N(qe)):"variable"==e||"keyword"==E.style?(E.marked="property",N(Ze,qe)):"number"==e||"string"==e?N(Ze,qe):"["==e?N(q,pe,U("]"),Ze,qe):"*"==t?(E.marked="keyword",N(qe)):u&&"("==e?T(Fe,qe):";"==e||","==e?N(qe):"}"==e?N():"@"==t?N(q,qe):void 0}function Ze(e,t){if("!"==t)return N(Ze);if("?"==t)return N(Ze);if(":"==e)return N(ve,Be);if("="==t)return N(Z);var i=E.state.lexical.prev;return T(i&&"interface"==i.info?Fe:De)}function Ge(e,t){return"*"==t?(E.marked="keyword",N(Qe,U(";"))):"default"==t?(E.marked="keyword",N(q,U(";"))):"{"==e?N(ue($e,"}"),Qe,U(";")):T(W)}function $e(e,t){return"as"==t?(E.marked="keyword",N(U("variable"))):"variable"==e?T(Z,$e):void 0}function Ke(e){return"string"==e?N():"("==e?T(q):"."==e?T(Y):T(Ye,Xe,Qe)}function Ye(e,t){return"{"==e?de(Ye,"}"):("variable"==e&&A(t),"*"==t&&(E.marked="keyword"),N(Je))}function Xe(e){if(","==e)return N(Ye,Xe)}function Je(e,t){if("as"==t)return E.marked="keyword",N(Ye)}function Qe(e,t){if("from"==t)return E.marked="keyword",N(q)}function et(e){return"]"==e?N():T(ue(Z,"]"))}function tt(){return T(P("form"),Ne,U("{"),P("}"),ue(it,"}"),V,V)}function it(){return T(Ne,Be)}function nt(e,t){return"operator"==e.lastType||","==e.lastType||p.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function ot(e,t,i){return t.tokenize==v&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(i||0)))}return H.lex=D.lex=!0,F.lex=!0,V.lex=!0,{startState:function(e){var t={tokenize:v,lastType:"sof",cc:[],lexical:new k((e||0)-l,0,"block",!1),localVars:i.localVars,context:i.localVars&&new R(null,null,!1),indented:e||0};return i.globalVars&&"object"==typeof i.globalVars&&(t.globalVars=i.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),x(e,t)),t.tokenize!=y&&e.eatSpace())return null;var i=t.tokenize(e,t);return"comment"==n?i:(t.lastType="operator"!=n||"++"!=o&&"--"!=o?n:"incdec",L(t,i,n,o,e))},indent:function(t,n){if(t.tokenize==y||t.tokenize==w)return e.Pass;if(t.tokenize!=v)return 0;var o,s=n&&n.charAt(0),a=t.lexical;if(!/^\s*else\b/.test(n))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==V)a=a.prev;else if(u!=Re&&u!=F)break}for(;("stat"==a.type||"form"==a.type)&&("}"==s||(o=t.cc[t.cc.length-1])&&(o==Y||o==X)&&!/^[,\.=+\-*:?[\(]/.test(n));)a=a.prev;r&&")"==a.type&&"stat"==a.prev.type&&(a=a.prev);var d=a.type,h=s==d;return"vardef"==d?a.indented+("operator"==t.lastType||","==t.lastType?a.info.length+1:0):"form"==d&&"{"==s?a.indented:"form"==d?a.indented+l:"stat"==d?a.indented+(nt(t,n)?r||l:0):"switch"!=a.info||h||0==i.doubleIndentSwitch?a.align?a.column+(h?0:1):a.indented+(h?0:l):a.indented+(/^(?:case|default)\b/.test(n)?l:2*l)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:a?null:"/*",blockCommentEnd:a?null:"*/",blockCommentContinue:a?null:" * ",lineComment:a?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:a?"json":"javascript",jsonldMode:s,jsonMode:a,expressionAllowed:ot,skipExpression:function(t){L(t,"atom","atom","true",new e.StringStream("",2,null))}}})),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/manifest+json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(i(237))},576:(e,t,i)=>{!function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},i={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",(function(n,o){var l,r,s=n.indentUnit,a={},c=o.htmlMode?t:i;for(var u in c)a[u]=c[u];for(var u in o)a[u]=o[u];function d(e,t){function i(i){return t.tokenize=i,i(e,t)}var n=e.next();return"<"==n?e.eat("!")?e.eat("[")?e.match("CDATA[")?i(f("atom","]]>")):null:e.match("--")?i(f("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),i(g(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=f("meta","?>"),"meta"):(l=e.eat("/")?"closeTag":"openTag",t.tokenize=h,"tag bracket"):"&"==n?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function h(e,t){var i=e.next();if(">"==i||"/"==i&&e.eat(">"))return t.tokenize=d,l=">"==i?"endTag":"selfcloseTag","tag bracket";if("="==i)return l="equals",null;if("<"==i){t.tokenize=d,t.state=w,t.tagName=t.tagStart=null;var n=t.tokenize(e,t);return n?n+" tag error":"tag error"}return/[\'\"]/.test(i)?(t.tokenize=p(i),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(e){var t=function(t,i){for(;!t.eol();)if(t.next()==e){i.tokenize=h;break}return"string"};return t.isInAttribute=!0,t}function f(e,t){return function(i,n){for(;!i.eol();){if(i.match(t)){n.tokenize=d;break}i.next()}return e}}function g(e){return function(t,i){for(var n;null!=(n=t.next());){if("<"==n)return i.tokenize=g(e+1),i.tokenize(t,i);if(">"==n){if(1==e){i.tokenize=d;break}return i.tokenize=g(e-1),i.tokenize(t,i)}}return"meta"}}function m(e){return e&&e.toLowerCase()}function v(e,t,i){this.prev=e.context,this.tagName=t||"",this.indent=e.indented,this.startOfLine=i,(a.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function b(e){e.context&&(e.context=e.context.prev)}function y(e,t){for(var i;;){if(!e.context)return;if(i=e.context.tagName,!a.contextGrabbers.hasOwnProperty(m(i))||!a.contextGrabbers[m(i)].hasOwnProperty(m(t)))return;b(e)}}function w(e,t,i){return"openTag"==e?(i.tagStart=t.column(),_):"closeTag"==e?x:w}function _(e,t,i){return"word"==e?(i.tagName=t.current(),r="tag",S):a.allowMissingTagName&&"endTag"==e?(r="tag bracket",S(e,t,i)):(r="error",_)}function x(e,t,i){if("word"==e){var n=t.current();return i.context&&i.context.tagName!=n&&a.implicitlyClosed.hasOwnProperty(m(i.context.tagName))&&b(i),i.context&&i.context.tagName==n||!1===a.matchClosing?(r="tag",C):(r="tag error",k)}return a.allowMissingTagName&&"endTag"==e?(r="tag bracket",C(e,t,i)):(r="error",k)}function C(e,t,i){return"endTag"!=e?(r="error",C):(b(i),w)}function k(e,t,i){return r="error",C(e,t,i)}function S(e,t,i){if("word"==e)return r="attribute",L;if("endTag"==e||"selfcloseTag"==e){var n=i.tagName,o=i.tagStart;return i.tagName=i.tagStart=null,"selfcloseTag"==e||a.autoSelfClosers.hasOwnProperty(m(n))?y(i,n):(y(i,n),i.context=new v(i,n,o==i.indented)),w}return r="error",S}function L(e,t,i){return"equals"==e?E:(a.allowMissing||(r="error"),S(e,t,i))}function E(e,t,i){return"string"==e?T:"word"==e&&a.allowUnquoted?(r="string",S):(r="error",S(e,t,i))}function T(e,t,i){return"string"==e?T:S(e,t,i)}return d.isInText=!0,{startState:function(e){var t={tokenize:d,state:w,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;l=null;var i=t.tokenize(e,t);return(i||l)&&"comment"!=i&&(r=null,t.state=t.state(l||i,e,t),r&&(i="error"==r?i+" error":r)),i},indent:function(t,i,n){var o=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+s;if(o&&o.noIndent)return e.Pass;if(t.tokenize!=h&&t.tokenize!=d)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==a.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+s*(a.multilineTagIndentFactor||1);if(a.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:a.htmlMode?"html":"xml",helperType:a.htmlMode?"html":"xml",skipAttribute:function(e){e.state==E&&(e.state=S)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],i=e.context;i;i=i.prev)t.push(i.tagName);return t.reverse()}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}(i(237))},950:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"ckb",toolbar:{default:"بنه‌ڕه‌ت",save:"پاشه‌كه‌وتكردن",font:"فۆنت",formats:"Formats",fontSize:"قه‌باره‌",bold:"تۆخكردن",underline:"هێڵ به‌ژێردا بێنه‌",italic:"لار",strike:"هێڵ به‌ناودا بێنه‌",subscript:"ژێرسکریپت",superscript:"سەرنووس",removeFormat:"لابردنی فۆرمات",fontColor:"ره‌نگی فۆنت",hiliteColor:"ره‌نگی دیاركراو",indent:"بۆشایی بەجێهێشتن",outdent:"لابردنی بۆشایی",align:"ئاراسته‌",alignLeft:"لای چه‌پ",alignRight:"لای راست",alignCenter:"ناوه‌ند",alignJustify:"به‌رێكی دابه‌ش بكه‌",list:"لیست",orderList:"لیستی ریزكراو",unorderList:"لیستی ریزنه‌كراو",horizontalRule:"هێڵی ئاسۆیی",hr_solid:"پته‌و",hr_dotted:"نوكته‌ نوكته‌",hr_dashed:"داش داش",table:"خشته‌",link:"به‌سته‌ر",math:"بیركاری",image:"وێنه‌",video:"ڤیدیۆ",audio:"ده‌نگ",fullScreen:"پڕ به‌ شاشه‌",showBlocks:"بڵۆك نیشانبده",codeView:"بینینی كۆده‌كان",undo:"وەک خۆی لێ بکەوە",redo:"هەڵگەڕاندنەوە",preview:"پێشبینین",print:"پرینت",tag_p:"په‌ره‌گراف",tag_div:"ی ئاسایی (DIV)",tag_h:"سەرپەڕە",tag_blockquote:"ده‌ق",tag_pre:"كۆد",template:"قاڵب",lineHeight:"بڵندی دێر",paragraphStyle:"ستایلی په‌ره‌گراف",textStyle:"ستایلی نوسین",imageGallery:"گاله‌ری وێنه‌كان",dir_ltr:"من اليسار إلى اليمين",dir_rtl:"من اليمين الى اليسار",mention:"تنويه ب"},dialogBox:{linkBox:{title:"به‌سته‌ر دابنێ",url:"به‌سته‌ر",text:"تێكستی به‌سته‌ر",newWindowCheck:"له‌ په‌نجه‌ره‌یه‌كی نوێ بكه‌ره‌وه‌",downloadLinkCheck:"رابط التحميل",bookmark:"المرجعية"},mathBox:{title:"بیركاری",inputLabel:"نیشانه‌كانی بیركاری",fontSizeLabel:"قه‌باره‌ی فۆنت",previewLabel:"پێشبینین"},imageBox:{title:"وێنه‌یه‌ك دابنێ",file:"فایلێك هه‌ڵبژێره‌",url:"به‌سته‌ری وێنه‌",altText:"نوسینی جێگره‌وه‌"},videoBox:{title:"ڤیدیۆیه‌ك دابنێ",file:"فایلێك هه‌ڵبژێره‌",url:"YouTube/Vimeo به‌سته‌ری له‌ناودانان وه‌ك "},audioBox:{title:"ده‌نگێك دابنێ",file:"فایلێك هه‌ڵبژێره‌",url:"به‌سته‌ری ده‌نگ"},browser:{tags:"تاگه‌كان",search:"گه‌ران"},caption:"پێناسه‌یه‌ك دابنێ",close:"داخستن",submitButton:"ناردن",revertButton:"بیگەڕێنەوە سەر باری سەرەتایی",proportion:"رێژه‌كان وه‌ك خۆی بهێڵه‌وه‌",basic:"سه‌ره‌تایی",left:"چه‌پ",right:"راست",center:"ناوەڕاست",width:"پانی",height:"به‌رزی",size:"قه‌باره‌",ratio:"رێژه‌"},controller:{edit:"دەسکاریکردن",unlink:"سڕینەوەی بەستەر",remove:"سڕینه‌وه‌",insertRowAbove:"ریزك له‌ سه‌ره‌وه‌ زیادبكه‌",insertRowBelow:"ریزێك له‌ خواره‌وه‌ زیادبكه‌",deleteRow:"ریز بسره‌وه‌",insertColumnBefore:"ستونێك له‌ پێشه‌وه‌ زیادبكه‌",insertColumnAfter:"ستونێك له‌ دواوه‌ زیادبكه‌",deleteColumn:"ستونێك بسره‌وه‌",fixedColumnWidth:"پانی ستون نه‌گۆربكه‌",resize100:"قه‌باره‌ بگۆره‌ بۆ ١٠٠%",resize75:"قه‌باره‌ بگۆره‌ بۆ ٧٥%",resize50:"قه‌باره‌ بگۆره‌ بۆ ٥٠%",resize25:"قه‌باره‌ بگۆره‌ بۆ ٢٥%",autoSize:"قه‌باره‌ی خۆكارانه‌",mirrorHorizontal:"هه‌ڵگه‌رێنه‌وه‌ به‌ده‌وری ته‌وه‌ره‌ی ئاسۆیی",mirrorVertical:"هه‌ڵگه‌رێنه‌وه‌ به‌ده‌وری ته‌وه‌ره‌ی ستونی",rotateLeft:"بسوڕێنه‌ به‌لای چه‌پدا",rotateRight:"بسورێنه‌ به‌لای راستدا",maxSize:"گه‌وره‌ترین قه‌باره‌",minSize:"بچوكترین قه‌باره‌",tableHeader:"سه‌ردێری خشته‌ك",mergeCells:"خانه‌كان تێكه‌ڵبكه‌",splitCells:"خانه‌كان لێك جیابكه‌وه‌",HorizontalSplit:"جیاكردنه‌وه‌ی ئاسۆیی",VerticalSplit:"جیاكردنه‌وه‌ی ستونی"},menu:{spaced:"بۆشای هه‌بێت",bordered:"لێواری هه‌بێت",neon:"نیۆن",translucent:"كه‌مێك وه‌ك شووشه‌",shadow:"سێبه‌ر",code:"كۆد"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"ckb",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},246:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"cs",toolbar:{default:"Výchozí",save:"Uložit",font:"Písmo",formats:"Formáty",fontSize:"Velikost",bold:"Tučné",underline:"Podtržení",italic:"Kurzíva",strike:"Přeškrtnutí",subscript:"Dolní index",superscript:"Horní index",removeFormat:"Odebrat formát",fontColor:"Barva písma",hiliteColor:"Barva zvýraznění",indent:"Odsadit",outdent:"Předsadit",align:"Zarovnat",alignLeft:"Zarovnat vlevo",alignRight:"Zarovnat vpravo",alignCenter:"Zarovnat na střed",alignJustify:"Zarovnat do bloku",list:"Seznam",orderList:"Seřazený seznam",unorderList:"Neřazený seznam",horizontalRule:"Vodorovná čára",hr_solid:"Nepřerušovaná",hr_dotted:"Tečkovaná",hr_dashed:"Čárkovaná",table:"Tabulka",link:"Odkaz",math:"Matematika",image:"Obrázek",video:"Video",audio:"Zvuk",fullScreen:"Celá obrazovka",showBlocks:"Zobrazit bloky",codeView:"Zobrazení kódu",undo:"Zpět",redo:"Opakovat",preview:"Náhled",print:"tisk",tag_p:"Odstavec",tag_div:"Normální (DIV)",tag_h:"Záhlaví",tag_blockquote:"Citovat",tag_pre:"Kód",template:"Šablona",lineHeight:"Výška řádku",paragraphStyle:"Styl odstavce",textStyle:"Styl textu",imageGallery:"Obrázková galerie",dir_ltr:"Zleva doprava",dir_rtl:"Zprava doleva",mention:"Zmínka"},dialogBox:{linkBox:{title:"Vložit odkaz",url:"URL pro odkaz",text:"Text k zobrazení",newWindowCheck:"Otevřít v novém okně",downloadLinkCheck:"Odkaz ke stažení",bookmark:"Záložka"},mathBox:{title:"Matematika",inputLabel:"Matematická notace",fontSizeLabel:"Velikost písma",previewLabel:"Náhled"},imageBox:{title:"Vložit obrázek",file:"Vybrat ze souborů",url:"URL obrázku",altText:"Alternativní text"},videoBox:{title:"Vložit video",file:"Vybrat ze souborů",url:"URL pro vložení médií, YouTube/Vimeo"},audioBox:{title:"Vložit zvuk",file:"Vybrat ze souborů",url:"Adresa URL zvuku"},browser:{tags:"Štítky",search:"Hledat"},caption:"Vložit popis",close:"Zavřít",submitButton:"Odeslat",revertButton:"Vrátit zpět",proportion:"Omezení proporcí",basic:"Základní",left:"Vlevo",right:"Vpravo",center:"Střed",width:"Šířka",height:"Výška",size:"Velikost",ratio:"Poměr"},controller:{edit:"Upravit",unlink:"Odpojit",remove:"Odebrat",insertRowAbove:"Vložit řádek výše",insertRowBelow:"Vložit řádek níže",deleteRow:"Smazat řádek",insertColumnBefore:"Vložit sloupec před",insertColumnAfter:"Vložit sloupec za",deleteColumn:"Smazat sloupec",fixedColumnWidth:"Pevná šířka sloupce",resize100:"Změnit velikost 100%",resize75:"Změnit velikost 75%",resize50:"Změnit velikost 50%",resize25:"Změnit velikost 25%",autoSize:"Automatická velikost",mirrorHorizontal:"Zrcadlo, horizontální",mirrorVertical:"Zrcadlo, vertikální",rotateLeft:"Otočit doleva",rotateRight:"Otočit doprava",maxSize:"Max. velikost",minSize:"Min. velikost",tableHeader:"Záhlaví tabulky",mergeCells:"Spojit buňky",splitCells:"Rozdělit buňky",HorizontalSplit:"Vodorovné rozdělení",VerticalSplit:"Svislé rozdělení"},menu:{spaced:"Rozložené",bordered:"Ohraničené",neon:"Neon",translucent:"Průsvitné",shadow:"Stín",code:"Kód"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"cs",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},31:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"da",toolbar:{default:"Default",save:"Gem",font:"Skrifttype",formats:"Format",fontSize:"Skriftstørrelse",bold:"Fed",underline:"Understreget",italic:"Skråskrift",strike:"Overstreget",subscript:"Sænket skrift",superscript:"Hævet skrift",removeFormat:"Fjern formatering",fontColor:"Skriftfarve",hiliteColor:"Baggrundsfarve",indent:"Ryk ind",outdent:"Ryk ud",align:"Justering",alignLeft:"Venstrejustering",alignRight:"Højrejustering",alignCenter:"Midterjustering",alignJustify:"Tilpas margin",list:"Lister",orderList:"Nummereret liste",unorderList:"Uordnet liste",horizontalRule:"Horisontal linie",hr_solid:"Almindelig",hr_dotted:"Punkteret",hr_dashed:"Streget",table:"Tabel",link:"Link",math:"Math",image:"Billede",video:"Video",audio:"Audio",fullScreen:"Fuld skærm",showBlocks:"Vis blokke",codeView:"Vis koder",undo:"Undo",redo:"Redo",preview:"Preview",print:"Print",tag_p:"Paragraph",tag_div:"Normal (DIV)",tag_h:"Overskrift",tag_blockquote:"Citer",tag_pre:"Code",template:"Schablone",lineHeight:"Linjehøjde",paragraphStyle:"Afsnitstil",textStyle:"Tekststil",imageGallery:"Billedgalleri",dir_ltr:"Venstre til højre",dir_rtl:"Højre til venstre",mention:"Nævne"},dialogBox:{linkBox:{title:"Indsæt link",url:"URL til link",text:"Tekst for link",newWindowCheck:"Åben i nyt faneblad",downloadLinkCheck:"Download link",bookmark:"Bogmærke"},mathBox:{title:"Math",inputLabel:"Matematisk notation",fontSizeLabel:"Skriftstørrelse",previewLabel:"Preview"},imageBox:{title:"Indsæt billede",file:"Indsæt fra fil",url:"Indsæt fra URL",altText:"Alternativ tekst"},videoBox:{title:"Indsæt Video",file:"Indsæt fra fil",url:"Indlejr video / YouTube,Vimeo"},audioBox:{title:"Indsæt Audio",file:"Indsæt fra fil",url:"Indsæt fra URL"},browser:{tags:"Tags",search:"Søg"},caption:"Indsæt beskrivelse",close:"Luk",submitButton:"Gennemfør",revertButton:"Gendan",proportion:"Bevar proportioner",basic:"Basis",left:"Venstre",right:"Højre",center:"Center",width:"Bredde",height:"Højde",size:"Størrelse",ratio:"Forhold"},controller:{edit:"Rediger",unlink:"Fjern link",remove:"Fjern",insertRowAbove:"Indsæt række foroven",insertRowBelow:"Indsæt række nedenfor",deleteRow:"Slet række",insertColumnBefore:"Indsæt kolonne før",insertColumnAfter:"Indsæt kolonne efter",deleteColumn:"Slet kolonne",fixedColumnWidth:"Fast søjlebredde",resize100:"Forstør 100%",resize75:"Forstør 75%",resize50:"Forstør 50%",resize25:"Forstør 25%",autoSize:"Auto størrelse",mirrorHorizontal:"Spejling, horisontal",mirrorVertical:"Spejling, vertikal",rotateLeft:"Roter til venstre",rotateRight:"Toter til højre",maxSize:"Max størrelse",minSize:"Min størrelse",tableHeader:"Tabel overskrift",mergeCells:"Sammenlæg celler (merge)",splitCells:"Opdel celler",HorizontalSplit:"Opdel horisontalt",VerticalSplit:"Opdel vertikalt"},menu:{spaced:"Brev Afstand",bordered:"Afgrænsningslinje",neon:"Neon",translucent:"Gennemsigtig",shadow:"Skygge",code:"Code"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"da",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},523:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"de",toolbar:{default:"Standard",save:"Speichern",font:"Schriftart",formats:"Format",fontSize:"Schriftgröße",bold:"Fett",underline:"Unterstrichen",italic:"Kursiv",strike:"Durchgestrichen",subscript:"Tiefgestellt",superscript:"Hochgestellt",removeFormat:"Format entfernen",fontColor:"Schriftfarbe",hiliteColor:"Farbe für Hervorhebungen",indent:"Einzug vergrößern",outdent:"Einzug verkleinern",align:"Ausrichtung",alignLeft:"Links ausrichten",alignRight:"Rechts ausrichten",alignCenter:"Zentriert ausrichten",alignJustify:"Blocksatz",list:"Liste",orderList:"Nummerierte Liste",unorderList:"Aufzählung",horizontalRule:"Horizontale Linie",hr_solid:"Strich",hr_dotted:"Gepunktet",hr_dashed:"Gestrichelt",table:"Tabelle",link:"Link",math:"Mathematik",image:"Bild",video:"Video",audio:"Audio",fullScreen:"Vollbild",showBlocks:"Blockformatierungen anzeigen",codeView:"Quelltext anzeigen",undo:"Rückgängig",redo:"Wiederholen",preview:"Vorschau",print:"Drucken",tag_p:"Absatz",tag_div:"Normal (DIV)",tag_h:"Header",tag_blockquote:"Zitat",tag_pre:"Quellcode",template:"Vorlage",lineHeight:"Zeilenhöhe",paragraphStyle:"Absatzstil",textStyle:"Textstil",imageGallery:"Bildergalerie",dir_ltr:"Links nach rechts",dir_rtl:"Rechts nach links",mention:"Erwähnen"},dialogBox:{linkBox:{title:"Link einfügen",url:"Link-URL",text:"Link-Text",newWindowCheck:"In neuem Fenster anzeigen",downloadLinkCheck:"Download-Link",bookmark:"Lesezeichen"},mathBox:{title:"Mathematik",inputLabel:"Mathematische Notation",fontSizeLabel:"Schriftgröße",previewLabel:"Vorschau"},imageBox:{title:"Bild einfügen",file:"Datei auswählen",url:"Bild-URL",altText:"Alternativer Text"},videoBox:{title:"Video einfügen",file:"Datei auswählen",url:"Video-URL, YouTube/Vimeo"},audioBox:{title:"Audio einfügen",file:"Datei auswählen",url:"Audio-URL"},browser:{tags:"Stichworte",search:"Suche"},caption:"Beschreibung eingeben",close:"Schließen",submitButton:"Übernehmen",revertButton:"Rückgängig",proportion:"Seitenverhältnis beibehalten",basic:"Standard",left:"Links",right:"Rechts",center:"Zentriert",width:"Breite",height:"Höhe",size:"Größe",ratio:"Verhältnis"},controller:{edit:"Bearbeiten",unlink:"Link entfernen",remove:"Löschen",insertRowAbove:"Zeile oberhalb einfügen",insertRowBelow:"Zeile unterhalb einfügen",deleteRow:"Zeile löschen",insertColumnBefore:"Spalte links einfügen",insertColumnAfter:"Spalte rechts einfügen",deleteColumn:"Spalte löschen",fixedColumnWidth:"Feste Spaltenbreite",resize100:"Zoom 100%",resize75:"Zoom 75%",resize50:"Zoom 50%",resize25:"Zoom 25%",autoSize:"Automatische Größenanpassung",mirrorHorizontal:"Horizontal spiegeln",mirrorVertical:"Vertikal spiegeln",rotateLeft:"Nach links drehen",rotateRight:"Nach rechts drehen",maxSize:"Maximale Größe",minSize:"Mindestgröße",tableHeader:"Tabellenüberschrift",mergeCells:"Zellen verbinden",splitCells:"Zellen teilen",HorizontalSplit:"Horizontal teilen",VerticalSplit:"Vertikal teilen"},menu:{spaced:"Buchstabenabstand",bordered:"Umrandet",neon:"Neon",translucent:"Durchscheinend",shadow:"Schatten",code:"Quellcode"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"de",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},791:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"en",toolbar:{default:"Default",save:"Save",font:"Font",formats:"Formats",fontSize:"Size",bold:"Bold",underline:"Underline",italic:"Italic",strike:"Strike",subscript:"Subscript",superscript:"Superscript",removeFormat:"Remove Format",fontColor:"Font Color",hiliteColor:"Highlight Color",indent:"Indent",outdent:"Outdent",align:"Align",alignLeft:"Align left",alignRight:"Align right",alignCenter:"Align center",alignJustify:"Align justify",list:"List",orderList:"Ordered list",unorderList:"Unordered list",horizontalRule:"Horizontal line",hr_solid:"Solid",hr_dotted:"Dotted",hr_dashed:"Dashed",table:"Table",link:"Link",math:"Math",image:"Image",video:"Video",audio:"Audio",fullScreen:"Full screen",showBlocks:"Show blocks",codeView:"Code view",undo:"Undo",redo:"Redo",preview:"Preview",print:"print",tag_p:"Paragraph",tag_div:"Normal (DIV)",tag_h:"Header",tag_blockquote:"Quote",tag_pre:"Code",template:"Template",lineHeight:"Line height",paragraphStyle:"Paragraph style",textStyle:"Text style",imageGallery:"Image gallery",dir_ltr:"Left to right",dir_rtl:"Right to left",mention:"Mention"},dialogBox:{linkBox:{title:"Insert Link",url:"URL to link",text:"Text to display",newWindowCheck:"Open in new window",downloadLinkCheck:"Download link",bookmark:"Bookmark"},mathBox:{title:"Math",inputLabel:"Mathematical Notation",fontSizeLabel:"Font Size",previewLabel:"Preview"},imageBox:{title:"Insert image",file:"Select from files",url:"Image URL",altText:"Alternative text"},videoBox:{title:"Insert Video",file:"Select from files",url:"Media embed URL, YouTube/Vimeo"},audioBox:{title:"Insert Audio",file:"Select from files",url:"Audio URL"},browser:{tags:"Tags",search:"Search"},caption:"Insert description",close:"Close",submitButton:"Submit",revertButton:"Revert",proportion:"Constrain proportions",basic:"Basic",left:"Left",right:"Right",center:"Center",width:"Width",height:"Height",size:"Size",ratio:"Ratio"},controller:{edit:"Edit",unlink:"Unlink",remove:"Remove",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",deleteRow:"Delete row",insertColumnBefore:"Insert column before",insertColumnAfter:"Insert column after",deleteColumn:"Delete column",fixedColumnWidth:"Fixed column width",resize100:"Resize 100%",resize75:"Resize 75%",resize50:"Resize 50%",resize25:"Resize 25%",autoSize:"Auto size",mirrorHorizontal:"Mirror, Horizontal",mirrorVertical:"Mirror, Vertical",rotateLeft:"Rotate left",rotateRight:"Rotate right",maxSize:"Max size",minSize:"Min size",tableHeader:"Table header",mergeCells:"Merge cells",splitCells:"Split Cells",HorizontalSplit:"Horizontal split",VerticalSplit:"Vertical split"},menu:{spaced:"Spaced",bordered:"Bordered",neon:"Neon",translucent:"Translucent",shadow:"Shadow",code:"Code"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"en",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},284:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"es",toolbar:{default:"Valor por defecto",save:"Guardar",font:"Fuente",formats:"Formato",fontSize:"Tamaño de fuente",bold:"Negrita",underline:"Subrayado",italic:"Cursiva",strike:"Tachado",subscript:"Subíndice",superscript:"Superíndice",removeFormat:"Eliminar formato",fontColor:"Color de fuente",hiliteColor:"Color de resaltado",indent:"Más tabulación",outdent:"Menos tabulación",align:"Alinear",alignLeft:"Alinear a la izquierda",alignRight:"Alinear a la derecha",alignCenter:"Alinear al centro",alignJustify:"Justificar",list:"Lista",orderList:"Lista ordenada",unorderList:"Lista desordenada",horizontalRule:"Horizontal line",hr_solid:"Línea horizontal solida",hr_dotted:"Línea horizontal punteada",hr_dashed:"Línea horizontal discontinua",table:"Tabla",link:"Link",math:"Matemáticas",image:"Imagen",video:"Video",audio:"Audio",fullScreen:"Pantalla completa",showBlocks:"Ver bloques",codeView:"Ver código fuente",undo:"UndoDeshacer última acción",redo:"Rehacer última acción",preview:"Vista previa",print:"Imprimir",tag_p:"Párrafo",tag_div:"Normal (DIV)",tag_h:"Header",tag_blockquote:"Cita",tag_pre:"Código",template:"Plantilla",lineHeight:"Altura de la línea",paragraphStyle:"Estilo del parrafo",textStyle:"Estilo del texto",imageGallery:"Galería de imágenes",dir_ltr:"De izquierda a derecha",dir_rtl:"De derecha a izquierda",mention:"Mencionar"},dialogBox:{linkBox:{title:"Insertar Link",url:"¿Hacia que URL lleva el link?",text:"Texto para mostrar",newWindowCheck:"Abrir en una nueva ventana",downloadLinkCheck:"Enlace de descarga",bookmark:"Marcador"},mathBox:{title:"Matemáticas",inputLabel:"Notación Matemática",fontSizeLabel:"Tamaño de fuente",previewLabel:"Vista previa"},imageBox:{title:"Insertar imagen",file:"Seleccionar desde los archivos",url:"URL de la imagen",altText:"Texto alternativo"},videoBox:{title:"Insertar Video",file:"Seleccionar desde los archivos",url:"¿URL del vídeo? Youtube/Vimeo"},audioBox:{title:"Insertar Audio",file:"Seleccionar desde los archivos",url:"URL de la audio"},browser:{tags:"Etiquetas",search:"Buscar"},caption:"Insertar descripción",close:"Cerrar",submitButton:"Enviar",revertButton:"revertir",proportion:"Restringir las proporciones",basic:"Basico",left:"Izquierda",right:"derecha",center:"Centro",width:"Ancho",height:"Alto",size:"Tamaño",ratio:"Proporción"},controller:{edit:"Editar",unlink:"Desvincular",remove:"RemoveQuitar",insertRowAbove:"Insertar fila arriba",insertRowBelow:"Insertar fila debajo",deleteRow:"Eliminar fila",insertColumnBefore:"Insertar columna antes",insertColumnAfter:"Insertar columna después",deleteColumn:"Eliminar columna",fixedColumnWidth:"Ancho de columna fijo",resize100:"Redimensionar 100%",resize75:"Redimensionar 75%",resize50:"Redimensionar 50%",resize25:"Redimensionar 25%",autoSize:"Tamaño automático",mirrorHorizontal:"Espejo, Horizontal",mirrorVertical:"Espejo, Vertical",rotateLeft:"Girar a la izquierda",rotateRight:"Girar a la derecha",maxSize:"Tamaño máximo",minSize:"Tamaño minímo",tableHeader:"Encabezado de tabla",mergeCells:"Combinar celdas",splitCells:"Dividir celdas",HorizontalSplit:"División horizontal",VerticalSplit:"División vertical"},menu:{spaced:"Espaciado",bordered:"Bordeado",neon:"Neón",translucent:"Translúcido",shadow:"Sombreado",code:"Código"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"es",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},664:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"fr",toolbar:{default:"Défaut",save:"Sauvegarder",font:"Police",formats:"Formats",fontSize:"Taille",bold:"Gras",underline:"Souligné",italic:"Italique",strike:"Barré",subscript:"Indice",superscript:"Exposant",removeFormat:"Effacer le formatage",fontColor:"Couleur du texte",hiliteColor:"Couleur en arrière plan",indent:"Indenter",outdent:"Désindenter",align:"Alignement",alignLeft:"À gauche",alignRight:"À droite",alignCenter:"Centré",alignJustify:"Justifié",list:"Liste",orderList:"Ordonnée",unorderList:"Non-ordonnée",horizontalRule:"Ligne horizontale",hr_solid:"Solide",hr_dotted:"Points",hr_dashed:"Tirets",table:"Table",link:"Lien",math:"Math",image:"Image",video:"Video",audio:"Audio",fullScreen:"Plein écran",showBlocks:"Voir les blocs",codeView:"Voir le code",undo:"Annuler",redo:"Rétablir",preview:"Prévisualiser",print:"Imprimer",tag_p:"Paragraphe",tag_div:"Normal (DIV)",tag_h:"Titre",tag_blockquote:"Citation",tag_pre:"Code",template:"Template",lineHeight:"Hauteur de la ligne",paragraphStyle:"Style de paragraphe",textStyle:"Style de texte",imageGallery:"Galerie d'images",dir_ltr:"De gauche à droite",dir_rtl:"De droite à gauche",mention:"Mention"},dialogBox:{linkBox:{title:"Insérer un lien",url:"Adresse URL du lien",text:"Texte à afficher",newWindowCheck:"Ouvrir dans une nouvelle fenêtre",downloadLinkCheck:"Lien de téléchargement",bookmark:"Signet"},mathBox:{title:"Math",inputLabel:"Notation mathématique",fontSizeLabel:"Taille",previewLabel:"Prévisualiser"},imageBox:{title:"Insérer une image",file:"Sélectionner le fichier",url:"Adresse URL du fichier",altText:"Texte Alternatif"},videoBox:{title:"Insérer une vidéo",file:"Sélectionner le fichier",url:"URL d’intégration du média, YouTube/Vimeo"},audioBox:{title:"Insérer un fichier audio",file:"Sélectionner le fichier",url:"Adresse URL du fichier"},browser:{tags:"Mots clés",search:"Chercher"},caption:"Insérer une description",close:"Fermer",submitButton:"Appliquer",revertButton:"Revenir en arrière",proportion:"Maintenir le rapport hauteur/largeur",basic:"Basique",left:"Gauche",right:"Droite",center:"Centré",width:"Largeur",height:"Hauteur",size:"Taille",ratio:"Rapport"},controller:{edit:"Modifier",unlink:"Supprimer un lien",remove:"Effacer",insertRowAbove:"Insérer une ligne en dessous",insertRowBelow:"Insérer une ligne au dessus",deleteRow:"Effacer la ligne",insertColumnBefore:"Insérer une colonne avant",insertColumnAfter:"Insérer une colonne après",deleteColumn:"Effacer la colonne",fixedColumnWidth:"Largeur de colonne fixe",resize100:"Redimensionner à 100%",resize75:"Redimensionner à 75%",resize50:"Redimensionner à 50%",resize25:"Redimensionner à 25%",autoSize:"Taille automatique",mirrorHorizontal:"Mirroir, Horizontal",mirrorVertical:"Mirroir, Vertical",rotateLeft:"Rotation à gauche",rotateRight:"Rotation à droite",maxSize:"Taille max",minSize:"Taille min",tableHeader:"En-tête de table",mergeCells:"Fusionner les cellules",splitCells:"Diviser les Cellules",HorizontalSplit:"Scission horizontale",VerticalSplit:"Scission verticale"},menu:{spaced:"Espacement",bordered:"Ligne de démarcation",neon:"Néon",translucent:"Translucide",shadow:"Ombre",code:"Code"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"fr",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},559:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"he",toolbar:{default:"ברירת מחדל",save:"שמור",font:"גופן",formats:"עיצוב",fontSize:"גודל",bold:"מודגש",underline:"קו תחתון",italic:"נטוי",strike:"קו חוצה",subscript:"עילי",superscript:"תחתי",removeFormat:"הסר עיצוב",fontColor:"צבע גופן",hiliteColor:"צבע קו תחתון",indent:"הגדל כניסה",outdent:"הקטן כניסה",align:"יישור",alignLeft:"יישר לשמאל",alignRight:"יישר לימין",alignCenter:"מרכז",alignJustify:"יישר לשני הצדדים",list:"רשימה",orderList:"מספור",unorderList:"תבליטים",horizontalRule:"קו אופקי",hr_solid:"קו",hr_dotted:"נקודות",hr_dashed:"מקפים",table:"טבלה",link:"קישור",math:"מתמטיקה",image:"תמונה",video:"חוזי",audio:"שמע",fullScreen:"מסך מלא",showBlocks:"הצג גושים",codeView:"הצג קוד",undo:"בטל",redo:"חזור",preview:"תצוגה מקדימה",print:"הדפס",tag_p:"פסקה",tag_div:"רגילה (DIV)",tag_h:"כותרת",tag_blockquote:"ציטוט",tag_pre:"קוד",template:"תבנית",lineHeight:"גובה השורה",paragraphStyle:"סגנון פסקה",textStyle:"סגנון גופן",imageGallery:"גלרית תמונות",dir_ltr:"משמאל לימין",dir_rtl:"מימין לשמאל",mention:"הזכר"},dialogBox:{linkBox:{title:"הכנס קשור",url:"כתובת קשור",text:"תיאור",newWindowCheck:"פתח בחלון חדש",downloadLinkCheck:"קישור להורדה",bookmark:"סמניה"},mathBox:{title:"נוסחה",inputLabel:"סימנים מתמטים",fontSizeLabel:"גודל גופן",previewLabel:"תצוגה מקדימה"},imageBox:{title:"הכנס תמונה",file:"בחר מקובץ",url:"כתובת URL תמונה",altText:"תיאור (תגית alt)"},videoBox:{title:"הכנס סרטון",file:"בחר מקובץ",url:"כתובת הטמעה YouTube/Vimeo"},audioBox:{title:"הכנס שמע",file:"בחר מקובץ",url:"כתובת URL שמע"},browser:{tags:"תג",search:"חפש"},caption:"הכנס תיאור",close:"סגור",submitButton:"שלח",revertButton:"בטל",proportion:"שמר יחס",basic:"בסיסי",left:"שמאל",right:"ימין",center:"מרכז",width:"רוחב",height:"גובה",size:"גודל",ratio:"יחס"},controller:{edit:"ערוך",unlink:"הסר קישורים",remove:"הסר",insertRowAbove:"הכנס שורה מעל",insertRowBelow:"הכנס שורה מתחת",deleteRow:"מחק שורה",insertColumnBefore:"הכנס עמודה לפני",insertColumnAfter:"הכנס עמודה אחרי",deleteColumn:"מחק עמודה",fixedColumnWidth:"קבע רוחב עמודות",resize100:"ללא הקטנה",resize75:"הקטן 75%",resize50:"הקטן 50%",resize25:"הקטן 25%",autoSize:"הקטן אוטומטית",mirrorHorizontal:"הפוך לרוחב",mirrorVertical:"הפוך לגובה",rotateLeft:"סובב שמאלה",rotateRight:"סובב ימינה",maxSize:"גודל מרבי",minSize:"גודל מזערי",tableHeader:"כותרת טבלה",mergeCells:"מזג תאים",splitCells:"פצל תא",HorizontalSplit:"פצל לגובה",VerticalSplit:"פצל לרוחב"},menu:{spaced:"מרווח",bordered:"בעל מיתאר",neon:"זוהר",translucent:"שקוף למחצה",shadow:"צל",code:"קוד"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"he",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},789:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"it",toolbar:{default:"Predefinita",save:"Salva",font:"Font",formats:"Formato",fontSize:"Grandezza",bold:"Grassetto",underline:"Sottolineato",italic:"Corsivo",strike:"Barrato",subscript:"Apice",superscript:"Pedice",removeFormat:"Rimuovi formattazione",fontColor:"Colore testo",hiliteColor:"Colore sottolineatura",indent:"Aumenta rientro",outdent:"Riduci rientro",align:"Allinea",alignLeft:"Allinea a sinistra",alignRight:"Allinea a destra",alignCenter:"Allinea al centro",alignJustify:"Giustifica testo",list:"Elenco",orderList:"Elenco numerato",unorderList:"Elenco puntato",horizontalRule:"Linea orizzontale",hr_solid:"Linea continua",hr_dotted:"Puntini",hr_dashed:"Trattini",table:"Tabella",link:"Collegamento ipertestuale",math:"Formula matematica",image:"Immagine",video:"Video",audio:"Audio",fullScreen:"A tutto schermo",showBlocks:"Visualizza blocchi",codeView:"Visualizza codice",undo:"Annulla",redo:"Ripristina",preview:"Anteprima",print:"Stampa",tag_p:"Paragrafo",tag_div:"Normale (DIV)",tag_h:"Titolo",tag_blockquote:"Citazione",tag_pre:"Codice",template:"Modello",lineHeight:"Interlinea",paragraphStyle:"Stile paragrafo",textStyle:"Stile testo",imageGallery:"Galleria di immagini",dir_ltr:"Da sinistra a destra",dir_rtl:"Da destra a sinistra",mention:"Menzione"},dialogBox:{linkBox:{title:"Inserisci un link",url:"Indirizzo",text:"Testo da visualizzare",newWindowCheck:"Apri in una nuova finestra",downloadLinkCheck:"Link per scaricare",bookmark:"Segnalibro"},mathBox:{title:"Matematica",inputLabel:"Notazione matematica",fontSizeLabel:"Grandezza testo",previewLabel:"Anteprima"},imageBox:{title:"Inserisci immagine",file:"Seleziona da file",url:"Indirizzo immagine",altText:"Testo alternativo (ALT)"},videoBox:{title:"Inserisci video",file:"Seleziona da file",url:"Indirizzo video di embed, YouTube/Vimeo"},audioBox:{title:"Inserisci audio",file:"Seleziona da file",url:"Indirizzo audio"},browser:{tags:"tag",search:"Ricerca"},caption:"Inserisci didascalia",close:"Chiudi",submitButton:"Invia",revertButton:"Annulla",proportion:"Proporzionale",basic:"Da impostazione",left:"Sinistra",right:"Destra",center:"Centrato",width:"Larghezza",height:"Altezza",size:"Dimensioni",ratio:"Rapporto"},controller:{edit:"Modifica",unlink:"Elimina link",remove:"Rimuovi",insertRowAbove:"Inserisci riga sopra",insertRowBelow:"Inserisci riga sotto",deleteRow:"Cancella riga",insertColumnBefore:"Inserisci colonna prima",insertColumnAfter:"Inserisci colonna dopo",deleteColumn:"Cancella colonna",fixedColumnWidth:"Larghezza delle colonne fissa",resize100:"Ridimensiona 100%",resize75:"Ridimensiona 75%",resize50:"Ridimensiona 50%",resize25:"Ridimensiona 25%",autoSize:"Ridimensione automatica",mirrorHorizontal:"Capovolgi orizzontalmente",mirrorVertical:"Capovolgi verticalmente",rotateLeft:"Ruota a sinistra",rotateRight:"Ruota a destra",maxSize:"Dimensione massima",minSize:"Dimensione minima",tableHeader:"Intestazione tabella",mergeCells:"Unisci celle",splitCells:"Dividi celle",HorizontalSplit:"Separa orizontalmente",VerticalSplit:"Separa verticalmente"},menu:{spaced:"Spaziato",bordered:"Bordato",neon:"Luminoso",translucent:"Traslucido",shadow:"Ombra",code:"Codice"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"it",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG una finestra con un documento");return i(e)}:i(t)},173:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"ja",toolbar:{default:"デフォルト",save:"保存",font:"フォント",formats:"段落形式",fontSize:"サイズ",bold:"太字",underline:"下線",italic:"イタリック",strike:"取り消し線",subscript:"下付き",superscript:"上付き",removeFormat:"形式を削除",fontColor:"文字色",hiliteColor:"文字の背景色",indent:"インデント",outdent:"インデント",align:"ソート",alignLeft:"左揃え",alignRight:"右揃え",alignCenter:"中央揃え",alignJustify:"両端揃え",list:"リスト",orderList:"数値ブリット",unorderList:"円形ブリット",horizontalRule:"水平線を挿入",hr_solid:"実線",hr_dotted:"点線",hr_dashed:"ダッシュ",table:"テーブル",link:"リンク",math:"数学",image:"画像",video:"動画",audio:"オーディオ",fullScreen:"フルスクリーン",showBlocks:"ブロック表示",codeView:"HTMLの編集",undo:"元に戻す",redo:"再実行",preview:"プレビュー",print:"印刷",tag_p:"本文",tag_div:"基本(DIV)",tag_h:"タイトル",tag_blockquote:"引用",tag_pre:"コード",template:"テンプレート",lineHeight:"行の高さ",paragraphStyle:"段落スタイル",textStyle:"テキストスタイル",imageGallery:"イメージギャラリー",dir_ltr:"左から右へ",dir_rtl:"右から左に",mention:"言及する"},dialogBox:{linkBox:{title:"リンクの挿入",url:"インターネットアドレス",text:"画面のテキスト",newWindowCheck:"別ウィンドウで開く",downloadLinkCheck:"ダウンロードリンク",bookmark:"ブックマーク"},mathBox:{title:"数学",inputLabel:"数学表記",fontSizeLabel:"サイズ",previewLabel:"プレビュー"},imageBox:{title:"画像の挿入",file:"ファイルの選択",url:"イメージアドレス",altText:"置換文字列"},videoBox:{title:"動画を挿入",file:"ファイルの選択",url:"メディア埋め込みアドレス, YouTube/Vimeo"},audioBox:{title:"オーディオを挿入",file:"ファイルの選択",url:"オーディオアドレス"},browser:{tags:"タグ",search:"探す"},caption:"説明付け",close:"閉じる",submitButton:"確認",revertButton:"元に戻す",proportion:"の割合カスタマイズ",basic:"基本",left:"左",right:"右",center:"中央",width:"横",height:"縦",size:"サイズ",ratio:"比率"},controller:{edit:"編集",unlink:"リンク解除",remove:"削除",insertRowAbove:"上に行を挿入",insertRowBelow:"下に行を挿入",deleteRow:"行の削除",insertColumnBefore:"左に列を挿入",insertColumnAfter:"右に列を挿入",deleteColumn:"列を削除する",fixedColumnWidth:"固定列幅",resize100:"100% サイズ",resize75:"75% サイズ",resize50:"50% サイズ",resize25:"25% サイズ",autoSize:"自動サイズ",mirrorHorizontal:"左右反転",mirrorVertical:"上下反転",rotateLeft:"左に回転",rotateRight:"右に回転",maxSize:"最大サイズ",minSize:"最小サイズ",tableHeader:"表のヘッダー",mergeCells:"セルの結合",splitCells:"セルを分割",HorizontalSplit:"横分割",VerticalSplit:"垂直分割"},menu:{spaced:"文字間隔",bordered:"境界線",neon:"ネオン",translucent:"半透明",shadow:"影",code:"コード"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"ja",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},786:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"ko",toolbar:{default:"기본값",save:"저장",font:"글꼴",formats:"문단 형식",fontSize:"크기",bold:"굵게",underline:"밑줄",italic:"기울임",strike:"취소선",subscript:"아래 첨자",superscript:"위 첨자",removeFormat:"형식 제거",fontColor:"글자색",hiliteColor:"배경색",indent:"들여쓰기",outdent:"내어쓰기",align:"정렬",alignLeft:"왼쪽 정렬",alignRight:"오른쪽 정렬",alignCenter:"가운데 정렬",alignJustify:"양쪽 정렬",list:"리스트",orderList:"숫자형 리스트",unorderList:"원형 리스트",horizontalRule:"가로 줄 삽입",hr_solid:"실선",hr_dotted:"점선",hr_dashed:"대시",table:"테이블",link:"링크",math:"수식",image:"이미지",video:"동영상",audio:"오디오",fullScreen:"전체 화면",showBlocks:"블록 보기",codeView:"HTML 편집",undo:"실행 취소",redo:"다시 실행",preview:"미리보기",print:"인쇄",tag_p:"본문",tag_div:"기본 (DIV)",tag_h:"제목",tag_blockquote:"인용문",tag_pre:"코드",template:"템플릿",lineHeight:"줄 높이",paragraphStyle:"문단 스타일",textStyle:"글자 스타일",imageGallery:"이미지 갤러리",dir_ltr:"왼쪽에서 오른쪽",dir_rtl:"오른쪽에서 왼쪽",mention:"멘션"},dialogBox:{linkBox:{title:"링크 삽입",url:"인터넷 주소",text:"화면 텍스트",newWindowCheck:"새창으로 열기",downloadLinkCheck:"다운로드 링크",bookmark:"북마크"},mathBox:{title:"수식",inputLabel:"수학적 표기법",fontSizeLabel:"글자 크기",previewLabel:"미리보기"},imageBox:{title:"이미지 삽입",file:"파일 선택",url:"이미지 주소",altText:"대체 문자열"},videoBox:{title:"동영상 삽입",file:"파일 선택",url:"미디어 임베드 주소, 유튜브/비메오"},audioBox:{title:"오디오 삽입",file:"파일 선택",url:"오디오 파일 주소"},browser:{tags:"태그",search:"검색"},caption:"설명 넣기",close:"닫기",submitButton:"확인",revertButton:"되돌리기",proportion:"비율 맞춤",basic:"기본",left:"왼쪽",right:"오른쪽",center:"가운데",width:"가로",height:"세로",size:"크기",ratio:"비율"},controller:{edit:"편집",unlink:"링크 해제",remove:"삭제",insertRowAbove:"위에 행 삽입",insertRowBelow:"아래에 행 삽입",deleteRow:"행 삭제",insertColumnBefore:"왼쪽에 열 삽입",insertColumnAfter:"오른쪽에 열 삽입",deleteColumn:"열 삭제",fixedColumnWidth:"고정 된 열 너비",resize100:"100% 크기",resize75:"75% 크기",resize50:"50% 크기",resize25:"25% 크기",autoSize:"자동 크기",mirrorHorizontal:"좌우 반전",mirrorVertical:"상하 반전",rotateLeft:"왼쪽으로 회전",rotateRight:"오른쪽으로 회전",maxSize:"최대화",minSize:"최소화",tableHeader:"테이블 제목",mergeCells:"셀 병합",splitCells:"셀 분할",HorizontalSplit:"가로 분할",VerticalSplit:"세로 분할"},menu:{spaced:"글자 간격",bordered:"경계선",neon:"네온",translucent:"반투명",shadow:"그림자",code:"코드"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"ko",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},782:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"lv",toolbar:{default:"Noklusējuma",save:"Saglabāt",font:"Fonts",formats:"Formāti",fontSize:"Fonta lielums",bold:"Treknraksts",underline:"Pasvītrot",italic:"Slīpraksts",strike:"Pārsvītrojums",subscript:"Apakšraksts",superscript:"Augšraksts",removeFormat:"Noņemt formātu",fontColor:"Fonta krāsa",hiliteColor:"Teksta iezīmēšanas krāsa",indent:"Palielināt atkāpi",outdent:"Samazināt atkāpi",align:"Izlīdzināt",alignLeft:"Līdzināt pa kreisi",alignRight:"Līdzināt pa labi",alignCenter:"Centrēt",alignJustify:"Taisnot",list:"Saraksts",orderList:"Numerācija",unorderList:"Aizzimes",horizontalRule:"Horizontāla līnija",hr_solid:"Ciets",hr_dotted:"Punktiņš",hr_dashed:"Braša",table:"Tabula",link:"Saite",math:"Matemātika",image:"Attēls",video:"Video",audio:"Audio",fullScreen:"Pilnekrāna režīms",showBlocks:"Parādit blokus",codeView:"Koda skats",undo:"Atsaukt",redo:"Atkārtot",preview:"Priekšskatījums",print:"Drukāt",tag_p:"Paragrāfs",tag_div:"Normāli (DIV)",tag_h:"Galvene",tag_blockquote:"Citāts",tag_pre:"Kods",template:"Veidne",lineHeight:"Līnijas augstums",paragraphStyle:"Paragrāfa stils",textStyle:"Teksta stils",imageGallery:"Attēlu galerija",dir_ltr:"No kreisās uz labo",dir_rtl:"No labās uz kreiso",mention:"Pieminēt"},dialogBox:{linkBox:{title:"Ievietot saiti",url:"Saites URL",text:"Parādāmais teksts",newWindowCheck:"Atvērt jaunā logā",downloadLinkCheck:"Lejupielādes saite",bookmark:"Grāmatzīme"},mathBox:{title:"Matemātika",inputLabel:"Matemātiskā notācija",fontSizeLabel:"Fonta lielums",previewLabel:"Priekšskatījums"},imageBox:{title:"Ievietot attēlu",file:"Izvēlieties no failiem",url:"Attēla URL",altText:"Alternatīvs teksts"},videoBox:{title:"Ievietot video",file:"Izvēlieties no failiem",url:"Multivides iegulšanas URL, YouTube/Vimeo"},audioBox:{title:"Ievietot audio",file:"Izvēlieties no failiem",url:"Audio URL"},browser:{tags:"Tagi",search:"Meklēt"},caption:"Ievietot aprakstu",close:"Aizvērt",submitButton:"Iesniegt",revertButton:"Atjaunot",proportion:"Ierobežo proporcijas",basic:"Nav iesaiņojuma",left:"Pa kreisi",right:"Labajā pusē",center:"Centrs",width:"Platums",height:"Augstums",size:"Izmērs",ratio:"Attiecība"},controller:{edit:"Rediģēt",unlink:"Atsaistīt",remove:"Noņemt",insertRowAbove:"Ievietot rindu virs",insertRowBelow:"Ievietot rindu zemāk",deleteRow:"Dzēst rindu",insertColumnBefore:"Ievietot kolonnu pirms",insertColumnAfter:"Ievietot kolonnu aiz",deleteColumn:"Dzēst kolonnu",fixColumnWidth:"Fiksēts kolonnas platums",resize100:"Mainīt izmēru 100%",resize75:"Mainīt izmēru 75%",resize50:"Mainīt izmēru 50%",resize25:"Mainīt izmēru 25%",autoSize:"Automātiskais izmērs",mirrorHorizontal:"Spogulis, horizontāls",mirrorVertical:"Spogulis, vertikāls",rotateLeft:"Pagriezt pa kreisi",rotateRight:"Pagriezt pa labi",maxSize:"Maksimālais izmērs",minSize:"Minimālais izmērs",tableHeader:"Tabulas galvene",mergeCells:"Apvienot šūnas",splitCells:"Sadalīt šūnas",HorizontalSplit:"Horizontāls sadalījums",VerticalSplit:"Vertikāls sadalījums"},menu:{spaced:"Ar atstarpi",bordered:"Robežojās",neon:"Neona",translucent:"Caurspīdīgs",shadow:"Ēna",code:"Kods"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"lv",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},430:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"nl",toolbar:{default:"Standaard",save:"Opslaan",font:"Lettertype",formats:"Formaten",fontSize:"Lettergrootte",bold:"Vetgedrukt",underline:"Onderstrepen",italic:"Cursief",strike:"Doorstrepen",subscript:"Subscript",superscript:"Superscript",removeFormat:"Opmaak verwijderen",fontColor:"Tekstkleur",hiliteColor:"Tekst markeren",indent:"Inspringen",outdent:"Inspringen ongedaan maken",align:"Uitlijnen",alignLeft:"Links uitlijnen",alignRight:"Rechts uitlijnen",alignCenter:"In het midden uitlijnen",alignJustify:"Uitvullen",list:"Lijst",orderList:"Geordende lijst",unorderList:"Ongeordende lijst",horizontalRule:"Horizontale regel",hr_solid:"Standaard",hr_dotted:"Gestippeld",hr_dashed:"Gestreept",table:"Tabel",link:"Link",math:"Wiskunde",image:"Afbeelding",video:"Video",audio:"Audio",fullScreen:"Volledig scherm",showBlocks:"Blokken tonen",codeView:"Broncode weergeven",undo:"Ongedaan maken",redo:"Ongedaan maken herstellen",preview:"Voorbeeldweergave",print:"Printen",tag_p:"Alinea",tag_div:"Normaal (div)",tag_h:"Kop",tag_blockquote:"Citaat",tag_pre:"Code",template:"Sjabloon",lineHeight:"Lijnhoogte",paragraphStyle:"Alineastijl",textStyle:"Tekststijl",imageGallery:"Galerij",dir_ltr:"Van links naar rechts",dir_rtl:"Rechts naar links",mention:"Vermelding"},dialogBox:{linkBox:{title:"Link invoegen",url:"URL",text:"Tekst van de link",newWindowCheck:"In een nieuw tabblad openen",downloadLinkCheck:"Downloadlink",bookmark:"Bladwijzer"},mathBox:{title:"Wiskunde",inputLabel:"Wiskundige notatie",fontSizeLabel:"Lettergrootte",previewLabel:"Voorbeeld"},imageBox:{title:"Afbeelding invoegen",file:"Selecteer een bestand van uw apparaat",url:"URL",altText:"Alt-tekst"},videoBox:{title:"Video invoegen",file:"Selecteer een bestand van uw apparaat",url:"Embedded URL (YouTube/Vimeo)"},audioBox:{title:"Audio invoegen",file:"Selecteer een bestand van uw apparaat",url:"URL"},browser:{tags:"Tags",search:"Zoeken"},caption:"Omschrijving toevoegen",close:"Sluiten",submitButton:"Toepassen",revertButton:"Standaardwaarden herstellen",proportion:"Verhouding behouden",basic:"Standaard",left:"Links",right:"Rechts",center:"Midden",width:"Breedte",height:"Hoogte",size:"Grootte",ratio:"Verhouding"},controller:{edit:"Bewerken",unlink:"Ontkoppelen",remove:"Verwijderen",insertRowAbove:"Rij hierboven invoegen",insertRowBelow:"Rij hieronder invoegen",deleteRow:"Rij verwijderen",insertColumnBefore:"Kolom links invoegen",insertColumnAfter:"Kolom rechts invoegen",deleteColumn:"Kolom verwijderen",fixedColumnWidth:"Vaste kolombreedte",resize100:"Formaat wijzigen: 100%",resize75:"Formaat wijzigen: 75%",resize50:"Formaat wijzigen: 50%",resize25:"Formaat wijzigen: 25%",autoSize:"Automatische grootte",mirrorHorizontal:"Horizontaal spiegelen",mirrorVertical:"Verticaal spiegelen",rotateLeft:"Naar links draaien",rotateRight:"Naar rechts draaien",maxSize:"Maximale grootte",minSize:"Minimale grootte",tableHeader:"Tabelkoppen",mergeCells:"Cellen samenvoegen",splitCells:"Cellen splitsen",HorizontalSplit:"Horizontaal splitsen",VerticalSplit:"Verticaal splitsen"},menu:{spaced:"Uit elkaar",bordered:"Omlijnd",neon:"Neon",translucent:"Doorschijnend",shadow:"Schaduw",code:"Code"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"nl",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},168:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"pl",toolbar:{default:"Domyślne",save:"Zapisz",font:"Czcionka",formats:"Formaty",fontSize:"Rozmiar",bold:"Pogrubienie",underline:"Podkreślenie",italic:"Kursywa",strike:"Przekreślenie",subscript:"Indeks dolny",superscript:"Indeks górny",removeFormat:"Wyczyść formatowanie",fontColor:"Kolor tekstu",hiliteColor:"Kolor tła tekstu",indent:"Zwiększ wcięcie",outdent:"Zmniejsz wcięcie",align:"Wyrównaj",alignLeft:"Do lewej",alignRight:"Do prawej",alignCenter:"Do środka",alignJustify:"Wyjustuj",list:"Lista",orderList:"Lista numerowana",unorderList:"Lista wypunktowana",horizontalRule:"Pozioma linia",hr_solid:"Ciągła",hr_dotted:"Kropkowana",hr_dashed:"Przerywana",table:"Tabela",link:"Odnośnik",math:"Matematyczne",image:"Obraz",video:"Wideo",audio:"Audio",fullScreen:"Pełny ekran",showBlocks:"Pokaż bloki",codeView:"Widok kodu",undo:"Cofnij",redo:"Ponów",preview:"Podgląd",print:"Drukuj",tag_p:"Akapit",tag_div:"Blok (DIV)",tag_h:"Nagłówek H",tag_blockquote:"Cytat",tag_pre:"Kod",template:"Szablon",lineHeight:"Odstęp między wierszami",paragraphStyle:"Styl akapitu",textStyle:"Styl tekstu",imageGallery:"Galeria obrazów",dir_ltr:"Od lewej do prawej",dir_rtl:"Od prawej do lewej",mention:"Wzmianka"},dialogBox:{linkBox:{title:"Wstaw odnośnik",url:"Adres URL",text:"Tekst do wyświetlenia",newWindowCheck:"Otwórz w nowym oknie",downloadLinkCheck:"Link do pobrania",bookmark:"Zakładka"},mathBox:{title:"Matematyczne",inputLabel:"Zapis matematyczny",fontSizeLabel:"Rozmiar czcionki",previewLabel:"Podgląd"},imageBox:{title:"Wstaw obraz",file:"Wybierz plik",url:"Adres URL obrazka",altText:"Tekst alternatywny"},videoBox:{title:"Wstaw wideo",file:"Wybierz plik",url:"Adres URL video, np. YouTube/Vimeo"},audioBox:{title:"Wstaw audio",file:"Wybierz plik",url:"Adres URL audio"},browser:{tags:"Tagi",search:"Szukaj"},caption:"Wstaw opis",close:"Zamknij",submitButton:"Zatwierdź",revertButton:"Cofnij zmiany",proportion:"Ogranicz proporcje",basic:"Bez wyrównania",left:"Do lewej",right:"Do prawej",center:"Do środka",width:"Szerokość",height:"Wysokość",size:"Rozmiar",ratio:"Proporcje"},controller:{edit:"Edycja",unlink:"Usuń odnośnik",remove:"Usuń",insertRowAbove:"Wstaw wiersz powyżej",insertRowBelow:"Wstaw wiersz poniżej",deleteRow:"Usuń wiersz",insertColumnBefore:"Wstaw kolumnę z lewej",insertColumnAfter:"Wstaw kolumnę z prawej",deleteColumn:"Usuń kolumnę",fixedColumnWidth:"Stała szerokość kolumny",resize100:"Zmień rozmiar - 100%",resize75:"Zmień rozmiar - 75%",resize50:"Zmień rozmiar - 50%",resize25:"Zmień rozmiar - 25%",autoSize:"Rozmiar automatyczny",mirrorHorizontal:"Odbicie lustrzane w poziomie",mirrorVertical:"Odbicie lustrzane w pionie",rotateLeft:"Obróć w lewo",rotateRight:"Obróć w prawo",maxSize:"Maksymalny rozmiar",minSize:"Minimalny rozmiar",tableHeader:"Nagłówek tabeli",mergeCells:"Scal komórki",splitCells:"Podziel komórki",HorizontalSplit:"Podział poziomy",VerticalSplit:"Podział pionowy"},menu:{spaced:"Rozstawiony",bordered:"Z obwódką",neon:"Neon",translucent:"Półprzezroczysty",shadow:"Cień",code:"Kod"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"pl",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},55:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"pt_br",toolbar:{default:"Padrão",save:"Salvar",font:"Fonte",formats:"Formatos",fontSize:"Tamanho",bold:"Negrito",underline:"Sublinhado",italic:"Itálico",strike:"Riscado",subscript:"Subescrito",superscript:"Sobrescrito",removeFormat:"Remover Formatação",fontColor:"Cor da Fonte",hiliteColor:"Cor de destaque",indent:"Recuo",outdent:"Avançar",align:"Alinhar",alignLeft:"Alinhar à esquerda",alignRight:"Alinhar à direita",alignCenter:"Centralizar",alignJustify:"Justificar",list:"Lista",orderList:"Lista ordenada",unorderList:"Lista desordenada",horizontalRule:"Linha horizontal",hr_solid:"sólida",hr_dotted:"pontilhada",hr_dashed:"tracejada",table:"Tabela",link:"Link",math:"Matemática",image:"Imagem",video:"Vídeo",audio:"Áudio",fullScreen:"Tela cheia",showBlocks:"Mostrar blocos",codeView:"Mostrar códigos",undo:"Voltar",redo:"Refazer",preview:"Prever",print:"Imprimir",tag_p:"Paragráfo",tag_div:"(DIV) Normal",tag_h:"Cabeçalho",tag_blockquote:"Citar",tag_pre:"Código",template:"Modelo",lineHeight:"Altura da linha",paragraphStyle:"Estilo do parágrafo",textStyle:"Estilo do texto",imageGallery:"Galeria de imagens",dir_ltr:"Esquerda para direita",dir_rtl:"Direita para esquerda",mention:"Menção"},dialogBox:{linkBox:{title:"Inserir link",url:"URL para link",text:"Texto a mostrar",newWindowCheck:"Abrir em nova guia",downloadLinkCheck:"Link para Download",bookmark:"marcar páginas"},mathBox:{title:"Matemática",inputLabel:"Notação matemática",fontSizeLabel:"Tamanho",previewLabel:"Prever"},imageBox:{title:"Inserir imagens",file:"Selecionar arquivos",url:"URL da imagem",altText:"Texto alternativo"},videoBox:{title:"Inserir vídeo",file:"Selecionar arquivos",url:"URL do YouTube/Vimeo"},audioBox:{title:"Inserir áudio",file:"Selecionar arquivos",url:"URL da áudio"},browser:{tags:"Tag",search:"Procurar"},caption:"Inserir descrição",close:"Fechar",submitButton:"Enviar",revertButton:"Reverter",proportion:"Restringir proporções",basic:"Básico",left:"Esquerda",right:"Direita",center:"Centro",width:"Largura",height:"Altura",size:"Tamanho",ratio:"Proporções"},controller:{edit:"Editar",unlink:"Remover link",remove:"Remover",insertRowAbove:"Inserir linha acima",insertRowBelow:"Inserir linha abaixo",deleteRow:"Deletar linha",insertColumnBefore:"Inserir coluna antes",insertColumnAfter:"Inserir coluna depois",deleteColumn:"Deletar coluna",fixedColumnWidth:"Largura fixa da coluna",resize100:"Redimensionar para 100%",resize75:"Redimensionar para 75%",resize50:"Redimensionar para 50%",resize25:"Redimensionar para 25%",autoSize:"Tamanho automático",mirrorHorizontal:"Espelho, Horizontal",mirrorVertical:"Espelho, Vertical",rotateLeft:"Girar para esquerda",rotateRight:"Girar para direita",maxSize:"Tam máx",minSize:"Tam mín",tableHeader:"Cabeçalho da tabela",mergeCells:"Mesclar células",splitCells:"Dividir células",HorizontalSplit:"Divisão horizontal",VerticalSplit:"Divisão vertical"},menu:{spaced:"Espaçado",bordered:"Com borda",neon:"Neon",translucent:"Translúcido",shadow:"Sombreado",code:"Código"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"pt_br",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},71:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"ro",toolbar:{default:"Default",save:"Salvează",font:"Font",formats:"Format",fontSize:"Dimensiune",bold:"Îngroșat",underline:"Subliniat",italic:"Înclinat",strike:"Tăiat",subscript:"Subscript",superscript:"Superscript",removeFormat:"Șterge formatare",fontColor:"Culoare font",hiliteColor:"Culoare de evidențiere",indent:"Indentează",outdent:"Fără indentare",align:"Aliniere",alignLeft:"Aliniere la stânga",alignRight:"Aliniere la dreapta",alignCenter:"Aliniere la centru",alignJustify:"Aliniere stânga - dreapta",list:"Listă",orderList:"Listă ordonată",unorderList:"Listă neordonată",horizontalRule:"Linie orizontală",hr_solid:"Solid",hr_dotted:"Punctat",hr_dashed:"Punctate",table:"Tabel",link:"Link",math:"Matematică",image:"Imagine",video:"Video",audio:"Audio",fullScreen:"Tot ecranul",showBlocks:"Arată blocuri",codeView:"Vizualizare cod",undo:"Anulează",redo:"Refă",preview:"Previzualizare",print:"printează",tag_p:"Paragraf",tag_div:"Normal (DIV)",tag_h:"Antet",tag_blockquote:"Quote",tag_pre:"Citat",template:"Template",lineHeight:"Înălțime linie",paragraphStyle:"Stil paragraf",textStyle:"Stil text",imageGallery:"Galerie de imagini",dir_ltr:"De la stânga la dreapta",dir_rtl:"De la dreapta la stanga",mention:"Mentiune"},dialogBox:{linkBox:{title:"Inserează Link",url:"Adresă link",text:"Text de afișat",newWindowCheck:"Deschide în fereastră nouă",downloadLinkCheck:"Link de descărcare",bookmark:"Marcaj"},mathBox:{title:"Matematică",inputLabel:"Notație matematică",fontSizeLabel:"Dimensiune font",previewLabel:"Previzualizare"},imageBox:{title:"Inserează imagine",file:"Selectează",url:"URL imagine",altText:"text alternativ"},videoBox:{title:"Inserează video",file:"Selectează",url:"Include URL, youtube/vimeo"},audioBox:{title:"Inserează Audio",file:"Selectează",url:"URL Audio"},browser:{tags:"Etichete",search:"Căutareim"},caption:"Inserează descriere",close:"Închide",submitButton:"Salvează",revertButton:"Revenire",proportion:"Constrânge proporțiile",basic:"De bază",left:"Stânga",right:"Dreapta",center:"Centru",width:"Lățime",height:"Înălțime",size:"Dimensiune",ratio:"Ratie"},controller:{edit:"Editează",unlink:"Scoate link",remove:"Elimină",insertRowAbove:"Inserează rând deasupra",insertRowBelow:"Inserează rând dedesupt",deleteRow:"Șterge linie",insertColumnBefore:"Inserează coloană înainte",insertColumnAfter:"Inserează coloană după",deleteColumn:"Șterge coloană",fixedColumnWidth:"Lățime fixă coloană",resize100:"Redimensionare 100%",resize75:"Redimensionare 75%",resize50:"Redimensionare 50%",resize25:"Redimensionare 25%",autoSize:"Dimensiune automată",mirrorHorizontal:"Oglindă, orizontal",mirrorVertical:"Oglindă, vertical",rotateLeft:"Rotește la stânga",rotateRight:"Rotește la dreapta",maxSize:"Dimensiune maximă",minSize:"Dimensiune minimă",tableHeader:"Antet tabel",mergeCells:"Îmbină celule",splitCells:"Divizează celule",HorizontalSplit:"Despicare orizontală",VerticalSplit:"Despicare verticală"},menu:{spaced:"Spațiat",bordered:"Mărginit",neon:"Neon",translucent:"Translucent",shadow:"Umbră",code:"Citat"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"ro",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},993:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"ru",toolbar:{default:"По умолчанию",save:"Сохранить",font:"Шрифт",formats:"Стиль абзаца",fontSize:"Размер шрифта",bold:"Полужирный",underline:"Подчёркнутый",italic:"Курсив",strike:"Зачеркнутый",subscript:"Нижний индекс",superscript:"Верхний индекс",removeFormat:"Очистить форматирование",fontColor:"Цвет текста",hiliteColor:"Цвет фона",indent:"Увеличить отступ",outdent:"Уменьшить отступ",align:"Выравнивание",alignLeft:"Слева",alignRight:"Справа",alignCenter:"По центру",alignJustify:"По ширине",list:"Списки",orderList:"Нумерованный",unorderList:"Маркированный",horizontalRule:"Горизонтальная линия",hr_solid:"Сплошная",hr_dotted:"Пунктир",hr_dashed:"Штриховая",table:"Таблица",link:"Ссылка",math:"математический",image:"Изображение",video:"Видео",audio:"Аудио",fullScreen:"Полный экран",showBlocks:"Блочный вид",codeView:"Редактировать HTML",undo:"Отменить",redo:"Вернуть",preview:"Предварительный просмотр",print:"Печать",tag_p:"Текст",tag_div:"Базовый",tag_h:"Заголовок",tag_blockquote:"Цитата",tag_pre:"Код",template:"Шаблон",lineHeight:"Высота линии",paragraphStyle:"Стиль абзаца",textStyle:"Стиль текста",imageGallery:"Галерея",dir_ltr:"Слева направо",dir_rtl:"Справа налево",mention:"Упоминание"},dialogBox:{linkBox:{title:"Вставить ссылку",url:"Ссылка",text:"Текст",newWindowCheck:"Открывать в новом окне",downloadLinkCheck:"Ссылка для скачивания",bookmark:"Закладка"},mathBox:{title:"математический",inputLabel:"Математическая запись",fontSizeLabel:"Кегль",previewLabel:"Предварительный просмотр"},imageBox:{title:"Вставить изображение",file:"Выберите файл",url:"Адрес изображения",altText:"Текстовое описание изображения"},videoBox:{title:"Вставить видео",file:"Выберите файл",url:"Ссылка на видео, Youtube,Vimeo"},audioBox:{title:"Вставить аудио",file:"Выберите файл",url:"Адрес аудио"},browser:{tags:"Теги",search:"Поиск"},caption:"Добавить подпись",close:"Закрыть",submitButton:"Подтвердить",revertButton:"Сбросить",proportion:"Сохранить пропорции",basic:"Без обтекания",left:"Слева",right:"Справа",center:"По центру",width:"Ширина",height:"Высота",size:"Размер",ratio:"Соотношение"},controller:{edit:"Изменить",unlink:"Убрать ссылку",remove:"Удалить",insertRowAbove:"Вставить строку выше",insertRowBelow:"Вставить строку ниже",deleteRow:"Удалить строку",insertColumnBefore:"Вставить столбец слева",insertColumnAfter:"Вставить столбец справа",deleteColumn:"Удалить столбец",fixedColumnWidth:"Фиксированная ширина столбца",resize100:"Размер 100%",resize75:"Размер 75%",resize50:"Размер 50%",resize25:"Размер 25%",autoSize:"Авто размер",mirrorHorizontal:"Отразить по горизонтали",mirrorVertical:"Отразить по вертикали",rotateLeft:"Повернуть против часовой стрелки",rotateRight:"Повернуть по часовой стрелке",maxSize:"Ширина по размеру страницы",minSize:"Ширина по содержимому",tableHeader:"Строка заголовков",mergeCells:"Объединить ячейки",splitCells:"Разделить ячейку",HorizontalSplit:"Разделить горизонтально",VerticalSplit:"Разделить вертикально"},menu:{spaced:"интервал",bordered:"Граничная Линия",neon:"неон",translucent:"полупрозрачный",shadow:"Тень",code:"Код"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"ru",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},744:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"se",toolbar:{default:"Default",save:"Spara",font:"Typsnitt",formats:"Format",fontSize:"Textstorlek",bold:"Fet",underline:"Understruket",italic:"Kursiv",strike:"Överstruket",subscript:"Sänkt skrift",superscript:"Höjd skrift",removeFormat:"Ta bort formattering",fontColor:"Textfärg",hiliteColor:"Bakgrundsfärg",indent:"Minska indrag",outdent:"Öka indrag",align:"Justering",alignLeft:"Vänsterjustering",alignRight:"Högerjustering",alignCenter:"Mittenjusteirng",alignJustify:"Justera indrag",list:"Listor",orderList:"Numrerad lista",unorderList:"Oordnad lista",horizontalRule:"Horisontell linje",hr_solid:"Solid",hr_dotted:"Punkter",hr_dashed:"Prickad",table:"Tabell",link:"Länk",math:"Math",image:"Bild",video:"Video",audio:"Ljud",fullScreen:"Helskärm",showBlocks:"Visa block",codeView:"Visa koder",undo:"Ångra",redo:"Gör om",preview:"Preview",print:"Print",tag_p:"Paragraf",tag_div:"Normal (DIV)",tag_h:"Rubrik",tag_blockquote:"Citer",tag_pre:"Kod",template:"Mall",lineHeight:"Linjehöjd",paragraphStyle:"Stil på stycke",textStyle:"Textstil",imageGallery:"Bildgalleri",dir_ltr:"Vänster till höger",dir_rtl:"Höger till vänster",mention:"Namn"},dialogBox:{linkBox:{title:"Lägg till länk",url:"URL till länk",text:"Länktext",newWindowCheck:"Öppna i nytt fönster",downloadLinkCheck:"Nedladdningslänk",bookmark:"Bokmärke"},mathBox:{title:"Math",inputLabel:"Matematisk notation",fontSizeLabel:"Textstorlek",previewLabel:"Preview"},imageBox:{title:"Lägg till bild",file:"Lägg till från fil",url:"Lägg till från URL",altText:"Alternativ text"},videoBox:{title:"Lägg till video",file:"Lägg till från fil",url:"Bädda in video / YouTube,Vimeo"},audioBox:{title:"Lägg till ljud",file:"Lägg till från fil",url:"Lägg till från URL"},browser:{tags:"Tags",search:"Sök"},caption:"Lägg till beskrivning",close:"Stäng",submitButton:"Skicka",revertButton:"Återgå",proportion:"Spara proportioner",basic:"Basic",left:"Vänster",right:"Höger",center:"Center",width:"Bredd",height:"Höjd",size:"Storlek",ratio:"Förhållande"},controller:{edit:"Redigera",unlink:"Ta bort länk",remove:"Ta bort",insertRowAbove:"Lägg till rad över",insertRowBelow:"Lägg till rad under",deleteRow:"Ta bort rad",insertColumnBefore:"Lägg till kolumn före",insertColumnAfter:"Lägg till kolumn efter",deleteColumn:"Ta bort kolumner",fixedColumnWidth:"Fast kolumnbredd",resize100:"Förstora 100%",resize75:"Förstora 75%",resize50:"Förstora 50%",resize25:"Förstora 25%",autoSize:"Autostorlek",mirrorHorizontal:"Spegling, horisontell",mirrorVertical:"Spegling, vertikal",rotateLeft:"Rotera till vänster",rotateRight:"Rotera till höger",maxSize:"Maxstorlek",minSize:"Minsta storlek",tableHeader:"Rubrik tabell",mergeCells:"Sammanfoga celler (merge)",splitCells:"Separera celler",HorizontalSplit:"Separera horisontalt",VerticalSplit:"Separera vertikalt"},menu:{spaced:"Avstånd",bordered:"Avgränsningslinje",neon:"Neon",translucent:"Genomskinlig",shadow:"Skugga",code:"Kod"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"se",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},302:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"ua",toolbar:{default:"По замовчуванням",save:"Зберегти",font:"Шрифт",formats:"Стиль абзацу",fontSize:"Розмір шрифту",bold:"Жирний",underline:"Підкреслений",italic:"Курсив",strike:"Перекреслити",subscript:"Нижній індекс",superscript:"Верхній індекс",removeFormat:"Очистити форматування",fontColor:"Колір тексту",hiliteColor:"Колір виділення",indent:"Збільшити відступ",outdent:"Зменшити відступ",align:"Вирівнювання",alignLeft:"За лівим краєм",alignRight:"За правим краєм",alignCenter:"По центру",alignJustify:"За шириною",list:"Список",orderList:"Нумерований",unorderList:"Маркований",horizontalRule:"Горизонтальна лінія",hr_solid:"Суцільна",hr_dotted:"Пунктирна",hr_dashed:"Штрихова",table:"Таблиця",link:"Посилання",math:"Формула",image:"Зображення",video:"Відео",audio:"Аудіо",fullScreen:"Повний екран",showBlocks:"Показати блоки",codeView:"Редагувати як HTML",undo:"Скасувати",redo:"Виконати знову",preview:"Попередній перегляд",print:"Друк",tag_p:"Абзац",tag_div:"Базовий",tag_h:"Заголовок",tag_blockquote:"Цитата",tag_pre:"Код",template:"Шаблон",lineHeight:"Висота лінії",paragraphStyle:"Стиль абзацу",textStyle:"Стиль тексту",imageGallery:"Галерея",dir_ltr:"Зліва направо",dir_rtl:"Справа наліво",mention:"Згадати"},dialogBox:{linkBox:{title:"Вставити посилання",url:"Посилання",text:"Текст",newWindowCheck:"Відкривати в новому вікні",downloadLinkCheck:"Посилання для завантаження",bookmark:"Закладка"},mathBox:{title:"Формула",inputLabel:"Математична запис",fontSizeLabel:"Розмір шрифту",previewLabel:"Попередній перегляд"},imageBox:{title:"Вставити зображення",file:"Виберіть файл",url:"Посилання на зображення",altText:"Текстовий опис зображення"},videoBox:{title:"Вставити відео",file:"Виберіть файл",url:"Посилання на відео, Youtube, Vimeo"},audioBox:{title:"Вставити аудіо",file:"Виберіть файл",url:"Посилання на аудіо"},browser:{tags:"Теги",search:"Пошук"},caption:"Додати підпис",close:"Закрити",submitButton:"Підтвердити",revertButton:"Скинути",proportion:"Зберегти пропорції",basic:"Без обтікання",left:"Зліва",right:"Справа",center:"По центру",width:"Ширина",height:"Висота",size:"Розмір",ratio:"Співвідношення"},controller:{edit:"Змінити",unlink:"Прибрати посилання",remove:"Видалити",insertRowAbove:"Вставити рядок вище",insertRowBelow:"Вставити рядок нижче",deleteRow:"Видалити рядок",insertColumnBefore:"Вставити стовпець зліва",insertColumnAfter:"Вставити стовпець справа",deleteColumn:"Видалити стовпець",fixedColumnWidth:"Фіксована ширина стовпця",resize100:"Розмір 100%",resize75:"Розмір 75%",resize50:"Розмір 50%",resize25:"Розмір 25%",autoSize:"Авто розмір",mirrorHorizontal:"Відобразити по горизонталі",mirrorVertical:"Відобразити по вертикалі",rotateLeft:"Повернути проти годинникової стрілки",rotateRight:"Повернути за годинниковою стрілкою",maxSize:"Ширина за розміром сторінки",minSize:"Ширина за вмістом",tableHeader:"Заголовок таблиці",mergeCells:"Об'єднати клітинки",splitCells:"Розділити клітинку",HorizontalSplit:"Розділити горизонтально",VerticalSplit:"Розділити вертикально"},menu:{spaced:"Інтервал",bordered:"З лініями",neon:"Неон",translucent:"Напівпрозорий",shadow:"Тінь",code:"Код"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"ua",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},835:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"ur",toolbar:{default:"طے شدہ",save:"محفوظ کریں",font:"فونٹ",formats:"فارمیٹس",fontSize:"سائز",bold:"بولڈ",underline:"انڈر لائن",italic:"ترچھا",strike:"لکیرہ کردہ",subscript:"ذیلی",superscript:"انتہائی",removeFormat:"فارمیٹ کو حذف دیں",fontColor:"لکھائی کا رنگ",hiliteColor:"نمایاں رنگ",indent:"حاشیہ",outdent:"ہاشیہ واپس",align:"رخ",alignLeft:"بائیں طرف",alignRight:"دائیں طرف",alignCenter:"مرکز میں طرف",alignJustify:"ہر طرف برابر",list:"فہرست",orderList:"ترتیب شدہ فہرست",unorderList:"غیر ترتیب شدہ فہرست",horizontalRule:"لکیر",hr_solid:"ٹھوس",hr_dotted:"نقطے دار",hr_dashed:"ڈیشڈ",table:"میز",link:"لنک",math:"ریاضی",image:"تصویر",video:"ویڈیو",audio:"آواز",fullScreen:"پوری اسکرین",showBlocks:"ڈبے دکھائیں",codeView:"کوڈ کا نظارہ",undo:"واپس کریں",redo:"دوبارہ کریں",preview:"پیشنظر",print:"پرنٹ کریں",tag_p:"پیراگراف",tag_div:"عام (div)",tag_h:"ہیڈر",tag_blockquote:"اقتباس",tag_pre:"کوڈ",template:"سانچہ",lineHeight:"لکیر کی اونچائی",paragraphStyle:"عبارت کا انداز",textStyle:"متن کا انداز",imageGallery:"تصویری نگارخانہ",dir_ltr:"بائیں سے دائیں",dir_rtl:"دائیں سے بائیں",mention:"تذکرہ"},dialogBox:{linkBox:{title:"لنک داخل کریں",url:"لنک کرنے کے لیے URL",text:"ظاہر کرنے کے لیے متن",newWindowCheck:"نئی ونڈو میں کھولیں",downloadLinkCheck:"ڈاؤن لوڈ لنک",bookmark:"بک مارک"},mathBox:{title:"ریاضی",inputLabel:"ریاضیاتی اشارے",fontSizeLabel:"حرف کا سائز",previewLabel:"پیش نظارہ"},imageBox:{title:"تصویر داخل کریں",file:"فائلوں سے منتخب کریں",url:"تصویری URL",altText:"متبادل متن"},videoBox:{title:"ویڈیو داخل کریں",file:"فائلوں سے منتخب کریں",url:"ذرائع ابلاغ کا یو آر ایل، یوٹیوب/ویمیو"},audioBox:{title:"آواز داخل کریں",file:"فائلوں سے منتخب کریں",url:"آواز URL"},browser:{tags:"ٹیگز",search:"تلاش کریں"},caption:"عنوان",close:"بند کریں",submitButton:"بھیجیں",revertButton:"واپس",proportion:"تناسب کو محدود کریں",basic:"بنیادی",left:"بائیں",right:"دائیں",center:"مرکز",width:"چوڑائی",height:"اونچائی",size:"حجم",ratio:"تناسب"},controller:{edit:"ترمیم",unlink:"لنک ختم کریں",remove:"حذف",insertRowAbove:"اوپر قطار شامل کریں",insertRowBelow:"نیچے قطار شامل کریں",deleteRow:"قطار کو حذف کریں",insertColumnBefore:"پہلے ستون شامل کریں",insertColumnAfter:"اس کے بعد ستون شامل کریں",deleteColumn:"ستون حذف کریں",fixedColumnWidth:"مقررہ ستون کی چوڑائی",resize100:"100% کا حجم تبدیل کریں",resize75:"75% کا حجم تبدیل کریں",resize50:"50% کا حجم تبدیل کریں",resize25:"25% کا حجم تبدیل کریں",autoSize:"ازخود حجم",mirrorHorizontal:"آئینہ، افقی",mirrorVertical:"آئینہ، عمودی",rotateLeft:"بائیں گھومو",rotateRight:"دائیں گھمائیں",maxSize:"زیادہ سے زیادہ سائز",minSize:"کم از کم سائز",tableHeader:"میز کی سرخی",mergeCells:"حجروں کو ضم کریں",splitCells:"حجروں کو علیدہ کرو",HorizontalSplit:"افقی تقسیم",VerticalSplit:"عمودی تقسیم"},menu:{spaced:"فاصلہ",bordered:"سرحدی",neon:"نیین",translucent:"پارباسی",shadow:"سایہ",code:"کوڈ"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"ur",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},456:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={code:"zh_cn",toolbar:{default:"默认",save:"保存",font:"字体",formats:"格式",fontSize:"字号",bold:"粗体",underline:"下划线",italic:"斜体",strike:"删除线",subscript:"下标",superscript:"上标",removeFormat:"清除格式",fontColor:"字体颜色",hiliteColor:"背景颜色",indent:"增加缩进",outdent:"减少缩进",align:"对齐方式",alignLeft:"左对齐",alignRight:"右对齐",alignCenter:"居中",alignJustify:"两端对齐",list:"列表",orderList:"有序列表",unorderList:"无序列表",horizontalRule:"水平线",hr_solid:"实线",hr_dotted:"点线",hr_dashed:"虚线",table:"表格",link:"超链接",math:"数学",image:"图片",video:"视频",audio:"音讯",fullScreen:"全屏",showBlocks:"显示块区域",codeView:"代码视图",undo:"撤消",redo:"恢复",preview:"预览",print:"打印",tag_p:"段落",tag_div:"正文 (DIV)",tag_h:"标题",tag_blockquote:"引用",tag_pre:"代码",template:"模板",lineHeight:"行高",paragraphStyle:"段落样式",textStyle:"文字样式",imageGallery:"图片库",dir_ltr:"左到右",dir_rtl:"右到左",mention:"提到"},dialogBox:{linkBox:{title:"插入超链接",url:"网址",text:"要显示的文字",newWindowCheck:"在新标签页中打开",downloadLinkCheck:"下载链接",bookmark:"书签"},mathBox:{title:"数学",inputLabel:"数学符号",fontSizeLabel:"字号",previewLabel:"预览"},imageBox:{title:"插入图片",file:"上传图片",url:"图片网址",altText:"替换文字"},videoBox:{title:"插入视频",file:"上传图片",url:"嵌入网址, Youtube,Vimeo"},audioBox:{title:"插入音频",file:"上传图片",url:"音频网址"},browser:{tags:"标签",search:"搜索"},caption:"标题",close:"取消",submitButton:"确定",revertButton:"恢复",proportion:"比例",basic:"基本",left:"左",right:"右",center:"居中",width:"宽度",height:"高度",size:"尺寸",ratio:"比"},controller:{edit:"编辑",unlink:"去除链接",remove:"删除",insertRowAbove:"在上方插入",insertRowBelow:"在下方插入",deleteRow:"删除行",insertColumnBefore:"在左侧插入",insertColumnAfter:"在右侧插入",deleteColumn:"删除列",fixedColumnWidth:"固定列宽",resize100:"放大 100%",resize75:"放大 75%",resize50:"放大 50%",resize25:"放大 25%",mirrorHorizontal:"翻转左右",mirrorVertical:"翻转上下",rotateLeft:"向左旋转",rotateRight:"向右旋转",maxSize:"最大尺寸",minSize:"最小尺寸",tableHeader:"表格标题",mergeCells:"合并单元格",splitCells:"分割单元格",HorizontalSplit:"水平分割",VerticalSplit:"垂直分割"},menu:{spaced:"间隔开",bordered:"边界线",neon:"霓虹灯",translucent:"半透明",shadow:"阴影",code:"代码"}};return void 0===t&&(e.SUNEDITOR_LANG||Object.defineProperty(e,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_LANG,"zh_cn",{enumerable:!0,writable:!0,configurable:!0,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return i(e)}:i(t)},315:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={name:"component",set_container:function(e,t){const i=this.util.createElement("DIV");return i.className="se-component "+t,i.appendChild(e),i},set_cover:function(e){const t=this.util.createElement("FIGURE");return t.appendChild(e),t},create_caption:function(){const e=this.util.createElement("FIGCAPTION");return e.innerHTML="
    "+this.lang.dialogBox.caption+"
    ",e}};return void 0===t&&(e.SUNEDITOR_MODULES||Object.defineProperty(e,"SUNEDITOR_MODULES",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_MODULES,"component",{enumerable:!0,writable:!1,configurable:!1,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_MODULES a window with a document");return i(e)}:i(t)},350:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={name:"dialog",add:function(e){const t=e.context;t.dialog={kind:"",updateModal:!1,_closeSignal:!1};let i=e.util.createElement("DIV");i.className="se-dialog sun-editor-common";let n=e.util.createElement("DIV");n.className="se-dialog-back",n.style.display="none";let o=e.util.createElement("DIV");o.className="se-dialog-inner",o.style.display="none",i.appendChild(n),i.appendChild(o),t.dialog.modalArea=i,t.dialog.back=n,t.dialog.modal=o,t.dialog.modal.addEventListener("mousedown",this._onMouseDown_dialog.bind(e)),t.dialog.modal.addEventListener("click",this._onClick_dialog.bind(e)),t.element.relative.appendChild(i),i=null,n=null,o=null},_onMouseDown_dialog:function(e){/se-dialog-inner/.test(e.target.className)?this.context.dialog._closeSignal=!0:this.context.dialog._closeSignal=!1},_onClick_dialog:function(e){(/close/.test(e.target.getAttribute("data-command"))||this.context.dialog._closeSignal)&&this.plugins.dialog.close.call(this)},open:function(e,t){if(this.modalForm)return!1;this.plugins.dialog._bindClose&&(this._d.removeEventListener("keydown",this.plugins.dialog._bindClose),this.plugins.dialog._bindClose=null),this.plugins.dialog._bindClose=function(e){/27/.test(e.keyCode)&&this.plugins.dialog.close.call(this)}.bind(this),this._d.addEventListener("keydown",this.plugins.dialog._bindClose),this.context.dialog.updateModal=t,"full"===this.options.popupDisplay?this.context.dialog.modalArea.style.position="fixed":this.context.dialog.modalArea.style.position="absolute",this.context.dialog.kind=e,this.modalForm=this.context[e].modal;const i=this.context[e].focusElement;"function"==typeof this.plugins[e].on&&this.plugins[e].on.call(this,t),this.context.dialog.modalArea.style.display="block",this.context.dialog.back.style.display="block",this.context.dialog.modal.style.display="block",this.modalForm.style.display="block",i&&i.focus()},_bindClose:null,close:function(){this.plugins.dialog._bindClose&&(this._d.removeEventListener("keydown",this.plugins.dialog._bindClose),this.plugins.dialog._bindClose=null);const e=this.context.dialog.kind;this.modalForm.style.display="none",this.context.dialog.back.style.display="none",this.context.dialog.modalArea.style.display="none",this.context.dialog.updateModal=!1,"function"==typeof this.plugins[e].init&&this.plugins[e].init.call(this),this.context.dialog.kind="",this.modalForm=null,this.focus()}};return void 0===t&&(e.SUNEDITOR_MODULES||Object.defineProperty(e,"SUNEDITOR_MODULES",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_MODULES,"dialog",{enumerable:!0,writable:!1,configurable:!1,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_MODULES a window with a document");return i(e)}:i(t)},438:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={name:"fileBrowser",_xmlHttp:null,_loading:null,add:function(e){const t=e.context;t.fileBrowser={_closeSignal:!1,area:null,header:null,tagArea:null,body:null,list:null,tagElements:null,items:[],selectedTags:[],selectorHandler:null,contextPlugin:"",columnSize:4};let i=e.util.createElement("DIV");i.className="se-file-browser sun-editor-common";let n=e.util.createElement("DIV");n.className="se-file-browser-back";let o=e.util.createElement("DIV");o.className="se-file-browser-inner",o.innerHTML=this.set_browser(e),i.appendChild(n),i.appendChild(o),this._loading=i.querySelector(".se-loading-box"),t.fileBrowser.area=i,t.fileBrowser.header=o.querySelector(".se-file-browser-header"),t.fileBrowser.titleArea=o.querySelector(".se-file-browser-title"),t.fileBrowser.tagArea=o.querySelector(".se-file-browser-tags"),t.fileBrowser.body=o.querySelector(".se-file-browser-body"),t.fileBrowser.list=o.querySelector(".se-file-browser-list"),t.fileBrowser.tagArea.addEventListener("click",this.onClickTag.bind(e)),t.fileBrowser.list.addEventListener("click",this.onClickFile.bind(e)),o.addEventListener("mousedown",this._onMouseDown_browser.bind(e)),o.addEventListener("click",this._onClick_browser.bind(e)),t.element.relative.appendChild(i),i=null,n=null,o=null},set_browser:function(e){const t=e.lang;return'
    '},_onMouseDown_browser:function(e){/se-file-browser-inner/.test(e.target.className)?this.context.fileBrowser._closeSignal=!0:this.context.fileBrowser._closeSignal=!1},_onClick_browser:function(e){e.stopPropagation(),(/close/.test(e.target.getAttribute("data-command"))||this.context.fileBrowser._closeSignal)&&this.plugins.fileBrowser.close.call(this)},open:function(e,t){this.plugins.fileBrowser._bindClose&&(this._d.removeEventListener("keydown",this.plugins.fileBrowser._bindClose),this.plugins.fileBrowser._bindClose=null),this.plugins.fileBrowser._bindClose=function(e){/27/.test(e.keyCode)&&this.plugins.fileBrowser.close.call(this)}.bind(this),this._d.addEventListener("keydown",this.plugins.fileBrowser._bindClose);const i=this.context.fileBrowser;i.contextPlugin=e,i.selectorHandler=t;const n=this.context[e],o=n.listClass;this.util.hasClass(i.list,o)||(i.list.className="se-file-browser-list "+o),"full"===this.options.popupDisplay?i.area.style.position="fixed":i.area.style.position="absolute",i.titleArea.textContent=n.title,i.area.style.display="block",this.plugins.fileBrowser._drawFileList.call(this,this.context[e].url,this.context[e].header)},_bindClose:null,close:function(){const e=this.plugins.fileBrowser;e._xmlHttp&&e._xmlHttp.abort(),e._bindClose&&(this._d.removeEventListener("keydown",e._bindClose),e._bindClose=null);const t=this.context.fileBrowser;t.area.style.display="none",t.selectorHandler=null,t.selectedTags=[],t.items=[],t.list.innerHTML=t.tagArea.innerHTML=t.titleArea.textContent="","function"==typeof this.plugins[t.contextPlugin].init&&this.plugins[t.contextPlugin].init.call(this),t.contextPlugin=""},showBrowserLoading:function(){this._loading.style.display="block"},closeBrowserLoading:function(){this._loading.style.display="none"},_drawFileList:function(e,t){const i=this.plugins.fileBrowser,n=i._xmlHttp=this.util.getXMLHttpRequest();if(n.onreadystatechange=i._callBackGet.bind(this,n),n.open("get",e,!0),null!==t&&"object"==typeof t&&this._w.Object.keys(t).length>0)for(let e in t)n.setRequestHeader(e,t[e]);n.send(null),this.plugins.fileBrowser.showBrowserLoading()},_callBackGet:function(e){if(4===e.readyState)if(this.plugins.fileBrowser._xmlHttp=null,200===e.status)try{const t=JSON.parse(e.responseText);t.result.length>0?this.plugins.fileBrowser._drawListItem.call(this,t.result,!0):t.nullMessage&&(this.context.fileBrowser.list.innerHTML=t.nullMessage)}catch(e){throw Error('[SUNEDITOR.fileBrowser.drawList.fail] cause : "'+e.message+'"')}finally{this.plugins.fileBrowser.closeBrowserLoading(),this.context.fileBrowser.body.style.maxHeight=this._w.innerHeight-this.context.fileBrowser.header.offsetHeight-50+"px"}else if(this.plugins.fileBrowser.closeBrowserLoading(),0!==e.status){const t=e.responseText?JSON.parse(e.responseText):e,i="[SUNEDITOR.fileBrowser.get.serverException] status: "+e.status+", response: "+(t.errorMessage||e.responseText);throw Error(i)}},_drawListItem:function(e,t){const i=this.context.fileBrowser,n=this.context[i.contextPlugin],o=[],l=e.length,r=n.columnSize||i.columnSize,s=r<=1?1:Math.round(l/r)||1,a=n.itemTemplateHandler;let c="",u='
    ',d=1;for(let i,n,h=0;h
    '),t&&n.length>0)for(let e,t=0,i=n.length;t'+e+"");u+="
    ",i.list.innerHTML=u,t&&(i.items=e,i.tagArea.innerHTML=c,i.tagElements=i.tagArea.querySelectorAll("A"))},onClickTag:function(e){const t=e.target;if(!this.util.isAnchor(t))return;const i=t.textContent,n=this.plugins.fileBrowser,o=this.context.fileBrowser,l=o.tagArea.querySelector('a[title="'+i+'"]'),r=o.selectedTags,s=r.indexOf(i);s>-1?(r.splice(s,1),this.util.removeClass(l,"on")):(r.push(i),this.util.addClass(l,"on")),n._drawListItem.call(this,0===r.length?o.items:o.items.filter((function(e){return e.tag.some((function(e){return r.indexOf(e)>-1}))})),!1)},onClickFile:function(e){e.preventDefault(),e.stopPropagation();const t=this.context.fileBrowser,i=t.list;let n=e.target,o=null;if(n!==i){for(;i!==n.parentNode&&(o=n.getAttribute("data-command"),!o);)n=n.parentNode;o&&((t.selectorHandler||this.context[t.contextPlugin].selectorHandler)(n,n.parentNode.querySelector(".__se__img_name").textContent),this.plugins.fileBrowser.close.call(this))}}};return void 0===t&&(e.SUNEDITOR_MODULES||Object.defineProperty(e,"SUNEDITOR_MODULES",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_MODULES,"fileBrowser",{enumerable:!0,writable:!1,configurable:!1,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_MODULES a window with a document");return i(e)}:i(t)},913:function(e){"use strict";var t,i;t="undefined"!=typeof window?window:this,i=function(e,t){const i={name:"fileManager",_xmlHttp:null,_checkMediaComponent:function(e){return!/IMG/i.test(e)||!/FIGURE/i.test(e.parentElement.nodeName)||!/FIGURE/i.test(e.parentElement.parentElement.nodeName)},upload:function(e,t,i,n,o){this.showLoading();const l=this.plugins.fileManager,r=l._xmlHttp=this.util.getXMLHttpRequest();if(r.onreadystatechange=l._callBackUpload.bind(this,r,n,o),r.open("post",e,!0),null!==t&&"object"==typeof t&&this._w.Object.keys(t).length>0)for(let e in t)r.setRequestHeader(e,t[e]);r.send(i)},_callBackUpload:function(e,t,i){if(4===e.readyState)if(200===e.status)try{t(e)}catch(e){throw Error('[SUNEDITOR.fileManager.upload.callBack.fail] cause : "'+e.message+'"')}finally{this.closeLoading()}else{this.closeLoading();const t=e.responseText?JSON.parse(e.responseText):e;if("function"!=typeof i||i("",t,this)){const i="[SUNEDITOR.fileManager.upload.serverException] status: "+e.status+", response: "+(t.errorMessage||e.responseText);throw this.functions.noticeOpen(i),Error(i)}}},checkInfo:function(e,t,i,n,o){let l=[];for(let e=0,i=t.length;e0;){const t=l.shift();this.util.getParentElement(t,this.util.isMediaComponent)&&r._checkMediaComponent(t)?!t.getAttribute("data-index")||h.indexOf(1*t.getAttribute("data-index"))<0?(d.push(s._infoIndex),t.removeAttribute("data-index"),c(e,t,i,null,o)):d.push(1*t.getAttribute("data-index")):(d.push(s._infoIndex),n(t))}for(let e,t=0;t-1||(a.splice(t,1),"function"==typeof i&&i(null,e,"delete",null,0,this),t--);o&&(this.context.resizing._resize_plugin=u)},setInfo:function(e,t,i,n,o){const l=o?this.context.resizing._resize_plugin:"";o&&(this.context.resizing._resize_plugin=e);const r=this.plugins[e],s=this.context[e],a=s._infoList;let c=t.getAttribute("data-index"),u=null,d="";if(n||(n={name:t.getAttribute("data-file-name")||("string"==typeof t.src?t.src.split("/").pop():""),size:t.getAttribute("data-file-size")||0}),!c||this._componentsInfoInit)d="create",c=s._infoIndex++,t.setAttribute("data-index",c),t.setAttribute("data-file-name",n.name),t.setAttribute("data-file-size",n.size),u={src:t.src,index:1*c,name:n.name,size:n.size},a.push(u);else{d="update",c*=1;for(let e=0,t=a.length;e=0){const n=this.context[e]._infoList;for(let e=0,o=n.length;e
    ",n},_module_getSizeX:function(e,t,i,n){return t||(t=e._element),i||(i=e._cover),n||(n=e._container),t?/%$/.test(t.style.width)?(n&&this.util.getNumber(n.style.width,2)||100)+"%":t.style.width:""},_module_getSizeY:function(e,t,i,n){return t||(t=e._element),i||(i=e._cover),n||(n=e._container),n&&i?this.util.getNumber(i.style.paddingBottom,0)>0&&!this.context.resizing._rotateVertical?i.style.height:/%$/.test(t.style.height)&&/%$/.test(t.style.width)?(n&&this.util.getNumber(n.style.height,2)||100)+"%":t.style.height:t&&t.style.height||""},_module_setModifyInputSize:function(e,t){const i=e._onlyPercentage&&this.context.resizing._rotateVertical;e.proportion.checked=e._proportionChecked="false"!==e._element.getAttribute("data-proportion");let n=i?"":this.plugins.resizing._module_getSizeX.call(this,e);if(n===e._defaultSizeX&&(n=""),e._onlyPercentage&&(n=this.util.getNumber(n,2)),e.inputX.value=n,t.setInputSize.call(this,"x"),!e._onlyPercentage){let t=i?"":this.plugins.resizing._module_getSizeY.call(this,e);t===e._defaultSizeY&&(t=""),e._onlyPercentage&&(t=this.util.getNumber(t,2)),e.inputY.value=t}e.inputX.disabled=!!i,e.inputY.disabled=!!i,e.proportion.disabled=!!i,t.setRatio.call(this)},_module_setInputSize:function(e,t){if(e._onlyPercentage)"x"===t&&e.inputX.value>100&&(e.inputX.value=100);else if(e.proportion.checked&&e._ratio&&/\d/.test(e.inputX.value)&&/\d/.test(e.inputY.value)){const i=e.inputX.value.replace(/\d+|\./g,"")||e.sizeUnit,n=e.inputY.value.replace(/\d+|\./g,"")||e.sizeUnit;if(i!==n)return;const o="%"===i?2:0;"x"===t?e.inputY.value=this.util.getNumber(e._ratioY*this.util.getNumber(e.inputX.value,o),o)+n:e.inputX.value=this.util.getNumber(e._ratioX*this.util.getNumber(e.inputY.value,o),o)+i}},_module_setRatio:function(e){const t=e.inputX.value,i=e.inputY.value;if(e.proportion.checked&&/\d+/.test(t)&&/\d+/.test(i)){if((t.replace(/\d+|\./g,"")||e.sizeUnit)!==(i.replace(/\d+|\./g,"")||e.sizeUnit))e._ratio=!1;else if(!e._ratio){const n=this.util.getNumber(t,0),o=this.util.getNumber(i,0);e._ratio=!0,e._ratioX=n/o,e._ratioY=o/n}}else e._ratio=!1},_module_sizeRevert:function(e){e._onlyPercentage?e.inputX.value=e._origin_w>100?100:e._origin_w:(e.inputX.value=e._origin_w,e.inputY.value=e._origin_h)},_module_saveCurrentSize:function(e){const t=this.plugins.resizing._module_getSizeX.call(this,e),i=this.plugins.resizing._module_getSizeY.call(this,e);e._element.setAttribute("width",t.replace("px","")),e._element.setAttribute("height",i.replace("px","")),e._element.setAttribute("data-size",t+","+i),e._videoRatio&&(e._videoRatio=i)},call_controller_resize:function(e,t){const i=this.context.resizing,n=this.context[t];i._resize_plugin=t;const o=i.resizeContainer,l=i.resizeDiv,r=this.util.getOffset(e,this.context.element.wysiwygFrame),s=i._rotateVertical=/^(90|270)$/.test(Math.abs(e.getAttribute("data-rotate")).toString()),a=s?e.offsetHeight:e.offsetWidth,c=s?e.offsetWidth:e.offsetHeight,u=r.top,d=r.left-this.context.element.wysiwygFrame.scrollLeft;o.style.top=u+"px",o.style.left=d+"px",o.style.width=a+"px",o.style.height=c+"px",l.style.top="0px",l.style.left="0px",l.style.width=a+"px",l.style.height=c+"px";let h=e.getAttribute("data-align")||"basic";h="none"===h?"basic":h;const p=this.util.getParentElement(e,this.util.isComponent),f=this.util.getParentElement(e,"FIGURE"),g=this.plugins.resizing._module_getSizeX.call(this,n,e,f,p)||"auto",m=n._onlyPercentage&&"image"===t?"":", "+(this.plugins.resizing._module_getSizeY.call(this,n,e,f,p)||"auto");this.util.changeTxt(i.resizeDisplay,this.lang.dialogBox[h]+" ("+g+m+")"),i.resizeButtonGroup.style.display=n._resizing?"":"none";const v=!n._resizing||n._resizeDotHide||n._onlyPercentage?"none":"flex",b=i.resizeHandles;for(let e=0,t=b.length;e=360?0:u;r.setAttribute("data-rotate",d),c._rotateVertical=/^(90|270)$/.test(this._w.Math.abs(d).toString()),this.plugins.resizing.setTransformSize.call(this,r,null,null),this.selectComponent(r,o);break;case"onalign":return void this.plugins.resizing.openAlignMenu.call(this);case"align":const h="basic"===n?"none":n;s.setAlign.call(this,h,null,null,null),this.selectComponent(r,o);break;case"caption":const p=!l._captionChecked;if(s.openModify.call(this,!0),l._captionChecked=l.captionCheckEl.checked=p,s.update_image.call(this,!1,!1,!1),p){const e=this.util.getChildElement(l._caption,(function(e){return 3===e.nodeType}));e?this.setRange(e,0,e,e.textContent.length):l._caption.focus(),this.controllersOff()}else this.selectComponent(r,o),s.openModify.call(this,!0);break;case"revert":s.setOriginSize.call(this),this.selectComponent(r,o);break;case"update":s.openModify.call(this),this.controllersOff();break;case"delete":s.destroy.call(this)}this.history.push(!1)}},resetTransform:function(e){const t=(e.getAttribute("data-size")||e.getAttribute("data-origin")||"").split(",");this.context.resizing._rotateVertical=!1,e.style.maxWidth="",e.style.transform="",e.style.transformOrigin="",e.setAttribute("data-rotate",""),e.setAttribute("data-rotateX",""),e.setAttribute("data-rotateY",""),this.plugins[this.context.resizing._resize_plugin].setSize.call(this,t[0]?t[0]:"auto",t[1]?t[1]:"",!0)},setTransformSize:function(e,t,i){let n=e.getAttribute("data-percentage");const o=this.context.resizing._rotateVertical,l=1*e.getAttribute("data-rotate");let r="";if(n&&!o)n=n.split(","),"auto"===n[0]&&"auto"===n[1]?this.plugins[this.context.resizing._resize_plugin].setAutoSize.call(this):this.plugins[this.context.resizing._resize_plugin].setPercentSize.call(this,n[0],n[1]);else{const n=this.util.getParentElement(e,"FIGURE"),s=t||e.offsetWidth,a=i||e.offsetHeight,c=(o?a:s)+"px",u=(o?s:a)+"px";this.plugins[this.context.resizing._resize_plugin].cancelPercentAttr.call(this),this.plugins[this.context.resizing._resize_plugin].setSize.call(this,s+"px",a+"px",!0),n.style.width=c,n.style.height=this.context[this.context.resizing._resize_plugin]._caption?"":u,o&&(r=90===l||-270===l?a/2+"px "+a/2+"px 0":s/2+"px "+s/2+"px 0")}e.style.transformOrigin=r,this.plugins.resizing._setTransForm(e,l.toString(),e.getAttribute("data-rotateX")||"",e.getAttribute("data-rotateY")||""),e.style.maxWidth=o?"none":"",this.plugins.resizing.setCaptionPosition.call(this,e)},_setTransForm:function(e,t,i,n){let o=(e.offsetWidth-e.offsetHeight)*(/-/.test(t)?1:-1),l="";if(/[1-9]/.test(t)&&(i||n))switch(l=i?"Y":"X",t){case"90":l=i&&n?"X":n?l:"";break;case"270":o*=-1,l=i&&n?"Y":i?l:"";break;case"-90":l=i&&n?"Y":i?l:"";break;case"-270":o*=-1,l=i&&n?"X":n?l:"";break;default:l=""}t%180==0&&(e.style.maxWidth=""),e.style.transform="rotate("+t+"deg)"+(i?" rotateX("+i+"deg)":"")+(n?" rotateY("+n+"deg)":"")+(l?" translate"+l+"("+o+"px)":"")},setCaptionPosition:function(e){const t=this.util.getChildElement(this.util.getParentElement(e,"FIGURE"),"FIGCAPTION");t&&(t.style.marginTop=(this.context.resizing._rotateVertical?e.offsetWidth-e.offsetHeight:0)+"px")},onMouseDown_resize_handle:function(e){e.stopPropagation(),e.preventDefault();const t=this.context.resizing,i=t._resize_direction=e.target.classList[0];t._resizeClientX=e.clientX,t._resizeClientY=e.clientY,this.context.element.resizeBackground.style.display="block",t.resizeButton.style.display="none",t.resizeDiv.style.float=/l/.test(i)?"right":/r/.test(i)?"left":"none";const n=function(e){if("keydown"===e.type&&27!==e.keyCode)return;const l=t._isChange;t._isChange=!1,this.removeDocEvent("mousemove",o),this.removeDocEvent("mouseup",n),this.removeDocEvent("keydown",n),"keydown"===e.type?(this.controllersOff(),this.context.element.resizeBackground.style.display="none",this.plugins[this.context.resizing._resize_plugin].init.call(this)):(this.plugins.resizing.cancel_controller_resize.call(this,i),l&&this.history.push(!1))}.bind(this),o=this.plugins.resizing.resizing_element.bind(this,t,i,this.context[t._resize_plugin]);this.addDocEvent("mousemove",o),this.addDocEvent("mouseup",n),this.addDocEvent("keydown",n)},resizing_element:function(e,t,i,n){const o=n.clientX,l=n.clientY;let r=i._element_w,s=i._element_h;const a=i._element_w+(/r/.test(t)?o-e._resizeClientX:e._resizeClientX-o),c=i._element_h+(/b/.test(t)?l-e._resizeClientY:e._resizeClientY-l),u=i._element_h/i._element_w*a;/t/.test(t)&&(e.resizeDiv.style.top=i._element_h-(/h/.test(t)?c:u)+"px"),/l/.test(t)&&(e.resizeDiv.style.left=i._element_w-a+"px"),/r|l/.test(t)&&(e.resizeDiv.style.width=a+"px",r=a),/^(t|b)[^h]$/.test(t)?(e.resizeDiv.style.height=u+"px",s=u):/^(t|b)h$/.test(t)&&(e.resizeDiv.style.height=c+"px",s=c),e._resize_w=r,e._resize_h=s,this.util.changeTxt(e.resizeDisplay,this._w.Math.round(r)+" x "+this._w.Math.round(s)),e._isChange=!0},cancel_controller_resize:function(e){const t=this.context.resizing._rotateVertical;this.controllersOff(),this.context.element.resizeBackground.style.display="none";let i=this._w.Math.round(t?this.context.resizing._resize_h:this.context.resizing._resize_w),n=this._w.Math.round(t?this.context.resizing._resize_w:this.context.resizing._resize_h);if(!t&&!/%$/.test(i)){const e=16,t=this.context.element.wysiwygFrame.clientWidth-2*e-2;this.util.getNumber(i,0)>t&&(n=this._w.Math.round(n/i*t),i=t)}const o=this.context.resizing._resize_plugin;this.plugins[o].setSize.call(this,i,n,!1,e),t&&this.plugins.resizing.setTransformSize.call(this,this.context[this.context.resizing._resize_plugin]._element,i,n),this.selectComponent(this.context[o]._element,o)}};return void 0===t&&(e.SUNEDITOR_MODULES||Object.defineProperty(e,"SUNEDITOR_MODULES",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(e.SUNEDITOR_MODULES,"resizing",{enumerable:!0,writable:!1,configurable:!1,value:i})),i},"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_MODULES a window with a document");return i(e)}:i(t)}},t={};function i(n){var o=t[n];if(void 0!==o)return o.exports;var l=t[n]={exports:{}};return e[n].call(l.exports,l,l.exports,i),l.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e={documentSelector:".js-document",documentDisabledClass:"is-disabled",openingTriggerActiveClass:"is-active",delay:200},t=['[href]:not([tabindex^="-"])','input:not([disabled]):not([type="hidden"]):not([tabindex^="-"]):not([type="radio"])','input[type="radio"]:checked','select:not([disabled]):not([tabindex^="-"])','textarea:not([disabled]):not([tabindex^="-"])','button:not([disabled]):not([tabindex^="-"])','[tabindex]:not([tabindex^="-"])','[contenteditable="true"]:not([tabindex^="-"])'],n="Escape",o="Tab",l="F6";function r(e,t){let i=e;for(;i!==t&&i;)i=i.parentNode;return!!i}const s=Symbol("onClick"),a=Symbol("onKeydown"),c=Symbol("addEventDelegation"),u=Symbol("addEventListeners"),d=Symbol("removeEventListeners"),h=Symbol("addAttributes"),p=Symbol("removeAttributes"),f=Symbol("setAttributes"),g=Symbol("setFocusableElements"),m=Symbol("setFocus"),v=Symbol("restoreFocus"),b=Symbol("switchFocus"),y=Symbol("maintainFocus"),w=Symbol("addObserver"),_=Symbol("removeObserver");let x=e;const C=class{constructor(e,{onOpen:t=(()=>{}),onClose:i=(()=>{}),openingSelector:n,closingSelector:o,backdropSelector:l,helperSelector:r,labelledby:u,describedby:d,isModal:h=!0,isTooltip:p=!1,isOpen:f=!1,isCreated:m=!0,disableScroll:v=!0,enableAutoFocus:y=!0,openingTriggerActiveClass:w=x.openingTriggerActiveClass,delay:_=x.delay}={}){document.querySelector(e)?(this.config={dialogSelector:e,onOpen:t,onClose:i,openingSelector:n,closingSelector:o,backdropSelector:l,helperSelector:r,labelledby:u,describedby:d,isModal:h,isTooltip:p,isCreated:m,isOpen:f,disableScroll:v,enableAutoFocus:y,documentSelector:x.documentSelector,documentDisabledClass:x.documentDisabledClass,openingTriggerActiveClass:w,delay:_},this.dialog=document.querySelector(e),this.dialogArea=`${e}, ${n}`,this.openingTriggers=document.querySelectorAll(n),this.backdropTrigger=document.querySelector(l),this.helpers=document.querySelectorAll(r),this.document=document.querySelector(this.config.documentSelector)||document.querySelector("html"),this.documentIsAlreadyDisabled=!1,this.focusableElements=[],this.firstFocusableElement=null,this.lastFocusableElement=null,this.openingTrigger=null,this.closingTrigger=null,this.isCreated=!1,this.isOpen=!1,this.close=this.close.bind(this),this.toggle=this.toggle.bind(this),this[s]=this[s].bind(this),this[a]=this[a].bind(this),this[c]=this[c].bind(this),this[b]=this[b].bind(this),this.observer=new MutationObserver((e=>e.forEach((()=>this[g]())))),this.isInitialized=!0,m&&this.create()):this.isInitialized=!1}[s](e){this.config.isTooltip&&!e.target.closest(this.dialogArea)&&this.close(e),e.target===this.backdropTrigger&&this.close(e)}[a](e){switch(e.key){case n:e.stopPropagation(),this.close(e);break;case l:this.config.isModal||(this.config.isTooltip?this.close(e):this[v]());break;case o:this[y](e)}}[c](e){document.querySelectorAll(this.config.openingSelector).forEach((t=>{r(e.target,t)&&(this.openingTrigger=t,this.toggle(e))})),document.querySelectorAll(this.config.closingSelector).forEach((t=>{r(e.target,t)&&(this.closingTrigger=t,this.close())}))}[u](){document.addEventListener("click",this[s],{capture:!0}),this.dialog.addEventListener("keydown",this[a])}[d](){document.removeEventListener("click",this[s],{capture:!0}),this.dialog.removeEventListener("keydown",this[a]),this.openingTrigger&&this.openingTrigger.removeEventListener("keydown",this[b])}[h](){this.dialog.setAttribute("role","dialog"),this.dialog.setAttribute("tabindex",-1),this.dialog.setAttribute("aria-hidden",!0),this.config.labelledby&&this.dialog.setAttribute("aria-labelledby",this.config.labelledby),this.config.describedby&&this.dialog.setAttribute("aria-describedby",this.config.describedby),this.config.isModal&&this.dialog.setAttribute("aria-modal",!0),this.openingTriggers.forEach((e=>e.setAttribute("aria-haspopup","dialog")))}[p](){this.dialog.removeAttribute("role"),this.dialog.removeAttribute("tabindex"),this.dialog.removeAttribute("aria-hidden"),this.dialog.removeAttribute("aria-labelledby"),this.dialog.removeAttribute("aria-describedby"),this.dialog.removeAttribute("aria-modal"),this.config.disableScroll&&this.isOpen&&!this.documentIsAlreadyDisabled&&this.document.classList.remove(this.config.documentDisabledClass),this.openingTriggers.forEach((e=>e.removeAttribute("aria-haspopup"))),this.openingTrigger&&this.openingTrigger.classList.remove(this.config.openingTriggerActiveClass),this.helpers.forEach((e=>e.classList.remove(this.config.openingTriggerActiveClass)))}[f](){this.dialog.setAttribute("aria-hidden",!this.isOpen),this.config.disableScroll&&!this.documentIsAlreadyDisabled&&(this.isOpen?this.document.classList.add(this.config.documentDisabledClass):this.document.classList.remove(this.config.documentDisabledClass)),this.openingTrigger&&(this.isOpen?this.openingTrigger.classList.add(this.config.openingTriggerActiveClass):this.openingTrigger.classList.remove(this.config.openingTriggerActiveClass)),this.helpers.forEach((e=>{this.isOpen?e.classList.add(this.config.openingTriggerActiveClass):e.classList.remove(this.config.openingTriggerActiveClass)}))}[g](){const e=function(e){const t=[];return e.forEach((e=>{const i=e.getBoundingClientRect();(i.width>0||i.height>0)&&t.push(e)})),t}(this.dialog.querySelectorAll(t)),i=function(e,t,i){const n=e.querySelectorAll(t),o=[];let l=!1;return 0===n.length?i:(i.forEach((e=>{n.forEach((t=>{t.contains(e)&&(l=!0)})),l||o.push(e),l=!1})),o)}(this.dialog,'[role="dialog"]',e);this.focusableElements=i.length>0?i:[this.dialog],[this.firstFocusableElement]=this.focusableElements,this.lastFocusableElement=this.focusableElements[this.focusableElements.length-1]}[m](){this.config.enableAutoFocus&&window.setTimeout((()=>this.firstFocusableElement.focus()),this.config.delay)}[v](){this.config.enableAutoFocus&&window.setTimeout((()=>this.openingTrigger.focus()),this.config.delay),this.isOpen&&this.openingTrigger.addEventListener("keydown",this[b])}[b](e){e.key===l&&(this.openingTrigger.removeEventListener("keydown",this[b]),this[m]())}[y](e){e.shiftKey&&e.target===this.firstFocusableElement&&(e.preventDefault(),this.lastFocusableElement.focus()),e.shiftKey||e.target!==this.lastFocusableElement||(e.preventDefault(),this.firstFocusableElement.focus())}[w](){this.observer.observe(this.dialog,{childList:!0,attributes:!0,subtree:!0})}[_](){this.observer.disconnect()}open(){this.isInitialized&&this.isCreated&&!this.isOpen&&(this.isOpen=!0,this.documentIsAlreadyDisabled=this.document.classList.contains(this.config.documentDisabledClass),this[f](),this[u](),this[m](),this.config.onOpen(this.dialog,this.openingTrigger))}close(e){this.isInitialized&&this.isCreated&&this.isOpen&&(this.isOpen=!1,e&&e.preventDefault(),this[f](),this[d](),this.openingTrigger&&(!this.config.isTooltip||this.config.isTooltip&&e&&"click"!==e.type)&&this[v](),this.config.onClose(this.dialog,this.closingTrigger))}toggle(e){this.isInitialized&&this.isCreated&&(e&&e.preventDefault(),this.isOpen?this.close():this.open())}create(){this.isInitialized&&!this.isCreated&&(this.isCreated=!0,this[h](),this[g](),this[w](),this.config.isOpen&&this.open(),document.addEventListener("click",this[c],{capture:!0}))}destroy(){this.isInitialized&&this.isCreated&&(this.close(),this.isCreated=!1,this[p](),this[d](),this[_](),document.removeEventListener("click",this[c],{capture:!0}))}};var k=Object.prototype.toString,S=Array.isArray||function(e){return"[object Array]"===k.call(e)};function L(e){return"function"==typeof e}function E(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function T(e,t){return null!=e&&"object"==typeof e&&t in e}var N=RegExp.prototype.test;var z=/\S/;function A(e){return!function(e,t){return N.call(e,t)}(z,e)}var B={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};var M=/\s*/,R=/\s+/,I=/\s*=/,O=/\s*\}/,H=/#|\^|\/|>|\{|&|=|!/;function D(e){this.string=e,this.tail=e,this.pos=0}function F(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function P(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}D.prototype.eos=function(){return""===this.tail},D.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var i=t[0];return this.tail=this.tail.substring(i.length),this.pos+=i.length,i},D.prototype.scanUntil=function(e){var t,i=this.tail.search(e);switch(i){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,i),this.tail=this.tail.substring(i)}return this.pos+=t.length,t},F.prototype.push=function(e){return new F(e,this)},F.prototype.lookup=function(e){var t,i,n,o=this.cache;if(o.hasOwnProperty(e))t=o[e];else{for(var l,r,s,a=this,c=!1;a;){if(e.indexOf(".")>0)for(l=a.view,r=e.split("."),s=0;null!=l&&s0?o[o.length-1][4]:i;break;default:n.push(t)}return i}(function(e){for(var t,i,n=[],o=0,l=e.length;o"===r?s=this.renderPartial(l,t,i,o):"&"===r?s=this.unescapedValue(l,t):"name"===r?s=this.escapedValue(l,t,o):"text"===r&&(s=this.rawValue(l)),void 0!==s&&(a+=s);return a},P.prototype.renderSection=function(e,t,i,n,o){var l=this,r="",s=t.lookup(e[1]);if(s){if(S(s))for(var a=0,c=s.length;a0||!i)&&(o[l]=n+o[l]);return o.join("\n")},P.prototype.renderPartial=function(e,t,i,n){if(i){var o=this.getConfigTags(n),l=L(i)?i(e[1]):i[e[1]];if(null!=l){var r=e[6],s=e[5],a=e[4],c=l;0==s&&a&&(c=this.indentPartial(l,a,r));var u=this.parse(c,o);return this.renderTokens(u,t,i,c,n)}}},P.prototype.unescapedValue=function(e,t){var i=t.lookup(e[1]);if(null!=i)return i},P.prototype.escapedValue=function(e,t,i){var n=this.getConfigEscape(i)||V.escape,o=t.lookup(e[1]);if(null!=o)return"number"==typeof o&&n===V.escape?String(o):n(o)},P.prototype.rawValue=function(e){return e[1]},P.prototype.getConfigTags=function(e){return S(e)?e:e&&"object"==typeof e?e.tags:void 0},P.prototype.getConfigEscape=function(e){return e&&"object"==typeof e&&!S(e)?e.escape:void 0};var V={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){U.templateCache=e},get templateCache(){return U.templateCache}},U=new P;V.clearCache=function(){return U.clearCache()},V.parse=function(e,t){return U.parse(e,t)},V.render=function(e,t,i,n){if("string"!=typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+((S(o=e)?"array":typeof o)+'" was given as the first argument for mustache#render(template, view, partials)'));var o;return U.render(e,t,i,n)},V.escape=function(e){return String(e).replace(/[&<>"'`=\/]/g,(function(e){return B[e]}))},V.Scanner=D,V.Context=F,V.Writer=P;const W=V,j={rtl:{italic:'',indent:'',outdent:'',list_bullets:'',list_number:'',link:'',unlink:''},redo:'',undo:'',bold:'',underline:'',italic:'',strike:'',subscript:'',superscript:'',erase:'',indent:'',outdent:'',expansion:'',reduction:'',code_view:'',preview:'',print:'',template:'',line_height:'',paragraph_style:'',text_style:'',save:'',blockquote:'',arrow_down:'',align_justify:'',align_left:'',align_right:'',align_center:'',font_color:'',highlight_color:'',list_bullets:'',list_number:'',table:'',horizontal_rule:'',show_blocks:'',cancel:'',image:'',video:'',link:'',math:'',unlink:'',table_header:'',merge_cell:'',split_cell:'',caption:'',edit:'',delete:'',modify:'',revert:'',auto_size:'',insert_row_below:'',insert_row_above:'',insert_column_left:'',insert_column_right:'',delete_row:'',delete_column:'',fixed_column_width:'',rotate_left:'',rotate_right:'',mirror_horizontal:'',mirror_vertical:'',checked:'',line_break:'',audio:'',image_gallery:'',bookmark:'',download:'',dir_ltr:'',dir_rtl:'',alert_outline:'',more_text:'',more_paragraph:'',more_plus:'',more_horizontal:'',more_vertical:'',attachment:'',map:'',magic_stick:'',empty_file:''};var q=i(791),Z=i.n(q);const G={_d:null,_w:null,isIE:null,isIE_Edge:null,isOSX_IOS:null,isChromium:null,isMobile:null,isResizeObserverSupported:null,_propertiesInit:function(){this._d||(this._d=document,this._w=window,this.isIE=navigator.userAgent.indexOf("Trident")>-1,this.isIE_Edge=navigator.userAgent.indexOf("Trident")>-1||navigator.appVersion.indexOf("Edge")>-1,this.isOSX_IOS=/(Mac|iPhone|iPod|iPad)/.test(navigator.platform),this.isChromium=!!window.chrome,this.isResizeObserverSupported="function"==typeof ResizeObserver,this.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0)},_allowedEmptyNodeList:".se-component, pre, blockquote, hr, li, table, img, iframe, video, audio, canvas",_HTMLConvertor:function(e){const t={"&":"&"," ":" ","'":"'",'"':""","<":"<",">":">"};return e.replace(/&|\u00A0|'|"|<|>/g,(function(e){return"string"==typeof t[e]?t[e]:e}))},zeroWidthSpace:String.fromCharCode(8203),zeroWidthRegExp:new RegExp(String.fromCharCode(8203),"g"),onlyZeroWidthRegExp:new RegExp("^"+String.fromCharCode(8203)+"+$"),fontValueMap:{"xx-small":1,"x-small":2,small:3,medium:4,large:5,"x-large":6,"xx-large":7},onlyZeroWidthSpace:function(e){return null!=e&&("string"!=typeof e&&(e=e.textContent),""===e||this.onlyZeroWidthRegExp.test(e))},getXMLHttpRequest:function(){if(!this._w.ActiveXObject)return this._w.XMLHttpRequest?new XMLHttpRequest:null;try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){return null}}},getValues:function(e){return e?this._w.Object.keys(e).map((function(t){return e[t]})):[]},camelToKebabCase:function(e){return"string"==typeof e?e.replace(/[A-Z]/g,(function(e){return"-"+e.toLowerCase()})):e.map((function(e){return G.camelToKebabCase(e)}))},kebabToCamelCase:function(e){return"string"==typeof e?e.replace(/-[a-zA-Z]/g,(function(e){return e.replace("-","").toUpperCase()})):e.map((function(e){return G.camelToKebabCase(e)}))},createElement:function(e){return this._d.createElement(e)},createTextNode:function(e){return this._d.createTextNode(e||"")},HTMLEncoder:function(e){const t={"<":"$lt;",">":"$gt;"};return e.replace(/<|>/g,(function(e){return"string"==typeof t[e]?t[e]:e}))},HTMLDecoder:function(e){const t={"$lt;":"<","$gt;":">"};return e.replace(/\$lt;|\$gt;/g,(function(e){return"string"==typeof t[e]?t[e]:e}))},hasOwn:function(e,t){return this._hasOwn.call(e,t)},_hasOwn:Object.prototype.hasOwnProperty,getIncludePath:function(e,t){let i="";const n=[],o="js"===t?"script":"link",l="js"===t?"src":"href";let r="(?:";for(let t=0,i=e.length;t0?n[0][l]:""),-1===i.indexOf(":/")&&"//"!==i.slice(0,2)&&(i=0===i.indexOf("/")?location.href.match(/^.*?:\/\/[^\/]*/)[0]+i:location.href.match(/^[^\?]*\/(?:)/)[0]+i),!i)throw"[SUNEDITOR.util.getIncludePath.fail] The SUNEDITOR installation path could not be automatically detected. (name: +"+name+", extension: "+t+")";return i},getPageStyle:function(e){let t="";const i=(e||this._d).styleSheets;for(let e,n=0,o=i.length;n-1||(n+=i[e].name+'="'+i[e].value+'" ');return n},getByteLength:function(e){if(!e||!e.toString)return 0;e=e.toString();const t=this._w.encodeURIComponent;let i,n;return this.isIE_Edge?(n=this._w.unescape(t(e)).length,i=0,null!==t(e).match(/(%0A|%0D)/gi)&&(i=t(e).match(/(%0A|%0D)/gi).length),n+i):(n=new this._w.TextEncoder("utf-8").encode(e).length,i=0,null!==t(e).match(/(%0A|%0D)/gi)&&(i=t(e).match(/(%0A|%0D)/gi).length),n+i)},isWysiwygDiv:function(e){return e&&1===e.nodeType&&(this.hasClass(e,"se-wrapper-wysiwyg")||/^BODY$/i.test(e.nodeName))},isNonEditable:function(e){return e&&1===e.nodeType&&"false"===e.getAttribute("contenteditable")},isTextStyleElement:function(e){return e&&3!==e.nodeType&&/^(strong|span|font|b|var|i|em|u|ins|s|strike|del|sub|sup|mark|a|label|code|summary)$/i.test(e.nodeName)},isInputElement:function(e){return e&&1===e.nodeType&&/^(INPUT|TEXTAREA)$/i.test(e.nodeName)},isFormatElement:function(e){return e&&1===e.nodeType&&(/^(P|DIV|H[1-6]|PRE|LI|TH|TD|DETAILS)$/i.test(e.nodeName)||this.hasClass(e,"(\\s|^)__se__format__replace_.+(\\s|$)|(\\s|^)__se__format__free_.+(\\s|$)"))&&!this.isComponent(e)&&!this.isWysiwygDiv(e)},isRangeFormatElement:function(e){return e&&1===e.nodeType&&(/^(BLOCKQUOTE|OL|UL|FIGCAPTION|TABLE|THEAD|TBODY|TR|TH|TD|DETAILS)$/i.test(e.nodeName)||this.hasClass(e,"(\\s|^)__se__format__range_.+(\\s|$)"))},isClosureRangeFormatElement:function(e){return e&&1===e.nodeType&&(/^(TH|TD)$/i.test(e.nodeName)||this.hasClass(e,"(\\s|^)__se__format__range__closure_.+(\\s|$)"))},isFreeFormatElement:function(e){return e&&1===e.nodeType&&(/^PRE$/i.test(e.nodeName)||this.hasClass(e,"(\\s|^)__se__format__free_.+(\\s|$)"))&&!this.isComponent(e)&&!this.isWysiwygDiv(e)},isClosureFreeFormatElement:function(e){return e&&1===e.nodeType&&this.hasClass(e,"(\\s|^)__se__format__free__closure_.+(\\s|$)")},isComponent:function(e){return e&&(/se-component/.test(e.className)||/^(TABLE|HR)$/.test(e.nodeName))},isUneditableComponent:function(e){return e&&this.hasClass(e,"__se__uneditable")},isMediaComponent:function(e){return e&&/se-component/.test(e.className)},isNotCheckingNode:function(e){return e&&/katex|__se__tag/.test(e.className)},getFormatElement:function(e,t){if(!e)return null;for(t||(t=function(){return!0});e;){if(this.isWysiwygDiv(e))return null;if(this.isRangeFormatElement(e)&&e.firstElementChild,this.isFormatElement(e)&&t(e))return e;e=e.parentNode}return null},getRangeFormatElement:function(e,t){if(!e)return null;for(t||(t=function(){return!0});e;){if(this.isWysiwygDiv(e))return null;if(this.isRangeFormatElement(e)&&!/^(THEAD|TBODY|TR)$/i.test(e.nodeName)&&t(e))return e;e=e.parentNode}return null},getFreeFormatElement:function(e,t){if(!e)return null;for(t||(t=function(){return!0});e;){if(this.isWysiwygDiv(e))return null;if(this.isFreeFormatElement(e)&&t(e))return e;e=e.parentNode}return null},getClosureFreeFormatElement:function(e,t){if(!e)return null;for(t||(t=function(){return!0});e;){if(this.isWysiwygDiv(e))return null;if(this.isClosureFreeFormatElement(e)&&t(e))return e;e=e.parentNode}return null},copyTagAttributes:function(e,t,i){if(t.style.cssText){const i=t.style;for(let t=0,n=i.length;t-1||!n[o].value?e.removeAttribute(t):"style"!==t&&e.setAttribute(n[o].name,n[o].value)},copyFormatAttributes:function(e,t){(t=t.cloneNode(!1)).className=t.className.replace(/(\s|^)__se__format__[^\s]+/g,""),this.copyTagAttributes(e,t)},getArrayItem:function(e,t,i){if(!e||0===e.length)return null;t=t||function(){return!0};const n=[];for(let o,l=0,r=e.length;lr?1:l0&&!this.isBreak(e);)e=e.firstChild;for(;t&&1===t.nodeType&&t.childNodes.length>0&&!this.isBreak(t);)t=t.lastChild;return{sc:e,ec:t||e}}},getOffset:function(e,t){let i=0,n=0,o=3===e.nodeType?e.parentElement:e;const l=this.getParentElement(e,this.isWysiwygDiv.bind(this));for(;o&&!this.hasClass(o,"se-container")&&o!==l;)i+=o.offsetLeft,n+=o.offsetTop,o=o.offsetParent;const r=t&&/iframe/i.test(t.nodeName);return{left:i+(r?t.parentElement.offsetLeft:0),top:n-(l?l.scrollTop:0)+(r?t.parentElement.offsetTop:0)}},getOverlapRangeAtIndex:function(e,t,i,n){if(e<=n?ti)return 0;const o=(e>i?e:i)-(t0?" ":"")+t)},removeClass:function(e,t){if(!e)return;const i=new this._w.RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(i," ").trim(),e.className.trim()||e.removeAttribute("class")},toggleClass:function(e,t){if(!e)return;let i=!1;const n=new this._w.RegExp("(\\s|^)"+t+"(\\s|$)");return n.test(e.className)?e.className=e.className.replace(n," ").trim():(e.className+=" "+t,i=!0),e.className.trim()||e.removeAttribute("class"),i},isImportantDisabled:function(e){return e.hasAttribute("data-important-disabled")},setDisabledButtons:function(e,t,i){for(let n=0,o=t.length;nn))continue;l.appendChild(i[e])}e--,t--,n--}return o.childNodes.length>0&&e.parentNode.insertBefore(o,e),l.childNodes.length>0&&e.parentNode.insertBefore(l,e.nextElementSibling),e}const n=e.parentNode;let o,l,r,s=0,a=1,c=!0;if((!i||i<0)&&(i=0),3===e.nodeType){if(s=this.getPositionIndex(e),t>=0&&e.length!==t){e.splitText(t);const i=this.getNodeFromPath([s+1],n);this.onlyZeroWidthSpace(i)&&(i.data=this.zeroWidthSpace)}}else if(1===e.nodeType){if(0===t){for(;e.firstChild;)e=e.firstChild;if(3===e.nodeType){const t=this.createTextNode(this.zeroWidthSpace);e.parentNode.insertBefore(t,e),e=t}}e.previousSibling?e=e.previousSibling:this.getElementDepth(e)===i&&(c=!1)}1===e.nodeType&&(a=0);let u=e;for(;this.getElementDepth(u)>i;)for(s=this.getPositionIndex(u)+a,u=u.parentNode,r=o,o=u.cloneNode(!1),l=u.childNodes,r&&(this.isListCell(o)&&this.isList(r)&&r.firstElementChild?(o.innerHTML=r.firstElementChild.innerHTML,G.removeItem(r.firstElementChild),r.children.length>0&&o.appendChild(r)):o.appendChild(r));l[s];)o.appendChild(l[s]);u.childNodes.length<=1&&(!u.firstChild||0===u.firstChild.textContent.length)&&(u.innerHTML="
    ");const d=u.parentNode;return c&&(u=u.nextSibling),o?(this.mergeSameTags(o,null,!1),this.mergeNestedTags(o,function(e){return this.isList(e)}.bind(this)),o.childNodes.length>0?d.insertBefore(o,u):o=u,this.isListCell(o)&&o.children&&this.isList(o.children[0])&&o.insertBefore(this.createElement("BR"),o.children[0]),0===n.childNodes.length&&this.removeItem(n),o):u},mergeSameTags:function(e,t,i){const n=this,o=t?t.length:0;let l=null;return o&&(l=this._w.Array.apply(null,new this._w.Array(o)).map(this._w.Number.prototype.valueOf,0)),function e(r,s,a){const c=r.childNodes;for(let u,d,h=0,p=c.length;h=0;){if(n.getArrayIndex(l.childNodes,i)!==e[a]){c=!1;break}i=u.parentNode,l=i.parentNode,a--}c&&(e.splice(s,1),e[s]=h)}}n.copyTagAttributes(u,r),r.parentNode.insertBefore(u,r),n.removeItem(r)}if(!d){1===u.nodeType&&e(u,s+1,h);break}if(u.nodeName===d.nodeName&&n.isSameAttributes(u,d)&&u.href===d.href){const e=u.childNodes;let i=0;for(let t=0,n=e.length;t0&&i++;const r=u.lastChild,c=d.firstChild;let p=0;if(r&&c){const e=3===r.nodeType&&3===c.nodeType;p=r.textContent.length;let n=r.previousSibling;for(;n&&3===n.nodeType;)p+=n.textContent.length,n=n.previousSibling;if(i>0&&3===r.nodeType&&3===c.nodeType&&(r.textContent.length>0||c.textContent.length>0)&&i--,o){let n=null;for(let u=0;uh){if(s>0&&n[s-1]!==a)continue;n[s]-=1,n[s+1]>=0&&n[s]===h&&(n[s+1]+=i,e&&r&&3===r.nodeType&&c&&3===c.nodeType&&(l[u]+=p))}}}if(3===u.nodeType){if(p=u.textContent.length,u.textContent+=d.textContent,o){let e=null;for(let n=0;nh){if(s>0&&e[s-1]!==a)continue;e[s]-=1,e[s+1]>=0&&e[s]===h&&(e[s+1]+=i,l[n]+=p)}}}else u.innerHTML+=d.innerHTML;n.removeItem(d),h--}else 1===u.nodeType&&e(u,s+1,h)}}(e,0,0),l},mergeNestedTags:function(e,t){"string"==typeof t?t=function(e){return this.test(e.tagName)}.bind(new this._w.RegExp("^("+(t||".+")+")$","i")):"function"!=typeof t&&(t=function(){return!0}),function e(i){let n=i.children;if(1===n.length&&n[0].nodeName===i.nodeName&&t(i)){const e=n[0];for(n=e.children;n[0];)i.appendChild(n[0]);i.removeChild(e)}for(let t=0,n=i.children.length;t")},htmlRemoveWhiteSpace:function(e){return e?e.trim().replace(/<\/?(?!strong|span|font|b|var|i|em|u|ins|s|strike|del|sub|sup|mark|a|label|code|summary)[^>^<]+>\s+(?=<)/gi,(function(e){return e.replace(/\n/g,"").replace(/\s+/," ")})):""},htmlCompress:function(e){return e.replace(/\n/g,"").replace(/(>)(?:\s+)(<)/g,"$1$2")},sortByDepth:function(e,t){const i=t?1:-1,n=-1*i;e.sort(function(e,t){return this.isListCell(e)&&this.isListCell(t)?(e=this.getElementDepth(e))>(t=this.getElementDepth(t))?i:e]*>","gi")},createTagsBlacklist:function(e){return new RegExp("<\\/?\\b(?:\\b"+(e||"^").replace(/\|/g,"\\b|\\b")+"\\b)[^>]*>","gi")},_consistencyCheckOfHTML:function(e,t,i,n){const o=[],l=[],r=[],s=[],a=this.getListChildNodes(e,function(a){if(1!==a.nodeType)return this.isList(a.parentElement)&&o.push(a),!1;if(i.test(a.nodeName)||!t.test(a.nodeName)&&0===a.childNodes.length&&this.isNotCheckingNode(a))return o.push(a),!1;const c=!this.getParentElement(a,this.isNotCheckingNode);if(!this.isTable(a)&&!this.isListCell(a)&&!this.isAnchor(a)&&(this.isFormatElement(a)||this.isRangeFormatElement(a)||this.isTextStyleElement(a))&&0===a.childNodes.length&&c)return l.push(a),!1;if(this.isList(a.parentNode)&&!this.isList(a)&&!this.isListCell(a))return r.push(a),!1;if(this.isCell(a)){const e=a.firstElementChild;if(!this.isFormatElement(e)&&!this.isRangeFormatElement(e)&&!this.isComponent(e))return s.push(a),!1}if(c&&a.className){const e=new this._w.Array(a.classList).map(n).join(" ").trim();e?a.className=e:a.removeAttribute("class")}return a.parentNode!==e&&c&&(this.isListCell(a)&&!this.isList(a.parentNode)||(this.isFormatElement(a)||this.isComponent(a))&&!this.isRangeFormatElement(a.parentNode)&&!this.getParentElement(a,this.isComponent))}.bind(this));for(let e=0,t=o.length;e=0;o--)t.insertBefore(e,i[o]);c.push(e)}else t.parentNode.insertBefore(e,t),c.push(t);for(let e,t=0,i=c.length;t":e.innerHTML,e.innerHTML=t.outerHTML},_setDefaultOptionStyle:function(e,t){let i="";e.height&&(i+="height:"+e.height+";"),e.minHeight&&(i+="min-height:"+e.minHeight+";"),e.maxHeight&&(i+="max-height:"+e.maxHeight+";"),e.position&&(i+="position:"+e.position+";"),e.width&&(i+="width:"+e.width+";"),e.minWidth&&(i+="min-width:"+e.minWidth+";"),e.maxWidth&&(i+="max-width:"+e.maxWidth+";");let n="",o="",l="";const r=(t=i+t).split(";");for(let t,i=0,s=r.length;i'+this._setIframeCssTags(t),e.contentDocument.body.className=t._editableClass,e.contentDocument.body.setAttribute("contenteditable",!0),e.contentDocument.body.setAttribute("autocorrect","off")},_setIframeCssTags:function(e){const t=e.iframeCSSFileName,i=this._w.RegExp;let n="";for(let e,o=0,l=t.length;o'}return n+("auto"===e.height?"":"")}},$=G,K={init:function(e,t){"object"!=typeof t&&(t={});const i=document;this._initOptions(e,t);const n=i.createElement("DIV");n.className="sun-editor"+(t.rtl?" se-rtl":""),e.id&&(n.id="suneditor_"+e.id);const o=i.createElement("DIV");o.className="se-container";const l=this._createToolBar(i,t.buttonList,t.plugins,t),r=l.element.cloneNode(!1);r.className+=" se-toolbar-shadow",l.element.style.visibility="hidden",l.pluginCallButtons.math&&this._checkKatexMath(t.katex);const s=i.createElement("DIV");s.className="se-arrow";const a=i.createElement("DIV");a.className="se-toolbar-sticky-dummy";const c=i.createElement("DIV");c.className="se-wrapper";const u=this._initElements(t,n,l.element,s),d=u.bottomBar,h=u.wysiwygFrame,p=u.placeholder;let f=u.codeView;const g=d.resizingBar,m=d.navigation,v=d.charWrapper,b=d.charCounter,y=i.createElement("DIV");y.className="se-loading-box sun-editor-common",y.innerHTML='
    ';const w=i.createElement("DIV");w.className="se-line-breaker",w.innerHTML='";const _=i.createElement("DIV");_.className+="se-line-breaker-component";const x=_.cloneNode(!0);_.innerHTML=x.innerHTML=t.icons.line_break;const C=i.createElement("DIV");C.className="se-resizing-back";const k=i.createElement("INPUT");k.tabIndex=-1,k.style.cssText="position: absolute !important; top: -10000px !important; display: block !important; width: 0 !important; height: 0 !important; margin: 0 !important; padding: 0 !important;";const S=t.toolbarContainer;S&&(S.appendChild(l.element),S.appendChild(r));const L=t.resizingBarContainer;return g&&L&&L.appendChild(g),c.appendChild(f),p&&c.appendChild(p),S||(o.appendChild(l.element),o.appendChild(r)),o.appendChild(a),o.appendChild(c),o.appendChild(C),o.appendChild(y),o.appendChild(w),o.appendChild(_),o.appendChild(x),o.appendChild(k),g&&!L&&o.appendChild(g),n.appendChild(o),f=this._checkCodeMirror(t,f),{constructed:{_top:n,_relative:o,_toolBar:l.element,_toolbarShadow:r,_menuTray:l._menuTray,_editorArea:c,_wysiwygArea:h,_codeArea:f,_placeholder:p,_resizingBar:g,_navigation:m,_charWrapper:v,_charCounter:b,_loading:y,_lineBreaker:w,_lineBreaker_t:_,_lineBreaker_b:x,_resizeBack:C,_stickyDummy:a,_arrow:s,_focusTemp:k},options:t,plugins:l.plugins,pluginCallButtons:l.pluginCallButtons,_responsiveButtons:l.responsiveButtons}},_checkCodeMirror:function(e,t){if(e.codeMirror){const i=[{mode:"htmlmixed",htmlMode:!0,lineNumbers:!0,lineWrapping:!0},e.codeMirror.options||{}].reduce((function(e,t){for(let i in t)$.hasOwn(t,i)&&(e[i]=t[i]);return e}),{});"auto"===e.height&&(i.viewportMargin=1/0,i.height="auto");const n=e.codeMirror.src.fromTextArea(t,i);n.display.wrapper.style.cssText=t.style.cssText,e.codeMirrorEditor=n,(t=n.display.wrapper).className+=" se-wrapper-code-mirror"}return t},_checkKatexMath:function(e){if(!e)throw Error('[SUNEDITOR.create.fail] To use the math button you need to add a "katex" object to the options.');const t=[{throwOnError:!1},e.options||{}].reduce((function(e,t){for(let i in t)$.hasOwn(t,i)&&(e[i]=t[i]);return e}),{});e.options=t},_setOptions:function(e,t,i){this._initOptions(t.element.originElement,e);const n=t.element,o=n.relative,l=n.editorArea,r=e.toolbarContainer&&e.toolbarContainer!==i.toolbarContainer,s=e.lang!==i.lang||e.buttonList!==i.buttonList||e.mode!==i.mode||r,a=this._createToolBar(document,s?e.buttonList:i.buttonList,e.plugins,e);a.pluginCallButtons.math&&this._checkKatexMath(e.katex);const c=document.createElement("DIV");c.className="se-arrow",s&&(a.element.style.visibility="hidden",r?(e.toolbarContainer.appendChild(a.element),n.toolbar.parentElement.removeChild(n.toolbar)):n.toolbar.parentElement.replaceChild(a.element,n.toolbar),n.toolbar=a.element,n._menuTray=a._menuTray,n._arrow=c);const u=this._initElements(e,n.topArea,s?a.element:n.toolbar,c),d=u.bottomBar,h=u.wysiwygFrame,p=u.placeholder;let f=u.codeView;return n.resizingBar&&$.removeItem(n.resizingBar),d.resizingBar&&(e.resizingBarContainer&&e.resizingBarContainer!==i.resizingBarContainer?e.resizingBarContainer.appendChild(d.resizingBar):o.appendChild(d.resizingBar)),l.innerHTML="",l.appendChild(f),p&&l.appendChild(p),f=this._checkCodeMirror(e,f),n.resizingBar=d.resizingBar,n.navigation=d.navigation,n.charWrapper=d.charWrapper,n.charCounter=d.charCounter,n.wysiwygFrame=h,n.code=f,n.placeholder=p,e.rtl?$.addClass(n.topArea,"se-rtl"):$.removeClass(n.topArea,"se-rtl"),{callButtons:a.pluginCallButtons,plugins:a.plugins,toolbar:a}},_initElements:function(e,t,i,n){t.style.cssText=e._editorStyles.top,/inline/i.test(e.mode)?(i.className+=" se-toolbar-inline",i.style.width=e.toolbarWidth):/balloon/i.test(e.mode)&&(i.className+=" se-toolbar-balloon",i.style.width=e.toolbarWidth,i.appendChild(n));const o=document.createElement(e.iframe?"IFRAME":"DIV");if(o.className="se-wrapper-inner se-wrapper-wysiwyg",e.iframe)o.allowFullscreen=!0,o.frameBorder=0,o.style.cssText=e._editorStyles.frame,o.className+=e.className;else{o.setAttribute("contenteditable",!0),o.setAttribute("autocorrect","off"),o.setAttribute("scrolling","auto");for(let t in e.iframeAttributes)o.setAttribute(t,e.iframeAttributes[t]);o.className+=" "+e._editableClass,o.style.cssText=e._editorStyles.frame+e._editorStyles.editor,o.className+=e.className}const l=document.createElement("TEXTAREA");l.className="se-wrapper-inner se-wrapper-code"+e.className,l.style.cssText=e._editorStyles.frame,l.style.display="none","auto"===e.height&&(l.style.overflow="hidden");let r=null,s=null,a=null,c=null;if(e.resizingBar&&(r=document.createElement("DIV"),r.className="se-resizing-bar sun-editor-common",s=document.createElement("DIV"),s.className="se-navigation sun-editor-common",r.appendChild(s),e.charCounter)){if(a=document.createElement("DIV"),a.className="se-char-counter-wrapper",e.charCounterLabel){const t=document.createElement("SPAN");t.className="se-char-label",t.textContent=e.charCounterLabel,a.appendChild(t)}if(c=document.createElement("SPAN"),c.className="se-char-counter",c.textContent="0",a.appendChild(c),e.maxCharCount>0){const t=document.createElement("SPAN");t.textContent=" / "+e.maxCharCount,a.appendChild(t)}r.appendChild(a)}let u=null;return e.placeholder&&(u=document.createElement("SPAN"),u.className="se-placeholder",u.innerText=e.placeholder),{bottomBar:{resizingBar:r,navigation:s,charWrapper:a,charCounter:c},wysiwygFrame:o,codeView:l,placeholder:u}},_initOptions:function(e,t){const i={};if(t.plugins){const e=t.plugins,n=e.length?e:Object.keys(e).map((function(t){return e[t]}));for(let e,t=0,o=n.length;t0?t.defaultTag:"p";const n=t.textTags=[{bold:"STRONG",underline:"U",italic:"EM",strike:"DEL",sub:"SUB",sup:"SUP"},t.textTags||{}].reduce((function(e,t){for(let i in t)e[i]=t[i];return e}),{});t._textTagsMap={strong:n.bold.toLowerCase(),b:n.bold.toLowerCase(),u:n.underline.toLowerCase(),ins:n.underline.toLowerCase(),em:n.italic.toLowerCase(),i:n.italic.toLowerCase(),del:n.strike.toLowerCase(),strike:n.strike.toLowerCase(),s:n.strike.toLowerCase(),sub:n.sub.toLowerCase(),sup:n.sup.toLowerCase()},t._defaultCommand={bold:t.textTags.bold,underline:t.textTags.underline,italic:t.textTags.italic,strike:t.textTags.strike,subscript:t.textTags.sub,superscript:t.textTags.sup},t.__allowedScriptTag=!0===t.__allowedScriptTag;t.tagsBlacklist=t.tagsBlacklist||"",t._defaultTagsWhitelist=("string"==typeof t._defaultTagsWhitelist?t._defaultTagsWhitelist:"br|p|div|pre|blockquote|h1|h2|h3|h4|h5|h6|ol|ul|li|hr|figure|figcaption|img|iframe|audio|video|source|table|thead|tbody|tr|th|td|a|b|strong|var|i|em|u|ins|s|span|strike|del|sub|sup|code|svg|path|details|summary")+(t.__allowedScriptTag?"|script":""),t._editorTagsWhitelist="*"===t.addTagsWhitelist?"*":this._setWhitelist(t._defaultTagsWhitelist+("string"==typeof t.addTagsWhitelist&&t.addTagsWhitelist.length>0?"|"+t.addTagsWhitelist:""),t.tagsBlacklist),t.pasteTagsBlacklist=t.tagsBlacklist+(t.tagsBlacklist&&t.pasteTagsBlacklist?"|"+t.pasteTagsBlacklist:t.pasteTagsBlacklist||""),t.pasteTagsWhitelist="*"===t.pasteTagsWhitelist?"*":this._setWhitelist("string"==typeof t.pasteTagsWhitelist?t.pasteTagsWhitelist:t._editorTagsWhitelist,t.pasteTagsBlacklist),t.attributesWhitelist=t.attributesWhitelist&&"object"==typeof t.attributesWhitelist?t.attributesWhitelist:null,t.attributesBlacklist=t.attributesBlacklist&&"object"==typeof t.attributesBlacklist?t.attributesBlacklist:null,t.mode=t.mode||"classic",t.rtl=!!t.rtl,t.lineAttrReset=["id"].concat(t.lineAttrReset&&"string"==typeof t.lineAttrReset?t.lineAttrReset.toLowerCase().split("|"):[]),t._editableClass="sun-editor-editable"+(t.rtl?" se-rtl":""),t._printClass="string"==typeof t._printClass?t._printClass:null,t.toolbarWidth=t.toolbarWidth?$.isNumber(t.toolbarWidth)?t.toolbarWidth+"px":t.toolbarWidth:"auto",t.toolbarContainer="string"==typeof t.toolbarContainer?document.querySelector(t.toolbarContainer):t.toolbarContainer,t.stickyToolbar=/balloon/i.test(t.mode)||t.toolbarContainer?-1:void 0===t.stickyToolbar?0:/^\d+/.test(t.stickyToolbar)?$.getNumber(t.stickyToolbar,0):-1,t.hideToolbar=!!t.hideToolbar,t.fullScreenOffset=void 0===t.fullScreenOffset?0:/^\d+/.test(t.fullScreenOffset)?$.getNumber(t.fullScreenOffset,0):0,t.fullPage=!!t.fullPage,t.iframe=t.fullPage||!!t.iframe,t.iframeAttributes=t.iframeAttributes||{},t.iframeCSSFileName=t.iframe?"string"==typeof t.iframeCSSFileName?[t.iframeCSSFileName]:t.iframeCSSFileName||["suneditor"]:null,t.previewTemplate="string"==typeof t.previewTemplate?t.previewTemplate:null,t.printTemplate="string"==typeof t.printTemplate?t.printTemplate:null,t.codeMirror=t.codeMirror?t.codeMirror.src?t.codeMirror:{src:t.codeMirror}:null,t.katex=t.katex?t.katex.src?t.katex:{src:t.katex}:null,t.mathFontSize=t.mathFontSize?t.mathFontSize:[{text:"1",value:"1em"},{text:"1.5",value:"1.5em"},{text:"2",value:"2em"},{text:"2.5",value:"2.5em"}],t.position="string"==typeof t.position?t.position:null,t.display=t.display||("none"!==e.style.display&&e.style.display?e.style.display:"block"),t.popupDisplay=t.popupDisplay||"full",t.resizingBar=void 0===t.resizingBar?!/inline|balloon/i.test(t.mode):t.resizingBar,t.showPathLabel=!!t.resizingBar&&("boolean"!=typeof t.showPathLabel||t.showPathLabel),t.resizeEnable=void 0===t.resizeEnable||!!t.resizeEnable,t.resizingBarContainer="string"==typeof t.resizingBarContainer?document.querySelector(t.resizingBarContainer):t.resizingBarContainer,t.charCounter=t.maxCharCount>0||"boolean"==typeof t.charCounter&&t.charCounter,t.charCounterType="string"==typeof t.charCounterType?t.charCounterType:"char",t.charCounterLabel="string"==typeof t.charCounterLabel?t.charCounterLabel.trim():null,t.maxCharCount=$.isNumber(t.maxCharCount)&&t.maxCharCount>-1?1*t.maxCharCount:null,t.width=t.width?$.isNumber(t.width)?t.width+"px":t.width:e.clientWidth?e.clientWidth+"px":"100%",t.minWidth=($.isNumber(t.minWidth)?t.minWidth+"px":t.minWidth)||"",t.maxWidth=($.isNumber(t.maxWidth)?t.maxWidth+"px":t.maxWidth)||"",t.height=t.height?$.isNumber(t.height)?t.height+"px":t.height:e.clientHeight?e.clientHeight+"px":"auto",t.minHeight=($.isNumber(t.minHeight)?t.minHeight+"px":t.minHeight)||"",t.maxHeight=($.isNumber(t.maxHeight)?t.maxHeight+"px":t.maxHeight)||"",t.className="string"==typeof t.className&&t.className.length>0?" "+t.className:"",t.defaultStyle="string"==typeof t.defaultStyle?t.defaultStyle:"",t.font=t.font?t.font:["Arial","Comic Sans MS","Courier New","Impact","Georgia","tahoma","Trebuchet MS","Verdana"],t.fontSize=t.fontSize?t.fontSize:null,t.formats=t.formats?t.formats:null,t.colorList=t.colorList?t.colorList:null,t.lineHeights=t.lineHeights?t.lineHeights:null,t.paragraphStyles=t.paragraphStyles?t.paragraphStyles:null,t.textStyles=t.textStyles?t.textStyles:null,t.fontSizeUnit="string"==typeof t.fontSizeUnit&&t.fontSizeUnit.trim().toLowerCase()||"px",t.alignItems="object"==typeof t.alignItems?t.alignItems:t.rtl?["right","center","left","justify"]:["left","center","right","justify"],t.imageResizing=void 0===t.imageResizing||t.imageResizing,t.imageHeightShow=void 0===t.imageHeightShow||!!t.imageHeightShow,t.imageAlignShow=void 0===t.imageAlignShow||!!t.imageAlignShow,t.imageWidth=t.imageWidth?$.isNumber(t.imageWidth)?t.imageWidth+"px":t.imageWidth:"auto",t.imageHeight=t.imageHeight?$.isNumber(t.imageHeight)?t.imageHeight+"px":t.imageHeight:"auto",t.imageSizeOnlyPercentage=!!t.imageSizeOnlyPercentage,t._imageSizeUnit=t.imageSizeOnlyPercentage?"%":"px",t.imageRotation=void 0!==t.imageRotation?t.imageRotation:!(t.imageSizeOnlyPercentage||!t.imageHeightShow),t.imageFileInput=void 0===t.imageFileInput||t.imageFileInput,t.imageUrlInput=void 0===t.imageUrlInput||!t.imageFileInput||t.imageUrlInput,t.imageUploadHeader=t.imageUploadHeader||null,t.imageUploadUrl="string"==typeof t.imageUploadUrl?t.imageUploadUrl:null,t.imageUploadSizeLimit=/\d+/.test(t.imageUploadSizeLimit)?$.getNumber(t.imageUploadSizeLimit,0):null,t.imageMultipleFile=!!t.imageMultipleFile,t.imageAccept="string"!=typeof t.imageAccept||"*"===t.imageAccept.trim()?"image/*":t.imageAccept.trim()||"image/*",t.imageGalleryUrl="string"==typeof t.imageGalleryUrl?t.imageGalleryUrl:null,t.imageGalleryHeader=t.imageGalleryHeader||null,t.videoResizing=void 0===t.videoResizing||t.videoResizing,t.videoHeightShow=void 0===t.videoHeightShow||!!t.videoHeightShow,t.videoAlignShow=void 0===t.videoAlignShow||!!t.videoAlignShow,t.videoRatioShow=void 0===t.videoRatioShow||!!t.videoRatioShow,t.videoWidth=t.videoWidth&&$.getNumber(t.videoWidth,0)?$.isNumber(t.videoWidth)?t.videoWidth+"px":t.videoWidth:"",t.videoHeight=t.videoHeight&&$.getNumber(t.videoHeight,0)?$.isNumber(t.videoHeight)?t.videoHeight+"px":t.videoHeight:"",t.videoSizeOnlyPercentage=!!t.videoSizeOnlyPercentage,t._videoSizeUnit=t.videoSizeOnlyPercentage?"%":"px",t.videoRotation=void 0!==t.videoRotation?t.videoRotation:!(t.videoSizeOnlyPercentage||!t.videoHeightShow),t.videoRatio=$.getNumber(t.videoRatio,4)||.5625,t.videoRatioList=t.videoRatioList?t.videoRatioList:null,t.youtubeQuery=(t.youtubeQuery||"").replace("?",""),t.videoFileInput=!!t.videoFileInput,t.videoUrlInput=void 0===t.videoUrlInput||!t.videoFileInput||t.videoUrlInput,t.videoUploadHeader=t.videoUploadHeader||null,t.videoUploadUrl="string"==typeof t.videoUploadUrl?t.videoUploadUrl:null,t.videoUploadSizeLimit=/\d+/.test(t.videoUploadSizeLimit)?$.getNumber(t.videoUploadSizeLimit,0):null,t.videoMultipleFile=!!t.videoMultipleFile,t.videoTagAttrs=t.videoTagAttrs||null,t.videoIframeAttrs=t.videoIframeAttrs||null,t.videoAccept="string"!=typeof t.videoAccept||"*"===t.videoAccept.trim()?"video/*":t.videoAccept.trim()||"video/*",t.audioWidth=t.audioWidth?$.isNumber(t.audioWidth)?t.audioWidth+"px":t.audioWidth:"",t.audioHeight=t.audioHeight?$.isNumber(t.audioHeight)?t.audioHeight+"px":t.audioHeight:"",t.audioFileInput=!!t.audioFileInput,t.audioUrlInput=void 0===t.audioUrlInput||!t.audioFileInput||t.audioUrlInput,t.audioUploadHeader=t.audioUploadHeader||null,t.audioUploadUrl="string"==typeof t.audioUploadUrl?t.audioUploadUrl:null,t.audioUploadSizeLimit=/\d+/.test(t.audioUploadSizeLimit)?$.getNumber(t.audioUploadSizeLimit,0):null,t.audioMultipleFile=!!t.audioMultipleFile,t.audioTagAttrs=t.audioTagAttrs||null,t.audioAccept="string"!=typeof t.audioAccept||"*"===t.audioAccept.trim()?"audio/*":t.audioAccept.trim()||"audio/*",t.tableCellControllerPosition="string"==typeof t.tableCellControllerPosition?t.tableCellControllerPosition.toLowerCase():"cell",t.linkTargetNewWindow=!!t.linkTargetNewWindow,t.linkProtocol="string"==typeof t.linkProtocol?t.linkProtocol:null,t.linkRel=Array.isArray(t.linkRel)?t.linkRel:[],t.linkRelDefault=t.linkRelDefault||{},t.tabDisable=!!t.tabDisable,t.shortcutsDisable=Array.isArray(t.shortcutsDisable)?t.shortcutsDisable:[],t.shortcutsHint=void 0===t.shortcutsHint||!!t.shortcutsHint,t.callBackSave=t.callBackSave?t.callBackSave:null,t.templates=t.templates?t.templates:null,t.placeholder="string"==typeof t.placeholder?t.placeholder:null,t.mediaAutoSelect=void 0===t.mediaAutoSelect||!!t.mediaAutoSelect,t.buttonList=t.buttonList?t.buttonList:[["undo","redo"],["bold","underline","italic","strike","subscript","superscript"],["removeFormat"],["outdent","indent"],["fullScreen","showBlocks","codeView"],["preview","print"]],t.rtl&&(t.buttonList=t.buttonList.reverse()),t.icons=t.icons&&"object"==typeof t.icons?[j,t.icons].reduce((function(e,t){for(let i in t)$.hasOwn(t,i)&&(e[i]=t[i]);return e}),{}):j,t.icons=t.rtl?[t.icons,t.icons.rtl].reduce((function(e,t){for(let i in t)$.hasOwn(t,i)&&(e[i]=t[i]);return e}),{}):t.icons,t.__listCommonStyle=t.__listCommonStyle||["fontSize","color","fontFamily","fontWeight","fontStyle"],t._editorStyles=$._setDefaultOptionStyle(t,t.defaultStyle)},_setWhitelist:function(e,t){if("string"!=typeof t)return e;t=t.split("|"),e=e.split("|");for(let i,n=0,o=t.length;n-1&&e.splice(i,1);return e.join("|")},_defaultButtons:function(e){const t=e.icons,i=e.lang,n=$.isOSX_IOS?"⌘":"CTRL",o=$.isOSX_IOS?"⇧":"+SHIFT",l=e.shortcutsHint?e.shortcutsDisable:["bold","strike","underline","italic","undo","indent","save"],r=e.rtl?["[","]"]:["]","["],s=e.rtl?[t.outdent,t.indent]:[t.indent,t.outdent];return{bold:["",i.toolbar.bold+''+(l.indexOf("bold")>-1?"":n+'+B')+"","bold","",t.bold],underline:["",i.toolbar.underline+''+(l.indexOf("underline")>-1?"":n+'+U')+"","underline","",t.underline],italic:["",i.toolbar.italic+''+(l.indexOf("italic")>-1?"":n+'+I')+"","italic","",t.italic],strike:["",i.toolbar.strike+''+(l.indexOf("strike")>-1?"":n+o+'+S')+"","strike","",t.strike],subscript:["",i.toolbar.subscript,"SUB","",t.subscript],superscript:["",i.toolbar.superscript,"SUP","",t.superscript],removeFormat:["",i.toolbar.removeFormat,"removeFormat","",t.erase],indent:["",i.toolbar.indent+''+(l.indexOf("indent")>-1?"":n+'+'+r[0]+"")+"","indent","",s[0]],outdent:["",i.toolbar.outdent+''+(l.indexOf("indent")>-1?"":n+'+'+r[1]+"")+"","outdent","",s[1]],fullScreen:["se-code-view-enabled se-resizing-enabled",i.toolbar.fullScreen,"fullScreen","",t.expansion],showBlocks:["",i.toolbar.showBlocks,"showBlocks","",t.show_blocks],codeView:["se-code-view-enabled se-resizing-enabled",i.toolbar.codeView,"codeView","",t.code_view],undo:["",i.toolbar.undo+''+(l.indexOf("undo")>-1?"":n+'+Z')+"","undo","",t.undo],redo:["",i.toolbar.redo+''+(l.indexOf("undo")>-1?"":n+'+Y / '+n+o+'+Z')+"","redo","",t.redo],preview:["se-resizing-enabled",i.toolbar.preview,"preview","",t.preview],print:["se-resizing-enabled",i.toolbar.print,"print","",t.print],dir:["",i.toolbar[e.rtl?"dir_ltr":"dir_rtl"],"dir","",t[e.rtl?"dir_ltr":"dir_rtl"]],dir_ltr:["",i.toolbar.dir_ltr,"dir_ltr","",t.dir_ltr],dir_rtl:["",i.toolbar.dir_rtl,"dir_rtl","",t.dir_rtl],save:["se-resizing-enabled",i.toolbar.save+''+(l.indexOf("save")>-1?"":n+'+S')+"","save","",t.save],blockquote:["",i.toolbar.tag_blockquote,"blockquote","command",t.blockquote],font:["se-btn-select se-btn-tool-font",i.toolbar.font,"font","submenu",''+i.toolbar.font+""+t.arrow_down],formatBlock:["se-btn-select se-btn-tool-format",i.toolbar.formats,"formatBlock","submenu",''+i.toolbar.formats+""+t.arrow_down],fontSize:["se-btn-select se-btn-tool-size",i.toolbar.fontSize,"fontSize","submenu",''+i.toolbar.fontSize+""+t.arrow_down],fontColor:["",i.toolbar.fontColor,"fontColor","submenu",t.font_color],hiliteColor:["",i.toolbar.hiliteColor,"hiliteColor","submenu",t.highlight_color],align:["se-btn-align",i.toolbar.align,"align","submenu",e.rtl?t.align_right:t.align_left],list:["",i.toolbar.list,"list","submenu",t.list_number],horizontalRule:["btn_line",i.toolbar.horizontalRule,"horizontalRule","submenu",t.horizontal_rule],table:["",i.toolbar.table,"table","submenu",t.table],lineHeight:["",i.toolbar.lineHeight,"lineHeight","submenu",t.line_height],template:["",i.toolbar.template,"template","submenu",t.template],paragraphStyle:["",i.toolbar.paragraphStyle,"paragraphStyle","submenu",t.paragraph_style],textStyle:["",i.toolbar.textStyle,"textStyle","submenu",t.text_style],link:["",i.toolbar.link,"link","dialog",t.link],image:["",i.toolbar.image,"image","dialog",t.image],video:["",i.toolbar.video,"video","dialog",t.video],audio:["",i.toolbar.audio,"audio","dialog",t.audio],math:["",i.toolbar.math,"math","dialog",t.math],imageGallery:["",i.toolbar.imageGallery,"imageGallery","fileBrowser",t.image_gallery]}},_createModuleGroup:function(){const e=$.createElement("DIV");e.className="se-btn-module se-btn-module-border";const t=$.createElement("UL");return t.className="se-menu-list",e.appendChild(t),{div:e,ul:t}},_createButton:function(e,t,i,n,o,l,r){const s=$.createElement("LI"),a=$.createElement("BUTTON"),c=t||i;return a.setAttribute("type","button"),a.setAttribute("class","se-btn"+(e?" "+e:"")+" se-tooltip"),a.setAttribute("data-command",i),a.setAttribute("data-display",n),a.setAttribute("aria-label",c.replace(//,"")),a.setAttribute("tabindex","-1"),o||(o='!'),/^default\./i.test(o)&&(o=r[o.replace(/^default\./i,"")]),/^text\./i.test(o)&&(o=o.replace(/^text\./i,""),a.className+=" se-btn-more-text"),o+=''+c+"",l&&a.setAttribute("disabled",!0),a.innerHTML=o,s.appendChild(a),{li:s,button:a}},_createToolBar:function(e,t,i,n){const o=e.createElement("DIV");o.className="se-toolbar-separator-vertical";const l=e.createElement("DIV");l.className="se-toolbar sun-editor-common";const r=e.createElement("DIV");r.className="se-btn-tray",l.appendChild(r),t=JSON.parse(JSON.stringify(t));const s=n.icons,a=this._defaultButtons(n),c={},u=[];let d=null,h=null,p=null,f=null,g="",m=!1;const v=$.createElement("DIV");v.className="se-toolbar-more-layer";e:for(let n,l,b,y,w,_=0;_",v.appendChild(l),l=l.firstElementChild.firstElementChild)}if(m){const e=o.cloneNode(!1);r.appendChild(e)}r.appendChild(p.div),m=!0}else if(/^\/$/.test(y)){const t=e.createElement("DIV");t.className="se-btn-module-enter",r.appendChild(t),m=!1}switch(r.children.length){case 0:r.style.display="none";break;case 1:$.removeClass(r.firstElementChild,"se-btn-module-border");break;default:if(n.rtl){const e=o.cloneNode(!1);e.style.float=r.lastElementChild.style.float,r.appendChild(e)}}u.length>0&&u.unshift(t),v.children.length>0&&r.appendChild(v);const b=e.createElement("DIV");b.className="se-menu-tray",l.appendChild(b);const y=e.createElement("DIV");return y.className="se-toolbar-cover",l.appendChild(y),n.hideToolbar&&(l.style.display="none"),{element:l,plugins:i,pluginCallButtons:c,responsiveButtons:u,_menuTray:b,_buttonTray:r}}},Y=function(e,t,i){return{element:{originElement:e,topArea:t._top,relative:t._relative,toolbar:t._toolBar,_toolbarShadow:t._toolbarShadow,_buttonTray:t._toolBar.querySelector(".se-btn-tray"),_menuTray:t._menuTray,resizingBar:t._resizingBar,navigation:t._navigation,charWrapper:t._charWrapper,charCounter:t._charCounter,editorArea:t._editorArea,wysiwygFrame:t._wysiwygArea,wysiwyg:t._wysiwygArea,code:t._codeArea,placeholder:t._placeholder,loading:t._loading,lineBreaker:t._lineBreaker,lineBreaker_t:t._lineBreaker_t,lineBreaker_b:t._lineBreaker_b,resizeBackground:t._resizeBack,_stickyDummy:t._stickyDummy,_arrow:t._arrow,_focusTemp:t._focusTemp},tool:{cover:t._toolBar.querySelector(".se-toolbar-cover"),bold:t._toolBar.querySelector('[data-command="bold"]'),underline:t._toolBar.querySelector('[data-command="underline"]'),italic:t._toolBar.querySelector('[data-command="italic"]'),strike:t._toolBar.querySelector('[data-command="strike"]'),sub:t._toolBar.querySelector('[data-command="SUB"]'),sup:t._toolBar.querySelector('[data-command="SUP"]'),undo:t._toolBar.querySelector('[data-command="undo"]'),redo:t._toolBar.querySelector('[data-command="redo"]'),save:t._toolBar.querySelector('[data-command="save"]'),outdent:t._toolBar.querySelector('[data-command="outdent"]'),indent:t._toolBar.querySelector('[data-command="indent"]'),fullScreen:t._toolBar.querySelector('[data-command="fullScreen"]'),showBlocks:t._toolBar.querySelector('[data-command="showBlocks"]'),codeView:t._toolBar.querySelector('[data-command="codeView"]'),dir:t._toolBar.querySelector('[data-command="dir"]'),dir_ltr:t._toolBar.querySelector('[data-command="dir_ltr"]'),dir_rtl:t._toolBar.querySelector('[data-command="dir_rtl"]')},options:i,option:i}};const X={name:"notice",add:function(e){const t=e.context;t.notice={};let i=e.util.createElement("DIV"),n=e.util.createElement("SPAN"),o=e.util.createElement("BUTTON");i.className="se-notice",o.className="close",o.setAttribute("aria-label","Close"),o.setAttribute("title",e.lang.dialogBox.close),o.innerHTML=e.icons.cancel,i.appendChild(n),i.appendChild(o),t.notice.modal=i,t.notice.message=n,o.addEventListener("click",this.onClick_cancel.bind(e)),t.element.editorArea.appendChild(i),i=null},onClick_cancel:function(e){e.preventDefault(),e.stopPropagation(),this.plugins.notice.close.call(this)},open:function(e){this.context.notice.message.textContent=e,this.context.notice.modal.style.display="block"},close:function(){this.context.notice.modal.style.display="none"}};const J={init:function(e){return{create:function(t,i){return this.create(t,i,e)}.bind(this)}},create:function(e,t,i){$._propertiesInit(),"object"!=typeof t&&(t={}),i&&(t=[i,t].reduce((function(e,t){for(let i in t)if($.hasOwn(t,i))if("plugins"===i&&t[i]&&e[i]){let n=e[i],o=t[i];n=n.length?n:Object.keys(n).map((function(e){return n[e]})),o=o.length?o:Object.keys(o).map((function(e){return o[e]})),e[i]=o.filter((function(e){return-1===n.indexOf(e)})).concat(n)}else e[i]=t[i];return e}),{}));const n="string"==typeof e?document.getElementById(e):e;if(!n){if("string"==typeof e)throw Error('[SUNEDITOR.create.fail] The element for that id was not found (ID:"'+e+'")');throw Error("[SUNEDITOR.create.fail] suneditor requires textarea's element or id value")}const o=K.init(n,t);if(o.constructed._top.id&&document.getElementById(o.constructed._top.id))throw Error('[SUNEDITOR.create.fail] The ID of the suneditor you are trying to create already exists (ID:"'+o.constructed._top.id+'")');return function(e,t,i,n,o,l){const r=e.element.originElement.ownerDocument||document,s=r.defaultView||window,a=$,c=o.icons,u={_d:r,_w:s,_parser:new s.DOMParser,_prevRtl:o.rtl,_editorHeight:0,_editorHeightPadding:0,_listCamel:o.__listCommonStyle,_listKebab:a.camelToKebabCase(o.__listCommonStyle),__focusTemp:e.element._focusTemp,_wd:null,_ww:null,_shadowRoot:null,_shadowRootControllerEventTarget:null,util:a,functions:null,options:null,wwComputedStyle:null,notice:X,icons:c,history:null,context:e,pluginCallButtons:t,plugins:i||{},initPlugins:{},_targetPlugins:{},_menuTray:{},lang:n,effectNode:null,submenu:null,container:null,_submenuName:"",_bindedSubmenuOff:null,_bindedContainerOff:null,submenuActiveButton:null,containerActiveButton:null,controllerArray:[],currentControllerName:"",currentControllerTarget:null,currentFileComponentInfo:null,codeViewDisabledButtons:[],resizingDisabledButtons:[],_moreLayerActiveButton:null,_htmlCheckWhitelistRegExp:null,_htmlCheckBlacklistRegExp:null,_disallowedTextTagsRegExp:null,editorTagsWhitelistRegExp:null,editorTagsBlacklistRegExp:null,pasteTagsWhitelistRegExp:null,pasteTagsBlacklistRegExp:null,hasFocus:!1,isDisabled:!1,isReadOnly:!1,_attributesWhitelistRegExp:null,_attributesWhitelistRegExp_all_data:null,_attributesBlacklistRegExp:null,_attributesTagsWhitelist:null,_attributesTagsBlacklist:null,_bindControllersOff:null,_isInline:null,_isBalloon:null,_isBalloonAlways:null,_inlineToolbarAttr:{top:"",width:"",isShow:!1},_notHideToolbar:!1,_sticky:!1,_antiBlur:!1,_lineBreaker:null,_lineBreakerButton:null,_componentsInfoInit:!0,_componentsInfoReset:!1,activePlugins:null,managedTagsInfo:null,_charTypeHTML:!1,_fileInfoPluginsCheck:null,_fileInfoPluginsReset:null,_fileManager:{tags:null,regExp:null,queryString:null,pluginRegExp:null,pluginMap:null},commandMap:{},_commandMapStyles:{STRONG:["font-weight"],U:["text-decoration"],EM:["font-style"],DEL:["text-decoration"]},_styleCommandMap:null,_cleanStyleRegExp:{div:new s.RegExp("\\s*[^-a-zA-Z](.+)\\s*:[^;]+(?!;)*","ig"),span:new s.RegExp("\\s*[^-a-zA-Z](font-family|font-size|color|background-color)\\s*:[^;]+(?!;)*","ig"),format:new s.RegExp("\\s*[^-a-zA-Z](text-align|margin-left|margin-right|width|height|line-height)\\s*:[^;]+(?!;)*","ig"),fontSizeUnit:new s.RegExp("\\d+"+o.fontSizeUnit+"$","i")},_variable:{isChanged:!1,isCodeView:!1,isFullScreen:!1,innerHeight_fullScreen:0,resizeClientY:0,tabSize:4,codeIndent:2,minResizingSize:a.getNumber(e.element.wysiwygFrame.style.minHeight||"65",0),currentNodes:[],currentNodesMap:[],_range:null,_selectionNode:null,_originCssText:e.element.topArea.style.cssText,_bodyOverflow:"",_editorAreaOriginCssText:"",_wysiwygOriginCssText:"",_codeOriginCssText:"",_fullScreenAttrs:{sticky:!1,balloon:!1,inline:!1},_lineBreakComp:null,_lineBreakDir:""},_formatAttrsTemp:null,_saveButtonStates:function(){this.allCommandButtons||(this.allCommandButtons={});const e=this.context.element._buttonTray.querySelectorAll(".se-menu-list button[data-display]");for(let t,i,n=0;ne?c-e:0,o=n>0?0:e-c;i.style.left=u-n+o+"px",r.left>d._getEditorOffsets(i).left&&(i.style.left="0px")}else{const e=l<=c?0:l-(u+c);i.style.left=e<0?u+e+"px":u+"px"}let h=0,p=t;for(;p&&p!==n;)h+=p.offsetTop,p=p.offsetParent;const f=h;this._isBalloon?h+=n.offsetTop+t.offsetHeight:h-=t.offsetHeight;const g=r.top,m=i.offsetHeight,v=this.getGlobalScrollOffset().top,b=s.innerHeight-(g-v+f+t.parentElement.offsetHeight);if(bb?(i.style.height=o+"px",e=-1*(o-f+3)):(i.style.height=b+"px",e=f+t.parentElement.offsetHeight),i.style.top=e+"px"}else i.style.top=f+t.parentElement.offsetHeight+"px";i.style.visibility=""},controllersOn:function(){this._bindControllersOff&&this._bindControllersOff(),this.controllerArray=[];for(let e,t=0;t0)for(let e=0;e0){for(let e=0;ed?u-d:0,n=i>0?0:d-u;t.style.left=c-i+n+"px",i>0&&h&&(h.style.left=(u-14<10+i?u-14:10+i)+"px");const o=e.element.wysiwygFrame.offsetLeft-t.offsetLeft;o>0&&(t.style.left="0px",h&&(h.style.left=o+"px"))}else{t.style.left=c+"px";const i=e.element.wysiwygFrame.offsetWidth-(t.offsetLeft+u);i<0?(t.style.left=t.offsetLeft+i+"px",h&&(h.style.left=20-i+"px")):h&&(h.style.left="20px")}t.style.visibility=""},execCommand:function(e,t,i){this._wd.execCommand(e,t,"formatBlock"===e?"<"+i+">":i),this.history.push(!0)},nativeFocus:function(){this.__focus(),this._editorRange()},__focus:function(){const t=a.getParentElement(this.getSelectionNode(),"figcaption");t?t.focus():e.element.wysiwyg.focus()},focus:function(){if("none"!==e.element.wysiwygFrame.style.display){if(o.iframe)this.nativeFocus();else try{const t=this.getRange();if(t.startContainer===t.endContainer&&a.isWysiwygDiv(t.startContainer)){const i=t.commonAncestorContainer.children[t.startOffset];if(!a.isFormatElement(i)&&!a.isComponent(i)){const t=a.createElement(o.defaultTag),n=a.createElement("BR");return t.appendChild(n),e.element.wysiwyg.insertBefore(t,i),void this.setRange(n,0,n,0)}}this.setRange(t.startContainer,t.startOffset,t.endContainer,t.endOffset)}catch(e){this.nativeFocus()}d._applyTagEffects(),this._isBalloon&&d._toggleToolbarBalloon()}},focusEdge:function(t){t||(t=e.element.wysiwyg.lastElementChild);const i=this.getFileComponent(t);i?this.selectComponent(i.target,i.pluginName):t?(t=a.getChildElement(t,(function(e){return 0===e.childNodes.length||3===e.nodeType}),!0))?this.setRange(t,t.textContent.length,t,t.textContent.length):this.nativeFocus():this.focus()},blur:function(){o.iframe?e.element.wysiwygFrame.blur():e.element.wysiwyg.blur()},setRange:function(e,t,i,n){if(!e||!i)return;t>e.textContent.length&&(t=e.textContent.length),n>i.textContent.length&&(n=i.textContent.length),a.isFormatElement(e)&&(e=e.childNodes[t]||e.childNodes[t-1]||e,t=t>0?1===e.nodeType?1:e.textContent?e.textContent.length:0:0),a.isFormatElement(i)&&(i=i.childNodes[n]||i.childNodes[n-1]||i,n=n>0?1===i.nodeType?1:i.textContent?i.textContent.length:0:0);const l=this._wd.createRange();try{l.setStart(e,t),l.setEnd(i,n)}catch(e){return console.warn("[SUNEDITOR.core.focus.error] "+e),void this.nativeFocus()}const r=this.getSelection();return r.removeAllRanges&&r.removeAllRanges(),r.addRange(l),this._rangeInfo(l,this.getSelection()),o.iframe&&this.__focus(),l},removeRange:function(){this._variable._range=null,this._variable._selectionNode=null,this.hasFocus&&this.getSelection().removeAllRanges(),this._setKeyEffect([])},getRange:function(){const t=this._variable._range||this._createDefaultRange(),i=this.getSelection();if(t.collapsed===i.isCollapsed||!e.element.wysiwyg.contains(i.focusNode))return t;if(i.rangeCount>0)return this._variable._range=i.getRangeAt(0),this._variable._range;{const e=i.anchorNode,t=i.focusNode,n=i.anchorOffset,o=i.focusOffset,l=a.compareElements(e,t),r=l.ancestor&&(0===l.result?n<=o:l.result>1);return this.setRange(r?e:t,r?n:o,r?t:e,r?o:n)}},getRange_addLine:function(t,i){if(this._selectionVoid(t)){const n=e.element.wysiwyg,l=a.createElement(o.defaultTag);l.innerHTML="
    ",n.insertBefore(l,i&&i!==n?i.nextElementSibling:n.firstElementChild),this.setRange(l.firstElementChild,0,l.firstElementChild,1),t=this._variable._range}return t},getSelection:function(){const t=this._shadowRoot&&this._shadowRoot.getSelection?this._shadowRoot.getSelection():this._ww.getSelection();return this._variable._range||e.element.wysiwyg.contains(t.focusNode)||(t.removeAllRanges(),t.addRange(this._createDefaultRange())),t},getSelectionNode:function(){if(e.element.wysiwyg.contains(this._variable._selectionNode)||this._editorRange(),!this._variable._selectionNode){const t=a.getChildElement(e.element.wysiwyg.firstChild,(function(e){return 0===e.childNodes.length||3===e.nodeType}),!1);if(t)return this._variable._selectionNode=t,t;this._editorRange()}return this._variable._selectionNode},_editorRange:function(){const e=this._wd.activeElement;if(a.isInputElement(e))return this._variable._selectionNode=e,e;const t=this.getSelection();if(!t)return null;let i=null;i=t.rangeCount>0?t.getRangeAt(0):this._createDefaultRange(),this._rangeInfo(i,t)},_rangeInfo:function(e,t){let i=null;this._variable._range=e,i=e.collapsed?a.isWysiwygDiv(e.commonAncestorContainer)&&e.commonAncestorContainer.children[e.startOffset]||e.commonAncestorContainer:t.extentNode||t.anchorNode,this._variable._selectionNode=i},_createDefaultRange:function(){const t=e.element.wysiwyg,i=this._wd.createRange();let n=t.firstElementChild,l=null;return n?(l=n.firstChild,l||(l=a.createElement("BR"),n.appendChild(l))):(n=a.createElement(o.defaultTag),l=a.createElement("BR"),n.appendChild(l),t.appendChild(n)),i.setStart(l,0),i.setEnd(l,0),i},_selectionVoid:function(e){const t=e.commonAncestorContainer;return a.isWysiwygDiv(e.startContainer)&&a.isWysiwygDiv(e.endContainer)||/FIGURE/i.test(t.nodeName)||this._fileManager.regExp.test(t.nodeName)||a.isMediaComponent(t)},_resetRangeToTextNode:function(){const t=this.getRange();if(this._selectionVoid(t))return!1;let i,n,l,r=t.startContainer,s=t.startOffset,c=t.endContainer,u=t.endOffset;if(a.isFormatElement(r))for(r.childNodes[s]?(r=r.childNodes[s]||r,s=0):(r=r.lastChild||r,s=r.textContent.length);r&&1===r.nodeType&&r.firstChild;)r=r.firstChild||r,s=0;if(a.isFormatElement(c)){for(c=c.childNodes[u]||c.lastChild||c;c&&1===c.nodeType&&c.lastChild;)c=c.lastChild;u=c.textContent.length}if(i=a.isWysiwygDiv(r)?e.element.wysiwyg.firstChild:r,n=s,a.isBreak(i)||1===i.nodeType&&i.childNodes.length>0){const e=a.isBreak(i);if(!e){for(;i&&!a.isBreak(i)&&1===i.nodeType;)i=i.childNodes[n]||i.nextElementSibling||i.nextSibling,n=0;let e=a.getFormatElement(i,null);e===a.getRangeFormatElement(e,null)&&(e=a.createElement(a.getParentElement(i,a.isCell)?"DIV":o.defaultTag),i.parentNode.insertBefore(e,i),e.appendChild(i))}if(a.isBreak(i)){const t=a.createTextNode(a.zeroWidthSpace);i.parentNode.insertBefore(t,i),i=t,e&&r===c&&(c=i,u=1)}}if(r=i,s=n,i=a.isWysiwygDiv(c)?e.element.wysiwyg.lastChild:c,n=u,a.isBreak(i)||1===i.nodeType&&i.childNodes.length>0){const e=a.isBreak(i);if(!e){for(;i&&!a.isBreak(i)&&1===i.nodeType&&(l=i.childNodes,0!==l.length);)i=l[n>0?n-1:n]||!/FIGURE/i.test(l[0].nodeName)?l[0]:i.previousElementSibling||i.previousSibling||r,n=n>0?i.textContent.length:n;let e=a.getFormatElement(i,null);e===a.getRangeFormatElement(e,null)&&(e=a.createElement(a.isCell(e)?"DIV":o.defaultTag),i.parentNode.insertBefore(e,i),e.appendChild(i))}if(a.isBreak(i)){const t=a.createTextNode(a.zeroWidthSpace);i.parentNode.insertBefore(t,i),i=t,n=1,e&&!i.previousSibling&&a.removeItem(c)}}return c=i,u=n,this.setRange(r,s,c,u),!0},getSelectedElements:function(t){if(!this._resetRangeToTextNode())return[];let i=this.getRange();if(a.isWysiwygDiv(i.startContainer)){const t=e.element.wysiwyg.children;if(0===t.length)return[];this.setRange(t[0],0,t[t.length-1],t[t.length-1].textContent.trim().length),i=this.getRange()}const n=i.startContainer,o=i.endContainer,l=i.commonAncestorContainer,r=a.getListChildren(l,(function(e){return t?t(e):a.isFormatElement(e)}));if(a.isWysiwygDiv(l)||a.isRangeFormatElement(l)||r.unshift(a.getFormatElement(l,null)),n===o||1===r.length)return r;let s=a.getFormatElement(n,null),c=a.getFormatElement(o,null),u=null,d=null;const h=function(e){return!a.isTable(e)||/^TABLE$/i.test(e.nodeName)};let p=a.getRangeFormatElement(s,h),f=a.getRangeFormatElement(c,h);a.isTable(p)&&a.isListCell(p.parentNode)&&(p=p.parentNode),a.isTable(f)&&a.isListCell(f.parentNode)&&(f=f.parentNode);const g=p===f;for(let e,t=0,i=r.length;t=0;i--)if(n[i].contains(n[e])){n.splice(e,1),e--,t--;break}return n},isEdgePoint:function(e,t,i){return"end"!==i&&0===t||(!i||"front"!==i)&&!e.nodeValue&&1===t||(!i||"end"===i)&&!!e.nodeValue&&t===e.nodeValue.length},_isEdgeFormat:function(e,t,i){if(!this.isEdgePoint(e,t,i))return!1;const n=[];for(i="front"===i?"previousSibling":"nextSibling";e&&!a.isFormatElement(e)&&!a.isWysiwygDiv(e);){if(e[i]&&(!a.isBreak(e[i])||e[i][i]))return null;1===e.nodeType&&n.push(e.cloneNode(!1)),e=e.parentNode}return n},showLoading:function(){e.element.loading.style.display="block"},closeLoading:function(){e.element.loading.style.display="none"},appendFormatTag:function(e,t){if(!e||!e.parentNode)return null;const i=a.getFormatElement(this.getSelectionNode(),null);let n=null;if(!a.isFormatElement(e)&&a.isFreeFormatElement(i||e.parentNode))n=a.createElement("BR");else{const e=t?"string"==typeof t?t:t.nodeName:!a.isFormatElement(i)||a.isRangeFormatElement(i)||a.isFreeFormatElement(i)?o.defaultTag:i.nodeName;n=a.createElement(e),n.innerHTML="
    ",(t&&"string"!=typeof t||!t&&a.isFormatElement(i))&&a.copyTagAttributes(n,t||i,["id"])}return a.isCell(e)?e.insertBefore(n,e.nextElementSibling):e.parentNode.insertBefore(n,e.nextElementSibling),n},insertComponent:function(e,t,i,n){if(this.isReadOnly||i&&!this.checkCharCount(e,null))return null;const o=this.removeNode();this.getRange_addLine(this.getRange(),o.container);let l=null,r=this.getSelectionNode(),s=a.getFormatElement(r,null);if(a.isListCell(s))this.insertNode(e,r===s?null:o.container.nextSibling,!1),e.nextSibling||e.parentNode.appendChild(a.createElement("BR"));else{if(this.getRange().collapsed&&(3===o.container.nodeType||a.isBreak(o.container))){const e=a.getParentElement(o.container,function(e){return this.isRangeFormatElement(e)}.bind(a));l=a.splitElement(o.container,o.offset,e?a.getElementDepth(e)+1:0),l&&(s=l.previousSibling)}this.insertNode(e,a.isRangeFormatElement(s)?null:s,!1),s&&a.onlyZeroWidthSpace(s)&&a.removeItem(s)}if(!n){this.setRange(e,0,e,0);const t=this.getFileComponent(e);t?this.selectComponent(t.target,t.pluginName):l&&(l=a.getEdgeChildNodes(l,null).sc||l,this.setRange(l,0,l,0))}return t||this.history.push(1),l||e},getFileComponent:function(e){if(!this._fileManager.queryString||!e)return null;let t,i;return(/^FIGURE$/i.test(e.nodeName)||/se-component/.test(e.className))&&(t=e.querySelector(this._fileManager.queryString)),!t&&e.nodeName&&this._fileManager.regExp.test(e.nodeName)&&(t=e),t&&(i=this._fileManager.pluginMap[t.nodeName.toLowerCase()],i)?{target:t,component:a.getParentElement(t,a.isComponent),pluginName:i}:null},selectComponent:function(e,t){if(a.isUneditableComponent(a.getParentElement(e,a.isComponent))||a.isUneditableComponent(e))return!1;this.hasFocus||this.focus();const i=this.plugins[t];i&&s.setTimeout(function(){"function"==typeof i.select&&this.callPlugin(t,i.select.bind(this,e),null),this._setComponentLineBreaker(e)}.bind(this))},_setComponentLineBreaker:function(t){this._lineBreaker.style.display="none";const i=a.getParentElement(t,a.isComponent),n=e.element.lineBreaker_t.style,o=e.element.lineBreaker_b.style,l="block"===this.context.resizing.resizeContainer.style.display?this.context.resizing.resizeContainer:t,r=a.isListCell(i.parentNode);let s,c,u;(r?i.previousSibling:a.isFormatElement(i.previousElementSibling))?n.display="none":(this._variable._lineBreakComp=i,c=e.element.wysiwyg.scrollTop,s=a.getOffset(t,e.element.wysiwygFrame).top+c,u=l.offsetWidth/2/2,n.top=s-c-12+"px",n.left=a.getOffset(l).left+u+"px",n.display="block"),(r?i.nextSibling:a.isFormatElement(i.nextElementSibling))?o.display="none":(s||(this._variable._lineBreakComp=i,c=e.element.wysiwyg.scrollTop,s=a.getOffset(t,e.element.wysiwygFrame).top+c,u=l.offsetWidth/2/2),o.top=s+l.offsetHeight-c-12+"px",o.left=a.getOffset(l).left+l.offsetWidth-u-24+"px",o.display="block")},_checkDuplicateNode:function(e,t){!function e(i){u._dupleCheck(i,t);const n=i.childNodes;for(let t=0,i=n.length;t-1&&i.splice(e,1);for(let t=0,i=l.classList.length;tv?g.splitText(v):g.nextSibling;else if(a.isBreak(l))i=l,l=l.parentNode;else{let e=l.childNodes[m];const n=e&&3===e.nodeType&&a.onlyZeroWidthSpace(e)&&a.isBreak(e.nextSibling)?e.nextSibling:e;n?!n.nextSibling&&a.isBreak(n)?(l.removeChild(n),i=null):i=a.isBreak(n)&&!a.isBreak(t)?n:n.nextSibling:i=null}else if(y===w){i=this.isEdgePoint(w,v)?w.nextSibling:w.splitText(v);let e=y;this.isEdgePoint(y,m)||(e=y.splitText(m)),l.removeChild(e),0===l.childNodes.length&&f&&(l.innerHTML="
    ")}else{const e=this.removeNode(),n=e.container,r=e.prevContainer;if(n&&0===n.childNodes.length&&f&&(a.isFormatElement(n)?n.innerHTML="
    ":a.isRangeFormatElement(n)&&(n.innerHTML="<"+o.defaultTag+">
    ")),a.isListCell(n)&&3===t.nodeType)l=n,i=null;else if(!f&&r)if(l=3===r.nodeType?r.parentNode:r,l.contains(n)){let e=!0;for(i=n;i.parentNode&&i.parentNode!==l;)i=i.parentNode,e=!1;e&&n===r&&(i=i.nextSibling)}else i=null;else a.isWysiwygDiv(n)&&!a.isFormatElement(t)?(l=n.appendChild(a.createElement(o.defaultTag)),i=null):l=(i=f?w:n===r?n.nextSibling:n)&&i.parentNode?i.parentNode:g;for(;i&&!a.isFormatElement(i)&&i.parentNode!==g;)i=i.parentNode}try{if(!d){if((a.isWysiwygDiv(i)||l===e.element.wysiwyg.parentNode)&&(l=e.element.wysiwyg,i=null),a.isFormatElement(t)||a.isRangeFormatElement(t)||!a.isListCell(l)&&a.isComponent(t)){const e=l;if(a.isList(i))l=i,i=null;else if(a.isListCell(i))l=i.previousElementSibling||i;else if(!r&&!i){const e=this.removeNode(),t=3===e.container.nodeType?a.isListCell(a.getFormatElement(e.container,null))?e.container:a.getFormatElement(e.container,null)||e.container.parentNode:e.container,n=a.isWysiwygDiv(t)||a.isRangeFormatElement(t);l=n?t:t.parentNode,i=n?null:t.nextSibling}0===e.childNodes.length&&l!==e&&a.removeItem(e)}if(!f||p||a.isRangeFormatElement(l)||a.isListCell(l)||a.isWysiwygDiv(l)||(i=l.nextElementSibling,l=l.parentNode),a.isWysiwygDiv(l)&&(3===t.nodeType||a.isBreak(t))){const e=a.createElement(o.defaultTag);e.appendChild(t),t=e}}if(d?h.parentNode?(l=h,i=s):(l=e.element.wysiwyg,i=null):i=l===i?l.lastChild:i,a.isListCell(t)&&!a.isList(l)){if(a.isListCell(l))i=l.nextElementSibling,l=l.parentNode;else{const e=a.createElement("ol");l.insertBefore(e,i),l=e,i=null}d=!0}if(this._checkDuplicateNode(t,l),l.insertBefore(t,i),d)if(a.onlyZeroWidthSpace(u.textContent.trim()))a.removeItem(u),t=t.lastChild;else{const e=a.getArrayItem(u.children,a.isList);e&&(t!==e?(t.appendChild(e),t=e.previousSibling):(l.appendChild(t),t=l),a.onlyZeroWidthSpace(u.textContent.trim())&&a.removeItem(u))}}catch(e){l.appendChild(t),console.warn("[SUNEDITOR.insertNode.warn] "+e)}finally{const e=l.querySelectorAll("[data-se-duple]");if(e.length>0)for(let i,n,o,l,r=0,s=e.length;r0&&(t.textContent=n+t.textContent,a.removeItem(e)),i&&i.length>0&&(t.textContent+=o,a.removeItem(i));const l={container:t,startOffset:n.length,endOffset:t.textContent.length-o.length};return this.setRange(t,l.startOffset,t,l.endOffset),l}if(!a.isBreak(t)&&!a.isListCell(t)&&a.isFormatElement(l)){let i=null;t.previousSibling&&!a.isBreak(t.previousSibling)||(i=a.createTextNode(a.zeroWidthSpace),t.parentNode.insertBefore(i,t)),t.nextSibling&&!a.isBreak(t.nextSibling)||(i=a.createTextNode(a.zeroWidthSpace),t.parentNode.insertBefore(i,t.nextSibling)),a._isIgnoreNodeChange(t)&&(t=t.nextSibling,e=0)}this.setRange(t,e,t,e)}return this.history.push(!0),t}},_setIntoFreeFormat:function(e){const t=e.parentNode;let i,n;for(;a.isFormatElement(e)||a.isRangeFormatElement(e);){for(i=e.childNodes,n=null;i[0];)if(n=i[0],a.isFormatElement(n)||a.isRangeFormatElement(n)){if(this._setIntoFreeFormat(n),!e.parentNode)break;i=e.childNodes}else t.insertBefore(n,e);0===e.childNodes.length&&a.removeItem(e),e=a.createElement("BR"),t.insertBefore(e,n.nextSibling)}return e},removeNode:function(){this._resetRangeToTextNode();const t=this.getRange();if(t.startContainer===t.endContainer){const e=a.getParentElement(t.startContainer,a.isMediaComponent);if(e){const t=a.createElement("BR"),i=a.createElement(o.defaultTag);return i.appendChild(t),a.changeElement(e,i),u.setRange(i,0,i,0),this.history.push(!0),{container:i,offset:0,prevContainer:null}}}const i=0===t.startOffset,n=u.isEdgePoint(t.endContainer,t.endOffset,"end");let l=null,r=null,s=null;i&&(r=a.getFormatElement(t.startContainer),r&&(l=r.previousElementSibling,r=l)),n&&(s=a.getFormatElement(t.endContainer),s=s?s.nextElementSibling:s);let c,d=0,h=t.startContainer,p=t.endContainer,f=t.startOffset,g=t.endOffset;const m=3===t.commonAncestorContainer.nodeType&&t.commonAncestorContainer.parentNode===h.parentNode?h.parentNode:t.commonAncestorContainer;if(m===h&&m===p&&(h=m.children[f],p=m.children[g],f=g=0),!h||!p)return{container:m,offset:0};if(h===p&&t.collapsed&&h.textContent&&a.onlyZeroWidthSpace(h.textContent.substr(f)))return{container:h,offset:f,prevContainer:h&&h.parentNode?h:null};let v=null,b=null;const y=a.getListChildNodes(m,null);let w=a.getArrayIndex(y,h),_=a.getArrayIndex(y,p);if(y.length>0&&w>-1&&_>-1){for(let e=w+1,t=h;e>=0;e--)y[e]===t.parentNode&&y[e].firstChild===t&&0===f&&(w=e,t=t.parentNode);for(let e=_-1,t=p;e>w;e--)y[e]===t.parentNode&&1===y[e].nodeType&&(y.splice(e,1),t=t.parentNode,--_)}else{if(0===y.length){if(a.isFormatElement(m)||a.isRangeFormatElement(m)||a.isWysiwygDiv(m)||a.isBreak(m)||a.isMedia(m))return{container:m,offset:0};if(3===m.nodeType)return{container:m,offset:g};y.push(m),h=p=m}else if(h=p=y[0],a.isBreak(h)||a.onlyZeroWidthSpace(h))return{container:a.isMedia(m)?m:h,offset:0};w=_=0}for(let e=w;e<=_;e++){const t=y[e];if(0===t.length||3===t.nodeType&&void 0===t.data)this._nodeRemoveListItem(t);else if(t!==h)if(t!==p)this._nodeRemoveListItem(t);else{if(1===p.nodeType){if(a.isComponent(p))continue;b=a.createTextNode(p.textContent)}else b=a.createTextNode(p.substringData(g,p.length-g));b.length>0?p.data=b.data:this._nodeRemoveListItem(p)}else{if(1===h.nodeType){if(a.isComponent(h))continue;v=a.createTextNode(h.textContent)}else t===p?(v=a.createTextNode(h.substringData(0,f)+p.substringData(g,p.length-g)),d=f):v=a.createTextNode(h.substringData(0,f));if(v.length>0?h.data=v.data:this._nodeRemoveListItem(h),t===p)break}}const x=a.getParentElement(p,"ul"),C=a.getParentElement(h,"li");if(x&&C&&C.contains(x)?(c=x.previousSibling,d=c.textContent.length):(c=p&&p.parentNode?p:h&&h.parentNode?h:t.endContainer||t.startContainer,d=i||n?n?c.textContent.length:0:d),!a.isWysiwygDiv(c)&&0===c.childNodes.length){const t=a.removeItemAllParents(c,null,null);t&&(c=t.sc||t.ec||e.element.wysiwyg)}return a.getFormatElement(c)||h&&h.parentNode||(s?(c=s,d=0):r&&(c=r,d=1)),this.setRange(c,d,c,d),this.history.push(!0),{container:c,offset:d,prevContainer:l}},_nodeRemoveListItem:function(e){const t=a.getFormatElement(e,null);a.removeItem(e),a.isListCell(t)&&(a.removeItemAllParents(t,null,null),t&&a.isList(t.firstChild)&&t.insertBefore(a.createTextNode(a.zeroWidthSpace),t.firstChild))},applyRangeFormatElement:function(e){this.getRange_addLine(this.getRange(),null);const t=this.getSelectedElementsAndComponents(!1);if(!t||0===t.length)return;e:for(let e,i,n,o,l,r,s=0,c=t.length;s-1&&(o=i.lastElementChild,t.indexOf(o)>-1))){let e=null;for(;e=o.lastElementChild;)if(a.isList(e)){if(!(t.indexOf(e.lastElementChild)>-1))continue e;o=e.lastElementChild}n=i.firstElementChild,l=t.indexOf(n),r=t.indexOf(o),t.splice(l,r-l+1),c=t.length}let i,n,o,l=t[t.length-1];i=a.isRangeFormatElement(l)||a.isFormatElement(l)?l:a.getRangeFormatElement(l,null)||a.getFormatElement(l,null),a.isCell(i)?(n=null,o=i):(n=i.nextSibling,o=i.parentNode);let r=a.getElementDepth(i),s=null;const c=[],u=function(e,t,i){let n=null;if(e!==t&&!a.isTable(t)){if(t&&a.getElementDepth(e)===a.getElementDepth(t))return i;n=a.removeItemAllParents(t,null,e)}return n?n.ec:i};for(let i,l,d,h,p,f,g,m=0,v=t.length;m=d?(r=d,o=v.cc,n=u(o,l,v.ec),n&&(o=n.parentNode)):o===v.cc&&(n=v.ec),o!==v.cc&&(h=u(o,v.cc,h),n=void 0!==h?h:v.cc);for(let e=0,t=v.removeArray.length;e=d&&(r=d,o=l,n=i.nextSibling),e.appendChild(i),o!==l&&(h=u(o,l),void 0!==h&&(n=h));if(this.effectNode=null,a.mergeSameTags(e,null,!1),a.mergeNestedTags(e,function(e){return this.isList(e)}.bind(a)),n&&a.getElementDepth(n)>0&&(a.isList(n.parentNode)||a.isList(n.parentNode.parentNode))){const t=a.getParentElement(n,function(e){return this.isRangeFormatElement(e)&&!this.isList(e)}.bind(a)),i=a.splitElement(n,null,t?a.getElementDepth(t)+1:0);i.parentNode.insertBefore(e,i)}else o.insertBefore(e,n),u(e,n);const d=a.getEdgeChildNodes(e.firstElementChild,e.lastElementChild);t.length>1?this.setRange(d.sc,0,d.ec,d.ec.textContent.length):this.setRange(d.ec,d.ec.textContent.length,d.ec,d.ec.textContent.length),this.history.push(!1)},detachRangeFormatElement:function(e,t,i,n,l){const r=this.getRange();let s=r.startOffset,c=r.endOffset,u=a.getListChildNodes(e,(function(t){return t.parentNode===e})),d=e.parentNode,h=null,p=null,f=e.cloneNode(!1);const g=[],m=a.isList(i);let v=!1,b=!1,y=!1;function w(t,i,n,o){if(a.onlyZeroWidthSpace(i)&&(i.innerHTML=a.zeroWidthSpace,s=c=1),3===i.nodeType)return t.insertBefore(i,n),i;const l=(y?i:o).childNodes;let r=i.cloneNode(!1),u=null,d=null;for(;l[0];)d=l[0],!a._notTextNode(d)||a.isBreak(d)||a.isListCell(r)?r.appendChild(d):(r.childNodes.length>0&&(u||(u=r),t.insertBefore(r,n),r=i.cloneNode(!1)),t.insertBefore(d,n),u||(u=d));if(r.childNodes.length>0){if(a.isListCell(t)&&a.isListCell(r)&&a.isList(n))if(m){for(u=n;n;)r.appendChild(n),n=n.nextSibling;t.parentNode.insertBefore(r,t.nextElementSibling)}else{const t=o.nextElementSibling,i=a.detachNestedList(o,!1);if(e!==i||t!==o.nextElementSibling){const t=r.childNodes;for(;t[0];)o.appendChild(t[0]);e=i,b=!0}}else t.insertBefore(r,n);u||(u=r)}return u}for(let l,r,s,c=0,_=u.length;c<_;c++)if(l=u[c],3!==l.nodeType||!a.isList(f))if(y=!1,n&&0===c&&(h=t&&t.length!==_&&t[0]!==l?f:e.previousSibling),t&&(r=t.indexOf(l)),t&&-1===r)f||(f=e.cloneNode(!1)),f.appendChild(l);else{if(t&&(s=t[r+1]),f&&f.children.length>0&&(d.insertBefore(f,e),f=null),!m&&a.isListCell(l))if(s&&a.getElementDepth(l)!==a.getElementDepth(s)&&(a.isListCell(d)||a.getArrayItem(l.children,a.isList,!1))){const t=l.nextElementSibling,i=a.detachNestedList(l,!1);e===i&&t===l.nextElementSibling||(e=i,b=!0)}else{const t=l;l=a.createElement(n?t.nodeName:a.isList(e.parentNode)||a.isListCell(e.parentNode)?"LI":a.isCell(e.parentNode)?"DIV":o.defaultTag);const i=a.isListCell(l),r=t.childNodes;for(;r[0]&&(!a.isList(r[0])||i);)l.appendChild(r[0]);a.copyFormatAttributes(l,t),y=!0}else l=l.cloneNode(!1);if(!b&&(n?(g.push(l),a.removeItem(u[c])):(i?(v||(d.insertBefore(i,e),v=!0),l=w(i,l,null,u[c])):l=w(d,l,e,u[c]),b||(t?(p=l,h||(h=l)):h||(h=p=l))),b)){b=y=!1,u=a.getListChildNodes(e,(function(t){return t.parentNode===e})),f=e.cloneNode(!1),d=e.parentNode,c=-1,_=u.length;continue}}const _=e.parentNode;let x=e.nextSibling;f&&f.children.length>0&&_.insertBefore(f,x),i?h=i.previousSibling:h||(h=e.previousSibling),x=e.nextSibling!==f?e.nextSibling:f?f.nextSibling:null,0===e.children.length||0===e.textContent.length?a.removeItem(e):a.removeEmptyNode(e,null,!1);let C=null;if(n)C={cc:_,sc:h,so:s,ec:x,eo:c,removeArray:g};else{h||(h=p),p||(p=h);const e=a.getEdgeChildNodes(h,p.parentNode?h:p);C={cc:(e.sc||e.ec).parentNode,sc:e.sc,so:s,ec:e.ec,eo:c,removeArray:null}}if(this.effectNode=null,l)return C;!n&&C&&(t?this.setRange(C.sc,s,C.ec,c):this.setRange(C.sc,0,C.sc,0)),this.history.push(!1)},detachList:function(e,t){let i={},n=!1,o=!1,l=null,r=null;const s=function(e){return!this.isComponent(e)}.bind(a);for(let c,u,d,h,p=0,f=e.length;p0)&&t,i=!!(i&&i.length>0)&&i;const l=!e,r=l&&!i&&!t;let c=o.startContainer,u=o.startOffset,d=o.endContainer,h=o.endOffset;if(r&&o.collapsed&&a.isFormatElement(c.parentNode)||c===d&&1===c.nodeType&&a.isNonEditable(c)){const e=c.parentNode;if(!a.isListCell(e)||!a.getValues(e.style).some(function(e){return this._listKebab.indexOf(e)>-1}.bind(this)))return}if(o.collapsed&&!r&&1===c.nodeType&&!a.isBreak(c)&&!a.isComponent(c)){let e=null;const t=c.childNodes[u];t&&(e=t.nextSibling?a.isBreak(t)?t:t.nextSibling:null);const i=a.createTextNode(a.zeroWidthSpace);c.insertBefore(i,e),this.setRange(i,1,i,1),o=this.getRange(),c=o.startContainer,u=o.startOffset,d=o.endContainer,h=o.endOffset}a.isFormatElement(c)&&(c=c.childNodes[u]||c.firstChild,u=0),a.isFormatElement(d)&&(d=d.childNodes[h]||d.lastChild,h=d.textContent.length),l&&(e=a.createElement("DIV"));const p=s.RegExp,f=e.nodeName;if(!r&&c===d&&!i&&e){let t=c,i=0;const n=[],o=e.style;for(let e=0,t=o.length;e0){for(;!a.isFormatElement(t)&&!a.isWysiwygDiv(t);){for(let o=0;o=n.length)return}}let g,m={},v={},b="",y="",w="";if(t){for(let e,i=0,n=t.length;i0&&(s=o.replace(b,"").trim(),s!==o&&(x.v=!0));const c=t.className;let u="";return y&&c.length>0&&(u=c.replace(y,"").trim(),u!==c&&(x.v=!0)),(!l||!y&&c||!b&&o||s||u||!i)&&(s||u||t.nodeName!==f||_(b)!==_(o)||_(y)!==_(c))?(b&&o.length>0&&(t.style.cssText=s),t.style.cssText||t.removeAttribute("style"),y&&c.length>0&&(t.className=u.trim()),t.className.trim()||t.removeAttribute("class"),t.style.cssText||t.className||t.nodeName!==f&&!i?t:(x.v=!0,null)):(x.v=!0,null)},k=this.getSelectedElements(null);o=this.getRange(),c=o.startContainer,u=o.startOffset,d=o.endContainer,h=o.endOffset,a.getFormatElement(c,null)||(c=a.getChildElement(k[0],(function(e){return 3===e.nodeType}),!1),u=0),a.getFormatElement(d,null)||(d=a.getChildElement(k[k.length-1],(function(e){return 3===e.nodeType}),!1),h=d.textContent.length);const S=a.getFormatElement(c,null)===a.getFormatElement(d,null),L=k.length-(S?0:1);g=e.cloneNode(!1);const E=r||l&&function(e){for(let t=0,i=e.length;t0&&this._resetCommonListCell(k[L],t)&&(i=!0),this._resetCommonListCell(k[0],t)&&(i=!0),i&&this.setRange(c,u,d,h),L>0&&(g=e.cloneNode(!1),v=this._nodeChange_endLine(k[L],g,C,d,h,r,l,x,N,z));for(let i,n=L-1;n>0;n--)this._resetCommonListCell(k[n],t),g=e.cloneNode(!1),i=this._nodeChange_middleLine(k[n],g,C,r,l,x,v.container),i.endContainer&&i.ancestor.contains(i.endContainer)&&(v.ancestor=null,v.container=i.endContainer),this._setCommonListStyle(i.ancestor,null);g=e.cloneNode(!1),m=this._nodeChange_startLine(k[0],g,C,c,u,r,l,x,N,z,v.container),m.endContainer&&(v.ancestor=null,v.container=m.endContainer),L<=0?v=m:v.container||(v.ancestor=null,v.container=m.container,v.offset=m.container.textContent.length),this._setCommonListStyle(m.ancestor,null),this._setCommonListStyle(v.ancestor||a.getFormatElement(v.container),null)}this.controllersOff(),this.setRange(m.container,m.offset,v.container,v.offset),this.history.push(!1)},_resetCommonListCell:function(e,t){if(!a.isListCell(e))return;t||(t=this._listKebab);const i=a.getArrayItem(e.childNodes,(function(e){return!a.isBreak(e)}),!0),n=e.style,l=[],r=[],s=a.getValues(n);for(let e=0,i=this._listKebab.length;e-1&&t.indexOf(this._listKebab[e])>-1&&(l.push(this._listCamel[e]),r.push(this._listKebab[e]));if(!l.length)return;const c=a.createElement("SPAN");for(let e=0,t=l.length;e0&&(e.insertBefore(u,d),u=c.cloneNode(!1),d=null,h=!0));return u.childNodes.length>0&&(e.insertBefore(u,d),h=!0),n.length||e.removeAttribute("style"),h},_setCommonListStyle:function(e,t){if(!a.isListCell(e))return;const i=a.getArrayItem((t||e).childNodes,(function(e){return!a.isBreak(e)}),!0);if(!(t=i[0])||i.length>1||1!==t.nodeType)return;const n=t.style,l=e.style,r=t.nodeName.toLowerCase();let s=!1;o._textTagsMap[r]===o._defaultCommand.bold.toLowerCase()&&(l.fontWeight="bold"),o._textTagsMap[r]===o._defaultCommand.italic.toLowerCase()&&(l.fontStyle="italic");const c=a.getValues(n);if(c.length>0)for(let e=0,t=this._listCamel.length;e-1&&(l[this._listCamel[e]]=n[this._listCamel[e]],n.removeProperty(this._listKebab[e]),s=!0);if(this._setCommonListStyle(e,t),s&&!n.length){const e=t.childNodes,i=t.parentNode,n=t.nextSibling;for(;e.length>0;)i.insertBefore(e[0],n);a.removeItem(t)}},_stripRemoveNode:function(e){const t=e.parentNode;if(!e||3===e.nodeType||!t)return;const i=e.childNodes;for(;i[0];)t.insertBefore(i[0],e);t.removeChild(e)},_util_getMaintainedNode:function(e,t,i){return!i||e?null:this.getParentElement(i,this._isMaintainedNode.bind(this))||(t?null:this.getParentElement(i,this._isSizeNode.bind(this)))},_util_isMaintainedNode:function(e,t,i){if(!i||e||1!==i.nodeType)return!1;const n=this._isMaintainedNode(i);return this.getParentElement(i,this._isMaintainedNode.bind(this))?n:n||!t&&this._isSizeNode(i)},_nodeChange_oneLine:function(e,t,i,n,o,l,r,c,u,d,h,p,f){let g=n.parentNode;for(;!(g.nextSibling||g.previousSibling||a.isFormatElement(g.parentNode)||a.isWysiwygDiv(g.parentNode))&&g.nodeName!==t.nodeName;)g=g.parentNode;if(!u&&g===l.parentNode&&g.nodeName===t.nodeName&&a.onlyZeroWidthSpace(n.textContent.slice(0,o))&&a.onlyZeroWidthSpace(l.textContent.slice(r))){const i=g.childNodes;let s=!0;for(let e,t,o,r,c=0,u=i.length;c0&&(i=t.test(e.style.cssText)),!i}if(function e(n,o){const l=n.childNodes;for(let n,r=0,s=l.length;r=L?T-L:S.data.length-L));if(k){const t=p(o);if(t&&t.parentNode!==e){let i=t,n=null;for(;i.parentNode!==e;){for(o=n=i.parentNode.cloneNode(!1);i.childNodes[0];)n.appendChild(i.childNodes[0]);i.appendChild(n),i=i.parentNode}i.parentNode.appendChild(t)}k=k.cloneNode(!1)}a.onlyZeroWidthSpace(l)||o.appendChild(l);const c=p(o);for(c&&(k=c),k&&(e=k),_=s,w=[],C="";_!==e&&_!==m&&null!==_;)n=f(_)?null:i(_),n&&1===_.nodeType&&B(_)&&(w.push(n),C+=_.style.cssText.substr(0,_.style.cssText.indexOf(":"))+"|"),_=_.parentNode;const u=w.pop()||r;for(x=_=u;w.length>0;)_=w.pop(),x.appendChild(_),x=_;if(t.appendChild(u),e.appendChild(t),k&&!p(E)&&(t=t.cloneNode(!1),b.appendChild(t),v.push(t)),S=r,L=0,N=!0,_!==r&&_.appendChild(S),!y)continue}if(z||s!==E){if(N){if(1===s.nodeType&&!a.isBreak(s)){a._isIgnoreNodeChange(s)?(b.appendChild(s.cloneNode(!0)),d||(t=t.cloneNode(!1),b.appendChild(t),v.push(t))):e(s,s);continue}_=s,w=[],C="";const l=[];for(;null!==_.parentNode&&_!==m&&_!==t;)n=z?_.cloneNode(!1):i(_),1===_.nodeType&&!a.isBreak(s)&&n&&B(_)&&(f(_)?k||l.push(n):w.push(n),C+=_.style.cssText.substr(0,_.style.cssText.indexOf(":"))+"|"),_=_.parentNode;w=w.concat(l);const r=w.pop()||s;for(x=_=r;w.length>0;)_=w.pop(),x.appendChild(_),x=_;if(!f(t.parentNode)||f(r)||a.onlyZeroWidthSpace(t)||(t=t.cloneNode(!1),b.appendChild(t),v.push(t)),z||k||!f(r))r===s?o=z?b:t:z?(b.appendChild(r),o=_):(t.appendChild(r),o=_);else{t=t.cloneNode(!1);const e=r.childNodes;for(let i=0,n=e.length;i0?_:t}if(k&&3===s.nodeType)if(p(s)){const e=a.getParentElement(o,function(e){return this._isMaintainedNode(e.parentNode)||e.parentNode===b}.bind(a));k.appendChild(e),t=e.cloneNode(!1),v.push(t),b.appendChild(t)}else k=null}u=s.cloneNode(!1),o.appendChild(u),1!==s.nodeType||a.isBreak(s)||(h=u),e(s,h)}else{k=p(s);const e=a.createTextNode(1===E.nodeType?"":E.substringData(T,E.length-T)),o=a.createTextNode(y||1===E.nodeType?"":E.substringData(0,T));if(k?k=k.cloneNode(!1):f(t.parentNode)&&!k&&(t=t.cloneNode(!1),b.appendChild(t),v.push(t)),!a.onlyZeroWidthSpace(e)){_=s,C="",w=[];const t=[];for(;_!==b&&_!==m&&null!==_;)1===_.nodeType&&B(_)&&(f(_)?t.push(_.cloneNode(!1)):w.push(_.cloneNode(!1)),C+=_.style.cssText.substr(0,_.style.cssText.indexOf(":"))+"|"),_=_.parentNode;for(w=w.concat(t),u=x=_=w.pop()||e;w.length>0;)_=w.pop(),x.appendChild(_),x=_;b.appendChild(u),_.textContent=e.data}if(k&&u){const e=p(u);e&&(k=e)}for(_=s,w=[],C="";_!==b&&_!==m&&null!==_;)n=f(_)?null:i(_),n&&1===_.nodeType&&B(_)&&(w.push(n),C+=_.style.cssText.substr(0,_.style.cssText.indexOf(":"))+"|"),_=_.parentNode;const l=w.pop()||o;for(x=_=l;w.length>0;)_=w.pop(),x.appendChild(_),x=_;k?((t=t.cloneNode(!1)).appendChild(l),k.insertBefore(t,k.firstChild),b.appendChild(k),v.push(t),k=null):t.appendChild(l),E=o,T=o.data.length,z=!0,!c&&d&&(t=o,o.textContent=a.zeroWidthSpace),_!==o&&_.appendChild(E)}}}(e,b),u&&!c&&!h.v)return{ancestor:e,startContainer:n,startOffset:o,endContainer:l,endOffset:r};if(c=c&&u)for(let e=0;e0,w=m.pop()||h;for(b=v=w;m.length>0;)v=m.pop(),b.appendChild(v),b=v;if(u(t.parentNode)&&!u(w)&&(t=t.cloneNode(!1),g.appendChild(t),f.push(t)),!y&&u(w)){t=t.cloneNode(!1);const e=w.childNodes;for(let i=0,n=e.length;i0;)v=m.pop(),b.appendChild(v),b=v;u!==o?(t.appendChild(u),o=v):o=t,a.isBreak(h)&&t.appendChild(h.cloneNode(!1)),e.appendChild(t),w=r,_=0,x=!0,o.appendChild(w)}}}(e,g),r&&!l&&!s.v)return{ancestor:e,container:n,offset:o,endContainer:d};if(l=l&&r)for(let e=0;e0&&u===d)return e.innerHTML=n.innerHTML,{ancestor:e,endContainer:i?a.getNodeFromPath(i,e):null}}l.v=!1;const s=e.cloneNode(!1),c=[t];let u=!0;if(function e(n,o){const l=n.childNodes;for(let n,d,h=0,p=l.length;h0&&(s.appendChild(t),t=t.cloneNode(!1)),d=p.cloneNode(!0),s.appendChild(d),s.appendChild(t),c.push(t),o=t,r&&p.contains(r)){const e=a.getNodePath(r,p);r=a.getNodeFromPath(e,d)}}}(e,t),u||o&&!n&&!l.v)return{ancestor:e,endContainer:r};if(s.appendChild(t),n&&o)for(let e=0;e0,d=g.pop()||s;for(v=m=d;g.length>0;)m=g.pop(),v.appendChild(m),v=m;if(u(t.parentNode)&&!u(d)&&(t=t.cloneNode(!1),f.insertBefore(t,f.firstChild),p.push(t)),!b&&u(d)){t=t.cloneNode(!1);const e=d.childNodes;for(let i=0,n=e.length;i0?m:t}else r?(t.insertBefore(d,t.firstChild),o=m):o=t;if(b&&3===s.nodeType)if(c(s)){const e=a.getParentElement(o,function(e){return this._isMaintainedNode(e.parentNode)||e.parentNode===f}.bind(a));b.appendChild(e),t=e.cloneNode(!1),p.push(t),f.insertBefore(t,f.firstChild)}else b=null}if(_||s!==y)n=_?i(s):s.cloneNode(!1),n&&(o.insertBefore(n,o.firstChild),1!==s.nodeType||a.isBreak(s)||(d=n)),e(s,d);else{b=c(s);const e=a.createTextNode(1===y.nodeType?"":y.substringData(w,y.length-w)),l=a.createTextNode(1===y.nodeType?"":y.substringData(0,w));if(b){b=b.cloneNode(!1);const e=c(o);if(e&&e.parentNode!==f){let t=e,i=null;for(;t.parentNode!==f;){for(o=i=t.parentNode.cloneNode(!1);t.childNodes[0];)i.appendChild(t.childNodes[0]);t.appendChild(i),t=t.parentNode}t.parentNode.insertBefore(e,t.parentNode.firstChild)}b=b.cloneNode(!1)}else u(t.parentNode)&&!b&&(t=t.cloneNode(!1),f.appendChild(t),p.push(t));for(a.onlyZeroWidthSpace(e)||o.insertBefore(e,o.firstChild),m=o,g=[];m!==f&&null!==m;)n=u(m)?null:i(m),n&&1===m.nodeType&&g.push(n),m=m.parentNode;const r=g.pop()||o;for(v=m=r;g.length>0;)m=g.pop(),v.appendChild(m),v=m;r!==o?(t.insertBefore(r,t.firstChild),o=m):o=t,a.isBreak(s)&&t.appendChild(s.cloneNode(!1)),b?(b.insertBefore(t,b.firstChild),f.insertBefore(b,f.firstChild),b=null):f.insertBefore(t,f.firstChild),y=l,w=l.data.length,_=!0,o.insertBefore(y,o.firstChild)}}}(e,f),r&&!l&&!s.v)return{ancestor:e,container:n,offset:o};if(l=l&&r)for(let e=0;e-1?null:a.createElement(i);let u=i;/^SUB$/i.test(i)&&s.indexOf("SUP")>-1?u="SUP":/^SUP$/i.test(i)&&s.indexOf("SUB")>-1&&(u="SUB"),this.nodeChange(c,this._commandMapStyles[i]||null,[u],!1),this.focus()}},removeFormat:function(){this.nodeChange(null,null,null,null)},indent:function(e){const t=this.getRange(),i=this.getSelectedElements(null),n=[],l="indent"!==e,r=o.rtl?"marginRight":"marginLeft";let s=t.startContainer,c=t.endContainer,u=t.startOffset,d=t.endOffset;for(let e,t,o=0,s=i.length;o0&&this.plugins.list.editInsideList.call(this,l,n),this.effectNode=null,this.setRange(s,u,c,d),this.history.push(!1)},toggleDisplayBlocks:function(){const t=e.element.wysiwyg;a.toggleClass(t,"se-show-block"),a.hasClass(t,"se-show-block")?a.addClass(this._styleCommandMap.showBlocks,"active"):a.removeClass(this._styleCommandMap.showBlocks,"active"),this._resourcesStateChange()},toggleCodeView:function(){const t=this._variable.isCodeView;this.controllersOff(),a.setDisabledButtons(!t,this.codeViewDisabledButtons),t?(a.isNonEditable(e.element.wysiwygFrame)||this._setCodeDataToEditor(),e.element.wysiwygFrame.scrollTop=0,e.element.code.style.display="none",e.element.wysiwygFrame.style.display="block",this._variable._codeOriginCssText=this._variable._codeOriginCssText.replace(/(\s?display(\s+)?:(\s+)?)[a-zA-Z]+(?=;)/,"display: none"),this._variable._wysiwygOriginCssText=this._variable._wysiwygOriginCssText.replace(/(\s?display(\s+)?:(\s+)?)[a-zA-Z]+(?=;)/,"display: block"),"auto"!==o.height||o.codeMirrorEditor||(e.element.code.style.height="0px"),this._variable.isCodeView=!1,this._variable.isFullScreen||(this._notHideToolbar=!1,/balloon|balloon-always/i.test(o.mode)&&(e.element._arrow.style.display="",this._isInline=!1,this._isBalloon=!0,d._hideToolbar())),this.nativeFocus(),a.removeClass(this._styleCommandMap.codeView,"active"),a.isNonEditable(e.element.wysiwygFrame)||(this.history.push(!1),this.history._resetCachingButton())):(this._setEditorDataToCodeView(),this._variable._codeOriginCssText=this._variable._codeOriginCssText.replace(/(\s?display(\s+)?:(\s+)?)[a-zA-Z]+(?=;)/,"display: block"),this._variable._wysiwygOriginCssText=this._variable._wysiwygOriginCssText.replace(/(\s?display(\s+)?:(\s+)?)[a-zA-Z]+(?=;)/,"display: none"),this._variable.isFullScreen?e.element.code.style.height="100%":"auto"!==o.height||o.codeMirrorEditor||(e.element.code.style.height=e.element.code.scrollHeight>0?e.element.code.scrollHeight+"px":"auto"),o.codeMirrorEditor&&o.codeMirrorEditor.refresh(),this._variable.isCodeView=!0,this._variable.isFullScreen||(this._notHideToolbar=!0,this._isBalloon&&(e.element._arrow.style.display="none",e.element.toolbar.style.left="",this._isInline=!0,this._isBalloon=!1,d._showToolbarInline())),this._variable._range=null,e.element.code.focus(),a.addClass(this._styleCommandMap.codeView,"active")),this._checkPlaceholder(),this.isReadOnly&&a.setDisabledButtons(!0,this.resizingDisabledButtons),"function"==typeof h.toggleCodeView&&h.toggleCodeView(this._variable.isCodeView,this)},_setCodeDataToEditor:function(){const t=this._getCodeView();if(o.fullPage){const e=this._parser.parseFromString(t,"text/html");if(!this.options.__allowedScriptTag){const t=e.head.children;for(let i=0,n=t.length;i0?this.convertContentsForEditor(t):"<"+o.defaultTag+">
    "},_setEditorDataToCodeView:function(){const t=this.convertHTMLForCodeView(e.element.wysiwyg,!1);let i="";if(o.fullPage){const e=a.getAttributesToString(this._wd.body,null);i="\n\n"+this._wd.head.outerHTML.replace(/>(?!\n)/g,">\n")+"\n"+t+"\n"}else i=t;e.element.code.style.display="block",e.element.wysiwygFrame.style.display="none",this._setCodeView(i)},toggleFullScreen:function(t){const i=e.element.topArea,n=e.element.toolbar,l=e.element.editorArea,u=e.element.wysiwygFrame,p=e.element.code,f=this._variable;this.controllersOff();const g="none"===n.style.display||this._isInline&&!this._inlineToolbarAttr.isShow;f.isFullScreen?(f.isFullScreen=!1,u.style.cssText=f._wysiwygOriginCssText,p.style.cssText=f._codeOriginCssText,n.style.cssText="",l.style.cssText=f._editorAreaOriginCssText,i.style.cssText=f._originCssText,r.body.style.overflow=f._bodyOverflow,"auto"!==o.height||o.codeMirrorEditor||d._codeViewAutoHeight(),o.toolbarContainer&&o.toolbarContainer.appendChild(n),o.stickyToolbar>-1&&a.removeClass(n,"se-toolbar-sticky"),f._fullScreenAttrs.sticky&&!o.toolbarContainer&&(f._fullScreenAttrs.sticky=!1,e.element._stickyDummy.style.display="block",a.addClass(n,"se-toolbar-sticky")),this._isInline=f._fullScreenAttrs.inline,this._isBalloon=f._fullScreenAttrs.balloon,this._isInline&&d._showToolbarInline(),o.toolbarContainer&&a.removeClass(n,"se-toolbar-balloon"),d.onScroll_window(),t&&a.changeElement(t.firstElementChild,c.expansion),e.element.topArea.style.marginTop="",a.removeClass(this._styleCommandMap.fullScreen,"active")):(f.isFullScreen=!0,f._fullScreenAttrs.inline=this._isInline,f._fullScreenAttrs.balloon=this._isBalloon,(this._isInline||this._isBalloon)&&(this._isInline=!1,this._isBalloon=!1),o.toolbarContainer&&e.element.relative.insertBefore(n,l),i.style.position="fixed",i.style.top="0",i.style.left="0",i.style.width="100%",i.style.maxWidth="100%",i.style.height="100%",i.style.zIndex="2147483647",""!==e.element._stickyDummy.style.display&&(f._fullScreenAttrs.sticky=!0,e.element._stickyDummy.style.display="none",a.removeClass(n,"se-toolbar-sticky")),f._bodyOverflow=r.body.style.overflow,r.body.style.overflow="hidden",f._editorAreaOriginCssText=l.style.cssText,f._wysiwygOriginCssText=u.style.cssText,f._codeOriginCssText=p.style.cssText,l.style.cssText=n.style.cssText="",u.style.cssText=(u.style.cssText.match(/\s?display(\s+)?:(\s+)?[a-zA-Z]+;/)||[""])[0]+o._editorStyles.editor,p.style.cssText=(p.style.cssText.match(/\s?display(\s+)?:(\s+)?[a-zA-Z]+;/)||[""])[0],n.style.width=u.style.height=p.style.height="100%",n.style.position="relative",n.style.display="block",f.innerHeight_fullScreen=s.innerHeight-n.offsetHeight,l.style.height=f.innerHeight_fullScreen-o.fullScreenOffset+"px",t&&a.changeElement(t.firstElementChild,c.reduction),o.iframe&&"auto"===o.height&&(l.style.overflow="auto",this._iframeAutoHeight()),e.element.topArea.style.marginTop=o.fullScreenOffset+"px",a.addClass(this._styleCommandMap.fullScreen,"active")),g&&h.toolbar.hide(),"function"==typeof h.toggleFullScreen&&h.toggleFullScreen(this._variable.isFullScreen,this)},print:function(){const e=a.createElement("IFRAME");e.style.display="none",r.body.appendChild(e);const t=o.printTemplate?o.printTemplate.replace(/\{\{\s*contents\s*\}\}/i,this.getContents(!0)):this.getContents(!0),i=a.getIframeDocument(e),n=this._wd;if(o.iframe){const e=null!==o._printClass?'class="'+o._printClass+'"':o.fullPage?a.getAttributesToString(n.body,["contenteditable"]):'class="'+o._editableClass+'"';i.write(""+n.head.innerHTML+""+t+"")}else{const e=r.head.getElementsByTagName("link"),n=r.head.getElementsByTagName("style");let l="";for(let t=0,i=e.length;t"+l+''+t+"")}this.showLoading(),s.setTimeout((function(){try{if(e.focus(),a.isIE_Edge||a.isChromium||r.documentMode||s.StyleMedia)try{e.contentWindow.document.execCommand("print",!1,null)}catch(t){e.contentWindow.print()}else e.contentWindow.print()}catch(e){throw Error("[SUNEDITOR.core.print.fail] error: "+e)}finally{u.closeLoading(),a.removeItem(e)}}),1e3)},preview:function(){u.submenuOff(),u.containerOff(),u.controllersOff();const e=o.previewTemplate?o.previewTemplate.replace(/\{\{\s*contents\s*\}\}/i,this.getContents(!0)):this.getContents(!0),t=s.open("","_blank");t.mimeType="text/html";const i=this._wd;if(o.iframe){const n=null!==o._printClass?'class="'+o._printClass+'"':o.fullPage?a.getAttributesToString(i.body,["contenteditable"]):'class="'+o._editableClass+'"';t.document.write(""+i.head.innerHTML+""+e+"")}else{const i=r.head.getElementsByTagName("link"),l=r.head.getElementsByTagName("style");let s="";for(let e=0,t=i.length;e'+n.toolbar.preview+""+s+''+e+"")}},setDir:function(t){const i="rtl"===t,l=this._prevRtl!==i;this._prevRtl=o.rtl=i,l&&(this.plugins.align&&this.plugins.align.exchangeDir.call(this),e.tool.indent&&a.changeElement(e.tool.indent.firstElementChild,c.indent),e.tool.outdent&&a.changeElement(e.tool.outdent.firstElementChild,c.outdent));const r=e.element;i?(a.addClass(r.topArea,"se-rtl"),a.addClass(r.wysiwygFrame,"se-rtl")):(a.removeClass(r.topArea,"se-rtl"),a.removeClass(r.wysiwygFrame,"se-rtl"));const s=a.getListChildren(r.wysiwyg,(function(e){return a.isFormatElement(e)&&(e.style.marginRight||e.style.marginLeft||e.style.textAlign)}));for(let e,t,i,n=0,o=s.length;n"+this._wd.head.outerHTML+""+n.innerHTML+""}return n.innerHTML},getFullContents:function(e){return'
    '+this.getContents(e)+"
    "},_makeLine:function(e,t){const i=o.defaultTag;if(1===e.nodeType){if(this.__disallowedTagNameRegExp.test(e.nodeName))return"";if(/__se__tag/.test(e.className))return e.outerHTML;const n=a.getListChildNodes(e,(function(e){return a.isSpanWithoutAttr(e)&&!a.getParentElement(e,a.isNotCheckingNode)}))||[];for(let e=n.length-1;e>=0;e--)n[e].outerHTML=n[e].innerHTML;return!t||a.isFormatElement(e)||a.isRangeFormatElement(e)||a.isComponent(e)||a.isFigures(e)||a.isAnchor(e)&&a.isMedia(e.firstElementChild)?a.isSpanWithoutAttr(e)?e.innerHTML:e.outerHTML:"<"+i+">"+(a.isSpanWithoutAttr(e)?e.innerHTML:e.outerHTML)+""}if(3===e.nodeType){if(!t)return a._HTMLConvertor(e.textContent);const n=e.textContent.split(/\n/g);let o="";for(let e,t=0,l=n.length;t0&&(o+="<"+i+">"+a._HTMLConvertor(e)+"");return o}return 8===e.nodeType&&this._allowHTMLComments?"\x3c!--"+e.textContent.trim()+"--\x3e":""},_tagConvertor:function(e){if(!this._disallowedTextTagsRegExp)return e;const t=o._textTagsMap;return e.replace(this._disallowedTextTagsRegExp,(function(e,i,n,o){return i+("string"==typeof t[n]?t[n]:n)+(o?" "+o:"")}))},_deleteDisallowedTags:function(e){return e=e.replace(this.__disallowedTagsRegExp,"").replace(/<[a-z0-9]+\:[a-z0-9]+[^>^\/]*>[^>]*<\/[a-z0-9]+\:[a-z0-9]+>/gi,""),/\bfont\b/i.test(this.options._editorTagsWhitelist)||(e=e.replace(/(<\/?)font(\s?)/gi,"$1span$2")),e.replace(this.editorTagsWhitelistRegExp,"").replace(this.editorTagsBlacklistRegExp,"")},_convertFontSize:function(e,t){const i=this._w.Math,n=t.match(/(\d+(?:\.\d+)?)(.+)/),o=n?1*n[1]:a.fontValueMap[t],l=n?n[2]:"rem";let r=o;switch(/em/.test(l)?r=i.round(o/.0625):"pt"===l?r=i.round(1.333*o):"%"===l&&(r=o/100),e){case"em":case"rem":case"%":return(.0625*r).toFixed(2)+e;case"pt":return i.floor(r/1.333)+e;default:return r+e}},_cleanStyle:function(e,t,i){let n=(e.match(/style\s*=\s*(?:"|')[^"']*(?:"|')/)||[])[0];if(/span/i.test(i)&&!n&&(e.match(/<[^\s]+\s(.+)/)||[])[1]){const t=(e.match(/\ssize="([^"]+)"/i)||[])[1],i=(e.match(/\sface="([^"]+)"/i)||[])[1],o=(e.match(/\scolor="([^"]+)"/i)||[])[1];(t||i||o)&&(n='style="'+(t?"font-size:"+this.util.getNumber(t/3.333,1)+"rem;":"")+(i?"font-family:"+i+";":"")+(o?"color:"+o+";":"")+'"')}if(n){t||(t=[]);const e=n.replace(/"/g,"").match(this._cleanStyleRegExp[i]);if(e){const i=[];for(let t,n=0,l=e.length;n0&&t.push('style="'+i.join(";")+'"')}}return t},_cleanTags:function(e,t,i){if(/^<[a-z0-9]+\:[a-z0-9]+/i.test(t))return t;let n=null;const o=i.match(/(?!<)[a-zA-Z0-9\-]+/)[0].toLowerCase(),l=this._attributesTagsBlacklist[o];t=t.replace(/\s(?:on[a-z]+)\s*=\s*(")[^"]*\1/gi,""),t=l?t.replace(l,""):t.replace(this._attributesBlacklistRegExp,"");const r=this._attributesTagsWhitelist[o];if(n=r?t.match(r):t.match(e?this._attributesWhitelistRegExp:this._attributesWhitelistRegExp_all_data),e||"span"===o||"li"===o||this._cleanStyleRegExp[o])if("a"===o){const e=t.match(/(?:(?:id|name)\s*=\s*(?:"|')[^"']*(?:"|'))/g);e&&(n||(n=[]),n.push(e[0]))}else n&&/style=/i.test(n.toString())||("span"!==o&&"li"!==o||(n=this._cleanStyle(t,n,"span")),this._cleanStyleRegExp[o]?n=this._cleanStyle(t,n,o):/^(P|DIV|H[1-6]|PRE)$/i.test(o)&&(n=this._cleanStyle(t,n,"format")));else{const e=t.match(/style\s*=\s*(?:"|')[^"']*(?:"|')/);e&&!n?n=[e[0]]:e&&!n.some((function(e){return/^style/.test(e.trim())}))&&n.push(e[0])}if(a.isFigures(o)){const e=t.match(/style\s*=\s*(?:"|')[^"']*(?:"|')/);n||(n=[]),e&&n.push(e[0])}if(n)for(let e,t=0,o=n.length;t"+(i.innerHTML.trim()||"
    ")+"":a.isRangeFormatElement(i)&&!a.isTable(i)?t+=this._convertListCell(i):t+="
  • "+i.outerHTML+"
  • ":t+="
  • "+(i.textContent||"
    ")+"
  • ";return t},_isFormatData:function(e){let t=!1;for(let i,n=0,o=e.length;n]*(?=>)/g,this._cleanTags.bind(this,!0)).replace(/$/i,"");const n=r.createRange().createContextualFragment(e);try{a._consistencyCheckOfHTML(n,this._htmlCheckWhitelistRegExp,this._htmlCheckBlacklistRegExp,this._classNameFilter)}catch(e){console.warn("[SUNEDITOR.cleanHTML.consistencyCheck.fail] "+e)}if(this.managedTagsInfo&&this.managedTagsInfo.query){const e=n.querySelectorAll(this.managedTagsInfo.query);for(let t,i,n=0,o=e.length;n]*(?=>)/g,this._cleanTags.bind(this,!0));const t=r.createRange().createContextualFragment(e);try{a._consistencyCheckOfHTML(t,this._htmlCheckWhitelistRegExp,this._htmlCheckBlacklistRegExp,this._classNameFilter)}catch(e){console.warn("[SUNEDITOR.convertContentsForEditor.consistencyCheck.fail] "+e)}if(this.managedTagsInfo&&this.managedTagsInfo.query){const e=t.querySelectorAll(this.managedTagsInfo.query);for(let t,i,n=0,o=e.length;n
    ":(n=a.htmlRemoveWhiteSpace(n),this._tagConvertor(n))},convertHTMLForCodeView:function(e,t){let i="";const n=s.RegExp,o=new n("^(BLOCKQUOTE|PRE|TABLE|THEAD|TBODY|TR|TH|TD|OL|UL|IMG|IFRAME|VIDEO|AUDIO|FIGURE|FIGCAPTION|HR|BR|CANVAS|SELECT)$","i"),l="string"==typeof e?r.createRange().createContextualFragment(e):e,c=function(e){return this.isFormatElement(e)||this.isComponent(e)}.bind(a),u=t?"":"\n";let d=t?0:1*this._variable.codeIndent;return d=d>0?new s.Array(d+1).join(" "):"",function e(t,l){const r=t.childNodes,h=o.test(t.nodeName),p=h?l:"";for(let f,g,m,v,b,y,w=0,_=r.length;w<_;w++)f=r[w],v=o.test(f.nodeName),g=v?u:"",m=!c(f)||h||/^(TH|TD)$/i.test(t.nodeName)?"":u,8!==f.nodeType?3!==f.nodeType?0!==f.childNodes.length?f.outerHTML?(b=f.nodeName.toLowerCase(),y=p||v?l:"",i+=(m||(h?"":g))+y+f.outerHTML.match(n("<"+b+"[^>]*>","i"))[0]+g,e(f,l+d),i+=(/\n$/.test(i)?y:"")+""+(m||g||h||/^(TH|TD)$/i.test(f.nodeName)?u:"")):i+=(new s.XMLSerializer).serializeToString(f):i+=(/^HR$/i.test(f.nodeName)?u:"")+(/^PRE$/i.test(f.parentElement.nodeName)&&/^BR$/i.test(f.nodeName)?"":p)+f.outerHTML+g:a.isList(f.parentElement)||(i+=a._HTMLConvertor(/^\n+$/.test(f.data)?"":f.data)):i+="\n\x3c!-- "+f.textContent.trim()+" --\x3e"+g}(l,""),i.trim()+u},addDocEvent:function(e,t,i){r.addEventListener(e,t,i),o.iframe&&this._wd.addEventListener(e,t)},removeDocEvent:function(e,t){r.removeEventListener(e,t),o.iframe&&this._wd.removeEventListener(e,t)},_charCount:function(e){const t=o.maxCharCount,i=o.charCounterType;let n=0;if(e&&(n=this.getCharLength(e,i)),this._setCharCount(),t>0){let e=!1;const o=h.getCharCount(i);if(o>t){if(e=!0,n>0){this._editorRange();const e=this.getRange(),i=e.endOffset-1,n=this.getSelectionNode().textContent,l=e.endOffset-(o-t);this.getSelectionNode().textContent=n.slice(0,l<0?0:l)+n.slice(e.endOffset,n.length),this.setRange(e.endContainer,i,e.endContainer,i)}}else o+n>t&&(e=!0);if(e&&(this._callCounterBlink(),n>0))return!1}return!0},checkCharCount:function(e,t){if(o.maxCharCount){const i=t||o.charCounterType,n=this.getCharLength("string"==typeof e?e:this._charTypeHTML&&1===e.nodeType?e.outerHTML:e.textContent,i);if(n>0&&n+h.getCharCount(i)>o.maxCharCount)return this._callCounterBlink(),!1}return!0},getCharLength:function(e,t){return/byte/.test(t)?a.getByteLength(e):e.length},resetResponsiveToolbar:function(){u.controllersOff();const t=d._responsiveButtonSize;if(t){let i=0;i=(u._isBalloon||u._isInline)&&"auto"===o.toolbarWidth?e.element.topArea.offsetWidth:e.element.toolbar.offsetWidth;let n="default";for(let e=1,o=t.length;e-1||!a.hasOwn(t,o)||(n.indexOf(o)>-1?i[o].active.call(this,null):t.OUTDENT&&/^OUTDENT$/i.test(o)?a.isImportantDisabled(t.OUTDENT)||t.OUTDENT.setAttribute("disabled",!0):t.INDENT&&/^INDENT$/i.test(o)?a.isImportantDisabled(t.INDENT)||t.INDENT.removeAttribute("disabled"):a.removeClass(t[o],"active"))},_init:function(n,l){const c=s.RegExp;this._ww=o.iframe?e.element.wysiwygFrame.contentWindow:s,this._wd=r,this._charTypeHTML="byte-html"===o.charCounterType,this.wwComputedStyle=s.getComputedStyle(e.element.wysiwyg),this._editorHeight=e.element.wysiwygFrame.offsetHeight,this._editorHeightPadding=a.getNumber(this.wwComputedStyle.getPropertyValue("padding-top"))+a.getNumber(this.wwComputedStyle.getPropertyValue("padding-bottom")),this._classNameFilter=function(e){return this.test(e)?e:""}.bind(o.allowedClassNames);const u=o.__allowedScriptTag?"":"script|";if(this.__scriptTagRegExp=new c("<(script)[^>]*>([\\s\\S]*?)<\\/\\1>|]*\\/?>","gi"),this.__disallowedTagsRegExp=new c("<("+u+"style)[^>]*>([\\s\\S]*?)<\\/\\1>|<("+u+"style)[^>]*\\/?>","gi"),this.__disallowedTagNameRegExp=new c("^("+u+"meta|link|style|[a-z]+:[a-z]+)$","i"),this.__allowedScriptRegExp=new c("^"+(o.__allowedScriptTag?"script":"")+"$","i"),!o.iframe&&"function"==typeof s.ShadowRoot){let t=e.element.wysiwygFrame;for(;t;){if(t.shadowRoot){this._shadowRoot=t.shadowRoot;break}if(t instanceof s.ShadowRoot){this._shadowRoot=t;break}t=t.parentNode}this._shadowRoot&&(this._shadowRootControllerEventTarget=[])}const d=s.Object.keys(o._textTagsMap),h=o.addTagsWhitelist?o.addTagsWhitelist.split("|").filter((function(e){return/b|i|ins|s|strike/i.test(e)})):[];for(let e=0;e^<]+)?\\s*(?=>)","gi");const p=function(e,t){return e?"*"===e?"[a-z-]+":t?e+"|"+t:e:"^"},f="contenteditable|colspan|rowspan|target|href|download|rel|src|alt|class|type|controls|origin-size";this._allowHTMLComments=o._editorTagsWhitelist.indexOf("//")>-1||"*"===o._editorTagsWhitelist,this._htmlCheckWhitelistRegExp=new c("^("+p(o._editorTagsWhitelist.replace("|//",""),"")+")$","i"),this._htmlCheckBlacklistRegExp=new c("^("+(o.tagsBlacklist||"^")+")$","i"),this.editorTagsWhitelistRegExp=a.createTagsWhitelist(p(o._editorTagsWhitelist.replace("|//","|\x3c!--|--\x3e"),"")),this.editorTagsBlacklistRegExp=a.createTagsBlacklist(o.tagsBlacklist.replace("|//","|\x3c!--|--\x3e")),this.pasteTagsWhitelistRegExp=a.createTagsWhitelist(p(o.pasteTagsWhitelist,"")),this.pasteTagsBlacklistRegExp=a.createTagsBlacklist(o.pasteTagsBlacklist);const g='\\s*=\\s*(")[^"]*\\1',m=o.attributesWhitelist;let v={},b="";if(m)for(let e in m)a.hasOwn(m,e)&&!/^on[a-z]+$/i.test(m[e])&&("all"===e?b=p(m[e],f):v[e]=new c("\\s(?:"+p(m[e],"")+")"+g,"ig"));this._attributesWhitelistRegExp=new c("\\s(?:"+(b||f+"|data-format|data-size|data-file-size|data-file-name|data-origin|data-align|data-image-link|data-rotate|data-proportion|data-percentage|data-exp|data-font-size")+")"+g,"ig"),this._attributesWhitelistRegExp_all_data=new c("\\s(?:"+(b||f)+"|data-[a-z0-9\\-]+)"+g,"ig"),this._attributesTagsWhitelist=v;const y=o.attributesBlacklist;if(v={},b="",y)for(let e in y)a.hasOwn(y,e)&&("all"===e?b=p(y[e],""):v[e]=new c("\\s(?:"+p(y[e],"")+")"+g,"ig"));this._attributesBlacklistRegExp=new c("\\s(?:"+(b||"^")+")"+g,"ig"),this._attributesTagsBlacklist=v,this._isInline=/inline/i.test(o.mode),this._isBalloon=/balloon|balloon-always/i.test(o.mode),this._isBalloonAlways=/balloon-always/i.test(o.mode),this._cachingButtons(),this._fileInfoPluginsCheck=[],this._fileInfoPluginsReset=[],this.managedTagsInfo={query:"",map:{}};const w=[];this.activePlugins=[],this._fileManager.tags=[],this._fileManager.pluginMap={};let _,x,C=[];for(let e in i)if(a.hasOwn(i,e)){if(_=i[e],x=t[e],(_.active||_.action)&&x&&this.callPlugin(e,null,x),"function"==typeof _.checkFileInfo&&"function"==typeof _.resetFileInfo&&(this.callPlugin(e,null,x),this._fileInfoPluginsCheck.push(_.checkFileInfo.bind(this)),this._fileInfoPluginsReset.push(_.resetFileInfo.bind(this))),s.Array.isArray(_.fileTags)){const t=_.fileTags;this.callPlugin(e,null,x),this._fileManager.tags=this._fileManager.tags.concat(t),C.push(e);for(let i=0,n=t.length;ic&&(u=u.slice(0,c),s&&s.setAttribute("disabled",!0)),u[c]=o?{contents:i,s:{path:n.getNodePath(o.startContainer,null,null),offset:o.startOffset},e:{path:n.getNodePath(o.endContainer,null,null),offset:o.endOffset}}:{contents:i,s:{path:[0,0],offset:[0,0]},e:{path:0,offset:0}},1===c&&r&&r.removeAttribute("disabled"),e._setCharCount(),t()}return{stack:u,push:function(t){i.setTimeout(e._resourcesStateChange.bind(e));const n="number"==typeof t?t>0?t:0:t?o:0;n&&!a||(i.clearTimeout(a),n)?a=i.setTimeout((function(){i.clearTimeout(a),a=null,h()}),n):h()},undo:function(){c>0&&(c--,d())},redo:function(){u.length-1>c&&(c++,d())},go:function(e){c=e<0?u.length-1:e,d()},getCurrentIndex:function(){return c},reset:function(i){r&&r.setAttribute("disabled",!0),s&&s.setAttribute("disabled",!0),e._variable.isChanged=!1,e.context.tool.save&&e.context.tool.save.setAttribute("disabled",!0),u.splice(0),c=0,u[c]={contents:e.getContents(!0),s:{path:[0,0],offset:0},e:{path:[0,0],offset:0}},i||t()},_resetCachingButton:function(){l=e.context.element,r=e.context.tool.undo,s=e.context.tool.redo,0===c?(r&&r.setAttribute("disabled",!0),s&&c===u.length-1&&s.setAttribute("disabled",!0),e._variable.isChanged=!1,e.context.tool.save&&e.context.tool.save.setAttribute("disabled",!0)):c===u.length-1&&s&&s.setAttribute("disabled",!0)},_destroy:function(){a&&i.clearTimeout(a),u=null}}}(this,this._onChange_historyStack.bind(this)),this.addModule([X]),o.iframe&&(this._wd=e.element.wysiwygFrame.contentDocument,e.element.wysiwyg=this._wd.body,o._editorStyles.editor&&(e.element.wysiwyg.style.cssText=o._editorStyles.editor),"auto"===o.height&&(this._iframeAuto=this._wd.body)),this._initWysiwygArea(n,l)},_cachingButtons:function(){this.codeViewDisabledButtons=e.element._buttonTray.querySelectorAll('.se-menu-list button[data-display]:not([class~="se-code-view-enabled"]):not([data-display="MORE"])'),this.resizingDisabledButtons=e.element._buttonTray.querySelectorAll('.se-menu-list button[data-display]:not([class~="se-resizing-enabled"]):not([data-display="MORE"])');const t=e.tool,i=this.commandMap;i.INDENT=t.indent,i.OUTDENT=t.outdent,i[o.textTags.bold.toUpperCase()]=t.bold,i[o.textTags.underline.toUpperCase()]=t.underline,i[o.textTags.italic.toUpperCase()]=t.italic,i[o.textTags.strike.toUpperCase()]=t.strike,i[o.textTags.sub.toUpperCase()]=t.subscript,i[o.textTags.sup.toUpperCase()]=t.superscript,this._styleCommandMap={fullScreen:t.fullScreen,showBlocks:t.showBlocks,codeView:t.codeView},this._saveButtonStates()},_initWysiwygArea:function(t,i){e.element.wysiwyg.innerHTML=t?i:this.convertContentsForEditor(("string"==typeof i?i:/^TEXTAREA$/i.test(e.element.originElement.nodeName)?e.element.originElement.value:e.element.originElement.innerHTML)||"")},_resourcesStateChange:function(){this._iframeAutoHeight(),this._checkPlaceholder()},_onChange_historyStack:function(){this.hasFocus&&d._applyTagEffects(),this._variable.isChanged=!0,e.tool.save&&e.tool.save.removeAttribute("disabled"),h.onChange&&h.onChange(this.getContents(!0),this),"block"===e.element.toolbar.style.display&&d._showToolbarBalloon()},_iframeAutoHeight:function(){this._iframeAuto?s.setTimeout((function(){const t=u._iframeAuto.offsetHeight;e.element.wysiwygFrame.style.height=t+"px",a.isResizeObserverSupported||u.__callResizeFunction(t,null)})):a.isResizeObserverSupported||u.__callResizeFunction(e.element.wysiwygFrame.offsetHeight,null)},__callResizeFunction:function(e,t){e=-1===e?t.borderBoxSize&&t.borderBoxSize[0]?t.borderBoxSize[0].blockSize:t.contentRect.height+this._editorHeightPadding:e,this._editorHeight!==e&&("function"==typeof h.onResizeEditor&&h.onResizeEditor(e,this._editorHeight,u,t),this._editorHeight=e)},_checkPlaceholder:function(){if(this._placeholder){if(this._variable.isCodeView)return void(this._placeholder.style.display="none");const t=e.element.wysiwyg;!a.onlyZeroWidthSpace(t.textContent)||t.querySelector(a._allowedEmptyNodeList)||(t.innerText.match(/\n/g)||"").length>1?this._placeholder.style.display="none":this._placeholder.style.display="block"}},_setDefaultFormat:function(e){if(this._fileManager.pluginRegExp.test(this.currentControllerName))return;const t=this.getRange(),i=t.commonAncestorContainer,n=t.startContainer,l=a.getRangeFormatElement(i,null);let r,s,c;const u=a.getParentElement(i,a.isComponent);if(!u||a.isTable(u)){if(1===i.nodeType&&"true"===i.getAttribute("data-se-embed")){let e=i.nextElementSibling;return a.isFormatElement(e)||(e=this.appendFormatTag(i,o.defaultTag)),void this.setRange(e.firstChild,0,e.firstChild,0)}if(!a.isRangeFormatElement(n)&&!a.isWysiwygDiv(n)||!a.isComponent(n.children[t.startOffset])&&!a.isComponent(n.children[t.startOffset-1])){if(a.getParentElement(i,a.isNotCheckingNode))return null;if(l)return c=a.createElement(e||o.defaultTag),c.innerHTML=l.innerHTML,0===c.childNodes.length&&(c.innerHTML=a.zeroWidthSpace),l.innerHTML=c.outerHTML,c=l.firstChild,r=a.getEdgeChildNodes(c,null).sc,r||(r=a.createTextNode(a.zeroWidthSpace),c.insertBefore(r,c.firstChild)),s=r.textContent.length,void this.setRange(r,s,r,s);if(a.isRangeFormatElement(i)&&i.childNodes.length<=1){let e=null;return 1===i.childNodes.length&&a.isBreak(i.firstChild)?e=i.firstChild:(e=a.createTextNode(a.zeroWidthSpace),i.appendChild(e)),void this.setRange(e,1,e,1)}try{if(3===i.nodeType&&(c=a.createElement(e||o.defaultTag),i.parentNode.insertBefore(c,i),c.appendChild(i)),a.isBreak(c.nextSibling)&&a.removeItem(c.nextSibling),a.isBreak(c.previousSibling)&&a.removeItem(c.previousSibling),a.isBreak(r)){const e=a.createTextNode(a.zeroWidthSpace);r.parentNode.insertBefore(e,r),r=e}}catch(t){this.execCommand("formatBlock",!1,e||o.defaultTag),this.removeRange(),this._editorRange()}if(a.isBreak(c.nextSibling)&&a.removeItem(c.nextSibling),a.isBreak(c.previousSibling)&&a.removeItem(c.previousSibling),a.isBreak(r)){const e=a.createTextNode(a.zeroWidthSpace);r.parentNode.insertBefore(e,r),r=e}this.effectNode=null,this.nativeFocus()}}},_setOptionsInit:function(t,i){this.context=e=Y(t.originElement,this._getConstructed(t),o),this._componentsInfoReset=!0,this._editorInit(!0,i)},_editorInit:function(t,i){this._init(t,i),d._addEvent(),this._setCharCount(),d._offStickyToolbar(),d.onResize_window(),e.element.toolbar.style.visibility="";const n=o.frameAttrbutes;for(let t in n)e.element.wysiwyg.setAttribute(t,n[t]);this._checkComponents(),this._componentsInfoInit=!1,this._componentsInfoReset=!1,this.history.reset(!0),s.setTimeout((function(){"function"==typeof u._resourcesStateChange&&(d._resizeObserver&&d._resizeObserver.observe(e.element.wysiwygFrame),d._toolbarObserver&&d._toolbarObserver.observe(e.element._toolbarShadow),u._resourcesStateChange(),"function"==typeof h.onload&&h.onload(u,t))}))},_getConstructed:function(e){return{_top:e.topArea,_relative:e.relative,_toolBar:e.toolbar,_toolbarShadow:e._toolbarShadow,_menuTray:e._menuTray,_editorArea:e.editorArea,_wysiwygArea:e.wysiwygFrame,_codeArea:e.code,_placeholder:e.placeholder,_resizingBar:e.resizingBar,_navigation:e.navigation,_charCounter:e.charCounter,_charWrapper:e.charWrapper,_loading:e.loading,_lineBreaker:e.lineBreaker,_lineBreaker_t:e.lineBreaker_t,_lineBreaker_b:e.lineBreaker_b,_resizeBack:e.resizeBackground,_stickyDummy:e._stickyDummy,_arrow:e._arrow}}},d={_IEisComposing:!1,_lineBreakerBind:null,_responsiveCurrentSize:"default",_responsiveButtonSize:null,_responsiveButtons:null,_cursorMoveKeyCode:new s.RegExp("^(8|3[2-9]|40|46)$"),_directionKeyCode:new s.RegExp("^(8|13|3[2-9]|40|46)$"),_nonTextKeyCode:new s.RegExp("^(8|13|1[6-9]|20|27|3[3-9]|40|45|46|11[2-9]|12[0-3]|144|145)$"),_historyIgnoreKeyCode:new s.RegExp("^(1[6-9]|20|27|3[3-9]|40|45|11[2-9]|12[0-3]|144|145)$"),_onButtonsCheck:new s.RegExp("^("+s.Object.keys(o._textTagsMap).join("|")+")$","i"),_frontZeroWidthReg:new s.RegExp(a.zeroWidthSpace+"+",""),_keyCodeShortcut:{65:"A",66:"B",83:"S",85:"U",73:"I",89:"Y",90:"Z",219:"[",221:"]"},_shortcutCommand:function(e,t){let i=null;const n=d._keyCodeShortcut[e];switch(n){case"A":i="selectAll";break;case"B":-1===o.shortcutsDisable.indexOf("bold")&&(i="bold");break;case"S":t&&-1===o.shortcutsDisable.indexOf("strike")?i="strike":t||-1!==o.shortcutsDisable.indexOf("save")||(i="save");break;case"U":-1===o.shortcutsDisable.indexOf("underline")&&(i="underline");break;case"I":-1===o.shortcutsDisable.indexOf("italic")&&(i="italic");break;case"Z":-1===o.shortcutsDisable.indexOf("undo")&&(i=t?"redo":"undo");break;case"Y":-1===o.shortcutsDisable.indexOf("undo")&&(i="redo");break;case"[":-1===o.shortcutsDisable.indexOf("indent")&&(i=o.rtl?"indent":"outdent");break;case"]":-1===o.shortcutsDisable.indexOf("indent")&&(i=o.rtl?"outdent":"indent")}return i?(u.commandHandler(u.commandMap[i],i),!0):!!n},_applyTagEffects:function(){let t=u.getSelectionNode();if(t===u.effectNode)return;u.effectNode=t;const n=o.rtl?"marginRight":"marginLeft",l=u.commandMap,r=d._onButtonsCheck,s=[],c=[],h=u.activePlugins,p=h.length;let f="";for(;t.firstChild;)t=t.firstChild;for(let e=t;!a.isWysiwygDiv(e)&&e;e=e.parentNode)if(1===e.nodeType&&!a.isBreak(e)){if(f=e.nodeName.toUpperCase(),c.push(f),!u.isReadOnly)for(let t,n=0;n0)&&(s.push("OUTDENT"),l.OUTDENT.removeAttribute("disabled")),-1===s.indexOf("INDENT")&&l.INDENT&&!a.isImportantDisabled(l.INDENT)&&(s.push("INDENT"),a.isListCell(e)&&!e.previousElementSibling?l.INDENT.setAttribute("disabled",!0):l.INDENT.removeAttribute("disabled"))):r&&r.test(f)&&(s.push(f),a.addClass(l[f],"active"))}u._setKeyEffect(s),u._variable.currentNodes=c.reverse(),u._variable.currentNodesMap=s,o.showPathLabel&&(e.element.navigation.textContent=u._variable.currentNodes.join(" > "))},_buttonsEventHandler:function(e){let t=e.target;if(u._bindControllersOff&&e.stopPropagation(),/^(input|textarea|select|option)$/i.test(t.nodeName)?u._antiBlur=!1:e.preventDefault(),a.getParentElement(t,".se-submenu"))e.stopPropagation(),u._notHideToolbar=!0;else{let i=t.getAttribute("data-command"),n=t.className;for(;!i&&!/se-menu-list/.test(n)&&!/sun-editor-common/.test(n);)t=t.parentNode,i=t.getAttribute("data-command"),n=t.className;i!==u._submenuName&&i!==u._containerName||e.stopPropagation()}},addGlobalEvent:(e,t,i)=>(o.iframe&&u._ww.addEventListener(e,t,i),u._w.addEventListener(e,t,i),{type:e,listener:t,useCapture:i}),removeGlobalEvent(e,t,i){e&&("object"==typeof e&&(t=e.listener,i=e.useCapture,e=e.type),o.iframe&&u._ww.removeEventListener(e,t,i),u._w.removeEventListener(e,t,i))},onClick_toolbar:function(e){let t=e.target,i=t.getAttribute("data-display"),n=t.getAttribute("data-command"),o=t.className;for(u.controllersOff();t.parentNode&&!n&&!/se-menu-list/.test(o)&&!/se-toolbar/.test(o);)t=t.parentNode,n=t.getAttribute("data-command"),i=t.getAttribute("data-display"),o=t.className;(n||i)&&(t.disabled||u.actionCall(n,i,t))},__selectionSyncEvent:null,onMouseDown_wysiwyg:function(t){if(u.isReadOnly||a.isNonEditable(e.element.wysiwyg))return;if(a._isExcludeSelectionElement(t.target))return void t.preventDefault();if(d.removeGlobalEvent(d.__selectionSyncEvent),d.__selectionSyncEvent=d.addGlobalEvent("mouseup",(function(){u._editorRange(),d.removeGlobalEvent(d.__selectionSyncEvent)})),"function"==typeof h.onMouseDown&&!1===h.onMouseDown(t,u))return;const i=a.getParentElement(t.target,a.isCell);if(i){const e=u.plugins.table;e&&i!==e._fixedCell&&!e._shift&&u.callPlugin("table",(function(){e.onTableCellMultiSelect.call(u,i,!1)}),null)}u._isBalloon&&d._hideToolbar()},onClick_wysiwyg:function(t){const i=t.target;if(u.isReadOnly)return t.preventDefault(),a.isAnchor(i)&&s.open(i.href,i.target),!1;if(a.isNonEditable(e.element.wysiwyg))return;if("function"==typeof h.onClick&&!1===h.onClick(t,u))return;const n=u.getFileComponent(i);if(n)return t.preventDefault(),void u.selectComponent(n.target,n.pluginName);const l=a.getParentElement(i,"FIGCAPTION");if(l&&a.isNonEditable(l)&&(t.preventDefault(),l.focus(),u._isInline&&!u._inlineToolbarAttr.isShow)){d._showToolbarInline();const e=function(){d._hideToolbar(),l.removeEventListener("blur",e)};l.addEventListener("blur",e)}if(u._editorRange(),3===t.detail){let e=u.getRange();a.isFormatElement(e.endContainer)&&0===e.endOffset&&(e=u.setRange(e.startContainer,e.startOffset,e.startContainer,e.startContainer.length),u._rangeInfo(e,u.getSelection()))}const r=u.getSelectionNode(),c=a.getFormatElement(r,null),p=a.getRangeFormatElement(r,null);let f=r;for(;f.firstChild;)f=f.firstChild;const g=u.getFileComponent(f);if(g){const e=u.getRange();p||e.startContainer!==e.endContainer||u.selectComponent(g.target,g.pluginName)}else u.currentFileComponentInfo&&u.controllersOff();if(c||a.isNonEditable(i)||a.isList(p))d._applyTagEffects();else{const e=u.getRange();if(a.getFormatElement(e.startContainer)===a.getFormatElement(e.endContainer))if(a.isList(p)){t.preventDefault();const e=a.createElement("LI"),i=r.nextElementSibling;e.appendChild(r),p.insertBefore(e,i),u.focus()}else a.isWysiwygDiv(r)||a.isComponent(r)||a.isTable(r)&&!a.isCell(r)||null===u._setDefaultFormat(a.isRangeFormatElement(p)?"DIV":o.defaultTag)?d._applyTagEffects():(t.preventDefault(),u.focus())}u._isBalloon&&s.setTimeout(d._toggleToolbarBalloon)},_balloonDelay:null,_showToolbarBalloonDelay:function(){d._balloonDelay&&s.clearTimeout(d._balloonDelay),d._balloonDelay=s.setTimeout(function(){s.clearTimeout(this._balloonDelay),this._balloonDelay=null,this._showToolbarBalloon()}.bind(d),350)},_toggleToolbarBalloon:function(){u._editorRange();const e=u.getRange();u._bindControllersOff||!u._isBalloonAlways&&e.collapsed?d._hideToolbar():d._showToolbarBalloon(e)},_showToolbarBalloon:function(t){if(!u._isBalloon)return;const i=t||u.getRange(),n=e.element.toolbar,l=e.element.topArea,r=u.getSelection();let c;if(u._isBalloonAlways&&i.collapsed)c=!0;else if(r.focusNode===r.anchorNode)c=r.focusOffset0&&d._getPageBottomSpace()<_?(t=!0,w=!0):t&&r.documentElement.offsetTop>_&&(t=!1,w=!0),w&&(b=(t?i.top-g-p:i.bottom+p)-(i.noText?0:h)+u),n.style.left=s.Math.floor(y)+"px",n.style.top=s.Math.floor(b)+"px",t?(a.removeClass(e.element._arrow,"se-arrow-up"),a.addClass(e.element._arrow,"se-arrow-down"),e.element._arrow.style.top=g+"px"):(a.removeClass(e.element._arrow,"se-arrow-down"),a.addClass(e.element._arrow,"se-arrow-up"),e.element._arrow.style.top=-p+"px");const x=s.Math.floor(f/2+(m-y));e.element._arrow.style.left=(x+p>n.offsetWidth?n.offsetWidth-p:x";const e=m.attributes;for(;e[0];)m.removeAttribute(e[0].name)}else{const e=a.createElement(o.defaultTag);e.innerHTML="
    ",m.parentElement.replaceChild(e,m)}return u.nativeFocus(),!1}}const n=p.startContainer;if(m&&!m.previousElementSibling&&0===p.startOffset&&3===n.nodeType&&!a.isFormatElement(n.parentNode)){let e=n.parentNode.previousSibling;const t=n.parentNode.nextSibling;e||(t?e=t:(e=a.createElement("BR"),m.appendChild(e)));let i=n;for(;m.contains(i)&&!i.previousSibling;)i=i.parentNode;if(!m.contains(i)){n.textContent="",a.removeItemAllParents(n,null,m);break}}if(d._isUneditableNode(p,!0)){t.preventDefault(),t.stopPropagation();break}!f&&u._isEdgeFormat(p.startContainer,p.startOffset,"start")&&a.isFormatElement(m.previousElementSibling)&&(u._formatAttrsTemp=m.previousElementSibling.attributes);const b=p.commonAncestorContainer;if(m=a.getFormatElement(p.startContainer,null),v=a.getRangeFormatElement(m,null),v&&m&&!a.isCell(v)&&!/^FIGCAPTION$/i.test(v.nodeName)){if(a.isListCell(m)&&a.isList(v)&&(a.isListCell(v.parentNode)||m.previousElementSibling)&&(i===m||3===i.nodeType&&(!i.previousSibling||a.isList(i.previousSibling)))&&(a.getFormatElement(p.startContainer,null)!==a.getFormatElement(p.endContainer,null)?v.contains(p.startContainer):0===p.startOffset&&p.collapsed)){if(p.startContainer!==p.endContainer)t.preventDefault(),u.removeNode(),3===p.startContainer.nodeType&&u.setRange(p.startContainer,p.startContainer.textContent.length,p.startContainer,p.startContainer.textContent.length),u.history.push(!0);else{let e=m.previousElementSibling||v.parentNode;if(a.isListCell(e)){t.preventDefault();let i=e;if(!e.contains(m)&&a.isListCell(i)&&a.isList(i.lastElementChild)){for(i=i.lastElementChild.lastElementChild;a.isListCell(i)&&a.isList(i.lastElementChild);)i=i.lastElementChild&&i.lastElementChild.lastElementChild;e=i}let n=e===v.parentNode?v.previousSibling:e.lastChild;n||(n=a.createTextNode(a.zeroWidthSpace),v.parentNode.insertBefore(n,v.parentNode.firstChild));const o=3===n.nodeType?n.textContent.length:1,l=m.childNodes;let r=n,s=l[0];for(;s=l[0];)e.insertBefore(s,r.nextSibling),r=s;a.removeItem(m),0===v.children.length&&a.removeItem(v),u.setRange(n,o,n,o),u.history.push(!0)}}break}if(!f&&0===p.startOffset){let e=!0,i=b;for(;i&&i!==v&&!a.isWysiwygDiv(i);){if(i.previousSibling&&(1===i.previousSibling.nodeType||!a.onlyZeroWidthSpace(i.previousSibling.textContent.trim()))){e=!1;break}i=i.parentNode}if(e&&v.parentNode){t.preventDefault(),u.detachRangeFormatElement(v,a.isListCell(m)?[m]:null,null,!1,!1),u.history.push(!0);break}}}if(!f&&m&&(0===p.startOffset||i===m&&m.childNodes[p.startOffset])){const e=i===m?m.childNodes[p.startOffset]:i,n=m.previousSibling,o=(3===b.nodeType||a.isBreak(b))&&!b.previousSibling&&0===p.startOffset;if(e&&!e.previousSibling&&(b&&a.isComponent(b.previousSibling)||o&&a.isComponent(n))){const e=u.getFileComponent(n);e?(t.preventDefault(),t.stopPropagation(),0===m.textContent.length&&a.removeItem(m),!1===u.selectComponent(e.target,e.pluginName)&&u.blur()):a.isComponent(n)&&(t.preventDefault(),t.stopPropagation(),a.removeItem(n));break}if(e&&a.isNonEditable(e.previousSibling)){t.preventDefault(),t.stopPropagation(),a.removeItem(e.previousSibling);break}}break;case 46:if(g){t.preventDefault(),t.stopPropagation(),u.plugins[g].destroy.call(u);break}if(f&&d._hardDelete()){t.preventDefault(),t.stopPropagation();break}if(d._isUneditableNode(p,!1)){t.preventDefault(),t.stopPropagation();break}if((a.isFormatElement(i)||null===i.nextSibling||a.onlyZeroWidthSpace(i.nextSibling)&&null===i.nextSibling.nextSibling)&&p.startOffset===i.textContent.length){const e=m.nextElementSibling;if(!e)break;if(a.isComponent(e)){if(t.preventDefault(),a.onlyZeroWidthSpace(m)&&(a.removeItem(m),a.isTable(e))){let t=a.getChildElement(e,a.isCell,!1);t=t.firstElementChild||t,u.setRange(t,0,t,0);break}const i=u.getFileComponent(e);i?(t.stopPropagation(),!1===u.selectComponent(i.target,i.pluginName)&&u.blur()):a.isComponent(e)&&(t.stopPropagation(),a.removeItem(e));break}}if(!f&&(u.isEdgePoint(p.endContainer,p.endOffset)||i===m&&m.childNodes[p.startOffset])){const e=i===m&&m.childNodes[p.startOffset]||i;if(e&&a.isNonEditable(e.nextSibling)){t.preventDefault(),t.stopPropagation(),a.removeItem(e.nextSibling);break}if(a.isComponent(e)){t.preventDefault(),t.stopPropagation(),a.removeItem(e);break}}if(!f&&u._isEdgeFormat(p.endContainer,p.endOffset,"end")&&a.isFormatElement(m.nextElementSibling)&&(u._formatAttrsTemp=m.attributes),m=a.getFormatElement(p.startContainer,null),v=a.getRangeFormatElement(m,null),a.isListCell(m)&&a.isList(v)&&(i===m||3===i.nodeType&&(!i.nextSibling||a.isList(i.nextSibling))&&(a.getFormatElement(p.startContainer,null)!==a.getFormatElement(p.endContainer,null)?v.contains(p.endContainer):p.endOffset===i.textContent.length&&p.collapsed))){p.startContainer!==p.endContainer&&u.removeNode();let e=a.getArrayItem(m.children,a.isList,!1);if(e=e||m.nextElementSibling||v.parentNode.nextElementSibling,e&&(a.isList(e)||a.getArrayItem(e.children,a.isList,!1))){let i,n;if(t.preventDefault(),a.isList(e)){const t=e.firstElementChild;for(n=t.childNodes,i=n[0];n[0];)m.insertBefore(n[0],e);a.removeItem(t)}else{for(i=e.firstChild,n=e.childNodes;n[0];)m.appendChild(n[0]);a.removeItem(e)}u.setRange(i,0,i,0),u.history.push(!0)}break}break;case 9:if(g||o.tabDisable)break;if(t.preventDefault(),r||c||a.isWysiwygDiv(i))break;const y=!p.collapsed||u.isEdgePoint(p.startContainer,p.startOffset),w=u.getSelectedElements(null);i=u.getSelectionNode();const _=[];let x=[],C=a.isListCell(w[0]),k=a.isListCell(w[w.length-1]),S={sc:p.startContainer,so:p.startOffset,ec:p.endContainer,eo:p.endOffset};for(let e,t=0,i=w.length;t0&&y&&u.plugins.list)S=u.plugins.list.editInsideList.call(u,l,_);else{const e=a.getParentElement(i,a.isCell);if(e&&y){const t=a.getParentElement(e,"table"),i=a.getListChildren(t,a.isCell);let n=l?a.prevIdx(i,e):a.nextIdx(i,e);n!==i.length||l||(n=0),-1===n&&l&&(n=i.length-1);let o=i[n];if(!o)break;o=o.firstElementChild||o,u.setRange(o,0,o,0);break}x=x.concat(_),C=k=null}if(x.length>0)if(l){const e=x.length-1;for(let t,i=0;i<=e;i++){t=x[i].childNodes;for(let e,i=0,n=t.length;i":"<"+m.nodeName+">
    ",!u.checkCharCount(e,"byte-html"))return t.preventDefault(),!1}if(!l&&!g){const n=u._isEdgeFormat(p.endContainer,p.endOffset,"end"),l=u._isEdgeFormat(p.startContainer,p.startOffset,"start");if(n&&(/^H[1-6]$/i.test(m.nodeName)||/^HR$/i.test(m.nodeName))){d._enterPrevent(t);let e=null;const i=u.appendFormatTag(m,o.defaultTag);if(n&&n.length>0){e=n.pop();const t=e;for(;n.length>0;)e=e.appendChild(n.pop());i.appendChild(t)}if(e=e?e.appendChild(i.firstChild):i.firstChild,a.isBreak(e)){const t=a.createTextNode(a.zeroWidthSpace);e.parentNode.insertBefore(t,e),u.setRange(t,1,t,1)}else u.setRange(e,0,e,0);break}if(v&&m&&!a.isCell(v)&&!/^FIGCAPTION$/i.test(v.nodeName)){const e=u.getRange();if(u.isEdgePoint(e.endContainer,e.endOffset)&&a.isList(i.nextSibling)){d._enterPrevent(t);const e=a.createElement("LI"),n=a.createElement("BR");e.appendChild(n),m.parentNode.insertBefore(e,m.nextElementSibling),e.appendChild(i.nextSibling),u.setRange(n,1,n,1);break}if((3!==e.commonAncestorContainer.nodeType||!e.commonAncestorContainer.nextElementSibling)&&a.onlyZeroWidthSpace(m.innerText.trim())&&!a.isListCell(m.nextElementSibling)){d._enterPrevent(t);let e=null;if(a.isListCell(v.parentNode)){const t=m.parentNode.parentNode;v=t.parentNode;const i=a.createElement("LI");i.innerHTML="
    ",a.copyTagAttributes(i,m,o.lineAttrReset),e=i,v.insertBefore(e,t.nextElementSibling)}else{const t=a.isCell(v.parentNode)?"DIV":a.isList(v.parentNode)?"LI":a.isFormatElement(v.nextElementSibling)&&!a.isRangeFormatElement(v.nextElementSibling)?v.nextElementSibling.nodeName:a.isFormatElement(v.previousElementSibling)&&!a.isRangeFormatElement(v.previousElementSibling)?v.previousElementSibling.nodeName:o.defaultTag;e=a.createElement(t),a.copyTagAttributes(e,m,o.lineAttrReset);const i=u.detachRangeFormatElement(v,[m],null,!0,!0);i.cc.insertBefore(e,i.ec)}e.innerHTML="
    ",a.removeItemAllParents(m,null,null),u.setRange(e,1,e,1);break}}if(L){d._enterPrevent(t);const e=i===L,n=u.getSelection(),o=i.childNodes,l=n.focusOffset,r=i.previousElementSibling,s=i.nextSibling;if(!a.isClosureFreeFormatElement(L)&&o&&(e&&p.collapsed&&o.length-1<=l+1&&a.isBreak(o[l])&&(!o[l+1]||(!o[l+2]||a.onlyZeroWidthSpace(o[l+2].textContent))&&3===o[l+1].nodeType&&a.onlyZeroWidthSpace(o[l+1].textContent))&&l>0&&a.isBreak(o[l-1])||!e&&a.onlyZeroWidthSpace(i.textContent)&&a.isBreak(r)&&(a.isBreak(r.previousSibling)||!a.onlyZeroWidthSpace(r.previousSibling.textContent))&&(!s||!a.isBreak(s)&&a.onlyZeroWidthSpace(s.textContent)))){e?a.removeItem(o[l-1]):a.removeItem(i);const t=u.appendFormatTag(L,a.isFormatElement(L.nextElementSibling)&&!a.isRangeFormatElement(L.nextElementSibling)?L.nextElementSibling:null);a.copyFormatAttributes(t,L),u.setRange(t,1,t,1);break}if(e){h.insertHTML(p.collapsed&&a.isBreak(p.startContainer.childNodes[p.startOffset-1])?"
    ":"

    ",!0,!1);let e=n.focusNode;const t=n.focusOffset;L===e&&(e=e.childNodes[t-l>1?t-1:t]),u.setRange(e,1,e,1)}else{const e=n.focusNode.nextSibling,t=a.createElement("BR");u.insertNode(t,null,!1);const i=t.previousSibling,o=t.nextSibling;a.isBreak(e)||a.isBreak(i)||o&&!a.onlyZeroWidthSpace(o)?u.setRange(o,0,o,0):(t.parentNode.insertBefore(t.cloneNode(!1),t),u.setRange(t,1,t,1))}d._onShortcutKey=!0;break}if(p.collapsed&&(l||n)){d._enterPrevent(t);const e=a.createElement("BR"),r=a.createElement(m.nodeName);a.copyTagAttributes(r,m,o.lineAttrReset);let s=e;do{if(!a.isBreak(i)&&1===i.nodeType){const e=i.cloneNode(!1);e.appendChild(s),s=e}i=i.parentNode}while(m!==i&&m.contains(i));r.appendChild(s),m.parentNode.insertBefore(r,l&&!n?m:m.nextElementSibling),n&&u.setRange(e,1,e,1);break}if(m){let i;t.stopPropagation();let r=0;if(p.collapsed)i=a.onlyZeroWidthSpace(m)?u.appendFormatTag(m,m.cloneNode(!1)):a.splitElement(p.endContainer,p.endOffset,a.getElementDepth(m));else{const s=a.getFormatElement(p.startContainer,null)!==a.getFormatElement(p.endContainer,null),c=m.cloneNode(!1);c.innerHTML="
    ";const h=u.removeNode();if(i=a.getFormatElement(h.container,null),!i){a.isWysiwygDiv(h.container)&&(d._enterPrevent(t),e.element.wysiwyg.appendChild(c),i=c,a.copyTagAttributes(i,m,o.lineAttrReset),u.setRange(i,r,i,r));break}const f=a.getRangeFormatElement(h.container);if(i=i.contains(f)?a.getChildElement(f,a.getFormatElement.bind(a)):i,s){if(n&&!l)i.parentNode.insertBefore(c,h.prevContainer&&h.container!==h.prevContainer?i:i.nextElementSibling),i=c,r=0;else if(r=h.offset,l){const e=i.parentNode.insertBefore(c,i);n&&(i=e,r=0)}}else n&&l?(i.parentNode.insertBefore(c,h.prevContainer&&h.container===h.prevContainer?i.nextElementSibling:i),i=c,r=0):i=a.splitElement(h.container,h.offset,a.getElementDepth(m))}d._enterPrevent(t),a.copyTagAttributes(i,m,o.lineAttrReset),u.setRange(i,r,i,r);break}}if(f)break;if(v&&a.getParentElement(v,"FIGCAPTION")&&a.getParentElement(v,a.isList)&&(d._enterPrevent(t),m=u.appendFormatTag(m,null),u.setRange(m,0,m,0)),g){t.preventDefault(),t.stopPropagation(),u.containerOff(),u.controllersOff();const i=e[g],n=i._container,r=n.previousElementSibling||n.nextElementSibling;let s=null;a.isListCell(n.parentNode)?s=a.createElement("BR"):(s=a.createElement(a.isFormatElement(r)&&!a.isRangeFormatElement(r)?r.nodeName:o.defaultTag),s.innerHTML="
    "),l?n.parentNode.insertBefore(s,n):n.parentNode.insertBefore(s,n.nextElementSibling),u.callPlugin(g,(function(){!1===u.selectComponent(i._element,g)&&u.blur()}),null)}break;case 27:if(g)return t.preventDefault(),t.stopPropagation(),u.controllersOff(),!1}if(l&&16===n){t.preventDefault(),t.stopPropagation();const e=u.plugins.table;if(e&&!e._shift&&!e._ref){const t=a.getParentElement(m,a.isCell);if(t)return void e.onTableCellMultiSelect.call(u,t,!0)}}else if(l&&(a.isOSX_IOS?c:r)&&32===n){t.preventDefault(),t.stopPropagation();const e=u.insertNode(a.createTextNode(" "));if(e&&e.container)return void u.setRange(e.container,e.endOffset,e.container,e.endOffset)}if(a.isIE&&!r&&!c&&!f&&!d._nonTextKeyCode.test(n)&&a.isBreak(p.commonAncestorContainer)){const e=a.createTextNode(a.zeroWidthSpace);u.insertNode(e,null,!1),u.setRange(e,1,e,1)}d._directionKeyCode.test(n)&&(u._editorRange(),d._applyTagEffects())}},_onKeyDown_wysiwyg_arrowKey:function(e){if(e.shiftKey)return;let t=u.getSelectionNode();const i=function(t,i=0){if(e.preventDefault(),e.stopPropagation(),!t)return;let n=u.getFileComponent(t);n?u.selectComponent(n.target,n.pluginName):(u.setRange(t,i,t,i),u.controllersOff())},n=a.getParentElement(t,"table");if(n){const o=a.getParentElement(t,"tr"),l=a.getParentElement(t,"td");let r=l,s=l;if(l){for(;r.firstChild;)r=r.firstChild;for(;s.lastChild;)s=s.lastChild}let c=t;for(;c.firstChild;)c=c.firstChild;const d=c===r,h=c===s;let p=null,f=0;if(38===e.keyCode&&d){const e=o&&o.previousElementSibling;for(p=e?e.children[l.cellIndex]:a.getPreviousDeepestNode(n,u.context.element.wysiwyg);p.lastChild;)p=p.lastChild;p&&(f=p.textContent.length)}else if(40===e.keyCode&&h){const e=o&&o.nextElementSibling;for(p=e?e.children[l.cellIndex]:a.getNextDeepestNode(n,u.context.element.wysiwyg);p.firstChild;)p=p.firstChild}if(p)return i(p,f),!1}const o=u.getFileComponent(t);if(o){const t=/37|38/.test(e.keyCode),n=/39|40/.test(e.keyCode);if(t){const e=a.getPreviousDeepestNode(o.target,u.context.element.wysiwyg);i(e,e&&e.textContent.length)}else n&&i(a.getNextDeepestNode(o.target,u.context.element.wysiwyg))}},onKeyUp_wysiwyg:function(e){if(d._onShortcutKey)return;u._editorRange();const t=e.keyCode,i=e.ctrlKey||e.metaKey||91===t||92===t||224===t,n=e.altKey;if(u.isReadOnly)return void(!i&&d._cursorMoveKeyCode.test(t)&&d._applyTagEffects());const l=u.getRange();let r=u.getSelectionNode();if(u._isBalloon&&(u._isBalloonAlways&&27!==t||!l.collapsed)){if(!u._isBalloonAlways)return void d._showToolbarBalloon();27!==t&&d._showToolbarBalloonDelay()}let s=r;for(;s.firstChild;)s=s.firstChild;const c=u.getFileComponent(s);if(16!==e.keyCode&&!e.shiftKey&&c?u.selectComponent(c.target,c.pluginName):u.currentFileComponentInfo&&u.controllersOff(),8===t&&a.isWysiwygDiv(r)&&""===r.textContent&&0===r.children.length){e.preventDefault(),e.stopPropagation(),r.innerHTML="";const t=a.createElement(a.isFormatElement(u._variable.currentNodes[0])?u._variable.currentNodes[0]:o.defaultTag);return t.innerHTML="
    ",r.appendChild(t),u.setRange(t,0,t,0),d._applyTagEffects(),void u.history.push(!1)}const p=a.getFormatElement(r,null),f=a.getRangeFormatElement(r,null),g=u._formatAttrsTemp;if(g){for(let e=0,i=g.length;e0?n-l-e.element.toolbar.offsetHeight:0;n=i+l?(u._sticky||d._onStickyToolbar(s),t.toolbar.style.top=s+i+l+o.stickyToolbar-n-u._variable.minResizingSize+"px"):n>=l&&d._onStickyToolbar(s)},_getEditorOffsets:function(t){let i=t||e.element.topArea,n=0,o=0,l=0;for(;i;)n+=i.offsetTop,o+=i.offsetLeft,l+=i.scrollTop,i=i.offsetParent;return{top:n,left:o,scroll:l}},_getPageBottomSpace:function(){return r.documentElement.scrollHeight-(d._getEditorOffsets(null).top+e.element.topArea.offsetHeight)},_onStickyToolbar:function(t){const i=e.element;u._isInline||o.toolbarContainer||(i._stickyDummy.style.height=i.toolbar.offsetHeight+"px",i._stickyDummy.style.display="block"),i.toolbar.style.top=o.stickyToolbar+t+"px",i.toolbar.style.width=u._isInline?u._inlineToolbarAttr.width:i.toolbar.offsetWidth+"px",a.addClass(i.toolbar,"se-toolbar-sticky"),u._sticky=!0},_offStickyToolbar:function(){const t=e.element;t._stickyDummy.style.display="none",t.toolbar.style.top=u._isInline?u._inlineToolbarAttr.top:"",t.toolbar.style.width=u._isInline?u._inlineToolbarAttr.width:"",t.editorArea.style.marginTop="",a.removeClass(t.toolbar,"se-toolbar-sticky"),u._sticky=!1},_codeViewAutoHeight:function(){u._variable.isFullScreen||(e.element.code.style.height=e.element.code.scrollHeight+"px")},_hardDelete:function(){const e=u.getRange(),t=e.startContainer,i=e.endContainer,n=a.getRangeFormatElement(t),o=a.getRangeFormatElement(i),l=a.isCell(n),r=a.isCell(o),s=e.commonAncestorContainer;if((l&&!n.previousElementSibling&&!n.parentElement.previousElementSibling||r&&!o.nextElementSibling&&!o.parentElement.nextElementSibling)&&n!==o)if(l){if(r)return a.removeItem(a.getParentElement(n,(function(e){return s===e.parentNode}))),u.nativeFocus(),!0;a.removeItem(a.getParentElement(n,(function(e){return s===e.parentNode})))}else a.removeItem(a.getParentElement(o,(function(e){return s===e.parentNode})));const c=1===t.nodeType?a.getParentElement(t,".se-component"):null,d=1===i.nodeType?a.getParentElement(i,".se-component"):null;return c&&a.removeItem(c),d&&a.removeItem(d),!1},onPaste_wysiwyg:function(e){const t=a.isIE?s.clipboardData:e.clipboardData;return!t||d._dataTransferAction("paste",e,t)},_setClipboardComponent:function(e,t,i){e.preventDefault(),e.stopPropagation(),i.setData("text/html",t.component.outerHTML)},onCopy_wysiwyg:function(e){const t=a.isIE?s.clipboardData:e.clipboardData;if("function"==typeof h.onCopy&&!1===h.onCopy(e,t,u))return e.preventDefault(),e.stopPropagation(),!1;const i=u.currentFileComponentInfo;i&&!a.isIE&&(d._setClipboardComponent(e,i,t),a.addClass(i.component,"se-component-copy"),s.setTimeout((function(){a.removeClass(i.component,"se-component-copy")}),150))},onSave_wysiwyg:function(e){"function"!=typeof h.onSave||h.onSave(e,u)},onCut_wysiwyg:function(e){const t=a.isIE?s.clipboardData:e.clipboardData;if("function"==typeof h.onCut&&!1===h.onCut(e,t,u))return e.preventDefault(),e.stopPropagation(),!1;const i=u.currentFileComponentInfo;i&&!a.isIE&&(d._setClipboardComponent(e,i,t),a.removeItem(i.component),u.controllersOff()),s.setTimeout((function(){u.history.push(!1)}))},onDrop_wysiwyg:function(e){if(u.isReadOnly||a.isIE)return e.preventDefault(),e.stopPropagation(),!1;const t=e.dataTransfer;return!t||(d._setDropLocationSelection(e),u.removeNode(),document.body.contains(u.currentControllerTarget)||u.controllersOff(),d._dataTransferAction("drop",e,t))},_setDropLocationSelection:function(e){const t={startContainer:null,startOffset:null,endContainer:null,endOffset:null};let i=null;if(e.rangeParent?(t.startContainer=e.rangeParent,t.startOffset=e.rangeOffset,t.endContainer=e.rangeParent,t.endOffset=e.rangeOffset):i=u._wd.caretRangeFromPoint?u._wd.caretRangeFromPoint(e.clientX,e.clientY):u.getRange(),i&&(t.startContainer=i.startContainer,t.startOffset=i.startOffset,t.endContainer=i.endContainer,t.endOffset=i.endOffset),t.startContainer===t.endContainer){const e=a.getParentElement(t.startContainer,a.isComponent);e&&(t.startContainer=e,t.startOffset=0,t.endContainer=e,t.endOffset=0)}u.setRange(t.startContainer,t.startOffset,t.endContainer,t.endOffset)},_dataTransferAction:function(t,i,n){let o,l;if(a.isIE){o=n.getData("Text");const r=u.getRange(),c=a.createElement("DIV"),h={sc:r.startContainer,so:r.startOffset,ec:r.endContainer,eo:r.endOffset};return c.setAttribute("contenteditable",!0),c.style.cssText="position:absolute; top:0; left:0; width:1px; height:1px; overflow:hidden;",e.element.relative.appendChild(c),c.focus(),s.setTimeout((function(){l=c.innerHTML,a.removeItem(c),u.setRange(h.sc,h.so,h.ec,h.eo),d._setClipboardData(t,i,o,l,n)})),!0}if(o=n.getData("text/plain"),l=n.getData("text/html"),!1===d._setClipboardData(t,i,o,l,n))return i.preventDefault(),i.stopPropagation(),!1},_setClipboardData:function(e,t,i,n,o){const l=/class=["']*Mso(Normal|List)/i.test(n)||/content=["']*Word.Document/i.test(n)||/content=["']*OneNote.File/i.test(n)||/content=["']*Excel.Sheet/i.test(n);n?(n=n.replace(/^\r?\n?\r?\n?\x3C!--StartFragment--\>|\x3C!--EndFragment-->\r?\n?<\/body\>\r?\n?<\/html>$/g,""),l&&(n=n.replace(/\n/g," "),i=i.replace(/\n/g," ")),n=u.cleanHTML(n,u.pasteTagsWhitelistRegExp,u.pasteTagsBlacklistRegExp)):n=a._HTMLConvertor(i).replace(/\n/g,"
    ");const r=u._charCount(u._charTypeHTML?n:i);if("paste"===e&&"function"==typeof h.onPaste){const e=h.onPaste(t,n,r,u);if(!1===e)return!1;if("string"==typeof e){if(!e)return!1;n=e}}if("drop"===e&&"function"==typeof h.onDrop){const e=h.onDrop(t,n,r,u);if(!1===e)return!1;if("string"==typeof e){if(!e)return!1;n=e}}const s=o.files;return s.length>0&&!l?(/^image/.test(s[0].type)&&u.plugins.image&&h.insertImage(s),!1):!!r&&(n?(h.insertHTML(n,!0,!1),!1):void 0)},onMouseMove_wysiwyg:function(t){if(u.isDisabled||u.isReadOnly)return!1;const i=a.getParentElement(t.target,a.isComponent),n=u._lineBreaker.style;if(i&&!u.currentControllerName){const l=e.element;let r=0,s=l.wysiwyg;do{r+=s.scrollTop,s=s.parentElement}while(s&&!/^(BODY|HTML)$/i.test(s.nodeName));const c=l.wysiwyg.scrollTop,h=d._getEditorOffsets(null),p=a.getOffset(i,l.wysiwygFrame).top+c,f=t.pageY+r+(o.iframe&&!o.toolbarContainer?l.toolbar.offsetHeight:0),g=p+(o.iframe?r:h.top),m=a.isListCell(i.parentNode);let v="",b="";if((m?!i.previousSibling:!a.isFormatElement(i.previousElementSibling))&&fg+i.offsetHeight-20))return void(n.display="none");b=p+i.offsetHeight,v="b"}u._variable._lineBreakComp=i,u._variable._lineBreakDir=v,n.top=b-c+"px",u._lineBreakerButton.style.left=a.getOffset(i).left+i.offsetWidth/2-15+"px",n.display="block"}else"none"!==n.display&&(n.display="none")},_enterPrevent(e){e.preventDefault(),a.isMobile&&u.__focusTemp.focus()},_onMouseDown_lineBreak:function(e){e.preventDefault()},_onLineBreak:function(e){e.preventDefault();const t=u._variable._lineBreakComp,i=this?this:u._variable._lineBreakDir,n=a.isListCell(t.parentNode),l=a.createElement(n?"BR":a.isCell(t.parentNode)?"DIV":o.defaultTag);if(n||(l.innerHTML="
    "),u._charTypeHTML&&!u.checkCharCount(l.outerHTML,"byte-html"))return;t.parentNode.insertBefore(l,"t"===i?t:t.nextSibling),u._lineBreaker.style.display="none",u._variable._lineBreakComp=null;const r=n?l:l.firstChild;u.setRange(r,1,r,1),u.history.push(!1)},_resizeObserver:null,_toolbarObserver:null,_addEvent:function(){const t=o.iframe?u._ww:e.element.wysiwyg;a.isResizeObserverSupported&&(this._resizeObserver=new s.ResizeObserver((function(e){u.__callResizeFunction(-1,e[0])}))),e.element.toolbar.addEventListener("mousedown",d._buttonsEventHandler,!1),e.element._menuTray.addEventListener("mousedown",d._buttonsEventHandler,!1),e.element.toolbar.addEventListener("click",d.onClick_toolbar,!1),t.addEventListener("mousedown",d.onMouseDown_wysiwyg,!1),t.addEventListener("click",d.onClick_wysiwyg,!1),t.addEventListener(a.isIE?"textinput":"input",d.onInput_wysiwyg,!1),t.addEventListener("keydown",d.onKeyDown_wysiwyg,!1),t.addEventListener("keyup",d.onKeyUp_wysiwyg,!1),t.addEventListener("paste",d.onPaste_wysiwyg,!1),t.addEventListener("copy",d.onCopy_wysiwyg,!1),t.addEventListener("cut",d.onCut_wysiwyg,!1),t.addEventListener("drop",d.onDrop_wysiwyg,!1),t.addEventListener("scroll",d.onScroll_wysiwyg,!1),t.addEventListener("focus",d.onFocus_wysiwyg,!1),t.addEventListener("blur",d.onBlur_wysiwyg,!1),d._lineBreakerBind={a:d._onLineBreak.bind(""),t:d._onLineBreak.bind("t"),b:d._onLineBreak.bind("b")},t.addEventListener("mousemove",d.onMouseMove_wysiwyg,!1),u._lineBreakerButton.addEventListener("mousedown",d._onMouseDown_lineBreak,!1),u._lineBreakerButton.addEventListener("click",d._lineBreakerBind.a,!1),e.element.lineBreaker_t.addEventListener("mousedown",d._lineBreakerBind.t,!1),e.element.lineBreaker_b.addEventListener("mousedown",d._lineBreakerBind.b,!1),t.addEventListener("touchstart",d.onMouseDown_wysiwyg,{passive:!0,useCapture:!1}),t.addEventListener("touchend",d.onClick_wysiwyg,{passive:!0,useCapture:!1}),"auto"!==o.height||o.codeMirrorEditor||(e.element.code.addEventListener("keydown",d._codeViewAutoHeight,!1),e.element.code.addEventListener("keyup",d._codeViewAutoHeight,!1),e.element.code.addEventListener("paste",d._codeViewAutoHeight,!1)),e.element.resizingBar&&(/\d+/.test(o.height)&&o.resizeEnable?e.element.resizingBar.addEventListener("mousedown",d.onMouseDown_resizingBar,!1):a.addClass(e.element.resizingBar,"se-resizing-none")),d._setResponsiveToolbar(),a.isResizeObserverSupported&&(this._toolbarObserver=new s.ResizeObserver(u.resetResponsiveToolbar)),s.addEventListener("resize",d.onResize_window,!1),o.stickyToolbar>-1&&s.addEventListener("scroll",d.onScroll_window,!1)},_removeEvent:function(){const t=o.iframe?u._ww:e.element.wysiwyg;e.element.toolbar.removeEventListener("mousedown",d._buttonsEventHandler),e.element._menuTray.removeEventListener("mousedown",d._buttonsEventHandler),e.element.toolbar.removeEventListener("click",d.onClick_toolbar),t.removeEventListener("mousedown",d.onMouseDown_wysiwyg),t.removeEventListener("click",d.onClick_wysiwyg),t.removeEventListener(a.isIE?"textinput":"input",d.onInput_wysiwyg),t.removeEventListener("keydown",d.onKeyDown_wysiwyg),t.removeEventListener("keyup",d.onKeyUp_wysiwyg),t.removeEventListener("paste",d.onPaste_wysiwyg),t.removeEventListener("copy",d.onCopy_wysiwyg),t.removeEventListener("cut",d.onCut_wysiwyg),t.removeEventListener("drop",d.onDrop_wysiwyg),t.removeEventListener("scroll",d.onScroll_wysiwyg),t.removeEventListener("mousemove",d.onMouseMove_wysiwyg),u._lineBreakerButton.removeEventListener("mousedown",d._onMouseDown_lineBreak),u._lineBreakerButton.removeEventListener("click",d._lineBreakerBind.a),e.element.lineBreaker_t.removeEventListener("mousedown",d._lineBreakerBind.t),e.element.lineBreaker_b.removeEventListener("mousedown",d._lineBreakerBind.b),d._lineBreakerBind=null,t.removeEventListener("touchstart",d.onMouseDown_wysiwyg,{passive:!0,useCapture:!1}),t.removeEventListener("touchend",d.onClick_wysiwyg,{passive:!0,useCapture:!1}),t.removeEventListener("focus",d.onFocus_wysiwyg),t.removeEventListener("blur",d.onBlur_wysiwyg),e.element.code.removeEventListener("keydown",d._codeViewAutoHeight),e.element.code.removeEventListener("keyup",d._codeViewAutoHeight),e.element.code.removeEventListener("paste",d._codeViewAutoHeight),e.element.resizingBar&&e.element.resizingBar.removeEventListener("mousedown",d.onMouseDown_resizingBar),d._resizeObserver&&(d._resizeObserver.unobserve(e.element.wysiwygFrame),d._resizeObserver=null),d._toolbarObserver&&(d._toolbarObserver.unobserve(e.element._toolbarShadow),d._toolbarObserver=null),s.removeEventListener("resize",d.onResize_window),s.removeEventListener("scroll",d.onScroll_window)},_setResponsiveToolbar:function(){if(0===l.length)return void(l=null);d._responsiveCurrentSize="default";const e=d._responsiveButtonSize=[],t=d._responsiveButtons={default:l[0]};for(let i,n,o=1,r=l.length;o';for(let e,i=0,n=o.length;i0&&(r+='
    '+t(l)+"
    ",l=[]),"object"==typeof e&&(r+='
    '+t(e)+"
    ")));return r+='
    ",r},_makeColorList:function(e){let t="";t+='
      ';for(let i,n=0,o=e.length;n');return t+="
    ",t},init:function(e,t){const i=this.plugins.colorPicker;let n=t||(i.getColorInNode.call(this,e)||this.context.colorPicker._defaultColor);n=i.isHexColor(n)?n:i.rgb2hex(n)||n;const o=this.context.colorPicker._colorList;if(o)for(let e=0,t=o.length;e=3&&"#"+((1<<24)+(i[0]<<16)+(i[1]<<8)+i[2]).toString(16).substr(1)}},Ve={name:"fontColor",display:"submenu",add:function(e,t){e.addModule([Pe]);const i=e.context;i.fontColor={previewEl:null,colorInput:null,colorList:null};let n=this.setSubmenu(e);i.fontColor.colorInput=n.querySelector("._se_color_picker_input"),i.fontColor.colorInput.addEventListener("keyup",this.onChangeInput.bind(e)),n.querySelector("._se_color_picker_submit").addEventListener("click",this.submit.bind(e)),n.querySelector("._se_color_picker_remove").addEventListener("click",this.remove.bind(e)),n.addEventListener("click",this.pickup.bind(e)),i.fontColor.colorList=n.querySelectorAll("li button"),e.initMenuTarget(this.name,t,n),n=null},setSubmenu:function(e){const t=e.context.colorPicker.colorListHTML,i=e.util.createElement("DIV");return i.className="se-submenu se-list-layer",i.innerHTML=t,i},on:function(){const e=this.context.colorPicker,t=this.context.fontColor;e._colorInput=t.colorInput;const i=this.wwComputedStyle.color;e._defaultColor=i?this.plugins.colorPicker.isHexColor(i)?i:this.plugins.colorPicker.rgb2hex(i):"#333333",e._styleProperty="color",e._colorList=t.colorList,this.plugins.colorPicker.init.call(this,this.getSelectionNode(),null)},onChangeInput:function(e){this.plugins.colorPicker.setCurrentColor.call(this,e.target.value)},submit:function(){this.plugins.fontColor.applyColor.call(this,this.context.colorPicker._currentColor)},pickup:function(e){e.preventDefault(),e.stopPropagation(),this.plugins.fontColor.applyColor.call(this,e.target.getAttribute("data-value"))},remove:function(){this.nodeChange(null,["color"],["span"],!0),this.submenuOff()},applyColor:function(e){if(!e)return;const t=this.util.createElement("SPAN");t.style.color=e,this.nodeChange(t,["color"],null,null),this.submenuOff()}},Ue={name:"hiliteColor",display:"submenu",add:function(e,t){e.addModule([Pe]);const i=e.context;i.hiliteColor={previewEl:null,colorInput:null,colorList:null};let n=this.setSubmenu(e);i.hiliteColor.colorInput=n.querySelector("._se_color_picker_input"),i.hiliteColor.colorInput.addEventListener("keyup",this.onChangeInput.bind(e)),n.querySelector("._se_color_picker_submit").addEventListener("click",this.submit.bind(e)),n.querySelector("._se_color_picker_remove").addEventListener("click",this.remove.bind(e)),n.addEventListener("click",this.pickup.bind(e)),i.hiliteColor.colorList=n.querySelectorAll("li button"),e.initMenuTarget(this.name,t,n),n=null},setSubmenu:function(e){const t=e.context.colorPicker.colorListHTML,i=e.util.createElement("DIV");return i.className="se-submenu se-list-layer",i.innerHTML=t,i},on:function(){const e=this.context.colorPicker,t=this.context.hiliteColor;e._colorInput=t.colorInput;const i=this.wwComputedStyle.backgroundColor;e._defaultColor=i?this.plugins.colorPicker.isHexColor(i)?i:this.plugins.colorPicker.rgb2hex(i):"#ffffff",e._styleProperty="backgroundColor",e._colorList=t.colorList,this.plugins.colorPicker.init.call(this,this.getSelectionNode(),null)},onChangeInput:function(e){this.plugins.colorPicker.setCurrentColor.call(this,e.target.value)},submit:function(){this.plugins.hiliteColor.applyColor.call(this,this.context.colorPicker._currentColor)},pickup:function(e){e.preventDefault(),e.stopPropagation(),this.plugins.hiliteColor.applyColor.call(this,e.target.getAttribute("data-value"))},remove:function(){this.nodeChange(null,["background-color"],["span"],!0),this.submenuOff()},applyColor:function(e){if(!e)return;const t=this.util.createElement("SPAN");t.style.backgroundColor=e,this.nodeChange(t,["background-color"],null,null),this.submenuOff()}},We={name:"template",display:"submenu",add:function(e,t){e.context.template={selectedIndex:-1};let i=this.setSubmenu(e);i.querySelector("ul").addEventListener("click",this.pickup.bind(e)),e.initMenuTarget(this.name,t,i),i=null},setSubmenu:function(e){const t=e.options.templates;if(!t||0===t.length)throw Error('[SUNEDITOR.plugins.template.fail] To use the "template" plugin, please define the "templates" option.');const i=e.util.createElement("DIV");i.className="se-list-layer";let n='
      ';for(let e,i=0,o=t.length;i";return n+="
    ",i.innerHTML=n,i},pickup:function(e){if(!/^BUTTON$/i.test(e.target.tagName))return!1;e.preventDefault(),e.stopPropagation(),this.context.template.selectedIndex=1*e.target.getAttribute("data-value");const t=this.options.templates[this.context.template.selectedIndex];if(!t.html)throw this.submenuOff(),Error('[SUNEDITOR.template.fail] cause : "templates[i].html not found"');this.setContents(t.html),this.submenuOff()}};var je=i(350),qe=i.n(je);const Ze={name:"selectMenu",add:function(e){e.context.selectMenu={caller:{},callerContext:null}},setForm:function(){return'
    '},createList:function(e,t,i){e.form.innerHTML="
      "+i+"
    ",e.items=t,e.menus=e.form.querySelectorAll("li")},initEvent:function(e,t){const i=t.querySelector(".se-select-list"),n=this.context.selectMenu.caller[e]={form:i,items:[],menus:[],index:-1,item:null,clickMethod:null,callerName:e};i.addEventListener("mousedown",this.plugins.selectMenu.onMousedown_list),i.addEventListener("mousemove",this.plugins.selectMenu.onMouseMove_list.bind(this,n)),i.addEventListener("click",this.plugins.selectMenu.onClick_list.bind(this,n))},onMousedown_list:function(e){e.preventDefault(),e.stopPropagation()},onMouseMove_list:function(e,t){this.util.addClass(e.form,"__se_select-menu-mouse-move");const i=t.target.getAttribute("data-index");i&&(e.index=1*i)},onClick_list:function(e,t){const i=t.target.getAttribute("data-index");i&&e.clickMethod.call(this,e.items[i])},moveItem:function(e,t){this.util.removeClass(e.form,"__se_select-menu-mouse-move"),t=e.index+t;const i=e.menus,n=i.length,o=e.index=t>=n?0:t<0?n-1:t;for(let e=0;e
    "+e.plugins.selectMenu.setForm()+'
    '+o.bookmark+''+o.download+'
    ",l.innerHTML=r,l},initEvent:function(e,t){const i=this.plugins.anchor,n=this.context.anchor.caller[e]={modal:t,urlInput:null,linkDefaultRel:this.options.linkRelDefault,defaultRel:this.options.linkRelDefault.default||"",currentRel:[],linkAnchor:null,linkValue:"",_change:!1,callerName:e};"string"==typeof n.linkDefaultRel.default&&(n.linkDefaultRel.default=n.linkDefaultRel.default.trim()),"string"==typeof n.linkDefaultRel.check_new_window&&(n.linkDefaultRel.check_new_window=n.linkDefaultRel.check_new_window.trim()),"string"==typeof n.linkDefaultRel.check_bookmark&&(n.linkDefaultRel.check_bookmark=n.linkDefaultRel.check_bookmark.trim()),n.urlInput=t.querySelector(".se-input-url"),n.anchorText=t.querySelector("._se_anchor_text"),n.newWindowCheck=t.querySelector("._se_anchor_check"),n.downloadCheck=t.querySelector("._se_anchor_download"),n.download=t.querySelector("._se_anchor_download_icon"),n.preview=t.querySelector(".se-link-preview"),n.bookmark=t.querySelector("._se_anchor_bookmark_icon"),n.bookmarkButton=t.querySelector("._se_bookmark_button"),this.plugins.selectMenu.initEvent.call(this,e,t);const o=this.context.selectMenu.caller[e];this.options.linkRel.length>0&&(n.relButton=t.querySelector(".se-anchor-rel-btn"),n.relList=t.querySelector(".se-list-layer"),n.relPreview=t.querySelector(".se-anchor-rel-preview"),n.relButton.addEventListener("click",i.onClick_relButton.bind(this,n)),n.relList.addEventListener("click",i.onClick_relList.bind(this,n))),n.newWindowCheck.addEventListener("change",i.onChange_newWindowCheck.bind(this,n)),n.downloadCheck.addEventListener("change",i.onChange_downloadCheck.bind(this,n)),n.anchorText.addEventListener("input",i.onChangeAnchorText.bind(this,n)),n.urlInput.addEventListener("input",i.onChangeUrlInput.bind(this,n)),n.urlInput.addEventListener("keydown",i.onKeyDownUrlInput.bind(this,o)),n.urlInput.addEventListener("focus",i.onFocusUrlInput.bind(this,n,o)),n.urlInput.addEventListener("blur",i.onBlurUrlInput.bind(this,o)),n.bookmarkButton.addEventListener("click",i.onClick_bookmarkButton.bind(this,n))},on:function(e,t){const i=this.plugins.anchor;if(t){if(e.linkAnchor){this.context.dialog.updateModal=!0;const t=e.linkAnchor.getAttribute("href");e.linkValue=e.preview.textContent=e.urlInput.value=i.selfPathBookmark.call(this,t)?t.substr(t.lastIndexOf("#")):t,e.anchorText.value=e.linkAnchor.textContent,e.newWindowCheck.checked=!!/_blank/i.test(e.linkAnchor.target),e.downloadCheck.checked=e.linkAnchor.download}}else i.init.call(this,e),e.anchorText.value=this.getSelection().toString().trim(),e.newWindowCheck.checked=this.options.linkTargetNewWindow;this.context.anchor.callerContext=e,i.setRel.call(this,e,t&&e.linkAnchor?e.linkAnchor.rel:e.defaultRel),i.setLinkPreview.call(this,e,e.linkValue),this.plugins.selectMenu.on.call(this,e.callerName,this.plugins.anchor.setHeaderBookmark)},selfPathBookmark:function(e){const t=this._w.location.href.replace(/\/$/,"");return 0===e.indexOf("#")||0===e.indexOf(t)&&e.indexOf("#")===(-1===t.indexOf("#")?t.length:t.substr(0,t.indexOf("#")).length)},_closeRelMenu:null,toggleRelList:function(e,t){if(t){const t=e.relButton,i=e.relList;this.util.addClass(t,"active"),i.style.visibility="hidden",i.style.display="block",this.options.rtl?i.style.left=t.offsetLeft-i.offsetWidth-1+"px":i.style.left=t.offsetLeft+t.offsetWidth+1+"px",i.style.top=t.offsetTop+t.offsetHeight/2-i.offsetHeight/2+"px",i.style.visibility="",this.plugins.anchor._closeRelMenu=function(e,t,i){i&&(e.relButton.contains(i.target)||e.relList.contains(i.target))||(this.util.removeClass(t,"active"),e.relList.style.display="none",this.modalForm.removeEventListener("click",this.plugins.anchor._closeRelMenu),this.plugins.anchor._closeRelMenu=null)}.bind(this,e,t),this.modalForm.addEventListener("click",this.plugins.anchor._closeRelMenu)}else this.plugins.anchor._closeRelMenu&&this.plugins.anchor._closeRelMenu()},onClick_relButton:function(e,t){this.plugins.anchor.toggleRelList.call(this,e,!this.util.hasClass(t.target,"active"))},onClick_relList:function(e,t){const i=t.target,n=i.getAttribute("data-command");if(!n)return;const o=e.currentRel,l=this.util.toggleClass(i,"se-checked"),r=o.indexOf(n);l?-1===r&&o.push(n):r>-1&&o.splice(r,1),e.relPreview.title=e.relPreview.textContent=o.join(" ")},setRel:function(e,t){const i=e.relList,n=e.currentRel=t?t.split(" "):[];if(!i)return;const o=i.querySelectorAll("button");for(let e,t=0,i=o.length;t-1?this.util.addClass(o[t],"se-checked"):this.util.removeClass(o[t],"se-checked");e.relPreview.title=e.relPreview.textContent=n.join(" ")},createHeaderList:function(e,t,i){const n=this.util.getListChildren(this.context.element.wysiwyg,(function(e){return/h[1-6]/i.test(e.nodeName)}));if(0===n.length)return;const o=new this._w.RegExp("^"+i.replace(/^#/,""),"i"),l=[];let r="";for(let e,t=0,i=n.length;t'+e.textContent+"");0===l.length?this.plugins.selectMenu.close.call(this,t):(this.plugins.selectMenu.createList(t,l,r),this.plugins.selectMenu.open.call(this,t,this.plugins.anchor._setMenuListPosition.bind(this,e)))},_setMenuListPosition:function(e,t){t.style.top=e.urlInput.offsetHeight+1+"px"},onKeyDownUrlInput:function(e,t){switch(t.keyCode){case 38:t.preventDefault(),t.stopPropagation(),this.plugins.selectMenu.moveItem.call(this,e,-1);break;case 40:t.preventDefault(),t.stopPropagation(),this.plugins.selectMenu.moveItem.call(this,e,1);break;case 13:e.index>-1&&(t.preventDefault(),t.stopPropagation(),this.plugins.anchor.setHeaderBookmark.call(this,this.plugins.selectMenu.getItem(e,null)))}},setHeaderBookmark:function(e){const t=this.context.anchor.callerContext,i=e.id||"h_"+this._w.Math.random().toString().replace(/.+\./,"");e.id=i,t.urlInput.value="#"+i,t.anchorText.value.trim()&&t._change||(t.anchorText.value=e.textContent),this.plugins.anchor.setLinkPreview.call(this,t,t.urlInput.value),this.plugins.selectMenu.close.call(this,this.context.selectMenu.callerContext),this.context.anchor.callerContext.urlInput.focus()},onChangeAnchorText:function(e,t){e._change=!!t.target.value.trim()},onChangeUrlInput:function(e,t){const i=t.target.value.trim();this.plugins.anchor.setLinkPreview.call(this,e,i),this.plugins.anchor.selfPathBookmark.call(this,i)?this.plugins.anchor.createHeaderList.call(this,e,this.context.selectMenu.callerContext,i):this.plugins.selectMenu.close.call(this,this.context.selectMenu.callerContext)},onFocusUrlInput:function(e,t){const i=e.urlInput.value;this.plugins.anchor.selfPathBookmark.call(this,i)&&this.plugins.anchor.createHeaderList.call(this,e,t,i)},onBlurUrlInput:function(e){this.plugins.selectMenu.close.call(this,e)},setLinkPreview:function(e,t){const i=e.preview,n=this.options.linkProtocol,o=this.options.linkNoPrefix,l=/^(mailto\:|tel\:|sms\:|https*\:\/\/|#)/.test(t)||0===t.indexOf(n),r=!!n&&this._w.RegExp("^"+this.util.escapeStringRegexp(t.substr(0,n.length))).test(n);t=e.linkValue=i.textContent=t?o?t:!n||l||r?l?t:/^www\./.test(t)?"http://"+t:this.context.anchor.host+(/^\//.test(t)?"":"/")+t:n+t:"",this.plugins.anchor.selfPathBookmark.call(this,t)?(e.bookmark.style.display="block",this.util.addClass(e.bookmarkButton,"active")):(e.bookmark.style.display="none",this.util.removeClass(e.bookmarkButton,"active")),!this.plugins.anchor.selfPathBookmark.call(this,t)&&e.downloadCheck.checked?e.download.style.display="block":e.download.style.display="none"},setCtx:function(e,t){e&&(t.linkAnchor=e,t.linkValue=e.href,t.currentRel=e.rel.split(" "))},updateAnchor:function(e,t,i,n,o){!this.plugins.anchor.selfPathBookmark.call(this,t)&&n.downloadCheck.checked?e.setAttribute("download",i||t):e.removeAttribute("download"),n.newWindowCheck.checked?e.target="_blank":e.removeAttribute("target");const l=n.currentRel.join(" ");l?e.rel=l:e.removeAttribute("rel"),e.href=t,o?0===e.children.length&&(e.textContent=""):e.textContent=i},createAnchor:function(e,t){if(0===e.linkValue.length)return null;const i=e.linkValue,n=e.anchorText,o=0===n.value.length?i:n.value,l=e.linkAnchor||this.util.createElement("A");return this.plugins.anchor.updateAnchor.call(this,l,i,o,e,t),e.linkValue=e.preview.textContent=e.urlInput.value=e.anchorText.value="",l},onClick_bookmarkButton:function(e){let t=e.urlInput.value;this.plugins.anchor.selfPathBookmark.call(this,t)?(t=t.substr(1),e.bookmark.style.display="none",this.util.removeClass(e.bookmarkButton,"active"),this.plugins.selectMenu.close.call(this,this.context.selectMenu.callerContext)):(t="#"+t,e.bookmark.style.display="block",this.util.addClass(e.bookmarkButton,"active"),e.downloadCheck.checked=!1,e.download.style.display="none",this.plugins.anchor.createHeaderList.call(this,e,this.context.selectMenu.callerContext,t)),e.urlInput.value=t,this.plugins.anchor.setLinkPreview.call(this,e,t),e.urlInput.focus()},onChange_newWindowCheck:function(e,t){"string"==typeof e.linkDefaultRel.check_new_window&&(t.target.checked?this.plugins.anchor.setRel.call(this,e,this.plugins.anchor._relMerge.call(this,e,e.linkDefaultRel.check_new_window)):this.plugins.anchor.setRel.call(this,e,this.plugins.anchor._relDelete.call(this,e,e.linkDefaultRel.check_new_window)))},onChange_downloadCheck:function(e,t){t.target.checked?(e.download.style.display="block",e.bookmark.style.display="none",this.util.removeClass(e.bookmarkButton,"active"),e.linkValue=e.preview.textContent=e.urlInput.value=e.urlInput.value.replace(/^\#+/,""),"string"==typeof e.linkDefaultRel.check_bookmark&&this.plugins.anchor.setRel.call(this,e,this.plugins.anchor._relMerge.call(this,e,e.linkDefaultRel.check_bookmark))):(e.download.style.display="none","string"==typeof e.linkDefaultRel.check_bookmark&&this.plugins.anchor.setRel.call(this,e,this.plugins.anchor._relDelete.call(this,e,e.linkDefaultRel.check_bookmark)))},_relMerge:function(e,t){const i=e.currentRel;if(!t)return i.join(" ");if(/^only\:/.test(t))return t=t.replace(/^only\:/,"").trim(),e.currentRel=t.split(" "),t;const n=t.split(" ");for(let e,t=0,o=n.length;t'+n.cancel+''+t.dialogBox.linkBox.title+""+e.context.anchor.forms.innerHTML+'";return i.innerHTML=o,i},setController_LinkButton:function(e){const t=e.lang,i=e.icons,n=e.util.createElement("DIV");return n.className="se-controller se-controller-link",n.innerHTML='
    ",n},open:function(){this.plugins.dialog.open.call(this,"link","link"===this.currentControllerName)},submit:function(e){this.showLoading(),e.preventDefault(),e.stopPropagation();try{const e=this.plugins.anchor.createAnchor.call(this,this.context.anchor.caller.link,!1);if(null===e)return;if(this.context.dialog.updateModal){const e=this.context.link._linkAnchor.childNodes[0];this.setRange(e,0,e,e.textContent.length)}else{const t=this.getSelectedElements();if(t.length>1){const i=this.util.createElement(t[0].nodeName);if(i.appendChild(e),!this.insertNode(i,null,!0))return}else if(!this.insertNode(e,null,!0))return;this.setRange(e.childNodes[0],0,e.childNodes[0],e.textContent.length)}}finally{this.plugins.dialog.close.call(this),this.closeLoading(),this.history.push(!1)}return!1},active:function(e){if(e){if(this.util.isAnchor(e)&&null===e.getAttribute("data-image-link"))return this.controllerArray.indexOf(this.context.link.linkController)<0&&this.plugins.link.call_controller.call(this,e),!0}else this.controllerArray.indexOf(this.context.link.linkController)>-1&&this.controllersOff();return!1},on:function(e){this.plugins.anchor.on.call(this,this.context.anchor.caller.link,e)},call_controller:function(e){this.editLink=this.context.link._linkAnchor=this.context.anchor.caller.link.linkAnchor=e;const t=this.context.link.linkController,i=t.querySelector("a");i.href=e.href,i.title=e.textContent,i.textContent=e.textContent,this.util.addClass(e,"on"),this.setControllerPosition(t,e,"bottom",{left:0,top:0}),this.controllersOn(t,e,"link",this.util.removeClass.bind(this.util,this.context.link._linkAnchor,"on"))},onClick_linkController:function(e){e.stopPropagation();const t=e.target.getAttribute("data-command")||e.target.parentNode.getAttribute("data-command");if(t){if(e.preventDefault(),/update/.test(t))this.plugins.dialog.open.call(this,"link",!0);else if(/unlink/.test(t)){const e=this.util.getChildElement(this.context.link._linkAnchor,(function(e){return 0===e.childNodes.length||3===e.nodeType}),!1),t=this.util.getChildElement(this.context.link._linkAnchor,(function(e){return 0===e.childNodes.length||3===e.nodeType}),!0);this.setRange(e,0,t,t.textContent.length),this.nodeChange(null,null,["A"],!1)}else this.util.removeItem(this.context.link._linkAnchor),this.context.anchor.caller.link.linkAnchor=null,this.focus(),this.history.push(!1);this.controllersOff()}},init:function(){this.context.link.linkController.style.display="none",this.plugins.anchor.init.call(this,this.context.anchor.caller.link)}};var Ke=i(315),Ye=i.n(Ke),Xe=i(345),Je=i.n(Xe),Qe=i(913),et=i.n(Qe);const tt={name:"image",display:"dialog",add:function(e){e.addModule([qe(),Ge,Ye(),Je(),et()]);const t=e.options,i=e.context,n=i.image={_infoList:[],_infoIndex:0,_uploadFileLength:0,focusElement:null,sizeUnit:t._imageSizeUnit,_linkElement:"",_altText:"",_align:"none",_floatClassRegExp:"__se__float\\-[a-z]+",_v_src:{_linkValue:""},svgDefaultSize:"30%",base64RenderIndex:0,_element:null,_cover:null,_container:null,inputX:null,inputY:null,_element_w:1,_element_h:1,_element_l:0,_element_t:0,_defaultSizeX:"auto",_defaultSizeY:"auto",_origin_w:"auto"===t.imageWidth?"":t.imageWidth,_origin_h:"auto"===t.imageHeight?"":t.imageHeight,_proportionChecked:!0,_resizing:t.imageResizing,_resizeDotHide:!t.imageHeightShow,_rotation:t.imageRotation,_alignHide:!t.imageAlignShow,_onlyPercentage:t.imageSizeOnlyPercentage,_ratio:!1,_ratioX:1,_ratioY:1,_captionShow:!0,_captionChecked:!1,_caption:null,captionCheckEl:null};let o=this.setDialog(e);n.modal=o,n.imgInputFile=o.querySelector("._se_image_file"),n.imgUrlFile=o.querySelector("._se_image_url"),n.focusElement=n.imgInputFile||n.imgUrlFile,n.altText=o.querySelector("._se_image_alt"),n.captionCheckEl=o.querySelector("._se_image_check_caption"),n.previewSrc=o.querySelector("._se_tab_content_image .se-link-preview"),o.querySelector(".se-dialog-tabs").addEventListener("click",this.openTab.bind(e)),o.querySelector("form").addEventListener("submit",this.submit.bind(e)),n.imgInputFile&&o.querySelector(".se-file-remove").addEventListener("click",this._removeSelectedFiles.bind(n.imgInputFile,n.imgUrlFile,n.previewSrc)),n.imgUrlFile&&n.imgUrlFile.addEventListener("input",this._onLinkPreview.bind(n.previewSrc,n._v_src,t.linkProtocol)),n.imgInputFile&&n.imgUrlFile&&n.imgInputFile.addEventListener("change",this._fileInputChange.bind(n));const l=o.querySelector(".__se__gallery");l&&l.addEventListener("click",this._openGallery.bind(e)),n.proportion={},n.inputX={},n.inputY={},t.imageResizing&&(n.proportion=o.querySelector("._se_image_check_proportion"),n.inputX=o.querySelector("._se_image_size_x"),n.inputY=o.querySelector("._se_image_size_y"),n.inputX.value=t.imageWidth,n.inputY.value=t.imageHeight,n.inputX.addEventListener("keyup",this.setInputSize.bind(e,"x")),n.inputY.addEventListener("keyup",this.setInputSize.bind(e,"y")),n.inputX.addEventListener("change",this.setRatio.bind(e)),n.inputY.addEventListener("change",this.setRatio.bind(e)),n.proportion.addEventListener("change",this.setRatio.bind(e)),o.querySelector(".se-dialog-btn-revert").addEventListener("click",this.sizeRevert.bind(e))),i.dialog.modal.appendChild(o),e.plugins.anchor.initEvent.call(e,"image",o.querySelector("._se_tab_content_url")),n.anchorCtx=e.context.anchor.caller.image,o=null},setDialog:function(e){const t=e.options,i=e.lang,n=e.util.createElement("DIV");n.className="se-dialog-content se-dialog-image",n.style.display="none";let o='
    '+i.dialogBox.imageBox.title+'
    ';if(t.imageFileInput&&(o+='
    "),t.imageUrlInput&&(o+='
    '+(t.imageGalleryUrl&&e.plugins.imageGallery?'":"")+'
    '),o+='
    ',t.imageResizing){const n=t.imageSizeOnlyPercentage,l=n?' style="display: none !important;"':"",r=t.imageHeightShow?"":' style="display: none !important;"';o+='
    ',n||!t.imageHeightShow?o+='
    ":o+='
    ",o+=' '+i.dialogBox.proportion+'
    "}return o+='
    ",n.innerHTML=o,n},_fileInputChange:function(){this.imgInputFile.value?(this.imgUrlFile.setAttribute("disabled",!0),this.previewSrc.style.textDecoration="line-through"):(this.imgUrlFile.removeAttribute("disabled"),this.previewSrc.style.textDecoration="")},_removeSelectedFiles:function(e,t){this.value="",e&&(e.removeAttribute("disabled"),t.style.textDecoration="")},_openGallery:function(){this.callPlugin("imageGallery",this.plugins.imageGallery.open.bind(this,this.plugins.image._setUrlInput.bind(this.context.image)),null)},_setUrlInput:function(e){this.altText.value=e.alt,this._v_src._linkValue=this.previewSrc.textContent=this.imgUrlFile.value=e.getAttribute("data-value")||e.src,this.imgUrlFile.focus()},_onLinkPreview:function(e,t,i){const n=i.target.value.trim();e._linkValue=this.textContent=n?t&&-1===n.indexOf("://")&&0!==n.indexOf("#")?t+n:-1===n.indexOf("://")?"/"+n:n:""},fileTags:["img"],select:function(e){this.plugins.image.onModifyMode.call(this,e,this.plugins.resizing.call_controller_resize.call(this,e,"image"))},destroy:function(e){const t=e||this.context.image._element,i=this.util.getParentElement(t,this.util.isMediaComponent)||t,n=1*t.getAttribute("data-index");if("function"==typeof this.functions.onImageDeleteBefore&&!1===this.functions.onImageDeleteBefore(t,i,n,this))return;let o=i.previousElementSibling||i.nextElementSibling;const l=i.parentNode;this.util.removeItem(i),this.plugins.image.init.call(this),this.controllersOff(),l!==this.context.element.wysiwyg&&this.util.removeItemAllParents(l,(function(e){return 0===e.childNodes.length}),null),this.focusEdge(o),this.plugins.fileManager.deleteInfo.call(this,"image",n,this.functions.onImageUpload),this.history.push(!1)},on:function(e){const t=this.context.image;e?t.imgInputFile&&this.options.imageMultipleFile&&t.imgInputFile.removeAttribute("multiple"):(t.inputX.value=t._origin_w=this.options.imageWidth===t._defaultSizeX?"":this.options.imageWidth,t.inputY.value=t._origin_h=this.options.imageHeight===t._defaultSizeY?"":this.options.imageHeight,t.imgInputFile&&this.options.imageMultipleFile&&t.imgInputFile.setAttribute("multiple","multiple")),this.plugins.anchor.on.call(this,t.anchorCtx,e)},open:function(){this.plugins.dialog.open.call(this,"image","image"===this.currentControllerName)},openTab:function(e){const t=this.context.image.modal,i="init"===e?t.querySelector("._se_tab_link"):e.target;if(!/^BUTTON$/i.test(i.tagName))return!1;const n=i.getAttribute("data-tab-link"),o="_se_tab_content";let l,r,s;for(r=t.getElementsByClassName(o),l=0;l0?(this.showLoading(),i.submitAction.call(this,this.context.image.imgInputFile.files)):t.imgUrlFile&&t._v_src._linkValue.length>0&&(this.showLoading(),i.onRender_imgUrl.call(this,t._v_src._linkValue))}catch(e){throw this.closeLoading(),Error('[SUNEDITOR.image.submit.fail] cause : "'+e.message+'"')}finally{this.plugins.dialog.close.call(this)}return!1},submitAction:function(e){if(0===e.length)return;let t=0,i=[];for(let n=0,o=e.length;n0){let e=0;const i=this.context.image._infoList;for(let t=0,n=i.length;tn){this.closeLoading();const i="[SUNEDITOR.imageUpload.fail] Size of uploadable total images: "+n/1e3+"KB";return void(("function"!=typeof this.functions.onImageUploadError||this.functions.onImageUploadError(i,{limitSize:n,currentSize:e,uploadSize:t},this))&&this.functions.noticeOpen(i))}}const o=this.context.image;o._uploadFileLength=i.length;const l={anchor:this.plugins.anchor.createAnchor.call(this,o.anchorCtx,!0),inputWidth:o.inputX.value,inputHeight:o.inputY.value,align:o._align,isUpdate:this.context.dialog.updateModal,alt:o._altText,element:o._element};if("function"==typeof this.functions.onImageUploadBefore){const e=this.functions.onImageUploadBefore(i,l,this,function(e){e&&this._w.Array.isArray(e.result)?this.plugins.image.register.call(this,l,e):this.plugins.image.upload.call(this,l,e)}.bind(this));if(void 0===e)return;if(!e)return void this.closeLoading();this._w.Array.isArray(e)&&e.length>0&&(i=e)}this.plugins.image.upload.call(this,l,i)},error:function(e,t){if(this.closeLoading(),"function"!=typeof this.functions.onImageUploadError||this.functions.onImageUploadError(e,t,this))throw this.functions.noticeOpen(e),Error("[SUNEDITOR.plugin.image.error] response: "+e)},upload:function(e,t){if(!t)return void this.closeLoading();if("string"==typeof t)return void this.plugins.image.error.call(this,t,null);const i=this.options.imageUploadUrl,n=this.context.dialog.updateModal?1:t.length;if("string"==typeof i&&i.length>0){const o=new FormData;for(let e=0;e'+e.icons.cancel+''+i.dialogBox.videoBox.title+'
    ';if(t.videoFileInput&&(o+='
    "),t.videoUrlInput&&(o+='
    '),t.videoResizing){const n=t.videoRatioList||[{name:"16:9",value:.5625},{name:"4:3",value:.75},{name:"21:9",value:.4285}],l=t.videoRatio,r=t.videoSizeOnlyPercentage,s=r?' style="display: none !important;"':"",a=t.videoHeightShow?"":' style="display: none !important;"',c=t.videoRatioShow?"":' style="display: none !important;"',u=r||t.videoHeightShow||t.videoRatioShow?"":' style="display: none !important;"';o+='
    "}return o+='
    ",n.innerHTML=o,n},_fileInputChange:function(){this.videoInputFile.value?(this.videoUrlFile.setAttribute("disabled",!0),this.preview.style.textDecoration="line-through"):(this.videoUrlFile.removeAttribute("disabled"),this.preview.style.textDecoration="")},_removeSelectedFiles:function(e,t){this.value="",e&&(e.removeAttribute("disabled"),t.style.textDecoration="")},_onLinkPreview:function(e,t,i){const n=i.target.value.trim();/^$/.test(n)?(e._linkValue=n,this.textContent=''):e._linkValue=this.textContent=n?t&&-1===n.indexOf("://")&&0!==n.indexOf("#")?t+n:-1===n.indexOf("://")?"/"+n:n:""},_setTagAttrs:function(e){e.setAttribute("controls",!0);const t=this.options.videoTagAttrs;if(t)for(let i in t)this.util.hasOwn(t,i)&&e.setAttribute(i,t[i])},createVideoTag:function(){const e=this.util.createElement("VIDEO");return this.plugins.video._setTagAttrs.call(this,e),e},_setIframeAttrs:function(e){e.frameBorder="0",e.allowFullscreen=!0;const t=this.options.videoIframeAttrs;if(t)for(let i in t)this.util.hasOwn(t,i)&&e.setAttribute(i,t[i])},createIframeTag:function(){const e=this.util.createElement("IFRAME");return this.plugins.video._setIframeAttrs.call(this,e),e},fileTags:["iframe","video"],select:function(e){this.plugins.video.onModifyMode.call(this,e,this.plugins.resizing.call_controller_resize.call(this,e,"video"))},destroy:function(e){const t=e||this.context.video._element,i=this.context.video._container,n=1*t.getAttribute("data-index");if("function"==typeof this.functions.onVideoDeleteBefore&&!1===this.functions.onVideoDeleteBefore(t,i,n,this))return;let o=i.previousElementSibling||i.nextElementSibling;const l=i.parentNode;this.util.removeItem(i),this.plugins.video.init.call(this),this.controllersOff(),l!==this.context.element.wysiwyg&&this.util.removeItemAllParents(l,(function(e){return 0===e.childNodes.length}),null),this.focusEdge(o),this.plugins.fileManager.deleteInfo.call(this,"video",n,this.functions.onVideoUpload),this.history.push(!1)},on:function(e){const t=this.context.video;e?t.videoInputFile&&this.options.videoMultipleFile&&t.videoInputFile.removeAttribute("multiple"):(t.inputX.value=t._origin_w=this.options.videoWidth===t._defaultSizeX?"":this.options.videoWidth,t.inputY.value=t._origin_h=this.options.videoHeight===t._defaultSizeY?"":this.options.videoHeight,t.proportion.disabled=!0,t.videoInputFile&&this.options.videoMultipleFile&&t.videoInputFile.setAttribute("multiple","multiple")),t._resizing&&this.plugins.video.setVideoRatioSelect.call(this,t._origin_h||t._defaultRatio)},open:function(){this.plugins.dialog.open.call(this,"video","video"===this.currentControllerName)},setVideoRatio:function(e){const t=this.context.video,i=e.target.options[e.target.selectedIndex].value;t._defaultSizeY=t._videoRatio=i?100*i+"%":t._defaultSizeY,t.inputY.placeholder=i?100*i+"%":"",t.inputY.value=""},setInputSize:function(e,t){if(t&&32===t.keyCode)return void t.preventDefault();const i=this.context.video;this.plugins.resizing._module_setInputSize.call(this,i,e),"y"===e&&this.plugins.video.setVideoRatioSelect.call(this,t.target.value||i._defaultRatio)},setRatio:function(){this.plugins.resizing._module_setRatio.call(this,this.context.video)},submit:function(e){const t=this.context.video,i=this.plugins.video;e.preventDefault(),e.stopPropagation(),t._align=t.modal.querySelector('input[name="suneditor_video_radio"]:checked').value;try{t.videoInputFile&&t.videoInputFile.files.length>0?(this.showLoading(),i.submitAction.call(this,this.context.video.videoInputFile.files)):t.videoUrlFile&&t._linkValue.length>0&&(this.showLoading(),i.setup_url.call(this,t._linkValue))}catch(e){throw this.closeLoading(),Error('[SUNEDITOR.video.submit.fail] cause : "'+e.message+'"')}finally{this.plugins.dialog.close.call(this)}return!1},submitAction:function(e){if(0===e.length)return;let t=0,i=[];for(let n=0,o=e.length;n0){let e=0;const i=this.context.video._infoList;for(let t=0,n=i.length;tn){this.closeLoading();const i="[SUNEDITOR.videoUpload.fail] Size of uploadable total videos: "+n/1e3+"KB";return void(("function"!=typeof this.functions.onVideoUploadError||this.functions.onVideoUploadError(i,{limitSize:n,currentSize:e,uploadSize:t},this))&&this.functions.noticeOpen(i))}}const o=this.context.video;o._uploadFileLength=i.length;const l={inputWidth:o.inputX.value,inputHeight:o.inputY.value,align:o._align,isUpdate:this.context.dialog.updateModal,element:o._element};if("function"==typeof this.functions.onVideoUploadBefore){const e=this.functions.onVideoUploadBefore(i,l,this,function(e){e&&this._w.Array.isArray(e.result)?this.plugins.video.register.call(this,l,e):this.plugins.video.upload.call(this,l,e)}.bind(this));if(void 0===e)return;if(!e)return void this.closeLoading();"object"==typeof e&&e.length>0&&(i=e)}this.plugins.video.upload.call(this,l,i)},error:function(e,t){if(this.closeLoading(),"function"!=typeof this.functions.onVideoUploadError||this.functions.onVideoUploadError(e,t,this))throw this.functions.noticeOpen(e),Error("[SUNEDITOR.plugin.video.error] response: "+e)},upload:function(e,t){if(!t)return void this.closeLoading();if("string"==typeof t)return void this.plugins.video.error.call(this,t,null);const i=this.options.videoUploadUrl,n=this.context.dialog.updateModal?1:t.length;if(!("string"==typeof i&&i.length>0))throw Error('[SUNEDITOR.videoUpload.fail] cause : There is no "videoUploadUrl" option.');{const o=new FormData;for(let e=0;e$/.test(e)){if(0===(e=(new this._w.DOMParser).parseFromString(e,"text/html").querySelector("iframe").src).length)return!1}if(/youtu\.?be/.test(e)){if(/^http/.test(e)||(e="https://"+e),e=e.replace("watch?v=",""),/^\/\/.+\/embed\//.test(e)||(e=e.replace(e.match(/\/\/.+\//)[0],"//www.youtube.com/embed/").replace("&","?&")),t._youtubeQuery.length>0)if(/\?/.test(e)){const i=e.split("?");e=i[0]+"?"+t._youtubeQuery+"&"+i[1]}else e+="?"+t._youtubeQuery}else/vimeo\.com/.test(e)&&(e.endsWith("/")&&(e=e.slice(0,-1)),e="https://player.vimeo.com/video/"+e.slice(e.lastIndexOf("/")+1));this.plugins.video.create_video.call(this,this.plugins.video[/embed|iframe|player|\/e\/|\.php|\.html?/.test(e)||/vimeo\.com/.test(e)?"createIframeTag":"createVideoTag"].call(this),e,t.inputX.value,t.inputY.value,t._align,null,this.context.dialog.updateModal)}catch(e){throw Error('[SUNEDITOR.video.upload.fail] cause : "'+e.message+'"')}finally{this.closeLoading()}},create_video:function(e,t,i,n,o,l,r){this.context.resizing._resize_plugin="video";const s=this.context.video;let a=null,c=null,u=!1;if(r){if((e=s._element).src!==t){u=!0;const i=/youtu\.?be/.test(t),n=/vimeo\.com/.test(t);if(!i&&!n||/^iframe$/i.test(e.nodeName))if(i||n||/^video$/i.test(e.nodeName))e.src=t;else{const i=this.plugins.video.createVideoTag.call(this);i.src=t,e.parentNode.replaceChild(i,e),s._element=e=i}else{const i=this.plugins.video.createIframeTag.call(this);i.src=t,e.parentNode.replaceChild(i,e),s._element=e=i}}c=s._container,a=this.util.getParentElement(e,"FIGURE")}else u=!0,e.src=t,s._element=e,a=this.plugins.component.set_cover.call(this,e),c=this.plugins.component.set_container.call(this,a,"se-video-container");s._cover=a,s._container=c;const d=this.plugins.resizing._module_getSizeX.call(this,s)!==(i||s._defaultSizeX)||this.plugins.resizing._module_getSizeY.call(this,s)!==(n||s._videoRatio),h=!r||d;s._resizing&&(this.context.video._proportionChecked=s.proportion.checked,e.setAttribute("data-proportion",s._proportionChecked));let p=!1;h&&(p=this.plugins.video.applySize.call(this)),p&&"center"===o||this.plugins.video.setAlign.call(this,null,e,a,c);let f=!0;if(r)s._resizing&&this.context.resizing._rotateVertical&&h&&this.plugins.resizing.setTransformSize.call(this,e,null,null);else if(f=this.insertComponent(c,!1,!0,!this.options.mediaAutoSelect),!this.options.mediaAutoSelect){const e=this.appendFormatTag(c,null);e&&this.setRange(e,0,e,0)}f&&(u&&this.plugins.fileManager.setInfo.call(this,"video",e,this.functions.onVideoUpload,l,!0),r&&(this.selectComponent(e,"video"),this.history.push(!1))),this.context.resizing._resize_plugin=""},_update_videoCover:function(e){if(!e)return;const t=this.context.video;/^video$/i.test(e.nodeName)?this.plugins.video._setTagAttrs.call(this,e):this.plugins.video._setIframeAttrs.call(this,e);let i=this.util.isRangeFormatElement(e.parentNode)||this.util.isWysiwygDiv(e.parentNode)?e:this.util.getFormatElement(e)||e;const n=e;t._element=e=e.cloneNode(!0);const o=t._cover=this.plugins.component.set_cover.call(this,e),l=t._container=this.plugins.component.set_container.call(this,o,"se-video-container");try{const r=i.querySelector("figcaption");let s=null;r&&(s=this.util.createElement("DIV"),s.innerHTML=r.innerHTML,this.util.removeItem(r));const a=(e.getAttribute("data-size")||e.getAttribute("data-origin")||"").split(",");this.plugins.video.applySize.call(this,a[0]||n.style.width||n.width||"",a[1]||n.style.height||n.height||"");const c=this.util.getFormatElement(n);if(c&&(t._align=c.style.textAlign||c.style.float),this.plugins.video.setAlign.call(this,null,e,o,l),this.util.getParentElement(n,this.util.isNotCheckingNode))n.parentNode.replaceChild(l,n);else if(this.util.isListCell(i)){const e=this.util.getParentElement(n,(function(e){return e.parentNode===i}));i.insertBefore(l,e),this.util.removeItem(n),this.util.removeEmptyNode(e,null,!0)}else if(this.util.isFormatElement(i)){const e=this.util.getParentElement(n,(function(e){return e.parentNode===i}));i=this.util.splitElement(i,e),i.parentNode.insertBefore(l,i),this.util.removeItem(n),this.util.removeEmptyNode(i,null,!0),0===i.children.length&&(i.innerHTML=this.util.htmlRemoveWhiteSpace(i.innerHTML))}else i.parentNode.replaceChild(l,i);s&&i.parentNode.insertBefore(s,l.nextElementSibling)}catch(e){console.warn("[SUNEDITOR.video.error] Maybe the video tag is nested.",e)}this.plugins.fileManager.setInfo.call(this,"video",e,this.functions.onVideoUpload,null,!0),this.plugins.video.init.call(this)},onModifyMode:function(e,t){const i=this.context.video;i._element=e,i._cover=this.util.getParentElement(e,"FIGURE"),i._container=this.util.getParentElement(e,this.util.isMediaComponent),i._align=e.style.float||e.getAttribute("data-align")||"none",e.style.float="",t&&(i._element_w=t.w,i._element_h=t.h,i._element_t=t.t,i._element_l=t.l);let n,o,l=i._element.getAttribute("data-size")||i._element.getAttribute("data-origin");l?(l=l.split(","),n=l[0],o=l[1]):t&&(n=t.w,o=t.h),i._origin_w=n||e.style.width||e.width||"",i._origin_h=o||e.style.height||e.height||""},openModify:function(e){const t=this.context.video;if(t.videoUrlFile&&(t._linkValue=t.preview.textContent=t.videoUrlFile.value=t._element.src||(t._element.querySelector("source")||"").src||""),(t.modal.querySelector('input[name="suneditor_video_radio"][value="'+t._align+'"]')||t.modal.querySelector('input[name="suneditor_video_radio"][value="none"]')).checked=!0,t._resizing){this.plugins.resizing._module_setModifyInputSize.call(this,t,this.plugins.video);const e=t._videoRatio=this.plugins.resizing._module_getSizeY.call(this,t);this.plugins.video.setVideoRatioSelect.call(this,e)||(t.inputY.value=t._onlyPercentage?this.util.getNumber(e,2):e)}e||this.plugins.dialog.open.call(this,"video",!0)},setVideoRatioSelect:function(e){let t=!1;const i=this.context.video,n=i.videoRatioOption.options;/%$/.test(e)||i._onlyPercentage?e=this.util.getNumber(e,2)/100+"":(!this.util.isNumber(e)||1*e>=1)&&(e=""),i.inputY.placeholder="";for(let o=0,l=n.length;o'+e.icons.cancel+''+i.dialogBox.audioBox.title+'
    ';return t.audioFileInput&&(o+='
    "),t.audioUrlInput&&(o+='
    '),o+='
    ",n.innerHTML=o,n},setController:function(e){const t=e.lang,i=e.icons,n=e.util.createElement("DIV");return n.className="se-controller se-controller-link",n.innerHTML='
    ",n},_fileInputChange:function(){this.audioInputFile.value?(this.audioUrlFile.setAttribute("disabled",!0),this.preview.style.textDecoration="line-through"):(this.audioUrlFile.removeAttribute("disabled"),this.preview.style.textDecoration="")},_removeSelectedFiles:function(e,t){this.value="",e&&(e.removeAttribute("disabled"),t.style.textDecoration="")},_createAudioTag:function(){const e=this.util.createElement("AUDIO");this.plugins.audio._setTagAttrs.call(this,e);const t=this.context.audio._origin_w,i=this.context.audio._origin_h;return e.setAttribute("origin-size",t+","+i),e.style.cssText=(t?"width:"+t+"; ":"")+(i?"height:"+i+";":""),e},_setTagAttrs:function(e){e.setAttribute("controls",!0);const t=this.options.audioTagAttrs;if(t)for(let i in t)this.util.hasOwn(t,i)&&e.setAttribute(i,t[i])},_onLinkPreview:function(e,t,i){const n=i.target.value.trim();e._linkValue=this.textContent=n?t&&-1===n.indexOf("://")&&0!==n.indexOf("#")?t+n:-1===n.indexOf("://")?"/"+n:n:""},fileTags:["audio"],select:function(e){this.plugins.audio.onModifyMode.call(this,e)},destroy:function(e){e=e||this.context.audio._element;const t=this.util.getParentElement(e,this.util.isComponent)||e,i=1*e.getAttribute("data-index");if("function"==typeof this.functions.onAudioDeleteBefore&&!1===this.functions.onAudioDeleteBefore(e,t,i,this))return;const n=t.previousElementSibling||t.nextElementSibling,o=t.parentNode;this.util.removeItem(t),this.plugins.audio.init.call(this),this.controllersOff(),o!==this.context.element.wysiwyg&&this.util.removeItemAllParents(o,(function(e){return 0===e.childNodes.length}),null),this.focusEdge(n),this.plugins.fileManager.deleteInfo.call(this,"audio",i,this.functions.onAudioUpload),this.history.push(!1)},checkFileInfo:function(){this.plugins.fileManager.checkInfo.call(this,"audio",["audio"],this.functions.onAudioUpload,this.plugins.audio.updateCover.bind(this),!1)},resetFileInfo:function(){this.plugins.fileManager.resetInfo.call(this,"audio",this.functions.onAudioUpload)},on:function(e){const t=this.context.audio;e?t._element?(this.context.dialog.updateModal=!0,t._linkValue=t.preview.textContent=t.audioUrlFile.value=t._element.src,t.audioInputFile&&this.options.audioMultipleFile&&t.audioInputFile.removeAttribute("multiple")):t.audioInputFile&&this.options.audioMultipleFile&&t.audioInputFile.removeAttribute("multiple"):(this.plugins.audio.init.call(this),t.audioInputFile&&this.options.audioMultipleFile&&t.audioInputFile.setAttribute("multiple","multiple"))},open:function(){this.plugins.dialog.open.call(this,"audio","audio"===this.currentControllerName)},submit:function(e){const t=this.context.audio;e.preventDefault(),e.stopPropagation();try{t.audioInputFile&&t.audioInputFile.files.length>0?(this.showLoading(),this.plugins.audio.submitAction.call(this,t.audioInputFile.files)):t.audioUrlFile&&t._linkValue.length>0&&(this.showLoading(),this.plugins.audio.setupUrl.call(this,t._linkValue))}catch(e){throw this.closeLoading(),Error('[SUNEDITOR.audio.submit.fail] cause : "'+e.message+'"')}finally{this.plugins.dialog.close.call(this)}return!1},submitAction:function(e){if(0===e.length)return;let t=0,i=[];for(let n=0,o=e.length;n0){let e=0;const i=this.context.audio._infoList;for(let t=0,n=i.length;tn){this.closeLoading();const i="[SUNEDITOR.audioUpload.fail] Size of uploadable total audios: "+n/1e3+"KB";return void(("function"!=typeof this.functions.onAudioUploadError||this.functions.onAudioUploadError(i,{limitSize:n,currentSize:e,uploadSize:t},this))&&this.functions.noticeOpen(i))}}const o=this.context.audio;o._uploadFileLength=i.length;const l={isUpdate:this.context.dialog.updateModal,element:o._element};if("function"==typeof this.functions.onAudioUploadBefore){const e=this.functions.onAudioUploadBefore(i,l,this,function(e){e&&this._w.Array.isArray(e.result)?this.plugins.audio.register.call(this,l,e):this.plugins.audio.upload.call(this,l,e)}.bind(this));if(void 0===e)return;if(!e)return void this.closeLoading();"object"==typeof e&&e.length>0&&(i=e)}this.plugins.audio.upload.call(this,l,i)},error:function(e,t){if(this.closeLoading(),"function"!=typeof this.functions.onAudioUploadError||this.functions.onAudioUploadError(e,t,this))throw this.functions.noticeOpen(e),Error("[SUNEDITOR.plugin.audio.exception] response: "+e)},upload:function(e,t){if(!t)return void this.closeLoading();if("string"==typeof t)return void this.plugins.audio.error.call(this,t,null);const i=this.options.audioUploadUrl,n=this.context.dialog.updateModal?1:t.length,o=new FormData;for(let e=0;e'+e.icons.cancel+''+t.dialogBox.mathBox.title+'

    ",e.context.math.defaultFontSize=o,i.innerHTML=l,i},setController_MathButton:function(e){const t=e.lang,i=e.util.createElement("DIV");return i.className="se-controller se-controller-link",i.innerHTML='
    ",i},open:function(){this.plugins.dialog.open.call(this,"math","math"===this.currentControllerName)},managedTags:function(){return{className:"katex",method:function(e){if(!e.getAttribute("data-exp")||!this.options.katex)return;const t=this._d.createRange().createContextualFragment(this.plugins.math._renderer.call(this,this.util.HTMLDecoder(e.getAttribute("data-exp"))));e.innerHTML=t.querySelector(".katex").innerHTML,e.setAttribute("contenteditable",!1)}}},_renderer:function(e){let t="";try{this.util.removeClass(this.context.math.focusElement,"se-error"),t=this.options.katex.src.renderToString(e,{throwOnError:!0,displayMode:!0})}catch(e){this.util.addClass(this.context.math.focusElement,"se-error"),t='Katex syntax error. (Refer KaTeX)',console.warn("[SUNEDITOR.math.Katex.error] ",e)}return t},_renderMathExp:function(e,t){e.previewElement.innerHTML=this.plugins.math._renderer.call(this,t.target.value)},submit:function(e){this.showLoading(),e.preventDefault(),e.stopPropagation();const t=function(){if(0===this.context.math.focusElement.value.trim().length)return!1;const e=this.context.math,t=e.focusElement.value,i=e.previewElement.querySelector(".katex");if(!i)return!1;if(i.className="__se__katex "+i.className,i.setAttribute("contenteditable",!1),i.setAttribute("data-exp",this.util.HTMLEncoder(t)),i.setAttribute("data-font-size",e.fontSizeElement.value),i.style.fontSize=e.fontSizeElement.value,this.context.dialog.updateModal){const t=this.util.getParentElement(e._mathExp,".katex");t.parentNode.replaceChild(i,t),this.setRange(i,0,i,1)}else{const e=this.getSelectedElements();if(e.length>1){const t=this.util.createElement(e[0].nodeName);if(t.appendChild(i),!this.insertNode(t,null,!0))return!1}else if(!this.insertNode(i,null,!0))return!1;const t=this.util.createTextNode(this.util.zeroWidthSpace);i.parentNode.insertBefore(t,i.nextSibling),this.setRange(i,0,i,1)}return e.focusElement.value="",e.fontSizeElement.value="1em",e.previewElement.style.fontSize="1em",e.previewElement.innerHTML="",!0}.bind(this);try{t()&&(this.plugins.dialog.close.call(this),this.history.push(!1))}catch(e){this.plugins.dialog.close.call(this)}finally{this.closeLoading()}return!1},active:function(e){if(e){if(e.getAttribute("data-exp"))return this.controllerArray.indexOf(this.context.math.mathController)<0&&(this.setRange(e,0,e,1),this.plugins.math.call_controller.call(this,e)),!0}else this.controllerArray.indexOf(this.context.math.mathController)>-1&&this.controllersOff();return!1},on:function(e){if(e){const e=this.context.math;if(e._mathExp){const t=this.util.HTMLDecoder(e._mathExp.getAttribute("data-exp")),i=e._mathExp.getAttribute("data-font-size")||"1em";this.context.dialog.updateModal=!0,e.focusElement.value=t,e.fontSizeElement.value=i,e.previewElement.innerHTML=this.plugins.math._renderer.call(this,t),e.previewElement.style.fontSize=i}}else this.plugins.math.init.call(this)},call_controller:function(e){this.context.math._mathExp=e;const t=this.context.math.mathController;this.setControllerPosition(t,e,"bottom",{left:0,top:0}),this.controllersOn(t,e,"math")},onClick_mathController:function(e){e.stopPropagation();const t=e.target.getAttribute("data-command")||e.target.parentNode.getAttribute("data-command");t&&(e.preventDefault(),/update/.test(t)?(this.context.math.focusElement.value=this.util.HTMLDecoder(this.context.math._mathExp.getAttribute("data-exp")),this.plugins.dialog.open.call(this,"math",!0)):(this.util.removeItem(this.context.math._mathExp),this.context.math._mathExp=null,this.focus(),this.history.push(!1)),this.controllersOff())},init:function(){const e=this.context.math;e.mathController.style.display="none",e._mathExp=null,e.focusElement.value="",e.previewElement.innerHTML=""}};var rt=i(438),st=i.n(rt);const at={name:"imageGallery",add:function(e){e.addModule([st()]);e.context.imageGallery={title:e.lang.toolbar.imageGallery,url:e.options.imageGalleryUrl,header:e.options.imageGalleryHeader,listClass:"se-image-list",itemTemplateHandler:this.drawItems,selectorHandler:this.setImage.bind(e),columnSize:4}},open:function(e){this.plugins.fileBrowser.open.call(this,"imageGallery",e)},drawItems:function(e){const t=e.src.split("/").pop();return'
    '+(e.alt||t)+'
    '+(e.name||t)+"
    "},setImage:function(e,t){this.callPlugin("image",function(){const i={name:t,size:0};this.plugins.image.create_image.call(this,e.getAttribute("data-value"),null,this.context.image._origin_w,this.context.image._origin_h,"none",i,e.alt)}.bind(this),null)}},ct={blockquote:{name:"blockquote",display:"command",add:function(e,t){e.context.blockquote={targetButton:t,tag:e.util.createElement("BLOCKQUOTE")}},active:function(e){if(e){if(/blockquote/i.test(e.nodeName))return this.util.addClass(this.context.blockquote.targetButton,"active"),!0}else this.util.removeClass(this.context.blockquote.targetButton,"active");return!1},action:function(){const e=this.util.getParentElement(this.getSelectionNode(),"blockquote");e?this.detachRangeFormatElement(e,null,null,!1,!1):this.applyRangeFormatElement(this.context.blockquote.tag.cloneNode(!1))}},align:{name:"align",display:"submenu",add:function(e,t){const i=e.icons,n=e.context;n.align={targetButton:t,_itemMenu:null,_alignList:null,currentAlign:"",defaultDir:e.options.rtl?"right":"left",icons:{justify:i.align_justify,left:i.align_left,right:i.align_right,center:i.align_center}};let o=this.setSubmenu(e),l=n.align._itemMenu=o.querySelector("ul");l.addEventListener("click",this.pickup.bind(e)),n.align._alignList=l.querySelectorAll("li button"),e.initMenuTarget(this.name,t,o),o=null,l=null},setSubmenu:function(e){const t=e.lang,i=e.icons,n=e.util.createElement("DIV"),o=e.options.alignItems;let l="";for(let e,n,r=0;r";return n.className="se-submenu se-list-layer se-list-align",n.innerHTML='
      '+l+"
    ",n},active:function(e){const t=this.context.align,i=t.targetButton,n=i.firstElementChild;if(e){if(this.util.isFormatElement(e)){const o=e.style.textAlign;if(o)return this.util.changeElement(n,t.icons[o]||t.icons[t.defaultDir]),i.setAttribute("data-focus",o),!0}}else this.util.changeElement(n,t.icons[t.defaultDir]),i.removeAttribute("data-focus");return!1},on:function(){const e=this.context.align,t=e._alignList,i=e.targetButton.getAttribute("data-focus")||e.defaultDir;if(i!==e.currentAlign){for(let e=0,n=t.length;e
    • ";for(l=0,r=s.length;l";return a+="
    ",i.innerHTML=a,i},active:function(e){const t=this.context.font.targetText,i=this.context.font.targetTooltip;if(e){if(e.style&&e.style.fontFamily.length>0){const n=e.style.fontFamily.replace(/["']/g,"");return this.util.changeTxt(t,n),this.util.changeTxt(i,this.lang.toolbar.font+" ("+n+")"),!0}}else{const e=this.hasFocus?this.wwComputedStyle.fontFamily:this.lang.toolbar.font;this.util.changeTxt(t,e),this.util.changeTxt(i,this.hasFocus?this.lang.toolbar.font+(e?" ("+e+")":""):e)}return!1},on:function(){const e=this.context.font,t=e._fontList,i=e.targetText.textContent;if(i!==e.currentFont){for(let e=0,n=t.length;e('+i.toolbar.default+")";for(let e,i=0,n=t.fontSizeUnit,r=o.length;i";return l+="",n.innerHTML=l,n},active:function(e){if(e){if(e.style&&e.style.fontSize.length>0)return this.util.changeTxt(this.context.fontSize.targetText,this._convertFontSize.call(this,this.options.fontSizeUnit,e.style.fontSize)),!0}else this.util.changeTxt(this.context.fontSize.targetText,this.hasFocus?this._convertFontSize.call(this,this.options.fontSizeUnit,this.wwComputedStyle.fontSize):this.lang.toolbar.fontSize);return!1},on:function(){const e=this.context.fontSize,t=e._sizeList,i=e.targetText.textContent;if(i!==e.currentSize){for(let e=0,n=t.length;e";return i.className="se-submenu se-list-layer se-list-line",i.innerHTML='
      '+o+"
    ",i},active:function(e){if(e){if(/HR/i.test(e.nodeName))return this.context.horizontalRule.currentHR=e,this.util.hasClass(e,"on")||(this.util.addClass(e,"on"),this.controllersOn("hr",this.util.removeClass.bind(this.util,e,"on"))),!0}else this.util.hasClass(this.context.horizontalRule.currentHR,"on")&&this.controllersOff();return!1},appendHr:function(e){return this.focus(),this.insertComponent(e.cloneNode(!1),!1,!0,!1)},horizontalRulePick:function(e){e.preventDefault(),e.stopPropagation();let t=e.target,i=t.getAttribute("data-command");for(;!i&&!/UL/i.test(t.tagName);)t=t.parentNode,i=t.getAttribute("data-command");if(!i)return;const n=this.plugins.horizontalRule.appendHr.call(this,t.firstElementChild);n&&(this.setRange(n,0,n,0),this.submenuOff())}},list:{name:"list",display:"submenu",add:function(e,t){const i=e.context;i.list={targetButton:t,_list:null,currentList:"",icons:{bullets:e.icons.list_bullets,number:e.icons.list_number}};let n=this.setSubmenu(e),o=n.querySelector("ul");o.addEventListener("click",this.pickup.bind(e)),i.list._list=o.querySelectorAll("li button"),e.initMenuTarget(this.name,t,n),n=null,o=null},setSubmenu:function(e){const t=e.lang,i=e.util.createElement("DIV");return i.className="se-submenu se-list-layer",i.innerHTML='
    ",i},active:function(e){const t=this.context.list.targetButton,i=t.firstElementChild,n=this.util;if(n.isList(e)){const o=e.nodeName;return t.setAttribute("data-focus",o),n.addClass(t,"active"),/UL/i.test(o)?n.changeElement(i,this.context.list.icons.bullets):n.changeElement(i,this.context.list.icons.number),!0}return t.removeAttribute("data-focus"),n.changeElement(i,this.context.list.icons.number),n.removeClass(t,"active"),!1},on:function(){const e=this.context.list,t=e._list,i=e.targetButton.getAttribute("data-focus")||"";if(i!==e.currentList){for(let e=0,n=t.length;e"),t.innerHTML+=i.outerHTML,e&&(t.innerHTML+="
    ")}else{const e=i.childNodes;for(;e[0];)t.appendChild(e[0])}s.appendChild(t),a||(h=s),a&&m===f&&!l.isRangeFormatElement(v)||(u||(u=s),n&&a&&m===f||a&&l.isList(f)&&f===c||s.parentNode!==m&&m.insertBefore(s,v)),l.removeItem(i),n&&null===p&&(p=s.children.length-1),a&&(l.getRangeFormatElement(f,g)!==l.getRangeFormatElement(c,g)||l.isList(f)&&l.isList(c)&&l.getElementDepth(f)!==l.getElementDepth(c))&&(s=l.createElement(e)),b&&0===b.children.length&&l.removeItem(b)}else l.removeItem(i);p&&(u=u.children[p]),r&&(f=s.children.length-1,s.innerHTML+=c.innerHTML,h=s.children[f],l.removeItem(c))}else{if(i)for(let e=0,t=o.length;e=0;i--)if(o[i].contains(o[e])){o.splice(e,1),e--,t--;break}const t=l.getRangeFormatElement(r),n=t&&t.tagName===e;let s,a;const c=function(e){return!this.isComponent(e)}.bind(l);n||(a=l.createElement(e));for(let t,r,u=0,d=o.length;u0){const e=o.cloneNode(!1),t=o.childNodes,l=this.util.getPositionIndex(n);for(;t[l];)e.appendChild(t[l]);i.appendChild(e)}0===o.children.length&&this.util.removeItem(o),this.util.mergeSameTags(r);const s=this.util.getEdgeChildNodes(t,i);return{cc:t.parentNode,sc:s.sc,ec:s.ec}},editInsideList:function(e,t){const i=(t=t||this.getSelectedElements().filter(function(e){return this.isListCell(e)}.bind(this.util))).length;if(0===i||!e&&!this.util.isListCell(t[0].previousElementSibling)&&!this.util.isListCell(t[i-1].nextElementSibling))return{sc:t[0],so:0,ec:t[i-1],eo:1};let n=t[0].parentNode,o=t[i-1],l=null;if(e){if(n!==o.parentNode&&this.util.isList(o.parentNode.parentNode)&&o.nextElementSibling)for(o=o.nextElementSibling;o;)t.push(o),o=o.nextElementSibling;l=this.plugins.list.editList.call(this,n.nodeName.toUpperCase(),t,!0)}else{let e=this.util.createElement(n.nodeName),r=t[0].previousElementSibling,s=o.nextElementSibling;const a={s:null,e:null,sl:n,el:n};for(let o,l=0,c=i;l span > span"),n.columnFixedButton=r.querySelector("._se_table_fixed_column"),n.headerButton=r.querySelector("._se_table_header");let s=this.setController_tableEditor(e,n.cellControllerTop);n.resizeDiv=s,n.splitMenu=s.querySelector(".se-btn-group-sub"),n.mergeButton=s.querySelector("._se_table_merge_button"),n.splitButton=s.querySelector("._se_table_split_button"),n.insertRowAboveButton=s.querySelector("._se_table_insert_row_a"),n.insertRowBelowButton=s.querySelector("._se_table_insert_row_b"),l.addEventListener("mousemove",this.onMouseMove_tablePicker.bind(e,n)),l.addEventListener("click",this.appendTable.bind(e)),s.addEventListener("click",this.onClick_tableController.bind(e)),r.addEventListener("click",this.onClick_tableController.bind(e)),e.initMenuTarget(this.name,t,o),i.element.relative.appendChild(s),i.element.relative.appendChild(r),o=null,l=null,s=null,r=null,n=null},setSubmenu:function(e){const t=e.util.createElement("DIV");return t.className="se-submenu se-selector-table",t.innerHTML='
    1 x 1
    ',t},setController_table:function(e){const t=e.lang,i=e.icons,n=e.util.createElement("DIV");return n.className="se-controller se-controller-table",n.innerHTML='
    ",n},setController_tableEditor:function(e,t){const i=e.lang,n=e.icons,o=e.util.createElement("DIV");return o.className="se-controller se-controller-table-cell",o.innerHTML=(t?"":'
    ')+'
    • '+i.controller.VerticalSplit+'
    • '+i.controller.HorizontalSplit+"
    ",o},appendTable:function(){const e=this.util.createElement("TABLE"),t=this.plugins.table.createCells,i=this.context.table._tableXY[0];let n=this.context.table._tableXY[1],o="";for(;n>0;)o+=""+t.call(this,"td",i)+"",--n;o+="",e.innerHTML=o;if(this.insertComponent(e,!1,!0,!1)){const t=e.querySelector("td div");this.setRange(t,0,t,0),this.plugins.table.reset_table_picker.call(this)}},createCells:function(e,t,i){if(e=e.toLowerCase(),i){const t=this.util.createElement(e);return t.innerHTML="

    ",t}{let i="";for(;t>0;)i+="<"+e+">

    ",t--;return i}},onMouseMove_tablePicker:function(e,t){t.stopPropagation();let i=this._w.Math.ceil(t.offsetX/18),n=this._w.Math.ceil(t.offsetY/18);i=i<1?1:i,n=n<1?1:n,e._rtl&&(e.tableHighlight.style.left=18*i-13+"px",i=11-i),e.tableHighlight.style.width=i+"em",e.tableHighlight.style.height=n+"em",this.util.changeTxt(e.tableDisplay,i+" x "+n),e._tableXY=[i,n]},reset_table_picker:function(){if(!this.context.table.tableHighlight)return;const e=this.context.table.tableHighlight.style,t=this.context.table.tableUnHighlight.style;e.width="1em",e.height="1em",t.width="10em",t.height="10em",this.util.changeTxt(this.context.table.tableDisplay,"1 x 1"),this.submenuOff()},init:function(){const e=this.context.table,t=this.plugins.table;if(t._removeEvents.call(this),t._selectedTable){const e=t._selectedTable.querySelectorAll(".se-table-selected-cell");for(let t=0,i=e.length;t0)for(let e,t=0;tl||(d>=e.index?(n+=e.cs,d+=e.cs,e.rs-=1,e.row=l+1,e.rs<1&&(a.splice(t,1),t--)):h===p-1&&(e.rs-=1,e.row=l+1,e.rs<1&&(a.splice(t,1),t--)));if(l===r&&h===o){i._logical_cellIndex=d;break}u>0&&s.push({index:d,cs:c+1,rs:u,row:-1}),n+=c}a=a.concat(s).sort((function(e,t){return e.index-t.index})),s=[]}s=null,a=null}},editTable:function(e,t){const i=this.plugins.table,n=this.context.table,o=n._element,l="row"===e;if(l){const e=n._trElement.parentNode;if(/^THEAD$/i.test(e.nodeName)){if("up"===t)return;if(!e.nextElementSibling||!/^TBODY$/i.test(e.nextElementSibling.nodeName))return void(o.innerHTML+=""+i.createCells.call(this,"td",n._logical_cellCnt,!1)+"")}}if(i._ref){const e=n._tdElement,o=i._selectedCells;if(l)if(t)i.setCellInfo.call(this,"up"===t?o[0]:o[o.length-1],!0),i.editRow.call(this,t,e);else{let e=o[0].parentNode;const n=[o[0]];for(let t,i=1,l=o.length;ir&&r>t&&(e[o].rowSpan=i+s,c-=n)}if(n){const e=a[l+1];if(e){const t=[];let i=a[l].cells,n=0;for(let e,o,l=0,r=i.length;l1&&(e.rowSpan-=1,t.push({cell:e.cloneNode(!1),index:o}));if(t.length>0){let o=t.shift();i=e.cells,n=0;for(let l,r,s=0,a=i.length;s=o.index)||(s--,n--,n+=o.cell.colSpan-1,e.insertBefore(o.cell,l),o=t.shift(),o));s++);if(o){e.appendChild(o.cell);for(let i=0,n=t.length;i0){const e=!l[b+1];for(let t,i=0;iv||(f>=t.index?(m+=t.cs,f=b+m,t.rs-=1,t.row=v+1,t.rs<1&&(u.splice(i,1),i--)):e&&(t.rs-=1,t.row=v+1,t.rs<1&&(u.splice(i,1),i--)))}i>0&&c.push({rs:i,cs:a+1,index:f,row:-1}),f>=t&&f+a<=t+r?h.push(e):f<=t+r&&f+a>=t?e.colSpan-=n.getOverlapRangeAtIndex(s,s+r,f,f+a):i>0&&(ft+r)&&p.push({cell:e,i:v,rs:v+i}),m+=a}else{if(b>=t)break;if(a>0){if(d<1&&a+b>=t){e.colSpan+=1,t=null,d=i+1;break}t-=a}if(!g){for(let e,i=0;i0){d-=1;continue}null!==t&&l.length>0&&(f=this.plugins.table.createCells.call(this,l[0].nodeName,0,!0),f=e.insertBefore(f,l[t]))}}if(o){let e,t;for(let i,o=0,l=h.length;o1)c.colSpan=this._w.Math.floor(e/2),o.colSpan=e-c.colSpan,r.insertBefore(c,o.nextElementSibling);else{let t=[],i=[];for(let r,a,c=0,u=n._rowCnt;c0)for(let e,t=0;tc||(d>=e.index?(a+=e.cs,d+=e.cs,e.rs-=1,e.row=c+1,e.rs<1&&(i.splice(t,1),t--)):h===p-1&&(e.rs-=1,e.row=c+1,e.rs<1&&(i.splice(t,1),t--)));if(d<=s&&u>0&&t.push({index:d,cs:l+1,rs:u,row:-1}),n!==o&&d<=s&&d+l>=s+e-1){n.colSpan+=1;break}if(d>s)break;a+=l}i=i.concat(t).sort((function(e,t){return e.index-t.index})),t=[]}r.insertBefore(c,o.nextElementSibling)}}else{const e=o.rowSpan;if(c.colSpan=o.colSpan,e>1){c.rowSpan=this._w.Math.floor(e/2);const i=e-c.rowSpan,n=[],a=t.getArrayIndex(l,r)+i;for(let e,t,i=0;i=s));c++)o=e[c],l=o.rowSpan-1,l>0&&l+i>=a&&r=h.index&&(a+=h.cs,o+=h.cs,h=n.shift()),o>=s||l===r-1){u.insertBefore(c,e.nextElementSibling);break}a+=t}o.rowSpan=i}else{c.rowSpan=o.rowSpan;const e=t.createElement("TR");e.appendChild(c);for(let e,t=0;t=a&&(e[i].rowSpan+=1)}const i=n._physical_cellIndex,s=r.cells;for(let e=0,t=s.length;e0&&r+l>=n&&(e.rowSpan-=i.getOverlapRangeAtIndex(n,o,r,r+l));else l.push(e[r]);for(let e=0,t=l.length;e"+this.plugins.table.createCells.call(this,"th",this.context.table._logical_cellCnt,!1)+"",n.insertBefore(t,n.firstElementChild)}e.toggleClass(t,"active"),/TH/i.test(this.context.table._tdElement.nodeName)?this.controllersOff():this.plugins.table.setPositionControllerDiv.call(this,this.context.table._tdElement,!1)},setTableStyle:function(e){const t=this.context.table,i=t._element;let n,o,l,r;e.indexOf("width")>-1&&(n=t.resizeButton.firstElementChild,o=t.resizeText,t._maxWidth?(l=t.icons.reduction,r=t.minText,t.columnFixedButton.style.display="block",this.util.removeClass(i,"se-table-size-auto"),this.util.addClass(i,"se-table-size-100")):(l=t.icons.expansion,r=t.maxText,t.columnFixedButton.style.display="none",this.util.removeClass(i,"se-table-size-100"),this.util.addClass(i,"se-table-size-auto")),this.util.changeElement(n,l),this.util.changeTxt(o,r)),e.indexOf("column")>-1&&(t._fixedColumn?(this.util.removeClass(i,"se-table-layout-auto"),this.util.addClass(i,"se-table-layout-fixed"),this.util.addClass(t.columnFixedButton,"active")):(this.util.removeClass(i,"se-table-layout-fixed"),this.util.addClass(i,"se-table-layout-auto"),this.util.removeClass(t.columnFixedButton,"active")))},setActiveButton:function(e,t){const i=this.context.table;/^TH$/i.test(e.nodeName)?(i.insertRowAboveButton.setAttribute("disabled",!0),i.insertRowBelowButton.setAttribute("disabled",!0)):(i.insertRowAboveButton.removeAttribute("disabled"),i.insertRowBelowButton.removeAttribute("disabled")),t&&e!==t?(i.splitButton.setAttribute("disabled",!0),i.mergeButton.removeAttribute("disabled")):(i.splitButton.removeAttribute("disabled"),i.mergeButton.setAttribute("disabled",!0))},_bindOnSelect:null,_bindOffSelect:null,_bindOffShift:null,_selectedCells:null,_shift:!1,_fixedCell:null,_fixedCellName:null,_selectedCell:null,_selectedTable:null,_ref:null,_toggleEditor:function(e){this.context.element.wysiwyg.setAttribute("contenteditable",e),e?this.util.removeClass(this.context.element.wysiwyg,"se-disabled"):this.util.addClass(this.context.element.wysiwyg,"se-disabled")},_offCellMultiSelect:function(e){e.stopPropagation();const t=this.plugins.table;t._shift?t._initBind&&(this._wd.removeEventListener("touchmove",t._initBind),t._initBind=null):(t._removeEvents.call(this),t._toggleEditor.call(this,!0)),t._fixedCell&&t._selectedTable&&(t.setActiveButton.call(this,t._fixedCell,t._selectedCell),t.call_controller_tableEdit.call(this,t._selectedCell||t._fixedCell),t._selectedCells=t._selectedTable.querySelectorAll(".se-table-selected-cell"),t._selectedCell&&t._fixedCell&&this.focusEdge(t._selectedCell),t._shift||(t._fixedCell=null,t._selectedCell=null,t._fixedCellName=null))},_onCellMultiSelect:function(e){this._antiBlur=!0;const t=this.plugins.table,i=this.util.getParentElement(e.target,this.util.isCell);if(t._shift)i===t._fixedCell?t._toggleEditor.call(this,!0):t._toggleEditor.call(this,!1);else if(!t._ref){if(i===t._fixedCell)return;t._toggleEditor.call(this,!1)}i&&i!==t._selectedCell&&t._fixedCellName===i.nodeName&&t._selectedTable===this.util.getParentElement(i,"TABLE")&&(t._selectedCell=i,t._setMultiCells.call(this,t._fixedCell,i))},_setMultiCells:function(e,t){const i=this.plugins.table,n=i._selectedTable.rows,o=this.util,l=i._selectedTable.querySelectorAll(".se-table-selected-cell");for(let e=0,t=l.length;e0)for(let e,t=0;tu||(d>=e.index?(l+=e.cs,d+=e.cs,e.rs-=1,e.row=u+1,e.rs<1&&(s.splice(t,1),t--)):f===g-1&&(e.rs-=1,e.row=u+1,e.rs<1&&(s.splice(t,1),t--)));if(r){if(n!==e&&n!==t||(c.cs=null!==c.cs&&c.csd+h?c.ce:d+h,c.rs=null!==c.rs&&c.rsu+p?c.re:u+p,c._i+=1),2===c._i){r=!1,s=[],a=[],u=-1;break}}else if(o.getOverlapRangeAtIndex(c.cs,c.ce,d,d+h)&&o.getOverlapRangeAtIndex(c.rs,c.re,u,u+p)){const e=c.csd+h?c.ce:d+h,i=c.rsu+p?c.re:u+p;if(c.cs!==e||c.ce!==t||c.rs!==i||c.re!==l){c.cs=e,c.ce=t,c.rs=i,c.re=l,u=-1,s=[],a=[];break}o.addClass(n,"se-table-selected-cell")}p>0&&a.push({index:d,cs:h+1,rs:p,row:-1}),l+=n.colSpan-1}s=s.concat(a).sort((function(e,t){return e.index-t.index})),a=[]}},_removeEvents:function(){const e=this.plugins.table;e._initBind&&(this._wd.removeEventListener("touchmove",e._initBind),e._initBind=null),e._bindOnSelect&&(this._wd.removeEventListener("mousedown",e._bindOnSelect),this._wd.removeEventListener("mousemove",e._bindOnSelect),e._bindOnSelect=null),e._bindOffSelect&&(this._wd.removeEventListener("mouseup",e._bindOffSelect),e._bindOffSelect=null),e._bindOffShift&&(this._wd.removeEventListener("keyup",e._bindOffShift),e._bindOffShift=null)},_initBind:null,onTableCellMultiSelect:function(e,t){const i=this.plugins.table;i._removeEvents.call(this),this.controllersOff(),i._shift=t,i._fixedCell=e,i._fixedCellName=e.nodeName,i._selectedTable=this.util.getParentElement(e,"TABLE");const n=i._selectedTable.querySelectorAll(".se-table-selected-cell");for(let e=0,t=n.length;e-1?(t=e.toLowerCase(),n="blockquote"===t?"range":"pre"===t?"free":"replace",a=/^h/.test(t)?t.match(/\d+/)[0]:"",s=i["tag_"+(a?"h":t)]+a,u="",c=""):(t=e.tag.toLowerCase(),n=e.command,s=e.name||t,u=e.class,c=u?' class="'+u+'"':""),r+='
  • ";return r+="",n.innerHTML=r,n},active:function(e){let t=this.lang.toolbar.formats;const i=this.context.formatBlock.targetText;if(e){if(this.util.isFormatElement(e)){const n=this.context.formatBlock._formatList,o=e.nodeName.toLowerCase(),l=(e.className.match(/(\s|^)__se__format__[^\s]+/)||[""])[0].trim();for(let e,i=0,r=n.length;i=0;d--)if(n=f[d],n!==(f[d+1]?f[d+1].parentNode:null)){if(u=a.isComponent(n),l=u?"":n.innerHTML.replace(/(?!>)\s+(?=<)|\n/g," "),r=a.getParentElement(n,(function(e){return e.parentNode===t})),(t!==n.parentNode||u)&&(a.isFormatElement(t)?(t.parentNode.insertBefore(i,t.nextSibling),t=t.parentNode):(t.insertBefore(i,r?r.nextSibling:null),t=n.parentNode),s=i.nextSibling,s&&i.nodeName===s.nodeName&&a.isSameAttributes(i,s)&&(i.innerHTML+="
    "+s.innerHTML,a.removeItem(s)),i=o.cloneNode(!1),h=!0),c=i.innerHTML,i.innerHTML=(h||!l||!c||/
    $/i.test(l)?l:l+"
    ")+c,0===d){t.insertBefore(i,n),s=n.nextSibling,s&&i.nodeName===s.nodeName&&a.isSameAttributes(i,s)&&(i.innerHTML+="
    "+s.innerHTML,a.removeItem(s));const e=i.previousSibling;e&&i.nodeName===e.nodeName&&a.isSameAttributes(i,e)&&(e.innerHTML+="
    "+i.innerHTML,a.removeItem(i))}u||a.removeItem(n),l&&(h=!1)}this.setRange(n,0,n,0)}else{for(let e,t,i=0,r=f.length;i('+i.toolbar.default+")";for(let e,t=0,i=o.length;t";return l+="",n.innerHTML=l,n},on:function(){const e=this.context.lineHeight,t=e._sizeList,i=this.util.getFormatElement(this.getSelectionNode()),n=i?i.style.lineHeight+"":"";if(n!==e.currentSize){for(let e=0,i=t.length;e"}return r+="",i.innerHTML=r,i},on:function(){const e=this.context.paragraphStyle._classList,t=this.util.getFormatElement(this.getSelectionNode());for(let i=0,n=e.length;i"}return l+="",i.innerHTML=l,i},on:function(){const e=this.util,t=this.context.textStyle._styleList,i=this.getSelectionNode();for(let n,o,l,r=0,s=t.length;r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,r=!0,s=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return r=e.done,e},e:function(e){s=!0,l=e},f:function(){try{r||null==i.return||i.return()}finally{if(s)throw l}}}}function yt(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i0)for(var o in n=!this.tagsAreExclusive,this.tags){var l=this.tags[o].replace(/^(-|\+)/,"");0<=this.config.uielements[i].tags.indexOf(l)&&(n=!this.tags[o].startsWith("-"))}n&&t.append(this.getNewUiElementCard(this.config.uielements[i],e))}this.newPanel.close(),this.selectionPanel.open()}},{key:"drawNewForm",value:function(e,t){this.newPanel.dialog.innerHTML=e;var i=this.newPanel.dialog;kt(i),this.dispatchInitFormEvent(i,this);var n=i.querySelector("form");n.manager=this,n.position=t,n.addEventListener("submit",(function(e){e.preventDefault();var t=e.currentTarget;return t.manager.submitUiElementForm(t,(function(){if(200===this.status){var e=JSON.parse(this.responseText);e.error?this.form.manager.drawNewForm(e.form_html,this.form.position):(this.form.manager.create(e.code,e.data,e.previewHtml,this.form.position),this.form.manager.newPanel.close(),this.form.manager.selectionPanel.close())}200!==this.status&&alert(this.form.manager.config.errorMessage)})),!1}));var o=i.querySelector(".js-uie-cancel");o.panel=this.newPanel,o.addEventListener("click",(function(e){e.currentTarget.panel.close()}));var l=i.querySelector(".js-uie-save");l.panel=this.newPanel,l.addEventListener("click",(function(e){e.currentTarget.panel.dialog.querySelector("form").dispatchEvent(new Event("submit",{cancelable:!0}))}))}},{key:"openNewPanel",value:function(e,t,i){this.newPanel.dialog.manager=this,this.newPanel.dialog.position=i,this.drawNewForm(e,i),this.newPanel.open()}},{key:"editUiElement",value:function(e){this.loadUiElementEditForm(e,(function(t){if(200===this.status){var i=JSON.parse(this.responseText);e.manager.openEditPanel(i.form_html,e)}}))}},{key:"drawEditForm",value:function(e,t){this.editPanel.dialog.querySelector(".js-uie-content").innerHTML=e;var i=this.editPanel.dialog;kt(i),this.dispatchInitFormEvent(i,this);var n=i.querySelector("form");n.manager=this,n.uiElement=t,n.addEventListener("submit",(function(e){e.preventDefault();var t=e.currentTarget;return t.manager.submitUiElementForm(t,(function(){if(200===this.status){var e=JSON.parse(this.responseText);e.error?this.form.manager.drawEditForm(e.form_html,this.form.uiElement):(this.form.uiElement.data=e.data,this.form.uiElement.previewHtml=e.previewHtml,this.form.manager.write(),this.form.manager.editPanel.close())}200!==this.status&&alert(this.config.errorMessage)})),!1}));var o=i.querySelector(".js-uie-cancel");o.panel=this.editPanel,o.addEventListener("click",(function(e){e.currentTarget.panel.close()}));var l=i.querySelector(".js-uie-save");l.panel=this.editPanel,l.addEventListener("click",(function(e){e.currentTarget.panel.dialog.querySelector("form").dispatchEvent(new Event("submit",{cancelable:!0}))}))}},{key:"openEditPanel",value:function(e,t){this.editPanel.dialog.manager=this,this.editPanel.dialog.uiElement=t,this.drawEditForm(e,t),this.editPanel.open()}},{key:"write",value:function(){this.input.value=this.uiElements.length>0?JSON.stringify(this.uiElements):"",this.drawUiElements(),document.dispatchEvent(new CustomEvent("mbiz:rich-editor:write-complete",{detail:{editorManager:this}}))}},{key:"create",value:function(e,t,i,n){var o=new MonsieurBizRichEditorUiElement(this.config,e,t,i);return this.uiElements.splice(n,0,o),this.write(),o}},{key:"moveUp",value:function(e){var t=this.uiElements.indexOf(e);0!==t&&(this.uiElements.splice(t,1),this.uiElements.splice(t-1,0,e),this.write())}},{key:"moveDown",value:function(e){var t=this.uiElements.indexOf(e);t!==this.uiElements.length-1&&(this.uiElements.splice(t,1),this.uiElements.splice(t+1,0,e),this.write())}},{key:"delete",value:function(e){var t=this.uiElements.indexOf(e);this.uiElements.splice(t,1),this.write()}},{key:"loadUiElementCreateForm",value:function(e,t){var i=new XMLHttpRequest;i.onload=t;var n=this.config.createElementFormUrl;i.open("get",n.replace("__CODE__",e.code),!0),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.send()}},{key:"loadUiElementEditForm",value:function(e,t){var i=new XMLHttpRequest;i.onload=t;var n=this.config.editElementFormUrl;i.open("post",n.replace("__CODE__",e.code),!0),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.send(new URLSearchParams({data:JSON.stringify(e.data)}).toString())}},{key:"submitUiElementForm",value:function(e,t){var i=new XMLHttpRequest;i.onload=t,i.form=e,i.open("post",e.action,!0),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.send(new FormData(e))}},{key:"requestUiElementsHtml",value:function(e,t){var i=new XMLHttpRequest;i.onload=t,i.open("post",this.config.renderElementsUrl,!0),i.setRequestHeader("X-Requested-With","XMLHttpRequest");var n=new FormData;n.append("ui_elements",JSON.stringify(e)),this.input.dataset.locale&&n.append("locale",this.input.dataset.locale),i.uiElements=e,i.manager=this,i.send(n)}},{key:"isClipboardEmpty",value:function(){var e=window.localStorage.getItem("monsieurBizRichEditorClipboard");return null===e||""===e}},{key:"saveUiElementToClipboard",value:function(e,t){window.localStorage.setItem("monsieurBizRichEditorClipboard",JSON.stringify(e)),t(),document.dispatchEvent(new CustomEvent("mbiz:rich-editor:uielement:copied",{}))}},{key:"pasteUiElementFromClipboard",value:function(e){var t=window.localStorage.getItem("monsieurBizRichEditorClipboard");if(null!==t){var i=JSON.parse(t),n=this;n.requestUiElementsHtml([i],(function(){if(200===this.status){var t=JSON.parse(this.responseText).shift();void 0===i.code&&void 0!==i.type&&(i.code=i.type,i.data=i.fields,delete i.type,delete i.fields);var o=n.config.findUiElementByCode(i.code);if(null!==o)if(n.tags.length>0){var l=!1;for(var r in n.tags)0<=n.config.uielements[o.code].tags.indexOf(n.tags[r])&&(l=!0);l?n.create(o.code,i.data,t,e):alert(n.config.unallowedUiElementMessage)}else n.create(o.code,i.data,t,e)}}))}}},{key:"dispatchInitFormEvent",value:function(e,t){document.dispatchEvent(new CustomEvent("monsieurBizRichEditorInitForm",{detail:{form:e,manager:t}}))}}])}()})()})(); \ No newline at end of file