Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

refactor: editor on ios

ammarahm-ed44c37b03bcd8
diff --git a/apps/mobile/html/Web.bundle/site/constants.js b/apps/mobile/html/Web.bundle/site/constants.js
new file mode 100644
index 000000000..e4cc0deb6
--- /dev/null
+++ b/apps/mobile/html/Web.bundle/site/constants.js
@@ -0,0 +1,489 @@
+let requiring = null;
+const pageTheme = {
+ colors: {
+ accent: '#0560FF',
+ shade: '#0560FF12',
+ fg: '#0560FF',
+ normal: 'black',
+ icon: 'gray',
+ errorBg: '#FFD2D2',
+ errorText: '#D8000C',
+ successBg: '#DFF2BF',
+ successText: '#4F8A10',
+ warningBg: '#FEEFB3',
+ warningText: '#9F6000',
+ night: false,
+ bg: 'white',
+ navbg: '#f6fbfc',
+ nav: '#f0f0f0',
+ pri: 'black',
+ sec: 'white',
+ factor: 1
+ }
+}
+
+const setTheme = function () {
+
+
+ let css = document.createElement('style');
+ css.type = 'text/css';
+
+ let node = `
+ .ql-snow.ql-toolbar button:hover,
+ .ql-snow .ql-toolbar button:hover,
+ .ql-snow.ql-toolbar button:focus,
+ .ql-snow .ql-toolbar button:focus,
+ .ql-snow.ql-toolbar button.ql-active,
+ .ql-snow .ql-toolbar button.ql-active,
+ .ql-snow.ql-toolbar .ql-picker-label:hover,
+ .ql-snow .ql-toolbar .ql-picker-label:hover,
+ .ql-snow.ql-toolbar .ql-picker-label.ql-active,
+ .ql-snow .ql-toolbar .ql-picker-label.ql-active,
+ .ql-snow.ql-toolbar .ql-picker-item:hover,
+ .ql-snow .ql-toolbar .ql-picker-item:hover,
+ .ql-snow.ql-toolbar .ql-picker-item.ql-selected,
+ .ql-snow .ql-toolbar .ql-picker-item.ql-selected {
+ color: ${pageTheme.colors.accent};
+ }
+ .ql-snow.ql-toolbar button:hover .ql-fill,
+ .ql-snow .ql-toolbar button:hover .ql-fill,
+ .ql-snow.ql-toolbar button:focus .ql-fill,
+ .ql-snow .ql-toolbar button:focus .ql-fill,
+ .ql-snow.ql-toolbar button.ql-active .ql-fill,
+ .ql-snow .ql-toolbar button.ql-active .ql-fill,
+ .ql-snow.ql-toolbar .ql-picker-label:hover .ql-fill,
+ .ql-snow .ql-toolbar .ql-picker-label:hover .ql-fill,
+ .ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-fill,
+ .ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-fill,
+ .ql-snow.ql-toolbar .ql-picker-item:hover .ql-fill,
+ .ql-snow .ql-toolbar .ql-picker-item:hover .ql-fill,
+ .ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-fill,
+ .ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-fill,
+ .ql-snow.ql-toolbar button:hover .ql-stroke.ql-fill,
+ .ql-snow .ql-toolbar button:hover .ql-stroke.ql-fill,
+ .ql-snow.ql-toolbar button:focus .ql-stroke.ql-fill,
+ .ql-snow .ql-toolbar button:focus .ql-stroke.ql-fill,
+ .ql-snow.ql-toolbar button.ql-active .ql-stroke.ql-fill,
+ .ql-snow .ql-toolbar button.ql-active .ql-stroke.ql-fill,
+ .ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,
+ .ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,
+ .ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,
+ .ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,
+ .ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,
+ .ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,
+ .ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill,
+ .ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill {
+ fill: ${pageTheme.colors.accent};
+ }
+ .ql-snow.ql-toolbar button:hover .ql-stroke,
+ .ql-snow .ql-toolbar button:hover .ql-stroke,
+ .ql-snow.ql-toolbar button:focus .ql-stroke,
+ .ql-snow .ql-toolbar button:focus .ql-stroke,
+ .ql-snow.ql-toolbar button.ql-active .ql-stroke,
+ .ql-snow .ql-toolbar button.ql-active .ql-stroke,
+ .ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke,
+ .ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke,
+ .ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke,
+ .ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke,
+ .ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke,
+ .ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke,
+ .ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke,
+ .ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke,
+ .ql-snow.ql-toolbar button:hover .ql-stroke-miter,
+ .ql-snow .ql-toolbar button:hover .ql-stroke-miter,
+ .ql-snow.ql-toolbar button:focus .ql-stroke-miter,
+ .ql-snow .ql-toolbar button:focus .ql-stroke-miter,
+ .ql-snow.ql-toolbar button.ql-active .ql-stroke-miter,
+ .ql-snow .ql-toolbar button.ql-active .ql-stroke-miter,
+ .ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke-miter,
+ .ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke-miter,
+ .ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,
+ .ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,
+ .ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke-miter,
+ .ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke-miter,
+ .ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter,
+ .ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter {
+ stroke: ${pageTheme.colors.accent};
+ }
+
+
+ .ql-editor ul[data-checked='true'] > li::before,
+ .ql-editor ul[data-checked='false'] > li::before {
+ color: #777;
+ cursor: pointer;
+ pointer-events: all;
+ }
+
+ @media (pointer: coarse) {
+ .ql-snow.ql-toolbar button:hover:not(.ql-active),
+ .ql-snow .ql-toolbar button:hover:not(.ql-active) {
+ color: ${pageTheme.colors.icon};
+ }
+ .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-fill,
+ .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-fill,
+ .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill,
+ .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill {
+ fill: ${pageTheme.colors.icon};
+ }
+ .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke,
+ .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke,
+ .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter,
+ .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter {
+ stroke: ${pageTheme.colors.icon};
+ }
+ }
+
+ .ql-snow .ql-stroke {
+ fill: none;
+ stroke: ${pageTheme.colors.icon};
+ stroke-linecap: round;
+ stroke-linejoin: round;
+ stroke-width: 2;
+ }
+ .ql-snow .ql-stroke-miter {
+ fill: none;
+ stroke: ${pageTheme.colors.icon};
+ stroke-miterlimit: 10;
+ stroke-width: 2;
+ }
+ .ql-snow .ql-fill,
+ .ql-snow .ql-stroke.ql-fill {
+ fill: ${pageTheme.colors.icon};
+ }
+
+ .ql-snow .ql-editor blockquote {
+ border-left: 4px solid ${pageTheme.colors.nav};
+ margin-bottom: 5px;
+ margin-top: 5px;
+ padding-left: 16px;
+ }
+ .ql-snow .ql-editor code,
+ .ql-snow .ql-editor pre {
+ background-color: ${pageTheme.colors.nav};
+ border-radius: 3px;
+ color:${pageTheme.colors.icon}
+ }
+
+ .ql-snow .ql-editor pre.ql-syntax {
+ background-color: ${pageTheme.colors.nav};
+ color: 'black';
+ overflow: visible;
+ }
+
+ .ql-snow .ql-picker {
+ color: ${pageTheme.colors.icon};
+ display: inline-block;
+ float: left;
+ font-size:${(pageTheme.colors.factor * 16)};
+ font-weight: 500;
+ height: 24px;
+ position: relative;
+ vertical-align: middle;
+ }
+
+ .ql-snow .ql-picker-options {
+ background-color: ${pageTheme.colors.nav};
+ display: none;
+ min-width: inherit;
+ padding: 4px 8px;
+ position: fixed;
+ }
+
+ .ql-snow .ql-picker.ql-expanded .ql-picker-label {
+ color: ${pageTheme.colors.nav};
+ z-index: 2;
+ }
+ .ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-fill {
+ fill: ${pageTheme.colors.nav};
+ }
+ .ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-stroke {
+ stroke: ${pageTheme.colors.nav};
+ }
+
+ .ql-snow .ql-color-picker.ql-background .ql-picker-item {
+ background-color: ${pageTheme.colors.bg};
+ }
+ .ql-snow .ql-color-picker.ql-color .ql-picker-item {
+ background-color: ${pageTheme.colors.sec};
+ }
+
+ .ql-toolbar.ql-snow .ql-picker-options {
+ border: 1px solid transparent;
+ box-shadow: rgba(0, 0, 0, 0.2) 0 2px 8px;
+ }
+ .ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label {
+ border-color: ${pageTheme.colors.nav};
+ }
+ .ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options {
+ border-color: ${pageTheme.colors.nav};
+ }
+ .ql-toolbar.ql-snow .ql-color-picker .ql-picker-item.ql-selected,
+ .ql-toolbar.ql-snow .ql-color-picker .ql-picker-item:hover {
+ border-color: ${pageTheme.colors.pri};
+ }
+
+ .ql-snow .ql-tooltip {
+ background-color: ${pageTheme.colors.bg};
+ box-shadow: 0px 0px 5px #000;
+ color: ${pageTheme.colors.icon};
+ padding: 5px 12px;
+ white-space: nowrap;
+ position: absolute;
+ font-size:${(pageTheme.colors.factor * 12)};
+ }
+
+ .ql-snow .ql-tooltip a.ql-action::after {
+ border-right: 1px solid ${pageTheme.colors.nav};
+ content: 'Edit';
+ margin-left: 16px;
+ padding-right: 8px;
+ }
+ .ql-snow a {
+ color: ${pageTheme.colors.accent};
+ }
+ .ql-container.ql-snow {
+ border: 1px solid ${pageTheme.colors.nav};
+ background-color:transparent;
+ }
+ .ql-snow.ql-toolbar button,
+ .ql-snow .ql-toolbar button {
+
+ height: ${(pageTheme.colors.factor * 32)};
+ width: ${(pageTheme.colors.factor * 36)};
+ }
+
+
+ .ql-toolbar {
+ background-color:transparent;
+ border-top: 1px solid ${pageTheme.colors.nav};
+ overflow-x: auto;
+ width: 100vw;
+ white-space: nowrap;
+ position: absolute;
+ zIndex:999;
+ bottom: 0px;
+ height: 50px;
+ left: 0px;
+ border-top: 1px solid ${pageTheme.colors.nav};
+ }
+
+ .ql-editor.ql-blank::before {
+ color: ${pageTheme.colors.icon}
+ }
+
+ #titleInput {
+ color:${pageTheme.colors.pri};
+ font-size:${27 * pageTheme.colors.factor};
+
+ }
+ #titleInput::-webkit-input-placeholder {
+ color:${pageTheme.colors.icon}
+ }
+
+ .ql-picker-options {
+ background-color: ${pageTheme.colors.nav};
+ border-color:${pageTheme.colors.nav};
+ }
+ .ql-container {
+ font-size:${(pageTheme.colors.factor * 18)};
+ color:${pageTheme.colors.pri};
+ }
+
+ .info-bar {
+ color:${pageTheme.colors.icon};
+ }
+
+ svg {
+ fill: ${pageTheme.colors.pri} !important;
+ }
+
+ `
+ css.appendChild(document.createTextNode(node));
+ document.getElementsByTagName("head")[0].appendChild(css);
+}
+
+let proToolbar = [
+ [{header: 1}, {header: 2}],
+ [{size: ['small', false, 'large', 'huge']}], // custom dropdown
+ ['bold', 'italic', 'image'], // toggled buttons
+ [{list: 'ordered'}, {list: 'bullet'}, {list: 'check'}],
+ [{header: [3, 4, 5, 6]}],
+ [{align: []}],
+ [{color: []}, {background: []}], // dropdown with defaults from theme
+ ['underline', 'strike', 'blockquote', 'code-block'],
+ [{script: 'sub'}, {script: 'super'}], // superscript/subscript
+ [{indent: '-1'}, {indent: '+1'}], // outdent/indent
+ [{direction: 'rtl'}], // text direction
+ ['clean'],
+];
+let simpleToolbar = [
+ [{header: 1}, {header: 2}],
+ ['bold', 'italic', 'underline', 'strike'], // toggled buttons
+ [{align: []}],
+ [{direction: 'rtl'}], // text direction
+
+];
+
+let fonts = ['DM Sans', 'sans-serif'];
+let fontNames = fonts.map(font => getFontName(font));
+function getFontName(font) {
+ return font.toLowerCase().replace(/\s/g, '-');
+}
+
+function addLinkMatcher() {
+ editor.clipboard.addMatcher(Node.TEXT_NODE, function (node, delta) {
+ let regex = /https?:\/\/[^\s]+/g;
+ if (typeof node.data !== 'string') return;
+
+ let matches = node.data.toLowerCase().match(regex);
+
+ if (matches && matches.length > 0) {
+ let ops = [];
+ let str = node.data;
+ matches.forEach(function (match) {
+ let split = str.split(match);
+ let beforeLink = split.shift();
+ ops.push({insert: beforeLink});
+ ops.push({insert: match, attributes: {link: match}});
+ str = split.join(match);
+ });
+ ops.push({insert: str});
+ delta.ops = ops;
+ }
+
+ return delta;
+ });
+}
+
+function setFonts() {
+ // specify the fonts you would
+ let fontStyles = '';
+ fonts.forEach(function (font) {
+ let fontName = getFontName(font);
+ fontStyles +=
+ '.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=' +
+ fontName +
+ ']::before, .ql-snow .ql-picker.ql-font .ql-picker-item[data-value=' +
+ fontName +
+ ']::before {' +
+ "content: '" +
+ font +
+ "';" +
+ "font-family: '" +
+ font +
+ "';" +
+ '}' +
+ '.ql-font-' +
+ fontName +
+ '{' +
+ " font-family: '" +
+ font +
+ "';" +
+ '}';
+ });
+ let node = document.createElement('style');
+ node.innerHTML = fontStyles;
+ document.body.appendChild(node);
+}
+
+function fixDropdownMenuLocations() {
+ document.querySelectorAll('.ql-picker').forEach(e => {
+ e.addEventListener('mousedown', function (e) {
+ e.preventDefault();
+
+ })
+ })
+
+ document.querySelectorAll('.ql-picker-label').forEach(e => {
+ e.addEventListener('click', function (evt) {
+
+ let top;
+ let left;
+ let menu;
+ let evtItemWidth;
+ let evtItemHeight;
+
+ if (!evt.target.offsetParent) {
+
+ let _myLocalElement = evt.path.filter(o => o.className == "ql-picker-label");
+
+ var rect = _myLocalElement[0].getBoundingClientRect();
+ evtItemWidth = _myLocalElement[0].offsetParent.offsetWidth;
+ evtItemHeight = _myLocalElement[0].offsetParent.offsetHeight;
+
+ top = rect.top;
+ left = rect.left;
+
+ menu = _myLocalElement[0].attributes.getNamedItem('aria-controls').value;
+ } else {
+ //left = evt.target.offsetParent.offsetLeft;
+ evtItemWidth = evt.target.offsetParent.offsetWidth;
+ evtItemHeight = evt.target.offsetParent.offsetHeight;
+
+
+ var rect = evt.target.offsetParent.getBoundingClientRect();
+ top = rect.top;
+ left = rect.left;
+ menu = evt.target.attributes.getNamedItem('aria-controls').value;
+ }
+
+
+ let menuHeight = document.getElementById(menu).offsetHeight;
+ let menuWidth = document.getElementById(menu).offsetWidth;
+ let wDiff;
+ if (menuWidth < evtItemWidth) {
+ wDiff = evtItemWidth - menuWidth;
+ left = left + (wDiff / 2);
+ } else {
+ wDiff = menuWidth - evtItemWidth;
+ left = left - (wDiff / 2);
+ }
+
+ dropDownFixPosition(
+ '.ql-picker-label',
+ menu,
+ top,
+ left,
+ menuHeight,
+ menuWidth
+ )
+
+ })
+ })
+
+
+ function dropDownFixPosition(button, dropdown, top, left, height, width) {
+
+ let b = document.querySelector(button);
+
+ var dropDownTop = top - (b.offsetHeight / 2) - height;
+
+ let screenWidth = window.outerWidth;
+
+ if (left + width > screenWidth) {
+ left = left - (left + width - screenWidth);
+ left -= 10;
+
+ }
+ document.getElementById(dropdown).style.top = dropDownTop;
+ document.getElementById(dropdown).style.left = left;
+
+ //dropdown.css('top', dropDownTop + 'px');
+ //dropdown.css('left', left + 'px');
+
+ window.addEventListener('resize', function () {
+
+
+ let currentTop = document.querySelector('#toolbar').offsetTop;
+
+ let downTop =
+ currentTop - b.offsetHeight - height;
+
+
+ document.getElementById(dropdown).style.top = downTop + 20;
+ document.getElementById(dropdown).style.left = left;
+
+
+ })
+ }
+}
\ No newline at end of file
diff --git a/apps/mobile/html/Web.bundle/site/index.html b/apps/mobile/html/Web.bundle/site/index.html
index 22974d243..098d4393e 100644
--- a/apps/mobile/html/Web.bundle/site/index.html
+++ b/apps/mobile/html/Web.bundle/site/index.html
@@ -1,16664 +1,96 @@
<html>
<head>
- <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
- <link href="fonts.css" rel="stylesheet">
- <style>
- .app-body {
- margin: 0px;
- overflow: hidden;
- }
-
- .floating-toolbar {
- position: fixed;
- bottom: 0;
- width: 100%;
- background-color: white;
- }
-
- #editor {
- border: hidden !important;
-
- }
- </style>
- <style>
- /*!
- * Quill Editor v1.3.6
- * https://quilljs.com/
- * Copyright (c) 2014, Jason Chen
- * Copyright (c) 2013, salesforce.com
- */
- .ql-container {
- box-sizing: border-box;
- font-family: 'Noto Sans', sans-serif;
-
- margin: 0px;
- position: relative;
-
- height: calc(100% - 105px) !important;
- }
-
- .ql-container.ql-disabled .ql-tooltip {
- visibility: hidden;
- }
-
- .ql-container.ql-disabled .ql-editor ul[data-checked]>li::before {
- pointer-events: none;
- }
-
- .ql-clipboard {
- left: -100000px;
- height: 1px;
- overflow-y: hidden;
- position: absolute;
- top: 50%;
- }
-
- .ql-clipboard p {
- margin: 0;
- padding: 0;
- }
-
- .ql-editor {
- box-sizing: border-box;
- line-height: 1.42;
- height: 100%;
- outline: none;
- overflow-y: auto;
- padding: 12px 12px;
- tab-size: 4;
- -moz-tab-size: 4;
- text-align: left;
- white-space: pre-wrap;
- word-wrap: break-word;
- }
-
- .ql-editor>* {
- cursor: text;
- }
-
- .ql-editor p,
- .ql-editor ol,
- .ql-editor ul,
- .ql-editor pre,
- .ql-editor blockquote,
- .ql-editor h1,
- .ql-editor h2,
- .ql-editor h3,
- .ql-editor h4,
- .ql-editor h5,
- .ql-editor h6 {
- margin: 0;
- padding: 0;
- counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
- }
-
- .ql-editor ol,
- .ql-editor ul {
- padding-left: 1.5em;
- }
-
- .ql-editor ol>li,
- .ql-editor ul>li {
- list-style-type: none;
- }
-
- .ql-editor ul>li::before {
- content: '\2022';
- }
-
- .ql-editor ul[data-checked='true'],
- .ql-editor ul[data-checked='false'] {
- pointer-events: none;
- }
-
- .ql-editor ul[data-checked='true']>li *,
- .ql-editor ul[data-checked='false']>li * {
- pointer-events: all;
- }
-
- .ql-editor ul[data-checked='true']>li::before {
- content: '\2611';
- }
-
- .ql-editor ul[data-checked='false']>li::before {
- content: '\2610';
- }
-
- .ql-editor li::before {
- display: inline-block;
- white-space: nowrap;
- width: 1.2em;
- }
-
- .ql-editor li:not(.ql-direction-rtl)::before {
- margin-left: -1.5em;
- margin-right: 0.3em;
- text-align: right;
- }
-
- .ql-editor li.ql-direction-rtl::before {
- margin-left: 0.3em;
- margin-right: -1.5em;
- }
-
- .ql-editor ol li:not(.ql-direction-rtl),
- .ql-editor ul li:not(.ql-direction-rtl) {
- padding-left: 0.1em;
- }
-
- .ql-editor ol li.ql-direction-rtl,
- .ql-editor ul li.ql-direction-rtl {
- padding-right: 2.5em;
- }
-
- .ql-editor ol li {
- counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
- counter-increment: list-0;
- }
-
- .ql-editor ol li:before {
- content: counter(list-0, decimal) '. ';
- }
-
- .ql-editor ol li.ql-indent-1 {
- counter-increment: list-1;
- }
-
- .ql-editor ol li.ql-indent-1:before {
- content: counter(list-1, lower-alpha) '. ';
- }
-
- .ql-editor ol li.ql-indent-1 {
- counter-reset: list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
- }
-
- .ql-editor ol li.ql-indent-2 {
- counter-increment: list-2;
- }
-
- .ql-editor ol li.ql-indent-2:before {
- content: counter(list-2, lower-roman) '. ';
- }
-
- .ql-editor ol li.ql-indent-2 {
- counter-reset: list-3 list-4 list-5 list-6 list-7 list-8 list-9;
- }
-
- .ql-editor ol li.ql-indent-3 {
- counter-increment: list-3;
- }
-
- .ql-editor ol li.ql-indent-3:before {
- content: counter(list-3, decimal) '. ';
- }
-
- .ql-editor ol li.ql-indent-3 {
- counter-reset: list-4 list-5 list-6 list-7 list-8 list-9;
- }
-
- .ql-editor ol li.ql-indent-4 {
- counter-increment: list-4;
- }
-
- .ql-editor ol li.ql-indent-4:before {
- content: counter(list-4, lower-alpha) '. ';
- }
-
- .ql-editor ol li.ql-indent-4 {
- counter-reset: list-5 list-6 list-7 list-8 list-9;
- }
-
- .ql-editor ol li.ql-indent-5 {
- counter-increment: list-5;
- }
-
- .ql-editor ol li.ql-indent-5:before {
- content: counter(list-5, lower-roman) '. ';
- }
-
- .ql-editor ol li.ql-indent-5 {
- counter-reset: list-6 list-7 list-8 list-9;
- }
-
- .ql-editor ol li.ql-indent-6 {
- counter-increment: list-6;
- }
-
- .ql-editor ol li.ql-indent-6:before {
- content: counter(list-6, decimal) '. ';
- }
-
- .ql-editor ol li.ql-indent-6 {
- counter-reset: list-7 list-8 list-9;
- }
-
- .ql-editor ol li.ql-indent-7 {
- counter-increment: list-7;
- }
-
- .ql-editor ol li.ql-indent-7:before {
- content: counter(list-7, lower-alpha) '. ';
- }
-
- .ql-editor ol li.ql-indent-7 {
- counter-reset: list-8 list-9;
- }
-
- .ql-editor ol li.ql-indent-8 {
- counter-increment: list-8;
- }
-
- .ql-editor ol li.ql-indent-8:before {
- content: counter(list-8, lower-roman) '. ';
- }
-
- .ql-editor ol li.ql-indent-8 {
- counter-reset: list-9;
- }
-
- .ql-editor ol li.ql-indent-9 {
- counter-increment: list-9;
- }
-
- .ql-editor ol li.ql-indent-9:before {
- content: counter(list-9, decimal) '. ';
- }
-
- .ql-editor .ql-indent-1:not(.ql-direction-rtl) {
- padding-left: 1.5em;
- }
-
- .ql-editor li.ql-indent-1:not(.ql-direction-rtl) {
- padding-left: 2em;
- }
-
- .ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right {
- padding-right: 1.5em;
- }
-
- .ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right {
- padding-right: 2em;
- }
-
- .ql-editor .ql-indent-2:not(.ql-direction-rtl) {
- padding-left: 3em;
- }
-
- .ql-editor li.ql-indent-2:not(.ql-direction-rtl) {
- padding-left: 3.5em;
- }
-
- .ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right {
- padding-right: 3em;
- }
-
- .ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right {
- padding-right: 3.5em;
- }
-
- .ql-editor .ql-indent-3:not(.ql-direction-rtl) {
- padding-left: 4.5em;
- }
-
- .ql-editor li.ql-indent-3:not(.ql-direction-rtl) {
- padding-left: 5em;
- }
-
- .ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right {
- padding-right: 4.5em;
- }
-
- .ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right {
- padding-right: 5em;
- }
-
- .ql-editor .ql-indent-4:not(.ql-direction-rtl) {
- padding-left: 6em;
- }
-
- .ql-editor li.ql-indent-4:not(.ql-direction-rtl) {
- padding-left: 6.5em;
- }
-
- .ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right {
- padding-right: 6em;
- }
-
- .ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right {
- padding-right: 6.5em;
- }
-
- .ql-editor .ql-indent-5:not(.ql-direction-rtl) {
- padding-left: 7.5em;
- }
-
- .ql-editor li.ql-indent-5:not(.ql-direction-rtl) {
- padding-left: 8em;
- }
-
- .ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right {
- padding-right: 7.5em;
- }
-
- .ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right {
- padding-right: 8em;
- }
-
- .ql-editor .ql-indent-6:not(.ql-direction-rtl) {
- padding-left: 9em;
- }
-
- .ql-editor li.ql-indent-6:not(.ql-direction-rtl) {
- padding-left: 9.5em;
- }
-
- .ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right {
- padding-right: 9em;
- }
-
- .ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right {
- padding-right: 9.5em;
- }
-
- .ql-editor .ql-indent-7:not(.ql-direction-rtl) {
- padding-left: 10.5em;
- }
-
- .ql-editor li.ql-indent-7:not(.ql-direction-rtl) {
- padding-left: 11em;
- }
-
- .ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right {
- padding-right: 10.5em;
- }
-
- .ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right {
- padding-right: 11em;
- }
-
- .ql-editor .ql-indent-8:not(.ql-direction-rtl) {
- padding-left: 12em;
- }
-
- .ql-editor li.ql-indent-8:not(.ql-direction-rtl) {
- padding-left: 12.5em;
- }
-
- .ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right {
- padding-right: 12em;
- }
-
- .ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right {
- padding-right: 12.5em;
- }
-
- .ql-editor .ql-indent-9:not(.ql-direction-rtl) {
- padding-left: 13.5em;
- }
-
- .ql-editor li.ql-indent-9:not(.ql-direction-rtl) {
- padding-left: 14em;
- }
-
- .ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right {
- padding-right: 13.5em;
- }
-
- .ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right {
- padding-right: 14em;
- }
-
- .ql-editor .ql-video {
- display: block;
- max-width: 100%;
- }
-
- .ql-editor .ql-video.ql-align-center {
- margin: 0 auto;
- }
-
- .ql-editor .ql-video.ql-align-right {
- margin: 0 0 0 auto;
- }
-
- .ql-editor .ql-bg-black {
- background-color: #000;
- }
-
- .ql-editor .ql-bg-red {
- background-color: #e60000;
- }
-
- .ql-editor .ql-bg-orange {
- background-color: #f90;
- }
-
- .ql-editor .ql-bg-yellow {
- background-color: #ff0;
- }
-
- .ql-editor .ql-bg-green {
- background-color: #008a00;
- }
-
- .ql-editor .ql-bg-blue {
- background-color: #06c;
- }
-
- .ql-editor .ql-bg-purple {
- background-color: #93f;
- }
-
- .ql-editor .ql-color-white {
- color: #fff;
- }
-
- .ql-editor .ql-color-red {
- color: #e60000;
- }
-
- .ql-editor .ql-color-orange {
- color: #f90;
- }
-
- .ql-editor .ql-color-yellow {
- color: #ff0;
- }
-
- .ql-editor .ql-color-green {
- color: #008a00;
- }
-
- .ql-editor .ql-color-blue {
- color: #06c;
- }
-
- .ql-editor .ql-color-purple {
- color: #93f;
- }
-
- .ql-editor .ql-font-serif {
- font-family: Georgia, Times New Roman, serif;
- }
-
- .ql-editor .ql-font-monospace {
- font-family: Monaco, Courier New, monospace;
- }
-
- .ql-editor .ql-size-small {
- font-size: 0.75em;
- }
-
- .ql-editor .ql-size-large {
- font-size: 1.5em;
- }
-
- .ql-editor .ql-size-huge {
- font-size: 2.5em;
- }
-
- .ql-editor .ql-direction-rtl {
- direction: rtl;
- text-align: inherit;
- }
-
- .ql-editor .ql-align-center {
- text-align: center;
- }
-
- .ql-editor .ql-align-justify {
- text-align: justify;
- }
-
- .ql-editor .ql-align-right {
- text-align: right;
- }
-
- .ql-editor.ql-blank::before {
-
- content: attr(data-placeholder);
- left: 12px;
- pointer-events: none;
- position: absolute;
- right: 12px;
- }
-
- .ql-snow.ql-toolbar:after,
- .ql-snow .ql-toolbar:after {
- clear: both;
- content: '';
- display: table;
- }
-
- .ql-snow.ql-toolbar button,
- .ql-snow .ql-toolbar button {
- background: none;
- border: none;
- cursor: pointer;
- display: inline-block;
- float: left;
- height: 32px;
- padding: 5px 15px;
- width: 36px;
- }
-
- .ql-snow.ql-toolbar button svg,
- .ql-snow .ql-toolbar button svg {
- float: left;
- height: 100%;
- }
-
- .ql-snow.ql-toolbar button:active:hover,
- .ql-snow .ql-toolbar button:active:hover {
- outline: none;
- }
-
- .ql-snow.ql-toolbar input.ql-image[type='file'],
- .ql-snow .ql-toolbar input.ql-image[type='file'] {
- display: none;
- }
-
- .ql-snow {
- box-sizing: border-box;
- justify-content: center;
- flex-direction: column;
- }
-
- .ql-snow * {
- box-sizing: border-box;
- }
-
- .ql-snow .ql-hidden {
- display: none;
- }
-
- .ql-snow .ql-out-bottom,
- .ql-snow .ql-out-top {
- visibility: hidden;
- }
-
- .ql-snow .ql-tooltip {
- position: absolute;
- border-radius: 5px;
- }
-
- .ql-snow .ql-tooltip a {
- cursor: pointer;
- text-decoration: none;
- }
-
- .ql-snow .ql-tooltip.ql-flip {
- transform: translateY(-10px);
- }
-
- .ql-snow .ql-formats {
- display: inline-block;
- vertical-align: middle;
- }
-
- .ql-snow .ql-formats:after {
- clear: both;
- content: '';
- display: table;
- }
-
-
- .ql-snow .ql-empty {
- fill: none;
- }
-
- .ql-snow .ql-even {
- fill-rule: evenodd;
- }
-
- .ql-snow .ql-thin,
- .ql-snow .ql-stroke.ql-thin {
- stroke-width: 1;
- }
-
- .ql-snow .ql-transparent {
- opacity: 0.4;
- }
-
- .ql-snow .ql-direction svg:last-child {
- display: none;
- }
-
- .ql-snow .ql-direction.ql-active svg:last-child {
- display: inline;
- }
-
- .ql-snow .ql-direction.ql-active svg:first-child {
- display: none;
- }
-
- .ql-snow .ql-editor h1 {
- font-size: 2em;
- font-family: 'DM Serif Text', sans-serif;
- font-weight: 400 !important;
- }
-
- .ql-snow .ql-editor h2 {
- font-size: 1.5em;
- font-family: 'DM Serif Text', sans-serif;
- font-weight: 400 !important;
- }
-
- .ql-snow .ql-editor h3 {
- font-size: 1.17em;
- font-family: 'DM Serif Text', sans-serif;
- font-weight: 400 !important;
- }
-
- .ql-snow .ql-editor h4 {
- font-size: 1em;
- font-family: 'DM Serif Text', sans-serif;
- font-weight: 400 !important;
- }
-
- .ql-snow .ql-editor h5 {
- font-size: 0.83em;
- font-family: 'DM Serif Text', sans-serif;
- font-weight: 400 !important;
- }
-
- .ql-snow .ql-editor h6 {
- font-size: 0.67em;
- font-family: 'DM Serif Text', sans-serif;
- font-weight: 400 !important;
- }
-
- .ql-snow .ql-editor a {
- text-decoration: underline;
- }
-
- .ql-snow .ql-editor pre {
- white-space: pre-wrap;
- margin-bottom: 5px;
- margin-top: 5px;
- padding: 5px 10px;
- }
-
- .ql-snow .ql-editor code {
- font-size: 85%;
- padding: 2px 4px;
- }
-
- .ql-snow .ql-editor img {
- max-width: 100%;
- }
-
- .ql-snow .ql-picker-label {
- cursor: pointer;
- display: inline-block;
- height: 100%;
- padding-left: 8px;
- padding-right: 2px;
-
- position: relative;
- width: 110%;
- }
-
- .ql-snow .ql-picker-label::before {
- display: inline-block;
- line-height: 22px;
- }
-
- .ql-snow .ql-picker-options .ql-picker-item {
- cursor: pointer;
- display: block;
- padding-bottom: 5px;
- padding-top: 5px;
- }
-
- .ql-snow .ql-picker.ql-expanded .ql-picker-options {
- display: block;
- margin-top: -1px;
- top: 100%;
- z-index: 1;
- }
-
- .ql-snow .ql-color-picker,
- .ql-snow .ql-icon-picker {
- width: 30px;
- }
-
- .ql-snow .ql-color-picker .ql-picker-label,
- .ql-snow .ql-icon-picker .ql-picker-label {
- padding: 2px 4px;
- }
-
- .ql-snow .ql-color-picker .ql-picker-label svg,
- .ql-snow .ql-icon-picker .ql-picker-label svg {
- right: 4px;
- }
-
- .ql-snow .ql-icon-picker .ql-picker-options {
- padding: 4px 0px;
- }
-
- .ql-snow .ql-icon-picker .ql-picker-item {
- height: 30px;
- width: 30px;
- padding: 2px 4px;
- }
-
- .ql-snow .ql-color-picker .ql-picker-options {
- padding: 3px 5px;
- width: 194px;
- }
-
- .ql-snow .ql-color-picker .ql-picker-item {
- border: 1px solid transparent;
- float: left;
- height: 20px;
- margin: 3px;
- padding: 0px;
- width: 20px;
- }
-
- .ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg {
- position: absolute;
- margin-top: -9px;
- right: 0;
- top: 50%;
- width: 20px;
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before,
- .ql-snow .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before,
- .ql-snow .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before,
- .ql-snow .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before,
- .ql-snow .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before,
- .ql-snow .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before {
- content: attr(data-label);
- }
-
- .ql-snow .ql-picker.ql-header {
- width: 98px;
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-label::before,
- .ql-snow .ql-picker.ql-header .ql-picker-item::before {
- content: 'Normal';
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-label[data-value='1']::before,
- .ql-snow .ql-picker.ql-header .ql-picker-item[data-value='1']::before {
- content: 'Heading 1';
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-label[data-value='2']::before,
- .ql-snow .ql-picker.ql-header .ql-picker-item[data-value='2']::before {
- content: 'Heading 2';
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-label[data-value='3']::before,
- .ql-snow .ql-picker.ql-header .ql-picker-item[data-value='3']::before {
- content: 'Heading 3';
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-label[data-value='4']::before,
- .ql-snow .ql-picker.ql-header .ql-picker-item[data-value='4']::before {
- content: 'Heading 4';
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-label[data-value='5']::before,
- .ql-snow .ql-picker.ql-header .ql-picker-item[data-value='5']::before {
- content: 'Heading 5';
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-label[data-value='6']::before,
- .ql-snow .ql-picker.ql-header .ql-picker-item[data-value='6']::before {
- content: 'Heading 6';
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-item[data-value='1']::before {
- font-size: 2em;
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-item[data-value='2']::before {
- font-size: 1.5em;
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-item[data-value='3']::before {
- font-size: 1.17em;
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-item[data-value='4']::before {
- font-size: 1em;
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-item[data-value='5']::before {
- font-size: 0.83em;
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-item[data-value='6']::before {
- font-size: 0.67em;
- }
-
- .ql-snow .ql-picker.ql-font {
- width: 108px;
- }
-
- .ql-snow .ql-picker.ql-font .ql-picker-label::before,
- .ql-snow .ql-picker.ql-font .ql-picker-item::before {
- content: 'Sans Serif';
- }
-
- .ql-snow .ql-picker.ql-font .ql-picker-label[data-value='serif']::before,
- .ql-snow .ql-picker.ql-font .ql-picker-item[data-value='serif']::before {
- content: 'Serif';
- }
-
- .ql-snow .ql-picker.ql-font .ql-picker-label[data-value='monospace']::before,
- .ql-snow .ql-picker.ql-font .ql-picker-item[data-value='monospace']::before {
- content: 'Monospace';
- }
-
- .ql-snow .ql-picker.ql-font .ql-picker-item[data-value='serif']::before {
- font-family: Georgia, Times New Roman, serif;
- }
-
- .ql-snow .ql-picker.ql-font .ql-picker-item[data-value='monospace']::before {
- font-family: Monaco, Courier New, monospace;
- }
-
- .ql-snow .ql-picker.ql-size {
- width: 98px;
- }
-
- .ql-snow .ql-picker.ql-size .ql-picker-label::before,
- .ql-snow .ql-picker.ql-size .ql-picker-item::before {
- content: 'Normal';
- }
-
- .ql-snow .ql-picker.ql-size .ql-picker-label[data-value='small']::before,
- .ql-snow .ql-picker.ql-size .ql-picker-item[data-value='small']::before {
- content: 'Small';
- }
-
- .ql-snow .ql-picker.ql-size .ql-picker-label[data-value='large']::before,
- .ql-snow .ql-picker.ql-size .ql-picker-item[data-value='large']::before {
- content: 'Large';
- }
-
- .ql-snow .ql-picker.ql-size .ql-picker-label[data-value='huge']::before,
- .ql-snow .ql-picker.ql-size .ql-picker-item[data-value='huge']::before {
- content: 'Huge';
- }
-
- .ql-snow .ql-picker.ql-size .ql-picker-item[data-value='small']::before {
- font-size: 10px;
- }
-
- .ql-snow .ql-picker.ql-size .ql-picker-item[data-value='large']::before {
- font-size: 18px;
- }
-
- .ql-snow .ql-picker.ql-size .ql-picker-item[data-value='huge']::before {
- font-size: 32px;
- }
-
- .ql-toolbar.ql-snow {
- box-sizing: border-box;
- font-family: 'Noto Sans', sans-serif;
- padding: 8px;
- }
-
- .ql-toolbar.ql-snow .ql-formats {
- margin-right: 15px;
- }
-
- .ql-toolbar.ql-snow .ql-picker-label {
- border: 1px solid transparent;
- }
-
- .ql-toolbar.ql-snow+.ql-container.ql-snow {
- border-top: 0px;
- }
-
- .ql-snow .ql-tooltip::before {
- content: 'Visit URL:';
- line-height: 26px;
- margin-right: 8px;
- }
-
- .ql-snow .ql-tooltip a.ql-preview {
- display: inline-block;
- max-width: 200px;
- overflow-x: hidden;
- text-overflow: ellipsis;
- vertical-align: top;
- }
-
- .ql-snow .ql-tooltip a.ql-remove::before {
- content: 'Remove';
- margin-left: 8px;
- }
-
- .ql-snow .ql-tooltip a {
- line-height: 26px;
- }
-
- .ql-snow .ql-tooltip.ql-editing a.ql-preview,
- .ql-snow .ql-tooltip.ql-editing a.ql-remove {
- display: none;
- }
-
- .ql-snow .ql-tooltip.ql-editing input[type='text'] {
- display: inline-block;
- }
-
- .ql-snow .ql-tooltip.ql-editing a.ql-action::after {
- border-right: 0px;
- content: 'Save';
- padding-right: 0px;
- }
-
- .ql-snow .ql-tooltip[data-mode='link']::before {
- content: 'Enter link:';
- }
-
- .ql-snow .ql-tooltip[data-mode='formula']::before {
- content: 'Enter formula:';
- }
-
- .ql-snow .ql-tooltip[data-mode='video']::before {
- content: 'Enter video:';
- }
-
- .ql-toolbar {
- overflow-x: auto;
- width: 100vw;
- white-space: nowrap;
- position: fixed;
- height: 50px;
- bottom: 0px;
- left: 0px;
- }
-
-
- .ql-snow .ql-picker.ql-expanded .ql-picker-label {
- color: #f0f0f0;
- z-index: 2;
- }
-
- .ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-fill {
- fill: #f0f0f0;
- }
-
- .ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-stroke {
- stroke: #f0f0f0;
- }
-
- .ql-snow .ql-color-picker.ql-background .ql-picker-item {
- background-color: white;
- }
-
- .ql-snow .ql-color-picker.ql-color .ql-picker-item {
- background-color: white;
- }
-
- .ql-toolbar.ql-snow .ql-picker-options {
- border: 1px solid transparent;
- box-shadow: rgba(0, 0, 0, 0.2) 0 2px 8px;
- }
-
- .ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label {
- border-color: #f0f0f0;
- }
-
- .ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options {
- border-color: #f0f0f0;
- }
-
- .ql-toolbar.ql-snow .ql-color-picker .ql-picker-item.ql-selected,
- .ql-toolbar.ql-snow .ql-color-picker .ql-picker-item:hover {
- border-color: black;
- }
-
- .ql-snow .ql-tooltip {
- background-color: white;
- box-shadow: 0px 0px 5px #000;
- color: gray;
- padding: 5px 12px;
- white-space: nowrap;
- position: absolute;
- font-size: 12px;
- }
-
- .ql-snow .ql-tooltip a.ql-action::after {
- border-right: 1px solid black;
- content: 'Edit';
- margin-left: 16px;
- padding-right: 8px;
- }
-
- .ql-snow a {
- color: blue;
- }
-
- .ql-container.ql-snow {
- border: 1px solid #f0f0f0;
- }
-
- .ql-toolbar {
- background-color: white;
- border-top: 1px solid black
- }
-
- .ql-editor.ql-blank::before {
- color: black
- }
-
- #titlebar input {
- font-family: "DM Serif Text", sans-serif;
- font-weight: 400 !important;
- width: 100%;
- background-color: transparent;
- border: none;
- height: 50;
- outline: none;
- z-index: 10;
- }
-
- #titlebar {
- background-color: transparent;
- }
-
- .info-bar {
- display: flex;
- color: gray;
- font-size: 11px;
- position: absolute;
- margin-top: -18px;
- font-family: 'DM Sans';
- padding-left: 6px;
- }
-
- #titlebar input:focus {
- outline: none;
- }
-
- #infowords {
- margin-right: 5px;
- margin-left: 5px;
- }
-
- #infodate {
- margin-right: 5px;
- margin-left: 5px;
- }
-
- #infosaved {
- margin-right: 5px;
- margin-left: 5px;
- }
- </style>
-
-</head>
-
-<body class="app-body">
- <div id="titlebar">
- <input id="titleInput" placeholder="Title here" />
- <div class="info-bar">
- <p id="infowords"></p>
- <p>-</p>
- <p id="infodate"></p>
- <p>-</p>
- <p id="infosaved"></p>
- </div>
- <div id="editor"></div>
- <div id="toolbar"></div>
-
-</body>
-
-<script>
- !function (t) { var e = {}; function n(r) { if (e[r]) return e[r].exports; var o = e[r] = { i: r, l: !1, exports: {} }; return t[r].call(o.exports, o, o.exports, n), o.l = !0, o.exports } n.m = t, n.c = e, n.d = function (t, e, r) { n.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: r }) }, n.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }) }, n.t = function (t, e) { if (1 & e && (t = n(t)), 8 & e) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var r = Object.create(null); if (n.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) for (var o in t) n.d(r, o, function (e) { return t[e] }.bind(null, o)); return r }, n.n = function (t) { var e = t && t.__esModule ? function () { return t.default } : function () { return t }; return n.d(e, "a", e), e }, n.o = function (t, e) { return Object.prototype.hasOwnProperty.call(t, e) }, n.p = "/dist/", n(n.s = 44) }([function (t, e) { var n = t.exports = "undefined" != typeof window && window.Math == Math ? window : "undefined" != typeof self && self.Math == Math ? self : Function("return this")(); "number" == typeof __g && (__g = n) }, function (t, e, n) { var r = n(32)("wks"), o = n(33), i = n(0).Symbol, u = "function" == typeof i; (t.exports = function (t) { return r[t] || (r[t] = u && i[t] || (u ? i : o)("Symbol." + t)) }).store = r }, function (t, e) { var n = t.exports = { version: "2.6.10" }; "number" == typeof __e && (__e = n) }, function (t, e, n) { var r = n(9); t.exports = function (t) { if (!r(t)) throw TypeError(t + " is not an object!"); return t } }, function (t, e) { t.exports = {} }, function (t, e, n) { var r = n(8), o = n(30); t.exports = n(6) ? function (t, e, n) { return r.f(t, e, o(1, n)) } : function (t, e, n) { return t[e] = n, t } }, function (t, e, n) { t.exports = !n(29)((function () { return 7 != Object.defineProperty({}, "a", { get: function () { return 7 } }).a })) }, function (t, e, n) { var r = n(0), o = n(2), i = n(12), u = n(5), c = n(14), a = function (t, e, n) { var s, f, l, h = t & a.F, p = t & a.G, v = t & a.S, d = t & a.P, y = t & a.B, m = t & a.W, g = p ? o : o[e] || (o[e] = {}), x = g.prototype, _ = p ? r : v ? r[e] : (r[e] || {}).prototype; for (s in p && (n = e), n) (f = !h && _ && void 0 !== _[s]) && c(g, s) || (l = f ? _[s] : n[s], g[s] = p && "function" != typeof _[s] ? n[s] : y && f ? i(l, r) : m && _[s] == l ? function (t) { var e = function (e, n, r) { if (this instanceof t) { switch (arguments.length) { case 0: return new t; case 1: return new t(e); case 2: return new t(e, n) }return new t(e, n, r) } return t.apply(this, arguments) }; return e.prototype = t.prototype, e }(l) : d && "function" == typeof l ? i(Function.call, l) : l, d && ((g.virtual || (g.virtual = {}))[s] = l, t & a.R && x && !x[s] && u(x, s, l))) }; a.F = 1, a.G = 2, a.S = 4, a.P = 8, a.B = 16, a.W = 32, a.U = 64, a.R = 128, t.exports = a }, function (t, e, n) { var r = n(3), o = n(51), i = n(52), u = Object.defineProperty; e.f = n(6) ? Object.defineProperty : function (t, e, n) { if (r(t), e = i(e, !0), r(n), o) try { return u(t, e, n) } catch (t) { } if ("get" in n || "set" in n) throw TypeError("Accessors not supported!"); return "value" in n && (t[e] = n.value), t } }, function (t, e) { t.exports = function (t) { return "object" == typeof t ? null !== t : "function" == typeof t } }, function (t, e, n) { t.exports = n(83) }, function (t, e) { var n = {}.toString; t.exports = function (t) { return n.call(t).slice(8, -1) } }, function (t, e, n) { var r = n(13); t.exports = function (t, e, n) { if (r(t), void 0 === e) return t; switch (n) { case 1: return function (n) { return t.call(e, n) }; case 2: return function (n, r) { return t.call(e, n, r) }; case 3: return function (n, r, o) { return t.call(e, n, r, o) } }return function () { return t.apply(e, arguments) } } }, function (t, e) { t.exports = function (t) { if ("function" != typeof t) throw TypeError(t + " is not a function!"); return t } }, function (t, e) { var n = {}.hasOwnProperty; t.exports = function (t, e) { return n.call(t, e) } }, function (t, e, n) { n(47); for (var r = n(0), o = n(5), i = n(4), u = n(1)("toStringTag"), c = "CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","), a = 0; a < c.length; a++) { var s = c[a], f = r[s], l = f && f.prototype; l && !l[u] && o(l, u, s), i[s] = i.Array } }, function (t, e, n) { var r = n(50), o = n(17); t.exports = function (t) { return r(o(t)) } }, function (t, e) { t.exports = function (t) { if (null == t) throw TypeError("Can't call method on " + t); return t } }, function (t, e) { t.exports = !0 }, function (t, e, n) { var r = n(9), o = n(0).document, i = r(o) && r(o.createElement); t.exports = function (t) { return i ? o.createElement(t) : {} } }, function (t, e) { var n = Math.ceil, r = Math.floor; t.exports = function (t) { return isNaN(t = +t) ? 0 : (t > 0 ? r : n)(t) } }, function (t, e, n) { var r = n(32)("keys"), o = n(33); t.exports = function (t) { return r[t] || (r[t] = o(t)) } }, function (t, e, n) { var r = n(8).f, o = n(14), i = n(1)("toStringTag"); t.exports = function (t, e, n) { t && !o(t = n ? t : t.prototype, i) && r(t, i, { configurable: !0, value: e }) } }, function (t, e, n) { "use strict"; var r = n(63)(!0); n(28)(String, "String", (function (t) { this._t = String(t), this._i = 0 }), (function () { var t, e = this._t, n = this._i; return n >= e.length ? { value: void 0, done: !0 } : (t = r(e, n), this._i += t.length, { value: t, done: !1 }) })) }, function (t, e, n) { var r = n(11), o = n(1)("toStringTag"), i = "Arguments" == r(function () { return arguments }()); t.exports = function (t) { var e, n, u; return void 0 === t ? "Undefined" : null === t ? "Null" : "string" == typeof (n = function (t, e) { try { return t[e] } catch (t) { } }(e = Object(t), o)) ? n : i ? r(e) : "Object" == (u = r(e)) && "function" == typeof e.callee ? "Arguments" : u } }, function (t, e, n) { "use strict"; var r = n(13); function o(t) { var e, n; this.promise = new t((function (t, r) { if (void 0 !== e || void 0 !== n) throw TypeError("Bad Promise constructor"); e = t, n = r })), this.resolve = r(e), this.reject = r(n) } t.exports.f = function (t) { return new o(t) } }, function (t, e, n) { t.exports = { default: n(68), __esModule: !0 } }, function (t, e, n) { "use strict"; e.__esModule = !0; var r, o = n(26), i = (r = o) && r.__esModule ? r : { default: r }; e.default = function (t) { return function () { var e = t.apply(this, arguments); return new i.default((function (t, n) { return function r(o, u) { try { var c = e[o](u), a = c.value } catch (t) { return void n(t) } if (!c.done) return i.default.resolve(a).then((function (t) { r("next", t) }), (function (t) { r("throw", t) })); t(a) }("next") })) } } }, function (t, e, n) { "use strict"; var r = n(18), o = n(7), i = n(53), u = n(5), c = n(4), a = n(54), s = n(22), f = n(61), l = n(1)("iterator"), h = !([].keys && "next" in [].keys()), p = function () { return this }; t.exports = function (t, e, n, v, d, y, m) { a(n, e, v); var g, x, _, w = function (t) { if (!h && t in L) return L[t]; switch (t) { case "keys": case "values": return function () { return new n(this, t) } }return function () { return new n(this, t) } }, b = e + " Iterator", O = "values" == d, j = !1, L = t.prototype, S = L[l] || L["@@iterator"] || d && L[d], P = S || w(d), E = d ? O ? w("entries") : P : void 0, T = "Array" == e && L.entries || S; if (T && (_ = f(T.call(new t))) !== Object.prototype && _.next && (s(_, b, !0), r || "function" == typeof _[l] || u(_, l, p)), O && S && "values" !== S.name && (j = !0, P = function () { return S.call(this) }), r && !m || !h && !j && L[l] || u(L, l, P), c[e] = P, c[b] = p, d) if (g = { values: O ? P : w("values"), keys: y ? P : w("keys"), entries: E }, m) for (x in g) x in L || i(L, x, g[x]); else o(o.P + o.F * (h || j), e, g); return g } }, function (t, e) { t.exports = function (t) { try { return !!t() } catch (t) { return !0 } } }, function (t, e) { t.exports = function (t, e) { return { enumerable: !(1 & t), configurable: !(2 & t), writable: !(4 & t), value: e } } }, function (t, e, n) { var r = n(20), o = Math.min; t.exports = function (t) { return t > 0 ? o(r(t), 9007199254740991) : 0 } }, function (t, e, n) { var r = n(2), o = n(0), i = o["__core-js_shared__"] || (o["__core-js_shared__"] = {}); (t.exports = function (t, e) { return i[t] || (i[t] = void 0 !== e ? e : {}) })("versions", []).push({ version: r.version, mode: n(18) ? "pure" : "global", copyright: "© 2019 Denis Pushkarev (zloirock.ru)" }) }, function (t, e) { var n = 0, r = Math.random(); t.exports = function (t) { return "Symbol(".concat(void 0 === t ? "" : t, ")_", (++n + r).toString(36)) } }, function (t, e) { t.exports = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",") }, function (t, e, n) { var r = n(0).document; t.exports = r && r.documentElement }, function (t, e, n) { var r = n(24), o = n(1)("iterator"), i = n(4); t.exports = n(2).getIteratorMethod = function (t) { if (null != t) return t[o] || t["@@iterator"] || i[r(t)] } }, function (t, e, n) { var r = n(3), o = n(13), i = n(1)("species"); t.exports = function (t, e) { var n, u = r(t).constructor; return void 0 === u || null == (n = r(u)[i]) ? e : o(n) } }, function (t, e, n) { var r, o, i, u = n(12), c = n(75), a = n(35), s = n(19), f = n(0), l = f.process, h = f.setImmediate, p = f.clearImmediate, v = f.MessageChannel, d = f.Dispatch, y = 0, m = {}, g = function () { var t = +this; if (m.hasOwnProperty(t)) { var e = m[t]; delete m[t], e() } }, x = function (t) { g.call(t.data) }; h && p || (h = function (t) { for (var e = [], n = 1; arguments.length > n;)e.push(arguments[n++]); return m[++y] = function () { c("function" == typeof t ? t : Function(t), e) }, r(y), y }, p = function (t) { delete m[t] }, "process" == n(11)(l) ? r = function (t) { l.nextTick(u(g, t, 1)) } : d && d.now ? r = function (t) { d.now(u(g, t, 1)) } : v ? (i = (o = new v).port2, o.port1.onmessage = x, r = u(i.postMessage, i, 1)) : f.addEventListener && "function" == typeof postMessage && !f.importScripts ? (r = function (t) { f.postMessage(t + "", "*") }, f.addEventListener("message", x, !1)) : r = "onreadystatechange" in s("script") ? function (t) { a.appendChild(s("script")).onreadystatechange = function () { a.removeChild(this), g.call(t) } } : function (t) { setTimeout(u(g, t, 1), 0) }), t.exports = { set: h, clear: p } }, function (t, e) { t.exports = function (t) { try { return { e: !1, v: t() } } catch (t) { return { e: !0, v: t } } } }, function (t, e, n) { var r = n(3), o = n(9), i = n(25); t.exports = function (t, e) { if (r(t), o(e) && e.constructor === t) return e; var n = i.f(t); return (0, n.resolve)(e), n.promise } }, function (t, e, n) { "use strict"; e.__esModule = !0; var r = i(n(45)), o = i(n(65)); function i(t) { return t && t.__esModule ? t : { default: t } } e.default = function (t, e) { if (Array.isArray(t)) return t; if ((0, r.default)(Object(t))) return function (t, e) { var n = [], r = !0, i = !1, u = void 0; try { for (var c, a = (0, o.default)(t); !(r = (c = a.next()).done) && (n.push(c.value), !e || n.length !== e); r = !0); } catch (t) { i = !0, u = t } finally { try { !r && a.return && a.return() } finally { if (i) throw u } } return n }(t, e); throw new TypeError("Invalid attempt to destructure non-iterable instance") } }, function (t, e, n) { "use strict"; e.__esModule = !0, e.default = function (t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") } }, function (t, e, n) { "use strict"; e.__esModule = !0; var r, o = n(85), i = (r = o) && r.__esModule ? r : { default: r }; e.default = function () { function t(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), (0, i.default)(t, r.key, r) } } return function (e, n, r) { return n && t(e.prototype, n), r && t(e, r), e } }() }, function (t, e, n) { "use strict"; n.r(e), n.d(e, "imageCompressor", (function () { return m })); var r, o = n(41), i = n.n(o), u = n(26), c = n.n(u), a = n(10), s = n.n(a), f = n(27), l = n.n(f), h = n(42), p = n.n(h), v = n(43), d = n.n(v), y = (r = l()(s.a.mark((function t(e, n, r, o, u, a) { var f, l, h, p, v, d, y; return s.a.wrap((function (t) { for (; ;)switch (t.prev = t.next) { case 0: return o = o || "image/jpeg", u = u || .7, (f = new Image).src = e, t.next = 6, new c.a((function (t) { f.onload = function () { t() } })); case 6: return l = g(f.width, f.height, n, r), h = i()(l, 2), p = h[0], v = h[1], (d = document.createElement("canvas")).width = p, d.height = v, d.getContext("2d").drawImage(f, 0, 0, p, v), y = d.toDataURL(o, u), t.abrupt("return", y); case 15: case "end": return t.stop() } }), t, this) }))), function (t, e, n, o, i, u) { return r.apply(this, arguments) }); var m = function () { function t(e, n) { p()(this, t), this.quill = e, this.range = null, this.options = n, this.debug = null == n.debug || 1 == n.debug, function (t) { t.maxWidth = t.maxWidth || 1e3, t.maxHeight = t.maxHeight || 1e3, t.maxWidth && "number" != typeof t.maxWidth && (t.maxWidth = 1e3), t.maxHeight && "number" != typeof t.maxHeight && (t.maxHeight = 1e3), t.quality && "number" != typeof t.quality && (t.quality = .7), !t.imageType || "string" == typeof t.imageType && t.imageType.startsWith("image/") || (t.imageType = "image/jpeg") }(n), this.quill.getModule("toolbar").addHandler("image", this.selectLocalImage.bind(this)) } return d()(t, [{ key: "selectLocalImage", value: function () { var t = this; this.range = this.quill.getSelection(), this.fileHolder = document.createElement("input"), this.fileHolder.setAttribute("type", "file"), this.fileHolder.setAttribute("accept", "image/*"), this.fileHolder.setAttribute("style", "visibility:hidden"), this.fileHolder.onchange = this.fileChanged.bind(this), document.body.appendChild(this.fileHolder), this.fileHolder.click(), window.requestAnimationFrame((function () { document.body.removeChild(t.fileHolder) })) } }, { key: "fileChanged", value: function () { var t = this, e = this.fileHolder.files[0]; if (e) { var n = new FileReader; n.addEventListener("load", l()(s.a.mark((function e() { var r, o; return s.a.wrap((function (e) { for (; ;)switch (e.prev = e.next) { case 0: return r = n.result, e.next = 3, y(r, t.options.maxWidth, t.options.maxHeight, t.options.imageType, t.options.quality, t.debug); case 3: o = e.sent, t.insertToEditor(o); case 5: case "end": return e.stop() } }), e, t) }))), !1), n.readAsDataURL(e) } } }, { key: "insertToEditor", value: function (t) { var e = this.range; this.logFileSize(t), this.quill.insertEmbed(e.index, "image", "" + t), e.index++, this.quill.setSelection(e, "api") } }, { key: "logFileSize", value: function (t) { (Math.round(3 * (t.length - "data:image/png;base64,".length) / 4) / 1024).toFixed(0); this.debug } }]), t }(); function g(t, e, n, r) { if (t < n && e < r) return [t, e]; if (t > n) { var o = n, i = Math.floor(e / t * o); if (i > r) { var u = r; return [Math.floor(t / e * u), u] } return [o, i] } if (e > r) { var c = r; return [Math.floor(t / e * c), c] } } window.imageCompressor = m, e.default = m }, function (t, e, n) { t.exports = { default: n(46), __esModule: !0 } }, function (t, e, n) { n(15), n(23), t.exports = n(64) }, function (t, e, n) { "use strict"; var r = n(48), o = n(49), i = n(4), u = n(16); t.exports = n(28)(Array, "Array", (function (t, e) { this._t = u(t), this._i = 0, this._k = e }), (function () { var t = this._t, e = this._k, n = this._i++; return !t || n >= t.length ? (this._t = void 0, o(1)) : o(0, "keys" == e ? n : "values" == e ? t[n] : [n, t[n]]) }), "values"), i.Arguments = i.Array, r("keys"), r("values"), r("entries") }, function (t, e) { t.exports = function () { } }, function (t, e) { t.exports = function (t, e) { return { value: e, done: !!t } } }, function (t, e, n) { var r = n(11); t.exports = Object("z").propertyIsEnumerable(0) ? Object : function (t) { return "String" == r(t) ? t.split("") : Object(t) } }, function (t, e, n) { t.exports = !n(6) && !n(29)((function () { return 7 != Object.defineProperty(n(19)("div"), "a", { get: function () { return 7 } }).a })) }, function (t, e, n) { var r = n(9); t.exports = function (t, e) { if (!r(t)) return t; var n, o; if (e && "function" == typeof (n = t.toString) && !r(o = n.call(t))) return o; if ("function" == typeof (n = t.valueOf) && !r(o = n.call(t))) return o; if (!e && "function" == typeof (n = t.toString) && !r(o = n.call(t))) return o; throw TypeError("Can't convert object to primitive value") } }, function (t, e, n) { t.exports = n(5) }, function (t, e, n) { "use strict"; var r = n(55), o = n(30), i = n(22), u = {}; n(5)(u, n(1)("iterator"), (function () { return this })), t.exports = function (t, e, n) { t.prototype = r(u, { next: o(1, n) }), i(t, e + " Iterator") } }, function (t, e, n) { var r = n(3), o = n(56), i = n(34), u = n(21)("IE_PROTO"), c = function () { }, a = function () { var t, e = n(19)("iframe"), r = i.length; for (e.style.display = "none", n(35).appendChild(e), e.src = "javascript:", (t = e.contentWindow.document).open(), t.write("<script>document.F=Object<\/script>"), t.close(), a = t.F; r--;)delete a.prototype[i[r]]; return a() }; t.exports = Object.create || function (t, e) { var n; return null !== t ? (c.prototype = r(t), n = new c, c.prototype = null, n[u] = t) : n = a(), void 0 === e ? n : o(n, e) } }, function (t, e, n) { var r = n(8), o = n(3), i = n(57); t.exports = n(6) ? Object.defineProperties : function (t, e) { o(t); for (var n, u = i(e), c = u.length, a = 0; c > a;)r.f(t, n = u[a++], e[n]); return t } }, function (t, e, n) { var r = n(58), o = n(34); t.exports = Object.keys || function (t) { return r(t, o) } }, function (t, e, n) { var r = n(14), o = n(16), i = n(59)(!1), u = n(21)("IE_PROTO"); t.exports = function (t, e) { var n, c = o(t), a = 0, s = []; for (n in c) n != u && r(c, n) && s.push(n); for (; e.length > a;)r(c, n = e[a++]) && (~i(s, n) || s.push(n)); return s } }, function (t, e, n) { var r = n(16), o = n(31), i = n(60); t.exports = function (t) { return function (e, n, u) { var c, a = r(e), s = o(a.length), f = i(u, s); if (t && n != n) { for (; s > f;)if ((c = a[f++]) != c) return !0 } else for (; s > f; f++)if ((t || f in a) && a[f] === n) return t || f || 0; return !t && -1 } } }, function (t, e, n) { var r = n(20), o = Math.max, i = Math.min; t.exports = function (t, e) { return (t = r(t)) < 0 ? o(t + e, 0) : i(t, e) } }, function (t, e, n) { var r = n(14), o = n(62), i = n(21)("IE_PROTO"), u = Object.prototype; t.exports = Object.getPrototypeOf || function (t) { return t = o(t), r(t, i) ? t[i] : "function" == typeof t.constructor && t instanceof t.constructor ? t.constructor.prototype : t instanceof Object ? u : null } }, function (t, e, n) { var r = n(17); t.exports = function (t) { return Object(r(t)) } }, function (t, e, n) { var r = n(20), o = n(17); t.exports = function (t) { return function (e, n) { var i, u, c = String(o(e)), a = r(n), s = c.length; return a < 0 || a >= s ? t ? "" : void 0 : (i = c.charCodeAt(a)) < 55296 || i > 56319 || a + 1 === s || (u = c.charCodeAt(a + 1)) < 56320 || u > 57343 ? t ? c.charAt(a) : i : t ? c.slice(a, a + 2) : u - 56320 + (i - 55296 << 10) + 65536 } } }, function (t, e, n) { var r = n(24), o = n(1)("iterator"), i = n(4); t.exports = n(2).isIterable = function (t) { var e = Object(t); return void 0 !== e[o] || "@@iterator" in e || i.hasOwnProperty(r(e)) } }, function (t, e, n) { t.exports = { default: n(66), __esModule: !0 } }, function (t, e, n) { n(15), n(23), t.exports = n(67) }, function (t, e, n) { var r = n(3), o = n(36); t.exports = n(2).getIterator = function (t) { var e = o(t); if ("function" != typeof e) throw TypeError(t + " is not iterable!"); return r(e.call(t)) } }, function (t, e, n) { n(69), n(23), n(15), n(70), n(81), n(82), t.exports = n(2).Promise }, function (t, e) { }, function (t, e, n) { "use strict"; var r, o, i, u, c = n(18), a = n(0), s = n(12), f = n(24), l = n(7), h = n(9), p = n(13), v = n(71), d = n(72), y = n(37), m = n(38).set, g = n(76)(), x = n(25), _ = n(39), w = n(77), b = n(40), O = a.TypeError, j = a.process, L = j && j.versions, S = L && L.v8 || "", P = a.Promise, E = "process" == f(j), T = function () { }, M = o = x.f, k = !!function () { try { var t = P.resolve(1), e = (t.constructor = {})[n(1)("species")] = function (t) { t(T, T) }; return (E || "function" == typeof PromiseRejectionEvent) && t.then(T) instanceof e && 0 !== S.indexOf("6.6") && -1 === w.indexOf("Chrome/66") } catch (t) { } }(), A = function (t) { var e; return !(!h(t) || "function" != typeof (e = t.then)) && e }, F = function (t, e) { if (!t._n) { t._n = !0; var n = t._c; g((function () { for (var r = t._v, o = 1 == t._s, i = 0, u = function (e) { var n, i, u, c = o ? e.ok : e.fail, a = e.resolve, s = e.reject, f = e.domain; try { c ? (o || (2 == t._h && H(t), t._h = 1), !0 === c ? n = r : (f && f.enter(), n = c(r), f && (f.exit(), u = !0)), n === e.promise ? s(O("Promise-chain cycle")) : (i = A(n)) ? i.call(n, a, s) : a(n)) : s(r) } catch (t) { f && !u && f.exit(), s(t) } }; n.length > i;)u(n[i++]); t._c = [], t._n = !1, e && !t._h && R(t) })) } }, R = function (t) { m.call(a, (function () { var e, n, r, o = t._v, i = C(t); if (i && (e = _((function () { E ? j.emit("unhandledRejection", o, t) : (n = a.onunhandledrejection) ? n({ promise: t, reason: o }) : (r = a.console) && r.error && r.error("Unhandled promise rejection", o) })), t._h = E || C(t) ? 2 : 1), t._a = void 0, i && e.e) throw e.v })) }, C = function (t) { return 1 !== t._h && 0 === (t._a || t._c).length }, H = function (t) { m.call(a, (function () { var e; E ? j.emit("rejectionHandled", t) : (e = a.onrejectionhandled) && e({ promise: t, reason: t._v }) })) }, I = function (t) { var e = this; e._d || (e._d = !0, (e = e._w || e)._v = t, e._s = 2, e._a || (e._a = e._c.slice()), F(e, !0)) }, N = function (t) { var e, n = this; if (!n._d) { n._d = !0, n = n._w || n; try { if (n === t) throw O("Promise can't be resolved itself"); (e = A(t)) ? g((function () { var r = { _w: n, _d: !1 }; try { e.call(t, s(N, r, 1), s(I, r, 1)) } catch (t) { I.call(r, t) } })) : (n._v = t, n._s = 1, F(n, !1)) } catch (t) { I.call({ _w: n, _d: !1 }, t) } } }; k || (P = function (t) { v(this, P, "Promise", "_h"), p(t), r.call(this); try { t(s(N, this, 1), s(I, this, 1)) } catch (t) { I.call(this, t) } }, (r = function (t) { this._c = [], this._a = void 0, this._s = 0, this._d = !1, this._v = void 0, this._h = 0, this._n = !1 }).prototype = n(78)(P.prototype, { then: function (t, e) { var n = M(y(this, P)); return n.ok = "function" != typeof t || t, n.fail = "function" == typeof e && e, n.domain = E ? j.domain : void 0, this._c.push(n), this._a && this._a.push(n), this._s && F(this, !1), n.promise }, catch: function (t) { return this.then(void 0, t) } }), i = function () { var t = new r; this.promise = t, this.resolve = s(N, t, 1), this.reject = s(I, t, 1) }, x.f = M = function (t) { return t === P || t === u ? new i(t) : o(t) }), l(l.G + l.W + l.F * !k, { Promise: P }), n(22)(P, "Promise"), n(79)("Promise"), u = n(2).Promise, l(l.S + l.F * !k, "Promise", { reject: function (t) { var e = M(this); return (0, e.reject)(t), e.promise } }), l(l.S + l.F * (c || !k), "Promise", { resolve: function (t) { return b(c && this === u ? P : this, t) } }), l(l.S + l.F * !(k && n(80)((function (t) { P.all(t).catch(T) }))), "Promise", { all: function (t) { var e = this, n = M(e), r = n.resolve, o = n.reject, i = _((function () { var n = [], i = 0, u = 1; d(t, !1, (function (t) { var c = i++, a = !1; n.push(void 0), u++, e.resolve(t).then((function (t) { a || (a = !0, n[c] = t, --u || r(n)) }), o) })), --u || r(n) })); return i.e && o(i.v), n.promise }, race: function (t) { var e = this, n = M(e), r = n.reject, o = _((function () { d(t, !1, (function (t) { e.resolve(t).then(n.resolve, r) })) })); return o.e && r(o.v), n.promise } }) }, function (t, e) { t.exports = function (t, e, n, r) { if (!(t instanceof e) || void 0 !== r && r in t) throw TypeError(n + ": incorrect invocation!"); return t } }, function (t, e, n) { var r = n(12), o = n(73), i = n(74), u = n(3), c = n(31), a = n(36), s = {}, f = {}; (e = t.exports = function (t, e, n, l, h) { var p, v, d, y, m = h ? function () { return t } : a(t), g = r(n, l, e ? 2 : 1), x = 0; if ("function" != typeof m) throw TypeError(t + " is not iterable!"); if (i(m)) { for (p = c(t.length); p > x; x++)if ((y = e ? g(u(v = t[x])[0], v[1]) : g(t[x])) === s || y === f) return y } else for (d = m.call(t); !(v = d.next()).done;)if ((y = o(d, g, v.value, e)) === s || y === f) return y }).BREAK = s, e.RETURN = f }, function (t, e, n) { var r = n(3); t.exports = function (t, e, n, o) { try { return o ? e(r(n)[0], n[1]) : e(n) } catch (e) { var i = t.return; throw void 0 !== i && r(i.call(t)), e } } }, function (t, e, n) { var r = n(4), o = n(1)("iterator"), i = Array.prototype; t.exports = function (t) { return void 0 !== t && (r.Array === t || i[o] === t) } }, function (t, e) { t.exports = function (t, e, n) { var r = void 0 === n; switch (e.length) { case 0: return r ? t() : t.call(n); case 1: return r ? t(e[0]) : t.call(n, e[0]); case 2: return r ? t(e[0], e[1]) : t.call(n, e[0], e[1]); case 3: return r ? t(e[0], e[1], e[2]) : t.call(n, e[0], e[1], e[2]); case 4: return r ? t(e[0], e[1], e[2], e[3]) : t.call(n, e[0], e[1], e[2], e[3]) }return t.apply(n, e) } }, function (t, e, n) { var r = n(0), o = n(38).set, i = r.MutationObserver || r.WebKitMutationObserver, u = r.process, c = r.Promise, a = "process" == n(11)(u); t.exports = function () { var t, e, n, s = function () { var r, o; for (a && (r = u.domain) && r.exit(); t;) { o = t.fn, t = t.next; try { o() } catch (r) { throw t ? n() : e = void 0, r } } e = void 0, r && r.enter() }; if (a) n = function () { u.nextTick(s) }; else if (!i || r.navigator && r.navigator.standalone) if (c && c.resolve) { var f = c.resolve(void 0); n = function () { f.then(s) } } else n = function () { o.call(r, s) }; else { var l = !0, h = document.createTextNode(""); new i(s).observe(h, { characterData: !0 }), n = function () { h.data = l = !l } } return function (r) { var o = { fn: r, next: void 0 }; e && (e.next = o), t || (t = o, n()), e = o } } }, function (t, e, n) { var r = n(0).navigator; t.exports = r && r.userAgent || "" }, function (t, e, n) { var r = n(5); t.exports = function (t, e, n) { for (var o in e) n && t[o] ? t[o] = e[o] : r(t, o, e[o]); return t } }, function (t, e, n) { "use strict"; var r = n(0), o = n(2), i = n(8), u = n(6), c = n(1)("species"); t.exports = function (t) { var e = "function" == typeof o[t] ? o[t] : r[t]; u && e && !e[c] && i.f(e, c, { configurable: !0, get: function () { return this } }) } }, function (t, e, n) { var r = n(1)("iterator"), o = !1; try { var i = [7][r](); i.return = function () { o = !0 }, Array.from(i, (function () { throw 2 })) } catch (t) { } t.exports = function (t, e) { if (!e && !o) return !1; var n = !1; try { var i = [7], u = i[r](); u.next = function () { return { done: n = !0 } }, i[r] = function () { return u }, t(i) } catch (t) { } return n } }, function (t, e, n) { "use strict"; var r = n(7), o = n(2), i = n(0), u = n(37), c = n(40); r(r.P + r.R, "Promise", { finally: function (t) { var e = u(this, o.Promise || i.Promise), n = "function" == typeof t; return this.then(n ? function (n) { return c(e, t()).then((function () { return n })) } : t, n ? function (n) { return c(e, t()).then((function () { throw n })) } : t) } }) }, function (t, e, n) { "use strict"; var r = n(7), o = n(25), i = n(39); r(r.S, "Promise", { try: function (t) { var e = o.f(this), n = i(t); return (n.e ? e.reject : e.resolve)(n.v), e.promise } }) }, function (t, e, n) { var r = function () { return this }() || Function("return this")(), o = r.regeneratorRuntime && Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime") >= 0, i = o && r.regeneratorRuntime; if (r.regeneratorRuntime = void 0, t.exports = n(84), o) r.regeneratorRuntime = i; else try { delete r.regeneratorRuntime } catch (t) { r.regeneratorRuntime = void 0 } }, function (t, e) { !function (e) { "use strict"; var n, r = Object.prototype, o = r.hasOwnProperty, i = "function" == typeof Symbol ? Symbol : {}, u = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", a = i.toStringTag || "@@toStringTag", s = "object" == typeof t, f = e.regeneratorRuntime; if (f) s && (t.exports = f); else { (f = e.regeneratorRuntime = s ? t.exports : {}).wrap = _; var l = "suspendedStart", h = "suspendedYield", p = "executing", v = "completed", d = {}, y = {}; y[u] = function () { return this }; var m = Object.getPrototypeOf, g = m && m(m(k([]))); g && g !== r && o.call(g, u) && (y = g); var x = j.prototype = b.prototype = Object.create(y); O.prototype = x.constructor = j, j.constructor = O, j[a] = O.displayName = "GeneratorFunction", f.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === O || "GeneratorFunction" === (e.displayName || e.name)) }, f.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, j) : (t.__proto__ = j, a in t || (t[a] = "GeneratorFunction")), t.prototype = Object.create(x), t }, f.awrap = function (t) { return { __await: t } }, L(S.prototype), S.prototype[c] = function () { return this }, f.AsyncIterator = S, f.async = function (t, e, n, r) { var o = new S(_(t, e, n, r)); return f.isGeneratorFunction(e) ? o : o.next().then((function (t) { return t.done ? t.value : o.next() })) }, L(x), x[a] = "Generator", x[u] = function () { return this }, x.toString = function () { return "[object Generator]" }, f.keys = function (t) { var e = []; for (var n in t) e.push(n); return e.reverse(), function n() { for (; e.length;) { var r = e.pop(); if (r in t) return n.value = r, n.done = !1, n } return n.done = !0, n } }, f.values = k, M.prototype = { constructor: M, reset: function (t) { if (this.prev = 0, this.next = 0, this.sent = this._sent = n, this.done = !1, this.delegate = null, this.method = "next", this.arg = n, this.tryEntries.forEach(T), !t) for (var e in this) "t" === e.charAt(0) && o.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = n) }, stop: function () { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval }, dispatchException: function (t) { if (this.done) throw t; var e = this; function r(r, o) { return c.type = "throw", c.arg = t, e.next = r, o && (e.method = "next", e.arg = n), !!o } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var u = this.tryEntries[i], c = u.completion; if ("root" === u.tryLoc) return r("end"); if (u.tryLoc <= this.prev) { var a = o.call(u, "catchLoc"), s = o.call(u, "finallyLoc"); if (a && s) { if (this.prev < u.catchLoc) return r(u.catchLoc, !0); if (this.prev < u.finallyLoc) return r(u.finallyLoc) } else if (a) { if (this.prev < u.catchLoc) return r(u.catchLoc, !0) } else { if (!s) throw new Error("try statement without catch or finally"); if (this.prev < u.finallyLoc) return r(u.finallyLoc) } } } }, abrupt: function (t, e) { for (var n = this.tryEntries.length - 1; n >= 0; --n) { var r = this.tryEntries[n]; if (r.tryLoc <= this.prev && o.call(r, "finallyLoc") && this.prev < r.finallyLoc) { var i = r; break } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var u = i ? i.completion : {}; return u.type = t, u.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, d) : this.complete(u) }, complete: function (t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), d }, finish: function (t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var n = this.tryEntries[e]; if (n.finallyLoc === t) return this.complete(n.completion, n.afterLoc), T(n), d } }, catch: function (t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var n = this.tryEntries[e]; if (n.tryLoc === t) { var r = n.completion; if ("throw" === r.type) { var o = r.arg; T(n) } return o } } throw new Error("illegal catch attempt") }, delegateYield: function (t, e, r) { return this.delegate = { iterator: k(t), resultName: e, nextLoc: r }, "next" === this.method && (this.arg = n), d } } } function _(t, e, n, r) { var o = e && e.prototype instanceof b ? e : b, i = Object.create(o.prototype), u = new M(r || []); return i._invoke = function (t, e, n) { var r = l; return function (o, i) { if (r === p) throw new Error("Generator is already running"); if (r === v) { if ("throw" === o) throw i; return A() } for (n.method = o, n.arg = i; ;) { var u = n.delegate; if (u) { var c = P(u, n); if (c) { if (c === d) continue; return c } } if ("next" === n.method) n.sent = n._sent = n.arg; else if ("throw" === n.method) { if (r === l) throw r = v, n.arg; n.dispatchException(n.arg) } else "return" === n.method && n.abrupt("return", n.arg); r = p; var a = w(t, e, n); if ("normal" === a.type) { if (r = n.done ? v : h, a.arg === d) continue; return { value: a.arg, done: n.done } } "throw" === a.type && (r = v, n.method = "throw", n.arg = a.arg) } } }(t, n, u), i } function w(t, e, n) { try { return { type: "normal", arg: t.call(e, n) } } catch (t) { return { type: "throw", arg: t } } } function b() { } function O() { } function j() { } function L(t) { ["next", "throw", "return"].forEach((function (e) { t[e] = function (t) { return this._invoke(e, t) } })) } function S(t) { var e; this._invoke = function (n, r) { function i() { return new Promise((function (e, i) { !function e(n, r, i, u) { var c = w(t[n], t, r); if ("throw" !== c.type) { var a = c.arg, s = a.value; return s && "object" == typeof s && o.call(s, "__await") ? Promise.resolve(s.__await).then((function (t) { e("next", t, i, u) }), (function (t) { e("throw", t, i, u) })) : Promise.resolve(s).then((function (t) { a.value = t, i(a) }), u) } u(c.arg) }(n, r, e, i) })) } return e = e ? e.then(i, i) : i() } } function P(t, e) { var r = t.iterator[e.method]; if (r === n) { if (e.delegate = null, "throw" === e.method) { if (t.iterator.return && (e.method = "return", e.arg = n, P(t, e), "throw" === e.method)) return d; e.method = "throw", e.arg = new TypeError("The iterator does not provide a 'throw' method") } return d } var o = w(r, t.iterator, e.arg); if ("throw" === o.type) return e.method = "throw", e.arg = o.arg, e.delegate = null, d; var i = o.arg; return i ? i.done ? (e[t.resultName] = i.value, e.next = t.nextLoc, "return" !== e.method && (e.method = "next", e.arg = n), e.delegate = null, d) : i : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, d) } function E(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e) } function T(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e } function M(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(E, this), this.reset(!0) } function k(t) { if (t) { var e = t[u]; if (e) return e.call(t); if ("function" == typeof t.next) return t; if (!isNaN(t.length)) { var r = -1, i = function e() { for (; ++r < t.length;)if (o.call(t, r)) return e.value = t[r], e.done = !1, e; return e.value = n, e.done = !0, e }; return i.next = i } } return { next: A } } function A() { return { value: n, done: !0 } } }(function () { return this }() || Function("return this")()) }, function (t, e, n) { t.exports = { default: n(86), __esModule: !0 } }, function (t, e, n) { n(87); var r = n(2).Object; t.exports = function (t, e, n) { return r.defineProperty(t, e, n) } }, function (t, e, n) { var r = n(7); r(r.S + r.F * !n(6), "Object", { defineProperty: n(8).f }) }]);
-</script>
-
-
-<script inline>
- function loadAction(premium, noMenu) {
- let titleIn = document.getElementById('titlebar');
-
-
-
- //titleIn.style.width = width;
- titleIn.style['padding-left'] = 0;
- titleIn.style['padding-right'] = 0;
-
- let proToolbar = [
- [{ header: 1 }, { header: 2 }],
- [{ size: ['small', false, 'large', 'huge'] }], // custom dropdown
- ['bold', 'italic', 'image'], // toggled buttons
- [{ list: 'ordered' }, { list: 'bullet' }, { list: 'check' }],
- [{ header: [3, 4, 5, 6] }],
- [{ align: [] }],
- [{ color: [] }, { background: [] }], // dropdown with defaults from theme
- ['underline', 'strike', 'blockquote', 'code-block'],
- [{ script: 'sub' }, { script: 'super' }], // superscript/subscript
- [{ indent: '-1' }, { indent: '+1' }], // outdent/indent
- [{ direction: 'rtl' }], // text direction
- ['clean'],
- ];
- let simpleToolbar = [
- [{ header: 1 }, { header: 2 }],
- ['bold', 'italic', 'underline', 'strike'], // toggled buttons
- [{ align: [] }],
- [{ direction: 'rtl' }], // text direction
-
- ];
- let mainToolbar = premium ? proToolbar : simpleToolbar;
-
- (function () { function r(e, n, t) { function o(i, f) { if (!n[i]) { if (!e[i]) { var c = "function" == typeof require && require; if (!f && c) return c(i, !0); if (u) return u(i, !0); var a = new Error("Cannot find module '" + i + "'"); throw a.code = "MODULE_NOT_FOUND", a } var p = n[i] = { exports: {} }; e[i][0].call(p.exports, function (r) { var n = e[i][1][r]; return o(n || r) }, p, p.exports, r, e, n, t) } return n[i].exports } for (var u = "function" == typeof require && require, i = 0; i < t.length; i++)o(t[i]); return o } return r })()({
- 1: [function (require, module, exports) {
- const Quill = require('quill');
-
- const pageTheme = {
- colors: {
- accent: '#0560FF',
- shade: '#0560FF12',
- fg: '#0560FF',
- normal: 'black',
- icon: 'gray',
- errorBg: '#FFD2D2',
- errorText: '#D8000C',
- successBg: '#DFF2BF',
- successText: '#4F8A10',
- warningBg: '#FEEFB3',
- warningText: '#9F6000',
- night: false,
- bg: 'white',
- navbg: '#f6fbfc',
- nav: '#f0f0f0',
- pri: 'black',
- sec: 'white',
- factor: 1
- }
- }
- // specify the fonts you would
- var fonts = ['Noto Sans', 'sans-serif'];
- // generate code friendly names
- function getFontName(font) {
- return font.toLowerCase().replace(/\s/g, '-');
- }
- var fontNames = fonts.map(font => getFontName(font));
- // add fonts to style
- var fontStyles = '';
- fonts.forEach(function (font) {
- var fontName = getFontName(font);
- fontStyles +=
- '.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=' +
- fontName +
- ']::before, .ql-snow .ql-picker.ql-font .ql-picker-item[data-value=' +
- fontName +
- ']::before {' +
- "content: '" +
- font +
- "';" +
- "font-family: '" +
- font +
- "';" +
- '}' +
- '.ql-font-' +
- fontName +
- '{' +
- " font-family: '" +
- font +
- "';" +
- '}';
- });
- var node = document.createElement('style');
- node.innerHTML = fontStyles;
- document.body.appendChild(node);
- Quill.register("modules/imageCompressor", imageCompressor);
-
-
- const editor = new Quill('#editor', {
- modules: {
- toolbar: mainToolbar,
- imageCompressor: {
- quality: 0.9,
- maxWidth: 1024,
- imageType: 'image/jpeg'
- },
- history: {
- delay: 2000,
- maxStack: 500,
- userOnly: true
- }
- },
- placeholder: 'Start writing your note',
- theme: 'snow',
- });
-
-
-
-
- var Font = Quill.import('formats/font');
- Font.whitelist = fontNames;
- Quill.register(Font, true);
-
- editor.clipboard.addMatcher(Node.TEXT_NODE, function (node, delta) {
- var regex = /https?:\/\/[^\s]+/g;
- if (typeof node.data !== 'string') return;
-
- var matches = node.data.toLowerCase().match(regex);
-
- if (matches && matches.length > 0) {
- var ops = [];
- var str = node.data;
- matches.forEach(function (match) {
- var split = str.split(match);
- var beforeLink = split.shift();
- ops.push({ insert: beforeLink });
- ops.push({ insert: match, attributes: { link: match } });
- str = split.join(match);
- });
- ops.push({ insert: str });
- delta.ops = ops;
- }
-
- return delta;
- });
-
- function isWhitespace(ch) {
- var whiteSpace = false;
- if (ch == ' ' || ch == '\t' || ch == '\n') {
- whiteSpace = true;
- }
- return whiteSpace;
- }
- var changeInterval = null;
-
- document.getElementById('titleInput').onsubmit = onChangetitle()
-
-
- document.getElementById('titleInput').onkeydown = function (evt) {
-
- var titleMessage = {
- type: 'title',
- value: document.getElementById('titleInput').value
- }
-
- window.ReactNativeWebView.postMessage(JSON.stringify(titleMessage));
- }
-
- document.getElementById('titleInput').onkeyup = function (evt) {
-
- var titleMessage = {
- type: 'title',
- value: document.getElementById('titleInput').value
- }
-
- window.ReactNativeWebView.postMessage(JSON.stringify(titleMessage));
- }
- function onChangetitle() {
- editor.focus();
-
- var titleMessage = {
- type: 'title',
- value: document.getElementById('titleInput').value
- }
- window.ReactNativeWebView.postMessage(JSON.stringify(titleMessage));
- }
- const setTheme = function () {
-
-
- let css = document.createElement('style');
- css.type = 'text/css';
-
- let node = `
- .ql-snow.ql-toolbar button:hover,
- .ql-snow .ql-toolbar button:hover,
- .ql-snow.ql-toolbar button:focus,
- .ql-snow .ql-toolbar button:focus,
- .ql-snow.ql-toolbar button.ql-active,
- .ql-snow .ql-toolbar button.ql-active,
- .ql-snow.ql-toolbar .ql-picker-label:hover,
- .ql-snow .ql-toolbar .ql-picker-label:hover,
- .ql-snow.ql-toolbar .ql-picker-label.ql-active,
- .ql-snow .ql-toolbar .ql-picker-label.ql-active,
- .ql-snow.ql-toolbar .ql-picker-item:hover,
- .ql-snow .ql-toolbar .ql-picker-item:hover,
- .ql-snow.ql-toolbar .ql-picker-item.ql-selected,
- .ql-snow .ql-toolbar .ql-picker-item.ql-selected {
- color: ${pageTheme.colors.accent};
- }
- .ql-snow.ql-toolbar button:hover .ql-fill,
- .ql-snow .ql-toolbar button:hover .ql-fill,
- .ql-snow.ql-toolbar button:focus .ql-fill,
- .ql-snow .ql-toolbar button:focus .ql-fill,
- .ql-snow.ql-toolbar button.ql-active .ql-fill,
- .ql-snow .ql-toolbar button.ql-active .ql-fill,
- .ql-snow.ql-toolbar .ql-picker-label:hover .ql-fill,
- .ql-snow .ql-toolbar .ql-picker-label:hover .ql-fill,
- .ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-fill,
- .ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-fill,
- .ql-snow.ql-toolbar .ql-picker-item:hover .ql-fill,
- .ql-snow .ql-toolbar .ql-picker-item:hover .ql-fill,
- .ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-fill,
- .ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-fill,
- .ql-snow.ql-toolbar button:hover .ql-stroke.ql-fill,
- .ql-snow .ql-toolbar button:hover .ql-stroke.ql-fill,
- .ql-snow.ql-toolbar button:focus .ql-stroke.ql-fill,
- .ql-snow .ql-toolbar button:focus .ql-stroke.ql-fill,
- .ql-snow.ql-toolbar button.ql-active .ql-stroke.ql-fill,
- .ql-snow .ql-toolbar button.ql-active .ql-stroke.ql-fill,
- .ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,
- .ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,
- .ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,
- .ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,
- .ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,
- .ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,
- .ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill,
- .ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill {
- fill: ${pageTheme.colors.accent};
- }
- .ql-snow.ql-toolbar button:hover .ql-stroke,
- .ql-snow .ql-toolbar button:hover .ql-stroke,
- .ql-snow.ql-toolbar button:focus .ql-stroke,
- .ql-snow .ql-toolbar button:focus .ql-stroke,
- .ql-snow.ql-toolbar button.ql-active .ql-stroke,
- .ql-snow .ql-toolbar button.ql-active .ql-stroke,
- .ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke,
- .ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke,
- .ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke,
- .ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke,
- .ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke,
- .ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke,
- .ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke,
- .ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke,
- .ql-snow.ql-toolbar button:hover .ql-stroke-miter,
- .ql-snow .ql-toolbar button:hover .ql-stroke-miter,
- .ql-snow.ql-toolbar button:focus .ql-stroke-miter,
- .ql-snow .ql-toolbar button:focus .ql-stroke-miter,
- .ql-snow.ql-toolbar button.ql-active .ql-stroke-miter,
- .ql-snow .ql-toolbar button.ql-active .ql-stroke-miter,
- .ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke-miter,
- .ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke-miter,
- .ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,
- .ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,
- .ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke-miter,
- .ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke-miter,
- .ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter,
- .ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter {
- stroke: ${pageTheme.colors.accent};
- }
-
-
- .ql-editor ul[data-checked='true'] > li::before,
- .ql-editor ul[data-checked='false'] > li::before {
- color: #777;
- cursor: pointer;
- pointer-events: all;
- }
-
- @media (pointer: coarse) {
- .ql-snow.ql-toolbar button:hover:not(.ql-active),
- .ql-snow .ql-toolbar button:hover:not(.ql-active) {
- color: ${pageTheme.colors.icon};
- }
- .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-fill,
- .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-fill,
- .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill,
- .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill {
- fill: ${pageTheme.colors.icon};
- }
- .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke,
- .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke,
- .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter,
- .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter {
- stroke: ${pageTheme.colors.icon};
- }
- }
-
- .ql-snow .ql-stroke {
- fill: none;
- stroke: ${pageTheme.colors.icon};
- stroke-linecap: round;
- stroke-linejoin: round;
- stroke-width: 2;
- }
- .ql-snow .ql-stroke-miter {
- fill: none;
- stroke: ${pageTheme.colors.icon};
- stroke-miterlimit: 10;
- stroke-width: 2;
- }
- .ql-snow .ql-fill,
- .ql-snow .ql-stroke.ql-fill {
- fill: ${pageTheme.colors.icon};
- }
-
- .ql-snow .ql-editor blockquote {
- border-left: 4px solid ${pageTheme.colors.nav};
- margin-bottom: 5px;
- margin-top: 5px;
- padding-left: 16px;
- }
- .ql-snow .ql-editor code,
- .ql-snow .ql-editor pre {
- background-color: ${pageTheme.colors.nav};
- border-radius: 3px;
- color:${pageTheme.colors.icon}
- }
-
- .ql-snow .ql-editor pre.ql-syntax {
- background-color: ${pageTheme.colors.nav};
- color: 'black';
- overflow: visible;
- }
-
- .ql-snow .ql-picker {
- color: ${pageTheme.colors.icon};
- display: inline-block;
- float: left;
- font-size:${(pageTheme.colors.factor * 16)};
- font-weight: 500;
- height: 24px;
- position: relative;
- vertical-align: middle;
- }
-
- .ql-snow .ql-picker-options {
- background-color: ${pageTheme.colors.nav};
- display: none;
- min-width: inherit;
- padding: 4px 8px;
- position: fixed;
- }
-
- .ql-snow .ql-picker.ql-expanded .ql-picker-label {
- color: ${pageTheme.colors.nav};
- z-index: 2;
- }
- .ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-fill {
- fill: ${pageTheme.colors.nav};
- }
- .ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-stroke {
- stroke: ${pageTheme.colors.nav};
- }
-
- .ql-snow .ql-color-picker.ql-background .ql-picker-item {
- background-color: ${pageTheme.colors.bg};
- }
- .ql-snow .ql-color-picker.ql-color .ql-picker-item {
- background-color: ${pageTheme.colors.sec};
- }
-
- .ql-toolbar.ql-snow .ql-picker-options {
- border: 1px solid transparent;
- box-shadow: rgba(0, 0, 0, 0.2) 0 2px 8px;
- }
- .ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label {
- border-color: ${pageTheme.colors.nav};
- }
- .ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options {
- border-color: ${pageTheme.colors.nav};
- }
- .ql-toolbar.ql-snow .ql-color-picker .ql-picker-item.ql-selected,
- .ql-toolbar.ql-snow .ql-color-picker .ql-picker-item:hover {
- border-color: ${pageTheme.colors.pri};
- }
-
- .ql-snow .ql-tooltip {
- background-color: ${pageTheme.colors.bg};
- box-shadow: 0px 0px 5px #000;
- color: ${pageTheme.colors.icon};
- padding: 5px 12px;
- white-space: nowrap;
- position: absolute;
- font-size:${(pageTheme.colors.factor * 12)};
- }
-
- .ql-snow .ql-tooltip a.ql-action::after {
- border-right: 1px solid ${pageTheme.colors.nav};
- content: 'Edit';
- margin-left: 16px;
- padding-right: 8px;
- }
- .ql-snow a {
- color: ${pageTheme.colors.accent};
- }
- .ql-container.ql-snow {
- border: 1px solid ${pageTheme.colors.nav};
- background-color:transparent;
- }
- .ql-snow.ql-toolbar button,
- .ql-snow .ql-toolbar button {
-
- height: ${(pageTheme.colors.factor * 32)};
- width: ${(pageTheme.colors.factor * 36)};
- }
-
-
- .ql-toolbar {
- background-color:transparent;
- border-top: 1px solid ${pageTheme.colors.nav};
- overflow-x: auto;
- width: 100vw;
- white-space: nowrap;
- position: absolute;
- zIndex:999;
- bottom: 0px;
- height: 50px;
- left: 0px;
- border-top: 1px solid ${pageTheme.colors.nav};
- }
-
- .ql-editor.ql-blank::before {
- color: ${pageTheme.colors.icon}
- }
-
- #titleInput {
- color:${pageTheme.colors.pri};
- font-size:${27 * pageTheme.colors.factor};
-
- }
- #titleInput::-webkit-input-placeholder {
- color:${pageTheme.colors.icon}
- }
-
- .ql-picker-options {
- background-color: ${pageTheme.colors.nav};
- border-color:${pageTheme.colors.nav};
- }
- .ql-container {
- font-size:${(pageTheme.colors.factor * 18)};
- color:${pageTheme.colors.pri};
- }
-
- .info-bar {
- color:${pageTheme.colors.icon};
- }
-
- svg {
- fill: ${pageTheme.colors.pri} !important;
- }
-
- `
- css.appendChild(document.createTextNode(node));
- document.getElementsByTagName("head")[0].appendChild(css);
- }
-
- setTheme();
-
- editor.once('text-change', function () {
-
- window.ReactNativeWebView.postMessage("loaded");
- let text = editor.getText();
- document.getElementById("infowords").innerText = text.split(' ').length + ' words';
-
-
- });
-
- window.addEventListener("focus", () => {
- //editor.setSelection(editor.getText().length - 1, 0);
- })
-
- // Receber mensagens do RN
- window.addEventListener('message', data => {
-
- /*
- the data object
- params:action,type,data;
- first we parse the data object;
- */
- let message = JSON.parse(data.data);
- let type = message.type;
- let value;
- if (message.value && message.type !== 'nomenu') {
- value = message.value;
- } else {
- value = message.value
- }
- switch (type) {
- case "reset": {
- editor.history.clear();
- editor.setText('', 'api');
- document.getElementById('titleInput').value = '';
- document.getElementById('titleInput').blur();
- editor.blur();
- window.blur();
- document.getElementById('infodate').innerText = "";
- document.getElementById('infosaved').innerText = "";
- document.getElementById("infowords").innerText = "";
- break
- }
- case "blur":
- document.getElementById('titleInput').blur();
- editor.blur();
- window.blur();
- break;
- case "undo":
- editor.history.undo();
- break;
- case "redo":
- editor.history.redo();
- break;
- case "clearHistory":
- editor.history.clear();
- break;
- case "dateEdited":
- document.getElementById('infodate').innerText = value;
- break;
- case "saving":
- document.getElementById('infosaved').innerText = value;
- break;
- case "text":
- editor.setText(value, 'api')
- setTimeout(() => {
- if (message.focus === "editor") {
- //editor.focus();
- } else {
- //document.getElementById('titleInput').focus();
- }
- }, 0)
- break;
- case "clearEditor":
- editor.setText('', 'api');
- break;
- case "clearTitle":
- document.getElementById('titleInput').value = '';
- break;
- case "focusEditor":
- editor.focus();
- break;
- case "focusTitle":
- document.getElementById('titleInput').focus();
- break;
- case "nomenu":
- let isenabled = value;
- let titleIn = document.getElementById('titlebar');
- if (isenabled) {
-
- titleIn.style['padding-left'] = 12;
- titleIn.style['padding-right'] = 60;
- } else {
-
- titleIn.style['padding-left'] = 60;
- titleIn.style['padding-right'] = 60;
- }
- break;
- case "title":
- document.getElementById('titleInput').value = JSON.parse(data.data).value
- break;
- case "theme":
- pageTheme.colors = value;
- setTheme();
- break;
-
- case "delta":
-
- const content = value
- editor.setContents(content, 'api');
- setTimeout(() => {
- //editor.setSelection(editor.getText().length - 1, 0);
- }, 500)
-
- break;
- case "html":
- editor.setContents(
- editor.clipboard.convert(value, 'api'),
- 'silent'
- );
- setTimeout(() => {
- //editor.setSelection(editor.getText().length - 1, 0);
- }, 0);
- break;
- default:
- break;
- }
-
- });
-
-
-
-
-
-
-
- // Toda vez que é editado, manda os conteúdos para o RN
- editor.on('text-change', function (delta, oldDelta, source) {
- var regex = /https?:\/\/[^\s]+$/;
- if (source === "api") return;
- if (
- delta.ops.length === 2 &&
- delta.ops[0].retain &&
- isWhitespace(delta.ops[1].insert)
- ) {
- var endRetain = delta.ops[0].retain;
- var text = editor.getText().substr(0, endRetain);
- var match = text.toLowerCase().match(regex);
-
- if (match !== null) {
- var url = match[0];
-
- var ops = [];
- if (endRetain > url.length) {
- ops.push({ retain: endRetain - url.length });
- }
-
- ops = ops.concat([
- { delete: url.length },
- { insert: url, attributes: { link: url } },
- ]);
-
- editor.updateContents({
- ops: ops,
- });
- }
- }
-
-
- let m = {};
- m.delta = { ops: editor.getContents().ops }
-
- m.text = editor.getText();
- document.getElementById("infowords").innerText = m.text.split(' ').length + ' words';
- m.html = editor.root.innerHTML;
- m.type = 'content';
-
- window.ReactNativeWebView.postMessage(JSON.stringify(m));
- });
-
-
-
-
- document.querySelectorAll('.ql-picker').forEach(e => {
- e.addEventListener('mousedown', function (e) {
- e.preventDefault();
-
- })
- })
-
- document.querySelectorAll('.ql-picker-label').forEach(e => {
- e.addEventListener('click', function (evt) {
-
- let top;
- let left;
- let menu;
- let evtItemWidth;
- let evtItemHeight;
-
- if (!evt.target.offsetParent) {
-
- let _myLocalElement = evt.path.filter(o => o.className == "ql-picker-label");
-
- var rect = _myLocalElement[0].getBoundingClientRect();
- evtItemWidth = _myLocalElement[0].offsetParent.offsetWidth;
- evtItemHeight = _myLocalElement[0].offsetParent.offsetHeight;
-
- top = rect.top;
- left = rect.left;
-
- menu = _myLocalElement[0].attributes.getNamedItem('aria-controls').value;
- } else {
- //left = evt.target.offsetParent.offsetLeft;
- evtItemWidth = evt.target.offsetParent.offsetWidth;
- evtItemHeight = evt.target.offsetParent.offsetHeight;
-
-
-
-
- var rect = evt.target.offsetParent.getBoundingClientRect();
- top = rect.top;
- left = rect.left;
- menu = evt.target.attributes.getNamedItem('aria-controls').value;
- }
-
-
- let menuHeight = document.getElementById(menu).offsetHeight;
- let menuWidth = document.getElementById(menu).offsetWidth;
- let wDiff;
- if (menuWidth < evtItemWidth) {
- wDiff = evtItemWidth - menuWidth;
- left = left + (wDiff / 2);
- } else {
- wDiff = menuWidth - evtItemWidth;
- left = left - (wDiff / 2);
- }
-
- dropDownFixPosition(
- '.ql-picker-label',
- menu,
- top,
- left,
- menuHeight,
- menuWidth
- )
-
- })
- })
-
-
- function dropDownFixPosition(button, dropdown, top, left, height, width) {
-
- let b = document.querySelector(button);
-
- var dropDownTop = top - (b.offsetHeight / 2) - height;
-
- let screenWidth = window.outerWidth;
-
- if (left + width > screenWidth) {
- left = left - (left + width - screenWidth);
- left -= 10;
-
- }
- document.getElementById(dropdown).style.top = dropDownTop;
- document.getElementById(dropdown).style.left = left;
-
- //dropdown.css('top', dropDownTop + 'px');
- //dropdown.css('left', left + 'px');
-
- window.addEventListener('resize', function () {
-
-
- let currentTop = document.querySelector('#toolbar').offsetTop;
-
- let downTop =
- currentTop - b.offsetHeight - height;
-
-
- document.getElementById(dropdown).style.top = downTop + 20;
- document.getElementById(dropdown).style.left = left;
-
-
- })
- }
-
- }, { "quill": 2 }], 2: [function (require, module, exports) {
- (function (Buffer) {
-
- /*!
- * Quill Editor v1.3.7
- * https://quilljs.com/
- * Copyright (c) 2014, Jason Chen
- * Copyright (c) 2013, salesforce.com
- */
- (function webpackUniversalModuleDefinition(root, factory) {
- if (typeof exports === 'object' && typeof module === 'object')
- module.exports = factory();
- else if (typeof define === 'function' && define.amd)
- define([], factory);
- else if (typeof exports === 'object')
- exports["Quill"] = factory();
- else
- root["Quill"] = factory();
- })(typeof self !== 'undefined' ? self : this, function () {
- return /******/ (function (modules) { // webpackBootstrap
-/******/ // The module cache
-/******/ var installedModules = {};
-/******/
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-/******/
-/******/ // Check if module is in cache
-/******/ if (installedModules[moduleId]) {
-/******/ return installedModules[moduleId].exports;
- /******/
- }
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = installedModules[moduleId] = {
-/******/ i: moduleId,
-/******/ l: false,
-/******/ exports: {}
- /******/
- };
-/******/
-/******/ // Execute the module function
-/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
-/******/
-/******/ // Flag the module as loaded
-/******/ module.l = true;
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
- /******/
- }
-/******/
-/******/
-/******/ // expose the modules object (__webpack_modules__)
-/******/ __webpack_require__.m = modules;
-/******/
-/******/ // expose the module cache
-/******/ __webpack_require__.c = installedModules;
-/******/
-/******/ // define getter function for harmony exports
-/******/ __webpack_require__.d = function (exports, name, getter) {
-/******/ if (!__webpack_require__.o(exports, name)) {
-/******/ Object.defineProperty(exports, name, {
-/******/ configurable: false,
-/******/ enumerable: true,
-/******/ get: getter
- /******/
- });
- /******/
- }
- /******/
- };
-/******/
-/******/ // getDefaultExport function for compatibility with non-harmony modules
-/******/ __webpack_require__.n = function (module) {
-/******/ var getter = module && module.__esModule ?
-/******/ function getDefault() { return module['default']; } :
-/******/ function getModuleExports() { return module; };
-/******/ __webpack_require__.d(getter, 'a', getter);
-/******/ return getter;
- /******/
- };
-/******/
-/******/ // Object.prototype.hasOwnProperty.call
-/******/ __webpack_require__.o = function (object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
-/******/
-/******/ // __webpack_public_path__
-/******/ __webpack_require__.p = "";
-/******/
-/******/ // Load entry module and return exports
-/******/ return __webpack_require__(__webpack_require__.s = 133);
- /******/
- })
-/************************************************************************/
-/******/([
-/* 0 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- Object.defineProperty(exports, "__esModule", { value: true });
- var container_1 = __webpack_require__(17);
- var format_1 = __webpack_require__(18);
- var leaf_1 = __webpack_require__(19);
- var scroll_1 = __webpack_require__(51);
- var inline_1 = __webpack_require__(52);
- var block_1 = __webpack_require__(53);
- var embed_1 = __webpack_require__(54);
- var text_1 = __webpack_require__(55);
- var attributor_1 = __webpack_require__(12);
- var class_1 = __webpack_require__(34);
- var style_1 = __webpack_require__(35);
- var store_1 = __webpack_require__(33);
- var Registry = __webpack_require__(2);
- var Parchment = {
- Scope: Registry.Scope,
- create: Registry.create,
- find: Registry.find,
- query: Registry.query,
- register: Registry.register,
- Container: container_1.default,
- Format: format_1.default,
- Leaf: leaf_1.default,
- Embed: embed_1.default,
- Scroll: scroll_1.default,
- Block: block_1.default,
- Inline: inline_1.default,
- Text: text_1.default,
- Attributor: {
- Attribute: attributor_1.default,
- Class: class_1.default,
- Style: style_1.default,
- Store: store_1.default,
- },
- };
- exports.default = Parchment;
-
-
- /***/
- }),
-/* 1 */
-/***/ (function (module, exports, __webpack_require__) {
-
- var diff = __webpack_require__(57);
- var equal = __webpack_require__(11);
- var extend = __webpack_require__(3);
- var op = __webpack_require__(22);
-
-
- var NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff()
-
-
- var Delta = function (ops) {
- // Assume we are given a well formed ops
- if (Array.isArray(ops)) {
- this.ops = ops;
- } else if (ops != null && Array.isArray(ops.ops)) {
- this.ops = ops.ops;
- } else {
- this.ops = [];
- }
- };
-
-
- Delta.prototype.insert = function (text, attributes) {
- var newOp = {};
- if (text.length === 0) return this;
- newOp.insert = text;
- if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {
- newOp.attributes = attributes;
- }
- return this.push(newOp);
- };
-
- Delta.prototype['delete'] = function (length) {
- if (length <= 0) return this;
- return this.push({ 'delete': length });
- };
-
- Delta.prototype.retain = function (length, attributes) {
- if (length <= 0) return this;
- var newOp = { retain: length };
- if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {
- newOp.attributes = attributes;
- }
- return this.push(newOp);
- };
-
- Delta.prototype.push = function (newOp) {
- var index = this.ops.length;
- var lastOp = this.ops[index - 1];
- newOp = extend(true, {}, newOp);
- if (typeof lastOp === 'object') {
- if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') {
- this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] };
- return this;
- }
- // Since it does not matter if we insert before or after deleting at the same index,
- // always prefer to insert first
- if (typeof lastOp['delete'] === 'number' && newOp.insert != null) {
- index -= 1;
- lastOp = this.ops[index - 1];
- if (typeof lastOp !== 'object') {
- this.ops.unshift(newOp);
- return this;
- }
- }
- if (equal(newOp.attributes, lastOp.attributes)) {
- if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') {
- this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };
- if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes
- return this;
- } else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') {
- this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };
- if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes
- return this;
- }
- }
- }
- if (index === this.ops.length) {
- this.ops.push(newOp);
- } else {
- this.ops.splice(index, 0, newOp);
- }
- return this;
- };
-
- Delta.prototype.chop = function () {
- var lastOp = this.ops[this.ops.length - 1];
- if (lastOp && lastOp.retain && !lastOp.attributes) {
- this.ops.pop();
- }
- return this;
- };
-
- Delta.prototype.filter = function (predicate) {
- return this.ops.filter(predicate);
- };
-
- Delta.prototype.forEach = function (predicate) {
- this.ops.forEach(predicate);
- };
-
- Delta.prototype.map = function (predicate) {
- return this.ops.map(predicate);
- };
-
- Delta.prototype.partition = function (predicate) {
- var passed = [], failed = [];
- this.forEach(function (op) {
- var target = predicate(op) ? passed : failed;
- target.push(op);
- });
- return [passed, failed];
- };
-
- Delta.prototype.reduce = function (predicate, initial) {
- return this.ops.reduce(predicate, initial);
- };
-
- Delta.prototype.changeLength = function () {
- return this.reduce(function (length, elem) {
- if (elem.insert) {
- return length + op.length(elem);
- } else if (elem.delete) {
- return length - elem.delete;
- }
- return length;
- }, 0);
- };
-
- Delta.prototype.length = function () {
- return this.reduce(function (length, elem) {
- return length + op.length(elem);
- }, 0);
- };
-
- Delta.prototype.slice = function (start, end) {
- start = start || 0;
- if (typeof end !== 'number') end = Infinity;
- var ops = [];
- var iter = op.iterator(this.ops);
- var index = 0;
- while (index < end && iter.hasNext()) {
- var nextOp;
- if (index < start) {
- nextOp = iter.next(start - index);
- } else {
- nextOp = iter.next(end - index);
- ops.push(nextOp);
- }
- index += op.length(nextOp);
- }
- return new Delta(ops);
- };
-
-
- Delta.prototype.compose = function (other) {
- var thisIter = op.iterator(this.ops);
- var otherIter = op.iterator(other.ops);
- var ops = [];
- var firstOther = otherIter.peek();
- if (firstOther != null && typeof firstOther.retain === 'number' && firstOther.attributes == null) {
- var firstLeft = firstOther.retain;
- while (thisIter.peekType() === 'insert' && thisIter.peekLength() <= firstLeft) {
- firstLeft -= thisIter.peekLength();
- ops.push(thisIter.next());
- }
- if (firstOther.retain - firstLeft > 0) {
- otherIter.next(firstOther.retain - firstLeft);
- }
- }
- var delta = new Delta(ops);
- while (thisIter.hasNext() || otherIter.hasNext()) {
- if (otherIter.peekType() === 'insert') {
- delta.push(otherIter.next());
- } else if (thisIter.peekType() === 'delete') {
- delta.push(thisIter.next());
- } else {
- var length = Math.min(thisIter.peekLength(), otherIter.peekLength());
- var thisOp = thisIter.next(length);
- var otherOp = otherIter.next(length);
- if (typeof otherOp.retain === 'number') {
- var newOp = {};
- if (typeof thisOp.retain === 'number') {
- newOp.retain = length;
- } else {
- newOp.insert = thisOp.insert;
- }
- // Preserve null when composing with a retain, otherwise remove it for inserts
- var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number');
- if (attributes) newOp.attributes = attributes;
- delta.push(newOp);
-
- // Optimization if rest of other is just retain
- if (!otherIter.hasNext() && equal(delta.ops[delta.ops.length - 1], newOp)) {
- var rest = new Delta(thisIter.rest());
- return delta.concat(rest).chop();
- }
-
- // Other op should be delete, we could be an insert or retain
- // Insert + delete cancels out
- } else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') {
- delta.push(otherOp);
- }
- }
- }
- return delta.chop();
- };
-
- Delta.prototype.concat = function (other) {
- var delta = new Delta(this.ops.slice());
- if (other.ops.length > 0) {
- delta.push(other.ops[0]);
- delta.ops = delta.ops.concat(other.ops.slice(1));
- }
- return delta;
- };
-
- Delta.prototype.diff = function (other, index) {
- if (this.ops === other.ops) {
- return new Delta();
- }
- var strings = [this, other].map(function (delta) {
- return delta.map(function (op) {
- if (op.insert != null) {
- return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER;
- }
- var prep = (delta === other) ? 'on' : 'with';
- throw new Error('diff() called ' + prep + ' non-document');
- }).join('');
- });
- var delta = new Delta();
- var diffResult = diff(strings[0], strings[1], index);
- var thisIter = op.iterator(this.ops);
- var otherIter = op.iterator(other.ops);
- diffResult.forEach(function (component) {
- var length = component[1].length;
- while (length > 0) {
- var opLength = 0;
- switch (component[0]) {
- case diff.INSERT:
- opLength = Math.min(otherIter.peekLength(), length);
- delta.push(otherIter.next(opLength));
- break;
- case diff.DELETE:
- opLength = Math.min(length, thisIter.peekLength());
- thisIter.next(opLength);
- delta['delete'](opLength);
- break;
- case diff.EQUAL:
- opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length);
- var thisOp = thisIter.next(opLength);
- var otherOp = otherIter.next(opLength);
- if (equal(thisOp.insert, otherOp.insert)) {
- delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes));
- } else {
- delta.push(otherOp)['delete'](opLength);
- }
- break;
- }
- length -= opLength;
- }
- });
- return delta.chop();
- };
-
- Delta.prototype.eachLine = function (predicate, newline) {
- newline = newline || '\n';
- var iter = op.iterator(this.ops);
- var line = new Delta();
- var i = 0;
- while (iter.hasNext()) {
- if (iter.peekType() !== 'insert') return;
- var thisOp = iter.peek();
- var start = op.length(thisOp) - iter.peekLength();
- var index = typeof thisOp.insert === 'string' ?
- thisOp.insert.indexOf(newline, start) - start : -1;
- if (index < 0) {
- line.push(iter.next());
- } else if (index > 0) {
- line.push(iter.next(index));
- } else {
- if (predicate(line, iter.next(1).attributes || {}, i) === false) {
- return;
- }
- i += 1;
- line = new Delta();
- }
- }
- if (line.length() > 0) {
- predicate(line, {}, i);
- }
- };
-
- Delta.prototype.transform = function (other, priority) {
- priority = !!priority;
- if (typeof other === 'number') {
- return this.transformPosition(other, priority);
- }
- var thisIter = op.iterator(this.ops);
- var otherIter = op.iterator(other.ops);
- var delta = new Delta();
- while (thisIter.hasNext() || otherIter.hasNext()) {
- if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) {
- delta.retain(op.length(thisIter.next()));
- } else if (otherIter.peekType() === 'insert') {
- delta.push(otherIter.next());
- } else {
- var length = Math.min(thisIter.peekLength(), otherIter.peekLength());
- var thisOp = thisIter.next(length);
- var otherOp = otherIter.next(length);
- if (thisOp['delete']) {
- // Our delete either makes their delete redundant or removes their retain
- continue;
- } else if (otherOp['delete']) {
- delta.push(otherOp);
- } else {
- // We retain either their retain or insert
- delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority));
- }
- }
- }
- return delta.chop();
- };
-
- Delta.prototype.transformPosition = function (index, priority) {
- priority = !!priority;
- var thisIter = op.iterator(this.ops);
- var offset = 0;
- while (thisIter.hasNext() && offset <= index) {
- var length = thisIter.peekLength();
- var nextType = thisIter.peekType();
- thisIter.next();
- if (nextType === 'delete') {
- index -= Math.min(length, index - offset);
- continue;
- } else if (nextType === 'insert' && (offset < index || !priority)) {
- index += length;
- }
- offset += length;
- }
- return index;
- };
-
-
- module.exports = Delta;
-
-
- /***/
- }),
-/* 2 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var ParchmentError = /** @class */ (function (_super) {
- __extends(ParchmentError, _super);
- function ParchmentError(message) {
- var _this = this;
- message = '[Parchment] ' + message;
- _this = _super.call(this, message) || this;
- _this.message = message;
- _this.name = _this.constructor.name;
- return _this;
- }
- return ParchmentError;
- }(Error));
- exports.ParchmentError = ParchmentError;
- var attributes = {};
- var classes = {};
- var tags = {};
- var types = {};
- exports.DATA_KEY = '__blot';
- var Scope;
- (function (Scope) {
- Scope[Scope["TYPE"] = 3] = "TYPE";
- Scope[Scope["LEVEL"] = 12] = "LEVEL";
- Scope[Scope["ATTRIBUTE"] = 13] = "ATTRIBUTE";
- Scope[Scope["BLOT"] = 14] = "BLOT";
- Scope[Scope["INLINE"] = 7] = "INLINE";
- Scope[Scope["BLOCK"] = 11] = "BLOCK";
- Scope[Scope["BLOCK_BLOT"] = 10] = "BLOCK_BLOT";
- Scope[Scope["INLINE_BLOT"] = 6] = "INLINE_BLOT";
- Scope[Scope["BLOCK_ATTRIBUTE"] = 9] = "BLOCK_ATTRIBUTE";
- Scope[Scope["INLINE_ATTRIBUTE"] = 5] = "INLINE_ATTRIBUTE";
- Scope[Scope["ANY"] = 15] = "ANY";
- })(Scope = exports.Scope || (exports.Scope = {}));
- function create(input, value) {
- var match = query(input);
- if (match == null) {
- throw new ParchmentError("Unable to create " + input + " blot");
- }
- var BlotClass = match;
- var node =
- // @ts-ignore
- input instanceof Node || input['nodeType'] === Node.TEXT_NODE ? input : BlotClass.create(value);
- return new BlotClass(node, value);
- }
- exports.create = create;
- function find(node, bubble) {
- if (bubble === void 0) { bubble = false; }
- if (node == null)
- return null;
- // @ts-ignore
- if (node[exports.DATA_KEY] != null)
- return node[exports.DATA_KEY].blot;
- if (bubble)
- return find(node.parentNode, bubble);
- return null;
- }
- exports.find = find;
- function query(query, scope) {
- if (scope === void 0) { scope = Scope.ANY; }
- var match;
- if (typeof query === 'string') {
- match = types[query] || attributes[query];
- // @ts-ignore
- }
- else if (query instanceof Text || query['nodeType'] === Node.TEXT_NODE) {
- match = types['text'];
- }
- else if (typeof query === 'number') {
- if (query & Scope.LEVEL & Scope.BLOCK) {
- match = types['block'];
- }
- else if (query & Scope.LEVEL & Scope.INLINE) {
- match = types['inline'];
- }
- }
- else if (query instanceof HTMLElement) {
- var names = (query.getAttribute('class') || '').split(/\s+/);
- for (var i in names) {
- match = classes[names[i]];
- if (match)
- break;
- }
- match = match || tags[query.tagName];
- }
- if (match == null)
- return null;
- // @ts-ignore
- if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope)
- return match;
- return null;
- }
- exports.query = query;
- function register() {
- var Definitions = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- Definitions[_i] = arguments[_i];
- }
- if (Definitions.length > 1) {
- return Definitions.map(function (d) {
- return register(d);
- });
- }
- var Definition = Definitions[0];
- if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') {
- throw new ParchmentError('Invalid definition');
- }
- else if (Definition.blotName === 'abstract') {
- throw new ParchmentError('Cannot register abstract class');
- }
- types[Definition.blotName || Definition.attrName] = Definition;
- if (typeof Definition.keyName === 'string') {
- attributes[Definition.keyName] = Definition;
- }
- else {
- if (Definition.className != null) {
- classes[Definition.className] = Definition;
- }
- if (Definition.tagName != null) {
- if (Array.isArray(Definition.tagName)) {
- Definition.tagName = Definition.tagName.map(function (tagName) {
- return tagName.toUpperCase();
- });
- }
- else {
- Definition.tagName = Definition.tagName.toUpperCase();
- }
- var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName];
- tagNames.forEach(function (tag) {
- if (tags[tag] == null || Definition.className == null) {
- tags[tag] = Definition;
- }
- });
- }
- }
- return Definition;
- }
- exports.register = register;
-
-
- /***/
- }),
-/* 3 */
-/***/ (function (module, exports) {
-
- 'use strict';
-
- var hasOwn = Object.prototype.hasOwnProperty;
- var toStr = Object.prototype.toString;
- var defineProperty = Object.defineProperty;
- var gOPD = Object.getOwnPropertyDescriptor;
-
- var isArray = function isArray(arr) {
- if (typeof Array.isArray === 'function') {
- return Array.isArray(arr);
- }
-
- return toStr.call(arr) === '[object Array]';
- };
-
- var isPlainObject = function isPlainObject(obj) {
- if (!obj || toStr.call(obj) !== '[object Object]') {
- return false;
- }
-
- var hasOwnConstructor = hasOwn.call(obj, 'constructor');
- var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');
- // Not own constructor property must be Object
- if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
- return false;
- }
-
- // Own properties are enumerated firstly, so to speed up,
- // if last one is own, then all properties are own.
- var key;
- for (key in obj) { /**/ }
-
- return typeof key === 'undefined' || hasOwn.call(obj, key);
- };
-
- // If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target
- var setProperty = function setProperty(target, options) {
- if (defineProperty && options.name === '__proto__') {
- defineProperty(target, options.name, {
- enumerable: true,
- configurable: true,
- value: options.newValue,
- writable: true
- });
- } else {
- target[options.name] = options.newValue;
- }
- };
-
- // Return undefined instead of __proto__ if '__proto__' is not an own property
- var getProperty = function getProperty(obj, name) {
- if (name === '__proto__') {
- if (!hasOwn.call(obj, name)) {
- return void 0;
- } else if (gOPD) {
- // In early versions of node, obj['__proto__'] is buggy when obj has
- // __proto__ as an own property. Object.getOwnPropertyDescriptor() works.
- return gOPD(obj, name).value;
- }
- }
-
- return obj[name];
- };
-
- module.exports = function extend() {
- var options, name, src, copy, copyIsArray, clone;
- var target = arguments[0];
- var i = 1;
- var length = arguments.length;
- var deep = false;
-
- // Handle a deep copy situation
- if (typeof target === 'boolean') {
- deep = target;
- target = arguments[1] || {};
- // skip the boolean and the target
- i = 2;
- }
- if (target == null || (typeof target !== 'object' && typeof target !== 'function')) {
- target = {};
- }
-
- for (; i < length; ++i) {
- options = arguments[i];
- // Only deal with non-null/undefined values
- if (options != null) {
- // Extend the base object
- for (name in options) {
- src = getProperty(target, name);
- copy = getProperty(options, name);
-
- // Prevent never-ending loop
- if (target !== copy) {
- // Recurse if we're merging plain objects or arrays
- if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {
- if (copyIsArray) {
- copyIsArray = false;
- clone = src && isArray(src) ? src : [];
- } else {
- clone = src && isPlainObject(src) ? src : {};
- }
-
- // Never move original objects, clone them
- setProperty(target, { name: name, newValue: extend(deep, clone, copy) });
-
- // Don't bring in undefined values
- } else if (typeof copy !== 'undefined') {
- setProperty(target, { name: name, newValue: copy });
- }
- }
- }
- }
- }
-
- // Return the modified object
- return target;
- };
-
-
- /***/
- }),
-/* 4 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = exports.BlockEmbed = exports.bubbleFormats = undefined;
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _extend = __webpack_require__(3);
-
- var _extend2 = _interopRequireDefault(_extend);
-
- var _quillDelta = __webpack_require__(1);
-
- var _quillDelta2 = _interopRequireDefault(_quillDelta);
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _break = __webpack_require__(16);
-
- var _break2 = _interopRequireDefault(_break);
-
- var _inline = __webpack_require__(6);
-
- var _inline2 = _interopRequireDefault(_inline);
-
- var _text = __webpack_require__(7);
-
- var _text2 = _interopRequireDefault(_text);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var NEWLINE_LENGTH = 1;
-
- var BlockEmbed = function (_Parchment$Embed) {
- _inherits(BlockEmbed, _Parchment$Embed);
-
- function BlockEmbed() {
- _classCallCheck(this, BlockEmbed);
-
- return _possibleConstructorReturn(this, (BlockEmbed.__proto__ || Object.getPrototypeOf(BlockEmbed)).apply(this, arguments));
- }
-
- _createClass(BlockEmbed, [{
- key: 'attach',
- value: function attach() {
- _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'attach', this).call(this);
- this.attributes = new _parchment2.default.Attributor.Store(this.domNode);
- }
- }, {
- key: 'delta',
- value: function delta() {
- return new _quillDelta2.default().insert(this.value(), (0, _extend2.default)(this.formats(), this.attributes.values()));
- }
- }, {
- key: 'format',
- value: function format(name, value) {
- var attribute = _parchment2.default.query(name, _parchment2.default.Scope.BLOCK_ATTRIBUTE);
- if (attribute != null) {
- this.attributes.attribute(attribute, value);
- }
- }
- }, {
- key: 'formatAt',
- value: function formatAt(index, length, name, value) {
- this.format(name, value);
- }
- }, {
- key: 'insertAt',
- value: function insertAt(index, value, def) {
- if (typeof value === 'string' && value.endsWith('\n')) {
- var block = _parchment2.default.create(Block.blotName);
- this.parent.insertBefore(block, index === 0 ? this : this.next);
- block.insertAt(0, value.slice(0, -1));
- } else {
- _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'insertAt', this).call(this, index, value, def);
- }
- }
- }]);
-
- return BlockEmbed;
- }(_parchment2.default.Embed);
-
- BlockEmbed.scope = _parchment2.default.Scope.BLOCK_BLOT;
- // It is important for cursor behavior BlockEmbeds use tags that are block level elements
-
-
- var Block = function (_Parchment$Block) {
- _inherits(Block, _Parchment$Block);
-
- function Block(domNode) {
- _classCallCheck(this, Block);
-
- var _this2 = _possibleConstructorReturn(this, (Block.__proto__ || Object.getPrototypeOf(Block)).call(this, domNode));
-
- _this2.cache = {};
- return _this2;
- }
-
- _createClass(Block, [{
- key: 'delta',
- value: function delta() {
- if (this.cache.delta == null) {
- this.cache.delta = this.descendants(_parchment2.default.Leaf).reduce(function (delta, leaf) {
- if (leaf.length() === 0) {
- return delta;
- } else {
- return delta.insert(leaf.value(), bubbleFormats(leaf));
- }
- }, new _quillDelta2.default()).insert('\n', bubbleFormats(this));
- }
- return this.cache.delta;
- }
- }, {
- key: 'deleteAt',
- value: function deleteAt(index, length) {
- _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'deleteAt', this).call(this, index, length);
- this.cache = {};
- }
- }, {
- key: 'formatAt',
- value: function formatAt(index, length, name, value) {
- if (length <= 0) return;
- if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) {
- if (index + length === this.length()) {
- this.format(name, value);
- }
- } else {
- _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'formatAt', this).call(this, index, Math.min(length, this.length() - index - 1), name, value);
- }
- this.cache = {};
- }
- }, {
- key: 'insertAt',
- value: function insertAt(index, value, def) {
- if (def != null) return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, index, value, def);
- if (value.length === 0) return;
- var lines = value.split('\n');
- var text = lines.shift();
- if (text.length > 0) {
- if (index < this.length() - 1 || this.children.tail == null) {
- _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, Math.min(index, this.length() - 1), text);
- } else {
- this.children.tail.insertAt(this.children.tail.length(), text);
- }
- this.cache = {};
- }
- var block = this;
- lines.reduce(function (index, line) {
- block = block.split(index, true);
- block.insertAt(0, line);
- return line.length;
- }, index + text.length);
- }
- }, {
- key: 'insertBefore',
- value: function insertBefore(blot, ref) {
- var head = this.children.head;
- _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertBefore', this).call(this, blot, ref);
- if (head instanceof _break2.default) {
- head.remove();
- }
- this.cache = {};
- }
- }, {
- key: 'length',
- value: function length() {
- if (this.cache.length == null) {
- this.cache.length = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'length', this).call(this) + NEWLINE_LENGTH;
- }
- return this.cache.length;
- }
- }, {
- key: 'moveChildren',
- value: function moveChildren(target, ref) {
- _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'moveChildren', this).call(this, target, ref);
- this.cache = {};
- }
- }, {
- key: 'optimize',
- value: function optimize(context) {
- _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'optimize', this).call(this, context);
- this.cache = {};
- }
- }, {
- key: 'path',
- value: function path(index) {
- return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'path', this).call(this, index, true);
- }
- }, {
- key: 'removeChild',
- value: function removeChild(child) {
- _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'removeChild', this).call(this, child);
- this.cache = {};
- }
- }, {
- key: 'split',
- value: function split(index) {
- var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
-
- if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {
- var clone = this.clone();
- if (index === 0) {
- this.parent.insertBefore(clone, this);
- return this;
- } else {
- this.parent.insertBefore(clone, this.next);
- return clone;
- }
- } else {
- var next = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'split', this).call(this, index, force);
- this.cache = {};
- return next;
- }
- }
- }]);
-
- return Block;
- }(_parchment2.default.Block);
-
- Block.blotName = 'block';
- Block.tagName = 'P';
- Block.defaultChild = 'break';
- Block.allowedChildren = [_inline2.default, _parchment2.default.Embed, _text2.default];
-
- function bubbleFormats(blot) {
- var formats = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
-
- if (blot == null) return formats;
- if (typeof blot.formats === 'function') {
- formats = (0, _extend2.default)(formats, blot.formats());
- }
- if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) {
- return formats;
- }
- return bubbleFormats(blot.parent, formats);
- }
-
- exports.bubbleFormats = bubbleFormats;
- exports.BlockEmbed = BlockEmbed;
- exports.default = Block;
-
- /***/
- }),
-/* 5 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.DeltaTransformer = exports.default = exports.overload = exports.expandConfig = undefined;
-
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
-
- var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- __webpack_require__(56);
-
- var _quillDelta = __webpack_require__(1);
-
- var _quillDelta2 = _interopRequireDefault(_quillDelta);
-
- var _editor = __webpack_require__(14);
-
- var _editor2 = _interopRequireDefault(_editor);
-
- var _emitter3 = __webpack_require__(8);
-
- var _emitter4 = _interopRequireDefault(_emitter3);
-
- var _module = __webpack_require__(9);
-
- var _module2 = _interopRequireDefault(_module);
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _selection = __webpack_require__(15);
-
- var _selection2 = _interopRequireDefault(_selection);
-
- var _extend = __webpack_require__(3);
-
- var _extend2 = _interopRequireDefault(_extend);
-
- var _logger = __webpack_require__(10);
-
- var _logger2 = _interopRequireDefault(_logger);
-
- var _theme = __webpack_require__(40);
-
- var _theme2 = _interopRequireDefault(_theme);
-
- var _delta = __webpack_require__(73);
-
- var _delta2 = _interopRequireDefault(_delta);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- var debug = (0, _logger2.default)("quill");
-
- var Quill = function () {
- _createClass(Quill, null, [{
- key: "debug",
- value: function debug(limit) {
- if (limit === true) {
- limit = "log";
- }
- _logger2.default.level(limit);
- }
- }, {
- key: "find",
- value: function find(node) {
- return node.__quill || _parchment2.default.find(node);
- }
- }, {
- key: "import",
- value: function _import(name) {
- if (this.imports[name] == null) {
- debug.error("Cannot import " + name + ". Are you sure it was registered?");
- }
- return this.imports[name];
- }
- }, {
- key: "register",
- value: function register(path, target) {
- var _this = this;
-
- var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
-
- if (typeof path !== "string") {
- var name = path.attrName || path.blotName;
- if (typeof name === "string") {
- // register(Blot | Attributor, overwrite)
- this.register("formats/" + name, path, target);
- } else {
- Object.keys(path).forEach(function (key) {
- _this.register(key, path[key], target);
- });
- }
- } else {
- if (this.imports[path] != null && !overwrite) {
- debug.warn("Overwriting " + path + " with", target);
- }
- this.imports[path] = target;
- if ((path.startsWith("blots/") || path.startsWith("formats/")) && target.blotName !== "abstract") {
- _parchment2.default.register(target);
- } else if (path.startsWith("modules") && typeof target.register === "function") {
- target.register();
- }
- }
- }
- }]);
-
- function Quill(container) {
- var _this2 = this;
-
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
-
- _classCallCheck(this, Quill);
-
- this.options = expandConfig(container, options);
- this.container = this.options.container;
- if (this.container == null) {
- return debug.error("Invalid Quill container", container);
- }
- if (this.options.debug) {
- Quill.debug(this.options.debug);
- }
- var html = this.container.innerHTML.trim();
- this.container.classList.add("ql-container");
- this.container.innerHTML = "";
- this.container.__quill = this;
- this.root = this.addContainer("ql-editor");
- this.root.classList.add("ql-blank");
- this.root.setAttribute("data-gramm", false);
- this.scrollingContainer = this.options.scrollingContainer || this.root;
- this.emitter = new _emitter4.default();
- this.scroll = _parchment2.default.create(this.root, {
- emitter: this.emitter,
- whitelist: this.options.formats
- });
- this.editor = new _editor2.default(this.scroll);
- this.selection = new _selection2.default(this.scroll, this.emitter);
- this.theme = new this.options.theme(this, this.options);
- this.keyboard = this.theme.addModule("keyboard");
- this.clipboard = this.theme.addModule("clipboard");
- this.history = this.theme.addModule("history");
- this.theme.init();
- this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type) {
- if (type === _emitter4.default.events.TEXT_CHANGE) {
- _this2.root.classList.toggle("ql-blank", _this2.editor.isBlank());
- }
- });
- this.emitter.on(_emitter4.default.events.SCROLL_UPDATE, function (source, mutations) {
- var range = _this2.selection.lastRange;
- var index = range && range.length === 0 ? range.index : undefined;
- modify.call(_this2, function () {
- return _this2.editor.update(null, mutations, index);
- }, source);
- });
- var contents = this.clipboard.convert("<div class='ql-editor' style=\"white-space: normal;\">" + html + "<p><br></p></div>");
- this.setContents(contents);
- this.history.clear();
- if (this.options.placeholder) {
- this.root.setAttribute("data-placeholder", this.options.placeholder);
- }
- if (this.options.readOnly) {
- this.disable();
- }
- }
-
- _createClass(Quill, [{
- key: "addContainer",
- value: function addContainer(container) {
- var refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
-
- if (typeof container === "string") {
- var className = container;
- container = document.createElement("div");
- container.classList.add(className);
- }
- this.container.insertBefore(container, refNode);
- return container;
- }
- }, {
- key: "blur",
- value: function blur() {
- this.selection.setRange(null);
- }
- }, {
- key: "deleteText",
- value: function deleteText(index, length, source) {
- var _this3 = this;
-
- var _overload = overload(index, length, source);
-
- var _overload2 = _slicedToArray(_overload, 4);
-
- index = _overload2[0];
- length = _overload2[1];
- source = _overload2[3];
-
- return modify.call(this, function () {
- return _this3.editor.deleteText(index, length);
- }, source, index, -1 * length);
- }
- }, {
- key: "disable",
- value: function disable() {
- this.enable(false);
- }
- }, {
- key: "enable",
- value: function enable() {
- var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
-
- this.scroll.enable(enabled);
- this.container.classList.toggle("ql-disabled", !enabled);
- }
- }, {
- key: "focus",
- value: function focus() {
- var scrollTop = this.scrollingContainer.scrollTop;
- this.selection.focus();
- this.scrollingContainer.scrollTop = scrollTop;
- this.scrollIntoView();
- }
- }, {
- key: "format",
- value: function format(name, value) {
- var _this4 = this;
-
- var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API;
-
- return modify.call(this, function () {
- var range = _this4.getSelection(true);
- var change = new _quillDelta2.default();
- if (range == null) {
- return change;
- } else if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) {
- change = _this4.editor.formatLine(range.index, range.length, _defineProperty({}, name, value));
- } else if (range.length === 0) {
- _this4.selection.format(name, value);
- return change;
- } else {
- change = _this4.editor.formatText(range.index, range.length, _defineProperty({}, name, value));
- }
- _this4.setSelection(range, _emitter4.default.sources.SILENT);
- return change;
- }, source);
- }
- }, {
- key: "formatLine",
- value: function formatLine(index, length, name, value, source) {
- var _this5 = this;
-
- var formats = void 0;
-
- var _overload3 = overload(index, length, name, value, source);
-
- var _overload4 = _slicedToArray(_overload3, 4);
-
- index = _overload4[0];
- length = _overload4[1];
- formats = _overload4[2];
- source = _overload4[3];
-
- return modify.call(this, function () {
- return _this5.editor.formatLine(index, length, formats);
- }, source, index, 0);
- }
- }, {
- key: "formatText",
- value: function formatText(index, length, name, value, source) {
- var _this6 = this;
-
- var formats = void 0;
-
- var _overload5 = overload(index, length, name, value, source);
-
- var _overload6 = _slicedToArray(_overload5, 4);
-
- index = _overload6[0];
- length = _overload6[1];
- formats = _overload6[2];
- source = _overload6[3];
-
- return modify.call(this, function () {
- return _this6.editor.formatText(index, length, formats);
- }, source, index, 0);
- }
- }, {
- key: "getBounds",
- value: function getBounds(index) {
- var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
-
- var bounds = void 0;
- if (typeof index === "number") {
- bounds = this.selection.getBounds(index, length);
- } else {
- bounds = this.selection.getBounds(index.index, index.length);
- }
- var containerBounds = this.container.getBoundingClientRect();
- return {
- bottom: bounds.bottom - containerBounds.top,
- height: bounds.height,
- left: bounds.left - containerBounds.left,
- right: bounds.right - containerBounds.left,
- top: bounds.top - containerBounds.top,
- width: bounds.width
- };
- }
- }, {
- key: "getContents",
- value: function getContents() {
- var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
- var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;
-
- var _overload7 = overload(index, length);
-
- var _overload8 = _slicedToArray(_overload7, 2);
-
- index = _overload8[0];
- length = _overload8[1];
-
- return this.editor.getContents(index, length);
- }
- }, {
- key: "getFormat",
- value: function getFormat() {
- var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection(true);
- var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
-
- if (typeof index === "number") {
- return this.editor.getFormat(index, length);
- } else {
- return this.editor.getFormat(index.index, index.length);
- }
- }
- }, {
- key: "getIndex",
- value: function getIndex(blot) {
- return blot.offset(this.scroll);
- }
- }, {
- key: "getLength",
- value: function getLength() {
- return this.scroll.length();
- }
- }, {
- key: "getLeaf",
- value: function getLeaf(index) {
- return this.scroll.leaf(index);
- }
- }, {
- key: "getLine",
- value: function getLine(index) {
- return this.scroll.line(index);
- }
- }, {
- key: "getLines",
- value: function getLines() {
- var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
- var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE;
-
- if (typeof index !== "number") {
- return this.scroll.lines(index.index, index.length);
- } else {
- return this.scroll.lines(index, length);
- }
- }
- }, {
- key: "getModule",
- value: function getModule(name) {
- return this.theme.modules[name];
- }
- }, {
- key: "getSelection",
- value: function getSelection() {
- var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
-
- if (focus) this.focus();
- this.update(); // Make sure we access getRange with editor in consistent state
- return this.selection.getRange()[0];
- }
- }, {
- key: "getText",
- value: function getText() {
- var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
- var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;
-
- var _overload9 = overload(index, length);
-
- var _overload10 = _slicedToArray(_overload9, 2);
-
- index = _overload10[0];
- length = _overload10[1];
-
- return this.editor.getText(index, length);
- }
- }, {
- key: "hasFocus",
- value: function hasFocus() {
- return this.selection.hasFocus();
- }
- }, {
- key: "insertEmbed",
- value: function insertEmbed(index, embed, value) {
- var _this7 = this;
-
- var source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API;
-
- return modify.call(this, function () {
- return _this7.editor.insertEmbed(index, embed, value);
- }, source, index);
- }
- }, {
- key: "insertText",
- value: function insertText(index, text, name, value, source) {
- var _this8 = this;
-
- var formats = void 0;
-
- var _overload11 = overload(index, 0, name, value, source);
-
- var _overload12 = _slicedToArray(_overload11, 4);
-
- index = _overload12[0];
- formats = _overload12[2];
- source = _overload12[3];
-
- return modify.call(this, function () {
- return _this8.editor.insertText(index, text, formats);
- }, source, index, text.length);
- }
- }, {
- key: "isEnabled",
- value: function isEnabled() {
- return !this.container.classList.contains("ql-disabled");
- }
- }, {
- key: "off",
- value: function off() {
- return this.emitter.off.apply(this.emitter, arguments);
- }
- }, {
- key: "on",
- value: function on() {
- return this.emitter.on.apply(this.emitter, arguments);
- }
- }, {
- key: "once",
- value: function once() {
- return this.emitter.once.apply(this.emitter, arguments);
- }
- }, {
- key: "pasteHTML",
- value: function pasteHTML(index, html, source) {
- this.clipboard.dangerouslyPasteHTML(index, html, source);
- }
- }, {
- key: "removeFormat",
- value: function removeFormat(index, length, source) {
- var _this9 = this;
-
- var _overload13 = overload(index, length, source);
-
- var _overload14 = _slicedToArray(_overload13, 4);
-
- index = _overload14[0];
- length = _overload14[1];
- source = _overload14[3];
-
- return modify.call(this, function () {
- return _this9.editor.removeFormat(index, length);
- }, source, index);
- }
- }, {
- key: "scrollIntoView",
- value: function scrollIntoView() {
- this.selection.scrollIntoView(this.scrollingContainer);
- }
- }, {
- key: "setContents",
- value: function setContents(delta) {
- var _this10 = this;
-
- var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API;
-
- return modify.call(this, function () {
- delta = new _quillDelta2.default(delta);
- var length = _this10.getLength();
- var deleted = _this10.editor.deleteText(0, length);
- var applied = _this10.editor.applyDelta(delta);
- var lastOp = applied.ops[applied.ops.length - 1];
- if (lastOp != null && typeof lastOp.insert === "string" && lastOp.insert[lastOp.insert.length - 1] === "\n") {
- _this10.editor.deleteText(_this10.getLength() - 1, 1);
- applied.delete(1);
- }
- var ret = deleted.compose(applied);
- return ret;
- }, source);
- }
- }, {
- key: "setSelection",
- value: function setSelection(index, length, source) {
- if (index == null) {
- this.selection.setRange(null, length || Quill.sources.API);
- } else {
- var _overload15 = overload(index, length, source);
-
- var _overload16 = _slicedToArray(_overload15, 4);
-
- index = _overload16[0];
- length = _overload16[1];
- source = _overload16[3];
-
- this.selection.setRange(new _selection.Range(index, length), source);
- if (source !== _emitter4.default.sources.SILENT) {
- this.selection.scrollIntoView(this.scrollingContainer);
- }
- }
- }
- }, {
- key: "setText",
- value: function setText(text) {
- var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API;
-
- var delta = new _quillDelta2.default().insert(text);
- return this.setContents(delta, source);
- }
- }, {
- key: "update",
- value: function update() {
- var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER;
-
- var change = this.scroll.update(source); // Will update selection before selection.update() does if text changes
- this.selection.update(source);
- return change;
- }
- }, {
- key: "updateContents",
- value: function updateContents(delta) {
- var _this11 = this;
-
- var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API;
-
- return modify.call(this, function () {
- delta = new _quillDelta2.default(delta);
- return _this11.editor.applyDelta(delta, source);
- }, source, true);
- }
- }]);
-
- return Quill;
- }();
-
- Quill.DEFAULTS = {
- bounds: null,
- formats: null,
- modules: {},
- placeholder: "",
- readOnly: false,
- scrollingContainer: null,
- strict: true,
- theme: "default"
- };
- Quill.events = _emitter4.default.events;
- Quill.sources = _emitter4.default.sources;
- // eslint-disable-next-line no-undef
- Quill.version = false ? "dev" : "1.3.7";
-
- Quill.imports = {
- delta: _quillDelta2.default,
- parchment: _parchment2.default,
- "core/module": _module2.default,
- "core/theme": _theme2.default
- };
-
- function expandConfig(container, userConfig) {
- userConfig = (0, _extend2.default)(true, {
- container: container,
- modules: {
- clipboard: true,
- keyboard: true,
- history: true
- }
- }, userConfig);
- if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) {
- userConfig.theme = _theme2.default;
- } else {
- userConfig.theme = Quill.import("themes/" + userConfig.theme);
- if (userConfig.theme == null) {
- throw new Error("Invalid theme " + userConfig.theme + ". Did you register it?");
- }
- }
- var themeConfig = (0, _extend2.default)(true, {}, userConfig.theme.DEFAULTS);
- [themeConfig, userConfig].forEach(function (config) {
- config.modules = config.modules || {};
- Object.keys(config.modules).forEach(function (module) {
- if (config.modules[module] === true) {
- config.modules[module] = {};
- }
- });
- });
- var moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules));
- var moduleConfig = moduleNames.reduce(function (config, name) {
- var moduleClass = Quill.import("modules/" + name);
- if (moduleClass == null) {
- debug.error("Cannot load " + name + " module. Are you sure you registered it?");
- } else {
- config[name] = moduleClass.DEFAULTS || {};
- }
- return config;
- }, {});
- // Special case toolbar shorthand
- if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) {
- userConfig.modules.toolbar = {
- container: userConfig.modules.toolbar
- };
- }
- userConfig = (0, _extend2.default)(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig);
- ["bounds", "container", "scrollingContainer"].forEach(function (key) {
- if (typeof userConfig[key] === "string") {
- userConfig[key] = document.querySelector(userConfig[key]);
- }
- });
- userConfig.modules = Object.keys(userConfig.modules).reduce(function (config, name) {
- if (userConfig.modules[name]) {
- config[name] = userConfig.modules[name];
- }
- return config;
- }, {});
- return userConfig;
- }
-
- // Handle selection preservation and TEXT_CHANGE emission
- // common to modification APIs
- function modify(modifier, source, index, shift) {
- if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {
- return new _quillDelta2.default();
- }
- var range = index == null ? null : this.getSelection();
- var oldDelta = this.editor.delta;
- var change = modifier();
- if (range != null) {
- if (index === true) index = range.index;
- if (shift == null) {
- range = shiftRange(range, change, source);
- } else if (shift !== 0) {
- range = shiftRange(range, index, shift, source);
- }
- this.setSelection(range, _emitter4.default.sources.SILENT);
- }
- if (change.length() > 0) {
- var _emitter;
-
- var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];
- (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));
- if (source !== _emitter4.default.sources.SILENT) {
- var _emitter2;
-
- (_emitter2 = this.emitter).emit.apply(_emitter2, args);
- }
- }
- return change;
- }
-
- function overload(index, length, name, value, source) {
- var formats = {};
- if (typeof index.index === "number" && typeof index.length === "number") {
- // Allow for throwaway end (used by insertText/insertEmbed)
- if (typeof length !== "number") {
- source = value, value = name, name = length, length = index.length, index = index.index;
- } else {
- length = index.length, index = index.index;
- }
- } else if (typeof length !== "number") {
- source = value, value = name, name = length, length = 0;
- }
- // Handle format being object, two format name/value strings or excluded
- if ((typeof name === "undefined" ? "undefined" : _typeof(name)) === "object") {
- formats = name;
- source = value;
- } else if (typeof name === "string") {
- if (value != null) {
- formats[name] = value;
- } else {
- source = name;
- }
- }
- // Handle optional source
- source = source || _emitter4.default.sources.API;
- return [index, length, formats, source];
- }
-
- function shiftRange(range, index, length, source) {
- if (range == null) return null;
- var start = void 0,
- end = void 0;
- if (index instanceof _quillDelta2.default) {
- var _map = [range.index, range.index + range.length].map(function (pos) {
- return index.transformPosition(pos, source !== _emitter4.default.sources.USER);
- });
-
- var _map2 = _slicedToArray(_map, 2);
-
- start = _map2[0];
- end = _map2[1];
- } else {
- var _map3 = [range.index, range.index + range.length].map(function (pos) {
- if (pos < index || pos === index && source === _emitter4.default.sources.USER) return pos;
- if (length >= 0) {
- return pos + length;
- } else {
- return Math.max(index, pos + length);
- }
- });
-
- var _map4 = _slicedToArray(_map3, 2);
-
- start = _map4[0];
- end = _map4[1];
- }
- return new _selection.Range(start, end - start);
- }
-
- exports.expandConfig = expandConfig;
- exports.overload = overload;
- exports.default = Quill;
- exports.DeltaTransformer = _delta2.default;
-
- /***/
- }),
-/* 6 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _text = __webpack_require__(7);
-
- var _text2 = _interopRequireDefault(_text);
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var Inline = function (_Parchment$Inline) {
- _inherits(Inline, _Parchment$Inline);
-
- function Inline() {
- _classCallCheck(this, Inline);
-
- return _possibleConstructorReturn(this, (Inline.__proto__ || Object.getPrototypeOf(Inline)).apply(this, arguments));
- }
-
- _createClass(Inline, [{
- key: 'formatAt',
- value: function formatAt(index, length, name, value) {
- if (Inline.compare(this.statics.blotName, name) < 0 && _parchment2.default.query(name, _parchment2.default.Scope.BLOT)) {
- var blot = this.isolate(index, length);
- if (value) {
- blot.wrap(name, value);
- }
- } else {
- _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'formatAt', this).call(this, index, length, name, value);
- }
- }
- }, {
- key: 'optimize',
- value: function optimize(context) {
- _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'optimize', this).call(this, context);
- if (this.parent instanceof Inline && Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) {
- var parent = this.parent.isolate(this.offset(), this.length());
- this.moveChildren(parent);
- parent.wrap(this);
- }
- }
- }], [{
- key: 'compare',
- value: function compare(self, other) {
- var selfIndex = Inline.order.indexOf(self);
- var otherIndex = Inline.order.indexOf(other);
- if (selfIndex >= 0 || otherIndex >= 0) {
- return selfIndex - otherIndex;
- } else if (self === other) {
- return 0;
- } else if (self < other) {
- return -1;
- } else {
- return 1;
- }
- }
- }]);
-
- return Inline;
- }(_parchment2.default.Inline);
-
- Inline.allowedChildren = [Inline, _parchment2.default.Embed, _text2.default];
- // Lower index means deeper in the DOM tree, since not found (-1) is for embeds
- Inline.order = ['cursor', 'inline', // Must be lower
- 'underline', 'strike', 'italic', 'bold', 'script', 'link', 'code' // Must be higher
- ];
-
- exports.default = Inline;
-
- /***/
- }),
-/* 7 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var TextBlot = function (_Parchment$Text) {
- _inherits(TextBlot, _Parchment$Text);
-
- function TextBlot() {
- _classCallCheck(this, TextBlot);
-
- return _possibleConstructorReturn(this, (TextBlot.__proto__ || Object.getPrototypeOf(TextBlot)).apply(this, arguments));
- }
-
- return TextBlot;
- }(_parchment2.default.Text);
-
- exports.default = TextBlot;
-
- /***/
- }),
-/* 8 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _eventemitter = __webpack_require__(72);
-
- var _eventemitter2 = _interopRequireDefault(_eventemitter);
-
- var _logger = __webpack_require__(10);
-
- var _logger2 = _interopRequireDefault(_logger);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var debug = (0, _logger2.default)('quill:events');
-
- var EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click'];
-
- EVENTS.forEach(function (eventName) {
- document.addEventListener(eventName, function () {
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- [].slice.call(document.querySelectorAll('.ql-container')).forEach(function (node) {
- // TODO use WeakMap
- if (node.__quill && node.__quill.emitter) {
- var _node$__quill$emitter;
-
- (_node$__quill$emitter = node.__quill.emitter).handleDOM.apply(_node$__quill$emitter, args);
- }
- });
- });
- });
-
- var Emitter = function (_EventEmitter) {
- _inherits(Emitter, _EventEmitter);
-
- function Emitter() {
- _classCallCheck(this, Emitter);
-
- var _this = _possibleConstructorReturn(this, (Emitter.__proto__ || Object.getPrototypeOf(Emitter)).call(this));
-
- _this.listeners = {};
- _this.on('error', debug.error);
- return _this;
- }
-
- _createClass(Emitter, [{
- key: 'emit',
- value: function emit() {
- debug.log.apply(debug, arguments);
- _get(Emitter.prototype.__proto__ || Object.getPrototypeOf(Emitter.prototype), 'emit', this).apply(this, arguments);
- }
- }, {
- key: 'handleDOM',
- value: function handleDOM(event) {
- for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
- args[_key2 - 1] = arguments[_key2];
- }
-
- (this.listeners[event.type] || []).forEach(function (_ref) {
- var node = _ref.node,
- handler = _ref.handler;
-
- if (event.target === node || node.contains(event.target)) {
- handler.apply(undefined, [event].concat(args));
- }
- });
- }
- }, {
- key: 'listenDOM',
- value: function listenDOM(eventName, node, handler) {
- if (!this.listeners[eventName]) {
- this.listeners[eventName] = [];
- }
- this.listeners[eventName].push({ node: node, handler: handler });
- }
- }]);
-
- return Emitter;
- }(_eventemitter2.default);
-
- Emitter.events = {
- EDITOR_CHANGE: 'editor-change',
- SCROLL_BEFORE_UPDATE: 'scroll-before-update',
- SCROLL_OPTIMIZE: 'scroll-optimize',
- SCROLL_UPDATE: 'scroll-update',
- SELECTION_CHANGE: 'selection-change',
- TEXT_CHANGE: 'text-change'
- };
- Emitter.sources = {
- API: 'api',
- SILENT: 'silent',
- USER: 'user'
- };
-
- exports.default = Emitter;
-
- /***/
- }),
-/* 9 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- var Module = function Module(quill) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
-
- _classCallCheck(this, Module);
-
- this.quill = quill;
- this.options = options;
- };
-
- Module.DEFAULTS = {};
-
- exports.default = Module;
-
- /***/
- }),
-/* 10 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var levels = ['error', 'warn', 'log', 'info'];
- var level = 'warn';
-
- function debug(method) {
- if (levels.indexOf(method) <= levels.indexOf(level)) {
- var _console;
-
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
-
- (_console = console)[method].apply(_console, args); // eslint-disable-line no-console
- }
- }
-
- function namespace(ns) {
- return levels.reduce(function (logger, method) {
- logger[method] = debug.bind(console, method, ns);
- return logger;
- }, {});
- }
-
- debug.level = namespace.level = function (newLevel) {
- level = newLevel;
- };
-
- exports.default = namespace;
-
- /***/
- }),
-/* 11 */
-/***/ (function (module, exports, __webpack_require__) {
-
- var objectKeys = __webpack_require__(36);
- var isArguments = __webpack_require__(59);
- var is = __webpack_require__(60);
- var isRegex = __webpack_require__(61);
- var flags = __webpack_require__(64);
- var isDate = __webpack_require__(71);
-
- var getTime = Date.prototype.getTime;
-
- function deepEqual(actual, expected, options) {
- var opts = options || {};
-
- // 7.1. All identical values are equivalent, as determined by ===.
- if (opts.strict ? is(actual, expected) : actual === expected) {
- return true;
- }
-
- // 7.3. Other pairs that do not both pass typeof value == 'object', equivalence is determined by ==.
- if (!actual || !expected || (typeof actual !== 'object' && typeof expected !== 'object')) {
- return opts.strict ? is(actual, expected) : actual == expected;
- }
-
- /*
- * 7.4. For all other Object pairs, including Array objects, equivalence is
- * determined by having the same number of owned properties (as verified
- * with Object.prototype.hasOwnProperty.call), the same set of keys
- * (although not necessarily the same order), equivalent values for every
- * corresponding key, and an identical 'prototype' property. Note: this
- * accounts for both named and indexed properties on Arrays.
- */
- // eslint-disable-next-line no-use-before-define
- return objEquiv(actual, expected, opts);
- }
-
- function isUndefinedOrNull(value) {
- return value === null || value === undefined;
- }
-
- function isBuffer(x) {
- if (!x || typeof x !== 'object' || typeof x.length !== 'number') {
- return false;
- }
- if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {
- return false;
- }
- if (x.length > 0 && typeof x[0] !== 'number') {
- return false;
- }
- return true;
- }
-
- function objEquiv(a, b, opts) {
- /* eslint max-statements: [2, 50] */
- var i, key;
- if (typeof a !== typeof b) { return false; }
- if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) { return false; }
-
- // an identical 'prototype' property.
- if (a.prototype !== b.prototype) { return false; }
-
- if (isArguments(a) !== isArguments(b)) { return false; }
-
- var aIsRegex = isRegex(a);
- var bIsRegex = isRegex(b);
- if (aIsRegex !== bIsRegex) { return false; }
- if (aIsRegex || bIsRegex) {
- return a.source === b.source && flags(a) === flags(b);
- }
-
- if (isDate(a) && isDate(b)) {
- return getTime.call(a) === getTime.call(b);
- }
-
- var aIsBuffer = isBuffer(a);
- var bIsBuffer = isBuffer(b);
- if (aIsBuffer !== bIsBuffer) { return false; }
- if (aIsBuffer || bIsBuffer) { // && would work too, because both are true or both false here
- if (a.length !== b.length) { return false; }
- for (i = 0; i < a.length; i++) {
- if (a[i] !== b[i]) { return false; }
- }
- return true;
- }
-
- if (typeof a !== typeof b) { return false; }
-
- try {
- var ka = objectKeys(a);
- var kb = objectKeys(b);
- } catch (e) { // happens when one is a string literal and the other isn't
- return false;
- }
- // having the same number of owned properties (keys incorporates hasOwnProperty)
- if (ka.length !== kb.length) { return false; }
-
- // the same set of keys (although not necessarily the same order),
- ka.sort();
- kb.sort();
- // ~~~cheap key test
- for (i = ka.length - 1; i >= 0; i--) {
- if (ka[i] != kb[i]) { return false; }
- }
- // equivalent values for every corresponding key, and ~~~possibly expensive deep test
- for (i = ka.length - 1; i >= 0; i--) {
- key = ka[i];
- if (!deepEqual(a[key], b[key], opts)) { return false; }
- }
-
- return true;
- }
-
- module.exports = deepEqual;
-
-
- /***/
- }),
-/* 12 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- Object.defineProperty(exports, "__esModule", { value: true });
- var Registry = __webpack_require__(2);
- var Attributor = /** @class */ (function () {
- function Attributor(attrName, keyName, options) {
- if (options === void 0) { options = {}; }
- this.attrName = attrName;
- this.keyName = keyName;
- var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE;
- if (options.scope != null) {
- // Ignore type bits, force attribute bit
- this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit;
- }
- else {
- this.scope = Registry.Scope.ATTRIBUTE;
- }
- if (options.whitelist != null)
- this.whitelist = options.whitelist;
- }
- Attributor.keys = function (node) {
- return [].map.call(node.attributes, function (item) {
- return item.name;
- });
- };
- Attributor.prototype.add = function (node, value) {
- if (!this.canAdd(node, value))
- return false;
- node.setAttribute(this.keyName, value);
- return true;
- };
- Attributor.prototype.canAdd = function (node, value) {
- var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE));
- if (match == null)
- return false;
- if (this.whitelist == null)
- return true;
- if (typeof value === 'string') {
- return this.whitelist.indexOf(value.replace(/["']/g, '')) > -1;
- }
- else {
- return this.whitelist.indexOf(value) > -1;
- }
- };
- Attributor.prototype.remove = function (node) {
- node.removeAttribute(this.keyName);
- };
- Attributor.prototype.value = function (node) {
- var value = node.getAttribute(this.keyName);
- if (this.canAdd(node, value) && value) {
- return value;
- }
- return '';
- };
- return Attributor;
- }());
- exports.default = Attributor;
-
-
- /***/
- }),
-/* 13 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = exports.Code = undefined;
-
- var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _quillDelta = __webpack_require__(1);
-
- var _quillDelta2 = _interopRequireDefault(_quillDelta);
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _block = __webpack_require__(4);
-
- var _block2 = _interopRequireDefault(_block);
-
- var _inline = __webpack_require__(6);
-
- var _inline2 = _interopRequireDefault(_inline);
-
- var _text = __webpack_require__(7);
-
- var _text2 = _interopRequireDefault(_text);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var Code = function (_Inline) {
- _inherits(Code, _Inline);
-
- function Code() {
- _classCallCheck(this, Code);
-
- return _possibleConstructorReturn(this, (Code.__proto__ || Object.getPrototypeOf(Code)).apply(this, arguments));
- }
-
- return Code;
- }(_inline2.default);
-
- Code.blotName = 'code';
- Code.tagName = 'CODE';
-
- var CodeBlock = function (_Block) {
- _inherits(CodeBlock, _Block);
-
- function CodeBlock() {
- _classCallCheck(this, CodeBlock);
-
- return _possibleConstructorReturn(this, (CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock)).apply(this, arguments));
- }
-
- _createClass(CodeBlock, [{
- key: 'delta',
- value: function delta() {
- var _this3 = this;
-
- var text = this.domNode.textContent;
- if (text.endsWith('\n')) {
- // Should always be true
- text = text.slice(0, -1);
- }
- return text.split('\n').reduce(function (delta, frag) {
- return delta.insert(frag).insert('\n', _this3.formats());
- }, new _quillDelta2.default());
- }
- }, {
- key: 'format',
- value: function format(name, value) {
- if (name === this.statics.blotName && value) return;
-
- var _descendant = this.descendant(_text2.default, this.length() - 1),
- _descendant2 = _slicedToArray(_descendant, 1),
- text = _descendant2[0];
-
- if (text != null) {
- text.deleteAt(text.length() - 1, 1);
- }
- _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'format', this).call(this, name, value);
- }
- }, {
- key: 'formatAt',
- value: function formatAt(index, length, name, value) {
- if (length === 0) return;
- if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK) == null || name === this.statics.blotName && value === this.statics.formats(this.domNode)) {
- return;
- }
- var nextNewline = this.newlineIndex(index);
- if (nextNewline < 0 || nextNewline >= index + length) return;
- var prevNewline = this.newlineIndex(index, true) + 1;
- var isolateLength = nextNewline - prevNewline + 1;
- var blot = this.isolate(prevNewline, isolateLength);
- var next = blot.next;
- blot.format(name, value);
- if (next instanceof CodeBlock) {
- next.formatAt(0, index - prevNewline + length - isolateLength, name, value);
- }
- }
- }, {
- key: 'insertAt',
- value: function insertAt(index, value, def) {
- if (def != null) return;
-
- var _descendant3 = this.descendant(_text2.default, index),
- _descendant4 = _slicedToArray(_descendant3, 2),
- text = _descendant4[0],
- offset = _descendant4[1];
-
- text.insertAt(offset, value);
- }
- }, {
- key: 'length',
- value: function length() {
- var length = this.domNode.textContent.length;
- if (!this.domNode.textContent.endsWith('\n')) {
- return length + 1;
- }
- return length;
- }
- }, {
- key: 'newlineIndex',
- value: function newlineIndex(searchIndex) {
- var reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
-
- if (!reverse) {
- var offset = this.domNode.textContent.slice(searchIndex).indexOf('\n');
- return offset > -1 ? searchIndex + offset : -1;
- } else {
- return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\n');
- }
- }
- }, {
- key: 'optimize',
- value: function optimize(context) {
- if (!this.domNode.textContent.endsWith('\n')) {
- this.appendChild(_parchment2.default.create('text', '\n'));
- }
- _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'optimize', this).call(this, context);
- var next = this.next;
- if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) {
- next.optimize(context);
- next.moveChildren(this);
- next.remove();
- }
- }
- }, {
- key: 'replace',
- value: function replace(target) {
- _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'replace', this).call(this, target);
- [].slice.call(this.domNode.querySelectorAll('*')).forEach(function (node) {
- var blot = _parchment2.default.find(node);
- if (blot == null) {
- node.parentNode.removeChild(node);
- } else if (blot instanceof _parchment2.default.Embed) {
- blot.remove();
- } else {
- blot.unwrap();
- }
- });
- }
- }], [{
- key: 'create',
- value: function create(value) {
- var domNode = _get(CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock), 'create', this).call(this, value);
- domNode.setAttribute('spellcheck', false);
- return domNode;
- }
- }, {
- key: 'formats',
- value: function formats() {
- return true;
- }
- }]);
-
- return CodeBlock;
- }(_block2.default);
-
- CodeBlock.blotName = 'code-block';
- CodeBlock.tagName = 'PRE';
- CodeBlock.TAB = ' ';
-
- exports.Code = Code;
- exports.default = CodeBlock;
-
- /***/
- }),
-/* 14 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
-
- var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _quillDelta = __webpack_require__(1);
-
- var _quillDelta2 = _interopRequireDefault(_quillDelta);
-
- var _op = __webpack_require__(22);
-
- var _op2 = _interopRequireDefault(_op);
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _code = __webpack_require__(13);
-
- var _code2 = _interopRequireDefault(_code);
-
- var _cursor = __webpack_require__(26);
-
- var _cursor2 = _interopRequireDefault(_cursor);
-
- var _block = __webpack_require__(4);
-
- var _block2 = _interopRequireDefault(_block);
-
- var _break = __webpack_require__(16);
-
- var _break2 = _interopRequireDefault(_break);
-
- var _clone = __webpack_require__(23);
-
- var _clone2 = _interopRequireDefault(_clone);
-
- var _deepEqual = __webpack_require__(11);
-
- var _deepEqual2 = _interopRequireDefault(_deepEqual);
-
- var _extend = __webpack_require__(3);
-
- var _extend2 = _interopRequireDefault(_extend);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- var ASCII = /^[ -~]*$/;
-
- var Editor = function () {
- function Editor(scroll) {
- _classCallCheck(this, Editor);
-
- this.scroll = scroll;
- this.delta = this.getDelta();
- }
-
- _createClass(Editor, [{
- key: 'applyDelta',
- value: function applyDelta(delta) {
- var _this = this;
-
- var consumeNextNewline = false;
- this.scroll.update();
- var scrollLength = this.scroll.length();
- this.scroll.batchStart();
- delta = normalizeDelta(delta);
- delta.reduce(function (index, op) {
- var length = op.retain || op.delete || op.insert.length || 1;
- var attributes = op.attributes || {};
- if (op.insert != null) {
- if (typeof op.insert === 'string') {
- var text = op.insert;
- if (text.endsWith('\n') && consumeNextNewline) {
- consumeNextNewline = false;
- text = text.slice(0, -1);
- }
- if (index >= scrollLength && !text.endsWith('\n')) {
- consumeNextNewline = true;
- }
- _this.scroll.insertAt(index, text);
-
- var _scroll$line = _this.scroll.line(index),
- _scroll$line2 = _slicedToArray(_scroll$line, 2),
- line = _scroll$line2[0],
- offset = _scroll$line2[1];
-
- var formats = (0, _extend2.default)({}, (0, _block.bubbleFormats)(line));
- if (line instanceof _block2.default) {
- var _line$descendant = line.descendant(_parchment2.default.Leaf, offset),
- _line$descendant2 = _slicedToArray(_line$descendant, 1),
- leaf = _line$descendant2[0];
-
- formats = (0, _extend2.default)(formats, (0, _block.bubbleFormats)(leaf));
- }
- attributes = _op2.default.attributes.diff(formats, attributes) || {};
- } else if (_typeof(op.insert) === 'object') {
- var key = Object.keys(op.insert)[0]; // There should only be one key
- if (key == null) return index;
- _this.scroll.insertAt(index, key, op.insert[key]);
- }
- scrollLength += length;
- }
- Object.keys(attributes).forEach(function (name) {
- _this.scroll.formatAt(index, length, name, attributes[name]);
- });
- return index + length;
- }, 0);
- delta.reduce(function (index, op) {
- if (typeof op.delete === 'number') {
- _this.scroll.deleteAt(index, op.delete);
- return index;
- }
- return index + (op.retain || op.insert.length || 1);
- }, 0);
- this.scroll.batchEnd();
- return this.update(delta);
- }
- }, {
- key: 'deleteText',
- value: function deleteText(index, length) {
- this.scroll.deleteAt(index, length);
- return this.update(new _quillDelta2.default().retain(index).delete(length));
- }
- }, {
- key: 'formatLine',
- value: function formatLine(index, length) {
- var _this2 = this;
-
- var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
-
- this.scroll.update();
- Object.keys(formats).forEach(function (format) {
- if (_this2.scroll.whitelist != null && !_this2.scroll.whitelist[format]) return;
- var lines = _this2.scroll.lines(index, Math.max(length, 1));
- var lengthRemaining = length;
- lines.forEach(function (line) {
- var lineLength = line.length();
- if (!(line instanceof _code2.default)) {
- line.format(format, formats[format]);
- } else {
- var codeIndex = index - line.offset(_this2.scroll);
- var codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1;
- line.formatAt(codeIndex, codeLength, format, formats[format]);
- }
- lengthRemaining -= lineLength;
- });
- });
- this.scroll.optimize();
- return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats)));
- }
- }, {
- key: 'formatText',
- value: function formatText(index, length) {
- var _this3 = this;
-
- var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
-
- Object.keys(formats).forEach(function (format) {
- _this3.scroll.formatAt(index, length, format, formats[format]);
- });
- return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats)));
- }
- }, {
- key: 'getContents',
- value: function getContents(index, length) {
- return this.delta.slice(index, index + length);
- }
- }, {
- key: 'getDelta',
- value: function getDelta() {
- return this.scroll.lines().reduce(function (delta, line) {
- return delta.concat(line.delta());
- }, new _quillDelta2.default());
- }
- }, {
- key: 'getFormat',
- value: function getFormat(index) {
- var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
-
- var lines = [],
- leaves = [];
- if (length === 0) {
- this.scroll.path(index).forEach(function (path) {
- var _path = _slicedToArray(path, 1),
- blot = _path[0];
-
- if (blot instanceof _block2.default) {
- lines.push(blot);
- } else if (blot instanceof _parchment2.default.Leaf) {
- leaves.push(blot);
- }
- });
- } else {
- lines = this.scroll.lines(index, length);
- leaves = this.scroll.descendants(_parchment2.default.Leaf, index, length);
- }
- var formatsArr = [lines, leaves].map(function (blots) {
- if (blots.length === 0) return {};
- var formats = (0, _block.bubbleFormats)(blots.shift());
- while (Object.keys(formats).length > 0) {
- var blot = blots.shift();
- if (blot == null) return formats;
- formats = combineFormats((0, _block.bubbleFormats)(blot), formats);
- }
- return formats;
- });
- return _extend2.default.apply(_extend2.default, formatsArr);
- }
- }, {
- key: 'getText',
- value: function getText(index, length) {
- return this.getContents(index, length).filter(function (op) {
- return typeof op.insert === 'string';
- }).map(function (op) {
- return op.insert;
- }).join('');
- }
- }, {
- key: 'insertEmbed',
- value: function insertEmbed(index, embed, value) {
- this.scroll.insertAt(index, embed, value);
- return this.update(new _quillDelta2.default().retain(index).insert(_defineProperty({}, embed, value)));
- }
- }, {
- key: 'insertText',
- value: function insertText(index, text) {
- var _this4 = this;
-
- var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
-
- text = text.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
- this.scroll.insertAt(index, text);
- Object.keys(formats).forEach(function (format) {
- _this4.scroll.formatAt(index, text.length, format, formats[format]);
- });
- return this.update(new _quillDelta2.default().retain(index).insert(text, (0, _clone2.default)(formats)));
- }
- }, {
- key: 'isBlank',
- value: function isBlank() {
- if (this.scroll.children.length == 0) return true;
- if (this.scroll.children.length > 1) return false;
- var block = this.scroll.children.head;
- if (block.statics.blotName !== _block2.default.blotName) return false;
- if (block.children.length > 1) return false;
- return block.children.head instanceof _break2.default;
- }
- }, {
- key: 'removeFormat',
- value: function removeFormat(index, length) {
- var text = this.getText(index, length);
-
- var _scroll$line3 = this.scroll.line(index + length),
- _scroll$line4 = _slicedToArray(_scroll$line3, 2),
- line = _scroll$line4[0],
- offset = _scroll$line4[1];
-
- var suffixLength = 0,
- suffix = new _quillDelta2.default();
- if (line != null) {
- if (!(line instanceof _code2.default)) {
- suffixLength = line.length() - offset;
- } else {
- suffixLength = line.newlineIndex(offset) - offset + 1;
- }
- suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\n');
- }
- var contents = this.getContents(index, length + suffixLength);
- var diff = contents.diff(new _quillDelta2.default().insert(text).concat(suffix));
- var delta = new _quillDelta2.default().retain(index).concat(diff);
- return this.applyDelta(delta);
- }
- }, {
- key: 'update',
- value: function update(change) {
- var mutations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- var cursorIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
-
- var oldDelta = this.delta;
- if (mutations.length === 1 && mutations[0].type === 'characterData' && mutations[0].target.data.match(ASCII) && _parchment2.default.find(mutations[0].target)) {
- // Optimization for character changes
- var textBlot = _parchment2.default.find(mutations[0].target);
- var formats = (0, _block.bubbleFormats)(textBlot);
- var index = textBlot.offset(this.scroll);
- var oldValue = mutations[0].oldValue.replace(_cursor2.default.CONTENTS, '');
- var oldText = new _quillDelta2.default().insert(oldValue);
- var newText = new _quillDelta2.default().insert(textBlot.value());
- var diffDelta = new _quillDelta2.default().retain(index).concat(oldText.diff(newText, cursorIndex));
- change = diffDelta.reduce(function (delta, op) {
- if (op.insert) {
- return delta.insert(op.insert, formats);
- } else {
- return delta.push(op);
- }
- }, new _quillDelta2.default());
- this.delta = oldDelta.compose(change);
- } else {
- this.delta = this.getDelta();
- if (!change || !(0, _deepEqual2.default)(oldDelta.compose(change), this.delta)) {
- change = oldDelta.diff(this.delta, cursorIndex);
- }
- }
- return change;
- }
- }]);
-
- return Editor;
- }();
-
- function combineFormats(formats, combined) {
- return Object.keys(combined).reduce(function (merged, name) {
- if (formats[name] == null) return merged;
- if (combined[name] === formats[name]) {
- merged[name] = combined[name];
- } else if (Array.isArray(combined[name])) {
- if (combined[name].indexOf(formats[name]) < 0) {
- merged[name] = combined[name].concat([formats[name]]);
- }
- } else {
- merged[name] = [combined[name], formats[name]];
- }
- return merged;
- }, {});
- }
-
- function normalizeDelta(delta) {
- return delta.reduce(function (delta, op) {
- if (op.insert === 1) {
- var attributes = (0, _clone2.default)(op.attributes);
- delete attributes['image'];
- return delta.insert({ image: op.attributes.image }, attributes);
- }
- if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) {
- op = (0, _clone2.default)(op);
- if (op.attributes.list) {
- op.attributes.list = 'ordered';
- } else {
- op.attributes.list = 'bullet';
- delete op.attributes.bullet;
- }
- }
- if (typeof op.insert === 'string') {
- var text = op.insert.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
- return delta.insert(text, op.attributes);
- }
- return delta.push(op);
- }, new _quillDelta2.default());
- }
-
- exports.default = Editor;
-
- /***/
- }),
-/* 15 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = exports.Range = undefined;
-
- var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _clone = __webpack_require__(23);
-
- var _clone2 = _interopRequireDefault(_clone);
-
- var _deepEqual = __webpack_require__(11);
-
- var _deepEqual2 = _interopRequireDefault(_deepEqual);
-
- var _emitter3 = __webpack_require__(8);
-
- var _emitter4 = _interopRequireDefault(_emitter3);
-
- var _logger = __webpack_require__(10);
-
- var _logger2 = _interopRequireDefault(_logger);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- var debug = (0, _logger2.default)('quill:selection');
-
- var Range = function Range(index) {
- var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
-
- _classCallCheck(this, Range);
-
- this.index = index;
- this.length = length;
- };
-
- var Selection = function () {
- function Selection(scroll, emitter) {
- var _this = this;
-
- _classCallCheck(this, Selection);
-
- this.emitter = emitter;
- this.scroll = scroll;
- this.composing = false;
- this.mouseDown = false;
- this.root = this.scroll.domNode;
- this.cursor = _parchment2.default.create('cursor', this);
- // savedRange is last non-null range
- this.lastRange = this.savedRange = new Range(0, 0);
- this.handleComposition();
- this.handleDragging();
- this.emitter.listenDOM('selectionchange', document, function () {
- if (!_this.mouseDown) {
- setTimeout(_this.update.bind(_this, _emitter4.default.sources.USER), 1);
- }
- });
- this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type, delta) {
- if (type === _emitter4.default.events.TEXT_CHANGE && delta.length() > 0) {
- _this.update(_emitter4.default.sources.SILENT);
- }
- });
- this.emitter.on(_emitter4.default.events.SCROLL_BEFORE_UPDATE, function () {
- if (!_this.hasFocus()) return;
- var native = _this.getNativeRange();
- if (native == null) return;
- if (native.start.node === _this.cursor.textNode) return; // cursor.restore() will handle
- // TODO unclear if this has negative side effects
- _this.emitter.once(_emitter4.default.events.SCROLL_UPDATE, function () {
- try {
- _this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset);
- } catch (ignored) { }
- });
- });
- this.emitter.on(_emitter4.default.events.SCROLL_OPTIMIZE, function (mutations, context) {
- if (context.range) {
- var _context$range = context.range,
- startNode = _context$range.startNode,
- startOffset = _context$range.startOffset,
- endNode = _context$range.endNode,
- endOffset = _context$range.endOffset;
-
- _this.setNativeRange(startNode, startOffset, endNode, endOffset);
- }
- });
- this.update(_emitter4.default.sources.SILENT);
- }
-
- _createClass(Selection, [{
- key: 'handleComposition',
- value: function handleComposition() {
- var _this2 = this;
-
- this.root.addEventListener('compositionstart', function () {
- _this2.composing = true;
- });
- this.root.addEventListener('compositionend', function () {
- _this2.composing = false;
- if (_this2.cursor.parent) {
- var range = _this2.cursor.restore();
- if (!range) return;
- setTimeout(function () {
- _this2.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset);
- }, 1);
- }
- });
- }
- }, {
- key: 'handleDragging',
- value: function handleDragging() {
- var _this3 = this;
-
- this.emitter.listenDOM('mousedown', document.body, function () {
- _this3.mouseDown = true;
- });
- this.emitter.listenDOM('mouseup', document.body, function () {
- _this3.mouseDown = false;
- _this3.update(_emitter4.default.sources.USER);
- });
- }
- }, {
- key: 'focus',
- value: function focus() {
- if (this.hasFocus()) return;
- this.root.focus();
- this.setRange(this.savedRange);
- }
- }, {
- key: 'format',
- value: function format(_format, value) {
- if (this.scroll.whitelist != null && !this.scroll.whitelist[_format]) return;
- this.scroll.update();
- var nativeRange = this.getNativeRange();
- if (nativeRange == null || !nativeRange.native.collapsed || _parchment2.default.query(_format, _parchment2.default.Scope.BLOCK)) return;
- if (nativeRange.start.node !== this.cursor.textNode) {
- var blot = _parchment2.default.find(nativeRange.start.node, false);
- if (blot == null) return;
- // TODO Give blot ability to not split
- if (blot instanceof _parchment2.default.Leaf) {
- var after = blot.split(nativeRange.start.offset);
- blot.parent.insertBefore(this.cursor, after);
- } else {
- blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen
- }
- this.cursor.attach();
- }
- this.cursor.format(_format, value);
- this.scroll.optimize();
- this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length);
- this.update();
- }
- }, {
- key: 'getBounds',
- value: function getBounds(index) {
- var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
-
- var scrollLength = this.scroll.length();
- index = Math.min(index, scrollLength - 1);
- length = Math.min(index + length, scrollLength - 1) - index;
- var node = void 0,
- _scroll$leaf = this.scroll.leaf(index),
- _scroll$leaf2 = _slicedToArray(_scroll$leaf, 2),
- leaf = _scroll$leaf2[0],
- offset = _scroll$leaf2[1];
- if (leaf == null) return null;
-
- var _leaf$position = leaf.position(offset, true);
-
- var _leaf$position2 = _slicedToArray(_leaf$position, 2);
-
- node = _leaf$position2[0];
- offset = _leaf$position2[1];
-
- var range = document.createRange();
- if (length > 0) {
- range.setStart(node, offset);
-
- var _scroll$leaf3 = this.scroll.leaf(index + length);
-
- var _scroll$leaf4 = _slicedToArray(_scroll$leaf3, 2);
-
- leaf = _scroll$leaf4[0];
- offset = _scroll$leaf4[1];
-
- if (leaf == null) return null;
-
- var _leaf$position3 = leaf.position(offset, true);
-
- var _leaf$position4 = _slicedToArray(_leaf$position3, 2);
-
- node = _leaf$position4[0];
- offset = _leaf$position4[1];
-
- range.setEnd(node, offset);
- return range.getBoundingClientRect();
- } else {
- var side = 'left';
- var rect = void 0;
- if (node instanceof Text) {
- if (offset < node.data.length) {
- range.setStart(node, offset);
- range.setEnd(node, offset + 1);
- } else {
- range.setStart(node, offset - 1);
- range.setEnd(node, offset);
- side = 'right';
- }
- rect = range.getBoundingClientRect();
- } else {
- rect = leaf.domNode.getBoundingClientRect();
- if (offset > 0) side = 'right';
- }
- return {
- bottom: rect.top + rect.height,
- height: rect.height,
- left: rect[side],
- right: rect[side],
- top: rect.top,
- width: 0
- };
- }
- }
- }, {
- key: 'getNativeRange',
- value: function getNativeRange() {
- var selection = document.getSelection();
- if (selection == null || selection.rangeCount <= 0) return null;
- var nativeRange = selection.getRangeAt(0);
- if (nativeRange == null) return null;
- var range = this.normalizeNative(nativeRange);
- debug.info('getNativeRange', range);
- return range;
- }
- }, {
- key: 'getRange',
- value: function getRange() {
- var normalized = this.getNativeRange();
- if (normalized == null) return [null, null];
- var range = this.normalizedToRange(normalized);
- return [range, normalized];
- }
- }, {
- key: 'hasFocus',
- value: function hasFocus() {
- return document.activeElement === this.root;
- }
- }, {
- key: 'normalizedToRange',
- value: function normalizedToRange(range) {
- var _this4 = this;
-
- var positions = [[range.start.node, range.start.offset]];
- if (!range.native.collapsed) {
- positions.push([range.end.node, range.end.offset]);
- }
- var indexes = positions.map(function (position) {
- var _position = _slicedToArray(position, 2),
- node = _position[0],
- offset = _position[1];
-
- var blot = _parchment2.default.find(node, true);
- var index = blot.offset(_this4.scroll);
- if (offset === 0) {
- return index;
- } else if (blot instanceof _parchment2.default.Container) {
- return index + blot.length();
- } else {
- return index + blot.index(node, offset);
- }
- });
- var end = Math.min(Math.max.apply(Math, _toConsumableArray(indexes)), this.scroll.length() - 1);
- var start = Math.min.apply(Math, [end].concat(_toConsumableArray(indexes)));
- return new Range(start, end - start);
- }
- }, {
- key: 'normalizeNative',
- value: function normalizeNative(nativeRange) {
- if (!contains(this.root, nativeRange.startContainer) || !nativeRange.collapsed && !contains(this.root, nativeRange.endContainer)) {
- return null;
- }
- var range = {
- start: { node: nativeRange.startContainer, offset: nativeRange.startOffset },
- end: { node: nativeRange.endContainer, offset: nativeRange.endOffset },
- native: nativeRange
- };
- [range.start, range.end].forEach(function (position) {
- var node = position.node,
- offset = position.offset;
- while (!(node instanceof Text) && node.childNodes.length > 0) {
- if (node.childNodes.length > offset) {
- node = node.childNodes[offset];
- offset = 0;
- } else if (node.childNodes.length === offset) {
- node = node.lastChild;
- offset = node instanceof Text ? node.data.length : node.childNodes.length + 1;
- } else {
- break;
- }
- }
- position.node = node, position.offset = offset;
- });
- return range;
- }
- }, {
- key: 'rangeToNative',
- value: function rangeToNative(range) {
- var _this5 = this;
-
- var indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length];
- var args = [];
- var scrollLength = this.scroll.length();
- indexes.forEach(function (index, i) {
- index = Math.min(scrollLength - 1, index);
- var node = void 0,
- _scroll$leaf5 = _this5.scroll.leaf(index),
- _scroll$leaf6 = _slicedToArray(_scroll$leaf5, 2),
- leaf = _scroll$leaf6[0],
- offset = _scroll$leaf6[1];
- var _leaf$position5 = leaf.position(offset, i !== 0);
-
- var _leaf$position6 = _slicedToArray(_leaf$position5, 2);
-
- node = _leaf$position6[0];
- offset = _leaf$position6[1];
-
- args.push(node, offset);
- });
- if (args.length < 2) {
- args = args.concat(args);
- }
- return args;
- }
- }, {
- key: 'scrollIntoView',
- value: function scrollIntoView(scrollingContainer) {
- var range = this.lastRange;
- if (range == null) return;
- var bounds = this.getBounds(range.index, range.length);
- if (bounds == null) return;
- var limit = this.scroll.length() - 1;
-
- var _scroll$line = this.scroll.line(Math.min(range.index, limit)),
- _scroll$line2 = _slicedToArray(_scroll$line, 1),
- first = _scroll$line2[0];
-
- var last = first;
- if (range.length > 0) {
- var _scroll$line3 = this.scroll.line(Math.min(range.index + range.length, limit));
-
- var _scroll$line4 = _slicedToArray(_scroll$line3, 1);
-
- last = _scroll$line4[0];
- }
- if (first == null || last == null) return;
- var scrollBounds = scrollingContainer.getBoundingClientRect();
- if (bounds.top < scrollBounds.top) {
- scrollingContainer.scrollTop -= scrollBounds.top - bounds.top;
- } else if (bounds.bottom > scrollBounds.bottom) {
- scrollingContainer.scrollTop += bounds.bottom - scrollBounds.bottom;
- }
- }
- }, {
- key: 'setNativeRange',
- value: function setNativeRange(startNode, startOffset) {
- var endNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : startNode;
- var endOffset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : startOffset;
- var force = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
-
- debug.info('setNativeRange', startNode, startOffset, endNode, endOffset);
- if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) {
- return;
- }
- var selection = document.getSelection();
- if (selection == null) return;
- if (startNode != null) {
- if (!this.hasFocus()) this.root.focus();
- var native = (this.getNativeRange() || {}).native;
- if (native == null || force || startNode !== native.startContainer || startOffset !== native.startOffset || endNode !== native.endContainer || endOffset !== native.endOffset) {
-
- if (startNode.tagName == "BR") {
- startOffset = [].indexOf.call(startNode.parentNode.childNodes, startNode);
- startNode = startNode.parentNode;
- }
- if (endNode.tagName == "BR") {
- endOffset = [].indexOf.call(endNode.parentNode.childNodes, endNode);
- endNode = endNode.parentNode;
- }
- var range = document.createRange();
- range.setStart(startNode, startOffset);
- range.setEnd(endNode, endOffset);
- selection.removeAllRanges();
- selection.addRange(range);
- }
- } else {
- selection.removeAllRanges();
- this.root.blur();
- document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs)
- }
- }
- }, {
- key: 'setRange',
- value: function setRange(range) {
- var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API;
-
- if (typeof force === 'string') {
- source = force;
- force = false;
- }
- debug.info('setRange', range);
- if (range != null) {
- var args = this.rangeToNative(range);
- this.setNativeRange.apply(this, _toConsumableArray(args).concat([force]));
- } else {
- this.setNativeRange(null);
- }
- this.update(source);
- }
- }, {
- key: 'update',
- value: function update() {
- var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER;
-
- var oldRange = this.lastRange;
-
- var _getRange = this.getRange(),
- _getRange2 = _slicedToArray(_getRange, 2),
- lastRange = _getRange2[0],
- nativeRange = _getRange2[1];
-
- this.lastRange = lastRange;
- if (this.lastRange != null) {
- this.savedRange = this.lastRange;
- }
- if (!(0, _deepEqual2.default)(oldRange, this.lastRange)) {
- var _emitter;
-
- if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) {
- this.cursor.restore();
- }
- var args = [_emitter4.default.events.SELECTION_CHANGE, (0, _clone2.default)(this.lastRange), (0, _clone2.default)(oldRange), source];
- (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));
- if (source !== _emitter4.default.sources.SILENT) {
- var _emitter2;
-
- (_emitter2 = this.emitter).emit.apply(_emitter2, args);
- }
- }
- }
- }]);
-
- return Selection;
- }();
-
- function contains(parent, descendant) {
- try {
- // Firefox inserts inaccessible nodes around video elements
- descendant.parentNode;
- } catch (e) {
- return false;
- }
- // IE11 has bug with Text nodes
- // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect
- if (descendant instanceof Text) {
- descendant = descendant.parentNode;
- }
- return parent.contains(descendant);
- }
-
- exports.Range = Range;
- exports.default = Selection;
-
- /***/
- }),
-/* 16 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var Break = function (_Parchment$Embed) {
- _inherits(Break, _Parchment$Embed);
-
- function Break() {
- _classCallCheck(this, Break);
-
- return _possibleConstructorReturn(this, (Break.__proto__ || Object.getPrototypeOf(Break)).apply(this, arguments));
- }
-
- _createClass(Break, [{
- key: 'insertInto',
- value: function insertInto(parent, ref) {
- if (parent.children.length === 0) {
- _get(Break.prototype.__proto__ || Object.getPrototypeOf(Break.prototype), 'insertInto', this).call(this, parent, ref);
- } else {
- this.remove();
- }
- }
- }, {
- key: 'length',
- value: function length() {
- return 0;
- }
- }, {
- key: 'value',
- value: function value() {
- return '';
- }
- }], [{
- key: 'value',
- value: function value() {
- return undefined;
- }
- }]);
-
- return Break;
- }(_parchment2.default.Embed);
-
- Break.blotName = 'break';
- Break.tagName = 'BR';
-
- exports.default = Break;
-
- /***/
- }),
-/* 17 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var linked_list_1 = __webpack_require__(50);
- var shadow_1 = __webpack_require__(32);
- var Registry = __webpack_require__(2);
- var ContainerBlot = /** @class */ (function (_super) {
- __extends(ContainerBlot, _super);
- function ContainerBlot(domNode) {
- var _this = _super.call(this, domNode) || this;
- _this.build();
- return _this;
- }
- ContainerBlot.prototype.appendChild = function (other) {
- this.insertBefore(other);
- };
- ContainerBlot.prototype.attach = function () {
- _super.prototype.attach.call(this);
- this.children.forEach(function (child) {
- child.attach();
- });
- };
- ContainerBlot.prototype.build = function () {
- var _this = this;
- this.children = new linked_list_1.default();
- // Need to be reversed for if DOM nodes already in order
- [].slice
- .call(this.domNode.childNodes)
- .reverse()
- .forEach(function (node) {
- try {
- var child = makeBlot(node);
- _this.insertBefore(child, _this.children.head || undefined);
- }
- catch (err) {
- if (err instanceof Registry.ParchmentError)
- return;
- else
- throw err;
- }
- });
- };
- ContainerBlot.prototype.deleteAt = function (index, length) {
- if (index === 0 && length === this.length()) {
- return this.remove();
- }
- this.children.forEachAt(index, length, function (child, offset, length) {
- child.deleteAt(offset, length);
- });
- };
- ContainerBlot.prototype.descendant = function (criteria, index) {
- var _a = this.children.find(index), child = _a[0], offset = _a[1];
- if ((criteria.blotName == null && criteria(child)) ||
- (criteria.blotName != null && child instanceof criteria)) {
- return [child, offset];
- }
- else if (child instanceof ContainerBlot) {
- return child.descendant(criteria, offset);
- }
- else {
- return [null, -1];
- }
- };
- ContainerBlot.prototype.descendants = function (criteria, index, length) {
- if (index === void 0) { index = 0; }
- if (length === void 0) { length = Number.MAX_VALUE; }
- var descendants = [];
- var lengthLeft = length;
- this.children.forEachAt(index, length, function (child, index, length) {
- if ((criteria.blotName == null && criteria(child)) ||
- (criteria.blotName != null && child instanceof criteria)) {
- descendants.push(child);
- }
- if (child instanceof ContainerBlot) {
- descendants = descendants.concat(child.descendants(criteria, index, lengthLeft));
- }
- lengthLeft -= length;
- });
- return descendants;
- };
- ContainerBlot.prototype.detach = function () {
- this.children.forEach(function (child) {
- child.detach();
- });
- _super.prototype.detach.call(this);
- };
- ContainerBlot.prototype.formatAt = function (index, length, name, value) {
- this.children.forEachAt(index, length, function (child, offset, length) {
- child.formatAt(offset, length, name, value);
- });
- };
- ContainerBlot.prototype.insertAt = function (index, value, def) {
- var _a = this.children.find(index), child = _a[0], offset = _a[1];
- if (child) {
- child.insertAt(offset, value, def);
- }
- else {
- var blot = def == null ? Registry.create('text', value) : Registry.create(value, def);
- this.appendChild(blot);
- }
- };
- ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) {
- if (this.statics.allowedChildren != null &&
- !this.statics.allowedChildren.some(function (child) {
- return childBlot instanceof child;
- })) {
- throw new Registry.ParchmentError("Cannot insert " + childBlot.statics.blotName + " into " + this.statics.blotName);
- }
- childBlot.insertInto(this, refBlot);
- };
- ContainerBlot.prototype.length = function () {
- return this.children.reduce(function (memo, child) {
- return memo + child.length();
- }, 0);
- };
- ContainerBlot.prototype.moveChildren = function (targetParent, refNode) {
- this.children.forEach(function (child) {
- targetParent.insertBefore(child, refNode);
- });
- };
- ContainerBlot.prototype.optimize = function (context) {
- _super.prototype.optimize.call(this, context);
- if (this.children.length === 0) {
- if (this.statics.defaultChild != null) {
- var child = Registry.create(this.statics.defaultChild);
- this.appendChild(child);
- child.optimize(context);
- }
- else {
- this.remove();
- }
- }
- };
- ContainerBlot.prototype.path = function (index, inclusive) {
- if (inclusive === void 0) { inclusive = false; }
- var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1];
- var position = [[this, index]];
- if (child instanceof ContainerBlot) {
- return position.concat(child.path(offset, inclusive));
- }
- else if (child != null) {
- position.push([child, offset]);
- }
- return position;
- };
- ContainerBlot.prototype.removeChild = function (child) {
- this.children.remove(child);
- };
- ContainerBlot.prototype.replace = function (target) {
- if (target instanceof ContainerBlot) {
- target.moveChildren(this);
- }
- _super.prototype.replace.call(this, target);
- };
- ContainerBlot.prototype.split = function (index, force) {
- if (force === void 0) { force = false; }
- if (!force) {
- if (index === 0)
- return this;
- if (index === this.length())
- return this.next;
- }
- var after = this.clone();
- this.parent.insertBefore(after, this.next);
- this.children.forEachAt(index, this.length(), function (child, offset, length) {
- child = child.split(offset, force);
- after.appendChild(child);
- });
- return after;
- };
- ContainerBlot.prototype.unwrap = function () {
- this.moveChildren(this.parent, this.next);
- this.remove();
- };
- ContainerBlot.prototype.update = function (mutations, context) {
- var _this = this;
- var addedNodes = [];
- var removedNodes = [];
- mutations.forEach(function (mutation) {
- if (mutation.target === _this.domNode && mutation.type === 'childList') {
- addedNodes.push.apply(addedNodes, mutation.addedNodes);
- removedNodes.push.apply(removedNodes, mutation.removedNodes);
- }
- });
- removedNodes.forEach(function (node) {
- // Check node has actually been removed
- // One exception is Chrome does not immediately remove IFRAMEs
- // from DOM but MutationRecord is correct in its reported removal
- if (node.parentNode != null &&
- // @ts-ignore
- node.tagName !== 'IFRAME' &&
- document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {
- return;
- }
- var blot = Registry.find(node);
- if (blot == null)
- return;
- if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) {
- blot.detach();
- }
- });
- addedNodes
- .filter(function (node) {
- return node.parentNode == _this.domNode;
- })
- .sort(function (a, b) {
- if (a === b)
- return 0;
- if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) {
- return 1;
- }
- return -1;
- })
- .forEach(function (node) {
- var refBlot = null;
- if (node.nextSibling != null) {
- refBlot = Registry.find(node.nextSibling);
- }
- var blot = makeBlot(node);
- if (blot.next != refBlot || blot.next == null) {
- if (blot.parent != null) {
- blot.parent.removeChild(_this);
- }
- _this.insertBefore(blot, refBlot || undefined);
- }
- });
- };
- return ContainerBlot;
- }(shadow_1.default));
- function makeBlot(node) {
- var blot = Registry.find(node);
- if (blot == null) {
- try {
- blot = Registry.create(node);
- }
- catch (e) {
- blot = Registry.create(Registry.Scope.INLINE);
- [].slice.call(node.childNodes).forEach(function (child) {
- // @ts-ignore
- blot.domNode.appendChild(child);
- });
- if (node.parentNode) {
- node.parentNode.replaceChild(blot.domNode, node);
- }
- blot.attach();
- }
- }
- return blot;
- }
- exports.default = ContainerBlot;
-
-
- /***/
- }),
-/* 18 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var attributor_1 = __webpack_require__(12);
- var store_1 = __webpack_require__(33);
- var container_1 = __webpack_require__(17);
- var Registry = __webpack_require__(2);
- var FormatBlot = /** @class */ (function (_super) {
- __extends(FormatBlot, _super);
- function FormatBlot(domNode) {
- var _this = _super.call(this, domNode) || this;
- _this.attributes = new store_1.default(_this.domNode);
- return _this;
- }
- FormatBlot.formats = function (domNode) {
- if (typeof this.tagName === 'string') {
- return true;
- }
- else if (Array.isArray(this.tagName)) {
- return domNode.tagName.toLowerCase();
- }
- return undefined;
- };
- FormatBlot.prototype.format = function (name, value) {
- var format = Registry.query(name);
- if (format instanceof attributor_1.default) {
- this.attributes.attribute(format, value);
- }
- else if (value) {
- if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) {
- this.replaceWith(name, value);
- }
- }
- };
- FormatBlot.prototype.formats = function () {
- var formats = this.attributes.values();
- var format = this.statics.formats(this.domNode);
- if (format != null) {
- formats[this.statics.blotName] = format;
- }
- return formats;
- };
- FormatBlot.prototype.replaceWith = function (name, value) {
- var replacement = _super.prototype.replaceWith.call(this, name, value);
- this.attributes.copy(replacement);
- return replacement;
- };
- FormatBlot.prototype.update = function (mutations, context) {
- var _this = this;
- _super.prototype.update.call(this, mutations, context);
- if (mutations.some(function (mutation) {
- return mutation.target === _this.domNode && mutation.type === 'attributes';
- })) {
- this.attributes.build();
- }
- };
- FormatBlot.prototype.wrap = function (name, value) {
- var wrapper = _super.prototype.wrap.call(this, name, value);
- if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) {
- this.attributes.move(wrapper);
- }
- return wrapper;
- };
- return FormatBlot;
- }(container_1.default));
- exports.default = FormatBlot;
-
-
- /***/
- }),
-/* 19 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var shadow_1 = __webpack_require__(32);
- var Registry = __webpack_require__(2);
- var LeafBlot = /** @class */ (function (_super) {
- __extends(LeafBlot, _super);
- function LeafBlot() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- LeafBlot.value = function (domNode) {
- return true;
- };
- LeafBlot.prototype.index = function (node, offset) {
- if (this.domNode === node ||
- this.domNode.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {
- return Math.min(offset, 1);
- }
- return -1;
- };
- LeafBlot.prototype.position = function (index, inclusive) {
- var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode);
- if (index > 0)
- offset += 1;
- return [this.parent.domNode, offset];
- };
- LeafBlot.prototype.value = function () {
- var _a;
- return _a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a;
- };
- LeafBlot.scope = Registry.Scope.INLINE_BLOT;
- return LeafBlot;
- }(shadow_1.default));
- exports.default = LeafBlot;
-
-
- /***/
- }),
-/* 20 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var implementation = __webpack_require__(63);
-
- module.exports = Function.prototype.bind || implementation;
-
-
- /***/
- }),
-/* 21 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var keys = __webpack_require__(36);
- var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
-
- var toStr = Object.prototype.toString;
- var concat = Array.prototype.concat;
- var origDefineProperty = Object.defineProperty;
-
- var isFunction = function (fn) {
- return typeof fn === 'function' && toStr.call(fn) === '[object Function]';
- };
-
- var arePropertyDescriptorsSupported = function () {
- var obj = {};
- try {
- origDefineProperty(obj, 'x', { enumerable: false, value: obj });
- // eslint-disable-next-line no-unused-vars, no-restricted-syntax
- for (var _ in obj) { // jscs:ignore disallowUnusedVariables
- return false;
- }
- return obj.x === obj;
- } catch (e) { /* this is IE 8. */
- return false;
- }
- };
- var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();
-
- var defineProperty = function (object, name, value, predicate) {
- if (name in object && (!isFunction(predicate) || !predicate())) {
- return;
- }
- if (supportsDescriptors) {
- origDefineProperty(object, name, {
- configurable: true,
- enumerable: false,
- value: value,
- writable: true
- });
- } else {
- object[name] = value;
- }
- };
-
- var defineProperties = function (object, map) {
- var predicates = arguments.length > 2 ? arguments[2] : {};
- var props = keys(map);
- if (hasSymbols) {
- props = concat.call(props, Object.getOwnPropertySymbols(map));
- }
- for (var i = 0; i < props.length; i += 1) {
- defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
- }
- };
-
- defineProperties.supportsDescriptors = !!supportsDescriptors;
-
- module.exports = defineProperties;
-
-
- /***/
- }),
-/* 22 */
-/***/ (function (module, exports, __webpack_require__) {
-
- var equal = __webpack_require__(11);
- var extend = __webpack_require__(3);
-
-
- var lib = {
- attributes: {
- compose: function (a, b, keepNull) {
- if (typeof a !== 'object') a = {};
- if (typeof b !== 'object') b = {};
- var attributes = extend(true, {}, b);
- if (!keepNull) {
- attributes = Object.keys(attributes).reduce(function (copy, key) {
- if (attributes[key] != null) {
- copy[key] = attributes[key];
- }
- return copy;
- }, {});
- }
- for (var key in a) {
- if (a[key] !== undefined && b[key] === undefined) {
- attributes[key] = a[key];
- }
- }
- return Object.keys(attributes).length > 0 ? attributes : undefined;
- },
-
- diff: function (a, b) {
- if (typeof a !== 'object') a = {};
- if (typeof b !== 'object') b = {};
- var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) {
- if (!equal(a[key], b[key])) {
- attributes[key] = b[key] === undefined ? null : b[key];
- }
- return attributes;
- }, {});
- return Object.keys(attributes).length > 0 ? attributes : undefined;
- },
-
- transform: function (a, b, priority) {
- if (typeof a !== 'object') return b;
- if (typeof b !== 'object') return undefined;
- if (!priority) return b; // b simply overwrites us without priority
- var attributes = Object.keys(b).reduce(function (attributes, key) {
- if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value
- return attributes;
- }, {});
- return Object.keys(attributes).length > 0 ? attributes : undefined;
- }
- },
-
- iterator: function (ops) {
- return new Iterator(ops);
- },
-
- length: function (op) {
- if (typeof op['delete'] === 'number') {
- return op['delete'];
- } else if (typeof op.retain === 'number') {
- return op.retain;
- } else {
- return typeof op.insert === 'string' ? op.insert.length : 1;
- }
- }
- };
-
-
- function Iterator(ops) {
- this.ops = ops;
- this.index = 0;
- this.offset = 0;
- };
-
- Iterator.prototype.hasNext = function () {
- return this.peekLength() < Infinity;
- };
-
- Iterator.prototype.next = function (length) {
- if (!length) length = Infinity;
- var nextOp = this.ops[this.index];
- if (nextOp) {
- var offset = this.offset;
- var opLength = lib.length(nextOp)
- if (length >= opLength - offset) {
- length = opLength - offset;
- this.index += 1;
- this.offset = 0;
- } else {
- this.offset += length;
- }
- if (typeof nextOp['delete'] === 'number') {
- return { 'delete': length };
- } else {
- var retOp = {};
- if (nextOp.attributes) {
- retOp.attributes = nextOp.attributes;
- }
- if (typeof nextOp.retain === 'number') {
- retOp.retain = length;
- } else if (typeof nextOp.insert === 'string') {
- retOp.insert = nextOp.insert.substr(offset, length);
- } else {
- // offset should === 0, length should === 1
- retOp.insert = nextOp.insert;
- }
- return retOp;
- }
- } else {
- return { retain: Infinity };
- }
- };
-
- Iterator.prototype.peek = function () {
- return this.ops[this.index];
- };
-
- Iterator.prototype.peekLength = function () {
- if (this.ops[this.index]) {
- // Should never return 0 if our index is being managed correctly
- return lib.length(this.ops[this.index]) - this.offset;
- } else {
- return Infinity;
- }
- };
-
- Iterator.prototype.peekType = function () {
- if (this.ops[this.index]) {
- if (typeof this.ops[this.index]['delete'] === 'number') {
- return 'delete';
- } else if (typeof this.ops[this.index].retain === 'number') {
- return 'retain';
- } else {
- return 'insert';
- }
- }
- return 'retain';
- };
-
- Iterator.prototype.rest = function () {
- if (!this.hasNext()) {
- return [];
- } else if (this.offset === 0) {
- return this.ops.slice(this.index);
- } else {
- var offset = this.offset;
- var index = this.index;
- var next = this.next();
- var rest = this.ops.slice(this.index);
- this.offset = offset;
- this.index = index;
- return [next].concat(rest);
- }
- };
-
-
- module.exports = lib;
-
-
- /***/
- }),
-/* 23 */
-/***/ (function (module, exports) {
-
- var clone = (function () {
- 'use strict';
-
- function _instanceof(obj, type) {
- return type != null && obj instanceof type;
- }
-
- var nativeMap;
- try {
- nativeMap = Map;
- } catch (_) {
- // maybe a reference error because no `Map`. Give it a dummy value that no
- // value will ever be an instanceof.
- nativeMap = function () { };
- }
-
- var nativeSet;
- try {
- nativeSet = Set;
- } catch (_) {
- nativeSet = function () { };
- }
-
- var nativePromise;
- try {
- nativePromise = Promise;
- } catch (_) {
- nativePromise = function () { };
- }
-
- /**
- * Clones (copies) an Object using deep copying.
- *
- * This function supports circular references by default, but if you are certain
- * there are no circular references in your object, you can save some CPU time
- * by calling clone(obj, false).
- *
- * Caution: if `circular` is false and `parent` contains circular references,
- * your program may enter an infinite loop and crash.
- *
- * @param `parent` - the object to be cloned
- * @param `circular` - set to true if the object to be cloned may contain
- * circular references. (optional - true by default)
- * @param `depth` - set to a number if the object is only to be cloned to
- * a particular depth. (optional - defaults to Infinity)
- * @param `prototype` - sets the prototype to be used when cloning an object.
- * (optional - defaults to parent prototype).
- * @param `includeNonEnumerable` - set to true if the non-enumerable properties
- * should be cloned as well. Non-enumerable properties on the prototype
- * chain will be ignored. (optional - false by default)
- */
- function clone(parent, circular, depth, prototype, includeNonEnumerable) {
- if (typeof circular === 'object') {
- depth = circular.depth;
- prototype = circular.prototype;
- includeNonEnumerable = circular.includeNonEnumerable;
- circular = circular.circular;
- }
- // maintain two arrays for circular references, where corresponding parents
- // and children have the same index
- var allParents = [];
- var allChildren = [];
-
- var useBuffer = typeof Buffer != 'undefined';
-
- if (typeof circular == 'undefined')
- circular = true;
-
- if (typeof depth == 'undefined')
- depth = Infinity;
-
- // recurse this function so we don't reset allParents and allChildren
- function _clone(parent, depth) {
- // cloning null always returns null
- if (parent === null)
- return null;
-
- if (depth === 0)
- return parent;
-
- var child;
- var proto;
- if (typeof parent != 'object') {
- return parent;
- }
-
- if (_instanceof(parent, nativeMap)) {
- child = new nativeMap();
- } else if (_instanceof(parent, nativeSet)) {
- child = new nativeSet();
- } else if (_instanceof(parent, nativePromise)) {
- child = new nativePromise(function (resolve, reject) {
- parent.then(function (value) {
- resolve(_clone(value, depth - 1));
- }, function (err) {
- reject(_clone(err, depth - 1));
- });
- });
- } else if (clone.__isArray(parent)) {
- child = [];
- } else if (clone.__isRegExp(parent)) {
- child = new RegExp(parent.source, __getRegExpFlags(parent));
- if (parent.lastIndex) child.lastIndex = parent.lastIndex;
- } else if (clone.__isDate(parent)) {
- child = new Date(parent.getTime());
- } else if (useBuffer && Buffer.isBuffer(parent)) {
- if (Buffer.allocUnsafe) {
- // Node.js >= 4.5.0
- child = Buffer.allocUnsafe(parent.length);
- } else {
- // Older Node.js versions
- child = new Buffer(parent.length);
- }
- parent.copy(child);
- return child;
- } else if (_instanceof(parent, Error)) {
- child = Object.create(parent);
- } else {
- if (typeof prototype == 'undefined') {
- proto = Object.getPrototypeOf(parent);
- child = Object.create(proto);
- }
- else {
- child = Object.create(prototype);
- proto = prototype;
- }
- }
-
- if (circular) {
- var index = allParents.indexOf(parent);
-
- if (index != -1) {
- return allChildren[index];
- }
- allParents.push(parent);
- allChildren.push(child);
- }
-
- if (_instanceof(parent, nativeMap)) {
- parent.forEach(function (value, key) {
- var keyChild = _clone(key, depth - 1);
- var valueChild = _clone(value, depth - 1);
- child.set(keyChild, valueChild);
- });
- }
- if (_instanceof(parent, nativeSet)) {
- parent.forEach(function (value) {
- var entryChild = _clone(value, depth - 1);
- child.add(entryChild);
- });
- }
-
- for (var i in parent) {
- var attrs;
- if (proto) {
- attrs = Object.getOwnPropertyDescriptor(proto, i);
- }
-
- if (attrs && attrs.set == null) {
- continue;
- }
- child[i] = _clone(parent[i], depth - 1);
- }
-
- if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(parent);
- for (var i = 0; i < symbols.length; i++) {
- // Don't need to worry about cloning a symbol because it is a primitive,
- // like a number or string.
- var symbol = symbols[i];
- var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);
- if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {
- continue;
- }
- child[symbol] = _clone(parent[symbol], depth - 1);
- if (!descriptor.enumerable) {
- Object.defineProperty(child, symbol, {
- enumerable: false
- });
- }
- }
- }
-
- if (includeNonEnumerable) {
- var allPropertyNames = Object.getOwnPropertyNames(parent);
- for (var i = 0; i < allPropertyNames.length; i++) {
- var propertyName = allPropertyNames[i];
- var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);
- if (descriptor && descriptor.enumerable) {
- continue;
- }
- child[propertyName] = _clone(parent[propertyName], depth - 1);
- Object.defineProperty(child, propertyName, {
- enumerable: false
- });
- }
- }
-
- return child;
- }
-
- return _clone(parent, depth);
- }
-
- /**
- * Simple flat clone using prototype, accepts only objects, usefull for property
- * override on FLAT configuration object (no nested props).
- *
- * USE WITH CAUTION! This may not behave as you wish if you do not know how this
- * works.
- */
- clone.clonePrototype = function clonePrototype(parent) {
- if (parent === null)
- return null;
-
- var c = function () { };
- c.prototype = parent;
- return new c();
- };
-
- // private utility functions
-
- function __objToStr(o) {
- return Object.prototype.toString.call(o);
- }
- clone.__objToStr = __objToStr;
-
- function __isDate(o) {
- return typeof o === 'object' && __objToStr(o) === '[object Date]';
- }
- clone.__isDate = __isDate;
-
- function __isArray(o) {
- return typeof o === 'object' && __objToStr(o) === '[object Array]';
- }
- clone.__isArray = __isArray;
-
- function __isRegExp(o) {
- return typeof o === 'object' && __objToStr(o) === '[object RegExp]';
- }
- clone.__isRegExp = __isRegExp;
-
- function __getRegExpFlags(re) {
- var flags = '';
- if (re.global) flags += 'g';
- if (re.ignoreCase) flags += 'i';
- if (re.multiline) flags += 'm';
- return flags;
- }
- clone.__getRegExpFlags = __getRegExpFlags;
-
- return clone;
- })();
-
- if (typeof module === 'object' && module.exports) {
- module.exports = clone;
- }
-
-
- /***/
- }),
-/* 24 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _emitter = __webpack_require__(8);
-
- var _emitter2 = _interopRequireDefault(_emitter);
-
- var _block = __webpack_require__(4);
-
- var _block2 = _interopRequireDefault(_block);
-
- var _break = __webpack_require__(16);
-
- var _break2 = _interopRequireDefault(_break);
-
- var _code = __webpack_require__(13);
-
- var _code2 = _interopRequireDefault(_code);
-
- var _container = __webpack_require__(27);
-
- var _container2 = _interopRequireDefault(_container);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- function isLine(blot) {
- return blot instanceof _block2.default || blot instanceof _block.BlockEmbed;
- }
-
- var Scroll = function (_Parchment$Scroll) {
- _inherits(Scroll, _Parchment$Scroll);
-
- function Scroll(domNode, config) {
- _classCallCheck(this, Scroll);
-
- var _this = _possibleConstructorReturn(this, (Scroll.__proto__ || Object.getPrototypeOf(Scroll)).call(this, domNode));
-
- _this.emitter = config.emitter;
- if (Array.isArray(config.whitelist)) {
- _this.whitelist = config.whitelist.reduce(function (whitelist, format) {
- whitelist[format] = true;
- return whitelist;
- }, {});
- }
- // Some reason fixes composition issues with character languages in Windows/Chrome, Safari
- _this.domNode.addEventListener('DOMNodeInserted', function () { });
- _this.optimize();
- _this.enable();
- return _this;
- }
-
- _createClass(Scroll, [{
- key: 'batchStart',
- value: function batchStart() {
- this.batch = true;
- }
- }, {
- key: 'batchEnd',
- value: function batchEnd() {
- this.batch = false;
- this.optimize();
- }
- }, {
- key: 'deleteAt',
- value: function deleteAt(index, length) {
- var _line = this.line(index),
- _line2 = _slicedToArray(_line, 2),
- first = _line2[0],
- offset = _line2[1];
-
- var _line3 = this.line(index + length),
- _line4 = _slicedToArray(_line3, 1),
- last = _line4[0];
-
- _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'deleteAt', this).call(this, index, length);
- if (last != null && first !== last && offset > 0) {
- if (first instanceof _block.BlockEmbed || last instanceof _block.BlockEmbed) {
- this.optimize();
- return;
- }
- if (first instanceof _code2.default) {
- var newlineIndex = first.newlineIndex(first.length(), true);
- if (newlineIndex > -1) {
- first = first.split(newlineIndex + 1);
- if (first === last) {
- this.optimize();
- return;
- }
- }
- } else if (last instanceof _code2.default) {
- var _newlineIndex = last.newlineIndex(0);
- if (_newlineIndex > -1) {
- last.split(_newlineIndex + 1);
- }
- }
- var ref = last.children.head instanceof _break2.default ? null : last.children.head;
- first.moveChildren(last, ref);
- first.remove();
- }
- this.optimize();
- }
- }, {
- key: 'enable',
- value: function enable() {
- var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
-
- this.domNode.setAttribute('contenteditable', enabled);
- }
- }, {
- key: 'formatAt',
- value: function formatAt(index, length, format, value) {
- if (this.whitelist != null && !this.whitelist[format]) return;
- _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'formatAt', this).call(this, index, length, format, value);
- this.optimize();
- }
- }, {
- key: 'insertAt',
- value: function insertAt(index, value, def) {
- if (def != null && this.whitelist != null && !this.whitelist[value]) return;
- if (index >= this.length()) {
- if (def == null || _parchment2.default.query(value, _parchment2.default.Scope.BLOCK) == null) {
- var blot = _parchment2.default.create(this.statics.defaultChild);
- this.appendChild(blot);
- if (def == null && value.endsWith('\n')) {
- value = value.slice(0, -1);
- }
- blot.insertAt(0, value, def);
- } else {
- var embed = _parchment2.default.create(value, def);
- this.appendChild(embed);
- }
- } else {
- _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertAt', this).call(this, index, value, def);
- }
- this.optimize();
- }
- }, {
- key: 'insertBefore',
- value: function insertBefore(blot, ref) {
- if (blot.statics.scope === _parchment2.default.Scope.INLINE_BLOT) {
- var wrapper = _parchment2.default.create(this.statics.defaultChild);
- wrapper.appendChild(blot);
- blot = wrapper;
- }
- _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertBefore', this).call(this, blot, ref);
- }
- }, {
- key: 'leaf',
- value: function leaf(index) {
- return this.path(index).pop() || [null, -1];
- }
- }, {
- key: 'line',
- value: function line(index) {
- if (index === this.length()) {
- return this.line(index - 1);
- }
- return this.descendant(isLine, index);
- }
- }, {
- key: 'lines',
- value: function lines() {
- var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
- var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE;
-
- var getLines = function getLines(blot, index, length) {
- var lines = [],
- lengthLeft = length;
- blot.children.forEachAt(index, length, function (child, index, length) {
- if (isLine(child)) {
- lines.push(child);
- } else if (child instanceof _parchment2.default.Container) {
- lines = lines.concat(getLines(child, index, lengthLeft));
- }
- lengthLeft -= length;
- });
- return lines;
- };
- return getLines(this, index, length);
- }
- }, {
- key: 'optimize',
- value: function optimize() {
- var mutations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
- var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
-
- if (this.batch === true) return;
- _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'optimize', this).call(this, mutations, context);
- if (mutations.length > 0) {
- this.emitter.emit(_emitter2.default.events.SCROLL_OPTIMIZE, mutations, context);
- }
- }
- }, {
- key: 'path',
- value: function path(index) {
- return _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'path', this).call(this, index).slice(1); // Exclude self
- }
- }, {
- key: 'update',
- value: function update(mutations) {
- if (this.batch === true) return;
- var source = _emitter2.default.sources.USER;
- if (typeof mutations === 'string') {
- source = mutations;
- }
- if (!Array.isArray(mutations)) {
- mutations = this.observer.takeRecords();
- }
- if (mutations.length > 0) {
- this.emitter.emit(_emitter2.default.events.SCROLL_BEFORE_UPDATE, source, mutations);
- }
- _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'update', this).call(this, mutations.concat([])); // pass copy
- if (mutations.length > 0) {
- this.emitter.emit(_emitter2.default.events.SCROLL_UPDATE, source, mutations);
- }
- }
- }]);
-
- return Scroll;
- }(_parchment2.default.Scroll);
-
- Scroll.blotName = 'scroll';
- Scroll.className = 'ql-editor';
- Scroll.tagName = 'DIV';
- Scroll.defaultChild = 'block';
- Scroll.allowedChildren = [_block2.default, _block.BlockEmbed, _container2.default];
-
- exports.default = Scroll;
-
- /***/
- }),
-/* 25 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.SHORTKEY = exports.default = undefined;
-
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
-
- var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _clone = __webpack_require__(23);
-
- var _clone2 = _interopRequireDefault(_clone);
-
- var _deepEqual = __webpack_require__(11);
-
- var _deepEqual2 = _interopRequireDefault(_deepEqual);
-
- var _extend = __webpack_require__(3);
-
- var _extend2 = _interopRequireDefault(_extend);
-
- var _quillDelta = __webpack_require__(1);
-
- var _quillDelta2 = _interopRequireDefault(_quillDelta);
-
- var _op = __webpack_require__(22);
-
- var _op2 = _interopRequireDefault(_op);
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _quill = __webpack_require__(5);
-
- var _quill2 = _interopRequireDefault(_quill);
-
- var _logger = __webpack_require__(10);
-
- var _logger2 = _interopRequireDefault(_logger);
-
- var _module = __webpack_require__(9);
-
- var _module2 = _interopRequireDefault(_module);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var debug = (0, _logger2.default)('quill:keyboard');
-
- var SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey';
-
- var Keyboard = function (_Module) {
- _inherits(Keyboard, _Module);
-
- _createClass(Keyboard, null, [{
- key: 'match',
- value: function match(evt, binding) {
- binding = normalize(binding);
- if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function (key) {
- return !!binding[key] !== evt[key] && binding[key] !== null;
- })) {
- return false;
- }
- return binding.key === (evt.which || evt.keyCode);
- }
- }]);
-
- function Keyboard(quill, options) {
- _classCallCheck(this, Keyboard);
-
- var _this = _possibleConstructorReturn(this, (Keyboard.__proto__ || Object.getPrototypeOf(Keyboard)).call(this, quill, options));
-
- _this.bindings = {};
- Object.keys(_this.options.bindings).forEach(function (name) {
- if (name === 'list autofill' && quill.scroll.whitelist != null && !quill.scroll.whitelist['list']) {
- return;
- }
- if (_this.options.bindings[name]) {
- _this.addBinding(_this.options.bindings[name]);
- }
- });
- _this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter);
- _this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function () { });
- if (/Firefox/i.test(navigator.userAgent)) {
- // Need to handle delete and backspace for Firefox in the general case #1171
- _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true }, handleBackspace);
- _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true }, handleDelete);
- } else {
- _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace);
- _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^.?$/ }, handleDelete);
- }
- _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange);
- _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange);
- _this.addBinding({ key: Keyboard.keys.BACKSPACE, altKey: null, ctrlKey: null, metaKey: null, shiftKey: null }, { collapsed: true, offset: 0 }, handleBackspace);
- _this.listen();
- return _this;
- }
-
- _createClass(Keyboard, [{
- key: 'addBinding',
- value: function addBinding(key) {
- var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
-
- var binding = normalize(key);
- if (binding == null || binding.key == null) {
- return debug.warn('Attempted to add invalid keyboard binding', binding);
- }
- if (typeof context === 'function') {
- context = { handler: context };
- }
- if (typeof handler === 'function') {
- handler = { handler: handler };
- }
- binding = (0, _extend2.default)(binding, context, handler);
- this.bindings[binding.key] = this.bindings[binding.key] || [];
- this.bindings[binding.key].push(binding);
- }
- }, {
- key: 'listen',
- value: function listen() {
- var _this2 = this;
-
- this.quill.root.addEventListener('keydown', function (evt) {
- if (evt.defaultPrevented) return;
- var which = evt.which || evt.keyCode;
- var bindings = (_this2.bindings[which] || []).filter(function (binding) {
- return Keyboard.match(evt, binding);
- });
- if (bindings.length === 0) return;
- var range = _this2.quill.getSelection();
- if (range == null || !_this2.quill.hasFocus()) return;
-
- var _quill$getLine = _this2.quill.getLine(range.index),
- _quill$getLine2 = _slicedToArray(_quill$getLine, 2),
- line = _quill$getLine2[0],
- offset = _quill$getLine2[1];
-
- var _quill$getLeaf = _this2.quill.getLeaf(range.index),
- _quill$getLeaf2 = _slicedToArray(_quill$getLeaf, 2),
- leafStart = _quill$getLeaf2[0],
- offsetStart = _quill$getLeaf2[1];
-
- var _ref = range.length === 0 ? [leafStart, offsetStart] : _this2.quill.getLeaf(range.index + range.length),
- _ref2 = _slicedToArray(_ref, 2),
- leafEnd = _ref2[0],
- offsetEnd = _ref2[1];
-
- var prefixText = leafStart instanceof _parchment2.default.Text ? leafStart.value().slice(0, offsetStart) : '';
- var suffixText = leafEnd instanceof _parchment2.default.Text ? leafEnd.value().slice(offsetEnd) : '';
- var curContext = {
- collapsed: range.length === 0,
- empty: range.length === 0 && line.length() <= 1,
- format: _this2.quill.getFormat(range),
- offset: offset,
- prefix: prefixText,
- suffix: suffixText
- };
- var prevented = bindings.some(function (binding) {
- if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false;
- if (binding.empty != null && binding.empty !== curContext.empty) return false;
- if (binding.offset != null && binding.offset !== curContext.offset) return false;
- if (Array.isArray(binding.format)) {
- // any format is present
- if (binding.format.every(function (name) {
- return curContext.format[name] == null;
- })) {
- return false;
- }
- } else if (_typeof(binding.format) === 'object') {
- // all formats must match
- if (!Object.keys(binding.format).every(function (name) {
- if (binding.format[name] === true) return curContext.format[name] != null;
- if (binding.format[name] === false) return curContext.format[name] == null;
- return (0, _deepEqual2.default)(binding.format[name], curContext.format[name]);
- })) {
- return false;
- }
- }
- if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false;
- if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false;
- return binding.handler.call(_this2, range, curContext) !== true;
- });
- if (prevented) {
- evt.preventDefault();
- }
- });
- }
- }]);
-
- return Keyboard;
- }(_module2.default);
-
- Keyboard.keys = {
- BACKSPACE: 8,
- TAB: 9,
- ENTER: 13,
- ESCAPE: 27,
- LEFT: 37,
- UP: 38,
- RIGHT: 39,
- DOWN: 40,
- DELETE: 46
- };
-
- Keyboard.DEFAULTS = {
- bindings: {
- 'bold': makeFormatHandler('bold'),
- 'italic': makeFormatHandler('italic'),
- 'underline': makeFormatHandler('underline'),
- 'indent': {
- // highlight tab or tab at beginning of list, indent or blockquote
- key: Keyboard.keys.TAB,
- format: ['blockquote', 'indent', 'list'],
- handler: function handler(range, context) {
- if (context.collapsed && context.offset !== 0) return true;
- this.quill.format('indent', '+1', _quill2.default.sources.USER);
- }
- },
- 'outdent': {
- key: Keyboard.keys.TAB,
- shiftKey: true,
- format: ['blockquote', 'indent', 'list'],
- // highlight tab or tab at beginning of list, indent or blockquote
- handler: function handler(range, context) {
- if (context.collapsed && context.offset !== 0) return true;
- this.quill.format('indent', '-1', _quill2.default.sources.USER);
- }
- },
- 'outdent backspace': {
- key: Keyboard.keys.BACKSPACE,
- collapsed: true,
- shiftKey: null,
- metaKey: null,
- ctrlKey: null,
- altKey: null,
- format: ['indent', 'list'],
- offset: 0,
- handler: function handler(range, context) {
- if (context.format.indent != null) {
- this.quill.format('indent', '-1', _quill2.default.sources.USER);
- } else if (context.format.list != null) {
- this.quill.format('list', false, _quill2.default.sources.USER);
- }
- }
- },
- 'indent code-block': makeCodeBlockHandler(true),
- 'outdent code-block': makeCodeBlockHandler(false),
- 'remove tab': {
- key: Keyboard.keys.TAB,
- shiftKey: true,
- collapsed: true,
- prefix: /\t$/,
- handler: function handler(range) {
- this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER);
- }
- },
- 'tab': {
- key: Keyboard.keys.TAB,
- handler: function handler(range) {
- this.quill.history.cutoff();
- var delta = new _quillDelta2.default().retain(range.index).delete(range.length).insert('\t');
- this.quill.updateContents(delta, _quill2.default.sources.USER);
- this.quill.history.cutoff();
- this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);
- }
- },
- 'list empty enter': {
- key: Keyboard.keys.ENTER,
- collapsed: true,
- format: ['list'],
- empty: true,
- handler: function handler(range, context) {
- this.quill.format('list', false, _quill2.default.sources.USER);
- if (context.format.indent) {
- this.quill.format('indent', false, _quill2.default.sources.USER);
- }
- }
- },
- 'checklist enter': {
- key: Keyboard.keys.ENTER,
- collapsed: true,
- format: { list: 'checked' },
- handler: function handler(range) {
- var _quill$getLine3 = this.quill.getLine(range.index),
- _quill$getLine4 = _slicedToArray(_quill$getLine3, 2),
- line = _quill$getLine4[0],
- offset = _quill$getLine4[1];
-
- var formats = (0, _extend2.default)({}, line.formats(), { list: 'checked' });
- var delta = new _quillDelta2.default().retain(range.index).insert('\n', formats).retain(line.length() - offset - 1).retain(1, { list: 'unchecked' });
- this.quill.updateContents(delta, _quill2.default.sources.USER);
- this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);
- this.quill.scrollIntoView();
- }
- },
- 'header enter': {
- key: Keyboard.keys.ENTER,
- collapsed: true,
- format: ['header'],
- suffix: /^$/,
- handler: function handler(range, context) {
- var _quill$getLine5 = this.quill.getLine(range.index),
- _quill$getLine6 = _slicedToArray(_quill$getLine5, 2),
- line = _quill$getLine6[0],
- offset = _quill$getLine6[1];
-
- var delta = new _quillDelta2.default().retain(range.index).insert('\n', context.format).retain(line.length() - offset - 1).retain(1, { header: null });
- this.quill.updateContents(delta, _quill2.default.sources.USER);
- this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);
- this.quill.scrollIntoView();
- }
- },
- 'list autofill': {
- key: ' ',
- collapsed: true,
- format: { list: false },
- prefix: /^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,
- handler: function handler(range, context) {
- var length = context.prefix.length;
-
- var _quill$getLine7 = this.quill.getLine(range.index),
- _quill$getLine8 = _slicedToArray(_quill$getLine7, 2),
- line = _quill$getLine8[0],
- offset = _quill$getLine8[1];
-
- if (offset > length) return true;
- var value = void 0;
- switch (context.prefix.trim()) {
- case '[]': case '[ ]':
- value = 'unchecked';
- break;
- case '[x]':
- value = 'checked';
- break;
- case '-': case '*':
- value = 'bullet';
- break;
- default:
- value = 'ordered';
- }
- this.quill.insertText(range.index, ' ', _quill2.default.sources.USER);
- this.quill.history.cutoff();
- var delta = new _quillDelta2.default().retain(range.index - offset).delete(length + 1).retain(line.length() - 2 - offset).retain(1, { list: value });
- this.quill.updateContents(delta, _quill2.default.sources.USER);
- this.quill.history.cutoff();
- this.quill.setSelection(range.index - length, _quill2.default.sources.SILENT);
- }
- },
- 'code exit': {
- key: Keyboard.keys.ENTER,
- collapsed: true,
- format: ['code-block'],
- prefix: /\n\n$/,
- suffix: /^\s+$/,
- handler: function handler(range) {
- var _quill$getLine9 = this.quill.getLine(range.index),
- _quill$getLine10 = _slicedToArray(_quill$getLine9, 2),
- line = _quill$getLine10[0],
- offset = _quill$getLine10[1];
-
- var delta = new _quillDelta2.default().retain(range.index + line.length() - offset - 2).retain(1, { 'code-block': null }).delete(1);
- this.quill.updateContents(delta, _quill2.default.sources.USER);
- }
- },
- 'embed left': makeEmbedArrowHandler(Keyboard.keys.LEFT, false),
- 'embed left shift': makeEmbedArrowHandler(Keyboard.keys.LEFT, true),
- 'embed right': makeEmbedArrowHandler(Keyboard.keys.RIGHT, false),
- 'embed right shift': makeEmbedArrowHandler(Keyboard.keys.RIGHT, true)
- }
- };
-
- function makeEmbedArrowHandler(key, shiftKey) {
- var _ref3;
-
- var where = key === Keyboard.keys.LEFT ? 'prefix' : 'suffix';
- return _ref3 = {
- key: key,
- shiftKey: shiftKey,
- altKey: null
- }, _defineProperty(_ref3, where, /^$/), _defineProperty(_ref3, 'handler', function handler(range) {
- var index = range.index;
- if (key === Keyboard.keys.RIGHT) {
- index += range.length + 1;
- }
-
- var _quill$getLeaf3 = this.quill.getLeaf(index),
- _quill$getLeaf4 = _slicedToArray(_quill$getLeaf3, 1),
- leaf = _quill$getLeaf4[0];
-
- if (!(leaf instanceof _parchment2.default.Embed)) return true;
- if (key === Keyboard.keys.LEFT) {
- if (shiftKey) {
- this.quill.setSelection(range.index - 1, range.length + 1, _quill2.default.sources.USER);
- } else {
- this.quill.setSelection(range.index - 1, _quill2.default.sources.USER);
- }
- } else {
- if (shiftKey) {
- this.quill.setSelection(range.index, range.length + 1, _quill2.default.sources.USER);
- } else {
- this.quill.setSelection(range.index + range.length + 1, _quill2.default.sources.USER);
- }
- }
- return false;
- }), _ref3;
- }
-
- function handleBackspace(range, context) {
- if (range.index === 0 || this.quill.getLength() <= 1) return;
-
- var _quill$getLine11 = this.quill.getLine(range.index),
- _quill$getLine12 = _slicedToArray(_quill$getLine11, 1),
- line = _quill$getLine12[0];
-
- var formats = {};
- if (context.offset === 0) {
- var _quill$getLine13 = this.quill.getLine(range.index - 1),
- _quill$getLine14 = _slicedToArray(_quill$getLine13, 1),
- prev = _quill$getLine14[0];
-
- if (prev != null && prev.length() > 1) {
- var curFormats = line.formats();
- var prevFormats = this.quill.getFormat(range.index - 1, 1);
- formats = _op2.default.attributes.diff(curFormats, prevFormats) || {};
- }
- }
- // Check for astral symbols
- var length = /[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(context.prefix) ? 2 : 1;
- this.quill.deleteText(range.index - length, length, _quill2.default.sources.USER);
- if (Object.keys(formats).length > 0) {
- this.quill.formatLine(range.index - length, length, formats, _quill2.default.sources.USER);
- }
- this.quill.focus();
- }
-
- function handleDelete(range, context) {
- // Check for astral symbols
- var length = /^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(context.suffix) ? 2 : 1;
- if (range.index >= this.quill.getLength() - length) return;
- var formats = {},
- nextLength = 0;
-
- var _quill$getLine15 = this.quill.getLine(range.index),
- _quill$getLine16 = _slicedToArray(_quill$getLine15, 1),
- line = _quill$getLine16[0];
-
- if (context.offset >= line.length() - 1) {
- var _quill$getLine17 = this.quill.getLine(range.index + 1),
- _quill$getLine18 = _slicedToArray(_quill$getLine17, 1),
- next = _quill$getLine18[0];
-
- if (next) {
- var curFormats = line.formats();
- var nextFormats = this.quill.getFormat(range.index, 1);
- formats = _op2.default.attributes.diff(curFormats, nextFormats) || {};
- nextLength = next.length();
- }
- }
- this.quill.deleteText(range.index, length, _quill2.default.sources.USER);
- if (Object.keys(formats).length > 0) {
- this.quill.formatLine(range.index + nextLength - 1, length, formats, _quill2.default.sources.USER);
- }
- }
-
- function handleDeleteRange(range) {
- var lines = this.quill.getLines(range);
- var formats = {};
- if (lines.length > 1) {
- var firstFormats = lines[0].formats();
- var lastFormats = lines[lines.length - 1].formats();
- formats = _op2.default.attributes.diff(lastFormats, firstFormats) || {};
- }
- this.quill.deleteText(range, _quill2.default.sources.USER);
- if (Object.keys(formats).length > 0) {
- this.quill.formatLine(range.index, 1, formats, _quill2.default.sources.USER);
- }
- this.quill.setSelection(range.index, _quill2.default.sources.SILENT);
- this.quill.focus();
- }
-
- function handleEnter(range, context) {
- var _this3 = this;
-
- if (range.length > 0) {
- this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change
- }
- var lineFormats = Object.keys(context.format).reduce(function (lineFormats, format) {
- if (_parchment2.default.query(format, _parchment2.default.Scope.BLOCK) && !Array.isArray(context.format[format])) {
- lineFormats[format] = context.format[format];
- }
- return lineFormats;
- }, {});
- this.quill.insertText(range.index, '\n', lineFormats, _quill2.default.sources.USER);
- // Earlier scroll.deleteAt might have messed up our selection,
- // so insertText's built in selection preservation is not reliable
- this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);
- this.quill.focus();
- Object.keys(context.format).forEach(function (name) {
- if (lineFormats[name] != null) return;
- if (Array.isArray(context.format[name])) return;
- if (name === 'link') return;
- _this3.quill.format(name, context.format[name], _quill2.default.sources.USER);
- });
- }
-
- function makeCodeBlockHandler(indent) {
- return {
- key: Keyboard.keys.TAB,
- shiftKey: !indent,
- format: { 'code-block': true },
- handler: function handler(range) {
- var CodeBlock = _parchment2.default.query('code-block');
- var index = range.index,
- length = range.length;
-
- var _quill$scroll$descend = this.quill.scroll.descendant(CodeBlock, index),
- _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2),
- block = _quill$scroll$descend2[0],
- offset = _quill$scroll$descend2[1];
-
- if (block == null) return;
- var scrollIndex = this.quill.getIndex(block);
- var start = block.newlineIndex(offset, true) + 1;
- var end = block.newlineIndex(scrollIndex + offset + length);
- var lines = block.domNode.textContent.slice(start, end).split('\n');
- offset = 0;
- lines.forEach(function (line, i) {
- if (indent) {
- block.insertAt(start + offset, CodeBlock.TAB);
- offset += CodeBlock.TAB.length;
- if (i === 0) {
- index += CodeBlock.TAB.length;
- } else {
- length += CodeBlock.TAB.length;
- }
- } else if (line.startsWith(CodeBlock.TAB)) {
- block.deleteAt(start + offset, CodeBlock.TAB.length);
- offset -= CodeBlock.TAB.length;
- if (i === 0) {
- index -= CodeBlock.TAB.length;
- } else {
- length -= CodeBlock.TAB.length;
- }
- }
- offset += line.length + 1;
- });
- this.quill.update(_quill2.default.sources.USER);
- this.quill.setSelection(index, length, _quill2.default.sources.SILENT);
- }
- };
- }
-
- function makeFormatHandler(format) {
- return {
- key: format[0].toUpperCase(),
- shortKey: true,
- handler: function handler(range, context) {
- this.quill.format(format, !context.format[format], _quill2.default.sources.USER);
- }
- };
- }
-
- function normalize(binding) {
- if (typeof binding === 'string' || typeof binding === 'number') {
- return normalize({ key: binding });
- }
- if ((typeof binding === 'undefined' ? 'undefined' : _typeof(binding)) === 'object') {
- binding = (0, _clone2.default)(binding, false);
- }
- if (typeof binding.key === 'string') {
- if (Keyboard.keys[binding.key.toUpperCase()] != null) {
- binding.key = Keyboard.keys[binding.key.toUpperCase()];
- } else if (binding.key.length === 1) {
- binding.key = binding.key.toUpperCase().charCodeAt(0);
- } else {
- return null;
- }
- }
- if (binding.shortKey) {
- binding[SHORTKEY] = binding.shortKey;
- delete binding.shortKey;
- }
- return binding;
- }
-
- exports.default = Keyboard;
- exports.SHORTKEY = SHORTKEY;
-
- /***/
- }),
-/* 26 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _text = __webpack_require__(7);
-
- var _text2 = _interopRequireDefault(_text);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var Cursor = function (_Parchment$Embed) {
- _inherits(Cursor, _Parchment$Embed);
-
- _createClass(Cursor, null, [{
- key: 'value',
- value: function value() {
- return undefined;
- }
- }]);
-
- function Cursor(domNode, selection) {
- _classCallCheck(this, Cursor);
-
- var _this = _possibleConstructorReturn(this, (Cursor.__proto__ || Object.getPrototypeOf(Cursor)).call(this, domNode));
-
- _this.selection = selection;
- _this.textNode = document.createTextNode(Cursor.CONTENTS);
- _this.domNode.appendChild(_this.textNode);
- _this._length = 0;
- return _this;
- }
-
- _createClass(Cursor, [{
- key: 'detach',
- value: function detach() {
- // super.detach() will also clear domNode.__blot
- if (this.parent != null) this.parent.removeChild(this);
- }
- }, {
- key: 'format',
- value: function format(name, value) {
- if (this._length !== 0) {
- return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'format', this).call(this, name, value);
- }
- var target = this,
- index = 0;
- while (target != null && target.statics.scope !== _parchment2.default.Scope.BLOCK_BLOT) {
- index += target.offset(target.parent);
- target = target.parent;
- }
- if (target != null) {
- this._length = Cursor.CONTENTS.length;
- target.optimize();
- target.formatAt(index, Cursor.CONTENTS.length, name, value);
- this._length = 0;
- }
- }
- }, {
- key: 'index',
- value: function index(node, offset) {
- if (node === this.textNode) return 0;
- return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'index', this).call(this, node, offset);
- }
- }, {
- key: 'length',
- value: function length() {
- return this._length;
- }
- }, {
- key: 'position',
- value: function position() {
- return [this.textNode, this.textNode.data.length];
- }
- }, {
- key: 'remove',
- value: function remove() {
- _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'remove', this).call(this);
- this.parent = null;
- }
- }, {
- key: 'restore',
- value: function restore() {
- if (this.selection.composing || this.parent == null) return;
- var textNode = this.textNode;
- var range = this.selection.getNativeRange();
- var restoreText = void 0,
- start = void 0,
- end = void 0;
- if (range != null && range.start.node === textNode && range.end.node === textNode) {
- var _ref = [textNode, range.start.offset, range.end.offset];
- restoreText = _ref[0];
- start = _ref[1];
- end = _ref[2];
- }
- // Link format will insert text outside of anchor tag
- while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) {
- this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode);
- }
- if (this.textNode.data !== Cursor.CONTENTS) {
- var text = this.textNode.data.split(Cursor.CONTENTS).join('');
- if (this.next instanceof _text2.default) {
- restoreText = this.next.domNode;
- this.next.insertAt(0, text);
- this.textNode.data = Cursor.CONTENTS;
- } else {
- this.textNode.data = text;
- this.parent.insertBefore(_parchment2.default.create(this.textNode), this);
- this.textNode = document.createTextNode(Cursor.CONTENTS);
- this.domNode.appendChild(this.textNode);
- }
- }
- this.remove();
- if (start != null) {
- var _map = [start, end].map(function (offset) {
- return Math.max(0, Math.min(restoreText.data.length, offset - 1));
- });
-
- var _map2 = _slicedToArray(_map, 2);
-
- start = _map2[0];
- end = _map2[1];
-
- return {
- startNode: restoreText,
- startOffset: start,
- endNode: restoreText,
- endOffset: end
- };
- }
- }
- }, {
- key: 'update',
- value: function update(mutations, context) {
- var _this2 = this;
-
- if (mutations.some(function (mutation) {
- return mutation.type === 'characterData' && mutation.target === _this2.textNode;
- })) {
- var range = this.restore();
- if (range) context.range = range;
- }
- }
- }, {
- key: 'value',
- value: function value() {
- return '';
- }
- }]);
-
- return Cursor;
- }(_parchment2.default.Embed);
-
- Cursor.blotName = 'cursor';
- Cursor.className = 'ql-cursor';
- Cursor.tagName = 'span';
- Cursor.CONTENTS = '\uFEFF'; // Zero width no break space
-
-
- exports.default = Cursor;
-
- /***/
- }),
-/* 27 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _block = __webpack_require__(4);
-
- var _block2 = _interopRequireDefault(_block);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var Container = function (_Parchment$Container) {
- _inherits(Container, _Parchment$Container);
-
- function Container() {
- _classCallCheck(this, Container);
-
- return _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).apply(this, arguments));
- }
-
- return Container;
- }(_parchment2.default.Container);
-
- Container.allowedChildren = [_block2.default, _block.BlockEmbed, Container];
-
- exports.default = Container;
-
- /***/
- }),
-/* 28 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.ColorStyle = exports.ColorClass = exports.ColorAttributor = undefined;
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var ColorAttributor = function (_Parchment$Attributor) {
- _inherits(ColorAttributor, _Parchment$Attributor);
-
- function ColorAttributor() {
- _classCallCheck(this, ColorAttributor);
-
- return _possibleConstructorReturn(this, (ColorAttributor.__proto__ || Object.getPrototypeOf(ColorAttributor)).apply(this, arguments));
- }
-
- _createClass(ColorAttributor, [{
- key: 'value',
- value: function value(domNode) {
- var value = _get(ColorAttributor.prototype.__proto__ || Object.getPrototypeOf(ColorAttributor.prototype), 'value', this).call(this, domNode);
- if (!value.startsWith('rgb(')) return value;
- value = value.replace(/^[^\d]+/, '').replace(/[^\d]+$/, '');
- return '#' + value.split(',').map(function (component) {
- return ('00' + parseInt(component).toString(16)).slice(-2);
- }).join('');
- }
- }]);
-
- return ColorAttributor;
- }(_parchment2.default.Attributor.Style);
-
- var ColorClass = new _parchment2.default.Attributor.Class('color', 'ql-color', {
- scope: _parchment2.default.Scope.INLINE
- });
- var ColorStyle = new ColorAttributor('color', 'color', {
- scope: _parchment2.default.Scope.INLINE
- });
-
- exports.ColorAttributor = ColorAttributor;
- exports.ColorClass = ColorClass;
- exports.ColorStyle = ColorStyle;
-
- /***/
- }),
-/* 29 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.sanitize = exports.default = undefined;
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _inline = __webpack_require__(6);
-
- var _inline2 = _interopRequireDefault(_inline);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var Link = function (_Inline) {
- _inherits(Link, _Inline);
-
- function Link() {
- _classCallCheck(this, Link);
-
- return _possibleConstructorReturn(this, (Link.__proto__ || Object.getPrototypeOf(Link)).apply(this, arguments));
- }
-
- _createClass(Link, [{
- key: 'format',
- value: function format(name, value) {
- if (name !== this.statics.blotName || !value) return _get(Link.prototype.__proto__ || Object.getPrototypeOf(Link.prototype), 'format', this).call(this, name, value);
- value = this.constructor.sanitize(value);
- this.domNode.setAttribute('href', value);
- }
- }], [{
- key: 'create',
- value: function create(value) {
- var node = _get(Link.__proto__ || Object.getPrototypeOf(Link), 'create', this).call(this, value);
- value = this.sanitize(value);
- node.setAttribute('href', value);
- node.setAttribute('rel', 'noopener noreferrer');
- node.setAttribute('target', '_blank');
- return node;
- }
- }, {
- key: 'formats',
- value: function formats(domNode) {
- return domNode.getAttribute('href');
- }
- }, {
- key: 'sanitize',
- value: function sanitize(url) {
- return _sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL;
- }
- }]);
-
- return Link;
- }(_inline2.default);
-
- Link.blotName = 'link';
- Link.tagName = 'A';
- Link.SANITIZED_URL = 'about:blank';
- Link.PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel'];
-
- function _sanitize(url, protocols) {
- var anchor = document.createElement('a');
- anchor.href = url;
- var protocol = anchor.href.slice(0, anchor.href.indexOf(':'));
- return protocols.indexOf(protocol) > -1;
- }
-
- exports.default = Link;
- exports.sanitize = _sanitize;
-
- /***/
- }),
-/* 30 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _keyboard = __webpack_require__(25);
-
- var _keyboard2 = _interopRequireDefault(_keyboard);
-
- var _unfoldMoreHorizontal = __webpack_require__(131);
-
- var _unfoldMoreHorizontal2 = _interopRequireDefault(_unfoldMoreHorizontal);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- var optionsCounter = 0;
-
- function toggleAriaAttribute(element, attribute) {
- element.setAttribute(attribute, !(element.getAttribute(attribute) === "true"));
- }
-
- var Picker = function () {
- function Picker(select) {
- var _this = this;
-
- _classCallCheck(this, Picker);
-
- this.select = select;
- this.container = document.createElement("span");
- this.buildPicker();
- this.select.style.display = "none";
- this.select.parentNode.insertBefore(this.container, this.select);
-
- this.label.addEventListener("mousedown", function () {
- _this.togglePicker();
- });
- this.label.addEventListener("keydown", function (event) {
- switch (event.keyCode) {
- // Allows the "Enter" key to open the picker
- case _keyboard2.default.keys.ENTER:
- _this.togglePicker();
- break;
-
- // Allows the "Escape" key to close the picker
- case _keyboard2.default.keys.ESCAPE:
- _this.escape();
- event.preventDefault();
- break;
- default:
- }
- });
- this.select.addEventListener("change", this.update.bind(this));
- }
-
- _createClass(Picker, [{
- key: "togglePicker",
- value: function togglePicker() {
- this.container.classList.toggle("ql-expanded");
- // Toggle aria-expanded and aria-hidden to make the picker accessible
- toggleAriaAttribute(this.label, "aria-expanded");
- toggleAriaAttribute(this.options, "aria-hidden");
- }
- }, {
- key: "buildItem",
- value: function buildItem(option) {
- var _this2 = this;
-
- var item = document.createElement("span");
- item.tabIndex = "0";
- item.setAttribute("role", "button");
-
- item.classList.add("ql-picker-item");
- if (option.hasAttribute("value")) {
- item.setAttribute("data-value", option.getAttribute("value"));
- }
- if (option.textContent) {
- item.setAttribute("data-label", option.textContent);
- }
- item.addEventListener("click", function () {
- _this2.selectItem(item, true);
- });
- item.addEventListener("keydown", function (event) {
- switch (event.keyCode) {
- // Allows the "Enter" key to select an item
- case _keyboard2.default.keys.ENTER:
- _this2.selectItem(item, true);
- event.preventDefault();
- break;
-
- // Allows the "Escape" key to close the picker
- case _keyboard2.default.keys.ESCAPE:
- _this2.escape();
- event.preventDefault();
- break;
- default:
- }
- });
-
- return item;
- }
- }, {
- key: "buildLabel",
- value: function buildLabel() {
- var label = document.createElement("span");
- label.classList.add("ql-picker-label");
- label.innerHTML = _unfoldMoreHorizontal2.default;
- label.tabIndex = "0";
- label.setAttribute("role", "button");
- label.setAttribute("aria-expanded", "false");
- this.container.appendChild(label);
- return label;
- }
- }, {
- key: "buildOptions",
- value: function buildOptions() {
- var _this3 = this;
-
- var options = document.createElement("span");
- options.classList.add("ql-picker-options");
-
- // Don't want screen readers to read this until options are visible
- options.setAttribute("aria-hidden", "true");
- options.tabIndex = "-1";
-
- // Need a unique id for aria-controls
- options.id = "ql-picker-options-" + optionsCounter;
- optionsCounter += 1;
- this.label.setAttribute("aria-controls", options.id);
-
- this.options = options;
-
- [].slice.call(this.select.options).forEach(function (option) {
- var item = _this3.buildItem(option);
- options.appendChild(item);
- if (option.selected === true) {
- _this3.selectItem(item);
- }
- });
- this.container.appendChild(options);
- }
- }, {
- key: "buildPicker",
- value: function buildPicker() {
- var _this4 = this;
-
- [].slice.call(this.select.attributes).forEach(function (item) {
- _this4.container.setAttribute(item.name, item.value);
- });
- this.container.classList.add("ql-picker");
- this.label = this.buildLabel();
- this.buildOptions();
- }
- }, {
- key: "escape",
- value: function escape() {
- var _this5 = this;
-
- // Close menu and return focus to trigger label
- this.close();
- // Need setTimeout for accessibility to ensure that the browser executes
- // focus on the next process thread and after any DOM content changes
- setTimeout(function () {
- return _this5.label.focus();
- }, 1);
- }
- }, {
- key: "close",
- value: function close() {
- this.container.classList.remove("ql-expanded");
- this.label.setAttribute("aria-expanded", "false");
- this.options.setAttribute("aria-hidden", "true");
- }
- }, {
- key: "selectItem",
- value: function selectItem(item) {
- var trigger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
-
- var selected = this.container.querySelector(".ql-selected");
- if (item === selected) return;
- if (selected != null) {
- selected.classList.remove("ql-selected");
- }
- if (item == null) return;
- item.classList.add("ql-selected");
- this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item);
- if (item.hasAttribute("data-value")) {
- this.label.setAttribute("data-value", item.getAttribute("data-value"));
- } else {
- this.label.removeAttribute("data-value");
- }
- if (item.hasAttribute("data-label")) {
- this.label.setAttribute("data-label", item.getAttribute("data-label"));
- } else {
- this.label.removeAttribute("data-label");
- }
- if (trigger) {
- if (typeof Event === "function") {
- this.select.dispatchEvent(new Event("change"));
- } else if ((typeof Event === "undefined" ? "undefined" : _typeof(Event)) === "object") {
- // IE11
- var event = document.createEvent("Event");
- event.initEvent("change", true, true);
- this.select.dispatchEvent(event);
- }
- this.close();
- }
- }
- }, {
- key: "update",
- value: function update() {
- var option = void 0;
- if (this.select.selectedIndex > -1) {
- var item = this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];
- option = this.select.options[this.select.selectedIndex];
- this.selectItem(item);
- } else {
- this.selectItem(null);
- }
- var isActive = option != null && option !== this.select.querySelector("option[selected]");
- this.label.classList.toggle("ql-active", isActive);
- }
- }]);
-
- return Picker;
- }();
-
- exports.default = Picker;
-
- /***/
- }),
-/* 31 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _quill = __webpack_require__(5);
-
- var _quill2 = _interopRequireDefault(_quill);
-
- var _block = __webpack_require__(4);
-
- var _block2 = _interopRequireDefault(_block);
-
- var _break = __webpack_require__(16);
-
- var _break2 = _interopRequireDefault(_break);
-
- var _container = __webpack_require__(27);
-
- var _container2 = _interopRequireDefault(_container);
-
- var _cursor = __webpack_require__(26);
-
- var _cursor2 = _interopRequireDefault(_cursor);
-
- var _embed = __webpack_require__(41);
-
- var _embed2 = _interopRequireDefault(_embed);
-
- var _inline = __webpack_require__(6);
-
- var _inline2 = _interopRequireDefault(_inline);
-
- var _scroll = __webpack_require__(24);
-
- var _scroll2 = _interopRequireDefault(_scroll);
-
- var _text = __webpack_require__(7);
-
- var _text2 = _interopRequireDefault(_text);
-
- var _clipboard = __webpack_require__(74);
-
- var _clipboard2 = _interopRequireDefault(_clipboard);
-
- var _history = __webpack_require__(48);
-
- var _history2 = _interopRequireDefault(_history);
-
- var _keyboard = __webpack_require__(25);
-
- var _keyboard2 = _interopRequireDefault(_keyboard);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- _quill2.default.register({
- 'blots/block': _block2.default,
- 'blots/block/embed': _block.BlockEmbed,
- 'blots/break': _break2.default,
- 'blots/container': _container2.default,
- 'blots/cursor': _cursor2.default,
- 'blots/embed': _embed2.default,
- 'blots/inline': _inline2.default,
- 'blots/scroll': _scroll2.default,
- 'blots/text': _text2.default,
-
- 'modules/clipboard': _clipboard2.default,
- 'modules/history': _history2.default,
- 'modules/keyboard': _keyboard2.default
- });
-
- _parchment2.default.register(_block2.default, _break2.default, _cursor2.default, _inline2.default, _scroll2.default, _text2.default);
-
- exports.default = _quill2.default;
-
- /***/
- }),
-/* 32 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- Object.defineProperty(exports, "__esModule", { value: true });
- var Registry = __webpack_require__(2);
- var ShadowBlot = /** @class */ (function () {
- function ShadowBlot(domNode) {
- this.domNode = domNode;
- // @ts-ignore
- this.domNode[Registry.DATA_KEY] = { blot: this };
- }
- Object.defineProperty(ShadowBlot.prototype, "statics", {
- // Hack for accessing inherited static methods
- get: function () {
- return this.constructor;
- },
- enumerable: true,
- configurable: true
- });
- ShadowBlot.create = function (value) {
- if (this.tagName == null) {
- throw new Registry.ParchmentError('Blot definition missing tagName');
- }
- var node;
- if (Array.isArray(this.tagName)) {
- if (typeof value === 'string') {
- value = value.toUpperCase();
- if (parseInt(value).toString() === value) {
- value = parseInt(value);
- }
- }
- if (typeof value === 'number') {
- node = document.createElement(this.tagName[value - 1]);
- }
- else if (this.tagName.indexOf(value) > -1) {
- node = document.createElement(value);
- }
- else {
- node = document.createElement(this.tagName[0]);
- }
- }
- else {
- node = document.createElement(this.tagName);
- }
- if (this.className) {
- node.classList.add(this.className);
- }
- return node;
- };
- ShadowBlot.prototype.attach = function () {
- if (this.parent != null) {
- this.scroll = this.parent.scroll;
- }
- };
- ShadowBlot.prototype.clone = function () {
- var domNode = this.domNode.cloneNode(false);
- return Registry.create(domNode);
- };
- ShadowBlot.prototype.detach = function () {
- if (this.parent != null)
- this.parent.removeChild(this);
- // @ts-ignore
- delete this.domNode[Registry.DATA_KEY];
- };
- ShadowBlot.prototype.deleteAt = function (index, length) {
- var blot = this.isolate(index, length);
- blot.remove();
- };
- ShadowBlot.prototype.formatAt = function (index, length, name, value) {
- var blot = this.isolate(index, length);
- if (Registry.query(name, Registry.Scope.BLOT) != null && value) {
- blot.wrap(name, value);
- }
- else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) {
- var parent = Registry.create(this.statics.scope);
- blot.wrap(parent);
- parent.format(name, value);
- }
- };
- ShadowBlot.prototype.insertAt = function (index, value, def) {
- var blot = def == null ? Registry.create('text', value) : Registry.create(value, def);
- var ref = this.split(index);
- this.parent.insertBefore(blot, ref);
- };
- ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) {
- if (refBlot === void 0) { refBlot = null; }
- if (this.parent != null) {
- this.parent.children.remove(this);
- }
- var refDomNode = null;
- parentBlot.children.insertBefore(this, refBlot);
- if (refBlot != null) {
- refDomNode = refBlot.domNode;
- }
- if (this.domNode.parentNode != parentBlot.domNode ||
- this.domNode.nextSibling != refDomNode) {
- parentBlot.domNode.insertBefore(this.domNode, refDomNode);
- }
- this.parent = parentBlot;
- this.attach();
- };
- ShadowBlot.prototype.isolate = function (index, length) {
- var target = this.split(index);
- target.split(length);
- return target;
- };
- ShadowBlot.prototype.length = function () {
- return 1;
- };
- ShadowBlot.prototype.offset = function (root) {
- if (root === void 0) { root = this.parent; }
- if (this.parent == null || this == root)
- return 0;
- return this.parent.children.offset(this) + this.parent.offset(root);
- };
- ShadowBlot.prototype.optimize = function (context) {
- // TODO clean up once we use WeakMap
- // @ts-ignore
- if (this.domNode[Registry.DATA_KEY] != null) {
- // @ts-ignore
- delete this.domNode[Registry.DATA_KEY].mutations;
- }
- };
- ShadowBlot.prototype.remove = function () {
- if (this.domNode.parentNode != null) {
- this.domNode.parentNode.removeChild(this.domNode);
- }
- this.detach();
- };
- ShadowBlot.prototype.replace = function (target) {
- if (target.parent == null)
- return;
- target.parent.insertBefore(this, target.next);
- target.remove();
- };
- ShadowBlot.prototype.replaceWith = function (name, value) {
- var replacement = typeof name === 'string' ? Registry.create(name, value) : name;
- replacement.replace(this);
- return replacement;
- };
- ShadowBlot.prototype.split = function (index, force) {
- return index === 0 ? this : this.next;
- };
- ShadowBlot.prototype.update = function (mutations, context) {
- // Nothing to do by default
- };
- ShadowBlot.prototype.wrap = function (name, value) {
- var wrapper = typeof name === 'string' ? Registry.create(name, value) : name;
- if (this.parent != null) {
- this.parent.insertBefore(wrapper, this.next);
- }
- wrapper.appendChild(this);
- return wrapper;
- };
- ShadowBlot.blotName = 'abstract';
- return ShadowBlot;
- }());
- exports.default = ShadowBlot;
-
-
- /***/
- }),
-/* 33 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- Object.defineProperty(exports, "__esModule", { value: true });
- var attributor_1 = __webpack_require__(12);
- var class_1 = __webpack_require__(34);
- var style_1 = __webpack_require__(35);
- var Registry = __webpack_require__(2);
- var AttributorStore = /** @class */ (function () {
- function AttributorStore(domNode) {
- this.attributes = {};
- this.domNode = domNode;
- this.build();
- }
- AttributorStore.prototype.attribute = function (attribute, value) {
- // verb
- if (value) {
- if (attribute.add(this.domNode, value)) {
- if (attribute.value(this.domNode) != null) {
- this.attributes[attribute.attrName] = attribute;
- }
- else {
- delete this.attributes[attribute.attrName];
- }
- }
- }
- else {
- attribute.remove(this.domNode);
- delete this.attributes[attribute.attrName];
- }
- };
- AttributorStore.prototype.build = function () {
- var _this = this;
- this.attributes = {};
- var attributes = attributor_1.default.keys(this.domNode);
- var classes = class_1.default.keys(this.domNode);
- var styles = style_1.default.keys(this.domNode);
- attributes
- .concat(classes)
- .concat(styles)
- .forEach(function (name) {
- var attr = Registry.query(name, Registry.Scope.ATTRIBUTE);
- if (attr instanceof attributor_1.default) {
- _this.attributes[attr.attrName] = attr;
- }
- });
- };
- AttributorStore.prototype.copy = function (target) {
- var _this = this;
- Object.keys(this.attributes).forEach(function (key) {
- var value = _this.attributes[key].value(_this.domNode);
- target.format(key, value);
- });
- };
- AttributorStore.prototype.move = function (target) {
- var _this = this;
- this.copy(target);
- Object.keys(this.attributes).forEach(function (key) {
- _this.attributes[key].remove(_this.domNode);
- });
- this.attributes = {};
- };
- AttributorStore.prototype.values = function () {
- var _this = this;
- return Object.keys(this.attributes).reduce(function (attributes, name) {
- attributes[name] = _this.attributes[name].value(_this.domNode);
- return attributes;
- }, {});
- };
- return AttributorStore;
- }());
- exports.default = AttributorStore;
-
-
- /***/
- }),
-/* 34 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var attributor_1 = __webpack_require__(12);
- function match(node, prefix) {
- var className = node.getAttribute('class') || '';
- return className.split(/\s+/).filter(function (name) {
- return name.indexOf(prefix + "-") === 0;
- });
- }
- var ClassAttributor = /** @class */ (function (_super) {
- __extends(ClassAttributor, _super);
- function ClassAttributor() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- ClassAttributor.keys = function (node) {
- return (node.getAttribute('class') || '').split(/\s+/).map(function (name) {
- return name
- .split('-')
- .slice(0, -1)
- .join('-');
- });
- };
- ClassAttributor.prototype.add = function (node, value) {
- if (!this.canAdd(node, value))
- return false;
- this.remove(node);
- node.classList.add(this.keyName + "-" + value);
- return true;
- };
- ClassAttributor.prototype.remove = function (node) {
- var matches = match(node, this.keyName);
- matches.forEach(function (name) {
- node.classList.remove(name);
- });
- if (node.classList.length === 0) {
- node.removeAttribute('class');
- }
- };
- ClassAttributor.prototype.value = function (node) {
- var result = match(node, this.keyName)[0] || '';
- var value = result.slice(this.keyName.length + 1); // +1 for hyphen
- return this.canAdd(node, value) ? value : '';
- };
- return ClassAttributor;
- }(attributor_1.default));
- exports.default = ClassAttributor;
-
-
- /***/
- }),
-/* 35 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var attributor_1 = __webpack_require__(12);
- function camelize(name) {
- var parts = name.split('-');
- var rest = parts
- .slice(1)
- .map(function (part) {
- return part[0].toUpperCase() + part.slice(1);
- })
- .join('');
- return parts[0] + rest;
- }
- var StyleAttributor = /** @class */ (function (_super) {
- __extends(StyleAttributor, _super);
- function StyleAttributor() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- StyleAttributor.keys = function (node) {
- return (node.getAttribute('style') || '').split(';').map(function (value) {
- var arr = value.split(':');
- return arr[0].trim();
- });
- };
- StyleAttributor.prototype.add = function (node, value) {
- if (!this.canAdd(node, value))
- return false;
- // @ts-ignore
- node.style[camelize(this.keyName)] = value;
- return true;
- };
- StyleAttributor.prototype.remove = function (node) {
- // @ts-ignore
- node.style[camelize(this.keyName)] = '';
- if (!node.getAttribute('style')) {
- node.removeAttribute('style');
- }
- };
- StyleAttributor.prototype.value = function (node) {
- // @ts-ignore
- var value = node.style[camelize(this.keyName)];
- return this.canAdd(node, value) ? value : '';
- };
- return StyleAttributor;
- }(attributor_1.default));
- exports.default = StyleAttributor;
-
-
- /***/
- }),
-/* 36 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var slice = Array.prototype.slice;
- var isArgs = __webpack_require__(37);
-
- var origKeys = Object.keys;
- var keysShim = origKeys ? function keys(o) { return origKeys(o); } : __webpack_require__(58);
-
- var originalKeys = Object.keys;
-
- keysShim.shim = function shimObjectKeys() {
- if (Object.keys) {
- var keysWorksWithArguments = (function () {
- // Safari 5.0 bug
- var args = Object.keys(arguments);
- return args && args.length === arguments.length;
- }(1, 2));
- if (!keysWorksWithArguments) {
- Object.keys = function keys(object) { // eslint-disable-line func-name-matching
- if (isArgs(object)) {
- return originalKeys(slice.call(object));
- }
- return originalKeys(object);
- };
- }
- } else {
- Object.keys = keysShim;
- }
- return Object.keys || keysShim;
- };
-
- module.exports = keysShim;
-
-
- /***/
- }),
-/* 37 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var toStr = Object.prototype.toString;
-
- module.exports = function isArguments(value) {
- var str = toStr.call(value);
- var isArgs = str === '[object Arguments]';
- if (!isArgs) {
- isArgs = str !== '[object Array]' &&
- value !== null &&
- typeof value === 'object' &&
- typeof value.length === 'number' &&
- value.length >= 0 &&
- toStr.call(value.callee) === '[object Function]';
- }
- return isArgs;
- };
-
-
- /***/
- }),
-/* 38 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var $Object = Object;
- var $TypeError = TypeError;
-
- module.exports = function flags() {
- if (this != null && this !== $Object(this)) {
- throw new $TypeError('RegExp.prototype.flags getter called on non-object');
- }
- var result = '';
- if (this.global) {
- result += 'g';
- }
- if (this.ignoreCase) {
- result += 'i';
- }
- if (this.multiline) {
- result += 'm';
- }
- if (this.dotAll) {
- result += 's';
- }
- if (this.unicode) {
- result += 'u';
- }
- if (this.sticky) {
- result += 'y';
- }
- return result;
- };
-
-
- /***/
- }),
-/* 39 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var implementation = __webpack_require__(38);
-
- var supportsDescriptors = __webpack_require__(21).supportsDescriptors;
- var $gOPD = Object.getOwnPropertyDescriptor;
- var $TypeError = TypeError;
-
- module.exports = function getPolyfill() {
- if (!supportsDescriptors) {
- throw new $TypeError('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');
- }
- if ((/a/mig).flags === 'gim') {
- var descriptor = $gOPD(RegExp.prototype, 'flags');
- if (descriptor && typeof descriptor.get === 'function' && typeof (/a/).dotAll === 'boolean') {
- return descriptor.get;
- }
- }
- return implementation;
- };
-
-
- /***/
- }),
-/* 40 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- var Theme = function () {
- function Theme(quill, options) {
- _classCallCheck(this, Theme);
-
- this.quill = quill;
- this.options = options;
- this.modules = {};
- }
-
- _createClass(Theme, [{
- key: 'init',
- value: function init() {
- var _this = this;
-
- Object.keys(this.options.modules).forEach(function (name) {
- if (_this.modules[name] == null) {
- _this.addModule(name);
- }
- });
- }
- }, {
- key: 'addModule',
- value: function addModule(name) {
- var moduleClass = this.quill.constructor.import('modules/' + name);
- this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {});
- return this.modules[name];
- }
- }]);
-
- return Theme;
- }();
-
- Theme.DEFAULTS = {
- modules: {}
- };
- Theme.themes = {
- 'default': Theme
- };
-
- exports.default = Theme;
-
- /***/
- }),
-/* 41 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _text = __webpack_require__(7);
-
- var _text2 = _interopRequireDefault(_text);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var GUARD_TEXT = '\uFEFF';
-
- var Embed = function (_Parchment$Embed) {
- _inherits(Embed, _Parchment$Embed);
-
- function Embed(node) {
- _classCallCheck(this, Embed);
-
- var _this = _possibleConstructorReturn(this, (Embed.__proto__ || Object.getPrototypeOf(Embed)).call(this, node));
-
- _this.contentNode = document.createElement('span');
- _this.contentNode.setAttribute('contenteditable', false);
- [].slice.call(_this.domNode.childNodes).forEach(function (childNode) {
- _this.contentNode.appendChild(childNode);
- });
- _this.leftGuard = document.createTextNode(GUARD_TEXT);
- _this.rightGuard = document.createTextNode(GUARD_TEXT);
- _this.domNode.appendChild(_this.leftGuard);
- _this.domNode.appendChild(_this.contentNode);
- _this.domNode.appendChild(_this.rightGuard);
- return _this;
- }
-
- _createClass(Embed, [{
- key: 'index',
- value: function index(node, offset) {
- if (node === this.leftGuard) return 0;
- if (node === this.rightGuard) return 1;
- return _get(Embed.prototype.__proto__ || Object.getPrototypeOf(Embed.prototype), 'index', this).call(this, node, offset);
- }
- }, {
- key: 'restore',
- value: function restore(node) {
- var range = void 0,
- textNode = void 0;
- var text = node.data.split(GUARD_TEXT).join('');
- if (node === this.leftGuard) {
- if (this.prev instanceof _text2.default) {
- var prevLength = this.prev.length();
- this.prev.insertAt(prevLength, text);
- range = {
- startNode: this.prev.domNode,
- startOffset: prevLength + text.length
- };
- } else {
- textNode = document.createTextNode(text);
- this.parent.insertBefore(_parchment2.default.create(textNode), this);
- range = {
- startNode: textNode,
- startOffset: text.length
- };
- }
- } else if (node === this.rightGuard) {
- if (this.next instanceof _text2.default) {
- this.next.insertAt(0, text);
- range = {
- startNode: this.next.domNode,
- startOffset: text.length
- };
- } else {
- textNode = document.createTextNode(text);
- this.parent.insertBefore(_parchment2.default.create(textNode), this.next);
- range = {
- startNode: textNode,
- startOffset: text.length
- };
- }
- }
- node.data = GUARD_TEXT;
- return range;
- }
- }, {
- key: 'update',
- value: function update(mutations, context) {
- var _this2 = this;
-
- mutations.forEach(function (mutation) {
- if (mutation.type === 'characterData' && (mutation.target === _this2.leftGuard || mutation.target === _this2.rightGuard)) {
- var range = _this2.restore(mutation.target);
- if (range) context.range = range;
- }
- });
- }
- }]);
-
- return Embed;
- }(_parchment2.default.Embed);
-
- exports.default = Embed;
-
- /***/
- }),
-/* 42 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.AlignStyle = exports.AlignClass = exports.AlignAttribute = undefined;
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- var config = {
- scope: _parchment2.default.Scope.BLOCK,
- whitelist: ['right', 'center', 'justify']
- };
-
- var AlignAttribute = new _parchment2.default.Attributor.Attribute('align', 'align', config);
- var AlignClass = new _parchment2.default.Attributor.Class('align', 'ql-align', config);
- var AlignStyle = new _parchment2.default.Attributor.Style('align', 'text-align', config);
-
- exports.AlignAttribute = AlignAttribute;
- exports.AlignClass = AlignClass;
- exports.AlignStyle = AlignStyle;
-
- /***/
- }),
-/* 43 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.DiffStyle = exports.DiffClass = exports.BackgroundStyle = exports.BackgroundClass = undefined;
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _color = __webpack_require__(28);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- var BackgroundClass = new _parchment2.default.Attributor.Class("background", "ql-bg", {
- scope: _parchment2.default.Scope.INLINE
- });
- var BackgroundStyle = new _color.ColorAttributor("background", "background-color", {
- scope: _parchment2.default.Scope.INLINE
- });
-
- var DiffClass = new _parchment2.default.Attributor.Class("diff", "ql-diff", {
- scope: _parchment2.default.Scope.INLINE
- });
- var DiffStyle = new _color.ColorAttributor("diff", "background-color", {
- scope: _parchment2.default.Scope.INLINE
- });
-
- exports.BackgroundClass = BackgroundClass;
- exports.BackgroundStyle = BackgroundStyle;
- exports.DiffClass = DiffClass;
- exports.DiffStyle = DiffStyle;
-
- /***/
- }),
-/* 44 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.DirectionStyle = exports.DirectionClass = exports.DirectionAttribute = undefined;
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- var config = {
- scope: _parchment2.default.Scope.BLOCK,
- whitelist: ['rtl']
- };
-
- var DirectionAttribute = new _parchment2.default.Attributor.Attribute('direction', 'dir', config);
- var DirectionClass = new _parchment2.default.Attributor.Class('direction', 'ql-direction', config);
- var DirectionStyle = new _parchment2.default.Attributor.Style('direction', 'direction', config);
-
- exports.DirectionAttribute = DirectionAttribute;
- exports.DirectionClass = DirectionClass;
- exports.DirectionStyle = DirectionStyle;
-
- /***/
- }),
-/* 45 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.FontClass = exports.FontStyle = undefined;
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var config = {
- scope: _parchment2.default.Scope.INLINE,
- whitelist: ['serif', 'monospace']
- };
-
- var FontClass = new _parchment2.default.Attributor.Class('font', 'ql-font', config);
-
- var FontStyleAttributor = function (_Parchment$Attributor) {
- _inherits(FontStyleAttributor, _Parchment$Attributor);
-
- function FontStyleAttributor() {
- _classCallCheck(this, FontStyleAttributor);
-
- return _possibleConstructorReturn(this, (FontStyleAttributor.__proto__ || Object.getPrototypeOf(FontStyleAttributor)).apply(this, arguments));
- }
-
- _createClass(FontStyleAttributor, [{
- key: 'value',
- value: function value(node) {
- return _get(FontStyleAttributor.prototype.__proto__ || Object.getPrototypeOf(FontStyleAttributor.prototype), 'value', this).call(this, node).replace(/["']/g, '');
- }
- }]);
-
- return FontStyleAttributor;
- }(_parchment2.default.Attributor.Style);
-
- var FontStyle = new FontStyleAttributor('font', 'font-family', config);
-
- exports.FontStyle = FontStyle;
- exports.FontClass = FontClass;
-
- /***/
- }),
-/* 46 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.SizeStyle = exports.SizeClass = undefined;
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- var SizeClass = new _parchment2.default.Attributor.Class('size', 'ql-size', {
- scope: _parchment2.default.Scope.INLINE,
- whitelist: ['small', 'large', 'huge']
- });
- var SizeStyle = new _parchment2.default.Attributor.Style('size', 'font-size', {
- scope: _parchment2.default.Scope.INLINE,
- whitelist: ['10px', '18px', '32px']
- });
-
- exports.SizeClass = SizeClass;
- exports.SizeStyle = SizeStyle;
-
- /***/
- }),
-/* 47 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- module.exports = {
- align: {
- "": __webpack_require__(94),
- center: __webpack_require__(95),
- right: __webpack_require__(96),
- justify: __webpack_require__(97)
- },
- background: __webpack_require__(98),
- blockquote: __webpack_require__(99),
- bold: __webpack_require__(100),
- clean: __webpack_require__(101),
- code: __webpack_require__(102),
- "code-block": __webpack_require__(103),
- color: __webpack_require__(104),
- direction: {
- "": __webpack_require__(105),
- rtl: __webpack_require__(106)
- },
- float: {
- center: __webpack_require__(107),
- full: __webpack_require__(108),
- left: __webpack_require__(109),
- right: __webpack_require__(110)
- },
- formula: __webpack_require__(111),
- header: {
- "1": __webpack_require__(112),
- "2": __webpack_require__(113),
- "3": __webpack_require__(114),
- "4": __webpack_require__(115),
- "5": __webpack_require__(116),
- "6": __webpack_require__(117)
- },
- italic: __webpack_require__(118),
- image: __webpack_require__(119),
- indent: {
- "+1": __webpack_require__(120),
- "-1": __webpack_require__(121)
- },
- link: __webpack_require__(122),
- list: {
- ordered: __webpack_require__(123),
- bullet: __webpack_require__(124),
- check: __webpack_require__(125)
- },
- script: {
- sub: __webpack_require__(126),
- super: __webpack_require__(127)
- },
- strike: __webpack_require__(128),
- underline: __webpack_require__(129),
- video: __webpack_require__(130)
- };
-
- /***/
- }),
-/* 48 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.getLastChangeIndex = exports.default = undefined;
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _quill = __webpack_require__(5);
-
- var _quill2 = _interopRequireDefault(_quill);
-
- var _module = __webpack_require__(9);
-
- var _module2 = _interopRequireDefault(_module);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var History = function (_Module) {
- _inherits(History, _Module);
-
- function History(quill, options) {
- _classCallCheck(this, History);
-
- var _this = _possibleConstructorReturn(this, (History.__proto__ || Object.getPrototypeOf(History)).call(this, quill, options));
-
- _this.lastRecorded = 0;
- _this.ignoreChange = false;
- _this.clear();
- _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (eventName, delta, oldDelta, source) {
- if (eventName !== _quill2.default.events.TEXT_CHANGE || _this.ignoreChange) return;
- if (!_this.options.userOnly || source === _quill2.default.sources.USER) {
- _this.record(delta, oldDelta);
- } else {
- _this.transform(delta);
- }
- });
- _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, _this.undo.bind(_this));
- _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, _this.redo.bind(_this));
- if (/Win/i.test(navigator.platform)) {
- _this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, _this.redo.bind(_this));
- }
- return _this;
- }
-
- _createClass(History, [{
- key: 'change',
- value: function change(source, dest) {
- if (this.stack[source].length === 0) return;
- var delta = this.stack[source].pop();
- this.stack[dest].push(delta);
- this.lastRecorded = 0;
- this.ignoreChange = true;
- this.quill.updateContents(delta[source], _quill2.default.sources.USER);
- this.ignoreChange = false;
- var index = getLastChangeIndex(delta[source]);
- this.quill.setSelection(index);
- }
- }, {
- key: 'clear',
- value: function clear() {
- this.stack = { undo: [], redo: [] };
- }
- }, {
- key: 'cutoff',
- value: function cutoff() {
- this.lastRecorded = 0;
- }
- }, {
- key: 'record',
- value: function record(changeDelta, oldDelta) {
- if (changeDelta.ops.length === 0) return;
- this.stack.redo = [];
- var undoDelta = this.quill.getContents().diff(oldDelta);
- var timestamp = Date.now();
- if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) {
- var delta = this.stack.undo.pop();
- undoDelta = undoDelta.compose(delta.undo);
- changeDelta = delta.redo.compose(changeDelta);
- } else {
- this.lastRecorded = timestamp;
- }
- this.stack.undo.push({
- redo: changeDelta,
- undo: undoDelta
- });
- if (this.stack.undo.length > this.options.maxStack) {
- this.stack.undo.shift();
- }
- }
- }, {
- key: 'redo',
- value: function redo() {
- this.change('redo', 'undo');
- }
- }, {
- key: 'transform',
- value: function transform(delta) {
- this.stack.undo.forEach(function (change) {
- change.undo = delta.transform(change.undo, true);
- change.redo = delta.transform(change.redo, true);
- });
- this.stack.redo.forEach(function (change) {
- change.undo = delta.transform(change.undo, true);
- change.redo = delta.transform(change.redo, true);
- });
- }
- }, {
- key: 'undo',
- value: function undo() {
- this.change('undo', 'redo');
- }
- }]);
-
- return History;
- }(_module2.default);
-
- History.DEFAULTS = {
- delay: 1000,
- maxStack: 100,
- userOnly: false
- };
-
- function endsWithNewlineChange(delta) {
- var lastOp = delta.ops[delta.ops.length - 1];
- if (lastOp == null) return false;
- if (lastOp.insert != null) {
- return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\n');
- }
- if (lastOp.attributes != null) {
- return Object.keys(lastOp.attributes).some(function (attr) {
- return _parchment2.default.query(attr, _parchment2.default.Scope.BLOCK) != null;
- });
- }
- return false;
- }
-
- function getLastChangeIndex(delta) {
- var deleteLength = delta.reduce(function (length, op) {
- length += op.delete || 0;
- return length;
- }, 0);
- var changeIndex = delta.length() - deleteLength;
- if (endsWithNewlineChange(delta)) {
- changeIndex -= 1;
- }
- return changeIndex;
- }
-
- exports.default = History;
- exports.getLastChangeIndex = getLastChangeIndex;
-
- /***/
- }),
-/* 49 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = exports.BaseTooltip = undefined;
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _extend = __webpack_require__(3);
-
- var _extend2 = _interopRequireDefault(_extend);
-
- var _quillDelta = __webpack_require__(1);
-
- var _quillDelta2 = _interopRequireDefault(_quillDelta);
-
- var _emitter = __webpack_require__(8);
-
- var _emitter2 = _interopRequireDefault(_emitter);
-
- var _keyboard = __webpack_require__(25);
-
- var _keyboard2 = _interopRequireDefault(_keyboard);
-
- var _theme = __webpack_require__(40);
-
- var _theme2 = _interopRequireDefault(_theme);
-
- var _colorPicker = __webpack_require__(77);
-
- var _colorPicker2 = _interopRequireDefault(_colorPicker);
-
- var _iconPicker = __webpack_require__(78);
-
- var _iconPicker2 = _interopRequireDefault(_iconPicker);
-
- var _picker = __webpack_require__(30);
-
- var _picker2 = _interopRequireDefault(_picker);
-
- var _tooltip = __webpack_require__(79);
-
- var _tooltip2 = _interopRequireDefault(_tooltip);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var ALIGNS = [false, 'center', 'right', 'justify'];
-
- var COLORS = ["#000000", "#e60000", "#ff9900", "#ffff00", "#008a00", "#0066cc", "#9933ff", "#ffffff", "#facccc", "#ffebcc", "#ffffcc", "#cce8cc", "#cce0f5", "#ebd6ff", "#bbbbbb", "#f06666", "#ffc266", "#ffff66", "#66b966", "#66a3e0", "#c285ff", "#888888", "#a10000", "#b26b00", "#b2b200", "#006100", "#0047b2", "#6b24b2", "#444444", "#5c0000", "#663d00", "#666600", "#003700", "#002966", "#3d1466"];
-
- var FONTS = [false, 'serif', 'monospace'];
-
- var HEADERS = ['1', '2', '3', false];
-
- var SIZES = ['small', false, 'large', 'huge'];
-
- var BaseTheme = function (_Theme) {
- _inherits(BaseTheme, _Theme);
-
- function BaseTheme(quill, options) {
- _classCallCheck(this, BaseTheme);
-
- var _this = _possibleConstructorReturn(this, (BaseTheme.__proto__ || Object.getPrototypeOf(BaseTheme)).call(this, quill, options));
-
- var listener = function listener(e) {
- if (!document.body.contains(quill.root)) {
- return document.body.removeEventListener('click', listener);
- }
- if (_this.tooltip != null && !_this.tooltip.root.contains(e.target) && document.activeElement !== _this.tooltip.textbox && !_this.quill.hasFocus()) {
- _this.tooltip.hide();
- }
- if (_this.pickers != null) {
- _this.pickers.forEach(function (picker) {
- if (!picker.container.contains(e.target)) {
- picker.close();
- }
- });
- }
- };
- quill.emitter.listenDOM('click', document.body, listener);
- return _this;
- }
-
- _createClass(BaseTheme, [{
- key: 'addModule',
- value: function addModule(name) {
- var module = _get(BaseTheme.prototype.__proto__ || Object.getPrototypeOf(BaseTheme.prototype), 'addModule', this).call(this, name);
- if (name === 'toolbar') {
- this.extendToolbar(module);
- }
- return module;
- }
- }, {
- key: 'buildButtons',
- value: function buildButtons(buttons, icons) {
- buttons.forEach(function (button) {
- var className = button.getAttribute('class') || '';
- className.split(/\s+/).forEach(function (name) {
- if (!name.startsWith('ql-')) return;
- name = name.slice('ql-'.length);
- if (icons[name] == null) return;
- if (name === 'direction') {
- button.innerHTML = icons[name][''] + icons[name]['rtl'];
- } else if (typeof icons[name] === 'string') {
- button.innerHTML = icons[name];
- } else {
- var value = button.value || '';
- if (value != null && icons[name][value]) {
- button.innerHTML = icons[name][value];
- }
- }
- });
- });
- }
- }, {
- key: 'buildPickers',
- value: function buildPickers(selects, icons) {
- var _this2 = this;
-
- this.pickers = selects.map(function (select) {
- if (select.classList.contains('ql-align')) {
- if (select.querySelector('option') == null) {
- fillSelect(select, ALIGNS);
- }
- return new _iconPicker2.default(select, icons.align);
- } else if (select.classList.contains('ql-background') || select.classList.contains('ql-color')) {
- var format = select.classList.contains('ql-background') ? 'background' : 'color';
- if (select.querySelector('option') == null) {
- fillSelect(select, COLORS, format === 'background' ? '#ffffff' : '#000000');
- }
- return new _colorPicker2.default(select, icons[format]);
- } else {
- if (select.querySelector('option') == null) {
- if (select.classList.contains('ql-font')) {
- fillSelect(select, FONTS);
- } else if (select.classList.contains('ql-header')) {
- fillSelect(select, HEADERS);
- } else if (select.classList.contains('ql-size')) {
- fillSelect(select, SIZES);
- }
- }
- return new _picker2.default(select);
- }
- });
- var update = function update() {
- _this2.pickers.forEach(function (picker) {
- picker.update();
- });
- };
- this.quill.on(_emitter2.default.events.EDITOR_CHANGE, update);
- }
- }]);
-
- return BaseTheme;
- }(_theme2.default);
-
- BaseTheme.DEFAULTS = (0, _extend2.default)(true, {}, _theme2.default.DEFAULTS, {
- modules: {
- toolbar: {
- handlers: {
- formula: function formula() {
- this.quill.theme.tooltip.edit('formula');
- },
- image: function image() {
- var _this3 = this;
-
- var fileInput = this.container.querySelector('input.ql-image[type=file]');
- if (fileInput == null) {
- fileInput = document.createElement('input');
- fileInput.setAttribute('type', 'file');
- fileInput.setAttribute('accept', 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon');
- fileInput.classList.add('ql-image');
- fileInput.addEventListener('change', function () {
- if (fileInput.files != null && fileInput.files[0] != null) {
- var reader = new FileReader();
- reader.onload = function (e) {
- var range = _this3.quill.getSelection(true);
- _this3.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert({ image: e.target.result }), _emitter2.default.sources.USER);
- _this3.quill.setSelection(range.index + 1, _emitter2.default.sources.SILENT);
- fileInput.value = "";
- };
- reader.readAsDataURL(fileInput.files[0]);
- }
- });
- this.container.appendChild(fileInput);
- }
- fileInput.click();
- },
- video: function video() {
- this.quill.theme.tooltip.edit('video');
- }
- }
- }
- }
- });
-
- var BaseTooltip = function (_Tooltip) {
- _inherits(BaseTooltip, _Tooltip);
-
- function BaseTooltip(quill, boundsContainer) {
- _classCallCheck(this, BaseTooltip);
-
- var _this4 = _possibleConstructorReturn(this, (BaseTooltip.__proto__ || Object.getPrototypeOf(BaseTooltip)).call(this, quill, boundsContainer));
-
- _this4.textbox = _this4.root.querySelector('input[type="text"]');
- _this4.listen();
- return _this4;
- }
-
- _createClass(BaseTooltip, [{
- key: 'listen',
- value: function listen() {
- var _this5 = this;
-
- this.textbox.addEventListener('keydown', function (event) {
- if (_keyboard2.default.match(event, 'enter')) {
- _this5.save();
- event.preventDefault();
- } else if (_keyboard2.default.match(event, 'escape')) {
- _this5.cancel();
- event.preventDefault();
- }
- });
- }
- }, {
- key: 'cancel',
- value: function cancel() {
- this.hide();
- }
- }, {
- key: 'edit',
- value: function edit() {
- var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'link';
- var preview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
-
- this.root.classList.remove('ql-hidden');
- this.root.classList.add('ql-editing');
- if (preview != null) {
- this.textbox.value = preview;
- } else if (mode !== this.root.getAttribute('data-mode')) {
- this.textbox.value = '';
- }
- this.position(this.quill.getBounds(this.quill.selection.savedRange));
- this.textbox.select();
- this.textbox.setAttribute('placeholder', this.textbox.getAttribute('data-' + mode) || '');
- this.root.setAttribute('data-mode', mode);
- }
- }, {
- key: 'restoreFocus',
- value: function restoreFocus() {
- var scrollTop = this.quill.scrollingContainer.scrollTop;
- this.quill.focus();
- this.quill.scrollingContainer.scrollTop = scrollTop;
- }
- }, {
- key: 'save',
- value: function save() {
- var value = this.textbox.value;
- switch (this.root.getAttribute('data-mode')) {
- case 'link':
- {
- var scrollTop = this.quill.root.scrollTop;
- if (this.linkRange) {
- this.quill.formatText(this.linkRange, 'link', value, _emitter2.default.sources.USER);
- delete this.linkRange;
- } else {
- this.restoreFocus();
- this.quill.format('link', value, _emitter2.default.sources.USER);
- }
- this.quill.root.scrollTop = scrollTop;
- break;
- }
- case 'video':
- {
- value = extractVideoUrl(value);
- } // eslint-disable-next-line no-fallthrough
- case 'formula':
- {
- if (!value) break;
- var range = this.quill.getSelection(true);
- if (range != null) {
- var index = range.index + range.length;
- this.quill.insertEmbed(index, this.root.getAttribute('data-mode'), value, _emitter2.default.sources.USER);
- if (this.root.getAttribute('data-mode') === 'formula') {
- this.quill.insertText(index + 1, ' ', _emitter2.default.sources.USER);
- }
- this.quill.setSelection(index + 2, _emitter2.default.sources.USER);
- }
- break;
- }
- default:
- }
- this.textbox.value = '';
- this.hide();
- }
- }]);
-
- return BaseTooltip;
- }(_tooltip2.default);
-
- function extractVideoUrl(url) {
- var match = url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/) || url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);
- if (match) {
- return (match[1] || 'https') + '://www.youtube.com/embed/' + match[2] + '?showinfo=0';
- }
- if (match = url.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/)) {
- // eslint-disable-line no-cond-assign
- return (match[1] || 'https') + '://player.vimeo.com/video/' + match[2] + '/';
- }
- return url;
- }
-
- function fillSelect(select, values) {
- var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
-
- values.forEach(function (value) {
- var option = document.createElement('option');
- if (value === defaultValue) {
- option.setAttribute('selected', 'selected');
- } else {
- option.setAttribute('value', value);
- }
- select.appendChild(option);
- });
- }
-
- exports.BaseTooltip = BaseTooltip;
- exports.default = BaseTheme;
-
- /***/
- }),
-/* 50 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- Object.defineProperty(exports, "__esModule", { value: true });
- var LinkedList = /** @class */ (function () {
- function LinkedList() {
- this.head = this.tail = null;
- this.length = 0;
- }
- LinkedList.prototype.append = function () {
- var nodes = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- nodes[_i] = arguments[_i];
- }
- this.insertBefore(nodes[0], null);
- if (nodes.length > 1) {
- this.append.apply(this, nodes.slice(1));
- }
- };
- LinkedList.prototype.contains = function (node) {
- var cur, next = this.iterator();
- while ((cur = next())) {
- if (cur === node)
- return true;
- }
- return false;
- };
- LinkedList.prototype.insertBefore = function (node, refNode) {
- if (!node)
- return;
- node.next = refNode;
- if (refNode != null) {
- node.prev = refNode.prev;
- if (refNode.prev != null) {
- refNode.prev.next = node;
- }
- refNode.prev = node;
- if (refNode === this.head) {
- this.head = node;
- }
- }
- else if (this.tail != null) {
- this.tail.next = node;
- node.prev = this.tail;
- this.tail = node;
- }
- else {
- node.prev = null;
- this.head = this.tail = node;
- }
- this.length += 1;
- };
- LinkedList.prototype.offset = function (target) {
- var index = 0, cur = this.head;
- while (cur != null) {
- if (cur === target)
- return index;
- index += cur.length();
- cur = cur.next;
- }
- return -1;
- };
- LinkedList.prototype.remove = function (node) {
- if (!this.contains(node))
- return;
- if (node.prev != null)
- node.prev.next = node.next;
- if (node.next != null)
- node.next.prev = node.prev;
- if (node === this.head)
- this.head = node.next;
- if (node === this.tail)
- this.tail = node.prev;
- this.length -= 1;
- };
- LinkedList.prototype.iterator = function (curNode) {
- if (curNode === void 0) { curNode = this.head; }
- // TODO use yield when we can
- return function () {
- var ret = curNode;
- if (curNode != null)
- curNode = curNode.next;
- return ret;
- };
- };
- LinkedList.prototype.find = function (index, inclusive) {
- if (inclusive === void 0) { inclusive = false; }
- var cur, next = this.iterator();
- while ((cur = next())) {
- var length = cur.length();
- if (index < length ||
- (inclusive && index === length && (cur.next == null || cur.next.length() !== 0))) {
- return [cur, index];
- }
- index -= length;
- }
- return [null, 0];
- };
- LinkedList.prototype.forEach = function (callback) {
- var cur, next = this.iterator();
- while ((cur = next())) {
- callback(cur);
- }
- };
- LinkedList.prototype.forEachAt = function (index, length, callback) {
- if (length <= 0)
- return;
- var _a = this.find(index), startNode = _a[0], offset = _a[1];
- var cur, curIndex = index - offset, next = this.iterator(startNode);
- while ((cur = next()) && curIndex < index + length) {
- var curLength = cur.length();
- if (index > curIndex) {
- callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index));
- }
- else {
- callback(cur, 0, Math.min(curLength, index + length - curIndex));
- }
- curIndex += curLength;
- }
- };
- LinkedList.prototype.map = function (callback) {
- return this.reduce(function (memo, cur) {
- memo.push(callback(cur));
- return memo;
- }, []);
- };
- LinkedList.prototype.reduce = function (callback, memo) {
- var cur, next = this.iterator();
- while ((cur = next())) {
- memo = callback(memo, cur);
- }
- return memo;
- };
- return LinkedList;
- }());
- exports.default = LinkedList;
-
-
- /***/
- }),
-/* 51 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var container_1 = __webpack_require__(17);
- var Registry = __webpack_require__(2);
- var OBSERVER_CONFIG = {
- attributes: true,
- characterData: true,
- characterDataOldValue: true,
- childList: true,
- subtree: true,
- };
- var MAX_OPTIMIZE_ITERATIONS = 100;
- var ScrollBlot = /** @class */ (function (_super) {
- __extends(ScrollBlot, _super);
- function ScrollBlot(node) {
- var _this = _super.call(this, node) || this;
- _this.scroll = _this;
- _this.observer = new MutationObserver(function (mutations) {
- _this.update(mutations);
- });
- _this.observer.observe(_this.domNode, OBSERVER_CONFIG);
- _this.attach();
- return _this;
- }
- ScrollBlot.prototype.detach = function () {
- _super.prototype.detach.call(this);
- this.observer.disconnect();
- };
- ScrollBlot.prototype.deleteAt = function (index, length) {
- this.update();
- if (index === 0 && length === this.length()) {
- this.children.forEach(function (child) {
- child.remove();
- });
- }
- else {
- _super.prototype.deleteAt.call(this, index, length);
- }
- };
- ScrollBlot.prototype.formatAt = function (index, length, name, value) {
- this.update();
- _super.prototype.formatAt.call(this, index, length, name, value);
- };
- ScrollBlot.prototype.insertAt = function (index, value, def) {
- this.update();
- _super.prototype.insertAt.call(this, index, value, def);
- };
- ScrollBlot.prototype.optimize = function (mutations, context) {
- var _this = this;
- if (mutations === void 0) { mutations = []; }
- if (context === void 0) { context = {}; }
- _super.prototype.optimize.call(this, context);
- // We must modify mutations directly, cannot make copy and then modify
- var records = [].slice.call(this.observer.takeRecords());
- // Array.push currently seems to be implemented by a non-tail recursive function
- // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords());
- while (records.length > 0)
- mutations.push(records.pop());
- // TODO use WeakMap
- var mark = function (blot, markParent) {
- if (markParent === void 0) { markParent = true; }
- if (blot == null || blot === _this)
- return;
- if (blot.domNode.parentNode == null)
- return;
- // @ts-ignore
- if (blot.domNode[Registry.DATA_KEY].mutations == null) {
- // @ts-ignore
- blot.domNode[Registry.DATA_KEY].mutations = [];
- }
- if (markParent)
- mark(blot.parent);
- };
- var optimize = function (blot) {
- // Post-order traversal
- if (
- // @ts-ignore
- blot.domNode[Registry.DATA_KEY] == null ||
- // @ts-ignore
- blot.domNode[Registry.DATA_KEY].mutations == null) {
- return;
- }
- if (blot instanceof container_1.default) {
- blot.children.forEach(optimize);
- }
- blot.optimize(context);
- };
- var remaining = mutations;
- for (var i = 0; remaining.length > 0; i += 1) {
- if (i >= MAX_OPTIMIZE_ITERATIONS) {
- throw new Error('[Parchment] Maximum optimize iterations reached');
- }
- remaining.forEach(function (mutation) {
- var blot = Registry.find(mutation.target, true);
- if (blot == null)
- return;
- if (blot.domNode === mutation.target) {
- if (mutation.type === 'childList') {
- mark(Registry.find(mutation.previousSibling, false));
- [].forEach.call(mutation.addedNodes, function (node) {
- var child = Registry.find(node, false);
- mark(child, false);
- if (child instanceof container_1.default) {
- child.children.forEach(function (grandChild) {
- mark(grandChild, false);
- });
- }
- });
- }
- else if (mutation.type === 'attributes') {
- mark(blot.prev);
- }
- }
- mark(blot);
- });
- this.children.forEach(optimize);
- remaining = [].slice.call(this.observer.takeRecords());
- records = remaining.slice();
- while (records.length > 0)
- mutations.push(records.pop());
- }
- };
- ScrollBlot.prototype.update = function (mutations, context) {
- var _this = this;
- if (context === void 0) { context = {}; }
- mutations = mutations || this.observer.takeRecords();
- // TODO use WeakMap
- mutations
- .map(function (mutation) {
- var blot = Registry.find(mutation.target, true);
- if (blot == null)
- return null;
- // @ts-ignore
- if (blot.domNode[Registry.DATA_KEY].mutations == null) {
- // @ts-ignore
- blot.domNode[Registry.DATA_KEY].mutations = [mutation];
- return blot;
- }
- else {
- // @ts-ignore
- blot.domNode[Registry.DATA_KEY].mutations.push(mutation);
- return null;
- }
- })
- .forEach(function (blot) {
- if (blot == null ||
- blot === _this ||
- //@ts-ignore
- blot.domNode[Registry.DATA_KEY] == null)
- return;
- // @ts-ignore
- blot.update(blot.domNode[Registry.DATA_KEY].mutations || [], context);
- });
- // @ts-ignore
- if (this.domNode[Registry.DATA_KEY].mutations != null) {
- // @ts-ignore
- _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations, context);
- }
- this.optimize(mutations, context);
- };
- ScrollBlot.blotName = 'scroll';
- ScrollBlot.defaultChild = 'block';
- ScrollBlot.scope = Registry.Scope.BLOCK_BLOT;
- ScrollBlot.tagName = 'DIV';
- return ScrollBlot;
- }(container_1.default));
- exports.default = ScrollBlot;
-
-
- /***/
- }),
-/* 52 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var format_1 = __webpack_require__(18);
- var Registry = __webpack_require__(2);
- // Shallow object comparison
- function isEqual(obj1, obj2) {
- if (Object.keys(obj1).length !== Object.keys(obj2).length)
- return false;
- // @ts-ignore
- for (var prop in obj1) {
- // @ts-ignore
- if (obj1[prop] !== obj2[prop])
- return false;
- }
- return true;
- }
- var InlineBlot = /** @class */ (function (_super) {
- __extends(InlineBlot, _super);
- function InlineBlot() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- InlineBlot.formats = function (domNode) {
- if (domNode.tagName === InlineBlot.tagName)
- return undefined;
- return _super.formats.call(this, domNode);
- };
- InlineBlot.prototype.format = function (name, value) {
- var _this = this;
- if (name === this.statics.blotName && !value) {
- this.children.forEach(function (child) {
- if (!(child instanceof format_1.default)) {
- child = child.wrap(InlineBlot.blotName, true);
- }
- _this.attributes.copy(child);
- });
- this.unwrap();
- }
- else {
- _super.prototype.format.call(this, name, value);
- }
- };
- InlineBlot.prototype.formatAt = function (index, length, name, value) {
- if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) {
- var blot = this.isolate(index, length);
- blot.format(name, value);
- }
- else {
- _super.prototype.formatAt.call(this, index, length, name, value);
- }
- };
- InlineBlot.prototype.optimize = function (context) {
- _super.prototype.optimize.call(this, context);
- var formats = this.formats();
- if (Object.keys(formats).length === 0) {
- return this.unwrap(); // unformatted span
- }
- var next = this.next;
- if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) {
- next.moveChildren(this);
- next.remove();
- }
- };
- InlineBlot.blotName = 'inline';
- InlineBlot.scope = Registry.Scope.INLINE_BLOT;
- InlineBlot.tagName = 'SPAN';
- return InlineBlot;
- }(format_1.default));
- exports.default = InlineBlot;
-
-
- /***/
- }),
-/* 53 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var format_1 = __webpack_require__(18);
- var Registry = __webpack_require__(2);
- var BlockBlot = /** @class */ (function (_super) {
- __extends(BlockBlot, _super);
- function BlockBlot() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- BlockBlot.formats = function (domNode) {
- var tagName = Registry.query(BlockBlot.blotName).tagName;
- if (domNode.tagName === tagName)
- return undefined;
- return _super.formats.call(this, domNode);
- };
- BlockBlot.prototype.format = function (name, value) {
- if (Registry.query(name, Registry.Scope.BLOCK) == null) {
- return;
- }
- else if (name === this.statics.blotName && !value) {
- this.replaceWith(BlockBlot.blotName);
- }
- else {
- _super.prototype.format.call(this, name, value);
- }
- };
- BlockBlot.prototype.formatAt = function (index, length, name, value) {
- if (Registry.query(name, Registry.Scope.BLOCK) != null) {
- this.format(name, value);
- }
- else {
- _super.prototype.formatAt.call(this, index, length, name, value);
- }
- };
- BlockBlot.prototype.insertAt = function (index, value, def) {
- if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) {
- // Insert text or inline
- _super.prototype.insertAt.call(this, index, value, def);
- }
- else {
- var after = this.split(index);
- var blot = Registry.create(value, def);
- after.parent.insertBefore(blot, after);
- }
- };
- BlockBlot.prototype.update = function (mutations, context) {
- if (navigator.userAgent.match(/Trident/)) {
- this.build();
- }
- else {
- _super.prototype.update.call(this, mutations, context);
- }
- };
- BlockBlot.blotName = 'block';
- BlockBlot.scope = Registry.Scope.BLOCK_BLOT;
- BlockBlot.tagName = 'P';
- return BlockBlot;
- }(format_1.default));
- exports.default = BlockBlot;
-
-
- /***/
- }),
-/* 54 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var leaf_1 = __webpack_require__(19);
- var EmbedBlot = /** @class */ (function (_super) {
- __extends(EmbedBlot, _super);
- function EmbedBlot() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- EmbedBlot.formats = function (domNode) {
- return undefined;
- };
- EmbedBlot.prototype.format = function (name, value) {
- // super.formatAt wraps, which is what we want in general,
- // but this allows subclasses to overwrite for formats
- // that just apply to particular embeds
- _super.prototype.formatAt.call(this, 0, this.length(), name, value);
- };
- EmbedBlot.prototype.formatAt = function (index, length, name, value) {
- if (index === 0 && length === this.length()) {
- this.format(name, value);
- }
- else {
- _super.prototype.formatAt.call(this, index, length, name, value);
- }
- };
- EmbedBlot.prototype.formats = function () {
- return this.statics.formats(this.domNode);
- };
- return EmbedBlot;
- }(leaf_1.default));
- exports.default = EmbedBlot;
-
-
- /***/
- }),
-/* 55 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var leaf_1 = __webpack_require__(19);
- var Registry = __webpack_require__(2);
- var TextBlot = /** @class */ (function (_super) {
- __extends(TextBlot, _super);
- function TextBlot(node) {
- var _this = _super.call(this, node) || this;
- _this.text = _this.statics.value(_this.domNode);
- return _this;
- }
- TextBlot.create = function (value) {
- return document.createTextNode(value);
- };
- TextBlot.value = function (domNode) {
- var text = domNode.data;
- // @ts-ignore
- if (text['normalize'])
- text = text['normalize']();
- return text;
- };
- TextBlot.prototype.deleteAt = function (index, length) {
- this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length);
- };
- TextBlot.prototype.index = function (node, offset) {
- if (this.domNode === node) {
- return offset;
- }
- return -1;
- };
- TextBlot.prototype.insertAt = function (index, value, def) {
- if (def == null) {
- this.text = this.text.slice(0, index) + value + this.text.slice(index);
- this.domNode.data = this.text;
- }
- else {
- _super.prototype.insertAt.call(this, index, value, def);
- }
- };
- TextBlot.prototype.length = function () {
- return this.text.length;
- };
- TextBlot.prototype.optimize = function (context) {
- _super.prototype.optimize.call(this, context);
- this.text = this.statics.value(this.domNode);
- if (this.text.length === 0) {
- this.remove();
- }
- else if (this.next instanceof TextBlot && this.next.prev === this) {
- this.insertAt(this.length(), this.next.value());
- this.next.remove();
- }
- };
- TextBlot.prototype.position = function (index, inclusive) {
- if (inclusive === void 0) { inclusive = false; }
- return [this.domNode, index];
- };
- TextBlot.prototype.split = function (index, force) {
- if (force === void 0) { force = false; }
- if (!force) {
- if (index === 0)
- return this;
- if (index === this.length())
- return this.next;
- }
- var after = Registry.create(this.domNode.splitText(index));
- this.parent.insertBefore(after, this.next);
- this.text = this.statics.value(this.domNode);
- return after;
- };
- TextBlot.prototype.update = function (mutations, context) {
- var _this = this;
- if (mutations.some(function (mutation) {
- return mutation.type === 'characterData' && mutation.target === _this.domNode;
- })) {
- this.text = this.statics.value(this.domNode);
- }
- };
- TextBlot.prototype.value = function () {
- return this.text;
- };
- TextBlot.blotName = 'text';
- TextBlot.scope = Registry.Scope.INLINE_BLOT;
- return TextBlot;
- }(leaf_1.default));
- exports.default = TextBlot;
-
-
- /***/
- }),
-/* 56 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var elem = document.createElement('div');
- elem.classList.toggle('test-class', false);
- if (elem.classList.contains('test-class')) {
- var _toggle = DOMTokenList.prototype.toggle;
- DOMTokenList.prototype.toggle = function (token, force) {
- if (arguments.length > 1 && !this.contains(token) === !force) {
- return force;
- } else {
- return _toggle.call(this, token);
- }
- };
- }
-
- if (!String.prototype.startsWith) {
- String.prototype.startsWith = function (searchString, position) {
- position = position || 0;
- return this.substr(position, searchString.length) === searchString;
- };
- }
-
- if (!String.prototype.endsWith) {
- String.prototype.endsWith = function (searchString, position) {
- var subjectString = this.toString();
- if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {
- position = subjectString.length;
- }
- position -= searchString.length;
- var lastIndex = subjectString.indexOf(searchString, position);
- return lastIndex !== -1 && lastIndex === position;
- };
- }
-
- if (!Array.prototype.find) {
- Object.defineProperty(Array.prototype, "find", {
- value: function value(predicate) {
- if (this === null) {
- throw new TypeError('Array.prototype.find called on null or undefined');
- }
- if (typeof predicate !== 'function') {
- throw new TypeError('predicate must be a function');
- }
- var list = Object(this);
- var length = list.length >>> 0;
- var thisArg = arguments[1];
- var value;
-
- for (var i = 0; i < length; i++) {
- value = list[i];
- if (predicate.call(thisArg, value, i, list)) {
- return value;
- }
- }
- return undefined;
- }
- });
- }
-
- document.addEventListener("DOMContentLoaded", function () {
- // Disable resizing in Firefox
- document.execCommand("enableObjectResizing", false, false);
- // Disable automatic linkifying in IE11
- document.execCommand("autoUrlDetect", false, false);
- });
-
- /***/
- }),
-/* 57 */
-/***/ (function (module, exports) {
-
- /**
- * This library modifies the diff-patch-match library by Neil Fraser
- * by removing the patch and match functionality and certain advanced
- * options in the diff function. The original license is as follows:
- *
- * ===
- *
- * Diff Match and Patch
- *
- * Copyright 2006 Google Inc.
- * http://code.google.com/p/google-diff-match-patch/
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
- /**
- * The data structure representing a diff is an array of tuples:
- * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]
- * which means: delete 'Hello', add 'Goodbye' and keep ' world.'
- */
- var DIFF_DELETE = -1;
- var DIFF_INSERT = 1;
- var DIFF_EQUAL = 0;
-
-
- /**
- * Find the differences between two texts. Simplifies the problem by stripping
- * any common prefix or suffix off the texts before diffing.
- * @param {string} text1 Old string to be diffed.
- * @param {string} text2 New string to be diffed.
- * @param {Int} cursor_pos Expected edit position in text1 (optional)
- * @return {Array} Array of diff tuples.
- */
- function diff_main(text1, text2, cursor_pos) {
- // Check for equality (speedup).
- if (text1 == text2) {
- if (text1) {
- return [[DIFF_EQUAL, text1]];
- }
- return [];
- }
-
- // Check cursor_pos within bounds
- if (cursor_pos < 0 || text1.length < cursor_pos) {
- cursor_pos = null;
- }
-
- // Trim off common prefix (speedup).
- var commonlength = diff_commonPrefix(text1, text2);
- var commonprefix = text1.substring(0, commonlength);
- text1 = text1.substring(commonlength);
- text2 = text2.substring(commonlength);
-
- // Trim off common suffix (speedup).
- commonlength = diff_commonSuffix(text1, text2);
- var commonsuffix = text1.substring(text1.length - commonlength);
- text1 = text1.substring(0, text1.length - commonlength);
- text2 = text2.substring(0, text2.length - commonlength);
-
- // Compute the diff on the middle block.
- var diffs = diff_compute_(text1, text2);
-
- // Restore the prefix and suffix.
- if (commonprefix) {
- diffs.unshift([DIFF_EQUAL, commonprefix]);
- }
- if (commonsuffix) {
- diffs.push([DIFF_EQUAL, commonsuffix]);
- }
- diff_cleanupMerge(diffs);
- if (cursor_pos != null) {
- diffs = fix_cursor(diffs, cursor_pos);
- }
- diffs = fix_emoji(diffs);
- return diffs;
- };
-
-
- /**
- * Find the differences between two texts. Assumes that the texts do not
- * have any common prefix or suffix.
- * @param {string} text1 Old string to be diffed.
- * @param {string} text2 New string to be diffed.
- * @return {Array} Array of diff tuples.
- */
- function diff_compute_(text1, text2) {
- var diffs;
-
- if (!text1) {
- // Just add some text (speedup).
- return [[DIFF_INSERT, text2]];
- }
-
- if (!text2) {
- // Just delete some text (speedup).
- return [[DIFF_DELETE, text1]];
- }
-
- var longtext = text1.length > text2.length ? text1 : text2;
- var shorttext = text1.length > text2.length ? text2 : text1;
- var i = longtext.indexOf(shorttext);
- if (i != -1) {
- // Shorter text is inside the longer text (speedup).
- diffs = [[DIFF_INSERT, longtext.substring(0, i)],
- [DIFF_EQUAL, shorttext],
- [DIFF_INSERT, longtext.substring(i + shorttext.length)]];
- // Swap insertions for deletions if diff is reversed.
- if (text1.length > text2.length) {
- diffs[0][0] = diffs[2][0] = DIFF_DELETE;
- }
- return diffs;
- }
-
- if (shorttext.length == 1) {
- // Single character string.
- // After the previous speedup, the character can't be an equality.
- return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
- }
-
- // Check to see if the problem can be split in two.
- var hm = diff_halfMatch_(text1, text2);
- if (hm) {
- // A half-match was found, sort out the return data.
- var text1_a = hm[0];
- var text1_b = hm[1];
- var text2_a = hm[2];
- var text2_b = hm[3];
- var mid_common = hm[4];
- // Send both pairs off for separate processing.
- var diffs_a = diff_main(text1_a, text2_a);
- var diffs_b = diff_main(text1_b, text2_b);
- // Merge the results.
- return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);
- }
-
- return diff_bisect_(text1, text2);
- };
-
-
- /**
- * Find the 'middle snake' of a diff, split the problem in two
- * and return the recursively constructed diff.
- * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.
- * @param {string} text1 Old string to be diffed.
- * @param {string} text2 New string to be diffed.
- * @return {Array} Array of diff tuples.
- * @private
- */
- function diff_bisect_(text1, text2) {
- // Cache the text lengths to prevent multiple calls.
- var text1_length = text1.length;
- var text2_length = text2.length;
- var max_d = Math.ceil((text1_length + text2_length) / 2);
- var v_offset = max_d;
- var v_length = 2 * max_d;
- var v1 = new Array(v_length);
- var v2 = new Array(v_length);
- // Setting all elements to -1 is faster in Chrome & Firefox than mixing
- // integers and undefined.
- for (var x = 0; x < v_length; x++) {
- v1[x] = -1;
- v2[x] = -1;
- }
- v1[v_offset + 1] = 0;
- v2[v_offset + 1] = 0;
- var delta = text1_length - text2_length;
- // If the total number of characters is odd, then the front path will collide
- // with the reverse path.
- var front = (delta % 2 != 0);
- // Offsets for start and end of k loop.
- // Prevents mapping of space beyond the grid.
- var k1start = 0;
- var k1end = 0;
- var k2start = 0;
- var k2end = 0;
- for (var d = 0; d < max_d; d++) {
- // Walk the front path one step.
- for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {
- var k1_offset = v_offset + k1;
- var x1;
- if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) {
- x1 = v1[k1_offset + 1];
- } else {
- x1 = v1[k1_offset - 1] + 1;
- }
- var y1 = x1 - k1;
- while (x1 < text1_length && y1 < text2_length &&
- text1.charAt(x1) == text2.charAt(y1)) {
- x1++;
- y1++;
- }
- v1[k1_offset] = x1;
- if (x1 > text1_length) {
- // Ran off the right of the graph.
- k1end += 2;
- } else if (y1 > text2_length) {
- // Ran off the bottom of the graph.
- k1start += 2;
- } else if (front) {
- var k2_offset = v_offset + delta - k1;
- if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) {
- // Mirror x2 onto top-left coordinate system.
- var x2 = text1_length - v2[k2_offset];
- if (x1 >= x2) {
- // Overlap detected.
- return diff_bisectSplit_(text1, text2, x1, y1);
- }
- }
- }
- }
-
- // Walk the reverse path one step.
- for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {
- var k2_offset = v_offset + k2;
- var x2;
- if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) {
- x2 = v2[k2_offset + 1];
- } else {
- x2 = v2[k2_offset - 1] + 1;
- }
- var y2 = x2 - k2;
- while (x2 < text1_length && y2 < text2_length &&
- text1.charAt(text1_length - x2 - 1) ==
- text2.charAt(text2_length - y2 - 1)) {
- x2++;
- y2++;
- }
- v2[k2_offset] = x2;
- if (x2 > text1_length) {
- // Ran off the left of the graph.
- k2end += 2;
- } else if (y2 > text2_length) {
- // Ran off the top of the graph.
- k2start += 2;
- } else if (!front) {
- var k1_offset = v_offset + delta - k2;
- if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) {
- var x1 = v1[k1_offset];
- var y1 = v_offset + x1 - k1_offset;
- // Mirror x2 onto top-left coordinate system.
- x2 = text1_length - x2;
- if (x1 >= x2) {
- // Overlap detected.
- return diff_bisectSplit_(text1, text2, x1, y1);
- }
- }
- }
- }
- }
- // Diff took too long and hit the deadline or
- // number of diffs equals number of characters, no commonality at all.
- return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
- };
-
-
- /**
- * Given the location of the 'middle snake', split the diff in two parts
- * and recurse.
- * @param {string} text1 Old string to be diffed.
- * @param {string} text2 New string to be diffed.
- * @param {number} x Index of split point in text1.
- * @param {number} y Index of split point in text2.
- * @return {Array} Array of diff tuples.
- */
- function diff_bisectSplit_(text1, text2, x, y) {
- var text1a = text1.substring(0, x);
- var text2a = text2.substring(0, y);
- var text1b = text1.substring(x);
- var text2b = text2.substring(y);
-
- // Compute both diffs serially.
- var diffs = diff_main(text1a, text2a);
- var diffsb = diff_main(text1b, text2b);
-
- return diffs.concat(diffsb);
- };
-
-
- /**
- * Determine the common prefix of two strings.
- * @param {string} text1 First string.
- * @param {string} text2 Second string.
- * @return {number} The number of characters common to the start of each
- * string.
- */
- function diff_commonPrefix(text1, text2) {
- // Quick check for common null cases.
- if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) {
- return 0;
- }
- // Binary search.
- // Performance analysis: http://neil.fraser.name/news/2007/10/09/
- var pointermin = 0;
- var pointermax = Math.min(text1.length, text2.length);
- var pointermid = pointermax;
- var pointerstart = 0;
- while (pointermin < pointermid) {
- if (text1.substring(pointerstart, pointermid) ==
- text2.substring(pointerstart, pointermid)) {
- pointermin = pointermid;
- pointerstart = pointermin;
- } else {
- pointermax = pointermid;
- }
- pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
- }
- return pointermid;
- };
-
-
- /**
- * Determine the common suffix of two strings.
- * @param {string} text1 First string.
- * @param {string} text2 Second string.
- * @return {number} The number of characters common to the end of each string.
- */
- function diff_commonSuffix(text1, text2) {
- // Quick check for common null cases.
- if (!text1 || !text2 ||
- text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) {
- return 0;
- }
- // Binary search.
- // Performance analysis: http://neil.fraser.name/news/2007/10/09/
- var pointermin = 0;
- var pointermax = Math.min(text1.length, text2.length);
- var pointermid = pointermax;
- var pointerend = 0;
- while (pointermin < pointermid) {
- if (text1.substring(text1.length - pointermid, text1.length - pointerend) ==
- text2.substring(text2.length - pointermid, text2.length - pointerend)) {
- pointermin = pointermid;
- pointerend = pointermin;
- } else {
- pointermax = pointermid;
- }
- pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
- }
- return pointermid;
- };
-
-
- /**
- * Do the two texts share a substring which is at least half the length of the
- * longer text?
- * This speedup can produce non-minimal diffs.
- * @param {string} text1 First string.
- * @param {string} text2 Second string.
- * @return {Array.<string>} Five element Array, containing the prefix of
- * text1, the suffix of text1, the prefix of text2, the suffix of
- * text2 and the common middle. Or null if there was no match.
- */
- function diff_halfMatch_(text1, text2) {
- var longtext = text1.length > text2.length ? text1 : text2;
- var shorttext = text1.length > text2.length ? text2 : text1;
- if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {
- return null; // Pointless.
- }
-
- /**
- * Does a substring of shorttext exist within longtext such that the substring
- * is at least half the length of longtext?
- * Closure, but does not reference any external variables.
- * @param {string} longtext Longer string.
- * @param {string} shorttext Shorter string.
- * @param {number} i Start index of quarter length substring within longtext.
- * @return {Array.<string>} Five element Array, containing the prefix of
- * longtext, the suffix of longtext, the prefix of shorttext, the suffix
- * of shorttext and the common middle. Or null if there was no match.
- * @private
- */
- function diff_halfMatchI_(longtext, shorttext, i) {
- // Start with a 1/4 length substring at position i as a seed.
- var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));
- var j = -1;
- var best_common = '';
- var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;
- while ((j = shorttext.indexOf(seed, j + 1)) != -1) {
- var prefixLength = diff_commonPrefix(longtext.substring(i),
- shorttext.substring(j));
- var suffixLength = diff_commonSuffix(longtext.substring(0, i),
- shorttext.substring(0, j));
- if (best_common.length < suffixLength + prefixLength) {
- best_common = shorttext.substring(j - suffixLength, j) +
- shorttext.substring(j, j + prefixLength);
- best_longtext_a = longtext.substring(0, i - suffixLength);
- best_longtext_b = longtext.substring(i + prefixLength);
- best_shorttext_a = shorttext.substring(0, j - suffixLength);
- best_shorttext_b = shorttext.substring(j + prefixLength);
- }
- }
- if (best_common.length * 2 >= longtext.length) {
- return [best_longtext_a, best_longtext_b,
- best_shorttext_a, best_shorttext_b, best_common];
- } else {
- return null;
- }
- }
-
- // First check if the second quarter is the seed for a half-match.
- var hm1 = diff_halfMatchI_(longtext, shorttext,
- Math.ceil(longtext.length / 4));
- // Check again based on the third quarter.
- var hm2 = diff_halfMatchI_(longtext, shorttext,
- Math.ceil(longtext.length / 2));
- var hm;
- if (!hm1 && !hm2) {
- return null;
- } else if (!hm2) {
- hm = hm1;
- } else if (!hm1) {
- hm = hm2;
- } else {
- // Both matched. Select the longest.
- hm = hm1[4].length > hm2[4].length ? hm1 : hm2;
- }
-
- // A half-match was found, sort out the return data.
- var text1_a, text1_b, text2_a, text2_b;
- if (text1.length > text2.length) {
- text1_a = hm[0];
- text1_b = hm[1];
- text2_a = hm[2];
- text2_b = hm[3];
- } else {
- text2_a = hm[0];
- text2_b = hm[1];
- text1_a = hm[2];
- text1_b = hm[3];
- }
- var mid_common = hm[4];
- return [text1_a, text1_b, text2_a, text2_b, mid_common];
- };
-
-
- /**
- * Reorder and merge like edit sections. Merge equalities.
- * Any edit section can move as long as it doesn't cross an equality.
- * @param {Array} diffs Array of diff tuples.
- */
- function diff_cleanupMerge(diffs) {
- diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.
- var pointer = 0;
- var count_delete = 0;
- var count_insert = 0;
- var text_delete = '';
- var text_insert = '';
- var commonlength;
- while (pointer < diffs.length) {
- switch (diffs[pointer][0]) {
- case DIFF_INSERT:
- count_insert++;
- text_insert += diffs[pointer][1];
- pointer++;
- break;
- case DIFF_DELETE:
- count_delete++;
- text_delete += diffs[pointer][1];
- pointer++;
- break;
- case DIFF_EQUAL:
- // Upon reaching an equality, check for prior redundancies.
- if (count_delete + count_insert > 1) {
- if (count_delete !== 0 && count_insert !== 0) {
- // Factor out any common prefixies.
- commonlength = diff_commonPrefix(text_insert, text_delete);
- if (commonlength !== 0) {
- if ((pointer - count_delete - count_insert) > 0 &&
- diffs[pointer - count_delete - count_insert - 1][0] ==
- DIFF_EQUAL) {
- diffs[pointer - count_delete - count_insert - 1][1] +=
- text_insert.substring(0, commonlength);
- } else {
- diffs.splice(0, 0, [DIFF_EQUAL,
- text_insert.substring(0, commonlength)]);
- pointer++;
- }
- text_insert = text_insert.substring(commonlength);
- text_delete = text_delete.substring(commonlength);
- }
- // Factor out any common suffixies.
- commonlength = diff_commonSuffix(text_insert, text_delete);
- if (commonlength !== 0) {
- diffs[pointer][1] = text_insert.substring(text_insert.length -
- commonlength) + diffs[pointer][1];
- text_insert = text_insert.substring(0, text_insert.length -
- commonlength);
- text_delete = text_delete.substring(0, text_delete.length -
- commonlength);
- }
- }
- // Delete the offending records and add the merged ones.
- if (count_delete === 0) {
- diffs.splice(pointer - count_insert,
- count_delete + count_insert, [DIFF_INSERT, text_insert]);
- } else if (count_insert === 0) {
- diffs.splice(pointer - count_delete,
- count_delete + count_insert, [DIFF_DELETE, text_delete]);
- } else {
- diffs.splice(pointer - count_delete - count_insert,
- count_delete + count_insert, [DIFF_DELETE, text_delete],
- [DIFF_INSERT, text_insert]);
- }
- pointer = pointer - count_delete - count_insert +
- (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1;
- } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {
- // Merge this equality with the previous one.
- diffs[pointer - 1][1] += diffs[pointer][1];
- diffs.splice(pointer, 1);
- } else {
- pointer++;
- }
- count_insert = 0;
- count_delete = 0;
- text_delete = '';
- text_insert = '';
- break;
- }
- }
- if (diffs[diffs.length - 1][1] === '') {
- diffs.pop(); // Remove the dummy entry at the end.
- }
-
- // Second pass: look for single edits surrounded on both sides by equalities
- // which can be shifted sideways to eliminate an equality.
- // e.g: A<ins>BA</ins>C -> <ins>AB</ins>AC
- var changes = false;
- pointer = 1;
- // Intentionally ignore the first and last element (don't need checking).
- while (pointer < diffs.length - 1) {
- if (diffs[pointer - 1][0] == DIFF_EQUAL &&
- diffs[pointer + 1][0] == DIFF_EQUAL) {
- // This is a single edit surrounded by equalities.
- if (diffs[pointer][1].substring(diffs[pointer][1].length -
- diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {
- // Shift the edit over the previous equality.
- diffs[pointer][1] = diffs[pointer - 1][1] +
- diffs[pointer][1].substring(0, diffs[pointer][1].length -
- diffs[pointer - 1][1].length);
- diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];
- diffs.splice(pointer - 1, 1);
- changes = true;
- } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==
- diffs[pointer + 1][1]) {
- // Shift the edit over the next equality.
- diffs[pointer - 1][1] += diffs[pointer + 1][1];
- diffs[pointer][1] =
- diffs[pointer][1].substring(diffs[pointer + 1][1].length) +
- diffs[pointer + 1][1];
- diffs.splice(pointer + 1, 1);
- changes = true;
- }
- }
- pointer++;
- }
- // If shifts were made, the diff needs reordering and another shift sweep.
- if (changes) {
- diff_cleanupMerge(diffs);
- }
- };
-
-
- var diff = diff_main;
- diff.INSERT = DIFF_INSERT;
- diff.DELETE = DIFF_DELETE;
- diff.EQUAL = DIFF_EQUAL;
-
- module.exports = diff;
-
- /*
- * Modify a diff such that the cursor position points to the start of a change:
- * E.g.
- * cursor_normalize_diff([[DIFF_EQUAL, 'abc']], 1)
- * => [1, [[DIFF_EQUAL, 'a'], [DIFF_EQUAL, 'bc']]]
- * cursor_normalize_diff([[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xyz']], 2)
- * => [2, [[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xy'], [DIFF_DELETE, 'z']]]
- *
- * @param {Array} diffs Array of diff tuples
- * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds!
- * @return {Array} A tuple [cursor location in the modified diff, modified diff]
- */
- function cursor_normalize_diff(diffs, cursor_pos) {
- if (cursor_pos === 0) {
- return [DIFF_EQUAL, diffs];
- }
- for (var current_pos = 0, i = 0; i < diffs.length; i++) {
- var d = diffs[i];
- if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) {
- var next_pos = current_pos + d[1].length;
- if (cursor_pos === next_pos) {
- return [i + 1, diffs];
- } else if (cursor_pos < next_pos) {
- // copy to prevent side effects
- diffs = diffs.slice();
- // split d into two diff changes
- var split_pos = cursor_pos - current_pos;
- var d_left = [d[0], d[1].slice(0, split_pos)];
- var d_right = [d[0], d[1].slice(split_pos)];
- diffs.splice(i, 1, d_left, d_right);
- return [i + 1, diffs];
- } else {
- current_pos = next_pos;
- }
- }
- }
- throw new Error('cursor_pos is out of bounds!')
- }
-
- /*
- * Modify a diff such that the edit position is "shifted" to the proposed edit location (cursor_position).
- *
- * Case 1)
- * Check if a naive shift is possible:
- * [0, X], [ 1, Y] -> [ 1, Y], [0, X] (if X + Y === Y + X)
- * [0, X], [-1, Y] -> [-1, Y], [0, X] (if X + Y === Y + X) - holds same result
- * Case 2)
- * Check if the following shifts are possible:
- * [0, 'pre'], [ 1, 'prefix'] -> [ 1, 'pre'], [0, 'pre'], [ 1, 'fix']
- * [0, 'pre'], [-1, 'prefix'] -> [-1, 'pre'], [0, 'pre'], [-1, 'fix']
- * ^ ^
- * d d_next
- *
- * @param {Array} diffs Array of diff tuples
- * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds!
- * @return {Array} Array of diff tuples
- */
- function fix_cursor(diffs, cursor_pos) {
- var norm = cursor_normalize_diff(diffs, cursor_pos);
- var ndiffs = norm[1];
- var cursor_pointer = norm[0];
- var d = ndiffs[cursor_pointer];
- var d_next = ndiffs[cursor_pointer + 1];
-
- if (d == null) {
- // Text was deleted from end of original string,
- // cursor is now out of bounds in new string
- return diffs;
- } else if (d[0] !== DIFF_EQUAL) {
- // A modification happened at the cursor location.
- // This is the expected outcome, so we can return the original diff.
- return diffs;
- } else {
- if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) {
- // Case 1)
- // It is possible to perform a naive shift
- ndiffs.splice(cursor_pointer, 2, d_next, d)
- return merge_tuples(ndiffs, cursor_pointer, 2)
- } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) {
- // Case 2)
- // d[1] is a prefix of d_next[1]
- // We can assume that d_next[0] !== 0, since d[0] === 0
- // Shift edit locations..
- ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]);
- var suffix = d_next[1].slice(d[1].length);
- if (suffix.length > 0) {
- ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]);
- }
- return merge_tuples(ndiffs, cursor_pointer, 3)
- } else {
- // Not possible to perform any modification
- return diffs;
- }
- }
- }
-
- /*
- * Check diff did not split surrogate pairs.
- * Ex. [0, '\uD83D'], [-1, '\uDC36'], [1, '\uDC2F'] -> [-1, '\uD83D\uDC36'], [1, '\uD83D\uDC2F']
- * '\uD83D\uDC36' === '🐶', '\uD83D\uDC2F' === '🐯'
- *
- * @param {Array} diffs Array of diff tuples
- * @return {Array} Array of diff tuples
- */
- function fix_emoji(diffs) {
- var compact = false;
- var starts_with_pair_end = function (str) {
- return str.charCodeAt(0) >= 0xDC00 && str.charCodeAt(0) <= 0xDFFF;
- }
- var ends_with_pair_start = function (str) {
- return str.charCodeAt(str.length - 1) >= 0xD800 && str.charCodeAt(str.length - 1) <= 0xDBFF;
- }
- for (var i = 2; i < diffs.length; i += 1) {
- if (diffs[i - 2][0] === DIFF_EQUAL && ends_with_pair_start(diffs[i - 2][1]) &&
- diffs[i - 1][0] === DIFF_DELETE && starts_with_pair_end(diffs[i - 1][1]) &&
- diffs[i][0] === DIFF_INSERT && starts_with_pair_end(diffs[i][1])) {
- compact = true;
-
- diffs[i - 1][1] = diffs[i - 2][1].slice(-1) + diffs[i - 1][1];
- diffs[i][1] = diffs[i - 2][1].slice(-1) + diffs[i][1];
-
- diffs[i - 2][1] = diffs[i - 2][1].slice(0, -1);
- }
- }
- if (!compact) {
- return diffs;
- }
- var fixed_diffs = [];
- for (var i = 0; i < diffs.length; i += 1) {
- if (diffs[i][1].length > 0) {
- fixed_diffs.push(diffs[i]);
- }
- }
- return fixed_diffs;
- }
-
- /*
- * Try to merge tuples with their neigbors in a given range.
- * E.g. [0, 'a'], [0, 'b'] -> [0, 'ab']
- *
- * @param {Array} diffs Array of diff tuples.
- * @param {Int} start Position of the first element to merge (diffs[start] is also merged with diffs[start - 1]).
- * @param {Int} length Number of consecutive elements to check.
- * @return {Array} Array of merged diff tuples.
- */
- function merge_tuples(diffs, start, length) {
- // Check from (start-1) to (start+length).
- for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) {
- if (i + 1 < diffs.length) {
- var left_d = diffs[i];
- var right_d = diffs[i + 1];
- if (left_d[0] === right_d[1]) {
- diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]);
- }
- }
- }
- return diffs;
- }
-
-
- /***/
- }),
-/* 58 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var keysShim;
- if (!Object.keys) {
- // modified from https://github.com/es-shims/es5-shim
- var has = Object.prototype.hasOwnProperty;
- var toStr = Object.prototype.toString;
- var isArgs = __webpack_require__(37); // eslint-disable-line global-require
- var isEnumerable = Object.prototype.propertyIsEnumerable;
- var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
- var hasProtoEnumBug = isEnumerable.call(function () { }, 'prototype');
- var dontEnums = [
- 'toString',
- 'toLocaleString',
- 'valueOf',
- 'hasOwnProperty',
- 'isPrototypeOf',
- 'propertyIsEnumerable',
- 'constructor'
- ];
- var equalsConstructorPrototype = function (o) {
- var ctor = o.constructor;
- return ctor && ctor.prototype === o;
- };
- var excludedKeys = {
- $applicationCache: true,
- $console: true,
- $external: true,
- $frame: true,
- $frameElement: true,
- $frames: true,
- $innerHeight: true,
- $innerWidth: true,
- $onmozfullscreenchange: true,
- $onmozfullscreenerror: true,
- $outerHeight: true,
- $outerWidth: true,
- $pageXOffset: true,
- $pageYOffset: true,
- $parent: true,
- $scrollLeft: true,
- $scrollTop: true,
- $scrollX: true,
- $scrollY: true,
- $self: true,
- $webkitIndexedDB: true,
- $webkitStorageInfo: true,
- $window: true
- };
- var hasAutomationEqualityBug = (function () {
- /* global window */
- if (typeof window === 'undefined') { return false; }
- for (var k in window) {
- try {
- if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
- try {
- equalsConstructorPrototype(window[k]);
- } catch (e) {
- return true;
- }
- }
- } catch (e) {
- return true;
- }
- }
- return false;
- }());
- var equalsConstructorPrototypeIfNotBuggy = function (o) {
- /* global window */
- if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
- return equalsConstructorPrototype(o);
- }
- try {
- return equalsConstructorPrototype(o);
- } catch (e) {
- return false;
- }
- };
-
- keysShim = function keys(object) {
- var isObject = object !== null && typeof object === 'object';
- var isFunction = toStr.call(object) === '[object Function]';
- var isArguments = isArgs(object);
- var isString = isObject && toStr.call(object) === '[object String]';
- var theKeys = [];
-
- if (!isObject && !isFunction && !isArguments) {
- throw new TypeError('Object.keys called on a non-object');
- }
-
- var skipProto = hasProtoEnumBug && isFunction;
- if (isString && object.length > 0 && !has.call(object, 0)) {
- for (var i = 0; i < object.length; ++i) {
- theKeys.push(String(i));
- }
- }
-
- if (isArguments && object.length > 0) {
- for (var j = 0; j < object.length; ++j) {
- theKeys.push(String(j));
- }
- } else {
- for (var name in object) {
- if (!(skipProto && name === 'prototype') && has.call(object, name)) {
- theKeys.push(String(name));
- }
- }
- }
-
- if (hasDontEnumBug) {
- var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
-
- for (var k = 0; k < dontEnums.length; ++k) {
- if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
- theKeys.push(dontEnums[k]);
- }
- }
- }
- return theKeys;
- };
- }
- module.exports = keysShim;
-
-
- /***/
- }),
-/* 59 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
- var toStr = Object.prototype.toString;
-
- var isStandardArguments = function isArguments(value) {
- if (hasToStringTag && value && typeof value === 'object' && Symbol.toStringTag in value) {
- return false;
- }
- return toStr.call(value) === '[object Arguments]';
- };
-
- var isLegacyArguments = function isArguments(value) {
- if (isStandardArguments(value)) {
- return true;
- }
- return value !== null &&
- typeof value === 'object' &&
- typeof value.length === 'number' &&
- value.length >= 0 &&
- toStr.call(value) !== '[object Array]' &&
- toStr.call(value.callee) === '[object Function]';
- };
-
- var supportsStandardArguments = (function () {
- return isStandardArguments(arguments);
- }());
-
- isStandardArguments.isLegacyArguments = isLegacyArguments; // for tests
-
- module.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments;
-
-
- /***/
- }),
-/* 60 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- // http://www.ecma-international.org/ecma-262/6.0/#sec-object.is
-
- var numberIsNaN = function (value) {
- return value !== value;
- };
-
- module.exports = function is(a, b) {
- if (a === 0 && b === 0) {
- return 1 / a === 1 / b;
- }
- if (a === b) {
- return true;
- }
- if (numberIsNaN(a) && numberIsNaN(b)) {
- return true;
- }
- return false;
- };
-
-
-
- /***/
- }),
-/* 61 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var has = __webpack_require__(62);
- var regexExec = RegExp.prototype.exec;
- var gOPD = Object.getOwnPropertyDescriptor;
-
- var tryRegexExecCall = function tryRegexExec(value) {
- try {
- var lastIndex = value.lastIndex;
- value.lastIndex = 0; // eslint-disable-line no-param-reassign
-
- regexExec.call(value);
- return true;
- } catch (e) {
- return false;
- } finally {
- value.lastIndex = lastIndex; // eslint-disable-line no-param-reassign
- }
- };
- var toStr = Object.prototype.toString;
- var regexClass = '[object RegExp]';
- var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
-
- module.exports = function isRegex(value) {
- if (!value || typeof value !== 'object') {
- return false;
- }
- if (!hasToStringTag) {
- return toStr.call(value) === regexClass;
- }
-
- var descriptor = gOPD(value, 'lastIndex');
- var hasLastIndexDataProperty = descriptor && has(descriptor, 'value');
- if (!hasLastIndexDataProperty) {
- return false;
- }
-
- return tryRegexExecCall(value);
- };
-
-
- /***/
- }),
-/* 62 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var bind = __webpack_require__(20);
-
- module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
-
-
- /***/
- }),
-/* 63 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- /* eslint no-invalid-this: 1 */
-
- var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
- var slice = Array.prototype.slice;
- var toStr = Object.prototype.toString;
- var funcType = '[object Function]';
-
- module.exports = function bind(that) {
- var target = this;
- if (typeof target !== 'function' || toStr.call(target) !== funcType) {
- throw new TypeError(ERROR_MESSAGE + target);
- }
- var args = slice.call(arguments, 1);
-
- var bound;
- var binder = function () {
- if (this instanceof bound) {
- var result = target.apply(
- this,
- args.concat(slice.call(arguments))
- );
- if (Object(result) === result) {
- return result;
- }
- return this;
- } else {
- return target.apply(
- that,
- args.concat(slice.call(arguments))
- );
- }
- };
-
- var boundLength = Math.max(0, target.length - args.length);
- var boundArgs = [];
- for (var i = 0; i < boundLength; i++) {
- boundArgs.push('$' + i);
- }
-
- bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
-
- if (target.prototype) {
- var Empty = function Empty() { };
- Empty.prototype = target.prototype;
- bound.prototype = new Empty();
- Empty.prototype = null;
- }
-
- return bound;
- };
-
-
- /***/
- }),
-/* 64 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var define = __webpack_require__(21);
- var callBind = __webpack_require__(65);
-
- var implementation = __webpack_require__(38);
- var getPolyfill = __webpack_require__(39);
- var shim = __webpack_require__(70);
-
- var flagsBound = callBind(implementation);
-
- define(flagsBound, {
- getPolyfill: getPolyfill,
- implementation: implementation,
- shim: shim
- });
-
- module.exports = flagsBound;
-
-
- /***/
- }),
-/* 65 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var bind = __webpack_require__(20);
-
- var GetIntrinsic = __webpack_require__(66);
-
- var $Function = GetIntrinsic('%Function%');
- var $apply = $Function.apply;
- var $call = $Function.call;
-
- module.exports = function callBind() {
- return bind.apply($call, arguments);
- };
-
- module.exports.apply = function applyBind() {
- return bind.apply($apply, arguments);
- };
-
-
- /***/
- }),
-/* 66 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- /* globals
- Atomics,
- SharedArrayBuffer,
- */
-
- var undefined;
-
- var $TypeError = TypeError;
-
- var $gOPD = Object.getOwnPropertyDescriptor;
- if ($gOPD) {
- try {
- $gOPD({}, '');
- } catch (e) {
- $gOPD = null; // this is IE 8, which has a broken gOPD
- }
- }
-
- var throwTypeError = function () { throw new $TypeError(); };
- var ThrowTypeError = $gOPD
- ? (function () {
- try {
- // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
- arguments.callee; // IE 8 does not throw here
- return throwTypeError;
- } catch (calleeThrows) {
- try {
- // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
- return $gOPD(arguments, 'callee').get;
- } catch (gOPDthrows) {
- return throwTypeError;
- }
- }
- }())
- : throwTypeError;
-
- var hasSymbols = __webpack_require__(67)();
-
- var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
-
- var generator; // = function * () {};
- var generatorFunction = generator ? getProto(generator) : undefined;
- var asyncFn; // async function() {};
- var asyncFunction = asyncFn ? asyncFn.constructor : undefined;
- var asyncGen; // async function * () {};
- var asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined;
- var asyncGenIterator = asyncGen ? asyncGen() : undefined;
-
- var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
-
- var INTRINSICS = {
- '%Array%': Array,
- '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
- '%ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype,
- '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
- '%ArrayPrototype%': Array.prototype,
- '%ArrayProto_entries%': Array.prototype.entries,
- '%ArrayProto_forEach%': Array.prototype.forEach,
- '%ArrayProto_keys%': Array.prototype.keys,
- '%ArrayProto_values%': Array.prototype.values,
- '%AsyncFromSyncIteratorPrototype%': undefined,
- '%AsyncFunction%': asyncFunction,
- '%AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined,
- '%AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined,
- '%AsyncGeneratorFunction%': asyncGenFunction,
- '%AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined,
- '%AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined,
- '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
- '%Boolean%': Boolean,
- '%BooleanPrototype%': Boolean.prototype,
- '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
- '%DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype,
- '%Date%': Date,
- '%DatePrototype%': Date.prototype,
- '%decodeURI%': decodeURI,
- '%decodeURIComponent%': decodeURIComponent,
- '%encodeURI%': encodeURI,
- '%encodeURIComponent%': encodeURIComponent,
- '%Error%': Error,
- '%ErrorPrototype%': Error.prototype,
- '%eval%': eval, // eslint-disable-line no-eval
- '%EvalError%': EvalError,
- '%EvalErrorPrototype%': EvalError.prototype,
- '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
- '%Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype,
- '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
- '%Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype,
- '%Function%': Function,
- '%FunctionPrototype%': Function.prototype,
- '%Generator%': generator ? getProto(generator()) : undefined,
- '%GeneratorFunction%': generatorFunction,
- '%GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined,
- '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
- '%Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype,
- '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
- '%Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype,
- '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
- '%Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype,
- '%isFinite%': isFinite,
- '%isNaN%': isNaN,
- '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
- '%JSON%': typeof JSON === 'object' ? JSON : undefined,
- '%JSONParse%': typeof JSON === 'object' ? JSON.parse : undefined,
- '%Map%': typeof Map === 'undefined' ? undefined : Map,
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
- '%MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype,
- '%Math%': Math,
- '%Number%': Number,
- '%NumberPrototype%': Number.prototype,
- '%Object%': Object,
- '%ObjectPrototype%': Object.prototype,
- '%ObjProto_toString%': Object.prototype.toString,
- '%ObjProto_valueOf%': Object.prototype.valueOf,
- '%parseFloat%': parseFloat,
- '%parseInt%': parseInt,
- '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
- '%PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype,
- '%PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then,
- '%Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all,
- '%Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject,
- '%Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve,
- '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
- '%RangeError%': RangeError,
- '%RangeErrorPrototype%': RangeError.prototype,
- '%ReferenceError%': ReferenceError,
- '%ReferenceErrorPrototype%': ReferenceError.prototype,
- '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
- '%RegExp%': RegExp,
- '%RegExpPrototype%': RegExp.prototype,
- '%Set%': typeof Set === 'undefined' ? undefined : Set,
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
- '%SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype,
- '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
- '%SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype,
- '%String%': String,
- '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
- '%StringPrototype%': String.prototype,
- '%Symbol%': hasSymbols ? Symbol : undefined,
- '%SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined,
- '%SyntaxError%': SyntaxError,
- '%SyntaxErrorPrototype%': SyntaxError.prototype,
- '%ThrowTypeError%': ThrowTypeError,
- '%TypedArray%': TypedArray,
- '%TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined,
- '%TypeError%': $TypeError,
- '%TypeErrorPrototype%': $TypeError.prototype,
- '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
- '%Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype,
- '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
- '%Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype,
- '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
- '%Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype,
- '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
- '%Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype,
- '%URIError%': URIError,
- '%URIErrorPrototype%': URIError.prototype,
- '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
- '%WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype,
- '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet,
- '%WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype
- };
-
- var bind = __webpack_require__(20);
- var $replace = bind.call(Function.call, String.prototype.replace);
-
- /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
- var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
- var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
- var stringToPath = function stringToPath(string) {
- var result = [];
- $replace(string, rePropName, function (match, number, quote, subString) {
- result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : (number || match);
- });
- return result;
- };
- /* end adaptation */
-
- var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
- if (!(name in INTRINSICS)) {
- throw new SyntaxError('intrinsic ' + name + ' does not exist!');
- }
-
- // istanbul ignore if // hopefully this is impossible to test :-)
- if (typeof INTRINSICS[name] === 'undefined' && !allowMissing) {
- throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
- }
-
- return INTRINSICS[name];
- };
-
- module.exports = function GetIntrinsic(name, allowMissing) {
- if (typeof name !== 'string' || name.length === 0) {
- throw new TypeError('intrinsic name must be a non-empty string');
- }
- if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
- throw new TypeError('"allowMissing" argument must be a boolean');
- }
-
- var parts = stringToPath(name);
-
- var value = getBaseIntrinsic('%' + (parts.length > 0 ? parts[0] : '') + '%', allowMissing);
- for (var i = 1; i < parts.length; i += 1) {
- if (value != null) {
- if ($gOPD && (i + 1) >= parts.length) {
- var desc = $gOPD(value, parts[i]);
- if (!allowMissing && !(parts[i] in value)) {
- throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
- }
- value = desc ? (desc.get || desc.value) : value[parts[i]];
- } else {
- value = value[parts[i]];
- }
- }
- }
- return value;
- };
-
-
- /***/
- }),
-/* 67 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-/* WEBPACK VAR INJECTION */(function (global) {
-
- var origSymbol = global.Symbol;
- var hasSymbolSham = __webpack_require__(69);
-
- module.exports = function hasNativeSymbols() {
- if (typeof origSymbol !== 'function') { return false; }
- if (typeof Symbol !== 'function') { return false; }
- if (typeof origSymbol('foo') !== 'symbol') { return false; }
- if (typeof Symbol('bar') !== 'symbol') { return false; }
-
- return hasSymbolSham();
- };
-
- /* WEBPACK VAR INJECTION */
- }.call(exports, __webpack_require__(68)))
-
- /***/
- }),
-/* 68 */
-/***/ (function (module, exports) {
-
- var g;
-
- // This works in non-strict mode
- g = (function () {
- return this;
- })();
-
- try {
- // This works if eval is allowed (see CSP)
- g = g || Function("return this")() || (1, eval)("this");
- } catch (e) {
- // This works if the window reference is available
- if (typeof window === "object")
- g = window;
- }
-
- // g can still be undefined, but nothing to do about it...
- // We return undefined, instead of nothing here, so it's
- // easier to handle this case. if(!global) { ...}
-
- module.exports = g;
-
-
- /***/
- }),
-/* 69 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- /* eslint complexity: [2, 18], max-statements: [2, 33] */
- module.exports = function hasSymbols() {
- if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
- if (typeof Symbol.iterator === 'symbol') { return true; }
-
- var obj = {};
- var sym = Symbol('test');
- var symObj = Object(sym);
- if (typeof sym === 'string') { return false; }
-
- if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
- if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
-
- // temp disabled per https://github.com/ljharb/object.assign/issues/17
- // if (sym instanceof Symbol) { return false; }
- // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
- // if (!(symObj instanceof Symbol)) { return false; }
-
- // if (typeof Symbol.prototype.toString !== 'function') { return false; }
- // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
-
- var symVal = 42;
- obj[sym] = symVal;
- for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax
- if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
-
- if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
-
- var syms = Object.getOwnPropertySymbols(obj);
- if (syms.length !== 1 || syms[0] !== sym) { return false; }
-
- if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
-
- if (typeof Object.getOwnPropertyDescriptor === 'function') {
- var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
- if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
- }
-
- return true;
- };
-
-
- /***/
- }),
-/* 70 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var supportsDescriptors = __webpack_require__(21).supportsDescriptors;
- var getPolyfill = __webpack_require__(39);
- var gOPD = Object.getOwnPropertyDescriptor;
- var defineProperty = Object.defineProperty;
- var TypeErr = TypeError;
- var getProto = Object.getPrototypeOf;
- var regex = /a/;
-
- module.exports = function shimFlags() {
- if (!supportsDescriptors || !getProto) {
- throw new TypeErr('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');
- }
- var polyfill = getPolyfill();
- var proto = getProto(regex);
- var descriptor = gOPD(proto, 'flags');
- if (!descriptor || descriptor.get !== polyfill) {
- defineProperty(proto, 'flags', {
- configurable: true,
- enumerable: false,
- get: polyfill
- });
- }
- return polyfill;
- };
-
-
- /***/
- }),
-/* 71 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var getDay = Date.prototype.getDay;
- var tryDateObject = function tryDateGetDayCall(value) {
- try {
- getDay.call(value);
- return true;
- } catch (e) {
- return false;
- }
- };
-
- var toStr = Object.prototype.toString;
- var dateClass = '[object Date]';
- var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
-
- module.exports = function isDateObject(value) {
- if (typeof value !== 'object' || value === null) {
- return false;
- }
- return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass;
- };
-
-
- /***/
- }),
-/* 72 */
-/***/ (function (module, exports) {
-
- 'use strict';
-
- var has = Object.prototype.hasOwnProperty
- , prefix = '~';
-
- /**
- * Constructor to create a storage for our `EE` objects.
- * An `Events` instance is a plain object whose properties are event names.
- *
- * @constructor
- * @api private
- */
- function Events() { }
-
- //
- // We try to not inherit from `Object.prototype`. In some engines creating an
- // instance in this way is faster than calling `Object.create(null)` directly.
- // If `Object.create(null)` is not supported we prefix the event names with a
- // character to make sure that the built-in object properties are not
- // overridden or used as an attack vector.
- //
- if (Object.create) {
- Events.prototype = Object.create(null);
-
- //
- // This hack is needed because the `__proto__` property is still inherited in
- // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
- //
- if (!new Events().__proto__) prefix = false;
- }
-
- /**
- * Representation of a single event listener.
- *
- * @param {Function} fn The listener function.
- * @param {Mixed} context The context to invoke the listener with.
- * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
- * @constructor
- * @api private
- */
- function EE(fn, context, once) {
- this.fn = fn;
- this.context = context;
- this.once = once || false;
- }
-
- /**
- * Minimal `EventEmitter` interface that is molded against the Node.js
- * `EventEmitter` interface.
- *
- * @constructor
- * @api public
- */
- function EventEmitter() {
- this._events = new Events();
- this._eventsCount = 0;
- }
-
- /**
- * Return an array listing the events for which the emitter has registered
- * listeners.
- *
- * @returns {Array}
- * @api public
- */
- EventEmitter.prototype.eventNames = function eventNames() {
- var names = []
- , events
- , name;
-
- if (this._eventsCount === 0) return names;
-
- for (name in (events = this._events)) {
- if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
- }
-
- if (Object.getOwnPropertySymbols) {
- return names.concat(Object.getOwnPropertySymbols(events));
- }
-
- return names;
- };
-
- /**
- * Return the listeners registered for a given event.
- *
- * @param {String|Symbol} event The event name.
- * @param {Boolean} exists Only check if there are listeners.
- * @returns {Array|Boolean}
- * @api public
- */
- EventEmitter.prototype.listeners = function listeners(event, exists) {
- var evt = prefix ? prefix + event : event
- , available = this._events[evt];
-
- if (exists) return !!available;
- if (!available) return [];
- if (available.fn) return [available.fn];
-
- for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {
- ee[i] = available[i].fn;
- }
-
- return ee;
- };
-
- /**
- * Calls each of the listeners registered for a given event.
- *
- * @param {String|Symbol} event The event name.
- * @returns {Boolean} `true` if the event had listeners, else `false`.
- * @api public
- */
- EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
- var evt = prefix ? prefix + event : event;
-
- if (!this._events[evt]) return false;
-
- var listeners = this._events[evt]
- , len = arguments.length
- , args
- , i;
-
- if (listeners.fn) {
- if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
-
- switch (len) {
- case 1: return listeners.fn.call(listeners.context), true;
- case 2: return listeners.fn.call(listeners.context, a1), true;
- case 3: return listeners.fn.call(listeners.context, a1, a2), true;
- case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
- case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
- case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
- }
-
- for (i = 1, args = new Array(len - 1); i < len; i++) {
- args[i - 1] = arguments[i];
- }
-
- listeners.fn.apply(listeners.context, args);
- } else {
- var length = listeners.length
- , j;
-
- for (i = 0; i < length; i++) {
- if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
-
- switch (len) {
- case 1: listeners[i].fn.call(listeners[i].context); break;
- case 2: listeners[i].fn.call(listeners[i].context, a1); break;
- case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
- case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
- default:
- if (!args) for (j = 1, args = new Array(len - 1); j < len; j++) {
- args[j - 1] = arguments[j];
- }
-
- listeners[i].fn.apply(listeners[i].context, args);
- }
- }
- }
-
- return true;
- };
-
- /**
- * Add a listener for a given event.
- *
- * @param {String|Symbol} event The event name.
- * @param {Function} fn The listener function.
- * @param {Mixed} [context=this] The context to invoke the listener with.
- * @returns {EventEmitter} `this`.
- * @api public
- */
- EventEmitter.prototype.on = function on(event, fn, context) {
- var listener = new EE(fn, context || this)
- , evt = prefix ? prefix + event : event;
-
- if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
- else if (!this._events[evt].fn) this._events[evt].push(listener);
- else this._events[evt] = [this._events[evt], listener];
-
- return this;
- };
-
- /**
- * Add a one-time listener for a given event.
- *
- * @param {String|Symbol} event The event name.
- * @param {Function} fn The listener function.
- * @param {Mixed} [context=this] The context to invoke the listener with.
- * @returns {EventEmitter} `this`.
- * @api public
- */
- EventEmitter.prototype.once = function once(event, fn, context) {
- var listener = new EE(fn, context || this, true)
- , evt = prefix ? prefix + event : event;
-
- if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
- else if (!this._events[evt].fn) this._events[evt].push(listener);
- else this._events[evt] = [this._events[evt], listener];
-
- return this;
- };
-
- /**
- * Remove the listeners of a given event.
- *
- * @param {String|Symbol} event The event name.
- * @param {Function} fn Only remove the listeners that match this function.
- * @param {Mixed} context Only remove the listeners that have this context.
- * @param {Boolean} once Only remove one-time listeners.
- * @returns {EventEmitter} `this`.
- * @api public
- */
- EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
- var evt = prefix ? prefix + event : event;
-
- if (!this._events[evt]) return this;
- if (!fn) {
- if (--this._eventsCount === 0) this._events = new Events();
- else delete this._events[evt];
- return this;
- }
-
- var listeners = this._events[evt];
-
- if (listeners.fn) {
- if (
- listeners.fn === fn
- && (!once || listeners.once)
- && (!context || listeners.context === context)
- ) {
- if (--this._eventsCount === 0) this._events = new Events();
- else delete this._events[evt];
- }
- } else {
- for (var i = 0, events = [], length = listeners.length; i < length; i++) {
- if (
- listeners[i].fn !== fn
- || (once && !listeners[i].once)
- || (context && listeners[i].context !== context)
- ) {
- events.push(listeners[i]);
- }
- }
-
- //
- // Reset the array, or remove it completely if we have no more listeners.
- //
- if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
- else if (--this._eventsCount === 0) this._events = new Events();
- else delete this._events[evt];
- }
-
- return this;
- };
-
- /**
- * Remove all listeners, or those of the specified event.
- *
- * @param {String|Symbol} [event] The event name.
- * @returns {EventEmitter} `this`.
- * @api public
- */
- EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
- var evt;
-
- if (event) {
- evt = prefix ? prefix + event : event;
- if (this._events[evt]) {
- if (--this._eventsCount === 0) this._events = new Events();
- else delete this._events[evt];
- }
- } else {
- this._events = new Events();
- this._eventsCount = 0;
- }
-
- return this;
- };
-
- //
- // Alias methods names because people roll like that.
- //
- EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
- EventEmitter.prototype.addListener = EventEmitter.prototype.on;
-
- //
- // This function doesn't apply anymore.
- //
- EventEmitter.prototype.setMaxListeners = function setMaxListeners() {
- return this;
- };
-
- //
- // Expose the prefix.
- //
- EventEmitter.prefixed = prefix;
-
- //
- // Allow `EventEmitter` to be imported as module namespace.
- //
- EventEmitter.EventEmitter = EventEmitter;
-
- //
- // Expose the module.
- //
- if ('undefined' !== typeof module) {
- module.exports = EventEmitter;
- }
-
-
- /***/
- }),
-/* 73 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _quillDelta = __webpack_require__(1);
-
- var _quillDelta2 = _interopRequireDefault(_quillDelta);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- var DeltaTransformer = function () {
- function DeltaTransformer() {
- _classCallCheck(this, DeltaTransformer);
- }
-
- _createClass(DeltaTransformer, [{
- key: "highlightDifference",
- value: function highlightDifference(first, second, color) {
- var firstDelta = new _quillDelta2.default(first);
- var secondDelta = new _quillDelta2.default(second);
- var diff = secondDelta.diff(firstDelta);
- var colored = diff.map(function (op) {
- if (op.insert) {
- if (!op.attributes) op.attributes = {};
- if (op.attributes.background) return op;
- op.attributes.diff = color;
- }
- return op;
- });
- return secondDelta.compose(new _quillDelta2.default(colored));
- }
- }, {
- key: "cleanDifference",
- value: function cleanDifference(delta) {
- return delta.ops.map(function (op) {
- if (op.attributes && op.attributes.diff) {
- delete op.attributes.diff;
- }
- return op;
- });
- }
- }]);
-
- return DeltaTransformer;
- }();
-
- exports.default = DeltaTransformer;
-
- /***/
- }),
-/* 74 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.matchText = exports.matchSpacing = exports.matchNewline = exports.matchBlot = exports.matchAttributor = exports.default = undefined;
-
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
-
- var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _extend2 = __webpack_require__(3);
-
- var _extend3 = _interopRequireDefault(_extend2);
-
- var _quillDelta = __webpack_require__(1);
-
- var _quillDelta2 = _interopRequireDefault(_quillDelta);
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _quill = __webpack_require__(5);
-
- var _quill2 = _interopRequireDefault(_quill);
-
- var _logger = __webpack_require__(10);
-
- var _logger2 = _interopRequireDefault(_logger);
-
- var _module = __webpack_require__(9);
-
- var _module2 = _interopRequireDefault(_module);
-
- var _align = __webpack_require__(42);
-
- var _background = __webpack_require__(43);
-
- var _code = __webpack_require__(13);
-
- var _code2 = _interopRequireDefault(_code);
-
- var _color = __webpack_require__(28);
-
- var _direction = __webpack_require__(44);
-
- var _font = __webpack_require__(45);
-
- var _size = __webpack_require__(46);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var debug = (0, _logger2.default)("quill:clipboard");
-
- var DOM_KEY = "__ql-matcher";
-
- var CLIPBOARD_CONFIG = [[Node.TEXT_NODE, matchText], [Node.TEXT_NODE, matchNewline], ["br", matchBreak], [Node.ELEMENT_NODE, matchNewline], [Node.ELEMENT_NODE, matchBlot], [Node.ELEMENT_NODE, matchSpacing], [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ["li", matchIndent], ["b", matchAlias.bind(matchAlias, "bold")], ["i", matchAlias.bind(matchAlias, "italic")], ["style", matchIgnore]];
-
- var ATTRIBUTE_ATTRIBUTORS = [_align.AlignAttribute, _direction.DirectionAttribute].reduce(function (memo, attr) {
- memo[attr.keyName] = attr;
- return memo;
- }, {});
-
- var STYLE_ATTRIBUTORS = [_align.AlignStyle, _background.BackgroundStyle, _color.ColorStyle, _direction.DirectionStyle, _font.FontStyle, _size.SizeStyle].reduce(function (memo, attr) {
- memo[attr.keyName] = attr;
- return memo;
- }, {});
-
- var Clipboard = function (_Module) {
- _inherits(Clipboard, _Module);
-
- function Clipboard(quill, options) {
- _classCallCheck(this, Clipboard);
-
- var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this, quill, options));
-
- _this.quill.root.addEventListener("paste", _this.onPaste.bind(_this));
- _this.container = _this.quill.addContainer("ql-clipboard");
- _this.container.setAttribute("contenteditable", true);
- _this.container.setAttribute("tabindex", -1);
- _this.matchers = [];
- CLIPBOARD_CONFIG.concat(_this.options.matchers).forEach(function (_ref) {
- var _ref2 = _slicedToArray(_ref, 2),
- selector = _ref2[0],
- matcher = _ref2[1];
-
- if (!options.matchVisual && matcher === matchSpacing) return;
- _this.addMatcher(selector, matcher);
- });
- return _this;
- }
-
- _createClass(Clipboard, [{
- key: "addMatcher",
- value: function addMatcher(selector, matcher) {
- this.matchers.push([selector, matcher]);
- }
- }, {
- key: "convert",
- value: function convert(html) {
- if (typeof html === "string") {
- this.container.innerHTML = html.replace(/\>\r?\n +\</g, "><"); // Remove spaces between tags
- return this.convert();
- }
- var formats = this.quill.getFormat(this.quill.selection.savedRange.index);
- if (formats[_code2.default.blotName]) {
- var text = this.container.innerText;
- this.container.innerHTML = "";
- return new _quillDelta2.default().insert(text, _defineProperty({}, _code2.default.blotName, formats[_code2.default.blotName]));
- }
-
- var _prepareMatching = this.prepareMatching(),
- _prepareMatching2 = _slicedToArray(_prepareMatching, 2),
- elementMatchers = _prepareMatching2[0],
- textMatchers = _prepareMatching2[1];
-
- var delta = traverse(this.container, elementMatchers, textMatchers);
- // Remove trailing newline
- if (deltaEndsWith(delta, "\n") && delta.ops[delta.ops.length - 1].attributes == null) {
- delta = delta.compose(new _quillDelta2.default().retain(delta.length() - 1).delete(1));
- }
- debug.log("convert", this.container.innerHTML, delta);
- this.container.innerHTML = "";
- return delta;
- }
- }, {
- key: "dangerouslyPasteHTML",
- value: function dangerouslyPasteHTML(index, html) {
- var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _quill2.default.sources.API;
-
- if (typeof index === "string") {
- this.quill.setContents(this.convert(index), html);
- this.quill.setSelection(0, _quill2.default.sources.SILENT);
- } else {
- var paste = this.convert(html);
- this.quill.updateContents(new _quillDelta2.default().retain(index).concat(paste), source);
- this.quill.setSelection(index + paste.length(), _quill2.default.sources.SILENT);
- }
- }
- }, {
- key: "onPaste",
- value: function onPaste(e) {
- var _this2 = this;
-
- var text = e.clipboardData.getData("Text");
- var isVeryLargeText = false;
- if (text.length > 25000) {
- e.preventDefault();
- this.container.innerHTML = text;
- isVeryLargeText = true;
- }
- if (!this.quill.isEnabled()) return;
- var range = this.quill.getSelection();
- var delta = new _quillDelta2.default().retain(range.index);
- var scrollTop = this.quill.scrollingContainer.scrollTop;
- this.container.focus();
- this.quill.selection.update(_quill2.default.sources.SILENT);
- setTimeout(function () {
- if (isVeryLargeText) {
- _this2.quill.deleteText(range.index, range.length, _quill2.default.sources.SILENT);
- _this2.quill.insertText(range.index, _this2.container.innerHTML, _quill2.default.sources.USER);
- _this2.quill.setSelection(range.index + _this2.container.innerHTML.length, _quill2.default.sources.SILENT);
- } else {
- delta = delta.concat(_this2.convert()).delete(range.length);
- _this2.quill.updateContents(delta, _quill2.default.sources.USER);
- // range.length contributes to delta.length()
- _this2.quill.setSelection(delta.length() - range.length, _quill2.default.sources.SILENT);
- }
- _this2.quill.scrollingContainer.scrollTop = scrollTop;
- _this2.quill.focus();
- }, 1);
- }
- }, {
- key: "prepareMatching",
- value: function prepareMatching() {
- var _this3 = this;
-
- var elementMatchers = [],
- textMatchers = [];
- this.matchers.forEach(function (pair) {
- var _pair = _slicedToArray(pair, 2),
- selector = _pair[0],
- matcher = _pair[1];
-
- switch (selector) {
- case Node.TEXT_NODE:
- textMatchers.push(matcher);
- break;
- case Node.ELEMENT_NODE:
- elementMatchers.push(matcher);
- break;
- default:
- [].forEach.call(_this3.container.querySelectorAll(selector), function (node) {
- // TODO use weakmap
- node[DOM_KEY] = node[DOM_KEY] || [];
- node[DOM_KEY].push(matcher);
- });
- break;
- }
- });
- return [elementMatchers, textMatchers];
- }
- }]);
-
- return Clipboard;
- }(_module2.default);
-
- Clipboard.DEFAULTS = {
- matchers: [],
- matchVisual: true
- };
-
- function applyFormat(delta, format, value) {
- if ((typeof format === "undefined" ? "undefined" : _typeof(format)) === "object") {
- return Object.keys(format).reduce(function (delta, key) {
- return applyFormat(delta, key, format[key]);
- }, delta);
- } else {
- return delta.reduce(function (delta, op) {
- if (op.attributes && op.attributes[format]) {
- return delta.push(op);
- } else {
- return delta.insert(op.insert, (0, _extend3.default)({}, _defineProperty({}, format, value), op.attributes));
- }
- }, new _quillDelta2.default());
- }
- }
-
- function computeStyle(node) {
- if (node.nodeType !== Node.ELEMENT_NODE) return {};
- var DOM_KEY = "__ql-computed-style";
- return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node));
- }
-
- function deltaEndsWith(delta, text) {
- var endText = "";
- for (var i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) {
- var op = delta.ops[i];
- if (typeof op.insert !== "string") break;
- endText = op.insert + endText;
- }
- return endText.slice(-1 * text.length) === text;
- }
-
- function isLine(node) {
- if (node.childNodes.length === 0) return false; // Exclude embed blocks
- var style = computeStyle(node);
- return ["block", "list-item"].indexOf(style.display) > -1;
- }
-
- function traverse(node, elementMatchers, textMatchers) {
- // Post-order
- if (node.nodeType === node.TEXT_NODE) {
- return textMatchers.reduce(function (delta, matcher) {
- return matcher(node, delta);
- }, new _quillDelta2.default());
- } else if (node.nodeType === node.ELEMENT_NODE) {
- return [].reduce.call(node.childNodes || [], function (delta, childNode) {
- var childrenDelta = traverse(childNode, elementMatchers, textMatchers);
- if (childNode.nodeType === node.ELEMENT_NODE) {
- childrenDelta = elementMatchers.reduce(function (childrenDelta, matcher) {
- return matcher(childNode, childrenDelta);
- }, childrenDelta);
- childrenDelta = (childNode[DOM_KEY] || []).reduce(function (childrenDelta, matcher) {
- return matcher(childNode, childrenDelta);
- }, childrenDelta);
- }
- return delta.concat(childrenDelta);
- }, new _quillDelta2.default());
- } else {
- return new _quillDelta2.default();
- }
- }
-
- function matchAlias(format, node, delta) {
- return applyFormat(delta, format, true);
- }
-
- function matchAttributor(node, delta) {
- var attributes = _parchment2.default.Attributor.Attribute.keys(node);
- var classes = _parchment2.default.Attributor.Class.keys(node);
- var styles = _parchment2.default.Attributor.Style.keys(node);
- var formats = {};
- attributes.concat(classes).concat(styles).forEach(function (name) {
- var attr = _parchment2.default.query(name, _parchment2.default.Scope.ATTRIBUTE);
- if (attr != null) {
- formats[attr.attrName] = attr.value(node);
- if (formats[attr.attrName]) return;
- }
- attr = ATTRIBUTE_ATTRIBUTORS[name];
- if (attr != null && (attr.attrName === name || attr.keyName === name)) {
- formats[attr.attrName] = attr.value(node) || undefined;
- }
- attr = STYLE_ATTRIBUTORS[name];
- if (attr != null && (attr.attrName === name || attr.keyName === name)) {
- attr = STYLE_ATTRIBUTORS[name];
- formats[attr.attrName] = attr.value(node) || undefined;
- }
- });
- if (Object.keys(formats).length > 0) {
- delta = applyFormat(delta, formats);
- }
- return delta;
- }
-
- function matchBlot(node, delta) {
- var match = _parchment2.default.query(node);
- if (match == null) return delta;
- if (match.prototype instanceof _parchment2.default.Embed) {
- var embed = {};
- var value = match.value(node);
- if (value != null) {
- embed[match.blotName] = value;
- delta = new _quillDelta2.default().insert(embed, match.formats(node));
- }
- } else if (typeof match.formats === "function") {
- delta = applyFormat(delta, match.blotName, match.formats(node));
- }
- return delta;
- }
-
- function matchBreak(node, delta) {
- if (!deltaEndsWith(delta, "\n")) {
- delta.insert("\n");
- }
- return delta;
- }
-
- function matchIgnore() {
- return new _quillDelta2.default();
- }
-
- function matchIndent(node, delta) {
- var match = _parchment2.default.query(node);
- if (match == null || match.blotName !== "list-item" || !deltaEndsWith(delta, "\n")) {
- return delta;
- }
- var indent = -1,
- parent = node.parentNode;
- while (!parent.classList.contains("ql-clipboard")) {
- if ((_parchment2.default.query(parent) || {}).blotName === "list") {
- indent += 1;
- }
- parent = parent.parentNode;
- }
- if (indent <= 0) return delta;
- return delta.compose(new _quillDelta2.default().retain(delta.length() - 1).retain(1, { indent: indent }));
- }
-
- function matchNewline(node, delta) {
- if (!deltaEndsWith(delta, "\n")) {
- if (isLine(node) || delta.length() > 0 && node.nextSibling && isLine(node.nextSibling)) {
- delta.insert("\n");
- }
- }
- return delta;
- }
-
- function matchSpacing(node, delta) {
- if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, "\n\n")) {
- var nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom);
- if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight * 1.5) {
- delta.insert("\n");
- }
- }
- return delta;
- }
-
- function matchStyles(node, delta) {
- var formats = {};
- var style = node.style || {};
- if (style.fontStyle && computeStyle(node).fontStyle === "italic") {
- formats.italic = true;
- }
- if (style.fontWeight && (computeStyle(node).fontWeight.startsWith("bold") || parseInt(computeStyle(node).fontWeight) >= 700)) {
- formats.bold = true;
- }
- if (Object.keys(formats).length > 0) {
- delta = applyFormat(delta, formats);
- }
- if (parseFloat(style.textIndent || 0) > 0) {
- // Could be 0.5in
- delta = new _quillDelta2.default().insert("\t").concat(delta);
- }
- return delta;
- }
-
- function matchText(node, delta) {
- var text = node.data;
- // Word represents empty line with <o:p>&nbsp;</o:p>
- if (node.parentNode.tagName === "O:P") {
- return delta.insert(text.trim());
- }
- if (text.trim().length === 0 && node.parentNode.classList.contains("ql-clipboard")) {
- return delta;
- }
- if (!computeStyle(node.parentNode).whiteSpace.startsWith("pre")) {
- // eslint-disable-next-line func-style
- var replacer = function replacer(collapse, match) {
- match = match.replace(/[^\u00a0]/g, ""); // \u00a0 is nbsp;
- return match.length < 1 && collapse ? " " : match;
- };
- text = text.replace(/\r\n/g, " ").replace(/\n/g, " ");
- text = text.replace(/\s\s+/g, replacer.bind(replacer, true)); // collapse whitespace
- if (node.previousSibling == null && isLine(node.parentNode) || node.previousSibling != null && isLine(node.previousSibling)) {
- text = text.replace(/^\s+/, replacer.bind(replacer, false));
- }
- if (node.nextSibling == null && isLine(node.parentNode) || node.nextSibling != null && isLine(node.nextSibling)) {
- text = text.replace(/\s+$/, replacer.bind(replacer, false));
- }
- }
- return delta.insert(text);
- }
-
- exports.default = Clipboard;
- exports.matchAttributor = matchAttributor;
- exports.matchBlot = matchBlot;
- exports.matchNewline = matchNewline;
- exports.matchSpacing = matchSpacing;
- exports.matchText = matchText;
-
- /***/
- }),
-/* 75 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _inline = __webpack_require__(6);
-
- var _inline2 = _interopRequireDefault(_inline);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var Bold = function (_Inline) {
- _inherits(Bold, _Inline);
-
- function Bold() {
- _classCallCheck(this, Bold);
-
- return _possibleConstructorReturn(this, (Bold.__proto__ || Object.getPrototypeOf(Bold)).apply(this, arguments));
- }
-
- _createClass(Bold, [{
- key: 'optimize',
- value: function optimize(context) {
- _get(Bold.prototype.__proto__ || Object.getPrototypeOf(Bold.prototype), 'optimize', this).call(this, context);
- if (this.domNode.tagName !== this.statics.tagName[0]) {
- this.replaceWith(this.statics.blotName);
- }
- }
- }], [{
- key: 'create',
- value: function create() {
- return _get(Bold.__proto__ || Object.getPrototypeOf(Bold), 'create', this).call(this);
- }
- }, {
- key: 'formats',
- value: function formats() {
- return true;
- }
- }]);
-
- return Bold;
- }(_inline2.default);
-
- Bold.blotName = 'bold';
- Bold.tagName = ['STRONG', 'B'];
-
- exports.default = Bold;
-
- /***/
- }),
-/* 76 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.addControls = exports.default = undefined;
-
- var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _quillDelta = __webpack_require__(1);
-
- var _quillDelta2 = _interopRequireDefault(_quillDelta);
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _quill = __webpack_require__(5);
-
- var _quill2 = _interopRequireDefault(_quill);
-
- var _logger = __webpack_require__(10);
-
- var _logger2 = _interopRequireDefault(_logger);
-
- var _module = __webpack_require__(9);
-
- var _module2 = _interopRequireDefault(_module);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var debug = (0, _logger2.default)('quill:toolbar');
-
- var Toolbar = function (_Module) {
- _inherits(Toolbar, _Module);
-
- function Toolbar(quill, options) {
- _classCallCheck(this, Toolbar);
-
- var _this = _possibleConstructorReturn(this, (Toolbar.__proto__ || Object.getPrototypeOf(Toolbar)).call(this, quill, options));
-
- if (Array.isArray(_this.options.container)) {
- var container = document.createElement('div');
- addControls(container, _this.options.container);
- quill.container.parentNode.insertBefore(container, quill.container);
- _this.container = container;
- } else if (typeof _this.options.container === 'string') {
- _this.container = document.querySelector(_this.options.container);
- } else {
- _this.container = _this.options.container;
- }
- if (!(_this.container instanceof HTMLElement)) {
- var _ret;
-
- return _ret = debug.error('Container required for toolbar', _this.options), _possibleConstructorReturn(_this, _ret);
- }
- _this.container.classList.add('ql-toolbar');
- _this.controls = [];
- _this.handlers = {};
- Object.keys(_this.options.handlers).forEach(function (format) {
- _this.addHandler(format, _this.options.handlers[format]);
- });
- [].forEach.call(_this.container.querySelectorAll('button, select'), function (input) {
- _this.attach(input);
- });
- _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (type, range) {
- if (type === _quill2.default.events.SELECTION_CHANGE) {
- _this.update(range);
- }
- });
- _this.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () {
- var _this$quill$selection = _this.quill.selection.getRange(),
- _this$quill$selection2 = _slicedToArray(_this$quill$selection, 1),
- range = _this$quill$selection2[0]; // quill.getSelection triggers update
-
-
- _this.update(range);
- });
- return _this;
- }
-
- _createClass(Toolbar, [{
- key: 'addHandler',
- value: function addHandler(format, handler) {
- this.handlers[format] = handler;
- }
- }, {
- key: 'attach',
- value: function attach(input) {
- var _this2 = this;
-
- var format = [].find.call(input.classList, function (className) {
- return className.indexOf('ql-') === 0;
- });
- if (!format) return;
- format = format.slice('ql-'.length);
- if (input.tagName === 'BUTTON') {
- input.setAttribute('type', 'button');
- }
- if (this.handlers[format] == null) {
- if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) {
- debug.warn('ignoring attaching to disabled format', format, input);
- return;
- }
- if (_parchment2.default.query(format) == null) {
- debug.warn('ignoring attaching to nonexistent format', format, input);
- return;
- }
- }
- var eventName = input.tagName === 'SELECT' ? 'change' : 'click';
- input.addEventListener(eventName, function (e) {
- var value = void 0;
- if (input.tagName === 'SELECT') {
- if (input.selectedIndex < 0) return;
- var selected = input.options[input.selectedIndex];
- if (selected.hasAttribute('selected')) {
- value = false;
- } else {
- value = selected.value || false;
- }
- } else {
- if (input.classList.contains('ql-active')) {
- value = false;
- } else {
- value = input.value || !input.hasAttribute('value');
- }
- e.preventDefault();
- }
- _this2.quill.focus();
-
- var _quill$selection$getR = _this2.quill.selection.getRange(),
- _quill$selection$getR2 = _slicedToArray(_quill$selection$getR, 1),
- range = _quill$selection$getR2[0];
-
- if (_this2.handlers[format] != null) {
- _this2.handlers[format].call(_this2, value);
- } else if (_parchment2.default.query(format).prototype instanceof _parchment2.default.Embed) {
- value = prompt('Enter ' + format);
- if (!value) return;
- _this2.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert(_defineProperty({}, format, value)), _quill2.default.sources.USER);
- } else {
- _this2.quill.format(format, value, _quill2.default.sources.USER);
- }
- _this2.update(range);
- });
- // TODO use weakmap
- this.controls.push([format, input]);
- }
- }, {
- key: 'update',
- value: function update(range) {
- var formats = range == null ? {} : this.quill.getFormat(range);
- this.controls.forEach(function (pair) {
- var _pair = _slicedToArray(pair, 2),
- format = _pair[0],
- input = _pair[1];
-
- if (input.tagName === 'SELECT') {
- var option = void 0;
- if (range == null) {
- option = null;
- } else if (formats[format] == null) {
- option = input.querySelector('option[selected]');
- } else if (!Array.isArray(formats[format])) {
- var value = formats[format];
- if (typeof value === 'string') {
- value = value.replace(/\"/g, '\\"');
- }
- option = input.querySelector('option[value="' + value + '"]');
- }
- if (option == null) {
- input.value = ''; // TODO make configurable?
- input.selectedIndex = -1;
- } else {
- option.selected = true;
- }
- } else {
- if (range == null) {
- input.classList.remove('ql-active');
- } else if (input.hasAttribute('value')) {
- // both being null should match (default values)
- // '1' should match with 1 (headers)
- var isActive = formats[format] === input.getAttribute('value') || formats[format] != null && formats[format].toString() === input.getAttribute('value') || formats[format] == null && !input.getAttribute('value');
- input.classList.toggle('ql-active', isActive);
- } else {
- input.classList.toggle('ql-active', formats[format] != null);
- }
- }
- });
- }
- }]);
-
- return Toolbar;
- }(_module2.default);
-
- Toolbar.DEFAULTS = {};
-
- function addButton(container, format, value) {
- var input = document.createElement('button');
- input.setAttribute('type', 'button');
- input.classList.add('ql-' + format);
- if (value != null) {
- input.value = value;
- }
- container.appendChild(input);
- }
-
- function addControls(container, groups) {
- if (!Array.isArray(groups[0])) {
- groups = [groups];
- }
- groups.forEach(function (controls) {
- var group = document.createElement('span');
- group.classList.add('ql-formats');
- controls.forEach(function (control) {
- if (typeof control === 'string') {
- addButton(group, control);
- } else {
- var format = Object.keys(control)[0];
- var value = control[format];
- if (Array.isArray(value)) {
- addSelect(group, format, value);
- } else {
- addButton(group, format, value);
- }
- }
- });
- container.appendChild(group);
- });
- }
-
- function addSelect(container, format, values) {
- var input = document.createElement('select');
- input.classList.add('ql-' + format);
- values.forEach(function (value) {
- var option = document.createElement('option');
- if (value !== false) {
- option.setAttribute('value', value);
- } else {
- option.setAttribute('selected', 'selected');
- }
- input.appendChild(option);
- });
- container.appendChild(input);
- }
-
- Toolbar.DEFAULTS = {
- container: null,
- handlers: {
- clean: function clean() {
- var _this3 = this;
-
- var range = this.quill.getSelection();
- if (range == null) return;
- if (range.length == 0) {
- var formats = this.quill.getFormat();
- Object.keys(formats).forEach(function (name) {
- // Clean functionality in existing apps only clean inline formats
- if (_parchment2.default.query(name, _parchment2.default.Scope.INLINE) != null) {
- _this3.quill.format(name, false);
- }
- });
- } else {
- this.quill.removeFormat(range, _quill2.default.sources.USER);
- }
- },
- direction: function direction(value) {
- var align = this.quill.getFormat()['align'];
- if (value === 'rtl' && align == null) {
- this.quill.format('align', 'right', _quill2.default.sources.USER);
- } else if (!value && align === 'right') {
- this.quill.format('align', false, _quill2.default.sources.USER);
- }
- this.quill.format('direction', value, _quill2.default.sources.USER);
- },
- indent: function indent(value) {
- var range = this.quill.getSelection();
- var formats = this.quill.getFormat(range);
- var indent = parseInt(formats.indent || 0);
- if (value === '+1' || value === '-1') {
- var modifier = value === '+1' ? 1 : -1;
- if (formats.direction === 'rtl') modifier *= -1;
- this.quill.format('indent', indent + modifier, _quill2.default.sources.USER);
- }
- },
- link: function link(value) {
- if (value === true) {
- value = prompt('Enter link URL:');
- }
- this.quill.format('link', value, _quill2.default.sources.USER);
- },
- list: function list(value) {
- var range = this.quill.getSelection();
- var formats = this.quill.getFormat(range);
- if (value === 'check') {
- if (formats['list'] === 'checked' || formats['list'] === 'unchecked') {
- this.quill.format('list', false, _quill2.default.sources.USER);
- } else {
- this.quill.format('list', 'unchecked', _quill2.default.sources.USER);
- }
- } else {
- this.quill.format('list', value, _quill2.default.sources.USER);
- }
- }
- }
- };
-
- exports.default = Toolbar;
- exports.addControls = addControls;
-
- /***/
- }),
-/* 77 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _picker = __webpack_require__(30);
-
- var _picker2 = _interopRequireDefault(_picker);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var ColorPicker = function (_Picker) {
- _inherits(ColorPicker, _Picker);
-
- function ColorPicker(select, label) {
- _classCallCheck(this, ColorPicker);
-
- var _this = _possibleConstructorReturn(this, (ColorPicker.__proto__ || Object.getPrototypeOf(ColorPicker)).call(this, select));
-
- _this.label.innerHTML = label;
- _this.container.classList.add('ql-color-picker');
- [].slice.call(_this.container.querySelectorAll('.ql-picker-item'), 0, 7).forEach(function (item) {
- item.classList.add('ql-primary');
- });
- return _this;
- }
-
- _createClass(ColorPicker, [{
- key: 'buildItem',
- value: function buildItem(option) {
- var item = _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'buildItem', this).call(this, option);
- item.style.backgroundColor = option.getAttribute('value') || '';
- return item;
- }
- }, {
- key: 'selectItem',
- value: function selectItem(item, trigger) {
- _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'selectItem', this).call(this, item, trigger);
- var colorLabel = this.label.querySelector('.ql-color-label');
- var value = item ? item.getAttribute('data-value') || '' : '';
- if (colorLabel) {
- if (colorLabel.tagName === 'line') {
- colorLabel.style.stroke = value;
- } else {
- colorLabel.style.fill = value;
- }
- }
- }
- }]);
-
- return ColorPicker;
- }(_picker2.default);
-
- exports.default = ColorPicker;
-
- /***/
- }),
-/* 78 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _picker = __webpack_require__(30);
-
- var _picker2 = _interopRequireDefault(_picker);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var IconPicker = function (_Picker) {
- _inherits(IconPicker, _Picker);
-
- function IconPicker(select, icons) {
- _classCallCheck(this, IconPicker);
-
- var _this = _possibleConstructorReturn(this, (IconPicker.__proto__ || Object.getPrototypeOf(IconPicker)).call(this, select));
-
- _this.container.classList.add('ql-icon-picker');
- [].forEach.call(_this.container.querySelectorAll('.ql-picker-item'), function (item) {
- item.innerHTML = icons[item.getAttribute('data-value') || ''];
- });
- _this.defaultItem = _this.container.querySelector('.ql-selected');
- _this.selectItem(_this.defaultItem);
- return _this;
- }
-
- _createClass(IconPicker, [{
- key: 'selectItem',
- value: function selectItem(item, trigger) {
- _get(IconPicker.prototype.__proto__ || Object.getPrototypeOf(IconPicker.prototype), 'selectItem', this).call(this, item, trigger);
- item = item || this.defaultItem;
- this.label.innerHTML = item.innerHTML;
- }
- }]);
-
- return IconPicker;
- }(_picker2.default);
-
- exports.default = IconPicker;
-
- /***/
- }),
-/* 79 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- var Tooltip = function () {
- function Tooltip(quill, boundsContainer) {
- var _this = this;
-
- _classCallCheck(this, Tooltip);
-
- this.quill = quill;
- this.boundsContainer = boundsContainer || document.body;
- this.root = quill.addContainer('ql-tooltip');
- this.root.innerHTML = this.constructor.TEMPLATE;
- if (this.quill.root === this.quill.scrollingContainer) {
- this.quill.root.addEventListener('scroll', function () {
- _this.root.style.marginTop = -1 * _this.quill.root.scrollTop + 'px';
- });
- }
- this.hide();
- }
-
- _createClass(Tooltip, [{
- key: 'hide',
- value: function hide() {
- this.root.classList.add('ql-hidden');
- }
- }, {
- key: 'position',
- value: function position(reference) {
- var left = reference.left + reference.width / 2 - this.root.offsetWidth / 2;
- // root.scrollTop should be 0 if scrollContainer !== root
- var top = reference.bottom + this.quill.root.scrollTop;
- this.root.style.left = left + 'px';
- this.root.style.top = top + 'px';
- this.root.classList.remove('ql-flip');
- var containerBounds = this.boundsContainer.getBoundingClientRect();
- var rootBounds = this.root.getBoundingClientRect();
- var shift = 0;
- if (rootBounds.right > containerBounds.right) {
- shift = containerBounds.right - rootBounds.right;
- this.root.style.left = left + shift + 'px';
- }
- if (rootBounds.left < containerBounds.left) {
- shift = containerBounds.left - rootBounds.left;
- this.root.style.left = left + shift + 'px';
- }
- if (rootBounds.bottom > containerBounds.bottom) {
- var height = rootBounds.bottom - rootBounds.top;
- var verticalShift = reference.bottom - reference.top + height;
- this.root.style.top = top - verticalShift + 'px';
- this.root.classList.add('ql-flip');
- }
- return shift;
- }
- }, {
- key: 'show',
- value: function show() {
- this.root.classList.remove('ql-editing');
- this.root.classList.remove('ql-hidden');
- }
- }]);
-
- return Tooltip;
- }();
-
- exports.default = Tooltip;
-
- /***/
- }),
-/* 80 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _extend = __webpack_require__(3);
-
- var _extend2 = _interopRequireDefault(_extend);
-
- var _emitter = __webpack_require__(8);
-
- var _emitter2 = _interopRequireDefault(_emitter);
-
- var _base = __webpack_require__(49);
-
- var _base2 = _interopRequireDefault(_base);
-
- var _link = __webpack_require__(29);
-
- var _link2 = _interopRequireDefault(_link);
-
- var _selection = __webpack_require__(15);
-
- var _icons = __webpack_require__(47);
-
- var _icons2 = _interopRequireDefault(_icons);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var TOOLBAR_CONFIG = [[{ header: ['1', '2', '3', false] }], ['bold', 'italic', 'underline', 'link'], [{ list: 'ordered' }, { list: 'bullet' }], ['clean']];
-
- var SnowTheme = function (_BaseTheme) {
- _inherits(SnowTheme, _BaseTheme);
-
- function SnowTheme(quill, options) {
- _classCallCheck(this, SnowTheme);
-
- if (options.modules.toolbar != null && options.modules.toolbar.container == null) {
- options.modules.toolbar.container = TOOLBAR_CONFIG;
- }
-
- var _this = _possibleConstructorReturn(this, (SnowTheme.__proto__ || Object.getPrototypeOf(SnowTheme)).call(this, quill, options));
-
- _this.quill.container.classList.add('ql-snow');
- return _this;
- }
-
- _createClass(SnowTheme, [{
- key: 'extendToolbar',
- value: function extendToolbar(toolbar) {
- toolbar.container.classList.add('ql-snow');
- this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default);
- this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default);
- this.tooltip = new SnowTooltip(this.quill, this.options.bounds);
- if (toolbar.container.querySelector('.ql-link')) {
- this.quill.keyboard.addBinding({ key: 'K', shortKey: true }, function (range, context) {
- toolbar.handlers['link'].call(toolbar, !context.format.link);
- });
- }
- }
- }]);
-
- return SnowTheme;
- }(_base2.default);
-
- SnowTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, {
- modules: {
- toolbar: {
- handlers: {
- link: function link(value) {
- if (value) {
- var range = this.quill.getSelection();
- if (range == null || range.length == 0) return;
- var preview = this.quill.getText(range);
- if (/^\S+@\S+\.\S+$/.test(preview) && preview.indexOf('mailto:') !== 0) {
- preview = 'mailto:' + preview;
- }
- var tooltip = this.quill.theme.tooltip;
- tooltip.edit('link', preview);
- } else {
- this.quill.format('link', false);
- }
- }
- }
- }
- }
- });
-
- var SnowTooltip = function (_BaseTooltip) {
- _inherits(SnowTooltip, _BaseTooltip);
-
- function SnowTooltip(quill, bounds) {
- _classCallCheck(this, SnowTooltip);
-
- var _this2 = _possibleConstructorReturn(this, (SnowTooltip.__proto__ || Object.getPrototypeOf(SnowTooltip)).call(this, quill, bounds));
-
- _this2.preview = _this2.root.querySelector('a.ql-preview');
- return _this2;
- }
-
- _createClass(SnowTooltip, [{
- key: 'listen',
- value: function listen() {
- var _this3 = this;
-
- _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'listen', this).call(this);
- this.root.querySelector('a.ql-action').addEventListener('click', function (event) {
- if (_this3.root.classList.contains('ql-editing')) {
- _this3.save();
- } else {
- _this3.edit('link', _this3.preview.textContent);
- }
- event.preventDefault();
- });
- this.root.querySelector('a.ql-remove').addEventListener('click', function (event) {
- if (_this3.linkRange != null) {
- var range = _this3.linkRange;
- _this3.restoreFocus();
- _this3.quill.formatText(range, 'link', false, _emitter2.default.sources.USER);
- delete _this3.linkRange;
- }
- event.preventDefault();
- _this3.hide();
- });
- this.quill.on(_emitter2.default.events.SELECTION_CHANGE, function (range, oldRange, source) {
- if (range == null) return;
- if (range.length === 0 && source === _emitter2.default.sources.USER) {
- var _quill$scroll$descend = _this3.quill.scroll.descendant(_link2.default, range.index),
- _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2),
- link = _quill$scroll$descend2[0],
- offset = _quill$scroll$descend2[1];
-
- if (link != null) {
- _this3.linkRange = new _selection.Range(range.index - offset, link.length());
- var preview = _link2.default.formats(link.domNode);
- _this3.preview.textContent = preview;
- _this3.preview.setAttribute('href', preview);
- _this3.show();
- _this3.position(_this3.quill.getBounds(_this3.linkRange));
- return;
- }
- } else {
- delete _this3.linkRange;
- }
- _this3.hide();
- });
- }
- }, {
- key: 'show',
- value: function show() {
- _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'show', this).call(this);
- this.root.removeAttribute('data-mode');
- }
- }]);
-
- return SnowTooltip;
- }(_base.BaseTooltip);
-
- SnowTooltip.TEMPLATE = ['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>', '<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">', '<a class="ql-action"></a>', '<a class="ql-remove"></a>'].join('');
-
- exports.default = SnowTheme;
-
- /***/
- }),
-/* 81 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _core = __webpack_require__(31);
-
- var _core2 = _interopRequireDefault(_core);
-
- var _align = __webpack_require__(42);
-
- var _direction = __webpack_require__(44);
-
- var _indent = __webpack_require__(82);
-
- var _blockquote = __webpack_require__(83);
-
- var _blockquote2 = _interopRequireDefault(_blockquote);
-
- var _header = __webpack_require__(84);
-
- var _header2 = _interopRequireDefault(_header);
-
- var _list = __webpack_require__(85);
-
- var _list2 = _interopRequireDefault(_list);
-
- var _background = __webpack_require__(43);
-
- var _color = __webpack_require__(28);
-
- var _font = __webpack_require__(45);
-
- var _size = __webpack_require__(46);
-
- var _bold = __webpack_require__(75);
-
- var _bold2 = _interopRequireDefault(_bold);
-
- var _italic = __webpack_require__(86);
-
- var _italic2 = _interopRequireDefault(_italic);
-
- var _link = __webpack_require__(29);
-
- var _link2 = _interopRequireDefault(_link);
-
- var _script = __webpack_require__(87);
-
- var _script2 = _interopRequireDefault(_script);
-
- var _strike = __webpack_require__(88);
-
- var _strike2 = _interopRequireDefault(_strike);
-
- var _underline = __webpack_require__(89);
-
- var _underline2 = _interopRequireDefault(_underline);
-
- var _image = __webpack_require__(90);
-
- var _image2 = _interopRequireDefault(_image);
-
- var _video = __webpack_require__(91);
-
- var _video2 = _interopRequireDefault(_video);
-
- var _code = __webpack_require__(13);
-
- var _code2 = _interopRequireDefault(_code);
-
- var _formula = __webpack_require__(92);
-
- var _formula2 = _interopRequireDefault(_formula);
-
- var _syntax = __webpack_require__(93);
-
- var _syntax2 = _interopRequireDefault(_syntax);
-
- var _toolbar = __webpack_require__(76);
-
- var _toolbar2 = _interopRequireDefault(_toolbar);
-
- var _icons = __webpack_require__(47);
-
- var _icons2 = _interopRequireDefault(_icons);
-
- var _picker = __webpack_require__(30);
-
- var _picker2 = _interopRequireDefault(_picker);
-
- var _colorPicker = __webpack_require__(77);
-
- var _colorPicker2 = _interopRequireDefault(_colorPicker);
-
- var _iconPicker = __webpack_require__(78);
-
- var _iconPicker2 = _interopRequireDefault(_iconPicker);
-
- var _tooltip = __webpack_require__(79);
-
- var _tooltip2 = _interopRequireDefault(_tooltip);
-
- var _bubble = __webpack_require__(132);
-
- var _bubble2 = _interopRequireDefault(_bubble);
-
- var _snow = __webpack_require__(80);
-
- var _snow2 = _interopRequireDefault(_snow);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- _core2.default.register({
- "attributors/attribute/direction": _direction.DirectionAttribute,
-
- "attributors/class/align": _align.AlignClass,
- "attributors/class/background": _background.BackgroundClass,
- "attributors/class/diff": _background.DiffClass,
- "attributors/class/color": _color.ColorClass,
- "attributors/class/direction": _direction.DirectionClass,
- "attributors/class/font": _font.FontClass,
- "attributors/class/size": _size.SizeClass,
-
- "attributors/style/align": _align.AlignStyle,
- "attributors/style/background": _background.BackgroundStyle,
- "attributors/style/diff": _background.DiffStyle,
- "attributors/style/color": _color.ColorStyle,
- "attributors/style/direction": _direction.DirectionStyle,
- "attributors/style/font": _font.FontStyle,
- "attributors/style/size": _size.SizeStyle
- }, true);
-
- _core2.default.register({
- "formats/align": _align.AlignClass,
- "formats/direction": _direction.DirectionClass,
- "formats/indent": _indent.IndentClass,
-
- "formats/background": _background.BackgroundStyle,
- "formats/diff": _background.DiffStyle,
- "formats/color": _color.ColorStyle,
- "formats/font": _font.FontClass,
- "formats/size": _size.SizeClass,
-
- "formats/blockquote": _blockquote2.default,
- "formats/code-block": _code2.default,
- "formats/header": _header2.default,
- "formats/list": _list2.default,
-
- "formats/bold": _bold2.default,
- "formats/code": _code.Code,
- "formats/italic": _italic2.default,
- "formats/link": _link2.default,
- "formats/script": _script2.default,
- "formats/strike": _strike2.default,
- "formats/underline": _underline2.default,
-
- "formats/image": _image2.default,
- "formats/video": _video2.default,
-
- "formats/list/item": _list.ListItem,
-
- "modules/formula": _formula2.default,
- "modules/syntax": _syntax2.default,
- "modules/toolbar": _toolbar2.default,
-
- "themes/bubble": _bubble2.default,
- "themes/snow": _snow2.default,
-
- "ui/icons": _icons2.default,
- "ui/picker": _picker2.default,
- "ui/icon-picker": _iconPicker2.default,
- "ui/color-picker": _colorPicker2.default,
- "ui/tooltip": _tooltip2.default
- }, true);
-
- exports.default = _core2.default;
-
- /***/
- }),
-/* 82 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.IndentClass = undefined;
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var IdentAttributor = function (_Parchment$Attributor) {
- _inherits(IdentAttributor, _Parchment$Attributor);
-
- function IdentAttributor() {
- _classCallCheck(this, IdentAttributor);
-
- return _possibleConstructorReturn(this, (IdentAttributor.__proto__ || Object.getPrototypeOf(IdentAttributor)).apply(this, arguments));
- }
-
- _createClass(IdentAttributor, [{
- key: 'add',
- value: function add(node, value) {
- if (value === '+1' || value === '-1') {
- var indent = this.value(node) || 0;
- value = value === '+1' ? indent + 1 : indent - 1;
- }
- if (value === 0) {
- this.remove(node);
- return true;
- } else {
- return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'add', this).call(this, node, value);
- }
- }
- }, {
- key: 'canAdd',
- value: function canAdd(node, value) {
- return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'canAdd', this).call(this, node, value) || _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'canAdd', this).call(this, node, parseInt(value));
- }
- }, {
- key: 'value',
- value: function value(node) {
- return parseInt(_get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'value', this).call(this, node)) || undefined; // Don't return NaN
- }
- }]);
-
- return IdentAttributor;
- }(_parchment2.default.Attributor.Class);
-
- var IndentClass = new IdentAttributor('indent', 'ql-indent', {
- scope: _parchment2.default.Scope.BLOCK,
- whitelist: [1, 2, 3, 4, 5, 6, 7, 8]
- });
-
- exports.IndentClass = IndentClass;
-
- /***/
- }),
-/* 83 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _block = __webpack_require__(4);
-
- var _block2 = _interopRequireDefault(_block);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var Blockquote = function (_Block) {
- _inherits(Blockquote, _Block);
-
- function Blockquote() {
- _classCallCheck(this, Blockquote);
-
- return _possibleConstructorReturn(this, (Blockquote.__proto__ || Object.getPrototypeOf(Blockquote)).apply(this, arguments));
- }
-
- return Blockquote;
- }(_block2.default);
-
- Blockquote.blotName = 'blockquote';
- Blockquote.tagName = 'blockquote';
-
- exports.default = Blockquote;
-
- /***/
- }),
-/* 84 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _block = __webpack_require__(4);
-
- var _block2 = _interopRequireDefault(_block);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var Header = function (_Block) {
- _inherits(Header, _Block);
-
- function Header() {
- _classCallCheck(this, Header);
-
- return _possibleConstructorReturn(this, (Header.__proto__ || Object.getPrototypeOf(Header)).apply(this, arguments));
- }
-
- _createClass(Header, null, [{
- key: 'formats',
- value: function formats(domNode) {
- return this.tagName.indexOf(domNode.tagName) + 1;
- }
- }]);
-
- return Header;
- }(_block2.default);
-
- Header.blotName = 'header';
- Header.tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'];
-
- exports.default = Header;
-
- /***/
- }),
-/* 85 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = exports.ListItem = undefined;
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _block = __webpack_require__(4);
-
- var _block2 = _interopRequireDefault(_block);
-
- var _container = __webpack_require__(27);
-
- var _container2 = _interopRequireDefault(_container);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var ListItem = function (_Block) {
- _inherits(ListItem, _Block);
-
- function ListItem() {
- _classCallCheck(this, ListItem);
-
- return _possibleConstructorReturn(this, (ListItem.__proto__ || Object.getPrototypeOf(ListItem)).apply(this, arguments));
- }
-
- _createClass(ListItem, [{
- key: 'format',
- value: function format(name, value) {
- if (name === List.blotName && !value) {
- this.replaceWith(_parchment2.default.create(this.statics.scope));
- } else {
- _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'format', this).call(this, name, value);
- }
- }
- }, {
- key: 'remove',
- value: function remove() {
- if (this.prev == null && this.next == null) {
- this.parent.remove();
- } else {
- _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'remove', this).call(this);
- }
- }
- }, {
- key: 'replaceWith',
- value: function replaceWith(name, value) {
- this.parent.isolate(this.offset(this.parent), this.length());
- if (name === this.parent.statics.blotName) {
- this.parent.replaceWith(name, value);
- return this;
- } else {
- this.parent.unwrap();
- return _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'replaceWith', this).call(this, name, value);
- }
- }
- }], [{
- key: 'formats',
- value: function formats(domNode) {
- return domNode.tagName === this.tagName ? undefined : _get(ListItem.__proto__ || Object.getPrototypeOf(ListItem), 'formats', this).call(this, domNode);
- }
- }]);
-
- return ListItem;
- }(_block2.default);
-
- ListItem.blotName = 'list-item';
- ListItem.tagName = 'LI';
-
- var List = function (_Container) {
- _inherits(List, _Container);
-
- _createClass(List, null, [{
- key: 'create',
- value: function create(value) {
- var tagName = value === 'ordered' ? 'OL' : 'UL';
- var node = _get(List.__proto__ || Object.getPrototypeOf(List), 'create', this).call(this, tagName);
- if (value === 'checked' || value === 'unchecked') {
- node.setAttribute('data-checked', value === 'checked');
- }
- return node;
- }
- }, {
- key: 'formats',
- value: function formats(domNode) {
- if (domNode.tagName === 'OL') return 'ordered';
- if (domNode.tagName === 'UL') {
- if (domNode.hasAttribute('data-checked')) {
- return domNode.getAttribute('data-checked') === 'true' ? 'checked' : 'unchecked';
- } else {
- return 'bullet';
- }
- }
- return undefined;
- }
- }]);
-
- function List(domNode) {
- _classCallCheck(this, List);
-
- var _this2 = _possibleConstructorReturn(this, (List.__proto__ || Object.getPrototypeOf(List)).call(this, domNode));
-
- var listEventHandler = function listEventHandler(e) {
- if (e.target.parentNode !== domNode) return;
- var format = _this2.statics.formats(domNode);
- var blot = _parchment2.default.find(e.target);
- if (format === 'checked') {
- blot.format('list', 'unchecked');
- } else if (format === 'unchecked') {
- blot.format('list', 'checked');
- }
- };
-
- domNode.addEventListener('touchstart', listEventHandler);
- domNode.addEventListener('mousedown', listEventHandler);
- return _this2;
- }
-
- _createClass(List, [{
- key: 'format',
- value: function format(name, value) {
- if (this.children.length > 0) {
- this.children.tail.format(name, value);
- }
- }
- }, {
- key: 'formats',
- value: function formats() {
- // We don't inherit from FormatBlot
- return _defineProperty({}, this.statics.blotName, this.statics.formats(this.domNode));
- }
- }, {
- key: 'insertBefore',
- value: function insertBefore(blot, ref) {
- if (blot instanceof ListItem) {
- _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'insertBefore', this).call(this, blot, ref);
- } else {
- var index = ref == null ? this.length() : ref.offset(this);
- var after = this.split(index);
- after.parent.insertBefore(blot, after);
- }
- }
- }, {
- key: 'optimize',
- value: function optimize(context) {
- _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'optimize', this).call(this, context);
- var next = this.next;
- if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && next.domNode.tagName === this.domNode.tagName && next.domNode.getAttribute('data-checked') === this.domNode.getAttribute('data-checked')) {
- next.moveChildren(this);
- next.remove();
- }
- }
- }, {
- key: 'replace',
- value: function replace(target) {
- if (target.statics.blotName !== this.statics.blotName) {
- var item = _parchment2.default.create(this.statics.defaultChild);
- target.moveChildren(item);
- this.appendChild(item);
- }
- _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'replace', this).call(this, target);
- }
- }]);
-
- return List;
- }(_container2.default);
-
- List.blotName = 'list';
- List.scope = _parchment2.default.Scope.BLOCK_BLOT;
- List.tagName = ['OL', 'UL'];
- List.defaultChild = 'list-item';
- List.allowedChildren = [ListItem];
-
- exports.ListItem = ListItem;
- exports.default = List;
-
- /***/
- }),
-/* 86 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _bold = __webpack_require__(75);
-
- var _bold2 = _interopRequireDefault(_bold);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var Italic = function (_Bold) {
- _inherits(Italic, _Bold);
-
- function Italic() {
- _classCallCheck(this, Italic);
-
- return _possibleConstructorReturn(this, (Italic.__proto__ || Object.getPrototypeOf(Italic)).apply(this, arguments));
- }
-
- return Italic;
- }(_bold2.default);
-
- Italic.blotName = 'italic';
- Italic.tagName = ['EM', 'I'];
-
- exports.default = Italic;
-
- /***/
- }),
-/* 87 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _inline = __webpack_require__(6);
-
- var _inline2 = _interopRequireDefault(_inline);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var Script = function (_Inline) {
- _inherits(Script, _Inline);
-
- function Script() {
- _classCallCheck(this, Script);
-
- return _possibleConstructorReturn(this, (Script.__proto__ || Object.getPrototypeOf(Script)).apply(this, arguments));
- }
-
- _createClass(Script, null, [{
- key: 'create',
- value: function create(value) {
- if (value === 'super') {
- return document.createElement('sup');
- } else if (value === 'sub') {
- return document.createElement('sub');
- } else {
- return _get(Script.__proto__ || Object.getPrototypeOf(Script), 'create', this).call(this, value);
- }
- }
- }, {
- key: 'formats',
- value: function formats(domNode) {
- if (domNode.tagName === 'SUB') return 'sub';
- if (domNode.tagName === 'SUP') return 'super';
- return undefined;
- }
- }]);
-
- return Script;
- }(_inline2.default);
-
- Script.blotName = 'script';
- Script.tagName = ['SUB', 'SUP'];
-
- exports.default = Script;
-
- /***/
- }),
-/* 88 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _inline = __webpack_require__(6);
-
- var _inline2 = _interopRequireDefault(_inline);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var Strike = function (_Inline) {
- _inherits(Strike, _Inline);
-
- function Strike() {
- _classCallCheck(this, Strike);
-
- return _possibleConstructorReturn(this, (Strike.__proto__ || Object.getPrototypeOf(Strike)).apply(this, arguments));
- }
-
- return Strike;
- }(_inline2.default);
-
- Strike.blotName = 'strike';
- Strike.tagName = 'S';
-
- exports.default = Strike;
-
- /***/
- }),
-/* 89 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _inline = __webpack_require__(6);
-
- var _inline2 = _interopRequireDefault(_inline);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var Underline = function (_Inline) {
- _inherits(Underline, _Inline);
-
- function Underline() {
- _classCallCheck(this, Underline);
-
- return _possibleConstructorReturn(this, (Underline.__proto__ || Object.getPrototypeOf(Underline)).apply(this, arguments));
- }
-
- return Underline;
- }(_inline2.default);
-
- Underline.blotName = 'underline';
- Underline.tagName = 'U';
-
- exports.default = Underline;
-
- /***/
- }),
-/* 90 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _link = __webpack_require__(29);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var ATTRIBUTES = ['alt', 'height', 'width'];
-
- var Image = function (_Parchment$Embed) {
- _inherits(Image, _Parchment$Embed);
-
- function Image() {
- _classCallCheck(this, Image);
-
- return _possibleConstructorReturn(this, (Image.__proto__ || Object.getPrototypeOf(Image)).apply(this, arguments));
- }
-
- _createClass(Image, [{
- key: 'format',
- value: function format(name, value) {
- if (ATTRIBUTES.indexOf(name) > -1) {
- if (value) {
- this.domNode.setAttribute(name, value);
- } else {
- this.domNode.removeAttribute(name);
- }
- } else {
- _get(Image.prototype.__proto__ || Object.getPrototypeOf(Image.prototype), 'format', this).call(this, name, value);
- }
- }
- }], [{
- key: 'create',
- value: function create(value) {
- var node = _get(Image.__proto__ || Object.getPrototypeOf(Image), 'create', this).call(this, value);
- if (typeof value === 'string') {
- node.setAttribute('src', this.sanitize(value));
- }
- return node;
- }
- }, {
- key: 'formats',
- value: function formats(domNode) {
- return ATTRIBUTES.reduce(function (formats, attribute) {
- if (domNode.hasAttribute(attribute)) {
- formats[attribute] = domNode.getAttribute(attribute);
- }
- return formats;
- }, {});
- }
- }, {
- key: 'match',
- value: function match(url) {
- return (/\.(jpe?g|gif|png)$/.test(url) || /^data:image\/.+;base64/.test(url)
- );
- }
- }, {
- key: 'sanitize',
- value: function sanitize(url) {
- return (0, _link.sanitize)(url, ['http', 'https', 'data']) ? url : '//:0';
- }
- }, {
- key: 'value',
- value: function value(domNode) {
- return domNode.getAttribute('src');
- }
- }]);
-
- return Image;
- }(_parchment2.default.Embed);
-
- Image.blotName = 'image';
- Image.tagName = 'IMG';
-
- exports.default = Image;
-
- /***/
- }),
-/* 91 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _block = __webpack_require__(4);
-
- var _link = __webpack_require__(29);
-
- var _link2 = _interopRequireDefault(_link);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var ATTRIBUTES = ['height', 'width'];
-
- var Video = function (_BlockEmbed) {
- _inherits(Video, _BlockEmbed);
-
- function Video() {
- _classCallCheck(this, Video);
-
- return _possibleConstructorReturn(this, (Video.__proto__ || Object.getPrototypeOf(Video)).apply(this, arguments));
- }
-
- _createClass(Video, [{
- key: 'format',
- value: function format(name, value) {
- if (ATTRIBUTES.indexOf(name) > -1) {
- if (value) {
- this.domNode.setAttribute(name, value);
- } else {
- this.domNode.removeAttribute(name);
- }
- } else {
- _get(Video.prototype.__proto__ || Object.getPrototypeOf(Video.prototype), 'format', this).call(this, name, value);
- }
- }
- }], [{
- key: 'create',
- value: function create(value) {
- var node = _get(Video.__proto__ || Object.getPrototypeOf(Video), 'create', this).call(this, value);
- node.setAttribute('frameborder', '0');
- node.setAttribute('allowfullscreen', true);
- node.setAttribute('src', this.sanitize(value));
- return node;
- }
- }, {
- key: 'formats',
- value: function formats(domNode) {
- return ATTRIBUTES.reduce(function (formats, attribute) {
- if (domNode.hasAttribute(attribute)) {
- formats[attribute] = domNode.getAttribute(attribute);
- }
- return formats;
- }, {});
- }
- }, {
- key: 'sanitize',
- value: function sanitize(url) {
- return _link2.default.sanitize(url);
- }
- }, {
- key: 'value',
- value: function value(domNode) {
- return domNode.getAttribute('src');
- }
- }]);
-
- return Video;
- }(_block.BlockEmbed);
-
- Video.blotName = 'video';
- Video.className = 'ql-video';
- Video.tagName = 'IFRAME';
-
- exports.default = Video;
-
- /***/
- }),
-/* 92 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = exports.FormulaBlot = undefined;
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _embed = __webpack_require__(41);
-
- var _embed2 = _interopRequireDefault(_embed);
-
- var _quill = __webpack_require__(5);
-
- var _quill2 = _interopRequireDefault(_quill);
-
- var _module = __webpack_require__(9);
-
- var _module2 = _interopRequireDefault(_module);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var FormulaBlot = function (_Embed) {
- _inherits(FormulaBlot, _Embed);
-
- function FormulaBlot() {
- _classCallCheck(this, FormulaBlot);
-
- return _possibleConstructorReturn(this, (FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot)).apply(this, arguments));
- }
-
- _createClass(FormulaBlot, null, [{
- key: 'create',
- value: function create(value) {
- var node = _get(FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot), 'create', this).call(this, value);
- if (typeof value === 'string') {
- window.katex.render(value, node, {
- throwOnError: false,
- errorColor: '#f00'
- });
- node.setAttribute('data-value', value);
- }
- return node;
- }
- }, {
- key: 'value',
- value: function value(domNode) {
- return domNode.getAttribute('data-value');
- }
- }]);
-
- return FormulaBlot;
- }(_embed2.default);
-
- FormulaBlot.blotName = 'formula';
- FormulaBlot.className = 'ql-formula';
- FormulaBlot.tagName = 'SPAN';
-
- var Formula = function (_Module) {
- _inherits(Formula, _Module);
-
- _createClass(Formula, null, [{
- key: 'register',
- value: function register() {
- _quill2.default.register(FormulaBlot, true);
- }
- }]);
-
- function Formula() {
- _classCallCheck(this, Formula);
-
- var _this2 = _possibleConstructorReturn(this, (Formula.__proto__ || Object.getPrototypeOf(Formula)).call(this));
-
- if (window.katex == null) {
- throw new Error('Formula module requires KaTeX.');
- }
- return _this2;
- }
-
- return Formula;
- }(_module2.default);
-
- exports.FormulaBlot = FormulaBlot;
- exports.default = Formula;
-
- /***/
- }),
-/* 93 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = exports.CodeToken = exports.CodeBlock = undefined;
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _quill = __webpack_require__(5);
-
- var _quill2 = _interopRequireDefault(_quill);
-
- var _module = __webpack_require__(9);
-
- var _module2 = _interopRequireDefault(_module);
-
- var _code = __webpack_require__(13);
-
- var _code2 = _interopRequireDefault(_code);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var SyntaxCodeBlock = function (_CodeBlock) {
- _inherits(SyntaxCodeBlock, _CodeBlock);
-
- function SyntaxCodeBlock() {
- _classCallCheck(this, SyntaxCodeBlock);
-
- return _possibleConstructorReturn(this, (SyntaxCodeBlock.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock)).apply(this, arguments));
- }
-
- _createClass(SyntaxCodeBlock, [{
- key: 'replaceWith',
- value: function replaceWith(block) {
- this.domNode.textContent = this.domNode.textContent;
- this.attach();
- _get(SyntaxCodeBlock.prototype.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock.prototype), 'replaceWith', this).call(this, block);
- }
- }, {
- key: 'highlight',
- value: function highlight(_highlight) {
- var text = this.domNode.textContent;
- if (this.cachedText !== text) {
- if (text.trim().length > 0 || this.cachedText == null) {
- this.domNode.innerHTML = _highlight(text);
- this.domNode.normalize();
- this.attach();
- }
- this.cachedText = text;
- }
- }
- }]);
-
- return SyntaxCodeBlock;
- }(_code2.default);
-
- SyntaxCodeBlock.className = 'ql-syntax';
-
- var CodeToken = new _parchment2.default.Attributor.Class('token', 'hljs', {
- scope: _parchment2.default.Scope.INLINE
- });
-
- var Syntax = function (_Module) {
- _inherits(Syntax, _Module);
-
- _createClass(Syntax, null, [{
- key: 'register',
- value: function register() {
- _quill2.default.register(CodeToken, true);
- _quill2.default.register(SyntaxCodeBlock, true);
- }
- }]);
-
- function Syntax(quill, options) {
- _classCallCheck(this, Syntax);
-
- var _this2 = _possibleConstructorReturn(this, (Syntax.__proto__ || Object.getPrototypeOf(Syntax)).call(this, quill, options));
-
- if (typeof _this2.options.highlight !== 'function') {
- throw new Error('Syntax module requires highlight.js. Please include the library on the page before Quill.');
- }
- var timer = null;
- _this2.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () {
- clearTimeout(timer);
- timer = setTimeout(function () {
- _this2.highlight();
- timer = null;
- }, _this2.options.interval);
- });
- _this2.highlight();
- return _this2;
- }
-
- _createClass(Syntax, [{
- key: 'highlight',
- value: function highlight() {
- var _this3 = this;
-
- if (this.quill.selection.composing) return;
- this.quill.update(_quill2.default.sources.USER);
- var range = this.quill.getSelection();
- this.quill.scroll.descendants(SyntaxCodeBlock).forEach(function (code) {
- code.highlight(_this3.options.highlight);
- });
- this.quill.update(_quill2.default.sources.SILENT);
- if (range != null) {
- this.quill.setSelection(range, _quill2.default.sources.SILENT);
- }
- }
- }]);
-
- return Syntax;
- }(_module2.default);
-
- Syntax.DEFAULTS = {
- highlight: function () {
- if (window.hljs == null) return null;
- return function (text) {
- var result = window.hljs.highlightAuto(text);
- return result.value;
- };
- }(),
- interval: 1000
- };
-
- exports.CodeBlock = SyntaxCodeBlock;
- exports.CodeToken = CodeToken;
- exports.default = Syntax;
-
- /***/
- }),
-/* 94 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-align-left width=24 height=24 viewBox=\"0 0 24 24\"><path d=M3,3H21V5H3V3M3,7H15V9H3V7M3,11H21V13H3V11M3,15H15V17H3V15M3,19H21V21H3V19Z /></svg>";
-
- /***/
- }),
-/* 95 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-align-center width=24 height=24 viewBox=\"0 0 24 24\"><path d=M3,3H21V5H3V3M7,7H17V9H7V7M3,11H21V13H3V11M7,15H17V17H7V15M3,19H21V21H3V19Z /></svg>";
-
- /***/
- }),
-/* 96 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-align-right width=24 height=24 viewBox=\"0 0 24 24\"><path d=M3,3H21V5H3V3M9,7H21V9H9V7M3,11H21V13H3V11M9,15H21V17H9V15M3,19H21V21H3V19Z /></svg>";
-
- /***/
- }),
-/* 97 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-align-justify width=24 height=24 viewBox=\"0 0 24 24\"><path d=M3,3H21V5H3V3M3,7H21V9H3V7M3,11H21V13H3V11M3,15H21V17H3V15M3,19H21V21H3V19Z /></svg>";
-
- /***/
- }),
-/* 98 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-color-highlight width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M4,17L6.75,14.25L6.72,14.23C6.14,13.64 6.14,12.69 6.72,12.11L11.46,7.37L15.7,11.61L10.96,16.35C10.39,16.93 9.46,16.93 8.87,16.37L8.24,17H4M15.91,2.91C16.5,2.33 17.45,2.33 18.03,2.91L20.16,5.03C20.74,5.62 20.74,6.57 20.16,7.16L16.86,10.45L12.62,6.21L15.91,2.91Z\"/></svg>";
-
- /***/
- }),
-/* 99 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-quote-open width=24 height=24 viewBox=\"0 0 24 24\"><path d=M10,7L8,11H11V17H5V11L7,7H10M18,7L16,11H19V17H13V11L15,7H18Z /></svg>";
-
- /***/
- }),
-/* 100 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-bold width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M13.5,15.5H10V12.5H13.5A1.5,1.5 0 0,1 15,14A1.5,1.5 0 0,1 13.5,15.5M10,6.5H13A1.5,1.5 0 0,1 14.5,8A1.5,1.5 0 0,1 13,9.5H10M15.6,10.79C16.57,10.11 17.25,9 17.25,8C17.25,5.74 15.5,4 13.25,4H7V18H14.04C16.14,18 17.75,16.3 17.75,14.21C17.75,12.69 16.89,11.39 15.6,10.79Z\"/></svg>";
-
- /***/
- }),
-/* 101 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-clear width=24 height=24 viewBox=\"0 0 24 24\"><path d=M6,5V5.18L8.82,8H11.22L10.5,9.68L12.6,11.78L14.21,8H20V5H6M3.27,5L2,6.27L8.97,13.24L6.5,19H9.5L11.07,15.34L16.73,21L18,19.73L3.55,5.27L3.27,5Z /></svg>";
-
- /***/
- }),
-/* 102 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-code-tags width=24 height=24 viewBox=\"0 0 24 24\"><path d=M14.6,16.6L19.2,12L14.6,7.4L16,6L22,12L16,18L14.6,16.6M9.4,16.6L4.8,12L9.4,7.4L8,6L2,12L8,18L9.4,16.6Z /></svg>";
-
- /***/
- }),
-/* 103 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-code-braces width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M8,3A2,2 0 0,0 6,5V9A2,2 0 0,1 4,11H3V13H4A2,2 0 0,1 6,15V19A2,2 0 0,0 8,21H10V19H8V14A2,2 0 0,0 6,12A2,2 0 0,0 8,10V5H10V3M16,3A2,2 0 0,1 18,5V9A2,2 0 0,0 20,11H21V13H20A2,2 0 0,0 18,15V19A2,2 0 0,1 16,21H14V19H16V14A2,2 0 0,1 18,12A2,2 0 0,1 16,10V5H14V3H16Z\"/></svg>";
-
- /***/
- }),
-/* 104 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-color-text width=24 height=24 viewBox=\"0 0 24 24\"><path d=M9.62,12L12,5.67L14.37,12M11,3L5.5,17H7.75L8.87,14H15.12L16.25,17H18.5L13,3H11Z /></svg>";
-
- /***/
- }),
-/* 105 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-textdirection-l-to-r width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M21,18L17,14V17H5V19H17V22M9,10V15H11V4H13V15H15V4H17V2H9A4,4 0 0,0 5,6A4,4 0 0,0 9,10Z\"/></svg>";
-
- /***/
- }),
-/* 106 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-textdirection-r-to-l width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M8,17V14L4,18L8,22V19H20V17M10,10V15H12V4H14V15H16V4H18V2H10A4,4 0 0,0 6,6A4,4 0 0,0 10,10Z\"/></svg>";
-
- /***/
- }),
-/* 107 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-float-center width=24 height=24 viewBox=\"0 0 24 24\"><path d=M9,7H15V13H9V7M3,3H21V5H3V3M3,15H21V17H3V15M3,19H17V21H3V19Z /></svg>";
-
- /***/
- }),
-/* 108 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-float-none width=24 height=24 viewBox=\"0 0 24 24\"><path d=M3,7H9V13H3V7M3,3H21V5H3V3M21,11V13H11V11H21M3,15H17V17H3V15M3,19H21V21H3V19Z /></svg>";
-
- /***/
- }),
-/* 109 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-float-left width=24 height=24 viewBox=\"0 0 24 24\"><path d=M3,7H9V13H3V7M3,3H21V5H3V3M21,7V9H11V7H21M21,11V13H11V11H21M3,15H17V17H3V15M3,19H21V21H3V19Z /></svg>";
-
- /***/
- }),
-/* 110 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-float-right width=24 height=24 viewBox=\"0 0 24 24\"><path d=M15,7H21V13H15V7M3,3H21V5H3V3M13,7V9H3V7H13M9,11V13H3V11H9M3,15H17V17H3V15M3,19H21V21H3V19Z /></svg>";
-
- /***/
- }),
-/* 111 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-function-variant width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M12.42,5.29C11.32,5.19 10.35,6 10.25,7.11L10,10H12.82V12H9.82L9.38,17.07C9.18,19.27 7.24,20.9 5.04,20.7C3.79,20.59 2.66,19.9 2,18.83L3.5,17.33C3.83,18.38 4.96,18.97 6,18.63C6.78,18.39 7.33,17.7 7.4,16.89L7.82,12H4.82V10H8L8.27,6.93C8.46,4.73 10.39,3.1 12.6,3.28C13.86,3.39 15,4.09 15.66,5.17L14.16,6.67C13.91,5.9 13.23,5.36 12.42,5.29M22,13.65L20.59,12.24L17.76,15.07L14.93,12.24L13.5,13.65L16.35,16.5L13.5,19.31L14.93,20.72L17.76,17.89L20.59,20.72L22,19.31L19.17,16.5L22,13.65Z\"/></svg>";
-
- /***/
- }),
-/* 112 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-header-1 width=24 height=24 viewBox=\"0 0 24 24\"><path d=M3,4H5V10H9V4H11V18H9V12H5V18H3V4M14,18V16H16V6.31L13.5,7.75V5.44L16,4H18V16H20V18H14Z /></svg>";
-
- /***/
- }),
-/* 113 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-header-2 width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M3,4H5V10H9V4H11V18H9V12H5V18H3V4M21,18H15A2,2 0 0,1 13,16C13,15.47 13.2,15 13.54,14.64L18.41,9.41C18.78,9.05 19,8.55 19,8A2,2 0 0,0 17,6A2,2 0 0,0 15,8H13A4,4 0 0,1 17,4A4,4 0 0,1 21,8C21,9.1 20.55,10.1 19.83,10.83L15,16H21V18Z\"/></svg>";
-
- /***/
- }),
-/* 114 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-header-3 width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M3,4H5V10H9V4H11V18H9V12H5V18H3V4M15,4H19A2,2 0 0,1 21,6V16A2,2 0 0,1 19,18H15A2,2 0 0,1 13,16V15H15V16H19V12H15V10H19V6H15V7H13V6A2,2 0 0,1 15,4Z\"/></svg>";
-
- /***/
- }),
-/* 115 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-header-4 width=24 height=24 viewBox=\"0 0 24 24\"><path d=M3,4H5V10H9V4H11V18H9V12H5V18H3V4M18,18V13H13V11L18,4H20V11H21V13H20V18H18M18,11V7.42L15.45,11H18Z /></svg>";
-
- /***/
- }),
-/* 116 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-header-5 width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M3,4H5V10H9V4H11V18H9V12H5V18H3V4M15,4H20V6H15V10H17A4,4 0 0,1 21,14A4,4 0 0,1 17,18H15A2,2 0 0,1 13,16V15H15V16H17A2,2 0 0,0 19,14A2,2 0 0,0 17,12H15A2,2 0 0,1 13,10V6A2,2 0 0,1 15,4Z\"/></svg>";
-
- /***/
- }),
-/* 117 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-header-6 width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M3,4H5V10H9V4H11V18H9V12H5V18H3V4M15,4H19A2,2 0 0,1 21,6V7H19V6H15V10H19A2,2 0 0,1 21,12V16A2,2 0 0,1 19,18H15A2,2 0 0,1 13,16V6A2,2 0 0,1 15,4M15,12V16H19V12H15Z\"/></svg>";
-
- /***/
- }),
-/* 118 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-italic width=24 height=24 viewBox=\"0 0 24 24\"><path d=M10,4V7H12.21L8.79,15H6V18H14V15H11.79L15.21,7H18V4H10Z /></svg>";
-
- /***/
- }),
-/* 119 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-image width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z\"/></svg>";
-
- /***/
- }),
-/* 120 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-indent-increase width=24 height=24 viewBox=\"0 0 24 24\"><path d=M11,13H21V11H11M11,9H21V7H11M3,3V5H21V3M11,17H21V15H11M3,8V16L7,12M3,21H21V19H3V21Z /></svg>";
-
- /***/
- }),
-/* 121 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-indent-decrease width=24 height=24 viewBox=\"0 0 24 24\"><path d=M11,13H21V11H11M11,9H21V7H11M3,3V5H21V3M3,21H21V19H3M3,12L7,16V8M11,17H21V15H11V17Z /></svg>";
-
- /***/
- }),
-/* 122 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-link width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z\"/></svg>";
-
- /***/
- }),
-/* 123 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-list-numbered width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M7,13V11H21V13H7M7,19V17H21V19H7M7,7V5H21V7H7M3,8V5H2V4H4V8H3M2,17V16H5V20H2V19H4V18.5H3V17.5H4V17H2M4.25,10A0.75,0.75 0 0,1 5,10.75C5,10.95 4.92,11.14 4.79,11.27L3.12,13H5V14H2V13.08L4,11H2V10H4.25Z\"/></svg>";
-
- /***/
- }),
-/* 124 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-list-bulleted-square width=24 height=24 viewBox=\"0 0 24 24\"><path d=M3,4H7V8H3V4M9,5V7H21V5H9M3,10H7V14H3V10M9,11V13H21V11H9M3,16H7V20H3V16M9,17V19H21V17H9 /></svg>";
-
- /***/
- }),
-/* 125 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-list-checks width=24 height=24 viewBox=\"0 0 24 24\"><path d=M3,5H9V11H3V5M5,7V9H7V7H5M11,7H21V9H11V7M11,15H21V17H11V15M5,20L1.5,16.5L2.91,15.09L5,17.17L9.59,12.59L11,14L5,20Z /></svg>";
-
- /***/
- }),
-/* 126 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-subscript width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M16,7.41L11.41,12L16,16.59L14.59,18L10,13.41L5.41,18L4,16.59L8.59,12L4,7.41L5.41,6L10,10.59L14.59,6L16,7.41M21.85,21.03H16.97V20.03L17.86,19.23C18.62,18.58 19.18,18.04 19.56,17.6C19.93,17.16 20.12,16.75 20.13,16.36C20.14,16.08 20.05,15.85 19.86,15.66C19.68,15.5 19.39,15.38 19,15.38C18.69,15.38 18.42,15.44 18.16,15.56L17.5,15.94L17.05,14.77C17.32,14.56 17.64,14.38 18.03,14.24C18.42,14.1 18.85,14 19.32,14C20.1,14.04 20.7,14.25 21.1,14.66C21.5,15.07 21.72,15.59 21.72,16.23C21.71,16.79 21.53,17.31 21.18,17.78C20.84,18.25 20.42,18.7 19.91,19.14L19.27,19.66V19.68H21.85V21.03Z\"/></svg>";
-
- /***/
- }),
-/* 127 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-superscript width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M16,7.41L11.41,12L16,16.59L14.59,18L10,13.41L5.41,18L4,16.59L8.59,12L4,7.41L5.41,6L10,10.59L14.59,6L16,7.41M21.85,9H16.97V8L17.86,7.18C18.62,6.54 19.18,6 19.56,5.55C19.93,5.11 20.12,4.7 20.13,4.32C20.14,4.04 20.05,3.8 19.86,3.62C19.68,3.43 19.39,3.34 19,3.33C18.69,3.34 18.42,3.4 18.16,3.5L17.5,3.89L17.05,2.72C17.32,2.5 17.64,2.33 18.03,2.19C18.42,2.05 18.85,2 19.32,2C20.1,2 20.7,2.2 21.1,2.61C21.5,3 21.72,3.54 21.72,4.18C21.71,4.74 21.53,5.26 21.18,5.73C20.84,6.21 20.42,6.66 19.91,7.09L19.27,7.61V7.63H21.85V9Z\"/></svg>";
-
- /***/
- }),
-/* 128 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-strikethrough width=24 height=24 viewBox=\"0 0 24 24\"><path d=M3,14H21V12H3M5,4V7H10V10H14V7H19V4M10,19H14V16H10V19Z /></svg>";
-
- /***/
- }),
-/* 129 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-underline width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M5,21H19V19H5V21M12,17A6,6 0 0,0 18,11V3H15.5V11A3.5,3.5 0 0,1 12,14.5A3.5,3.5 0 0,1 8.5,11V3H6V11A6,6 0 0,0 12,17Z\"/></svg>";
-
- /***/
- }),
-/* 130 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-video width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M17,10.5V7A1,1 0 0,0 16,6H4A1,1 0 0,0 3,7V17A1,1 0 0,0 4,18H16A1,1 0 0,0 17,17V13.5L21,17.5V6.5L17,10.5Z\"/></svg>";
-
- /***/
- }),
-/* 131 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-unfold-more-horizontal width=24 height=24 viewBox=\"0 0 24 24\"><path d=M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z /></svg>";
-
- /***/
- }),
-/* 132 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = exports.BubbleTooltip = undefined;
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _extend = __webpack_require__(3);
-
- var _extend2 = _interopRequireDefault(_extend);
-
- var _emitter = __webpack_require__(8);
-
- var _emitter2 = _interopRequireDefault(_emitter);
-
- var _base = __webpack_require__(49);
-
- var _base2 = _interopRequireDefault(_base);
-
- var _selection = __webpack_require__(15);
-
- var _icons = __webpack_require__(47);
-
- var _icons2 = _interopRequireDefault(_icons);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var TOOLBAR_CONFIG = [['bold', 'italic', 'link'], [{ header: 1 }, { header: 2 }, 'blockquote']];
-
- var BubbleTheme = function (_BaseTheme) {
- _inherits(BubbleTheme, _BaseTheme);
-
- function BubbleTheme(quill, options) {
- _classCallCheck(this, BubbleTheme);
-
- if (options.modules.toolbar != null && options.modules.toolbar.container == null) {
- options.modules.toolbar.container = TOOLBAR_CONFIG;
- }
-
- var _this = _possibleConstructorReturn(this, (BubbleTheme.__proto__ || Object.getPrototypeOf(BubbleTheme)).call(this, quill, options));
-
- _this.quill.container.classList.add('ql-bubble');
- return _this;
- }
-
- _createClass(BubbleTheme, [{
- key: 'extendToolbar',
- value: function extendToolbar(toolbar) {
- this.tooltip = new BubbleTooltip(this.quill, this.options.bounds);
- this.tooltip.root.appendChild(toolbar.container);
- this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default);
- this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default);
- }
- }]);
-
- return BubbleTheme;
- }(_base2.default);
-
- BubbleTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, {
- modules: {
- toolbar: {
- handlers: {
- link: function link(value) {
- if (!value) {
- this.quill.format('link', false);
- } else {
- this.quill.theme.tooltip.edit();
- }
- }
- }
- }
- }
- });
-
- var BubbleTooltip = function (_BaseTooltip) {
- _inherits(BubbleTooltip, _BaseTooltip);
-
- function BubbleTooltip(quill, bounds) {
- _classCallCheck(this, BubbleTooltip);
-
- var _this2 = _possibleConstructorReturn(this, (BubbleTooltip.__proto__ || Object.getPrototypeOf(BubbleTooltip)).call(this, quill, bounds));
-
- _this2.quill.on(_emitter2.default.events.EDITOR_CHANGE, function (type, range, oldRange, source) {
- if (type !== _emitter2.default.events.SELECTION_CHANGE) return;
- if (range != null && range.length > 0 && source === _emitter2.default.sources.USER) {
- _this2.show();
- // Lock our width so we will expand beyond our offsetParent boundaries
- _this2.root.style.left = '0px';
- _this2.root.style.width = '';
- _this2.root.style.width = _this2.root.offsetWidth + 'px';
- var lines = _this2.quill.getLines(range.index, range.length);
- if (lines.length === 1) {
- _this2.position(_this2.quill.getBounds(range));
- } else {
- var lastLine = lines[lines.length - 1];
- var index = _this2.quill.getIndex(lastLine);
- var length = Math.min(lastLine.length() - 1, range.index + range.length - index);
- var _bounds = _this2.quill.getBounds(new _selection.Range(index, length));
- _this2.position(_bounds);
- }
- } else if (document.activeElement !== _this2.textbox && _this2.quill.hasFocus()) {
- _this2.hide();
- }
- });
- return _this2;
- }
-
- _createClass(BubbleTooltip, [{
- key: 'listen',
- value: function listen() {
- var _this3 = this;
-
- _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'listen', this).call(this);
- this.root.querySelector('.ql-close').addEventListener('click', function () {
- _this3.root.classList.remove('ql-editing');
- });
- this.quill.on(_emitter2.default.events.SCROLL_OPTIMIZE, function () {
- // Let selection be restored by toolbar handlers before repositioning
- setTimeout(function () {
- if (_this3.root.classList.contains('ql-hidden')) return;
- var range = _this3.quill.getSelection();
- if (range != null) {
- _this3.position(_this3.quill.getBounds(range));
- }
- }, 1);
- });
- }
- }, {
- key: 'cancel',
- value: function cancel() {
- this.show();
- }
- }, {
- key: 'position',
- value: function position(reference) {
- var shift = _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'position', this).call(this, reference);
- var arrow = this.root.querySelector('.ql-tooltip-arrow');
- arrow.style.marginLeft = '';
- if (shift === 0) return shift;
- arrow.style.marginLeft = -1 * shift - arrow.offsetWidth / 2 + 'px';
- }
- }]);
-
- return BubbleTooltip;
- }(_base.BaseTooltip);
-
- BubbleTooltip.TEMPLATE = ['<span class="ql-tooltip-arrow"></span>', '<div class="ql-tooltip-editor">', '<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">', '<a class="ql-close"></a>', '</div>'].join('');
-
- exports.BubbleTooltip = BubbleTooltip;
- exports.default = BubbleTheme;
-
- /***/
- }),
-/* 133 */
-/***/ (function (module, exports, __webpack_require__) {
-
- module.exports = __webpack_require__(81);
-
-
- /***/
- })
-/******/])["default"];
- });
-
-
-
-
-
-
-
-
- }).call(this, require("buffer").Buffer)
- }, { "buffer": 4 }], 3: [function (require, module, exports) {
- 'use strict'
-
- exports.byteLength = byteLength
- exports.toByteArray = toByteArray
- exports.fromByteArray = fromByteArray
-
- var lookup = []
- var revLookup = []
- var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
-
- var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
- for (var i = 0, len = code.length; i < len; ++i) {
- lookup[i] = code[i]
- revLookup[code.charCodeAt(i)] = i
- }
-
- // Support decoding URL-safe base64 strings, as Node.js does.
- // See: https://en.wikipedia.org/wiki/Base64#URL_applications
- revLookup['-'.charCodeAt(0)] = 62
- revLookup['_'.charCodeAt(0)] = 63
-
- function getLens(b64) {
- var len = b64.length
-
- if (len % 4 > 0) {
- throw new Error('Invalid string. Length must be a multiple of 4')
- }
-
- // Trim off extra bytes after placeholder bytes are found
- // See: https://github.com/beatgammit/base64-js/issues/42
- var validLen = b64.indexOf('=')
- if (validLen === -1) validLen = len
-
- var placeHoldersLen = validLen === len
- ? 0
- : 4 - (validLen % 4)
-
- return [validLen, placeHoldersLen]
- }
-
- // base64 is 4/3 + up to two characters of the original data
- function byteLength(b64) {
- var lens = getLens(b64)
- var validLen = lens[0]
- var placeHoldersLen = lens[1]
- return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
- }
-
- function _byteLength(b64, validLen, placeHoldersLen) {
- return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
- }
-
- function toByteArray(b64) {
- var tmp
- var lens = getLens(b64)
- var validLen = lens[0]
- var placeHoldersLen = lens[1]
-
- var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
-
- var curByte = 0
-
- // if there are placeholders, only get up to the last complete 4 chars
- var len = placeHoldersLen > 0
- ? validLen - 4
- : validLen
-
- for (var i = 0; i < len; i += 4) {
- tmp =
- (revLookup[b64.charCodeAt(i)] << 18) |
- (revLookup[b64.charCodeAt(i + 1)] << 12) |
- (revLookup[b64.charCodeAt(i + 2)] << 6) |
- revLookup[b64.charCodeAt(i + 3)]
- arr[curByte++] = (tmp >> 16) & 0xFF
- arr[curByte++] = (tmp >> 8) & 0xFF
- arr[curByte++] = tmp & 0xFF
- }
-
- if (placeHoldersLen === 2) {
- tmp =
- (revLookup[b64.charCodeAt(i)] << 2) |
- (revLookup[b64.charCodeAt(i + 1)] >> 4)
- arr[curByte++] = tmp & 0xFF
- }
-
- if (placeHoldersLen === 1) {
- tmp =
- (revLookup[b64.charCodeAt(i)] << 10) |
- (revLookup[b64.charCodeAt(i + 1)] << 4) |
- (revLookup[b64.charCodeAt(i + 2)] >> 2)
- arr[curByte++] = (tmp >> 8) & 0xFF
- arr[curByte++] = tmp & 0xFF
- }
-
- return arr
- }
-
- function tripletToBase64(num) {
- return lookup[num >> 18 & 0x3F] +
- lookup[num >> 12 & 0x3F] +
- lookup[num >> 6 & 0x3F] +
- lookup[num & 0x3F]
- }
-
- function encodeChunk(uint8, start, end) {
- var tmp
- var output = []
- for (var i = start; i < end; i += 3) {
- tmp =
- ((uint8[i] << 16) & 0xFF0000) +
- ((uint8[i + 1] << 8) & 0xFF00) +
- (uint8[i + 2] & 0xFF)
- output.push(tripletToBase64(tmp))
- }
- return output.join('')
- }
-
- function fromByteArray(uint8) {
- var tmp
- var len = uint8.length
- var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
- var parts = []
- var maxChunkLength = 16383 // must be multiple of 3
-
- // go through the array every three bytes, we'll deal with trailing stuff later
- for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
- parts.push(encodeChunk(
- uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
- ))
- }
-
- // pad the end with zeros, but make sure to not forget the extra bytes
- if (extraBytes === 1) {
- tmp = uint8[len - 1]
- parts.push(
- lookup[tmp >> 2] +
- lookup[(tmp << 4) & 0x3F] +
- '=='
- )
- } else if (extraBytes === 2) {
- tmp = (uint8[len - 2] << 8) + uint8[len - 1]
- parts.push(
- lookup[tmp >> 10] +
- lookup[(tmp >> 4) & 0x3F] +
- lookup[(tmp << 2) & 0x3F] +
- '='
- )
- }
-
- return parts.join('')
- }
-
- }, {}], 4: [function (require, module, exports) {
- /*!
- * The buffer module from node.js, for the browser.
- *
- * @author Feross Aboukhadijeh <https://feross.org>
- * @license MIT
- */
- /* eslint-disable no-proto */
-
- 'use strict'
-
- var base64 = require('base64-js')
- var ieee754 = require('ieee754')
-
- exports.Buffer = Buffer
- exports.SlowBuffer = SlowBuffer
- exports.INSPECT_MAX_BYTES = 50
-
- var K_MAX_LENGTH = 0x7fffffff
- exports.kMaxLength = K_MAX_LENGTH
-
- /**
- * If `Buffer.TYPED_ARRAY_SUPPORT`:
- * === true Use Uint8Array implementation (fastest)
- * === false Print warning and recommend using `buffer` v4.x which has an Object
- * implementation (most compatible, even IE6)
- *
- * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
- * Opera 11.6+, iOS 4.2+.
- *
- * We report that the browser does not support typed arrays if the are not subclassable
- * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
- * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
- * for __proto__ and has a buggy typed array implementation.
- */
- Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport()
-
- if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&
- typeof console.error === 'function') {
- console.error(
- 'This browser lacks typed array (Uint8Array) support which is required by ' +
- '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'
- )
- }
-
- function typedArraySupport() {
- // Can typed array instances can be augmented?
- try {
- var arr = new Uint8Array(1)
- arr.__proto__ = { __proto__: Uint8Array.prototype, foo: function () { return 42 } }
- return arr.foo() === 42
- } catch (e) {
- return false
- }
- }
-
- Object.defineProperty(Buffer.prototype, 'parent', {
- enumerable: true,
- get: function () {
- if (!Buffer.isBuffer(this)) return undefined
- return this.buffer
- }
- })
-
- Object.defineProperty(Buffer.prototype, 'offset', {
- enumerable: true,
- get: function () {
- if (!Buffer.isBuffer(this)) return undefined
- return this.byteOffset
- }
- })
-
- function createBuffer(length) {
- if (length > K_MAX_LENGTH) {
- throw new RangeError('The value "' + length + '" is invalid for option "size"')
- }
- // Return an augmented `Uint8Array` instance
- var buf = new Uint8Array(length)
- buf.__proto__ = Buffer.prototype
- return buf
- }
-
- /**
- * The Buffer constructor returns instances of `Uint8Array` that have their
- * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
- * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
- * and the `Uint8Array` methods. Square bracket notation works as expected -- it
- * returns a single octet.
- *
- * The `Uint8Array` prototype remains unmodified.
- */
-
- function Buffer(arg, encodingOrOffset, length) {
- // Common case.
- if (typeof arg === 'number') {
- if (typeof encodingOrOffset === 'string') {
- throw new TypeError(
- 'The "string" argument must be of type string. Received type number'
- )
- }
- return allocUnsafe(arg)
- }
- return from(arg, encodingOrOffset, length)
- }
-
- // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
- if (typeof Symbol !== 'undefined' && Symbol.species != null &&
- Buffer[Symbol.species] === Buffer) {
- Object.defineProperty(Buffer, Symbol.species, {
- value: null,
- configurable: true,
- enumerable: false,
- writable: false
- })
- }
-
- Buffer.poolSize = 8192 // not used by this implementation
-
- function from(value, encodingOrOffset, length) {
- if (typeof value === 'string') {
- return fromString(value, encodingOrOffset)
- }
-
- if (ArrayBuffer.isView(value)) {
- return fromArrayLike(value)
- }
-
- if (value == null) {
- throw TypeError(
- 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
- 'or Array-like Object. Received type ' + (typeof value)
- )
- }
-
- if (isInstance(value, ArrayBuffer) ||
- (value && isInstance(value.buffer, ArrayBuffer))) {
- return fromArrayBuffer(value, encodingOrOffset, length)
- }
-
- if (typeof value === 'number') {
- throw new TypeError(
- 'The "value" argument must not be of type number. Received type number'
- )
- }
-
- var valueOf = value.valueOf && value.valueOf()
- if (valueOf != null && valueOf !== value) {
- return Buffer.from(valueOf, encodingOrOffset, length)
- }
-
- var b = fromObject(value)
- if (b) return b
-
- if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&
- typeof value[Symbol.toPrimitive] === 'function') {
- return Buffer.from(
- value[Symbol.toPrimitive]('string'), encodingOrOffset, length
- )
- }
-
- throw new TypeError(
- 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
- 'or Array-like Object. Received type ' + (typeof value)
- )
- }
-
- /**
- * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
- * if value is a number.
- * Buffer.from(str[, encoding])
- * Buffer.from(array)
- * Buffer.from(buffer)
- * Buffer.from(arrayBuffer[, byteOffset[, length]])
- **/
- Buffer.from = function (value, encodingOrOffset, length) {
- return from(value, encodingOrOffset, length)
- }
-
- // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
- // https://github.com/feross/buffer/pull/148
- Buffer.prototype.__proto__ = Uint8Array.prototype
- Buffer.__proto__ = Uint8Array
-
- function assertSize(size) {
- if (typeof size !== 'number') {
- throw new TypeError('"size" argument must be of type number')
- } else if (size < 0) {
- throw new RangeError('The value "' + size + '" is invalid for option "size"')
- }
- }
-
- function alloc(size, fill, encoding) {
- assertSize(size)
- if (size <= 0) {
- return createBuffer(size)
- }
- if (fill !== undefined) {
- // Only pay attention to encoding if it's a string. This
- // prevents accidentally sending in a number that would
- // be interpretted as a start offset.
- return typeof encoding === 'string'
- ? createBuffer(size).fill(fill, encoding)
- : createBuffer(size).fill(fill)
- }
- return createBuffer(size)
- }
-
- /**
- * Creates a new filled Buffer instance.
- * alloc(size[, fill[, encoding]])
- **/
- Buffer.alloc = function (size, fill, encoding) {
- return alloc(size, fill, encoding)
- }
-
- function allocUnsafe(size) {
- assertSize(size)
- return createBuffer(size < 0 ? 0 : checked(size) | 0)
- }
-
- /**
- * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
- * */
- Buffer.allocUnsafe = function (size) {
- return allocUnsafe(size)
- }
- /**
- * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
- */
- Buffer.allocUnsafeSlow = function (size) {
- return allocUnsafe(size)
- }
-
- function fromString(string, encoding) {
- if (typeof encoding !== 'string' || encoding === '') {
- encoding = 'utf8'
- }
-
- if (!Buffer.isEncoding(encoding)) {
- throw new TypeError('Unknown encoding: ' + encoding)
- }
-
- var length = byteLength(string, encoding) | 0
- var buf = createBuffer(length)
-
- var actual = buf.write(string, encoding)
-
- if (actual !== length) {
- // Writing a hex string, for example, that contains invalid characters will
- // cause everything after the first invalid character to be ignored. (e.g.
- // 'abxxcd' will be treated as 'ab')
- buf = buf.slice(0, actual)
- }
-
- return buf
- }
-
- function fromArrayLike(array) {
- var length = array.length < 0 ? 0 : checked(array.length) | 0
- var buf = createBuffer(length)
- for (var i = 0; i < length; i += 1) {
- buf[i] = array[i] & 255
- }
- return buf
- }
-
- function fromArrayBuffer(array, byteOffset, length) {
- if (byteOffset < 0 || array.byteLength < byteOffset) {
- throw new RangeError('"offset" is outside of buffer bounds')
- }
-
- if (array.byteLength < byteOffset + (length || 0)) {
- throw new RangeError('"length" is outside of buffer bounds')
- }
-
- var buf
- if (byteOffset === undefined && length === undefined) {
- buf = new Uint8Array(array)
- } else if (length === undefined) {
- buf = new Uint8Array(array, byteOffset)
- } else {
- buf = new Uint8Array(array, byteOffset, length)
- }
-
- // Return an augmented `Uint8Array` instance
- buf.__proto__ = Buffer.prototype
- return buf
- }
-
- function fromObject(obj) {
- if (Buffer.isBuffer(obj)) {
- var len = checked(obj.length) | 0
- var buf = createBuffer(len)
-
- if (buf.length === 0) {
- return buf
- }
-
- obj.copy(buf, 0, 0, len)
- return buf
- }
-
- if (obj.length !== undefined) {
- if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {
- return createBuffer(0)
- }
- return fromArrayLike(obj)
- }
-
- if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
- return fromArrayLike(obj.data)
- }
- }
-
- function checked(length) {
- // Note: cannot use `length < K_MAX_LENGTH` here because that fails when
- // length is NaN (which is otherwise coerced to zero.)
- if (length >= K_MAX_LENGTH) {
- throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
- 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')
- }
- return length | 0
- }
-
- function SlowBuffer(length) {
- if (+length != length) { // eslint-disable-line eqeqeq
- length = 0
- }
- return Buffer.alloc(+length)
- }
-
- Buffer.isBuffer = function isBuffer(b) {
- return b != null && b._isBuffer === true &&
- b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false
- }
-
- Buffer.compare = function compare(a, b) {
- if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)
- if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)
- if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
- throw new TypeError(
- 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
- )
- }
-
- if (a === b) return 0
-
- var x = a.length
- var y = b.length
-
- for (var i = 0, len = Math.min(x, y); i < len; ++i) {
- if (a[i] !== b[i]) {
- x = a[i]
- y = b[i]
- break
- }
- }
-
- if (x < y) return -1
- if (y < x) return 1
- return 0
- }
-
- Buffer.isEncoding = function isEncoding(encoding) {
- switch (String(encoding).toLowerCase()) {
- case 'hex':
- case 'utf8':
- case 'utf-8':
- case 'ascii':
- case 'latin1':
- case 'binary':
- case 'base64':
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return true
- default:
- return false
- }
- }
-
- Buffer.concat = function concat(list, length) {
- if (!Array.isArray(list)) {
- throw new TypeError('"list" argument must be an Array of Buffers')
- }
-
- if (list.length === 0) {
- return Buffer.alloc(0)
- }
-
- var i
- if (length === undefined) {
- length = 0
- for (i = 0; i < list.length; ++i) {
- length += list[i].length
- }
- }
-
- var buffer = Buffer.allocUnsafe(length)
- var pos = 0
- for (i = 0; i < list.length; ++i) {
- var buf = list[i]
- if (isInstance(buf, Uint8Array)) {
- buf = Buffer.from(buf)
- }
- if (!Buffer.isBuffer(buf)) {
- throw new TypeError('"list" argument must be an Array of Buffers')
- }
- buf.copy(buffer, pos)
- pos += buf.length
- }
- return buffer
- }
-
- function byteLength(string, encoding) {
- if (Buffer.isBuffer(string)) {
- return string.length
- }
- if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {
- return string.byteLength
- }
- if (typeof string !== 'string') {
- throw new TypeError(
- 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' +
- 'Received type ' + typeof string
- )
- }
-
- var len = string.length
- var mustMatch = (arguments.length > 2 && arguments[2] === true)
- if (!mustMatch && len === 0) return 0
-
- // Use a for loop to avoid recursion
- var loweredCase = false
- for (; ;) {
- switch (encoding) {
- case 'ascii':
- case 'latin1':
- case 'binary':
- return len
- case 'utf8':
- case 'utf-8':
- return utf8ToBytes(string).length
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return len * 2
- case 'hex':
- return len >>> 1
- case 'base64':
- return base64ToBytes(string).length
- default:
- if (loweredCase) {
- return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8
- }
- encoding = ('' + encoding).toLowerCase()
- loweredCase = true
- }
- }
- }
- Buffer.byteLength = byteLength
-
- function slowToString(encoding, start, end) {
- var loweredCase = false
-
- // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
- // property of a typed array.
-
- // This behaves neither like String nor Uint8Array in that we set start/end
- // to their upper/lower bounds if the value passed is out of range.
- // undefined is handled specially as per ECMA-262 6th Edition,
- // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
- if (start === undefined || start < 0) {
- start = 0
- }
- // Return early if start > this.length. Done here to prevent potential uint32
- // coercion fail below.
- if (start > this.length) {
- return ''
- }
-
- if (end === undefined || end > this.length) {
- end = this.length
- }
-
- if (end <= 0) {
- return ''
- }
-
- // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
- end >>>= 0
- start >>>= 0
-
- if (end <= start) {
- return ''
- }
-
- if (!encoding) encoding = 'utf8'
-
- while (true) {
- switch (encoding) {
- case 'hex':
- return hexSlice(this, start, end)
-
- case 'utf8':
- case 'utf-8':
- return utf8Slice(this, start, end)
-
- case 'ascii':
- return asciiSlice(this, start, end)
-
- case 'latin1':
- case 'binary':
- return latin1Slice(this, start, end)
-
- case 'base64':
- return base64Slice(this, start, end)
-
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return utf16leSlice(this, start, end)
-
- default:
- if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
- encoding = (encoding + '').toLowerCase()
- loweredCase = true
- }
- }
- }
-
- // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)
- // to detect a Buffer instance. It's not possible to use `instanceof Buffer`
- // reliably in a browserify context because there could be multiple different
- // copies of the 'buffer' package in use. This method works even for Buffer
- // instances that were created from another copy of the `buffer` package.
- // See: https://github.com/feross/buffer/issues/154
- Buffer.prototype._isBuffer = true
-
- function swap(b, n, m) {
- var i = b[n]
- b[n] = b[m]
- b[m] = i
- }
-
- Buffer.prototype.swap16 = function swap16() {
- var len = this.length
- if (len % 2 !== 0) {
- throw new RangeError('Buffer size must be a multiple of 16-bits')
- }
- for (var i = 0; i < len; i += 2) {
- swap(this, i, i + 1)
- }
- return this
- }
-
- Buffer.prototype.swap32 = function swap32() {
- var len = this.length
- if (len % 4 !== 0) {
- throw new RangeError('Buffer size must be a multiple of 32-bits')
- }
- for (var i = 0; i < len; i += 4) {
- swap(this, i, i + 3)
- swap(this, i + 1, i + 2)
- }
- return this
- }
-
- Buffer.prototype.swap64 = function swap64() {
- var len = this.length
- if (len % 8 !== 0) {
- throw new RangeError('Buffer size must be a multiple of 64-bits')
- }
- for (var i = 0; i < len; i += 8) {
- swap(this, i, i + 7)
- swap(this, i + 1, i + 6)
- swap(this, i + 2, i + 5)
- swap(this, i + 3, i + 4)
- }
- return this
- }
-
- Buffer.prototype.toString = function toString() {
- var length = this.length
- if (length === 0) return ''
- if (arguments.length === 0) return utf8Slice(this, 0, length)
- return slowToString.apply(this, arguments)
- }
-
- Buffer.prototype.toLocaleString = Buffer.prototype.toString
-
- Buffer.prototype.equals = function equals(b) {
- if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
- if (this === b) return true
- return Buffer.compare(this, b) === 0
- }
-
- Buffer.prototype.inspect = function inspect() {
- var str = ''
- var max = exports.INSPECT_MAX_BYTES
- str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()
- if (this.length > max) str += ' ... '
- return '<Buffer ' + str + '>'
- }
-
- Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {
- if (isInstance(target, Uint8Array)) {
- target = Buffer.from(target, target.offset, target.byteLength)
- }
- if (!Buffer.isBuffer(target)) {
- throw new TypeError(
- 'The "target" argument must be one of type Buffer or Uint8Array. ' +
- 'Received type ' + (typeof target)
- )
- }
+ <meta content="width=device-width, initial-scale=1, user-scalable=no" name="viewport"/>
+ <link href="fonts.css" rel="stylesheet">
+ <link href="styles.css" rel="stylesheet">
+ <style>
+
+ .ql-toolbar {
+ overflow-x: auto;
+ width: 100vw;
+ white-space: nowrap;
+ position: fixed;
+ height: 50px;
+ bottom: 0px;
+ left: 0px;
+ }
+ </style>
- if (start === undefined) {
- start = 0
- }
- if (end === undefined) {
- end = target ? target.length : 0
- }
- if (thisStart === undefined) {
- thisStart = 0
- }
- if (thisEnd === undefined) {
- thisEnd = this.length
- }
-
- if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
- throw new RangeError('out of range index')
- }
-
- if (thisStart >= thisEnd && start >= end) {
- return 0
- }
- if (thisStart >= thisEnd) {
- return -1
- }
- if (start >= end) {
- return 1
- }
-
- start >>>= 0
- end >>>= 0
- thisStart >>>= 0
- thisEnd >>>= 0
-
- if (this === target) return 0
-
- var x = thisEnd - thisStart
- var y = end - start
- var len = Math.min(x, y)
-
- var thisCopy = this.slice(thisStart, thisEnd)
- var targetCopy = target.slice(start, end)
-
- for (var i = 0; i < len; ++i) {
- if (thisCopy[i] !== targetCopy[i]) {
- x = thisCopy[i]
- y = targetCopy[i]
- break
- }
- }
-
- if (x < y) return -1
- if (y < x) return 1
- return 0
- }
-
- // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
- // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
- //
- // Arguments:
- // - buffer - a Buffer to search
- // - val - a string, Buffer, or number
- // - byteOffset - an index into `buffer`; will be clamped to an int32
- // - encoding - an optional encoding, relevant is val is a string
- // - dir - true for indexOf, false for lastIndexOf
- function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
- // Empty buffer means no match
- if (buffer.length === 0) return -1
-
- // Normalize byteOffset
- if (typeof byteOffset === 'string') {
- encoding = byteOffset
- byteOffset = 0
- } else if (byteOffset > 0x7fffffff) {
- byteOffset = 0x7fffffff
- } else if (byteOffset < -0x80000000) {
- byteOffset = -0x80000000
- }
- byteOffset = +byteOffset // Coerce to Number.
- if (numberIsNaN(byteOffset)) {
- // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
- byteOffset = dir ? 0 : (buffer.length - 1)
- }
-
- // Normalize byteOffset: negative offsets start from the end of the buffer
- if (byteOffset < 0) byteOffset = buffer.length + byteOffset
- if (byteOffset >= buffer.length) {
- if (dir) return -1
- else byteOffset = buffer.length - 1
- } else if (byteOffset < 0) {
- if (dir) byteOffset = 0
- else return -1
- }
-
- // Normalize val
- if (typeof val === 'string') {
- val = Buffer.from(val, encoding)
- }
-
- // Finally, search either indexOf (if dir is true) or lastIndexOf
- if (Buffer.isBuffer(val)) {
- // Special case: looking for empty string/buffer always fails
- if (val.length === 0) {
- return -1
- }
- return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
- } else if (typeof val === 'number') {
- val = val & 0xFF // Search for a byte value [0-255]
- if (typeof Uint8Array.prototype.indexOf === 'function') {
- if (dir) {
- return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
- } else {
- return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
- }
- }
- return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)
- }
-
- throw new TypeError('val must be string, number or Buffer')
- }
-
- function arrayIndexOf(arr, val, byteOffset, encoding, dir) {
- var indexSize = 1
- var arrLength = arr.length
- var valLength = val.length
-
- if (encoding !== undefined) {
- encoding = String(encoding).toLowerCase()
- if (encoding === 'ucs2' || encoding === 'ucs-2' ||
- encoding === 'utf16le' || encoding === 'utf-16le') {
- if (arr.length < 2 || val.length < 2) {
- return -1
- }
- indexSize = 2
- arrLength /= 2
- valLength /= 2
- byteOffset /= 2
- }
- }
-
- function read(buf, i) {
- if (indexSize === 1) {
- return buf[i]
- } else {
- return buf.readUInt16BE(i * indexSize)
- }
- }
-
- var i
- if (dir) {
- var foundIndex = -1
- for (i = byteOffset; i < arrLength; i++) {
- if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
- if (foundIndex === -1) foundIndex = i
- if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
- } else {
- if (foundIndex !== -1) i -= i - foundIndex
- foundIndex = -1
- }
- }
- } else {
- if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
- for (i = byteOffset; i >= 0; i--) {
- var found = true
- for (var j = 0; j < valLength; j++) {
- if (read(arr, i + j) !== read(val, j)) {
- found = false
- break
- }
- }
- if (found) return i
- }
- }
-
- return -1
- }
-
- Buffer.prototype.includes = function includes(val, byteOffset, encoding) {
- return this.indexOf(val, byteOffset, encoding) !== -1
- }
-
- Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) {
- return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
- }
-
- Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
- return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
- }
-
- function hexWrite(buf, string, offset, length) {
- offset = Number(offset) || 0
- var remaining = buf.length - offset
- if (!length) {
- length = remaining
- } else {
- length = Number(length)
- if (length > remaining) {
- length = remaining
- }
- }
-
- var strLen = string.length
-
- if (length > strLen / 2) {
- length = strLen / 2
- }
- for (var i = 0; i < length; ++i) {
- var parsed = parseInt(string.substr(i * 2, 2), 16)
- if (numberIsNaN(parsed)) return i
- buf[offset + i] = parsed
- }
- return i
- }
-
- function utf8Write(buf, string, offset, length) {
- return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
- }
-
- function asciiWrite(buf, string, offset, length) {
- return blitBuffer(asciiToBytes(string), buf, offset, length)
- }
-
- function latin1Write(buf, string, offset, length) {
- return asciiWrite(buf, string, offset, length)
- }
-
- function base64Write(buf, string, offset, length) {
- return blitBuffer(base64ToBytes(string), buf, offset, length)
- }
-
- function ucs2Write(buf, string, offset, length) {
- return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
- }
-
- Buffer.prototype.write = function write(string, offset, length, encoding) {
- // Buffer#write(string)
- if (offset === undefined) {
- encoding = 'utf8'
- length = this.length
- offset = 0
- // Buffer#write(string, encoding)
- } else if (length === undefined && typeof offset === 'string') {
- encoding = offset
- length = this.length
- offset = 0
- // Buffer#write(string, offset[, length][, encoding])
- } else if (isFinite(offset)) {
- offset = offset >>> 0
- if (isFinite(length)) {
- length = length >>> 0
- if (encoding === undefined) encoding = 'utf8'
- } else {
- encoding = length
- length = undefined
- }
- } else {
- throw new Error(
- 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
- )
- }
-
- var remaining = this.length - offset
- if (length === undefined || length > remaining) length = remaining
-
- if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
- throw new RangeError('Attempt to write outside buffer bounds')
- }
-
- if (!encoding) encoding = 'utf8'
-
- var loweredCase = false
- for (; ;) {
- switch (encoding) {
- case 'hex':
- return hexWrite(this, string, offset, length)
-
- case 'utf8':
- case 'utf-8':
- return utf8Write(this, string, offset, length)
-
- case 'ascii':
- return asciiWrite(this, string, offset, length)
-
- case 'latin1':
- case 'binary':
- return latin1Write(this, string, offset, length)
-
- case 'base64':
- // Warning: maxLength not taken into account in base64Write
- return base64Write(this, string, offset, length)
-
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return ucs2Write(this, string, offset, length)
-
- default:
- if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
- encoding = ('' + encoding).toLowerCase()
- loweredCase = true
- }
- }
- }
-
- Buffer.prototype.toJSON = function toJSON() {
- return {
- type: 'Buffer',
- data: Array.prototype.slice.call(this._arr || this, 0)
- }
- }
-
- function base64Slice(buf, start, end) {
- if (start === 0 && end === buf.length) {
- return base64.fromByteArray(buf)
- } else {
- return base64.fromByteArray(buf.slice(start, end))
- }
- }
-
- function utf8Slice(buf, start, end) {
- end = Math.min(buf.length, end)
- var res = []
-
- var i = start
- while (i < end) {
- var firstByte = buf[i]
- var codePoint = null
- var bytesPerSequence = (firstByte > 0xEF) ? 4
- : (firstByte > 0xDF) ? 3
- : (firstByte > 0xBF) ? 2
- : 1
-
- if (i + bytesPerSequence <= end) {
- var secondByte, thirdByte, fourthByte, tempCodePoint
-
- switch (bytesPerSequence) {
- case 1:
- if (firstByte < 0x80) {
- codePoint = firstByte
- }
- break
- case 2:
- secondByte = buf[i + 1]
- if ((secondByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
- if (tempCodePoint > 0x7F) {
- codePoint = tempCodePoint
- }
- }
- break
- case 3:
- secondByte = buf[i + 1]
- thirdByte = buf[i + 2]
- if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
- if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
- codePoint = tempCodePoint
- }
- }
- break
- case 4:
- secondByte = buf[i + 1]
- thirdByte = buf[i + 2]
- fourthByte = buf[i + 3]
- if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
- if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
- codePoint = tempCodePoint
- }
- }
- }
- }
-
- if (codePoint === null) {
- // we did not generate a valid codePoint so insert a
- // replacement char (U+FFFD) and advance only 1 byte
- codePoint = 0xFFFD
- bytesPerSequence = 1
- } else if (codePoint > 0xFFFF) {
- // encode to utf16 (surrogate pair dance)
- codePoint -= 0x10000
- res.push(codePoint >>> 10 & 0x3FF | 0xD800)
- codePoint = 0xDC00 | codePoint & 0x3FF
- }
-
- res.push(codePoint)
- i += bytesPerSequence
- }
-
- return decodeCodePointsArray(res)
- }
-
- // Based on http://stackoverflow.com/a/22747272/680742, the browser with
- // the lowest limit is Chrome, with 0x10000 args.
- // We go 1 magnitude less, for safety
- var MAX_ARGUMENTS_LENGTH = 0x1000
-
- function decodeCodePointsArray(codePoints) {
- var len = codePoints.length
- if (len <= MAX_ARGUMENTS_LENGTH) {
- return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
- }
-
- // Decode in chunks to avoid "call stack size exceeded".
- var res = ''
- var i = 0
- while (i < len) {
- res += String.fromCharCode.apply(
- String,
- codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
- )
- }
- return res
- }
-
- function asciiSlice(buf, start, end) {
- var ret = ''
- end = Math.min(buf.length, end)
-
- for (var i = start; i < end; ++i) {
- ret += String.fromCharCode(buf[i] & 0x7F)
- }
- return ret
- }
-
- function latin1Slice(buf, start, end) {
- var ret = ''
- end = Math.min(buf.length, end)
-
- for (var i = start; i < end; ++i) {
- ret += String.fromCharCode(buf[i])
- }
- return ret
- }
-
- function hexSlice(buf, start, end) {
- var len = buf.length
-
- if (!start || start < 0) start = 0
- if (!end || end < 0 || end > len) end = len
-
- var out = ''
- for (var i = start; i < end; ++i) {
- out += toHex(buf[i])
- }
- return out
- }
-
- function utf16leSlice(buf, start, end) {
- var bytes = buf.slice(start, end)
- var res = ''
- for (var i = 0; i < bytes.length; i += 2) {
- res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))
- }
- return res
- }
-
- Buffer.prototype.slice = function slice(start, end) {
- var len = this.length
- start = ~~start
- end = end === undefined ? len : ~~end
-
- if (start < 0) {
- start += len
- if (start < 0) start = 0
- } else if (start > len) {
- start = len
- }
-
- if (end < 0) {
- end += len
- if (end < 0) end = 0
- } else if (end > len) {
- end = len
- }
-
- if (end < start) end = start
-
- var newBuf = this.subarray(start, end)
- // Return an augmented `Uint8Array` instance
- newBuf.__proto__ = Buffer.prototype
- return newBuf
- }
-
- /*
- * Need to make sure that buffer isn't trying to write out of bounds.
- */
- function checkOffset(offset, ext, length) {
- if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
- if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
- }
-
- Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) {
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
-
- var val = this[offset]
- var mul = 1
- var i = 0
- while (++i < byteLength && (mul *= 0x100)) {
- val += this[offset + i] * mul
- }
-
- return val
- }
-
- Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) {
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) {
- checkOffset(offset, byteLength, this.length)
- }
-
- var val = this[offset + --byteLength]
- var mul = 1
- while (byteLength > 0 && (mul *= 0x100)) {
- val += this[offset + --byteLength] * mul
- }
-
- return val
- }
-
- Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 1, this.length)
- return this[offset]
- }
-
- Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 2, this.length)
- return this[offset] | (this[offset + 1] << 8)
- }
-
- Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 2, this.length)
- return (this[offset] << 8) | this[offset + 1]
- }
-
- Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return ((this[offset]) |
- (this[offset + 1] << 8) |
- (this[offset + 2] << 16)) +
- (this[offset + 3] * 0x1000000)
- }
-
- Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return (this[offset] * 0x1000000) +
- ((this[offset + 1] << 16) |
- (this[offset + 2] << 8) |
- this[offset + 3])
- }
-
- Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) {
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
-
- var val = this[offset]
- var mul = 1
- var i = 0
- while (++i < byteLength && (mul *= 0x100)) {
- val += this[offset + i] * mul
- }
- mul *= 0x80
-
- if (val >= mul) val -= Math.pow(2, 8 * byteLength)
-
- return val
- }
-
- Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) {
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
-
- var i = byteLength
- var mul = 1
- var val = this[offset + --i]
- while (i > 0 && (mul *= 0x100)) {
- val += this[offset + --i] * mul
- }
- mul *= 0x80
-
- if (val >= mul) val -= Math.pow(2, 8 * byteLength)
-
- return val
- }
-
- Buffer.prototype.readInt8 = function readInt8(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 1, this.length)
- if (!(this[offset] & 0x80)) return (this[offset])
- return ((0xff - this[offset] + 1) * -1)
- }
-
- Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 2, this.length)
- var val = this[offset] | (this[offset + 1] << 8)
- return (val & 0x8000) ? val | 0xFFFF0000 : val
- }
-
- Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 2, this.length)
- var val = this[offset + 1] | (this[offset] << 8)
- return (val & 0x8000) ? val | 0xFFFF0000 : val
- }
-
- Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return (this[offset]) |
- (this[offset + 1] << 8) |
- (this[offset + 2] << 16) |
- (this[offset + 3] << 24)
- }
-
- Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return (this[offset] << 24) |
- (this[offset + 1] << 16) |
- (this[offset + 2] << 8) |
- (this[offset + 3])
- }
-
- Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
- return ieee754.read(this, offset, true, 23, 4)
- }
-
- Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
- return ieee754.read(this, offset, false, 23, 4)
- }
-
- Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 8, this.length)
- return ieee754.read(this, offset, true, 52, 8)
- }
-
- Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 8, this.length)
- return ieee754.read(this, offset, false, 52, 8)
- }
-
- function checkInt(buf, value, offset, ext, max, min) {
- if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
- if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
- if (offset + ext > buf.length) throw new RangeError('Index out of range')
- }
-
- Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) {
- value = +value
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) {
- var maxBytes = Math.pow(2, 8 * byteLength) - 1
- checkInt(this, value, offset, byteLength, maxBytes, 0)
- }
-
- var mul = 1
- var i = 0
- this[offset] = value & 0xFF
- while (++i < byteLength && (mul *= 0x100)) {
- this[offset + i] = (value / mul) & 0xFF
- }
-
- return offset + byteLength
- }
-
- Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) {
- value = +value
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) {
- var maxBytes = Math.pow(2, 8 * byteLength) - 1
- checkInt(this, value, offset, byteLength, maxBytes, 0)
- }
-
- var i = byteLength - 1
- var mul = 1
- this[offset + i] = value & 0xFF
- while (--i >= 0 && (mul *= 0x100)) {
- this[offset + i] = (value / mul) & 0xFF
- }
-
- return offset + byteLength
- }
-
- Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
- this[offset] = (value & 0xff)
- return offset + 1
- }
-
- Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- return offset + 2
- }
-
- Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
- this[offset] = (value >>> 8)
- this[offset + 1] = (value & 0xff)
- return offset + 2
- }
-
- Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
- this[offset + 3] = (value >>> 24)
- this[offset + 2] = (value >>> 16)
- this[offset + 1] = (value >>> 8)
- this[offset] = (value & 0xff)
- return offset + 4
- }
-
- Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
- this[offset] = (value >>> 24)
- this[offset + 1] = (value >>> 16)
- this[offset + 2] = (value >>> 8)
- this[offset + 3] = (value & 0xff)
- return offset + 4
- }
-
- Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) {
- var limit = Math.pow(2, (8 * byteLength) - 1)
-
- checkInt(this, value, offset, byteLength, limit - 1, -limit)
- }
-
- var i = 0
- var mul = 1
- var sub = 0
- this[offset] = value & 0xFF
- while (++i < byteLength && (mul *= 0x100)) {
- if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
- sub = 1
- }
- this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
- }
-
- return offset + byteLength
- }
-
- Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) {
- var limit = Math.pow(2, (8 * byteLength) - 1)
-
- checkInt(this, value, offset, byteLength, limit - 1, -limit)
- }
-
- var i = byteLength - 1
- var mul = 1
- var sub = 0
- this[offset + i] = value & 0xFF
- while (--i >= 0 && (mul *= 0x100)) {
- if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
- sub = 1
- }
- this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
- }
-
- return offset + byteLength
- }
-
- Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
- if (value < 0) value = 0xff + value + 1
- this[offset] = (value & 0xff)
- return offset + 1
- }
-
- Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- return offset + 2
- }
-
- Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
- this[offset] = (value >>> 8)
- this[offset + 1] = (value & 0xff)
- return offset + 2
- }
-
- Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- this[offset + 2] = (value >>> 16)
- this[offset + 3] = (value >>> 24)
- return offset + 4
- }
-
- Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
- if (value < 0) value = 0xffffffff + value + 1
- this[offset] = (value >>> 24)
- this[offset + 1] = (value >>> 16)
- this[offset + 2] = (value >>> 8)
- this[offset + 3] = (value & 0xff)
- return offset + 4
- }
-
- function checkIEEE754(buf, value, offset, ext, max, min) {
- if (offset + ext > buf.length) throw new RangeError('Index out of range')
- if (offset < 0) throw new RangeError('Index out of range')
- }
-
- function writeFloat(buf, value, offset, littleEndian, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) {
- checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
- }
- ieee754.write(buf, value, offset, littleEndian, 23, 4)
- return offset + 4
- }
-
- Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {
- return writeFloat(this, value, offset, true, noAssert)
- }
-
- Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {
- return writeFloat(this, value, offset, false, noAssert)
- }
-
- function writeDouble(buf, value, offset, littleEndian, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) {
- checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
- }
- ieee754.write(buf, value, offset, littleEndian, 52, 8)
- return offset + 8
- }
-
- Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {
- return writeDouble(this, value, offset, true, noAssert)
- }
-
- Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {
- return writeDouble(this, value, offset, false, noAssert)
- }
-
- // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
- Buffer.prototype.copy = function copy(target, targetStart, start, end) {
- if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')
- if (!start) start = 0
- if (!end && end !== 0) end = this.length
- if (targetStart >= target.length) targetStart = target.length
- if (!targetStart) targetStart = 0
- if (end > 0 && end < start) end = start
-
- // Copy 0 bytes; we're done
- if (end === start) return 0
- if (target.length === 0 || this.length === 0) return 0
-
- // Fatal error conditions
- if (targetStart < 0) {
- throw new RangeError('targetStart out of bounds')
- }
- if (start < 0 || start >= this.length) throw new RangeError('Index out of range')
- if (end < 0) throw new RangeError('sourceEnd out of bounds')
-
- // Are we oob?
- if (end > this.length) end = this.length
- if (target.length - targetStart < end - start) {
- end = target.length - targetStart + start
- }
-
- var len = end - start
-
- if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {
- // Use built-in when available, missing from IE11
- this.copyWithin(targetStart, start, end)
- } else if (this === target && start < targetStart && targetStart < end) {
- // descending copy from end
- for (var i = len - 1; i >= 0; --i) {
- target[i + targetStart] = this[i + start]
- }
- } else {
- Uint8Array.prototype.set.call(
- target,
- this.subarray(start, end),
- targetStart
- )
- }
-
- return len
- }
-
- // Usage:
- // buffer.fill(number[, offset[, end]])
- // buffer.fill(buffer[, offset[, end]])
- // buffer.fill(string[, offset[, end]][, encoding])
- Buffer.prototype.fill = function fill(val, start, end, encoding) {
- // Handle string cases:
- if (typeof val === 'string') {
- if (typeof start === 'string') {
- encoding = start
- start = 0
- end = this.length
- } else if (typeof end === 'string') {
- encoding = end
- end = this.length
- }
- if (encoding !== undefined && typeof encoding !== 'string') {
- throw new TypeError('encoding must be a string')
- }
- if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
- throw new TypeError('Unknown encoding: ' + encoding)
- }
- if (val.length === 1) {
- var code = val.charCodeAt(0)
- if ((encoding === 'utf8' && code < 128) ||
- encoding === 'latin1') {
- // Fast path: If `val` fits into a single byte, use that numeric value.
- val = code
- }
- }
- } else if (typeof val === 'number') {
- val = val & 255
- }
-
- // Invalid ranges are not set to a default, so can range check early.
- if (start < 0 || this.length < start || this.length < end) {
- throw new RangeError('Out of range index')
- }
-
- if (end <= start) {
- return this
- }
+</head>
- start = start >>> 0
- end = end === undefined ? this.length : end >>> 0
+<body class="app-body">
+<div id="titlebar">
+ <form
+ id="formBox"
+ >
+
+
+ <input id="titleInput" placeholder="Title here"/>
+ <div class="info-bar">
+ <p id="infowords"></p>
+ <p>-</p>
+ <p id="infodate"></p>
+ <p>-</p>
+ <p id="infosaved"></p>
+ </form>
+</div>
+</div>
+<div id="editor"></div>
+<div id="toolbar"></div>
- if (!val) val = 0
+</body>
- var i
- if (typeof val === 'number') {
- for (i = start; i < end; ++i) {
- this[i] = val
- }
- } else {
- var bytes = Buffer.isBuffer(val)
- ? val
- : Buffer.from(val, encoding)
- var len = bytes.length
- if (len === 0) {
- throw new TypeError('The value "' + val +
- '" is invalid for argument "value"')
- }
- for (i = 0; i < end - start; ++i) {
- this[i + start] = bytes[i % len]
- }
- }
+<script src="constants.js"></script>
+<script src="listeners.js"></script>
+<script src="module.js"></script>
+<script src="quill.js"></script>
- return this
- }
+<script>
+ let editor;
- // HELPER FUNCTIONS
- // ================
+ function loadAction(premium, noMenu) {
+ let titleIn = document.getElementById('titlebar');
+ titleIn.style['padding-left'] = 0;
+ titleIn.style['padding-right'] = 0;
- var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g
+ let mainToolbar = premium ? proToolbar : simpleToolbar;
- function base64clean(str) {
- // Node takes equal signs as end of the Base64 encoding
- str = str.split('=')[0]
- // Node strips out invalid characters like \n and \t from the string, base64-js does not
- str = str.trim().replace(INVALID_BASE64_RE, '')
- // Node converts strings with length < 2 to ''
- if (str.length < 2) return ''
- // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
- while (str.length % 4 !== 0) {
- str = str + '='
- }
- return str
- }
+ const Quill = require('quill');
- function toHex(n) {
- if (n < 16) return '0' + n.toString(16)
- return n.toString(16)
- }
+ setFonts();
- function utf8ToBytes(string, units) {
- units = units || Infinity
- var codePoint
- var length = string.length
- var leadSurrogate = null
- var bytes = []
+ Quill.register("modules/imageCompressor", imageCompressor);
- for (var i = 0; i < length; ++i) {
- codePoint = string.charCodeAt(i)
- // is surrogate component
- if (codePoint > 0xD7FF && codePoint < 0xE000) {
- // last char was a lead
- if (!leadSurrogate) {
- // no lead yet
- if (codePoint > 0xDBFF) {
- // unexpected trail
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- continue
- } else if (i + 1 === length) {
- // unpaired lead
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- continue
+ editor = new Quill('#editor', {
+ modules: {
+ toolbar: mainToolbar,
+ imageCompressor: {
+ quality: 0.9,
+ maxWidth: 1024,
+ imageType: 'image/jpeg'
+ },
+ history: {
+ delay: 2000,
+ maxStack: 500,
+ userOnly: true
}
+ },
+ placeholder: 'Start writing your note',
+ theme: 'snow',
+ });
- // valid lead
- leadSurrogate = codePoint
-
- continue
- }
-
- // 2 leads in a row
- if (codePoint < 0xDC00) {
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- leadSurrogate = codePoint
- continue
- }
-
- // valid surrogate pair
- codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
- } else if (leadSurrogate) {
- // valid bmp char, but last char was a lead
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- }
-
- leadSurrogate = null
-
- // encode utf8
- if (codePoint < 0x80) {
- if ((units -= 1) < 0) break
- bytes.push(codePoint)
- } else if (codePoint < 0x800) {
- if ((units -= 2) < 0) break
- bytes.push(
- codePoint >> 0x6 | 0xC0,
- codePoint & 0x3F | 0x80
- )
- } else if (codePoint < 0x10000) {
- if ((units -= 3) < 0) break
- bytes.push(
- codePoint >> 0xC | 0xE0,
- codePoint >> 0x6 & 0x3F | 0x80,
- codePoint & 0x3F | 0x80
- )
- } else if (codePoint < 0x110000) {
- if ((units -= 4) < 0) break
- bytes.push(
- codePoint >> 0x12 | 0xF0,
- codePoint >> 0xC & 0x3F | 0x80,
- codePoint >> 0x6 & 0x3F | 0x80,
- codePoint & 0x3F | 0x80
- )
- } else {
- throw new Error('Invalid code point')
- }
- }
-
- return bytes
- }
-
- function asciiToBytes(str) {
- var byteArray = []
- for (var i = 0; i < str.length; ++i) {
- // Node's code seems to be doing this and not & 0x7F..
- byteArray.push(str.charCodeAt(i) & 0xFF)
- }
- return byteArray
- }
-
- function utf16leToBytes(str, units) {
- var c, hi, lo
- var byteArray = []
- for (var i = 0; i < str.length; ++i) {
- if ((units -= 2) < 0) break
-
- c = str.charCodeAt(i)
- hi = c >> 8
- lo = c % 256
- byteArray.push(lo)
- byteArray.push(hi)
- }
-
- return byteArray
- }
-
- function base64ToBytes(str) {
- return base64.toByteArray(base64clean(str))
- }
-
- function blitBuffer(src, dst, offset, length) {
- for (var i = 0; i < length; ++i) {
- if ((i + offset >= dst.length) || (i >= src.length)) break
- dst[i + offset] = src[i]
- }
- return i
- }
-
- // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass
- // the `instanceof` check but they should be treated as of that type.
- // See: https://github.com/feross/buffer/issues/166
- function isInstance(obj, type) {
- return obj instanceof type ||
- (obj != null && obj.constructor != null && obj.constructor.name != null &&
- obj.constructor.name === type.name)
- }
- function numberIsNaN(obj) {
- // For IE11 support
- return obj !== obj // eslint-disable-line no-self-compare
- }
-
- }, { "base64-js": 3, "ieee754": 5 }], 5: [function (require, module, exports) {
- exports.read = function (buffer, offset, isLE, mLen, nBytes) {
- var e, m
- var eLen = (nBytes * 8) - mLen - 1
- var eMax = (1 << eLen) - 1
- var eBias = eMax >> 1
- var nBits = -7
- var i = isLE ? (nBytes - 1) : 0
- var d = isLE ? -1 : 1
- var s = buffer[offset + i]
-
- i += d
-
- e = s & ((1 << (-nBits)) - 1)
- s >>= (-nBits)
- nBits += eLen
- for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) { }
-
- m = e & ((1 << (-nBits)) - 1)
- e >>= (-nBits)
- nBits += mLen
- for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) { }
-
- if (e === 0) {
- e = 1 - eBias
- } else if (e === eMax) {
- return m ? NaN : ((s ? -1 : 1) * Infinity)
- } else {
- m = m + Math.pow(2, mLen)
- e = e - eBias
- }
- return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
- }
-
- exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
- var e, m, c
- var eLen = (nBytes * 8) - mLen - 1
- var eMax = (1 << eLen) - 1
- var eBias = eMax >> 1
- var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
- var i = isLE ? 0 : (nBytes - 1)
- var d = isLE ? 1 : -1
- var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
-
- value = Math.abs(value)
-
- if (isNaN(value) || value === Infinity) {
- m = isNaN(value) ? 1 : 0
- e = eMax
- } else {
- e = Math.floor(Math.log(value) / Math.LN2)
- if (value * (c = Math.pow(2, -e)) < 1) {
- e--
- c *= 2
- }
- if (e + eBias >= 1) {
- value += rt / c
- } else {
- value += rt * Math.pow(2, 1 - eBias)
- }
- if (value * c >= 2) {
- e++
- c /= 2
- }
-
- if (e + eBias >= eMax) {
- m = 0
- e = eMax
- } else if (e + eBias >= 1) {
- m = ((value * c) - 1) * Math.pow(2, mLen)
- e = e + eBias
- } else {
- m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
- e = 0
- }
- }
-
- for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) { }
-
- e = (e << mLen) | m
- eLen += mLen
- for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) { }
-
- buffer[offset + i - d] |= s * 128
- }
-
- }, {}]
- }, {}, [1]);
+ let Font = Quill.import('formats/font');
+ Font.whitelist = fontNames;
+ Quill.register(Font, true);
- }
+ addLinkMatcher();
+ attachTitleInputListeners();
+ setTheme();
+ attachEditorListeners();
+ fixDropdownMenuLocations();
+ }
</script>
diff --git a/apps/mobile/html/Web.bundle/site/listeners.js b/apps/mobile/html/Web.bundle/site/listeners.js
new file mode 100644
index 000000000..4b1f5c6a2
--- /dev/null
+++ b/apps/mobile/html/Web.bundle/site/listeners.js
@@ -0,0 +1,207 @@
+
+function attachTitleInputListeners() {
+ document.getElementById('formBox').onsubmit = function (evt) {
+ evt.preventDefault()
+ editor.focus();
+ editor.setSelection(editor.getText().length - 1, 0);
+ onTitleChange();
+ }
+
+ document.getElementById('titleInput').onkeydown = function (evt) {
+ onTitleChange();
+ }
+
+ document.getElementById('titleInput').onkeyup = function (evt) {
+
+ onTitleChange()
+ }
+
+
+
+}
+
+function onTitleChange() {
+ let titleMessage = {
+ type: 'title',
+ value: document.getElementById('titleInput').value
+ }
+
+ if (titleMessage && typeof titleMessage.value === 'string') {
+ window.ReactNativeWebView.postMessage(JSON.stringify(titleMessage));
+ }
+}
+
+function attachEditorListeners() {
+
+
+ editor.once('text-change', function () {
+
+ window.ReactNativeWebView.postMessage("loaded");
+ let text = editor.getText();
+ document.getElementById("infowords").innerText = text.split(' ').length + ' words';
+
+
+ });
+
+ window.addEventListener('message', data => {
+
+ let message = JSON.parse(data.data);
+ let type = message.type;
+ let value;
+ if (message.value && message.type !== 'nomenu') {
+ value = message.value;
+ } else {
+ value = message.value
+ }
+ switch (type) {
+ case "reset": {
+ editor.history.clear();
+ editor.setText('', 'api');
+ document.getElementById('titleInput').value = '';
+ document.getElementById('titleInput').blur();
+ editor.blur();
+ window.blur();
+ document.getElementById('infodate').innerText = "";
+ document.getElementById('infosaved').innerText = "";
+ document.getElementById("infowords").innerText = "";
+ break
+ }
+ case "blur":
+ document.getElementById('titleInput').blur();
+ editor.blur();
+ window.blur();
+ break;
+ case "undo":
+ editor.history.undo();
+ break;
+ case "redo":
+ editor.history.redo();
+ break;
+ case "clearHistory":
+ editor.history.clear();
+ break;
+ case "dateEdited":
+ document.getElementById('infodate').innerText = value;
+ break;
+ case "saving":
+ document.getElementById('infosaved').innerText = value;
+ break;
+ case "text":
+ editor.setText(value, 'api')
+ setTimeout(() => {
+ if (message.focus === "editor") {
+ //editor.focus();
+ } else {
+ //document.getElementById('titleInput').focus();
+ }
+ }, 0)
+ break;
+ case "clearEditor":
+ editor.setText('', 'api');
+ break;
+ case "clearTitle":
+ document.getElementById('titleInput').value = '';
+ break;
+ case "focusEditor":
+ editor.focus();
+ break;
+ case "focusTitle":
+ document.getElementById('titleInput').focus();
+ break;
+ case "nomenu":
+ let isenabled = value;
+ let titleIn = document.getElementById('titlebar');
+ if (isenabled) {
+
+ titleIn.style['padding-left'] = 12;
+ titleIn.style['padding-right'] = 60;
+ } else {
+
+ titleIn.style['padding-left'] = 60;
+ titleIn.style['padding-right'] = 60;
+ }
+ break;
+ case "title":
+ document.getElementById('titleInput').value = JSON.parse(data.data).value
+ break;
+ case "theme":
+ pageTheme.colors = value;
+ setTheme();
+ break;
+
+ case "delta":
+
+ const content = value
+ editor.setContents(content, 'api');
+ setTimeout(() => {
+ //editor.setSelection(editor.getText().length - 1, 0);
+ }, 500)
+
+ break;
+ case "html":
+ editor.setContents(
+ editor.clipboard.convert(value, 'api'),
+ 'silent'
+ );
+ setTimeout(() => {
+ //editor.setSelection(editor.getText().length - 1, 0);
+ }, 0);
+ break;
+ default:
+ break;
+ }
+
+ });
+
+ function isWhitespace(ch) {
+ let whiteSpace = false;
+ if (ch === ' ' || ch === '\t' || ch === '\n') {
+ whiteSpace = true;
+ }
+ return whiteSpace;
+ }
+
+
+ editor.on('text-change', function (delta, oldDelta, source) {
+ var regex = /https?:\/\/[^\s]+$/;
+ if (source === "api") return;
+ if (
+ delta.ops.length === 2 &&
+ delta.ops[0].retain &&
+ isWhitespace(delta.ops[1].insert)
+ ) {
+ var endRetain = delta.ops[0].retain;
+ var text = editor.getText().substr(0, endRetain);
+ var match = text.toLowerCase().match(regex);
+
+ if (match !== null) {
+ var url = match[0];
+
+ var ops = [];
+ if (endRetain > url.length) {
+ ops.push({retain: endRetain - url.length});
+ }
+
+ ops = ops.concat([
+ {delete: url.length},
+ {insert: url, attributes: {link: url}},
+ ]);
+
+ editor.updateContents({
+ ops: ops,
+ });
+ }
+ }
+
+
+ let m = {};
+ m.delta = {ops: editor.getContents().ops}
+
+ m.text = editor.getText();
+ document.getElementById("infowords").innerText = m.text.split(' ').length + ' words';
+ m.html = editor.root.innerHTML;
+ m.type = 'content';
+ window.ReactNativeWebView.postMessage(JSON.stringify(m));
+
+ });
+}
\ No newline at end of file
diff --git a/apps/mobile/html/Web.bundle/site/module.js b/apps/mobile/html/Web.bundle/site/module.js
new file mode 100644
index 000000000..3d3f135db
--- /dev/null
+++ b/apps/mobile/html/Web.bundle/site/module.js
@@ -0,0 +1 @@
+!function (t) { var e = {}; function n(r) { if (e[r]) return e[r].exports; var o = e[r] = { i: r, l: !1, exports: {} }; return t[r].call(o.exports, o, o.exports, n), o.l = !0, o.exports } n.m = t, n.c = e, n.d = function (t, e, r) { n.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: r }) }, n.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }) }, n.t = function (t, e) { if (1 & e && (t = n(t)), 8 & e) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var r = Object.create(null); if (n.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) for (var o in t) n.d(r, o, function (e) { return t[e] }.bind(null, o)); return r }, n.n = function (t) { var e = t && t.__esModule ? function () { return t.default } : function () { return t }; return n.d(e, "a", e), e }, n.o = function (t, e) { return Object.prototype.hasOwnProperty.call(t, e) }, n.p = "/dist/", n(n.s = 44) }([function (t, e) { var n = t.exports = "undefined" != typeof window && window.Math == Math ? window : "undefined" != typeof self && self.Math == Math ? self : Function("return this")(); "number" == typeof __g && (__g = n) }, function (t, e, n) { var r = n(32)("wks"), o = n(33), i = n(0).Symbol, u = "function" == typeof i; (t.exports = function (t) { return r[t] || (r[t] = u && i[t] || (u ? i : o)("Symbol." + t)) }).store = r }, function (t, e) { var n = t.exports = { version: "2.6.10" }; "number" == typeof __e && (__e = n) }, function (t, e, n) { var r = n(9); t.exports = function (t) { if (!r(t)) throw TypeError(t + " is not an object!"); return t } }, function (t, e) { t.exports = {} }, function (t, e, n) { var r = n(8), o = n(30); t.exports = n(6) ? function (t, e, n) { return r.f(t, e, o(1, n)) } : function (t, e, n) { return t[e] = n, t } }, function (t, e, n) { t.exports = !n(29)((function () { return 7 != Object.defineProperty({}, "a", { get: function () { return 7 } }).a })) }, function (t, e, n) { var r = n(0), o = n(2), i = n(12), u = n(5), c = n(14), a = function (t, e, n) { var s, f, l, h = t & a.F, p = t & a.G, v = t & a.S, d = t & a.P, y = t & a.B, m = t & a.W, g = p ? o : o[e] || (o[e] = {}), x = g.prototype, _ = p ? r : v ? r[e] : (r[e] || {}).prototype; for (s in p && (n = e), n) (f = !h && _ && void 0 !== _[s]) && c(g, s) || (l = f ? _[s] : n[s], g[s] = p && "function" != typeof _[s] ? n[s] : y && f ? i(l, r) : m && _[s] == l ? function (t) { var e = function (e, n, r) { if (this instanceof t) { switch (arguments.length) { case 0: return new t; case 1: return new t(e); case 2: return new t(e, n) }return new t(e, n, r) } return t.apply(this, arguments) }; return e.prototype = t.prototype, e }(l) : d && "function" == typeof l ? i(Function.call, l) : l, d && ((g.virtual || (g.virtual = {}))[s] = l, t & a.R && x && !x[s] && u(x, s, l))) }; a.F = 1, a.G = 2, a.S = 4, a.P = 8, a.B = 16, a.W = 32, a.U = 64, a.R = 128, t.exports = a }, function (t, e, n) { var r = n(3), o = n(51), i = n(52), u = Object.defineProperty; e.f = n(6) ? Object.defineProperty : function (t, e, n) { if (r(t), e = i(e, !0), r(n), o) try { return u(t, e, n) } catch (t) { } if ("get" in n || "set" in n) throw TypeError("Accessors not supported!"); return "value" in n && (t[e] = n.value), t } }, function (t, e) { t.exports = function (t) { return "object" == typeof t ? null !== t : "function" == typeof t } }, function (t, e, n) { t.exports = n(83) }, function (t, e) { var n = {}.toString; t.exports = function (t) { return n.call(t).slice(8, -1) } }, function (t, e, n) { var r = n(13); t.exports = function (t, e, n) { if (r(t), void 0 === e) return t; switch (n) { case 1: return function (n) { return t.call(e, n) }; case 2: return function (n, r) { return t.call(e, n, r) }; case 3: return function (n, r, o) { return t.call(e, n, r, o) } }return function () { return t.apply(e, arguments) } } }, function (t, e) { t.exports = function (t) { if ("function" != typeof t) throw TypeError(t + " is not a function!"); return t } }, function (t, e) { var n = {}.hasOwnProperty; t.exports = function (t, e) { return n.call(t, e) } }, function (t, e, n) { n(47); for (var r = n(0), o = n(5), i = n(4), u = n(1)("toStringTag"), c = "CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","), a = 0; a < c.length; a++) { var s = c[a], f = r[s], l = f && f.prototype; l && !l[u] && o(l, u, s), i[s] = i.Array } }, function (t, e, n) { var r = n(50), o = n(17); t.exports = function (t) { return r(o(t)) } }, function (t, e) { t.exports = function (t) { if (null == t) throw TypeError("Can't call method on " + t); return t } }, function (t, e) { t.exports = !0 }, function (t, e, n) { var r = n(9), o = n(0).document, i = r(o) && r(o.createElement); t.exports = function (t) { return i ? o.createElement(t) : {} } }, function (t, e) { var n = Math.ceil, r = Math.floor; t.exports = function (t) { return isNaN(t = +t) ? 0 : (t > 0 ? r : n)(t) } }, function (t, e, n) { var r = n(32)("keys"), o = n(33); t.exports = function (t) { return r[t] || (r[t] = o(t)) } }, function (t, e, n) { var r = n(8).f, o = n(14), i = n(1)("toStringTag"); t.exports = function (t, e, n) { t && !o(t = n ? t : t.prototype, i) && r(t, i, { configurable: !0, value: e }) } }, function (t, e, n) { "use strict"; var r = n(63)(!0); n(28)(String, "String", (function (t) { this._t = String(t), this._i = 0 }), (function () { var t, e = this._t, n = this._i; return n >= e.length ? { value: void 0, done: !0 } : (t = r(e, n), this._i += t.length, { value: t, done: !1 }) })) }, function (t, e, n) { var r = n(11), o = n(1)("toStringTag"), i = "Arguments" == r(function () { return arguments }()); t.exports = function (t) { var e, n, u; return void 0 === t ? "Undefined" : null === t ? "Null" : "string" == typeof (n = function (t, e) { try { return t[e] } catch (t) { } }(e = Object(t), o)) ? n : i ? r(e) : "Object" == (u = r(e)) && "function" == typeof e.callee ? "Arguments" : u } }, function (t, e, n) { "use strict"; var r = n(13); function o(t) { var e, n; this.promise = new t((function (t, r) { if (void 0 !== e || void 0 !== n) throw TypeError("Bad Promise constructor"); e = t, n = r })), this.resolve = r(e), this.reject = r(n) } t.exports.f = function (t) { return new o(t) } }, function (t, e, n) { t.exports = { default: n(68), __esModule: !0 } }, function (t, e, n) { "use strict"; e.__esModule = !0; var r, o = n(26), i = (r = o) && r.__esModule ? r : { default: r }; e.default = function (t) { return function () { var e = t.apply(this, arguments); return new i.default((function (t, n) { return function r(o, u) { try { var c = e[o](u), a = c.value } catch (t) { return void n(t) } if (!c.done) return i.default.resolve(a).then((function (t) { r("next", t) }), (function (t) { r("throw", t) })); t(a) }("next") })) } } }, function (t, e, n) { "use strict"; var r = n(18), o = n(7), i = n(53), u = n(5), c = n(4), a = n(54), s = n(22), f = n(61), l = n(1)("iterator"), h = !([].keys && "next" in [].keys()), p = function () { return this }; t.exports = function (t, e, n, v, d, y, m) { a(n, e, v); var g, x, _, w = function (t) { if (!h && t in L) return L[t]; switch (t) { case "keys": case "values": return function () { return new n(this, t) } }return function () { return new n(this, t) } }, b = e + " Iterator", O = "values" == d, j = !1, L = t.prototype, S = L[l] || L["@@iterator"] || d && L[d], P = S || w(d), E = d ? O ? w("entries") : P : void 0, T = "Array" == e && L.entries || S; if (T && (_ = f(T.call(new t))) !== Object.prototype && _.next && (s(_, b, !0), r || "function" == typeof _[l] || u(_, l, p)), O && S && "values" !== S.name && (j = !0, P = function () { return S.call(this) }), r && !m || !h && !j && L[l] || u(L, l, P), c[e] = P, c[b] = p, d) if (g = { values: O ? P : w("values"), keys: y ? P : w("keys"), entries: E }, m) for (x in g) x in L || i(L, x, g[x]); else o(o.P + o.F * (h || j), e, g); return g } }, function (t, e) { t.exports = function (t) { try { return !!t() } catch (t) { return !0 } } }, function (t, e) { t.exports = function (t, e) { return { enumerable: !(1 & t), configurable: !(2 & t), writable: !(4 & t), value: e } } }, function (t, e, n) { var r = n(20), o = Math.min; t.exports = function (t) { return t > 0 ? o(r(t), 9007199254740991) : 0 } }, function (t, e, n) { var r = n(2), o = n(0), i = o["__core-js_shared__"] || (o["__core-js_shared__"] = {}); (t.exports = function (t, e) { return i[t] || (i[t] = void 0 !== e ? e : {}) })("versions", []).push({ version: r.version, mode: n(18) ? "pure" : "global", copyright: "© 2019 Denis Pushkarev (zloirock.ru)" }) }, function (t, e) { var n = 0, r = Math.random(); t.exports = function (t) { return "Symbol(".concat(void 0 === t ? "" : t, ")_", (++n + r).toString(36)) } }, function (t, e) { t.exports = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",") }, function (t, e, n) { var r = n(0).document; t.exports = r && r.documentElement }, function (t, e, n) { var r = n(24), o = n(1)("iterator"), i = n(4); t.exports = n(2).getIteratorMethod = function (t) { if (null != t) return t[o] || t["@@iterator"] || i[r(t)] } }, function (t, e, n) { var r = n(3), o = n(13), i = n(1)("species"); t.exports = function (t, e) { var n, u = r(t).constructor; return void 0 === u || null == (n = r(u)[i]) ? e : o(n) } }, function (t, e, n) { var r, o, i, u = n(12), c = n(75), a = n(35), s = n(19), f = n(0), l = f.process, h = f.setImmediate, p = f.clearImmediate, v = f.MessageChannel, d = f.Dispatch, y = 0, m = {}, g = function () { var t = +this; if (m.hasOwnProperty(t)) { var e = m[t]; delete m[t], e() } }, x = function (t) { g.call(t.data) }; h && p || (h = function (t) { for (var e = [], n = 1; arguments.length > n;)e.push(arguments[n++]); return m[++y] = function () { c("function" == typeof t ? t : Function(t), e) }, r(y), y }, p = function (t) { delete m[t] }, "process" == n(11)(l) ? r = function (t) { l.nextTick(u(g, t, 1)) } : d && d.now ? r = function (t) { d.now(u(g, t, 1)) } : v ? (i = (o = new v).port2, o.port1.onmessage = x, r = u(i.postMessage, i, 1)) : f.addEventListener && "function" == typeof postMessage && !f.importScripts ? (r = function (t) { f.postMessage(t + "", "*") }, f.addEventListener("message", x, !1)) : r = "onreadystatechange" in s("script") ? function (t) { a.appendChild(s("script")).onreadystatechange = function () { a.removeChild(this), g.call(t) } } : function (t) { setTimeout(u(g, t, 1), 0) }), t.exports = { set: h, clear: p } }, function (t, e) { t.exports = function (t) { try { return { e: !1, v: t() } } catch (t) { return { e: !0, v: t } } } }, function (t, e, n) { var r = n(3), o = n(9), i = n(25); t.exports = function (t, e) { if (r(t), o(e) && e.constructor === t) return e; var n = i.f(t); return (0, n.resolve)(e), n.promise } }, function (t, e, n) { "use strict"; e.__esModule = !0; var r = i(n(45)), o = i(n(65)); function i(t) { return t && t.__esModule ? t : { default: t } } e.default = function (t, e) { if (Array.isArray(t)) return t; if ((0, r.default)(Object(t))) return function (t, e) { var n = [], r = !0, i = !1, u = void 0; try { for (var c, a = (0, o.default)(t); !(r = (c = a.next()).done) && (n.push(c.value), !e || n.length !== e); r = !0); } catch (t) { i = !0, u = t } finally { try { !r && a.return && a.return() } finally { if (i) throw u } } return n }(t, e); throw new TypeError("Invalid attempt to destructure non-iterable instance") } }, function (t, e, n) { "use strict"; e.__esModule = !0, e.default = function (t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") } }, function (t, e, n) { "use strict"; e.__esModule = !0; var r, o = n(85), i = (r = o) && r.__esModule ? r : { default: r }; e.default = function () { function t(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), (0, i.default)(t, r.key, r) } } return function (e, n, r) { return n && t(e.prototype, n), r && t(e, r), e } }() }, function (t, e, n) { "use strict"; n.r(e), n.d(e, "imageCompressor", (function () { return m })); var r, o = n(41), i = n.n(o), u = n(26), c = n.n(u), a = n(10), s = n.n(a), f = n(27), l = n.n(f), h = n(42), p = n.n(h), v = n(43), d = n.n(v), y = (r = l()(s.a.mark((function t(e, n, r, o, u, a) { var f, l, h, p, v, d, y; return s.a.wrap((function (t) { for (; ;)switch (t.prev = t.next) { case 0: return o = o || "image/jpeg", u = u || .7, (f = new Image).src = e, t.next = 6, new c.a((function (t) { f.onload = function () { t() } })); case 6: return l = g(f.width, f.height, n, r), h = i()(l, 2), p = h[0], v = h[1], (d = document.createElement("canvas")).width = p, d.height = v, d.getContext("2d").drawImage(f, 0, 0, p, v), y = d.toDataURL(o, u), t.abrupt("return", y); case 15: case "end": return t.stop() } }), t, this) }))), function (t, e, n, o, i, u) { return r.apply(this, arguments) }); var m = function () { function t(e, n) { p()(this, t), this.quill = e, this.range = null, this.options = n, this.debug = null == n.debug || 1 == n.debug, function (t) { t.maxWidth = t.maxWidth || 1e3, t.maxHeight = t.maxHeight || 1e3, t.maxWidth && "number" != typeof t.maxWidth && (t.maxWidth = 1e3), t.maxHeight && "number" != typeof t.maxHeight && (t.maxHeight = 1e3), t.quality && "number" != typeof t.quality && (t.quality = .7), !t.imageType || "string" == typeof t.imageType && t.imageType.startsWith("image/") || (t.imageType = "image/jpeg") }(n), this.quill.getModule("toolbar").addHandler("image", this.selectLocalImage.bind(this)) } return d()(t, [{ key: "selectLocalImage", value: function () { var t = this; this.range = this.quill.getSelection(), this.fileHolder = document.createElement("input"), this.fileHolder.setAttribute("type", "file"), this.fileHolder.setAttribute("accept", "image/*"), this.fileHolder.setAttribute("style", "visibility:hidden"), this.fileHolder.onchange = this.fileChanged.bind(this), document.body.appendChild(this.fileHolder), this.fileHolder.click(), window.requestAnimationFrame((function () { document.body.removeChild(t.fileHolder) })) } }, { key: "fileChanged", value: function () { var t = this, e = this.fileHolder.files[0]; if (e) { var n = new FileReader; n.addEventListener("load", l()(s.a.mark((function e() { var r, o; return s.a.wrap((function (e) { for (; ;)switch (e.prev = e.next) { case 0: return r = n.result, e.next = 3, y(r, t.options.maxWidth, t.options.maxHeight, t.options.imageType, t.options.quality, t.debug); case 3: o = e.sent, t.insertToEditor(o); case 5: case "end": return e.stop() } }), e, t) }))), !1), n.readAsDataURL(e) } } }, { key: "insertToEditor", value: function (t) { var e = this.range; this.logFileSize(t), this.quill.insertEmbed(e.index, "image", "" + t), e.index++, this.quill.setSelection(e, "api") } }, { key: "logFileSize", value: function (t) { (Math.round(3 * (t.length - "data:image/png;base64,".length) / 4) / 1024).toFixed(0); this.debug } }]), t }(); function g(t, e, n, r) { if (t < n && e < r) return [t, e]; if (t > n) { var o = n, i = Math.floor(e / t * o); if (i > r) { var u = r; return [Math.floor(t / e * u), u] } return [o, i] } if (e > r) { var c = r; return [Math.floor(t / e * c), c] } } window.imageCompressor = m, e.default = m }, function (t, e, n) { t.exports = { default: n(46), __esModule: !0 } }, function (t, e, n) { n(15), n(23), t.exports = n(64) }, function (t, e, n) { "use strict"; var r = n(48), o = n(49), i = n(4), u = n(16); t.exports = n(28)(Array, "Array", (function (t, e) { this._t = u(t), this._i = 0, this._k = e }), (function () { var t = this._t, e = this._k, n = this._i++; return !t || n >= t.length ? (this._t = void 0, o(1)) : o(0, "keys" == e ? n : "values" == e ? t[n] : [n, t[n]]) }), "values"), i.Arguments = i.Array, r("keys"), r("values"), r("entries") }, function (t, e) { t.exports = function () { } }, function (t, e) { t.exports = function (t, e) { return { value: e, done: !!t } } }, function (t, e, n) { var r = n(11); t.exports = Object("z").propertyIsEnumerable(0) ? Object : function (t) { return "String" == r(t) ? t.split("") : Object(t) } }, function (t, e, n) { t.exports = !n(6) && !n(29)((function () { return 7 != Object.defineProperty(n(19)("div"), "a", { get: function () { return 7 } }).a })) }, function (t, e, n) { var r = n(9); t.exports = function (t, e) { if (!r(t)) return t; var n, o; if (e && "function" == typeof (n = t.toString) && !r(o = n.call(t))) return o; if ("function" == typeof (n = t.valueOf) && !r(o = n.call(t))) return o; if (!e && "function" == typeof (n = t.toString) && !r(o = n.call(t))) return o; throw TypeError("Can't convert object to primitive value") } }, function (t, e, n) { t.exports = n(5) }, function (t, e, n) { "use strict"; var r = n(55), o = n(30), i = n(22), u = {}; n(5)(u, n(1)("iterator"), (function () { return this })), t.exports = function (t, e, n) { t.prototype = r(u, { next: o(1, n) }), i(t, e + " Iterator") } }, function (t, e, n) { var r = n(3), o = n(56), i = n(34), u = n(21)("IE_PROTO"), c = function () { }, a = function () { var t, e = n(19)("iframe"), r = i.length; for (e.style.display = "none", n(35).appendChild(e), e.src = "javascript:", (t = e.contentWindow.document).open(), t.write("<script>document.F=Object<\/script>"), t.close(), a = t.F; r--;)delete a.prototype[i[r]]; return a() }; t.exports = Object.create || function (t, e) { var n; return null !== t ? (c.prototype = r(t), n = new c, c.prototype = null, n[u] = t) : n = a(), void 0 === e ? n : o(n, e) } }, function (t, e, n) { var r = n(8), o = n(3), i = n(57); t.exports = n(6) ? Object.defineProperties : function (t, e) { o(t); for (var n, u = i(e), c = u.length, a = 0; c > a;)r.f(t, n = u[a++], e[n]); return t } }, function (t, e, n) { var r = n(58), o = n(34); t.exports = Object.keys || function (t) { return r(t, o) } }, function (t, e, n) { var r = n(14), o = n(16), i = n(59)(!1), u = n(21)("IE_PROTO"); t.exports = function (t, e) { var n, c = o(t), a = 0, s = []; for (n in c) n != u && r(c, n) && s.push(n); for (; e.length > a;)r(c, n = e[a++]) && (~i(s, n) || s.push(n)); return s } }, function (t, e, n) { var r = n(16), o = n(31), i = n(60); t.exports = function (t) { return function (e, n, u) { var c, a = r(e), s = o(a.length), f = i(u, s); if (t && n != n) { for (; s > f;)if ((c = a[f++]) != c) return !0 } else for (; s > f; f++)if ((t || f in a) && a[f] === n) return t || f || 0; return !t && -1 } } }, function (t, e, n) { var r = n(20), o = Math.max, i = Math.min; t.exports = function (t, e) { return (t = r(t)) < 0 ? o(t + e, 0) : i(t, e) } }, function (t, e, n) { var r = n(14), o = n(62), i = n(21)("IE_PROTO"), u = Object.prototype; t.exports = Object.getPrototypeOf || function (t) { return t = o(t), r(t, i) ? t[i] : "function" == typeof t.constructor && t instanceof t.constructor ? t.constructor.prototype : t instanceof Object ? u : null } }, function (t, e, n) { var r = n(17); t.exports = function (t) { return Object(r(t)) } }, function (t, e, n) { var r = n(20), o = n(17); t.exports = function (t) { return function (e, n) { var i, u, c = String(o(e)), a = r(n), s = c.length; return a < 0 || a >= s ? t ? "" : void 0 : (i = c.charCodeAt(a)) < 55296 || i > 56319 || a + 1 === s || (u = c.charCodeAt(a + 1)) < 56320 || u > 57343 ? t ? c.charAt(a) : i : t ? c.slice(a, a + 2) : u - 56320 + (i - 55296 << 10) + 65536 } } }, function (t, e, n) { var r = n(24), o = n(1)("iterator"), i = n(4); t.exports = n(2).isIterable = function (t) { var e = Object(t); return void 0 !== e[o] || "@@iterator" in e || i.hasOwnProperty(r(e)) } }, function (t, e, n) { t.exports = { default: n(66), __esModule: !0 } }, function (t, e, n) { n(15), n(23), t.exports = n(67) }, function (t, e, n) { var r = n(3), o = n(36); t.exports = n(2).getIterator = function (t) { var e = o(t); if ("function" != typeof e) throw TypeError(t + " is not iterable!"); return r(e.call(t)) } }, function (t, e, n) { n(69), n(23), n(15), n(70), n(81), n(82), t.exports = n(2).Promise }, function (t, e) { }, function (t, e, n) { "use strict"; var r, o, i, u, c = n(18), a = n(0), s = n(12), f = n(24), l = n(7), h = n(9), p = n(13), v = n(71), d = n(72), y = n(37), m = n(38).set, g = n(76)(), x = n(25), _ = n(39), w = n(77), b = n(40), O = a.TypeError, j = a.process, L = j && j.versions, S = L && L.v8 || "", P = a.Promise, E = "process" == f(j), T = function () { }, M = o = x.f, k = !!function () { try { var t = P.resolve(1), e = (t.constructor = {})[n(1)("species")] = function (t) { t(T, T) }; return (E || "function" == typeof PromiseRejectionEvent) && t.then(T) instanceof e && 0 !== S.indexOf("6.6") && -1 === w.indexOf("Chrome/66") } catch (t) { } }(), A = function (t) { var e; return !(!h(t) || "function" != typeof (e = t.then)) && e }, F = function (t, e) { if (!t._n) { t._n = !0; var n = t._c; g((function () { for (var r = t._v, o = 1 == t._s, i = 0, u = function (e) { var n, i, u, c = o ? e.ok : e.fail, a = e.resolve, s = e.reject, f = e.domain; try { c ? (o || (2 == t._h && H(t), t._h = 1), !0 === c ? n = r : (f && f.enter(), n = c(r), f && (f.exit(), u = !0)), n === e.promise ? s(O("Promise-chain cycle")) : (i = A(n)) ? i.call(n, a, s) : a(n)) : s(r) } catch (t) { f && !u && f.exit(), s(t) } }; n.length > i;)u(n[i++]); t._c = [], t._n = !1, e && !t._h && R(t) })) } }, R = function (t) { m.call(a, (function () { var e, n, r, o = t._v, i = C(t); if (i && (e = _((function () { E ? j.emit("unhandledRejection", o, t) : (n = a.onunhandledrejection) ? n({ promise: t, reason: o }) : (r = a.console) && r.error && r.error("Unhandled promise rejection", o) })), t._h = E || C(t) ? 2 : 1), t._a = void 0, i && e.e) throw e.v })) }, C = function (t) { return 1 !== t._h && 0 === (t._a || t._c).length }, H = function (t) { m.call(a, (function () { var e; E ? j.emit("rejectionHandled", t) : (e = a.onrejectionhandled) && e({ promise: t, reason: t._v }) })) }, I = function (t) { var e = this; e._d || (e._d = !0, (e = e._w || e)._v = t, e._s = 2, e._a || (e._a = e._c.slice()), F(e, !0)) }, N = function (t) { var e, n = this; if (!n._d) { n._d = !0, n = n._w || n; try { if (n === t) throw O("Promise can't be resolved itself"); (e = A(t)) ? g((function () { var r = { _w: n, _d: !1 }; try { e.call(t, s(N, r, 1), s(I, r, 1)) } catch (t) { I.call(r, t) } })) : (n._v = t, n._s = 1, F(n, !1)) } catch (t) { I.call({ _w: n, _d: !1 }, t) } } }; k || (P = function (t) { v(this, P, "Promise", "_h"), p(t), r.call(this); try { t(s(N, this, 1), s(I, this, 1)) } catch (t) { I.call(this, t) } }, (r = function (t) { this._c = [], this._a = void 0, this._s = 0, this._d = !1, this._v = void 0, this._h = 0, this._n = !1 }).prototype = n(78)(P.prototype, { then: function (t, e) { var n = M(y(this, P)); return n.ok = "function" != typeof t || t, n.fail = "function" == typeof e && e, n.domain = E ? j.domain : void 0, this._c.push(n), this._a && this._a.push(n), this._s && F(this, !1), n.promise }, catch: function (t) { return this.then(void 0, t) } }), i = function () { var t = new r; this.promise = t, this.resolve = s(N, t, 1), this.reject = s(I, t, 1) }, x.f = M = function (t) { return t === P || t === u ? new i(t) : o(t) }), l(l.G + l.W + l.F * !k, { Promise: P }), n(22)(P, "Promise"), n(79)("Promise"), u = n(2).Promise, l(l.S + l.F * !k, "Promise", { reject: function (t) { var e = M(this); return (0, e.reject)(t), e.promise } }), l(l.S + l.F * (c || !k), "Promise", { resolve: function (t) { return b(c && this === u ? P : this, t) } }), l(l.S + l.F * !(k && n(80)((function (t) { P.all(t).catch(T) }))), "Promise", { all: function (t) { var e = this, n = M(e), r = n.resolve, o = n.reject, i = _((function () { var n = [], i = 0, u = 1; d(t, !1, (function (t) { var c = i++, a = !1; n.push(void 0), u++, e.resolve(t).then((function (t) { a || (a = !0, n[c] = t, --u || r(n)) }), o) })), --u || r(n) })); return i.e && o(i.v), n.promise }, race: function (t) { var e = this, n = M(e), r = n.reject, o = _((function () { d(t, !1, (function (t) { e.resolve(t).then(n.resolve, r) })) })); return o.e && r(o.v), n.promise } }) }, function (t, e) { t.exports = function (t, e, n, r) { if (!(t instanceof e) || void 0 !== r && r in t) throw TypeError(n + ": incorrect invocation!"); return t } }, function (t, e, n) { var r = n(12), o = n(73), i = n(74), u = n(3), c = n(31), a = n(36), s = {}, f = {}; (e = t.exports = function (t, e, n, l, h) { var p, v, d, y, m = h ? function () { return t } : a(t), g = r(n, l, e ? 2 : 1), x = 0; if ("function" != typeof m) throw TypeError(t + " is not iterable!"); if (i(m)) { for (p = c(t.length); p > x; x++)if ((y = e ? g(u(v = t[x])[0], v[1]) : g(t[x])) === s || y === f) return y } else for (d = m.call(t); !(v = d.next()).done;)if ((y = o(d, g, v.value, e)) === s || y === f) return y }).BREAK = s, e.RETURN = f }, function (t, e, n) { var r = n(3); t.exports = function (t, e, n, o) { try { return o ? e(r(n)[0], n[1]) : e(n) } catch (e) { var i = t.return; throw void 0 !== i && r(i.call(t)), e } } }, function (t, e, n) { var r = n(4), o = n(1)("iterator"), i = Array.prototype; t.exports = function (t) { return void 0 !== t && (r.Array === t || i[o] === t) } }, function (t, e) { t.exports = function (t, e, n) { var r = void 0 === n; switch (e.length) { case 0: return r ? t() : t.call(n); case 1: return r ? t(e[0]) : t.call(n, e[0]); case 2: return r ? t(e[0], e[1]) : t.call(n, e[0], e[1]); case 3: return r ? t(e[0], e[1], e[2]) : t.call(n, e[0], e[1], e[2]); case 4: return r ? t(e[0], e[1], e[2], e[3]) : t.call(n, e[0], e[1], e[2], e[3]) }return t.apply(n, e) } }, function (t, e, n) { var r = n(0), o = n(38).set, i = r.MutationObserver || r.WebKitMutationObserver, u = r.process, c = r.Promise, a = "process" == n(11)(u); t.exports = function () { var t, e, n, s = function () { var r, o; for (a && (r = u.domain) && r.exit(); t;) { o = t.fn, t = t.next; try { o() } catch (r) { throw t ? n() : e = void 0, r } } e = void 0, r && r.enter() }; if (a) n = function () { u.nextTick(s) }; else if (!i || r.navigator && r.navigator.standalone) if (c && c.resolve) { var f = c.resolve(void 0); n = function () { f.then(s) } } else n = function () { o.call(r, s) }; else { var l = !0, h = document.createTextNode(""); new i(s).observe(h, { characterData: !0 }), n = function () { h.data = l = !l } } return function (r) { var o = { fn: r, next: void 0 }; e && (e.next = o), t || (t = o, n()), e = o } } }, function (t, e, n) { var r = n(0).navigator; t.exports = r && r.userAgent || "" }, function (t, e, n) { var r = n(5); t.exports = function (t, e, n) { for (var o in e) n && t[o] ? t[o] = e[o] : r(t, o, e[o]); return t } }, function (t, e, n) { "use strict"; var r = n(0), o = n(2), i = n(8), u = n(6), c = n(1)("species"); t.exports = function (t) { var e = "function" == typeof o[t] ? o[t] : r[t]; u && e && !e[c] && i.f(e, c, { configurable: !0, get: function () { return this } }) } }, function (t, e, n) { var r = n(1)("iterator"), o = !1; try { var i = [7][r](); i.return = function () { o = !0 }, Array.from(i, (function () { throw 2 })) } catch (t) { } t.exports = function (t, e) { if (!e && !o) return !1; var n = !1; try { var i = [7], u = i[r](); u.next = function () { return { done: n = !0 } }, i[r] = function () { return u }, t(i) } catch (t) { } return n } }, function (t, e, n) { "use strict"; var r = n(7), o = n(2), i = n(0), u = n(37), c = n(40); r(r.P + r.R, "Promise", { finally: function (t) { var e = u(this, o.Promise || i.Promise), n = "function" == typeof t; return this.then(n ? function (n) { return c(e, t()).then((function () { return n })) } : t, n ? function (n) { return c(e, t()).then((function () { throw n })) } : t) } }) }, function (t, e, n) { "use strict"; var r = n(7), o = n(25), i = n(39); r(r.S, "Promise", { try: function (t) { var e = o.f(this), n = i(t); return (n.e ? e.reject : e.resolve)(n.v), e.promise } }) }, function (t, e, n) { var r = function () { return this }() || Function("return this")(), o = r.regeneratorRuntime && Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime") >= 0, i = o && r.regeneratorRuntime; if (r.regeneratorRuntime = void 0, t.exports = n(84), o) r.regeneratorRuntime = i; else try { delete r.regeneratorRuntime } catch (t) { r.regeneratorRuntime = void 0 } }, function (t, e) { !function (e) { "use strict"; var n, r = Object.prototype, o = r.hasOwnProperty, i = "function" == typeof Symbol ? Symbol : {}, u = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", a = i.toStringTag || "@@toStringTag", s = "object" == typeof t, f = e.regeneratorRuntime; if (f) s && (t.exports = f); else { (f = e.regeneratorRuntime = s ? t.exports : {}).wrap = _; var l = "suspendedStart", h = "suspendedYield", p = "executing", v = "completed", d = {}, y = {}; y[u] = function () { return this }; var m = Object.getPrototypeOf, g = m && m(m(k([]))); g && g !== r && o.call(g, u) && (y = g); var x = j.prototype = b.prototype = Object.create(y); O.prototype = x.constructor = j, j.constructor = O, j[a] = O.displayName = "GeneratorFunction", f.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === O || "GeneratorFunction" === (e.displayName || e.name)) }, f.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, j) : (t.__proto__ = j, a in t || (t[a] = "GeneratorFunction")), t.prototype = Object.create(x), t }, f.awrap = function (t) { return { __await: t } }, L(S.prototype), S.prototype[c] = function () { return this }, f.AsyncIterator = S, f.async = function (t, e, n, r) { var o = new S(_(t, e, n, r)); return f.isGeneratorFunction(e) ? o : o.next().then((function (t) { return t.done ? t.value : o.next() })) }, L(x), x[a] = "Generator", x[u] = function () { return this }, x.toString = function () { return "[object Generator]" }, f.keys = function (t) { var e = []; for (var n in t) e.push(n); return e.reverse(), function n() { for (; e.length;) { var r = e.pop(); if (r in t) return n.value = r, n.done = !1, n } return n.done = !0, n } }, f.values = k, M.prototype = { constructor: M, reset: function (t) { if (this.prev = 0, this.next = 0, this.sent = this._sent = n, this.done = !1, this.delegate = null, this.method = "next", this.arg = n, this.tryEntries.forEach(T), !t) for (var e in this) "t" === e.charAt(0) && o.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = n) }, stop: function () { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval }, dispatchException: function (t) { if (this.done) throw t; var e = this; function r(r, o) { return c.type = "throw", c.arg = t, e.next = r, o && (e.method = "next", e.arg = n), !!o } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var u = this.tryEntries[i], c = u.completion; if ("root" === u.tryLoc) return r("end"); if (u.tryLoc <= this.prev) { var a = o.call(u, "catchLoc"), s = o.call(u, "finallyLoc"); if (a && s) { if (this.prev < u.catchLoc) return r(u.catchLoc, !0); if (this.prev < u.finallyLoc) return r(u.finallyLoc) } else if (a) { if (this.prev < u.catchLoc) return r(u.catchLoc, !0) } else { if (!s) throw new Error("try statement without catch or finally"); if (this.prev < u.finallyLoc) return r(u.finallyLoc) } } } }, abrupt: function (t, e) { for (var n = this.tryEntries.length - 1; n >= 0; --n) { var r = this.tryEntries[n]; if (r.tryLoc <= this.prev && o.call(r, "finallyLoc") && this.prev < r.finallyLoc) { var i = r; break } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var u = i ? i.completion : {}; return u.type = t, u.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, d) : this.complete(u) }, complete: function (t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), d }, finish: function (t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var n = this.tryEntries[e]; if (n.finallyLoc === t) return this.complete(n.completion, n.afterLoc), T(n), d } }, catch: function (t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var n = this.tryEntries[e]; if (n.tryLoc === t) { var r = n.completion; if ("throw" === r.type) { var o = r.arg; T(n) } return o } } throw new Error("illegal catch attempt") }, delegateYield: function (t, e, r) { return this.delegate = { iterator: k(t), resultName: e, nextLoc: r }, "next" === this.method && (this.arg = n), d } } } function _(t, e, n, r) { var o = e && e.prototype instanceof b ? e : b, i = Object.create(o.prototype), u = new M(r || []); return i._invoke = function (t, e, n) { var r = l; return function (o, i) { if (r === p) throw new Error("Generator is already running"); if (r === v) { if ("throw" === o) throw i; return A() } for (n.method = o, n.arg = i; ;) { var u = n.delegate; if (u) { var c = P(u, n); if (c) { if (c === d) continue; return c } } if ("next" === n.method) n.sent = n._sent = n.arg; else if ("throw" === n.method) { if (r === l) throw r = v, n.arg; n.dispatchException(n.arg) } else "return" === n.method && n.abrupt("return", n.arg); r = p; var a = w(t, e, n); if ("normal" === a.type) { if (r = n.done ? v : h, a.arg === d) continue; return { value: a.arg, done: n.done } } "throw" === a.type && (r = v, n.method = "throw", n.arg = a.arg) } } }(t, n, u), i } function w(t, e, n) { try { return { type: "normal", arg: t.call(e, n) } } catch (t) { return { type: "throw", arg: t } } } function b() { } function O() { } function j() { } function L(t) { ["next", "throw", "return"].forEach((function (e) { t[e] = function (t) { return this._invoke(e, t) } })) } function S(t) { var e; this._invoke = function (n, r) { function i() { return new Promise((function (e, i) { !function e(n, r, i, u) { var c = w(t[n], t, r); if ("throw" !== c.type) { var a = c.arg, s = a.value; return s && "object" == typeof s && o.call(s, "__await") ? Promise.resolve(s.__await).then((function (t) { e("next", t, i, u) }), (function (t) { e("throw", t, i, u) })) : Promise.resolve(s).then((function (t) { a.value = t, i(a) }), u) } u(c.arg) }(n, r, e, i) })) } return e = e ? e.then(i, i) : i() } } function P(t, e) { var r = t.iterator[e.method]; if (r === n) { if (e.delegate = null, "throw" === e.method) { if (t.iterator.return && (e.method = "return", e.arg = n, P(t, e), "throw" === e.method)) return d; e.method = "throw", e.arg = new TypeError("The iterator does not provide a 'throw' method") } return d } var o = w(r, t.iterator, e.arg); if ("throw" === o.type) return e.method = "throw", e.arg = o.arg, e.delegate = null, d; var i = o.arg; return i ? i.done ? (e[t.resultName] = i.value, e.next = t.nextLoc, "return" !== e.method && (e.method = "next", e.arg = n), e.delegate = null, d) : i : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, d) } function E(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e) } function T(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e } function M(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(E, this), this.reset(!0) } function k(t) { if (t) { var e = t[u]; if (e) return e.call(t); if ("function" == typeof t.next) return t; if (!isNaN(t.length)) { var r = -1, i = function e() { for (; ++r < t.length;)if (o.call(t, r)) return e.value = t[r], e.done = !1, e; return e.value = n, e.done = !0, e }; return i.next = i } } return { next: A } } function A() { return { value: n, done: !0 } } }(function () { return this }() || Function("return this")()) }, function (t, e, n) { t.exports = { default: n(86), __esModule: !0 } }, function (t, e, n) { n(87); var r = n(2).Object; t.exports = function (t, e, n) { return r.defineProperty(t, e, n) } }, function (t, e, n) { var r = n(7); r(r.S + r.F * !n(6), "Object", { defineProperty: n(8).f }) }]);
diff --git a/apps/mobile/html/Web.bundle/site/plaineditor.html b/apps/mobile/html/Web.bundle/site/plaineditor.html
index f84a7936a..be51e9fc3 100644
--- a/apps/mobile/html/Web.bundle/site/plaineditor.html
+++ b/apps/mobile/html/Web.bundle/site/plaineditor.html
@@ -1,16356 +1,65 @@
<html>
-
<head>
- <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
- <link href="fonts.css" rel="stylesheet">
- <style>
- .app-body {
- margin: 0px;
- }
-
- .floating-toolbar {
- position: fixed;
- bottom: 0;
- width: 100%;
- background-color: white;
- }
-
- #editor {
- border: hidden !important;
-
- }
- </style>
- <style>
- /*!
- * Quill Editor v1.3.6
- * https://quilljs.com/
- * Copyright (c) 2014, Jason Chen
- * Copyright (c) 2013, salesforce.com
- */
- .ql-container {
- box-sizing: border-box;
- font-family: 'Noto Sans', sans-serif;
-
- margin: 0px;
- position: relative;
-
- height: 100% !important;
- }
-
- .ql-container.ql-disabled .ql-tooltip {
- visibility: hidden;
- }
-
- .ql-container.ql-disabled .ql-editor ul[data-checked]>li::before {
- pointer-events: none;
- }
-
- .ql-clipboard {
- left: -100000px;
- height: 1px;
- overflow-y: hidden;
- position: absolute;
- top: 50%;
- }
-
- .ql-clipboard p {
- margin: 0;
- padding: 0;
- }
-
- .ql-editor {
- box-sizing: border-box;
- line-height: 1.42;
- height: 100%;
- outline: none;
- overflow-y: auto;
- padding: 12px 12px;
- tab-size: 4;
- -moz-tab-size: 4;
- text-align: left;
- white-space: pre-wrap;
- word-wrap: break-word;
- }
-
- .ql-editor>* {
- cursor: text;
- }
-
- .ql-editor p,
- .ql-editor ol,
- .ql-editor ul,
- .ql-editor pre,
- .ql-editor blockquote,
- .ql-editor h1,
- .ql-editor h2,
- .ql-editor h3,
- .ql-editor h4,
- .ql-editor h5,
- .ql-editor h6 {
- margin: 0;
- padding: 0;
- counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
- }
-
- .ql-editor ol,
- .ql-editor ul {
- padding-left: 1.5em;
- }
-
- .ql-editor ol>li,
- .ql-editor ul>li {
- list-style-type: none;
- }
-
- .ql-editor ul>li::before {
- content: '\2022';
- }
-
- .ql-editor ul[data-checked='true'],
- .ql-editor ul[data-checked='false'] {
- pointer-events: none;
- }
-
- .ql-editor ul[data-checked='true']>li *,
- .ql-editor ul[data-checked='false']>li * {
- pointer-events: all;
- }
-
- .ql-editor ul[data-checked='true']>li::before {
- content: '\2611';
- }
-
- .ql-editor ul[data-checked='false']>li::before {
- content: '\2610';
- }
-
- .ql-editor li::before {
- display: inline-block;
- white-space: nowrap;
- width: 1.2em;
- }
-
- .ql-editor li:not(.ql-direction-rtl)::before {
- margin-left: -1.5em;
- margin-right: 0.3em;
- text-align: right;
- }
-
- .ql-editor li.ql-direction-rtl::before {
- margin-left: 0.3em;
- margin-right: -1.5em;
- }
-
- .ql-editor ol li:not(.ql-direction-rtl),
- .ql-editor ul li:not(.ql-direction-rtl) {
- padding-left: 0.1em;
- }
-
- .ql-editor ol li.ql-direction-rtl,
- .ql-editor ul li.ql-direction-rtl {
- padding-right: 2.5em;
- }
-
- .ql-editor ol li {
- counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
- counter-increment: list-0;
- }
-
- .ql-editor ol li:before {
- content: counter(list-0, decimal) '. ';
- }
-
- .ql-editor ol li.ql-indent-1 {
- counter-increment: list-1;
- }
-
- .ql-editor ol li.ql-indent-1:before {
- content: counter(list-1, lower-alpha) '. ';
- }
-
- .ql-editor ol li.ql-indent-1 {
- counter-reset: list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
- }
-
- .ql-editor ol li.ql-indent-2 {
- counter-increment: list-2;
- }
-
- .ql-editor ol li.ql-indent-2:before {
- content: counter(list-2, lower-roman) '. ';
- }
-
- .ql-editor ol li.ql-indent-2 {
- counter-reset: list-3 list-4 list-5 list-6 list-7 list-8 list-9;
- }
-
- .ql-editor ol li.ql-indent-3 {
- counter-increment: list-3;
- }
-
- .ql-editor ol li.ql-indent-3:before {
- content: counter(list-3, decimal) '. ';
- }
-
- .ql-editor ol li.ql-indent-3 {
- counter-reset: list-4 list-5 list-6 list-7 list-8 list-9;
- }
-
- .ql-editor ol li.ql-indent-4 {
- counter-increment: list-4;
- }
-
- .ql-editor ol li.ql-indent-4:before {
- content: counter(list-4, lower-alpha) '. ';
- }
-
- .ql-editor ol li.ql-indent-4 {
- counter-reset: list-5 list-6 list-7 list-8 list-9;
- }
-
- .ql-editor ol li.ql-indent-5 {
- counter-increment: list-5;
- }
-
- .ql-editor ol li.ql-indent-5:before {
- content: counter(list-5, lower-roman) '. ';
- }
-
- .ql-editor ol li.ql-indent-5 {
- counter-reset: list-6 list-7 list-8 list-9;
- }
-
- .ql-editor ol li.ql-indent-6 {
- counter-increment: list-6;
- }
-
- .ql-editor ol li.ql-indent-6:before {
- content: counter(list-6, decimal) '. ';
- }
-
- .ql-editor ol li.ql-indent-6 {
- counter-reset: list-7 list-8 list-9;
- }
-
- .ql-editor ol li.ql-indent-7 {
- counter-increment: list-7;
- }
-
- .ql-editor ol li.ql-indent-7:before {
- content: counter(list-7, lower-alpha) '. ';
- }
-
- .ql-editor ol li.ql-indent-7 {
- counter-reset: list-8 list-9;
- }
-
- .ql-editor ol li.ql-indent-8 {
- counter-increment: list-8;
- }
-
- .ql-editor ol li.ql-indent-8:before {
- content: counter(list-8, lower-roman) '. ';
- }
-
- .ql-editor ol li.ql-indent-8 {
- counter-reset: list-9;
- }
-
- .ql-editor ol li.ql-indent-9 {
- counter-increment: list-9;
- }
-
- .ql-editor ol li.ql-indent-9:before {
- content: counter(list-9, decimal) '. ';
- }
-
- .ql-editor .ql-indent-1:not(.ql-direction-rtl) {
- padding-left: 1.5em;
- }
-
- .ql-editor li.ql-indent-1:not(.ql-direction-rtl) {
- padding-left: 2em;
- }
-
- .ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right {
- padding-right: 1.5em;
- }
-
- .ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right {
- padding-right: 2em;
- }
-
- .ql-editor .ql-indent-2:not(.ql-direction-rtl) {
- padding-left: 3em;
- }
-
- .ql-editor li.ql-indent-2:not(.ql-direction-rtl) {
- padding-left: 3.5em;
- }
-
- .ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right {
- padding-right: 3em;
- }
-
- .ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right {
- padding-right: 3.5em;
- }
-
- .ql-editor .ql-indent-3:not(.ql-direction-rtl) {
- padding-left: 4.5em;
- }
-
- .ql-editor li.ql-indent-3:not(.ql-direction-rtl) {
- padding-left: 5em;
- }
-
- .ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right {
- padding-right: 4.5em;
- }
-
- .ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right {
- padding-right: 5em;
- }
+ <meta content="width=device-width, initial-scale=1, user-scalable=no" name="viewport"/>
+ <link href="fonts.css" rel="stylesheet">
+ <link href="styles.css" rel="stylesheet">
+ <style>
+ .ql-toolbar {
+ overflow-x: auto;
+ width: 100vw;
+ white-space: nowrap;
+ position: fixed;
+ height: 0px;
+ bottom: 0px;
+ left: 0px;
+ }
+ </style>
- .ql-editor .ql-indent-4:not(.ql-direction-rtl) {
- padding-left: 6em;
- }
-
- .ql-editor li.ql-indent-4:not(.ql-direction-rtl) {
- padding-left: 6.5em;
- }
-
- .ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right {
- padding-right: 6em;
- }
-
- .ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right {
- padding-right: 6.5em;
- }
-
- .ql-editor .ql-indent-5:not(.ql-direction-rtl) {
- padding-left: 7.5em;
- }
-
- .ql-editor li.ql-indent-5:not(.ql-direction-rtl) {
- padding-left: 8em;
- }
-
- .ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right {
- padding-right: 7.5em;
- }
-
- .ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right {
- padding-right: 8em;
- }
-
- .ql-editor .ql-indent-6:not(.ql-direction-rtl) {
- padding-left: 9em;
- }
-
- .ql-editor li.ql-indent-6:not(.ql-direction-rtl) {
- padding-left: 9.5em;
- }
-
- .ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right {
- padding-right: 9em;
- }
-
- .ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right {
- padding-right: 9.5em;
- }
-
- .ql-editor .ql-indent-7:not(.ql-direction-rtl) {
- padding-left: 10.5em;
- }
-
- .ql-editor li.ql-indent-7:not(.ql-direction-rtl) {
- padding-left: 11em;
- }
-
- .ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right {
- padding-right: 10.5em;
- }
-
- .ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right {
- padding-right: 11em;
- }
-
- .ql-editor .ql-indent-8:not(.ql-direction-rtl) {
- padding-left: 12em;
- }
-
- .ql-editor li.ql-indent-8:not(.ql-direction-rtl) {
- padding-left: 12.5em;
- }
-
- .ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right {
- padding-right: 12em;
- }
-
- .ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right {
- padding-right: 12.5em;
- }
-
- .ql-editor .ql-indent-9:not(.ql-direction-rtl) {
- padding-left: 13.5em;
- }
-
- .ql-editor li.ql-indent-9:not(.ql-direction-rtl) {
- padding-left: 14em;
- }
-
- .ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right {
- padding-right: 13.5em;
- }
-
- .ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right {
- padding-right: 14em;
- }
-
- .ql-editor .ql-video {
- display: block;
- max-width: 100%;
- }
-
- .ql-editor .ql-video.ql-align-center {
- margin: 0 auto;
- }
-
- .ql-editor .ql-video.ql-align-right {
- margin: 0 0 0 auto;
- }
-
- .ql-editor .ql-bg-black {
- background-color: #000;
- }
-
- .ql-editor .ql-bg-red {
- background-color: #e60000;
- }
-
- .ql-editor .ql-bg-orange {
- background-color: #f90;
- }
-
- .ql-editor .ql-bg-yellow {
- background-color: #ff0;
- }
-
- .ql-editor .ql-bg-green {
- background-color: #008a00;
- }
-
- .ql-editor .ql-bg-blue {
- background-color: #06c;
- }
-
- .ql-editor .ql-bg-purple {
- background-color: #93f;
- }
-
- .ql-editor .ql-color-white {
- color: #fff;
- }
-
- .ql-editor .ql-color-red {
- color: #e60000;
- }
-
- .ql-editor .ql-color-orange {
- color: #f90;
- }
-
- .ql-editor .ql-color-yellow {
- color: #ff0;
- }
-
- .ql-editor .ql-color-green {
- color: #008a00;
- }
-
- .ql-editor .ql-color-blue {
- color: #06c;
- }
-
- .ql-editor .ql-color-purple {
- color: #93f;
- }
-
- .ql-editor .ql-font-serif {
- font-family: Georgia, Times New Roman, serif;
- }
-
- .ql-editor .ql-font-monospace {
- font-family: Monaco, Courier New, monospace;
- }
-
- .ql-editor .ql-size-small {
- font-size: 0.75em;
- }
-
- .ql-editor .ql-size-large {
- font-size: 1.5em;
- }
-
- .ql-editor .ql-size-huge {
- font-size: 2.5em;
- }
-
- .ql-editor .ql-direction-rtl {
- direction: rtl;
- text-align: inherit;
- }
-
- .ql-editor .ql-align-center {
- text-align: center;
- }
-
- .ql-editor .ql-align-justify {
- text-align: justify;
- }
-
- .ql-editor .ql-align-right {
- text-align: right;
- }
-
- .ql-editor.ql-blank::before {
-
- content: attr(data-placeholder);
- left: 15px;
- pointer-events: none;
- position: absolute;
- right: 15px;
- }
-
- .ql-snow.ql-toolbar:after,
- .ql-snow .ql-toolbar:after {
- clear: both;
- content: '';
- display: table;
- }
-
- .ql-snow.ql-toolbar button,
- .ql-snow .ql-toolbar button {
- background: none;
- border: none;
- cursor: pointer;
- display: inline-block;
- float: left;
- height: 32px;
- padding: 5px 15px;
- width: 36px;
- }
-
- .ql-snow.ql-toolbar button svg,
- .ql-snow .ql-toolbar button svg {
- float: left;
- height: 100%;
- }
-
- .ql-snow.ql-toolbar button:active:hover,
- .ql-snow .ql-toolbar button:active:hover {
- outline: none;
- }
-
- .ql-snow.ql-toolbar input.ql-image[type='file'],
- .ql-snow .ql-toolbar input.ql-image[type='file'] {
- display: none;
- }
-
- .ql-snow {
- box-sizing: border-box;
- justify-content: center;
- flex-direction: column;
- }
-
- .ql-snow * {
- box-sizing: border-box;
- }
-
- .ql-snow .ql-hidden {
- display: none;
- }
+</head>
- .ql-snow .ql-out-bottom,
- .ql-snow .ql-out-top {
- visibility: hidden;
- }
+<body class="app-body">
+<div id="editor"></div>
+<div id="toolbar"></div>
+</body>
- .ql-snow .ql-tooltip {
- position: absolute;
- border-radius: 5px;
- }
+<script src="constants.js"></script>
+<script src="listeners.js"></script>
+<script src="module.js"></script>
+<script src="quill.js"></script>
- .ql-snow .ql-tooltip a {
- cursor: pointer;
- text-decoration: none;
- }
+<script>
+ let editor;
+
+ function loadAction() {
+
+ const Quill = require('quill');
+ setFonts();
+ Quill.register("modules/imageCompressor", imageCompressor);
+
+ editor = new Quill('#editor', {
+ modules: {
+ toolbar: [
+ [],],
+ imageCompressor: {
+ quality: 0.9,
+ maxWidth: 1024,
+ imageType: 'image/jpeg'
+ },
+ },
+ placeholder: ' ',
+ });
- .ql-snow .ql-tooltip.ql-flip {
- transform: translateY(-10px);
- }
+ let Font = Quill.import('formats/font');
+ Font.whitelist = fontNames;
+ Quill.register(Font, true);
- .ql-snow .ql-formats {
- display: inline-block;
- vertical-align: middle;
+ addLinkMatcher();
+ attachTitleInputListeners();
+ setTheme();
+ attachEditorListeners();
}
- .ql-snow .ql-formats:after {
- clear: both;
- content: '';
- display: table;
- }
-
-
- .ql-snow .ql-empty {
- fill: none;
- }
-
- .ql-snow .ql-even {
- fill-rule: evenodd;
- }
-
- .ql-snow .ql-thin,
- .ql-snow .ql-stroke.ql-thin {
- stroke-width: 1;
- }
-
- .ql-snow .ql-transparent {
- opacity: 0.4;
- }
-
- .ql-snow .ql-direction svg:last-child {
- display: none;
- }
-
- .ql-snow .ql-direction.ql-active svg:last-child {
- display: inline;
- }
-
- .ql-snow .ql-direction.ql-active svg:first-child {
- display: none;
- }
-
- .ql-snow .ql-editor h1 {
- font-size: 2em;
- font-family: 'DM Serif Text', sans-serif;
- font-weight: 400 !important;
- }
-
- .ql-snow .ql-editor h2 {
- font-size: 1.5em;
- font-family: 'DM Serif Text', sans-serif;
- font-weight: 400 !important;
- }
-
- .ql-snow .ql-editor h3 {
- font-size: 1.17em;
- font-family: 'DM Serif Text', sans-serif;
- font-weight: 400 !important;
- }
-
- .ql-snow .ql-editor h4 {
- font-size: 1em;
- font-family: 'DM Serif Text', sans-serif;
- font-weight: 400 !important;
- }
-
- .ql-snow .ql-editor h5 {
- font-size: 0.83em;
- font-family: 'DM Serif Text', sans-serif;
- font-weight: 400 !important;
- }
-
- .ql-snow .ql-editor h6 {
- font-size: 0.67em;
- font-family: 'DM Serif Text', sans-serif;
- font-weight: 400 !important;
- }
-
- .ql-snow .ql-editor a {
- text-decoration: underline;
- }
-
-
- .ql-snow .ql-editor pre {
- white-space: pre-wrap;
- margin-bottom: 5px;
- margin-top: 5px;
- padding: 5px 10px;
- }
-
- .ql-snow .ql-editor code {
- font-size: 85%;
- padding: 2px 4px;
- }
-
- .ql-snow .ql-editor img {
- max-width: 100%;
- }
-
- .ql-snow .ql-picker-label {
- cursor: pointer;
- display: inline-block;
- height: 100%;
- padding-left: 8px;
- padding-right: 2px;
-
- position: relative;
- width: 110%;
- }
-
- .ql-snow .ql-picker-label::before {
- display: inline-block;
- line-height: 22px;
- }
-
- .ql-snow .ql-picker-options .ql-picker-item {
- cursor: pointer;
- display: block;
- padding-bottom: 5px;
- padding-top: 5px;
- }
-
- .ql-snow .ql-picker.ql-expanded .ql-picker-options {
- display: block;
- margin-top: -1px;
- top: 100%;
- z-index: 1;
- }
-
- .ql-snow .ql-color-picker,
- .ql-snow .ql-icon-picker {
- width: 30px;
- }
-
- .ql-snow .ql-color-picker .ql-picker-label,
- .ql-snow .ql-icon-picker .ql-picker-label {
- padding: 2px 4px;
- }
-
- .ql-snow .ql-color-picker .ql-picker-label svg,
- .ql-snow .ql-icon-picker .ql-picker-label svg {
- right: 4px;
- }
-
- .ql-snow .ql-icon-picker .ql-picker-options {
- padding: 4px 0px;
- }
-
- .ql-snow .ql-icon-picker .ql-picker-item {
- height: 30px;
- width: 30px;
- padding: 2px 4px;
- }
-
- .ql-snow .ql-color-picker .ql-picker-options {
- padding: 3px 5px;
- width: 194px;
- }
-
- .ql-snow .ql-color-picker .ql-picker-item {
- border: 1px solid transparent;
- float: left;
- height: 20px;
- margin: 3px;
- padding: 0px;
- width: 20px;
- }
-
- .ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg {
- position: absolute;
- margin-top: -9px;
- right: 0;
- top: 50%;
- width: 20px;
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before,
- .ql-snow .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before,
- .ql-snow .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before,
- .ql-snow .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before,
- .ql-snow .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before,
- .ql-snow .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before {
- content: attr(data-label);
- }
-
- .ql-snow .ql-picker.ql-header {
- width: 98px;
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-label::before,
- .ql-snow .ql-picker.ql-header .ql-picker-item::before {
- content: 'Normal';
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-label[data-value='1']::before,
- .ql-snow .ql-picker.ql-header .ql-picker-item[data-value='1']::before {
- content: 'Heading 1';
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-label[data-value='2']::before,
- .ql-snow .ql-picker.ql-header .ql-picker-item[data-value='2']::before {
- content: 'Heading 2';
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-label[data-value='3']::before,
- .ql-snow .ql-picker.ql-header .ql-picker-item[data-value='3']::before {
- content: 'Heading 3';
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-label[data-value='4']::before,
- .ql-snow .ql-picker.ql-header .ql-picker-item[data-value='4']::before {
- content: 'Heading 4';
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-label[data-value='5']::before,
- .ql-snow .ql-picker.ql-header .ql-picker-item[data-value='5']::before {
- content: 'Heading 5';
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-label[data-value='6']::before,
- .ql-snow .ql-picker.ql-header .ql-picker-item[data-value='6']::before {
- content: 'Heading 6';
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-item[data-value='1']::before {
- font-size: 2em;
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-item[data-value='2']::before {
- font-size: 1.5em;
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-item[data-value='3']::before {
- font-size: 1.17em;
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-item[data-value='4']::before {
- font-size: 1em;
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-item[data-value='5']::before {
- font-size: 0.83em;
- }
-
- .ql-snow .ql-picker.ql-header .ql-picker-item[data-value='6']::before {
- font-size: 0.67em;
- }
-
- .ql-snow .ql-picker.ql-font {
- width: 108px;
- }
-
- .ql-snow .ql-picker.ql-font .ql-picker-label::before,
- .ql-snow .ql-picker.ql-font .ql-picker-item::before {
- content: 'Sans Serif';
- }
-
- .ql-snow .ql-picker.ql-font .ql-picker-label[data-value='serif']::before,
- .ql-snow .ql-picker.ql-font .ql-picker-item[data-value='serif']::before {
- content: 'Serif';
- }
-
- .ql-snow .ql-picker.ql-font .ql-picker-label[data-value='monospace']::before,
- .ql-snow .ql-picker.ql-font .ql-picker-item[data-value='monospace']::before {
- content: 'Monospace';
- }
-
- .ql-snow .ql-picker.ql-font .ql-picker-item[data-value='serif']::before {
- font-family: Georgia, Times New Roman, serif;
- }
-
- .ql-snow .ql-picker.ql-font .ql-picker-item[data-value='monospace']::before {
- font-family: Monaco, Courier New, monospace;
- }
-
- .ql-snow .ql-picker.ql-size {
- width: 98px;
- }
-
- .ql-snow .ql-picker.ql-size .ql-picker-label::before,
- .ql-snow .ql-picker.ql-size .ql-picker-item::before {
- content: 'Normal';
- }
-
- .ql-snow .ql-picker.ql-size .ql-picker-label[data-value='small']::before,
- .ql-snow .ql-picker.ql-size .ql-picker-item[data-value='small']::before {
- content: 'Small';
- }
-
- .ql-snow .ql-picker.ql-size .ql-picker-label[data-value='large']::before,
- .ql-snow .ql-picker.ql-size .ql-picker-item[data-value='large']::before {
- content: 'Large';
- }
-
- .ql-snow .ql-picker.ql-size .ql-picker-label[data-value='huge']::before,
- .ql-snow .ql-picker.ql-size .ql-picker-item[data-value='huge']::before {
- content: 'Huge';
- }
-
- .ql-snow .ql-picker.ql-size .ql-picker-item[data-value='small']::before {
- font-size: 10px;
- }
-
- .ql-snow .ql-picker.ql-size .ql-picker-item[data-value='large']::before {
- font-size: 18px;
- }
-
- .ql-snow .ql-picker.ql-size .ql-picker-item[data-value='huge']::before {
- font-size: 32px;
- }
-
- .ql-toolbar.ql-snow {
- box-sizing: border-box;
- font-family: 'Noto Sans', sans-serif;
- padding: 8px;
- }
-
- .ql-toolbar.ql-snow .ql-formats {
- margin-right: 15px;
- }
-
- .ql-toolbar.ql-snow .ql-picker-label {
- border: 1px solid transparent;
- }
-
- .ql-toolbar.ql-snow+.ql-container.ql-snow {
- border-top: 0px;
- }
-
- .ql-snow .ql-tooltip::before {
- content: 'Visit URL:';
- line-height: 26px;
- margin-right: 8px;
- }
-
- .ql-snow .ql-tooltip a.ql-preview {
- display: inline-block;
- max-width: 200px;
- overflow-x: hidden;
- text-overflow: ellipsis;
- vertical-align: top;
- }
-
- .ql-snow .ql-tooltip a.ql-remove::before {
- content: 'Remove';
- margin-left: 8px;
- }
-
- .ql-snow .ql-tooltip a {
- line-height: 26px;
- }
-
- .ql-snow .ql-tooltip.ql-editing a.ql-preview,
- .ql-snow .ql-tooltip.ql-editing a.ql-remove {
- display: none;
- }
-
- .ql-snow .ql-tooltip.ql-editing input[type='text'] {
- display: inline-block;
- }
-
- .ql-snow .ql-tooltip.ql-editing a.ql-action::after {
- border-right: 0px;
- content: 'Save';
- padding-right: 0px;
- }
-
- .ql-snow .ql-tooltip[data-mode='link']::before {
- content: 'Enter link:';
- }
-
- .ql-snow .ql-tooltip[data-mode='formula']::before {
- content: 'Enter formula:';
- }
-
- .ql-snow .ql-tooltip[data-mode='video']::before {
- content: 'Enter video:';
- }
-
- .ql-toolbar {
- overflow-x: auto;
- width: 100vw;
- white-space: nowrap;
- position: fixed;
- height: 0px;
- bottom: 0px;
- left: 0px;
- }
-
-
- .ql-snow .ql-picker.ql-expanded .ql-picker-label {
- color: #f0f0f0;
- z-index: 2;
- }
-
- .ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-fill {
- fill: #f0f0f0;
- }
-
- .ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-stroke {
- stroke: #f0f0f0;
- }
-
- .ql-snow .ql-color-picker.ql-background .ql-picker-item {
- background-color: white;
- }
-
- .ql-snow .ql-color-picker.ql-color .ql-picker-item {
- background-color: white;
- }
-
- .ql-toolbar.ql-snow .ql-picker-options {
- border: 1px solid transparent;
- box-shadow: rgba(0, 0, 0, 0.2) 0 2px 8px;
- }
-
- .ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label {
- border-color: #f0f0f0;
- }
-
- .ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options {
- border-color: #f0f0f0;
- }
-
- .ql-toolbar.ql-snow .ql-color-picker .ql-picker-item.ql-selected,
- .ql-toolbar.ql-snow .ql-color-picker .ql-picker-item:hover {
- border-color: black;
- }
-
- .ql-snow .ql-tooltip {
- background-color: white;
- box-shadow: 0px 0px 5px #000;
- color: gray;
- padding: 5px 12px;
- white-space: nowrap;
- position: absolute;
- font-size: 12px;
- }
-
- .ql-snow .ql-tooltip a.ql-action::after {
- border-right: 1px solid black;
- content: 'Edit';
- margin-left: 16px;
- padding-right: 8px;
- }
-
- .ql-snow a {
- color: blue;
- }
-
- .ql-container.ql-snow {
- border: 1px solid #f0f0f0;
- }
-
- .ql-toolbar {
- background-color: white;
- border-top: 1px solid white
- }
-
- .ql-editor.ql-blank::before {
- color: black
- }
- </style>
-
-</head>
-
-<body class="app-body">
- <div id="editor"></div>
- <div id="toolbar"></div>
-</body>
-
-<script>
- !function (t) { var e = {}; function n(r) { if (e[r]) return e[r].exports; var o = e[r] = { i: r, l: !1, exports: {} }; return t[r].call(o.exports, o, o.exports, n), o.l = !0, o.exports } n.m = t, n.c = e, n.d = function (t, e, r) { n.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: r }) }, n.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }) }, n.t = function (t, e) { if (1 & e && (t = n(t)), 8 & e) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var r = Object.create(null); if (n.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) for (var o in t) n.d(r, o, function (e) { return t[e] }.bind(null, o)); return r }, n.n = function (t) { var e = t && t.__esModule ? function () { return t.default } : function () { return t }; return n.d(e, "a", e), e }, n.o = function (t, e) { return Object.prototype.hasOwnProperty.call(t, e) }, n.p = "/dist/", n(n.s = 44) }([function (t, e) { var n = t.exports = "undefined" != typeof window && window.Math == Math ? window : "undefined" != typeof self && self.Math == Math ? self : Function("return this")(); "number" == typeof __g && (__g = n) }, function (t, e, n) { var r = n(32)("wks"), o = n(33), i = n(0).Symbol, u = "function" == typeof i; (t.exports = function (t) { return r[t] || (r[t] = u && i[t] || (u ? i : o)("Symbol." + t)) }).store = r }, function (t, e) { var n = t.exports = { version: "2.6.10" }; "number" == typeof __e && (__e = n) }, function (t, e, n) { var r = n(9); t.exports = function (t) { if (!r(t)) throw TypeError(t + " is not an object!"); return t } }, function (t, e) { t.exports = {} }, function (t, e, n) { var r = n(8), o = n(30); t.exports = n(6) ? function (t, e, n) { return r.f(t, e, o(1, n)) } : function (t, e, n) { return t[e] = n, t } }, function (t, e, n) { t.exports = !n(29)((function () { return 7 != Object.defineProperty({}, "a", { get: function () { return 7 } }).a })) }, function (t, e, n) { var r = n(0), o = n(2), i = n(12), u = n(5), c = n(14), a = function (t, e, n) { var s, f, l, h = t & a.F, p = t & a.G, v = t & a.S, d = t & a.P, y = t & a.B, m = t & a.W, g = p ? o : o[e] || (o[e] = {}), x = g.prototype, _ = p ? r : v ? r[e] : (r[e] || {}).prototype; for (s in p && (n = e), n) (f = !h && _ && void 0 !== _[s]) && c(g, s) || (l = f ? _[s] : n[s], g[s] = p && "function" != typeof _[s] ? n[s] : y && f ? i(l, r) : m && _[s] == l ? function (t) { var e = function (e, n, r) { if (this instanceof t) { switch (arguments.length) { case 0: return new t; case 1: return new t(e); case 2: return new t(e, n) }return new t(e, n, r) } return t.apply(this, arguments) }; return e.prototype = t.prototype, e }(l) : d && "function" == typeof l ? i(Function.call, l) : l, d && ((g.virtual || (g.virtual = {}))[s] = l, t & a.R && x && !x[s] && u(x, s, l))) }; a.F = 1, a.G = 2, a.S = 4, a.P = 8, a.B = 16, a.W = 32, a.U = 64, a.R = 128, t.exports = a }, function (t, e, n) { var r = n(3), o = n(51), i = n(52), u = Object.defineProperty; e.f = n(6) ? Object.defineProperty : function (t, e, n) { if (r(t), e = i(e, !0), r(n), o) try { return u(t, e, n) } catch (t) { } if ("get" in n || "set" in n) throw TypeError("Accessors not supported!"); return "value" in n && (t[e] = n.value), t } }, function (t, e) { t.exports = function (t) { return "object" == typeof t ? null !== t : "function" == typeof t } }, function (t, e, n) { t.exports = n(83) }, function (t, e) { var n = {}.toString; t.exports = function (t) { return n.call(t).slice(8, -1) } }, function (t, e, n) { var r = n(13); t.exports = function (t, e, n) { if (r(t), void 0 === e) return t; switch (n) { case 1: return function (n) { return t.call(e, n) }; case 2: return function (n, r) { return t.call(e, n, r) }; case 3: return function (n, r, o) { return t.call(e, n, r, o) } }return function () { return t.apply(e, arguments) } } }, function (t, e) { t.exports = function (t) { if ("function" != typeof t) throw TypeError(t + " is not a function!"); return t } }, function (t, e) { var n = {}.hasOwnProperty; t.exports = function (t, e) { return n.call(t, e) } }, function (t, e, n) { n(47); for (var r = n(0), o = n(5), i = n(4), u = n(1)("toStringTag"), c = "CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","), a = 0; a < c.length; a++) { var s = c[a], f = r[s], l = f && f.prototype; l && !l[u] && o(l, u, s), i[s] = i.Array } }, function (t, e, n) { var r = n(50), o = n(17); t.exports = function (t) { return r(o(t)) } }, function (t, e) { t.exports = function (t) { if (null == t) throw TypeError("Can't call method on " + t); return t } }, function (t, e) { t.exports = !0 }, function (t, e, n) { var r = n(9), o = n(0).document, i = r(o) && r(o.createElement); t.exports = function (t) { return i ? o.createElement(t) : {} } }, function (t, e) { var n = Math.ceil, r = Math.floor; t.exports = function (t) { return isNaN(t = +t) ? 0 : (t > 0 ? r : n)(t) } }, function (t, e, n) { var r = n(32)("keys"), o = n(33); t.exports = function (t) { return r[t] || (r[t] = o(t)) } }, function (t, e, n) { var r = n(8).f, o = n(14), i = n(1)("toStringTag"); t.exports = function (t, e, n) { t && !o(t = n ? t : t.prototype, i) && r(t, i, { configurable: !0, value: e }) } }, function (t, e, n) { "use strict"; var r = n(63)(!0); n(28)(String, "String", (function (t) { this._t = String(t), this._i = 0 }), (function () { var t, e = this._t, n = this._i; return n >= e.length ? { value: void 0, done: !0 } : (t = r(e, n), this._i += t.length, { value: t, done: !1 }) })) }, function (t, e, n) { var r = n(11), o = n(1)("toStringTag"), i = "Arguments" == r(function () { return arguments }()); t.exports = function (t) { var e, n, u; return void 0 === t ? "Undefined" : null === t ? "Null" : "string" == typeof (n = function (t, e) { try { return t[e] } catch (t) { } }(e = Object(t), o)) ? n : i ? r(e) : "Object" == (u = r(e)) && "function" == typeof e.callee ? "Arguments" : u } }, function (t, e, n) { "use strict"; var r = n(13); function o(t) { var e, n; this.promise = new t((function (t, r) { if (void 0 !== e || void 0 !== n) throw TypeError("Bad Promise constructor"); e = t, n = r })), this.resolve = r(e), this.reject = r(n) } t.exports.f = function (t) { return new o(t) } }, function (t, e, n) { t.exports = { default: n(68), __esModule: !0 } }, function (t, e, n) { "use strict"; e.__esModule = !0; var r, o = n(26), i = (r = o) && r.__esModule ? r : { default: r }; e.default = function (t) { return function () { var e = t.apply(this, arguments); return new i.default((function (t, n) { return function r(o, u) { try { var c = e[o](u), a = c.value } catch (t) { return void n(t) } if (!c.done) return i.default.resolve(a).then((function (t) { r("next", t) }), (function (t) { r("throw", t) })); t(a) }("next") })) } } }, function (t, e, n) { "use strict"; var r = n(18), o = n(7), i = n(53), u = n(5), c = n(4), a = n(54), s = n(22), f = n(61), l = n(1)("iterator"), h = !([].keys && "next" in [].keys()), p = function () { return this }; t.exports = function (t, e, n, v, d, y, m) { a(n, e, v); var g, x, _, w = function (t) { if (!h && t in L) return L[t]; switch (t) { case "keys": case "values": return function () { return new n(this, t) } }return function () { return new n(this, t) } }, b = e + " Iterator", O = "values" == d, j = !1, L = t.prototype, S = L[l] || L["@@iterator"] || d && L[d], P = S || w(d), E = d ? O ? w("entries") : P : void 0, T = "Array" == e && L.entries || S; if (T && (_ = f(T.call(new t))) !== Object.prototype && _.next && (s(_, b, !0), r || "function" == typeof _[l] || u(_, l, p)), O && S && "values" !== S.name && (j = !0, P = function () { return S.call(this) }), r && !m || !h && !j && L[l] || u(L, l, P), c[e] = P, c[b] = p, d) if (g = { values: O ? P : w("values"), keys: y ? P : w("keys"), entries: E }, m) for (x in g) x in L || i(L, x, g[x]); else o(o.P + o.F * (h || j), e, g); return g } }, function (t, e) { t.exports = function (t) { try { return !!t() } catch (t) { return !0 } } }, function (t, e) { t.exports = function (t, e) { return { enumerable: !(1 & t), configurable: !(2 & t), writable: !(4 & t), value: e } } }, function (t, e, n) { var r = n(20), o = Math.min; t.exports = function (t) { return t > 0 ? o(r(t), 9007199254740991) : 0 } }, function (t, e, n) { var r = n(2), o = n(0), i = o["__core-js_shared__"] || (o["__core-js_shared__"] = {}); (t.exports = function (t, e) { return i[t] || (i[t] = void 0 !== e ? e : {}) })("versions", []).push({ version: r.version, mode: n(18) ? "pure" : "global", copyright: "© 2019 Denis Pushkarev (zloirock.ru)" }) }, function (t, e) { var n = 0, r = Math.random(); t.exports = function (t) { return "Symbol(".concat(void 0 === t ? "" : t, ")_", (++n + r).toString(36)) } }, function (t, e) { t.exports = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",") }, function (t, e, n) { var r = n(0).document; t.exports = r && r.documentElement }, function (t, e, n) { var r = n(24), o = n(1)("iterator"), i = n(4); t.exports = n(2).getIteratorMethod = function (t) { if (null != t) return t[o] || t["@@iterator"] || i[r(t)] } }, function (t, e, n) { var r = n(3), o = n(13), i = n(1)("species"); t.exports = function (t, e) { var n, u = r(t).constructor; return void 0 === u || null == (n = r(u)[i]) ? e : o(n) } }, function (t, e, n) { var r, o, i, u = n(12), c = n(75), a = n(35), s = n(19), f = n(0), l = f.process, h = f.setImmediate, p = f.clearImmediate, v = f.MessageChannel, d = f.Dispatch, y = 0, m = {}, g = function () { var t = +this; if (m.hasOwnProperty(t)) { var e = m[t]; delete m[t], e() } }, x = function (t) { g.call(t.data) }; h && p || (h = function (t) { for (var e = [], n = 1; arguments.length > n;)e.push(arguments[n++]); return m[++y] = function () { c("function" == typeof t ? t : Function(t), e) }, r(y), y }, p = function (t) { delete m[t] }, "process" == n(11)(l) ? r = function (t) { l.nextTick(u(g, t, 1)) } : d && d.now ? r = function (t) { d.now(u(g, t, 1)) } : v ? (i = (o = new v).port2, o.port1.onmessage = x, r = u(i.postMessage, i, 1)) : f.addEventListener && "function" == typeof postMessage && !f.importScripts ? (r = function (t) { f.postMessage(t + "", "*") }, f.addEventListener("message", x, !1)) : r = "onreadystatechange" in s("script") ? function (t) { a.appendChild(s("script")).onreadystatechange = function () { a.removeChild(this), g.call(t) } } : function (t) { setTimeout(u(g, t, 1), 0) }), t.exports = { set: h, clear: p } }, function (t, e) { t.exports = function (t) { try { return { e: !1, v: t() } } catch (t) { return { e: !0, v: t } } } }, function (t, e, n) { var r = n(3), o = n(9), i = n(25); t.exports = function (t, e) { if (r(t), o(e) && e.constructor === t) return e; var n = i.f(t); return (0, n.resolve)(e), n.promise } }, function (t, e, n) { "use strict"; e.__esModule = !0; var r = i(n(45)), o = i(n(65)); function i(t) { return t && t.__esModule ? t : { default: t } } e.default = function (t, e) { if (Array.isArray(t)) return t; if ((0, r.default)(Object(t))) return function (t, e) { var n = [], r = !0, i = !1, u = void 0; try { for (var c, a = (0, o.default)(t); !(r = (c = a.next()).done) && (n.push(c.value), !e || n.length !== e); r = !0); } catch (t) { i = !0, u = t } finally { try { !r && a.return && a.return() } finally { if (i) throw u } } return n }(t, e); throw new TypeError("Invalid attempt to destructure non-iterable instance") } }, function (t, e, n) { "use strict"; e.__esModule = !0, e.default = function (t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") } }, function (t, e, n) { "use strict"; e.__esModule = !0; var r, o = n(85), i = (r = o) && r.__esModule ? r : { default: r }; e.default = function () { function t(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), (0, i.default)(t, r.key, r) } } return function (e, n, r) { return n && t(e.prototype, n), r && t(e, r), e } }() }, function (t, e, n) { "use strict"; n.r(e), n.d(e, "imageCompressor", (function () { return m })); var r, o = n(41), i = n.n(o), u = n(26), c = n.n(u), a = n(10), s = n.n(a), f = n(27), l = n.n(f), h = n(42), p = n.n(h), v = n(43), d = n.n(v), y = (r = l()(s.a.mark((function t(e, n, r, o, u, a) { var f, l, h, p, v, d, y; return s.a.wrap((function (t) { for (; ;)switch (t.prev = t.next) { case 0: return o = o || "image/jpeg", u = u || .7, (f = new Image).src = e, t.next = 6, new c.a((function (t) { f.onload = function () { t() } })); case 6: return l = g(f.width, f.height, n, r), h = i()(l, 2), p = h[0], v = h[1], (d = document.createElement("canvas")).width = p, d.height = v, d.getContext("2d").drawImage(f, 0, 0, p, v), y = d.toDataURL(o, u), t.abrupt("return", y); case 15: case "end": return t.stop() } }), t, this) }))), function (t, e, n, o, i, u) { return r.apply(this, arguments) }); var m = function () { function t(e, n) { p()(this, t), this.quill = e, this.range = null, this.options = n, this.debug = null == n.debug || 1 == n.debug, function (t) { t.maxWidth = t.maxWidth || 1e3, t.maxHeight = t.maxHeight || 1e3, t.maxWidth && "number" != typeof t.maxWidth && (t.maxWidth = 1e3), t.maxHeight && "number" != typeof t.maxHeight && (t.maxHeight = 1e3), t.quality && "number" != typeof t.quality && (t.quality = .7), !t.imageType || "string" == typeof t.imageType && t.imageType.startsWith("image/") || (t.imageType = "image/jpeg") }(n), this.quill.getModule("toolbar").addHandler("image", this.selectLocalImage.bind(this)) } return d()(t, [{ key: "selectLocalImage", value: function () { var t = this; this.range = this.quill.getSelection(), this.fileHolder = document.createElement("input"), this.fileHolder.setAttribute("type", "file"), this.fileHolder.setAttribute("accept", "image/*"), this.fileHolder.setAttribute("style", "visibility:hidden"), this.fileHolder.onchange = this.fileChanged.bind(this), document.body.appendChild(this.fileHolder), this.fileHolder.click(), window.requestAnimationFrame((function () { document.body.removeChild(t.fileHolder) })) } }, { key: "fileChanged", value: function () { var t = this, e = this.fileHolder.files[0]; if (e) { var n = new FileReader; n.addEventListener("load", l()(s.a.mark((function e() { var r, o; return s.a.wrap((function (e) { for (; ;)switch (e.prev = e.next) { case 0: return r = n.result, e.next = 3, y(r, t.options.maxWidth, t.options.maxHeight, t.options.imageType, t.options.quality, t.debug); case 3: o = e.sent, t.insertToEditor(o); case 5: case "end": return e.stop() } }), e, t) }))), !1), n.readAsDataURL(e) } } }, { key: "insertToEditor", value: function (t) { var e = this.range; this.logFileSize(t), this.quill.insertEmbed(e.index, "image", "" + t), e.index++, this.quill.setSelection(e, "api") } }, { key: "logFileSize", value: function (t) { (Math.round(3 * (t.length - "data:image/png;base64,".length) / 4) / 1024).toFixed(0); this.debug } }]), t }(); function g(t, e, n, r) { if (t < n && e < r) return [t, e]; if (t > n) { var o = n, i = Math.floor(e / t * o); if (i > r) { var u = r; return [Math.floor(t / e * u), u] } return [o, i] } if (e > r) { var c = r; return [Math.floor(t / e * c), c] } } window.imageCompressor = m, e.default = m }, function (t, e, n) { t.exports = { default: n(46), __esModule: !0 } }, function (t, e, n) { n(15), n(23), t.exports = n(64) }, function (t, e, n) { "use strict"; var r = n(48), o = n(49), i = n(4), u = n(16); t.exports = n(28)(Array, "Array", (function (t, e) { this._t = u(t), this._i = 0, this._k = e }), (function () { var t = this._t, e = this._k, n = this._i++; return !t || n >= t.length ? (this._t = void 0, o(1)) : o(0, "keys" == e ? n : "values" == e ? t[n] : [n, t[n]]) }), "values"), i.Arguments = i.Array, r("keys"), r("values"), r("entries") }, function (t, e) { t.exports = function () { } }, function (t, e) { t.exports = function (t, e) { return { value: e, done: !!t } } }, function (t, e, n) { var r = n(11); t.exports = Object("z").propertyIsEnumerable(0) ? Object : function (t) { return "String" == r(t) ? t.split("") : Object(t) } }, function (t, e, n) { t.exports = !n(6) && !n(29)((function () { return 7 != Object.defineProperty(n(19)("div"), "a", { get: function () { return 7 } }).a })) }, function (t, e, n) { var r = n(9); t.exports = function (t, e) { if (!r(t)) return t; var n, o; if (e && "function" == typeof (n = t.toString) && !r(o = n.call(t))) return o; if ("function" == typeof (n = t.valueOf) && !r(o = n.call(t))) return o; if (!e && "function" == typeof (n = t.toString) && !r(o = n.call(t))) return o; throw TypeError("Can't convert object to primitive value") } }, function (t, e, n) { t.exports = n(5) }, function (t, e, n) { "use strict"; var r = n(55), o = n(30), i = n(22), u = {}; n(5)(u, n(1)("iterator"), (function () { return this })), t.exports = function (t, e, n) { t.prototype = r(u, { next: o(1, n) }), i(t, e + " Iterator") } }, function (t, e, n) { var r = n(3), o = n(56), i = n(34), u = n(21)("IE_PROTO"), c = function () { }, a = function () { var t, e = n(19)("iframe"), r = i.length; for (e.style.display = "none", n(35).appendChild(e), e.src = "javascript:", (t = e.contentWindow.document).open(), t.write("<script>document.F=Object<\/script>"), t.close(), a = t.F; r--;)delete a.prototype[i[r]]; return a() }; t.exports = Object.create || function (t, e) { var n; return null !== t ? (c.prototype = r(t), n = new c, c.prototype = null, n[u] = t) : n = a(), void 0 === e ? n : o(n, e) } }, function (t, e, n) { var r = n(8), o = n(3), i = n(57); t.exports = n(6) ? Object.defineProperties : function (t, e) { o(t); for (var n, u = i(e), c = u.length, a = 0; c > a;)r.f(t, n = u[a++], e[n]); return t } }, function (t, e, n) { var r = n(58), o = n(34); t.exports = Object.keys || function (t) { return r(t, o) } }, function (t, e, n) { var r = n(14), o = n(16), i = n(59)(!1), u = n(21)("IE_PROTO"); t.exports = function (t, e) { var n, c = o(t), a = 0, s = []; for (n in c) n != u && r(c, n) && s.push(n); for (; e.length > a;)r(c, n = e[a++]) && (~i(s, n) || s.push(n)); return s } }, function (t, e, n) { var r = n(16), o = n(31), i = n(60); t.exports = function (t) { return function (e, n, u) { var c, a = r(e), s = o(a.length), f = i(u, s); if (t && n != n) { for (; s > f;)if ((c = a[f++]) != c) return !0 } else for (; s > f; f++)if ((t || f in a) && a[f] === n) return t || f || 0; return !t && -1 } } }, function (t, e, n) { var r = n(20), o = Math.max, i = Math.min; t.exports = function (t, e) { return (t = r(t)) < 0 ? o(t + e, 0) : i(t, e) } }, function (t, e, n) { var r = n(14), o = n(62), i = n(21)("IE_PROTO"), u = Object.prototype; t.exports = Object.getPrototypeOf || function (t) { return t = o(t), r(t, i) ? t[i] : "function" == typeof t.constructor && t instanceof t.constructor ? t.constructor.prototype : t instanceof Object ? u : null } }, function (t, e, n) { var r = n(17); t.exports = function (t) { return Object(r(t)) } }, function (t, e, n) { var r = n(20), o = n(17); t.exports = function (t) { return function (e, n) { var i, u, c = String(o(e)), a = r(n), s = c.length; return a < 0 || a >= s ? t ? "" : void 0 : (i = c.charCodeAt(a)) < 55296 || i > 56319 || a + 1 === s || (u = c.charCodeAt(a + 1)) < 56320 || u > 57343 ? t ? c.charAt(a) : i : t ? c.slice(a, a + 2) : u - 56320 + (i - 55296 << 10) + 65536 } } }, function (t, e, n) { var r = n(24), o = n(1)("iterator"), i = n(4); t.exports = n(2).isIterable = function (t) { var e = Object(t); return void 0 !== e[o] || "@@iterator" in e || i.hasOwnProperty(r(e)) } }, function (t, e, n) { t.exports = { default: n(66), __esModule: !0 } }, function (t, e, n) { n(15), n(23), t.exports = n(67) }, function (t, e, n) { var r = n(3), o = n(36); t.exports = n(2).getIterator = function (t) { var e = o(t); if ("function" != typeof e) throw TypeError(t + " is not iterable!"); return r(e.call(t)) } }, function (t, e, n) { n(69), n(23), n(15), n(70), n(81), n(82), t.exports = n(2).Promise }, function (t, e) { }, function (t, e, n) { "use strict"; var r, o, i, u, c = n(18), a = n(0), s = n(12), f = n(24), l = n(7), h = n(9), p = n(13), v = n(71), d = n(72), y = n(37), m = n(38).set, g = n(76)(), x = n(25), _ = n(39), w = n(77), b = n(40), O = a.TypeError, j = a.process, L = j && j.versions, S = L && L.v8 || "", P = a.Promise, E = "process" == f(j), T = function () { }, M = o = x.f, k = !!function () { try { var t = P.resolve(1), e = (t.constructor = {})[n(1)("species")] = function (t) { t(T, T) }; return (E || "function" == typeof PromiseRejectionEvent) && t.then(T) instanceof e && 0 !== S.indexOf("6.6") && -1 === w.indexOf("Chrome/66") } catch (t) { } }(), A = function (t) { var e; return !(!h(t) || "function" != typeof (e = t.then)) && e }, F = function (t, e) { if (!t._n) { t._n = !0; var n = t._c; g((function () { for (var r = t._v, o = 1 == t._s, i = 0, u = function (e) { var n, i, u, c = o ? e.ok : e.fail, a = e.resolve, s = e.reject, f = e.domain; try { c ? (o || (2 == t._h && H(t), t._h = 1), !0 === c ? n = r : (f && f.enter(), n = c(r), f && (f.exit(), u = !0)), n === e.promise ? s(O("Promise-chain cycle")) : (i = A(n)) ? i.call(n, a, s) : a(n)) : s(r) } catch (t) { f && !u && f.exit(), s(t) } }; n.length > i;)u(n[i++]); t._c = [], t._n = !1, e && !t._h && R(t) })) } }, R = function (t) { m.call(a, (function () { var e, n, r, o = t._v, i = C(t); if (i && (e = _((function () { E ? j.emit("unhandledRejection", o, t) : (n = a.onunhandledrejection) ? n({ promise: t, reason: o }) : (r = a.console) && r.error && r.error("Unhandled promise rejection", o) })), t._h = E || C(t) ? 2 : 1), t._a = void 0, i && e.e) throw e.v })) }, C = function (t) { return 1 !== t._h && 0 === (t._a || t._c).length }, H = function (t) { m.call(a, (function () { var e; E ? j.emit("rejectionHandled", t) : (e = a.onrejectionhandled) && e({ promise: t, reason: t._v }) })) }, I = function (t) { var e = this; e._d || (e._d = !0, (e = e._w || e)._v = t, e._s = 2, e._a || (e._a = e._c.slice()), F(e, !0)) }, N = function (t) { var e, n = this; if (!n._d) { n._d = !0, n = n._w || n; try { if (n === t) throw O("Promise can't be resolved itself"); (e = A(t)) ? g((function () { var r = { _w: n, _d: !1 }; try { e.call(t, s(N, r, 1), s(I, r, 1)) } catch (t) { I.call(r, t) } })) : (n._v = t, n._s = 1, F(n, !1)) } catch (t) { I.call({ _w: n, _d: !1 }, t) } } }; k || (P = function (t) { v(this, P, "Promise", "_h"), p(t), r.call(this); try { t(s(N, this, 1), s(I, this, 1)) } catch (t) { I.call(this, t) } }, (r = function (t) { this._c = [], this._a = void 0, this._s = 0, this._d = !1, this._v = void 0, this._h = 0, this._n = !1 }).prototype = n(78)(P.prototype, { then: function (t, e) { var n = M(y(this, P)); return n.ok = "function" != typeof t || t, n.fail = "function" == typeof e && e, n.domain = E ? j.domain : void 0, this._c.push(n), this._a && this._a.push(n), this._s && F(this, !1), n.promise }, catch: function (t) { return this.then(void 0, t) } }), i = function () { var t = new r; this.promise = t, this.resolve = s(N, t, 1), this.reject = s(I, t, 1) }, x.f = M = function (t) { return t === P || t === u ? new i(t) : o(t) }), l(l.G + l.W + l.F * !k, { Promise: P }), n(22)(P, "Promise"), n(79)("Promise"), u = n(2).Promise, l(l.S + l.F * !k, "Promise", { reject: function (t) { var e = M(this); return (0, e.reject)(t), e.promise } }), l(l.S + l.F * (c || !k), "Promise", { resolve: function (t) { return b(c && this === u ? P : this, t) } }), l(l.S + l.F * !(k && n(80)((function (t) { P.all(t).catch(T) }))), "Promise", { all: function (t) { var e = this, n = M(e), r = n.resolve, o = n.reject, i = _((function () { var n = [], i = 0, u = 1; d(t, !1, (function (t) { var c = i++, a = !1; n.push(void 0), u++, e.resolve(t).then((function (t) { a || (a = !0, n[c] = t, --u || r(n)) }), o) })), --u || r(n) })); return i.e && o(i.v), n.promise }, race: function (t) { var e = this, n = M(e), r = n.reject, o = _((function () { d(t, !1, (function (t) { e.resolve(t).then(n.resolve, r) })) })); return o.e && r(o.v), n.promise } }) }, function (t, e) { t.exports = function (t, e, n, r) { if (!(t instanceof e) || void 0 !== r && r in t) throw TypeError(n + ": incorrect invocation!"); return t } }, function (t, e, n) { var r = n(12), o = n(73), i = n(74), u = n(3), c = n(31), a = n(36), s = {}, f = {}; (e = t.exports = function (t, e, n, l, h) { var p, v, d, y, m = h ? function () { return t } : a(t), g = r(n, l, e ? 2 : 1), x = 0; if ("function" != typeof m) throw TypeError(t + " is not iterable!"); if (i(m)) { for (p = c(t.length); p > x; x++)if ((y = e ? g(u(v = t[x])[0], v[1]) : g(t[x])) === s || y === f) return y } else for (d = m.call(t); !(v = d.next()).done;)if ((y = o(d, g, v.value, e)) === s || y === f) return y }).BREAK = s, e.RETURN = f }, function (t, e, n) { var r = n(3); t.exports = function (t, e, n, o) { try { return o ? e(r(n)[0], n[1]) : e(n) } catch (e) { var i = t.return; throw void 0 !== i && r(i.call(t)), e } } }, function (t, e, n) { var r = n(4), o = n(1)("iterator"), i = Array.prototype; t.exports = function (t) { return void 0 !== t && (r.Array === t || i[o] === t) } }, function (t, e) { t.exports = function (t, e, n) { var r = void 0 === n; switch (e.length) { case 0: return r ? t() : t.call(n); case 1: return r ? t(e[0]) : t.call(n, e[0]); case 2: return r ? t(e[0], e[1]) : t.call(n, e[0], e[1]); case 3: return r ? t(e[0], e[1], e[2]) : t.call(n, e[0], e[1], e[2]); case 4: return r ? t(e[0], e[1], e[2], e[3]) : t.call(n, e[0], e[1], e[2], e[3]) }return t.apply(n, e) } }, function (t, e, n) { var r = n(0), o = n(38).set, i = r.MutationObserver || r.WebKitMutationObserver, u = r.process, c = r.Promise, a = "process" == n(11)(u); t.exports = function () { var t, e, n, s = function () { var r, o; for (a && (r = u.domain) && r.exit(); t;) { o = t.fn, t = t.next; try { o() } catch (r) { throw t ? n() : e = void 0, r } } e = void 0, r && r.enter() }; if (a) n = function () { u.nextTick(s) }; else if (!i || r.navigator && r.navigator.standalone) if (c && c.resolve) { var f = c.resolve(void 0); n = function () { f.then(s) } } else n = function () { o.call(r, s) }; else { var l = !0, h = document.createTextNode(""); new i(s).observe(h, { characterData: !0 }), n = function () { h.data = l = !l } } return function (r) { var o = { fn: r, next: void 0 }; e && (e.next = o), t || (t = o, n()), e = o } } }, function (t, e, n) { var r = n(0).navigator; t.exports = r && r.userAgent || "" }, function (t, e, n) { var r = n(5); t.exports = function (t, e, n) { for (var o in e) n && t[o] ? t[o] = e[o] : r(t, o, e[o]); return t } }, function (t, e, n) { "use strict"; var r = n(0), o = n(2), i = n(8), u = n(6), c = n(1)("species"); t.exports = function (t) { var e = "function" == typeof o[t] ? o[t] : r[t]; u && e && !e[c] && i.f(e, c, { configurable: !0, get: function () { return this } }) } }, function (t, e, n) { var r = n(1)("iterator"), o = !1; try { var i = [7][r](); i.return = function () { o = !0 }, Array.from(i, (function () { throw 2 })) } catch (t) { } t.exports = function (t, e) { if (!e && !o) return !1; var n = !1; try { var i = [7], u = i[r](); u.next = function () { return { done: n = !0 } }, i[r] = function () { return u }, t(i) } catch (t) { } return n } }, function (t, e, n) { "use strict"; var r = n(7), o = n(2), i = n(0), u = n(37), c = n(40); r(r.P + r.R, "Promise", { finally: function (t) { var e = u(this, o.Promise || i.Promise), n = "function" == typeof t; return this.then(n ? function (n) { return c(e, t()).then((function () { return n })) } : t, n ? function (n) { return c(e, t()).then((function () { throw n })) } : t) } }) }, function (t, e, n) { "use strict"; var r = n(7), o = n(25), i = n(39); r(r.S, "Promise", { try: function (t) { var e = o.f(this), n = i(t); return (n.e ? e.reject : e.resolve)(n.v), e.promise } }) }, function (t, e, n) { var r = function () { return this }() || Function("return this")(), o = r.regeneratorRuntime && Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime") >= 0, i = o && r.regeneratorRuntime; if (r.regeneratorRuntime = void 0, t.exports = n(84), o) r.regeneratorRuntime = i; else try { delete r.regeneratorRuntime } catch (t) { r.regeneratorRuntime = void 0 } }, function (t, e) { !function (e) { "use strict"; var n, r = Object.prototype, o = r.hasOwnProperty, i = "function" == typeof Symbol ? Symbol : {}, u = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", a = i.toStringTag || "@@toStringTag", s = "object" == typeof t, f = e.regeneratorRuntime; if (f) s && (t.exports = f); else { (f = e.regeneratorRuntime = s ? t.exports : {}).wrap = _; var l = "suspendedStart", h = "suspendedYield", p = "executing", v = "completed", d = {}, y = {}; y[u] = function () { return this }; var m = Object.getPrototypeOf, g = m && m(m(k([]))); g && g !== r && o.call(g, u) && (y = g); var x = j.prototype = b.prototype = Object.create(y); O.prototype = x.constructor = j, j.constructor = O, j[a] = O.displayName = "GeneratorFunction", f.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === O || "GeneratorFunction" === (e.displayName || e.name)) }, f.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, j) : (t.__proto__ = j, a in t || (t[a] = "GeneratorFunction")), t.prototype = Object.create(x), t }, f.awrap = function (t) { return { __await: t } }, L(S.prototype), S.prototype[c] = function () { return this }, f.AsyncIterator = S, f.async = function (t, e, n, r) { var o = new S(_(t, e, n, r)); return f.isGeneratorFunction(e) ? o : o.next().then((function (t) { return t.done ? t.value : o.next() })) }, L(x), x[a] = "Generator", x[u] = function () { return this }, x.toString = function () { return "[object Generator]" }, f.keys = function (t) { var e = []; for (var n in t) e.push(n); return e.reverse(), function n() { for (; e.length;) { var r = e.pop(); if (r in t) return n.value = r, n.done = !1, n } return n.done = !0, n } }, f.values = k, M.prototype = { constructor: M, reset: function (t) { if (this.prev = 0, this.next = 0, this.sent = this._sent = n, this.done = !1, this.delegate = null, this.method = "next", this.arg = n, this.tryEntries.forEach(T), !t) for (var e in this) "t" === e.charAt(0) && o.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = n) }, stop: function () { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval }, dispatchException: function (t) { if (this.done) throw t; var e = this; function r(r, o) { return c.type = "throw", c.arg = t, e.next = r, o && (e.method = "next", e.arg = n), !!o } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var u = this.tryEntries[i], c = u.completion; if ("root" === u.tryLoc) return r("end"); if (u.tryLoc <= this.prev) { var a = o.call(u, "catchLoc"), s = o.call(u, "finallyLoc"); if (a && s) { if (this.prev < u.catchLoc) return r(u.catchLoc, !0); if (this.prev < u.finallyLoc) return r(u.finallyLoc) } else if (a) { if (this.prev < u.catchLoc) return r(u.catchLoc, !0) } else { if (!s) throw new Error("try statement without catch or finally"); if (this.prev < u.finallyLoc) return r(u.finallyLoc) } } } }, abrupt: function (t, e) { for (var n = this.tryEntries.length - 1; n >= 0; --n) { var r = this.tryEntries[n]; if (r.tryLoc <= this.prev && o.call(r, "finallyLoc") && this.prev < r.finallyLoc) { var i = r; break } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var u = i ? i.completion : {}; return u.type = t, u.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, d) : this.complete(u) }, complete: function (t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), d }, finish: function (t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var n = this.tryEntries[e]; if (n.finallyLoc === t) return this.complete(n.completion, n.afterLoc), T(n), d } }, catch: function (t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var n = this.tryEntries[e]; if (n.tryLoc === t) { var r = n.completion; if ("throw" === r.type) { var o = r.arg; T(n) } return o } } throw new Error("illegal catch attempt") }, delegateYield: function (t, e, r) { return this.delegate = { iterator: k(t), resultName: e, nextLoc: r }, "next" === this.method && (this.arg = n), d } } } function _(t, e, n, r) { var o = e && e.prototype instanceof b ? e : b, i = Object.create(o.prototype), u = new M(r || []); return i._invoke = function (t, e, n) { var r = l; return function (o, i) { if (r === p) throw new Error("Generator is already running"); if (r === v) { if ("throw" === o) throw i; return A() } for (n.method = o, n.arg = i; ;) { var u = n.delegate; if (u) { var c = P(u, n); if (c) { if (c === d) continue; return c } } if ("next" === n.method) n.sent = n._sent = n.arg; else if ("throw" === n.method) { if (r === l) throw r = v, n.arg; n.dispatchException(n.arg) } else "return" === n.method && n.abrupt("return", n.arg); r = p; var a = w(t, e, n); if ("normal" === a.type) { if (r = n.done ? v : h, a.arg === d) continue; return { value: a.arg, done: n.done } } "throw" === a.type && (r = v, n.method = "throw", n.arg = a.arg) } } }(t, n, u), i } function w(t, e, n) { try { return { type: "normal", arg: t.call(e, n) } } catch (t) { return { type: "throw", arg: t } } } function b() { } function O() { } function j() { } function L(t) { ["next", "throw", "return"].forEach((function (e) { t[e] = function (t) { return this._invoke(e, t) } })) } function S(t) { var e; this._invoke = function (n, r) { function i() { return new Promise((function (e, i) { !function e(n, r, i, u) { var c = w(t[n], t, r); if ("throw" !== c.type) { var a = c.arg, s = a.value; return s && "object" == typeof s && o.call(s, "__await") ? Promise.resolve(s.__await).then((function (t) { e("next", t, i, u) }), (function (t) { e("throw", t, i, u) })) : Promise.resolve(s).then((function (t) { a.value = t, i(a) }), u) } u(c.arg) }(n, r, e, i) })) } return e = e ? e.then(i, i) : i() } } function P(t, e) { var r = t.iterator[e.method]; if (r === n) { if (e.delegate = null, "throw" === e.method) { if (t.iterator.return && (e.method = "return", e.arg = n, P(t, e), "throw" === e.method)) return d; e.method = "throw", e.arg = new TypeError("The iterator does not provide a 'throw' method") } return d } var o = w(r, t.iterator, e.arg); if ("throw" === o.type) return e.method = "throw", e.arg = o.arg, e.delegate = null, d; var i = o.arg; return i ? i.done ? (e[t.resultName] = i.value, e.next = t.nextLoc, "return" !== e.method && (e.method = "next", e.arg = n), e.delegate = null, d) : i : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, d) } function E(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e) } function T(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e } function M(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(E, this), this.reset(!0) } function k(t) { if (t) { var e = t[u]; if (e) return e.call(t); if ("function" == typeof t.next) return t; if (!isNaN(t.length)) { var r = -1, i = function e() { for (; ++r < t.length;)if (o.call(t, r)) return e.value = t[r], e.done = !1, e; return e.value = n, e.done = !0, e }; return i.next = i } } return { next: A } } function A() { return { value: n, done: !0 } } }(function () { return this }() || Function("return this")()) }, function (t, e, n) { t.exports = { default: n(86), __esModule: !0 } }, function (t, e, n) { n(87); var r = n(2).Object; t.exports = function (t, e, n) { return r.defineProperty(t, e, n) } }, function (t, e, n) { var r = n(7); r(r.S + r.F * !n(6), "Object", { defineProperty: n(8).f }) }]);
-</script>
-
-
-<script inline>(function () { function r(e, n, t) { function o(i, f) { if (!n[i]) { if (!e[i]) { var c = "function" == typeof require && require; if (!f && c) return c(i, !0); if (u) return u(i, !0); var a = new Error("Cannot find module '" + i + "'"); throw a.code = "MODULE_NOT_FOUND", a } var p = n[i] = { exports: {} }; e[i][0].call(p.exports, function (r) { var n = e[i][1][r]; return o(n || r) }, p, p.exports, r, e, n, t) } return n[i].exports } for (var u = "function" == typeof require && require, i = 0; i < t.length; i++)o(t[i]); return o } return r })()({
- 1: [function (require, module, exports) {
- const Quill = require('quill');
-
- const pageTheme = {
- colors: {
- accent: '#0560FF',
- shade: '#0560FF12',
- fg: '#0560FF',
- normal: 'black',
- icon: 'gray',
- errorBg: '#FFD2D2',
- errorText: '#D8000C',
- successBg: '#DFF2BF',
- successText: '#4F8A10',
- warningBg: '#FEEFB3',
- warningText: '#9F6000',
- night: false,
- bg: 'white',
- navbg: '#f6fbfc',
- nav: '#f0f0f0',
- pri: 'black',
- sec: 'white',
- factor: 1
- }
- }
- // specify the fonts you would
- var fonts = ['Noto Sans', 'sans-serif'];
- // generate code friendly names
- function getFontName(font) {
- return font.toLowerCase().replace(/\s/g, '-');
- }
- var fontNames = fonts.map(font => getFontName(font));
- // add fonts to style
- var fontStyles = '';
- fonts.forEach(function (font) {
- var fontName = getFontName(font);
- fontStyles +=
- '.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=' +
- fontName +
- ']::before, .ql-snow .ql-picker.ql-font .ql-picker-item[data-value=' +
- fontName +
- ']::before {' +
- "content: '" +
- font +
- "';" +
- "font-family: '" +
- font +
- "';" +
- '}' +
- '.ql-font-' +
- fontName +
- '{' +
- " font-family: '" +
- font +
- "';" +
- '}';
- });
- var node = document.createElement('style');
- node.innerHTML = fontStyles;
- document.body.appendChild(node);
- Quill.register("modules/imageCompressor", imageCompressor);
-
- const editor = new Quill('#editor', {
- modules: {
- toolbar: [
- [],],
- imageCompressor: {
- quality: 0.9,
- maxWidth: 1024,
- imageType: 'image/jpeg'
- },
- },
- placeholder: ' ',
- });
-
-
- var Font = Quill.import('formats/font');
- Font.whitelist = fontNames;
- Quill.register(Font, true);
-
- editor.clipboard.addMatcher(Node.TEXT_NODE, function (node, delta) {
- var regex = /https?:\/\/[^\s]+/g;
- if (typeof node.data !== 'string') return;
-
- var matches = node.data.toLowerCase().match(regex);
-
- if (matches && matches.length > 0) {
- var ops = [];
- var str = node.data;
- matches.forEach(function (match) {
- var split = str.split(match);
- var beforeLink = split.shift();
- ops.push({ insert: beforeLink });
- ops.push({ insert: match, attributes: { link: match } });
- str = split.join(match);
- });
- ops.push({ insert: str });
- delta.ops = ops;
- }
-
- return delta;
- });
-
- function isWhitespace(ch) {
- var whiteSpace = false;
- if (ch == ' ' || ch == '\t' || ch == '\n') {
- whiteSpace = true;
- }
- return whiteSpace;
- }
- var changeInterval = null;
-
-
- const setTheme = function () {
-
-
- let css = document.createElement('style');
- css.type = 'text/css';
-
- let node = `
- .ql-snow.ql-toolbar button:hover,
- .ql-snow .ql-toolbar button:hover,
- .ql-snow.ql-toolbar button:focus,
- .ql-snow .ql-toolbar button:focus,
- .ql-snow.ql-toolbar button.ql-active,
- .ql-snow .ql-toolbar button.ql-active,
- .ql-snow.ql-toolbar .ql-picker-label:hover,
- .ql-snow .ql-toolbar .ql-picker-label:hover,
- .ql-snow.ql-toolbar .ql-picker-label.ql-active,
- .ql-snow .ql-toolbar .ql-picker-label.ql-active,
- .ql-snow.ql-toolbar .ql-picker-item:hover,
- .ql-snow .ql-toolbar .ql-picker-item:hover,
- .ql-snow.ql-toolbar .ql-picker-item.ql-selected,
- .ql-snow .ql-toolbar .ql-picker-item.ql-selected {
- color: ${pageTheme.colors.accent};
- }
- .ql-snow.ql-toolbar button:hover .ql-fill,
- .ql-snow .ql-toolbar button:hover .ql-fill,
- .ql-snow.ql-toolbar button:focus .ql-fill,
- .ql-snow .ql-toolbar button:focus .ql-fill,
- .ql-snow.ql-toolbar button.ql-active .ql-fill,
- .ql-snow .ql-toolbar button.ql-active .ql-fill,
- .ql-snow.ql-toolbar .ql-picker-label:hover .ql-fill,
- .ql-snow .ql-toolbar .ql-picker-label:hover .ql-fill,
- .ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-fill,
- .ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-fill,
- .ql-snow.ql-toolbar .ql-picker-item:hover .ql-fill,
- .ql-snow .ql-toolbar .ql-picker-item:hover .ql-fill,
- .ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-fill,
- .ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-fill,
- .ql-snow.ql-toolbar button:hover .ql-stroke.ql-fill,
- .ql-snow .ql-toolbar button:hover .ql-stroke.ql-fill,
- .ql-snow.ql-toolbar button:focus .ql-stroke.ql-fill,
- .ql-snow .ql-toolbar button:focus .ql-stroke.ql-fill,
- .ql-snow.ql-toolbar button.ql-active .ql-stroke.ql-fill,
- .ql-snow .ql-toolbar button.ql-active .ql-stroke.ql-fill,
- .ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,
- .ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,
- .ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,
- .ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,
- .ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,
- .ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,
- .ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill,
- .ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill {
- fill: ${pageTheme.colors.accent};
- }
- .ql-snow.ql-toolbar button:hover .ql-stroke,
- .ql-snow .ql-toolbar button:hover .ql-stroke,
- .ql-snow.ql-toolbar button:focus .ql-stroke,
- .ql-snow .ql-toolbar button:focus .ql-stroke,
- .ql-snow.ql-toolbar button.ql-active .ql-stroke,
- .ql-snow .ql-toolbar button.ql-active .ql-stroke,
- .ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke,
- .ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke,
- .ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke,
- .ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke,
- .ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke,
- .ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke,
- .ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke,
- .ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke,
- .ql-snow.ql-toolbar button:hover .ql-stroke-miter,
- .ql-snow .ql-toolbar button:hover .ql-stroke-miter,
- .ql-snow.ql-toolbar button:focus .ql-stroke-miter,
- .ql-snow .ql-toolbar button:focus .ql-stroke-miter,
- .ql-snow.ql-toolbar button.ql-active .ql-stroke-miter,
- .ql-snow .ql-toolbar button.ql-active .ql-stroke-miter,
- .ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke-miter,
- .ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke-miter,
- .ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,
- .ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,
- .ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke-miter,
- .ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke-miter,
- .ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter,
- .ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter {
- stroke: ${pageTheme.colors.accent};
- }
-
-
- .ql-editor ul[data-checked='true'] > li::before,
- .ql-editor ul[data-checked='false'] > li::before {
- color: #777;
- cursor: pointer;
- pointer-events: all;
- }
-
- @media (pointer: coarse) {
- .ql-snow.ql-toolbar button:hover:not(.ql-active),
- .ql-snow .ql-toolbar button:hover:not(.ql-active) {
- color: ${pageTheme.colors.icon};
- }
- .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-fill,
- .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-fill,
- .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill,
- .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill {
- fill: ${pageTheme.colors.icon};
- }
- .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke,
- .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke,
- .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter,
- .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter {
- stroke: ${pageTheme.colors.icon};
- }
- }
-
- .ql-snow .ql-stroke {
- fill: none;
- stroke: ${pageTheme.colors.icon};
- stroke-linecap: round;
- stroke-linejoin: round;
- stroke-width: 2;
- }
- .ql-snow .ql-stroke-miter {
- fill: none;
- stroke: ${pageTheme.colors.icon};
- stroke-miterlimit: 10;
- stroke-width: 2;
- }
- .ql-snow .ql-fill,
- .ql-snow .ql-stroke.ql-fill {
- fill: ${pageTheme.colors.icon};
- }
-
- .ql-snow .ql-editor blockquote {
- border-left: 4px solid ${pageTheme.colors.nav};
- margin-bottom: 5px;
- margin-top: 5px;
- padding-left: 16px;
- }
- .ql-snow .ql-editor code,
- .ql-snow .ql-editor pre {
- background-color: ${pageTheme.colors.nav};
- border-radius: 3px;
- color:${pageTheme.colors.icon}
- }
-
- .ql-snow .ql-editor pre.ql-syntax {
- background-color: ${pageTheme.colors.nav};
- color: 'black';
- overflow: visible;
- }
-
- .ql-snow .ql-picker {
- color: ${pageTheme.colors.icon};
- display: inline-block;
- float: left;
- font-size:${(pageTheme.colors.factor * 16)};
- font-weight: 500;
- height: 24px;
- position: relative;
- vertical-align: middle;
- }
-
- .ql-snow .ql-picker-options {
- background-color: ${pageTheme.colors.nav};
- display: none;
- min-width: inherit;
- padding: 4px 8px;
- position: fixed;
- }
-
- .ql-snow .ql-picker.ql-expanded .ql-picker-label {
- color: ${pageTheme.colors.nav};
- z-index: 2;
- }
- .ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-fill {
- fill: ${pageTheme.colors.nav};
- }
- .ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-stroke {
- stroke: ${pageTheme.colors.nav};
- }
-
- .ql-snow .ql-color-picker.ql-background .ql-picker-item {
- background-color: ${pageTheme.colors.bg};
- }
- .ql-snow .ql-color-picker.ql-color .ql-picker-item {
- background-color: ${pageTheme.colors.sec};
- }
-
- .ql-toolbar.ql-snow .ql-picker-options {
- border: 1px solid transparent;
- box-shadow: rgba(0, 0, 0, 0.2) 0 2px 8px;
- }
- .ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label {
- border-color: ${pageTheme.colors.nav};
- }
- .ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options {
- border-color: ${pageTheme.colors.nav};
- }
- .ql-toolbar.ql-snow .ql-color-picker .ql-picker-item.ql-selected,
- .ql-toolbar.ql-snow .ql-color-picker .ql-picker-item:hover {
- border-color: ${pageTheme.colors.pri};
- }
-
- .ql-snow .ql-tooltip {
- background-color: ${pageTheme.colors.bg};
- box-shadow: 0px 0px 5px #000;
- color: ${pageTheme.colors.icon};
- padding: 5px 12px;
- white-space: nowrap;
- position: absolute;
- font-size:${(pageTheme.colors.factor * 12)};
- }
-
- .ql-snow .ql-tooltip a.ql-action::after {
- border-right: 1px solid ${pageTheme.colors.nav};
- content: 'Edit';
- margin-left: 16px;
- padding-right: 8px;
- }
- .ql-snow a {
- color: ${pageTheme.colors.accent};
- }
- .ql-container.ql-snow {
- border: 1px solid ${pageTheme.colors.nav};
- background-color:transparent;
- }
- .ql-snow.ql-toolbar button,
- .ql-snow .ql-toolbar button {
-
- height: ${(pageTheme.colors.factor * 32)};
- width: ${(pageTheme.colors.factor * 36)};
- }
-
-
- .ql-toolbar {
- background-color:transparent;
- border-top: 1px solid ${pageTheme.colors.nav};
- overflow-x: auto;
- width: 100vw;
- white-space: nowrap;
- position: absolute;
- zIndex:999;
- bottom: 0px;
- height: 0px;
- bottom: 1000px;
- left: 0px;
- border-top: 1px solid ${pageTheme.colors.nav};
- }
-
- .ql-editor.ql-blank::before {
- color: ${pageTheme.colors.icon}
- }
-
- #titleInput {
- color:${pageTheme.colors.pri};
- font-size:${28 * pageTheme.colors.factor};
-
- }
- #titleInput::-webkit-input-placeholder {
- color:${pageTheme.colors.icon}
- }
-
- .ql-picker-options {
- background-color: ${pageTheme.colors.nav};
- border-color:${pageTheme.colors.nav};
- }
- .ql-container {
- font-size:${(pageTheme.colors.factor * 18)};
- color:${pageTheme.colors.pri};
- }
-
- `
- css.appendChild(document.createTextNode(node));
- document.getElementsByTagName("head")[0].appendChild(css);
- }
-
- setTheme();
-
-
-
-
- // Receber mensagens do RN
- window.addEventListener('message', data => {
-
- /*
- the data object
- params:action,type,data;
- first we parse the data object;
- */
- let message = JSON.parse(data.data);
- let type = message.type;
-
- let value;
- if (message.value && message.type !== 'nomenu') {
- value = message.value;
- } else {
- value = message.value
- }
- switch (type) {
-
- case "blur":
- editor.blur();
- break;
- case "text":
- editor.setText(value, 'api')
- setTimeout(() => {
- if (message.focus === "editor") {
- editor.focus();
- } else {
-
- }
- }, 0)
- break;
- case "clearEditor":
- editor.setText('', 'api');
- break;
- case "focusEditor":
- editor.focus();
- break;
- case "theme":
- pageTheme.colors = value;
- setTheme();
- break;
-
- case "delta":
- const content = value
- editor.setContents(content, 'api');
- setTimeout(() => {
- editor.setSelection(editor.getText().length - 1, 0);
- }, 500)
-
- break;
- case "html":
- editor.setContents(
- editor.clipboard.convert(value, 'api'),
- 'silent'
- );
- setTimeout(() => {
- editor.setSelection(editor.getText().length - 1, 0);
- }, 0);
- break;
- default:
- break;
- }
-
- });
-
- // Toda vez que é editado, manda os conteúdos para o RN
- editor.on('text-change', function (delta, oldDelta, source) {
- var regex = /https?:\/\/[^\s]+$/;
- if (
- delta.ops.length === 2 &&
- delta.ops[0].retain &&
- isWhitespace(delta.ops[1].insert)
- ) {
- var endRetain = delta.ops[0].retain;
- var text = editor.getText().substr(0, endRetain);
- var match = text.toLowerCase().match(regex);
-
- if (match !== null) {
- var url = match[0];
-
- var ops = [];
- if (endRetain > url.length) {
- ops.push({ retain: endRetain - url.length });
- }
-
- ops = ops.concat([
- { delete: url.length },
- { insert: url, attributes: { link: url } },
- ]);
-
- editor.updateContents({
- ops: ops,
- });
- }
- }
-
-
- let m = {};
- m.delta = { ops: editor.getContents().ops }
-
- m.text = editor.getText();
-
- m.type = 'content';
-
- window.ReactNativeWebView.postMessage(JSON.stringify(m));
- });
-
-
-
-
-
- }, { "quill": 2 }], 2: [function (require, module, exports) {
- (function (Buffer) {
- /*!
- * Quill Editor v1.3.7
- * https://quilljs.com/
- * Copyright (c) 2014, Jason Chen
- * Copyright (c) 2013, salesforce.com
- */
- (function webpackUniversalModuleDefinition(root, factory) {
- if (typeof exports === 'object' && typeof module === 'object')
- module.exports = factory();
- else if (typeof define === 'function' && define.amd)
- define([], factory);
- else if (typeof exports === 'object')
- exports["Quill"] = factory();
- else
- root["Quill"] = factory();
- })(typeof self !== 'undefined' ? self : this, function () {
- return /******/ (function (modules) { // webpackBootstrap
-/******/ // The module cache
-/******/ var installedModules = {};
-/******/
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-/******/
-/******/ // Check if module is in cache
-/******/ if (installedModules[moduleId]) {
-/******/ return installedModules[moduleId].exports;
- /******/
- }
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = installedModules[moduleId] = {
-/******/ i: moduleId,
-/******/ l: false,
-/******/ exports: {}
- /******/
- };
-/******/
-/******/ // Execute the module function
-/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
-/******/
-/******/ // Flag the module as loaded
-/******/ module.l = true;
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
- /******/
- }
-/******/
-/******/
-/******/ // expose the modules object (__webpack_modules__)
-/******/ __webpack_require__.m = modules;
-/******/
-/******/ // expose the module cache
-/******/ __webpack_require__.c = installedModules;
-/******/
-/******/ // define getter function for harmony exports
-/******/ __webpack_require__.d = function (exports, name, getter) {
-/******/ if (!__webpack_require__.o(exports, name)) {
-/******/ Object.defineProperty(exports, name, {
-/******/ configurable: false,
-/******/ enumerable: true,
-/******/ get: getter
- /******/
- });
- /******/
- }
- /******/
- };
-/******/
-/******/ // getDefaultExport function for compatibility with non-harmony modules
-/******/ __webpack_require__.n = function (module) {
-/******/ var getter = module && module.__esModule ?
-/******/ function getDefault() { return module['default']; } :
-/******/ function getModuleExports() { return module; };
-/******/ __webpack_require__.d(getter, 'a', getter);
-/******/ return getter;
- /******/
- };
-/******/
-/******/ // Object.prototype.hasOwnProperty.call
-/******/ __webpack_require__.o = function (object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
-/******/
-/******/ // __webpack_public_path__
-/******/ __webpack_require__.p = "";
-/******/
-/******/ // Load entry module and return exports
-/******/ return __webpack_require__(__webpack_require__.s = 133);
- /******/
- })
-/************************************************************************/
-/******/([
-/* 0 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- Object.defineProperty(exports, "__esModule", { value: true });
- var container_1 = __webpack_require__(17);
- var format_1 = __webpack_require__(18);
- var leaf_1 = __webpack_require__(19);
- var scroll_1 = __webpack_require__(51);
- var inline_1 = __webpack_require__(52);
- var block_1 = __webpack_require__(53);
- var embed_1 = __webpack_require__(54);
- var text_1 = __webpack_require__(55);
- var attributor_1 = __webpack_require__(12);
- var class_1 = __webpack_require__(34);
- var style_1 = __webpack_require__(35);
- var store_1 = __webpack_require__(33);
- var Registry = __webpack_require__(2);
- var Parchment = {
- Scope: Registry.Scope,
- create: Registry.create,
- find: Registry.find,
- query: Registry.query,
- register: Registry.register,
- Container: container_1.default,
- Format: format_1.default,
- Leaf: leaf_1.default,
- Embed: embed_1.default,
- Scroll: scroll_1.default,
- Block: block_1.default,
- Inline: inline_1.default,
- Text: text_1.default,
- Attributor: {
- Attribute: attributor_1.default,
- Class: class_1.default,
- Style: style_1.default,
- Store: store_1.default,
- },
- };
- exports.default = Parchment;
-
-
- /***/
- }),
-/* 1 */
-/***/ (function (module, exports, __webpack_require__) {
-
- var diff = __webpack_require__(57);
- var equal = __webpack_require__(11);
- var extend = __webpack_require__(3);
- var op = __webpack_require__(22);
-
-
- var NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff()
-
-
- var Delta = function (ops) {
- // Assume we are given a well formed ops
- if (Array.isArray(ops)) {
- this.ops = ops;
- } else if (ops != null && Array.isArray(ops.ops)) {
- this.ops = ops.ops;
- } else {
- this.ops = [];
- }
- };
-
-
- Delta.prototype.insert = function (text, attributes) {
- var newOp = {};
- if (text.length === 0) return this;
- newOp.insert = text;
- if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {
- newOp.attributes = attributes;
- }
- return this.push(newOp);
- };
-
- Delta.prototype['delete'] = function (length) {
- if (length <= 0) return this;
- return this.push({ 'delete': length });
- };
-
- Delta.prototype.retain = function (length, attributes) {
- if (length <= 0) return this;
- var newOp = { retain: length };
- if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {
- newOp.attributes = attributes;
- }
- return this.push(newOp);
- };
-
- Delta.prototype.push = function (newOp) {
- var index = this.ops.length;
- var lastOp = this.ops[index - 1];
- newOp = extend(true, {}, newOp);
- if (typeof lastOp === 'object') {
- if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') {
- this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] };
- return this;
- }
- // Since it does not matter if we insert before or after deleting at the same index,
- // always prefer to insert first
- if (typeof lastOp['delete'] === 'number' && newOp.insert != null) {
- index -= 1;
- lastOp = this.ops[index - 1];
- if (typeof lastOp !== 'object') {
- this.ops.unshift(newOp);
- return this;
- }
- }
- if (equal(newOp.attributes, lastOp.attributes)) {
- if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') {
- this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };
- if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes
- return this;
- } else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') {
- this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };
- if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes
- return this;
- }
- }
- }
- if (index === this.ops.length) {
- this.ops.push(newOp);
- } else {
- this.ops.splice(index, 0, newOp);
- }
- return this;
- };
-
- Delta.prototype.chop = function () {
- var lastOp = this.ops[this.ops.length - 1];
- if (lastOp && lastOp.retain && !lastOp.attributes) {
- this.ops.pop();
- }
- return this;
- };
-
- Delta.prototype.filter = function (predicate) {
- return this.ops.filter(predicate);
- };
-
- Delta.prototype.forEach = function (predicate) {
- this.ops.forEach(predicate);
- };
-
- Delta.prototype.map = function (predicate) {
- return this.ops.map(predicate);
- };
-
- Delta.prototype.partition = function (predicate) {
- var passed = [], failed = [];
- this.forEach(function (op) {
- var target = predicate(op) ? passed : failed;
- target.push(op);
- });
- return [passed, failed];
- };
-
- Delta.prototype.reduce = function (predicate, initial) {
- return this.ops.reduce(predicate, initial);
- };
-
- Delta.prototype.changeLength = function () {
- return this.reduce(function (length, elem) {
- if (elem.insert) {
- return length + op.length(elem);
- } else if (elem.delete) {
- return length - elem.delete;
- }
- return length;
- }, 0);
- };
-
- Delta.prototype.length = function () {
- return this.reduce(function (length, elem) {
- return length + op.length(elem);
- }, 0);
- };
-
- Delta.prototype.slice = function (start, end) {
- start = start || 0;
- if (typeof end !== 'number') end = Infinity;
- var ops = [];
- var iter = op.iterator(this.ops);
- var index = 0;
- while (index < end && iter.hasNext()) {
- var nextOp;
- if (index < start) {
- nextOp = iter.next(start - index);
- } else {
- nextOp = iter.next(end - index);
- ops.push(nextOp);
- }
- index += op.length(nextOp);
- }
- return new Delta(ops);
- };
-
-
- Delta.prototype.compose = function (other) {
- var thisIter = op.iterator(this.ops);
- var otherIter = op.iterator(other.ops);
- var ops = [];
- var firstOther = otherIter.peek();
- if (firstOther != null && typeof firstOther.retain === 'number' && firstOther.attributes == null) {
- var firstLeft = firstOther.retain;
- while (thisIter.peekType() === 'insert' && thisIter.peekLength() <= firstLeft) {
- firstLeft -= thisIter.peekLength();
- ops.push(thisIter.next());
- }
- if (firstOther.retain - firstLeft > 0) {
- otherIter.next(firstOther.retain - firstLeft);
- }
- }
- var delta = new Delta(ops);
- while (thisIter.hasNext() || otherIter.hasNext()) {
- if (otherIter.peekType() === 'insert') {
- delta.push(otherIter.next());
- } else if (thisIter.peekType() === 'delete') {
- delta.push(thisIter.next());
- } else {
- var length = Math.min(thisIter.peekLength(), otherIter.peekLength());
- var thisOp = thisIter.next(length);
- var otherOp = otherIter.next(length);
- if (typeof otherOp.retain === 'number') {
- var newOp = {};
- if (typeof thisOp.retain === 'number') {
- newOp.retain = length;
- } else {
- newOp.insert = thisOp.insert;
- }
- // Preserve null when composing with a retain, otherwise remove it for inserts
- var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number');
- if (attributes) newOp.attributes = attributes;
- delta.push(newOp);
-
- // Optimization if rest of other is just retain
- if (!otherIter.hasNext() && equal(delta.ops[delta.ops.length - 1], newOp)) {
- var rest = new Delta(thisIter.rest());
- return delta.concat(rest).chop();
- }
-
- // Other op should be delete, we could be an insert or retain
- // Insert + delete cancels out
- } else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') {
- delta.push(otherOp);
- }
- }
- }
- return delta.chop();
- };
-
- Delta.prototype.concat = function (other) {
- var delta = new Delta(this.ops.slice());
- if (other.ops.length > 0) {
- delta.push(other.ops[0]);
- delta.ops = delta.ops.concat(other.ops.slice(1));
- }
- return delta;
- };
-
- Delta.prototype.diff = function (other, index) {
- if (this.ops === other.ops) {
- return new Delta();
- }
- var strings = [this, other].map(function (delta) {
- return delta.map(function (op) {
- if (op.insert != null) {
- return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER;
- }
- var prep = (delta === other) ? 'on' : 'with';
- throw new Error('diff() called ' + prep + ' non-document');
- }).join('');
- });
- var delta = new Delta();
- var diffResult = diff(strings[0], strings[1], index);
- var thisIter = op.iterator(this.ops);
- var otherIter = op.iterator(other.ops);
- diffResult.forEach(function (component) {
- var length = component[1].length;
- while (length > 0) {
- var opLength = 0;
- switch (component[0]) {
- case diff.INSERT:
- opLength = Math.min(otherIter.peekLength(), length);
- delta.push(otherIter.next(opLength));
- break;
- case diff.DELETE:
- opLength = Math.min(length, thisIter.peekLength());
- thisIter.next(opLength);
- delta['delete'](opLength);
- break;
- case diff.EQUAL:
- opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length);
- var thisOp = thisIter.next(opLength);
- var otherOp = otherIter.next(opLength);
- if (equal(thisOp.insert, otherOp.insert)) {
- delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes));
- } else {
- delta.push(otherOp)['delete'](opLength);
- }
- break;
- }
- length -= opLength;
- }
- });
- return delta.chop();
- };
-
- Delta.prototype.eachLine = function (predicate, newline) {
- newline = newline || '\n';
- var iter = op.iterator(this.ops);
- var line = new Delta();
- var i = 0;
- while (iter.hasNext()) {
- if (iter.peekType() !== 'insert') return;
- var thisOp = iter.peek();
- var start = op.length(thisOp) - iter.peekLength();
- var index = typeof thisOp.insert === 'string' ?
- thisOp.insert.indexOf(newline, start) - start : -1;
- if (index < 0) {
- line.push(iter.next());
- } else if (index > 0) {
- line.push(iter.next(index));
- } else {
- if (predicate(line, iter.next(1).attributes || {}, i) === false) {
- return;
- }
- i += 1;
- line = new Delta();
- }
- }
- if (line.length() > 0) {
- predicate(line, {}, i);
- }
- };
-
- Delta.prototype.transform = function (other, priority) {
- priority = !!priority;
- if (typeof other === 'number') {
- return this.transformPosition(other, priority);
- }
- var thisIter = op.iterator(this.ops);
- var otherIter = op.iterator(other.ops);
- var delta = new Delta();
- while (thisIter.hasNext() || otherIter.hasNext()) {
- if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) {
- delta.retain(op.length(thisIter.next()));
- } else if (otherIter.peekType() === 'insert') {
- delta.push(otherIter.next());
- } else {
- var length = Math.min(thisIter.peekLength(), otherIter.peekLength());
- var thisOp = thisIter.next(length);
- var otherOp = otherIter.next(length);
- if (thisOp['delete']) {
- // Our delete either makes their delete redundant or removes their retain
- continue;
- } else if (otherOp['delete']) {
- delta.push(otherOp);
- } else {
- // We retain either their retain or insert
- delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority));
- }
- }
- }
- return delta.chop();
- };
-
- Delta.prototype.transformPosition = function (index, priority) {
- priority = !!priority;
- var thisIter = op.iterator(this.ops);
- var offset = 0;
- while (thisIter.hasNext() && offset <= index) {
- var length = thisIter.peekLength();
- var nextType = thisIter.peekType();
- thisIter.next();
- if (nextType === 'delete') {
- index -= Math.min(length, index - offset);
- continue;
- } else if (nextType === 'insert' && (offset < index || !priority)) {
- index += length;
- }
- offset += length;
- }
- return index;
- };
-
-
- module.exports = Delta;
-
-
- /***/
- }),
-/* 2 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var ParchmentError = /** @class */ (function (_super) {
- __extends(ParchmentError, _super);
- function ParchmentError(message) {
- var _this = this;
- message = '[Parchment] ' + message;
- _this = _super.call(this, message) || this;
- _this.message = message;
- _this.name = _this.constructor.name;
- return _this;
- }
- return ParchmentError;
- }(Error));
- exports.ParchmentError = ParchmentError;
- var attributes = {};
- var classes = {};
- var tags = {};
- var types = {};
- exports.DATA_KEY = '__blot';
- var Scope;
- (function (Scope) {
- Scope[Scope["TYPE"] = 3] = "TYPE";
- Scope[Scope["LEVEL"] = 12] = "LEVEL";
- Scope[Scope["ATTRIBUTE"] = 13] = "ATTRIBUTE";
- Scope[Scope["BLOT"] = 14] = "BLOT";
- Scope[Scope["INLINE"] = 7] = "INLINE";
- Scope[Scope["BLOCK"] = 11] = "BLOCK";
- Scope[Scope["BLOCK_BLOT"] = 10] = "BLOCK_BLOT";
- Scope[Scope["INLINE_BLOT"] = 6] = "INLINE_BLOT";
- Scope[Scope["BLOCK_ATTRIBUTE"] = 9] = "BLOCK_ATTRIBUTE";
- Scope[Scope["INLINE_ATTRIBUTE"] = 5] = "INLINE_ATTRIBUTE";
- Scope[Scope["ANY"] = 15] = "ANY";
- })(Scope = exports.Scope || (exports.Scope = {}));
- function create(input, value) {
- var match = query(input);
- if (match == null) {
- throw new ParchmentError("Unable to create " + input + " blot");
- }
- var BlotClass = match;
- var node =
- // @ts-ignore
- input instanceof Node || input['nodeType'] === Node.TEXT_NODE ? input : BlotClass.create(value);
- return new BlotClass(node, value);
- }
- exports.create = create;
- function find(node, bubble) {
- if (bubble === void 0) { bubble = false; }
- if (node == null)
- return null;
- // @ts-ignore
- if (node[exports.DATA_KEY] != null)
- return node[exports.DATA_KEY].blot;
- if (bubble)
- return find(node.parentNode, bubble);
- return null;
- }
- exports.find = find;
- function query(query, scope) {
- if (scope === void 0) { scope = Scope.ANY; }
- var match;
- if (typeof query === 'string') {
- match = types[query] || attributes[query];
- // @ts-ignore
- }
- else if (query instanceof Text || query['nodeType'] === Node.TEXT_NODE) {
- match = types['text'];
- }
- else if (typeof query === 'number') {
- if (query & Scope.LEVEL & Scope.BLOCK) {
- match = types['block'];
- }
- else if (query & Scope.LEVEL & Scope.INLINE) {
- match = types['inline'];
- }
- }
- else if (query instanceof HTMLElement) {
- var names = (query.getAttribute('class') || '').split(/\s+/);
- for (var i in names) {
- match = classes[names[i]];
- if (match)
- break;
- }
- match = match || tags[query.tagName];
- }
- if (match == null)
- return null;
- // @ts-ignore
- if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope)
- return match;
- return null;
- }
- exports.query = query;
- function register() {
- var Definitions = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- Definitions[_i] = arguments[_i];
- }
- if (Definitions.length > 1) {
- return Definitions.map(function (d) {
- return register(d);
- });
- }
- var Definition = Definitions[0];
- if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') {
- throw new ParchmentError('Invalid definition');
- }
- else if (Definition.blotName === 'abstract') {
- throw new ParchmentError('Cannot register abstract class');
- }
- types[Definition.blotName || Definition.attrName] = Definition;
- if (typeof Definition.keyName === 'string') {
- attributes[Definition.keyName] = Definition;
- }
- else {
- if (Definition.className != null) {
- classes[Definition.className] = Definition;
- }
- if (Definition.tagName != null) {
- if (Array.isArray(Definition.tagName)) {
- Definition.tagName = Definition.tagName.map(function (tagName) {
- return tagName.toUpperCase();
- });
- }
- else {
- Definition.tagName = Definition.tagName.toUpperCase();
- }
- var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName];
- tagNames.forEach(function (tag) {
- if (tags[tag] == null || Definition.className == null) {
- tags[tag] = Definition;
- }
- });
- }
- }
- return Definition;
- }
- exports.register = register;
-
-
- /***/
- }),
-/* 3 */
-/***/ (function (module, exports) {
-
- 'use strict';
-
- var hasOwn = Object.prototype.hasOwnProperty;
- var toStr = Object.prototype.toString;
- var defineProperty = Object.defineProperty;
- var gOPD = Object.getOwnPropertyDescriptor;
-
- var isArray = function isArray(arr) {
- if (typeof Array.isArray === 'function') {
- return Array.isArray(arr);
- }
-
- return toStr.call(arr) === '[object Array]';
- };
-
- var isPlainObject = function isPlainObject(obj) {
- if (!obj || toStr.call(obj) !== '[object Object]') {
- return false;
- }
-
- var hasOwnConstructor = hasOwn.call(obj, 'constructor');
- var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');
- // Not own constructor property must be Object
- if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
- return false;
- }
-
- // Own properties are enumerated firstly, so to speed up,
- // if last one is own, then all properties are own.
- var key;
- for (key in obj) { /**/ }
-
- return typeof key === 'undefined' || hasOwn.call(obj, key);
- };
-
- // If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target
- var setProperty = function setProperty(target, options) {
- if (defineProperty && options.name === '__proto__') {
- defineProperty(target, options.name, {
- enumerable: true,
- configurable: true,
- value: options.newValue,
- writable: true
- });
- } else {
- target[options.name] = options.newValue;
- }
- };
-
- // Return undefined instead of __proto__ if '__proto__' is not an own property
- var getProperty = function getProperty(obj, name) {
- if (name === '__proto__') {
- if (!hasOwn.call(obj, name)) {
- return void 0;
- } else if (gOPD) {
- // In early versions of node, obj['__proto__'] is buggy when obj has
- // __proto__ as an own property. Object.getOwnPropertyDescriptor() works.
- return gOPD(obj, name).value;
- }
- }
-
- return obj[name];
- };
-
- module.exports = function extend() {
- var options, name, src, copy, copyIsArray, clone;
- var target = arguments[0];
- var i = 1;
- var length = arguments.length;
- var deep = false;
-
- // Handle a deep copy situation
- if (typeof target === 'boolean') {
- deep = target;
- target = arguments[1] || {};
- // skip the boolean and the target
- i = 2;
- }
- if (target == null || (typeof target !== 'object' && typeof target !== 'function')) {
- target = {};
- }
-
- for (; i < length; ++i) {
- options = arguments[i];
- // Only deal with non-null/undefined values
- if (options != null) {
- // Extend the base object
- for (name in options) {
- src = getProperty(target, name);
- copy = getProperty(options, name);
-
- // Prevent never-ending loop
- if (target !== copy) {
- // Recurse if we're merging plain objects or arrays
- if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {
- if (copyIsArray) {
- copyIsArray = false;
- clone = src && isArray(src) ? src : [];
- } else {
- clone = src && isPlainObject(src) ? src : {};
- }
-
- // Never move original objects, clone them
- setProperty(target, { name: name, newValue: extend(deep, clone, copy) });
-
- // Don't bring in undefined values
- } else if (typeof copy !== 'undefined') {
- setProperty(target, { name: name, newValue: copy });
- }
- }
- }
- }
- }
-
- // Return the modified object
- return target;
- };
-
-
- /***/
- }),
-/* 4 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = exports.BlockEmbed = exports.bubbleFormats = undefined;
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _extend = __webpack_require__(3);
-
- var _extend2 = _interopRequireDefault(_extend);
-
- var _quillDelta = __webpack_require__(1);
-
- var _quillDelta2 = _interopRequireDefault(_quillDelta);
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _break = __webpack_require__(16);
-
- var _break2 = _interopRequireDefault(_break);
-
- var _inline = __webpack_require__(6);
-
- var _inline2 = _interopRequireDefault(_inline);
-
- var _text = __webpack_require__(7);
-
- var _text2 = _interopRequireDefault(_text);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var NEWLINE_LENGTH = 1;
-
- var BlockEmbed = function (_Parchment$Embed) {
- _inherits(BlockEmbed, _Parchment$Embed);
-
- function BlockEmbed() {
- _classCallCheck(this, BlockEmbed);
-
- return _possibleConstructorReturn(this, (BlockEmbed.__proto__ || Object.getPrototypeOf(BlockEmbed)).apply(this, arguments));
- }
-
- _createClass(BlockEmbed, [{
- key: 'attach',
- value: function attach() {
- _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'attach', this).call(this);
- this.attributes = new _parchment2.default.Attributor.Store(this.domNode);
- }
- }, {
- key: 'delta',
- value: function delta() {
- return new _quillDelta2.default().insert(this.value(), (0, _extend2.default)(this.formats(), this.attributes.values()));
- }
- }, {
- key: 'format',
- value: function format(name, value) {
- var attribute = _parchment2.default.query(name, _parchment2.default.Scope.BLOCK_ATTRIBUTE);
- if (attribute != null) {
- this.attributes.attribute(attribute, value);
- }
- }
- }, {
- key: 'formatAt',
- value: function formatAt(index, length, name, value) {
- this.format(name, value);
- }
- }, {
- key: 'insertAt',
- value: function insertAt(index, value, def) {
- if (typeof value === 'string' && value.endsWith('\n')) {
- var block = _parchment2.default.create(Block.blotName);
- this.parent.insertBefore(block, index === 0 ? this : this.next);
- block.insertAt(0, value.slice(0, -1));
- } else {
- _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'insertAt', this).call(this, index, value, def);
- }
- }
- }]);
-
- return BlockEmbed;
- }(_parchment2.default.Embed);
-
- BlockEmbed.scope = _parchment2.default.Scope.BLOCK_BLOT;
- // It is important for cursor behavior BlockEmbeds use tags that are block level elements
-
-
- var Block = function (_Parchment$Block) {
- _inherits(Block, _Parchment$Block);
-
- function Block(domNode) {
- _classCallCheck(this, Block);
-
- var _this2 = _possibleConstructorReturn(this, (Block.__proto__ || Object.getPrototypeOf(Block)).call(this, domNode));
-
- _this2.cache = {};
- return _this2;
- }
-
- _createClass(Block, [{
- key: 'delta',
- value: function delta() {
- if (this.cache.delta == null) {
- this.cache.delta = this.descendants(_parchment2.default.Leaf).reduce(function (delta, leaf) {
- if (leaf.length() === 0) {
- return delta;
- } else {
- return delta.insert(leaf.value(), bubbleFormats(leaf));
- }
- }, new _quillDelta2.default()).insert('\n', bubbleFormats(this));
- }
- return this.cache.delta;
- }
- }, {
- key: 'deleteAt',
- value: function deleteAt(index, length) {
- _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'deleteAt', this).call(this, index, length);
- this.cache = {};
- }
- }, {
- key: 'formatAt',
- value: function formatAt(index, length, name, value) {
- if (length <= 0) return;
- if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) {
- if (index + length === this.length()) {
- this.format(name, value);
- }
- } else {
- _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'formatAt', this).call(this, index, Math.min(length, this.length() - index - 1), name, value);
- }
- this.cache = {};
- }
- }, {
- key: 'insertAt',
- value: function insertAt(index, value, def) {
- if (def != null) return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, index, value, def);
- if (value.length === 0) return;
- var lines = value.split('\n');
- var text = lines.shift();
- if (text.length > 0) {
- if (index < this.length() - 1 || this.children.tail == null) {
- _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, Math.min(index, this.length() - 1), text);
- } else {
- this.children.tail.insertAt(this.children.tail.length(), text);
- }
- this.cache = {};
- }
- var block = this;
- lines.reduce(function (index, line) {
- block = block.split(index, true);
- block.insertAt(0, line);
- return line.length;
- }, index + text.length);
- }
- }, {
- key: 'insertBefore',
- value: function insertBefore(blot, ref) {
- var head = this.children.head;
- _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertBefore', this).call(this, blot, ref);
- if (head instanceof _break2.default) {
- head.remove();
- }
- this.cache = {};
- }
- }, {
- key: 'length',
- value: function length() {
- if (this.cache.length == null) {
- this.cache.length = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'length', this).call(this) + NEWLINE_LENGTH;
- }
- return this.cache.length;
- }
- }, {
- key: 'moveChildren',
- value: function moveChildren(target, ref) {
- _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'moveChildren', this).call(this, target, ref);
- this.cache = {};
- }
- }, {
- key: 'optimize',
- value: function optimize(context) {
- _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'optimize', this).call(this, context);
- this.cache = {};
- }
- }, {
- key: 'path',
- value: function path(index) {
- return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'path', this).call(this, index, true);
- }
- }, {
- key: 'removeChild',
- value: function removeChild(child) {
- _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'removeChild', this).call(this, child);
- this.cache = {};
- }
- }, {
- key: 'split',
- value: function split(index) {
- var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
-
- if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {
- var clone = this.clone();
- if (index === 0) {
- this.parent.insertBefore(clone, this);
- return this;
- } else {
- this.parent.insertBefore(clone, this.next);
- return clone;
- }
- } else {
- var next = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'split', this).call(this, index, force);
- this.cache = {};
- return next;
- }
- }
- }]);
-
- return Block;
- }(_parchment2.default.Block);
-
- Block.blotName = 'block';
- Block.tagName = 'P';
- Block.defaultChild = 'break';
- Block.allowedChildren = [_inline2.default, _parchment2.default.Embed, _text2.default];
-
- function bubbleFormats(blot) {
- var formats = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
-
- if (blot == null) return formats;
- if (typeof blot.formats === 'function') {
- formats = (0, _extend2.default)(formats, blot.formats());
- }
- if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) {
- return formats;
- }
- return bubbleFormats(blot.parent, formats);
- }
-
- exports.bubbleFormats = bubbleFormats;
- exports.BlockEmbed = BlockEmbed;
- exports.default = Block;
-
- /***/
- }),
-/* 5 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.DeltaTransformer = exports.default = exports.overload = exports.expandConfig = undefined;
-
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
-
- var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- __webpack_require__(56);
-
- var _quillDelta = __webpack_require__(1);
-
- var _quillDelta2 = _interopRequireDefault(_quillDelta);
-
- var _editor = __webpack_require__(14);
-
- var _editor2 = _interopRequireDefault(_editor);
-
- var _emitter3 = __webpack_require__(8);
-
- var _emitter4 = _interopRequireDefault(_emitter3);
-
- var _module = __webpack_require__(9);
-
- var _module2 = _interopRequireDefault(_module);
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _selection = __webpack_require__(15);
-
- var _selection2 = _interopRequireDefault(_selection);
-
- var _extend = __webpack_require__(3);
-
- var _extend2 = _interopRequireDefault(_extend);
-
- var _logger = __webpack_require__(10);
-
- var _logger2 = _interopRequireDefault(_logger);
-
- var _theme = __webpack_require__(40);
-
- var _theme2 = _interopRequireDefault(_theme);
-
- var _delta = __webpack_require__(73);
-
- var _delta2 = _interopRequireDefault(_delta);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- var debug = (0, _logger2.default)("quill");
-
- var Quill = function () {
- _createClass(Quill, null, [{
- key: "debug",
- value: function debug(limit) {
- if (limit === true) {
- limit = "log";
- }
- _logger2.default.level(limit);
- }
- }, {
- key: "find",
- value: function find(node) {
- return node.__quill || _parchment2.default.find(node);
- }
- }, {
- key: "import",
- value: function _import(name) {
- if (this.imports[name] == null) {
- debug.error("Cannot import " + name + ". Are you sure it was registered?");
- }
- return this.imports[name];
- }
- }, {
- key: "register",
- value: function register(path, target) {
- var _this = this;
-
- var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
-
- if (typeof path !== "string") {
- var name = path.attrName || path.blotName;
- if (typeof name === "string") {
- // register(Blot | Attributor, overwrite)
- this.register("formats/" + name, path, target);
- } else {
- Object.keys(path).forEach(function (key) {
- _this.register(key, path[key], target);
- });
- }
- } else {
- if (this.imports[path] != null && !overwrite) {
- debug.warn("Overwriting " + path + " with", target);
- }
- this.imports[path] = target;
- if ((path.startsWith("blots/") || path.startsWith("formats/")) && target.blotName !== "abstract") {
- _parchment2.default.register(target);
- } else if (path.startsWith("modules") && typeof target.register === "function") {
- target.register();
- }
- }
- }
- }]);
-
- function Quill(container) {
- var _this2 = this;
-
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
-
- _classCallCheck(this, Quill);
-
- this.options = expandConfig(container, options);
- this.container = this.options.container;
- if (this.container == null) {
- return debug.error("Invalid Quill container", container);
- }
- if (this.options.debug) {
- Quill.debug(this.options.debug);
- }
- var html = this.container.innerHTML.trim();
- this.container.classList.add("ql-container");
- this.container.innerHTML = "";
- this.container.__quill = this;
- this.root = this.addContainer("ql-editor");
- this.root.classList.add("ql-blank");
- this.root.setAttribute("data-gramm", false);
- this.scrollingContainer = this.options.scrollingContainer || this.root;
- this.emitter = new _emitter4.default();
- this.scroll = _parchment2.default.create(this.root, {
- emitter: this.emitter,
- whitelist: this.options.formats
- });
- this.editor = new _editor2.default(this.scroll);
- this.selection = new _selection2.default(this.scroll, this.emitter);
- this.theme = new this.options.theme(this, this.options);
- this.keyboard = this.theme.addModule("keyboard");
- this.clipboard = this.theme.addModule("clipboard");
- this.history = this.theme.addModule("history");
- this.theme.init();
- this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type) {
- if (type === _emitter4.default.events.TEXT_CHANGE) {
- _this2.root.classList.toggle("ql-blank", _this2.editor.isBlank());
- }
- });
- this.emitter.on(_emitter4.default.events.SCROLL_UPDATE, function (source, mutations) {
- var range = _this2.selection.lastRange;
- var index = range && range.length === 0 ? range.index : undefined;
- modify.call(_this2, function () {
- return _this2.editor.update(null, mutations, index);
- }, source);
- });
- var contents = this.clipboard.convert("<div class='ql-editor' style=\"white-space: normal;\">" + html + "<p><br></p></div>");
- this.setContents(contents);
- this.history.clear();
- if (this.options.placeholder) {
- this.root.setAttribute("data-placeholder", this.options.placeholder);
- }
- if (this.options.readOnly) {
- this.disable();
- }
- }
-
- _createClass(Quill, [{
- key: "addContainer",
- value: function addContainer(container) {
- var refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
-
- if (typeof container === "string") {
- var className = container;
- container = document.createElement("div");
- container.classList.add(className);
- }
- this.container.insertBefore(container, refNode);
- return container;
- }
- }, {
- key: "blur",
- value: function blur() {
- this.selection.setRange(null);
- }
- }, {
- key: "deleteText",
- value: function deleteText(index, length, source) {
- var _this3 = this;
-
- var _overload = overload(index, length, source);
-
- var _overload2 = _slicedToArray(_overload, 4);
-
- index = _overload2[0];
- length = _overload2[1];
- source = _overload2[3];
-
- return modify.call(this, function () {
- return _this3.editor.deleteText(index, length);
- }, source, index, -1 * length);
- }
- }, {
- key: "disable",
- value: function disable() {
- this.enable(false);
- }
- }, {
- key: "enable",
- value: function enable() {
- var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
-
- this.scroll.enable(enabled);
- this.container.classList.toggle("ql-disabled", !enabled);
- }
- }, {
- key: "focus",
- value: function focus() {
- var scrollTop = this.scrollingContainer.scrollTop;
- this.selection.focus();
- this.scrollingContainer.scrollTop = scrollTop;
- this.scrollIntoView();
- }
- }, {
- key: "format",
- value: function format(name, value) {
- var _this4 = this;
-
- var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API;
-
- return modify.call(this, function () {
- var range = _this4.getSelection(true);
- var change = new _quillDelta2.default();
- if (range == null) {
- return change;
- } else if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) {
- change = _this4.editor.formatLine(range.index, range.length, _defineProperty({}, name, value));
- } else if (range.length === 0) {
- _this4.selection.format(name, value);
- return change;
- } else {
- change = _this4.editor.formatText(range.index, range.length, _defineProperty({}, name, value));
- }
- _this4.setSelection(range, _emitter4.default.sources.SILENT);
- return change;
- }, source);
- }
- }, {
- key: "formatLine",
- value: function formatLine(index, length, name, value, source) {
- var _this5 = this;
-
- var formats = void 0;
-
- var _overload3 = overload(index, length, name, value, source);
-
- var _overload4 = _slicedToArray(_overload3, 4);
-
- index = _overload4[0];
- length = _overload4[1];
- formats = _overload4[2];
- source = _overload4[3];
-
- return modify.call(this, function () {
- return _this5.editor.formatLine(index, length, formats);
- }, source, index, 0);
- }
- }, {
- key: "formatText",
- value: function formatText(index, length, name, value, source) {
- var _this6 = this;
-
- var formats = void 0;
-
- var _overload5 = overload(index, length, name, value, source);
-
- var _overload6 = _slicedToArray(_overload5, 4);
-
- index = _overload6[0];
- length = _overload6[1];
- formats = _overload6[2];
- source = _overload6[3];
-
- return modify.call(this, function () {
- return _this6.editor.formatText(index, length, formats);
- }, source, index, 0);
- }
- }, {
- key: "getBounds",
- value: function getBounds(index) {
- var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
-
- var bounds = void 0;
- if (typeof index === "number") {
- bounds = this.selection.getBounds(index, length);
- } else {
- bounds = this.selection.getBounds(index.index, index.length);
- }
- var containerBounds = this.container.getBoundingClientRect();
- return {
- bottom: bounds.bottom - containerBounds.top,
- height: bounds.height,
- left: bounds.left - containerBounds.left,
- right: bounds.right - containerBounds.left,
- top: bounds.top - containerBounds.top,
- width: bounds.width
- };
- }
- }, {
- key: "getContents",
- value: function getContents() {
- var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
- var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;
-
- var _overload7 = overload(index, length);
-
- var _overload8 = _slicedToArray(_overload7, 2);
-
- index = _overload8[0];
- length = _overload8[1];
-
- return this.editor.getContents(index, length);
- }
- }, {
- key: "getFormat",
- value: function getFormat() {
- var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection(true);
- var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
-
- if (typeof index === "number") {
- return this.editor.getFormat(index, length);
- } else {
- return this.editor.getFormat(index.index, index.length);
- }
- }
- }, {
- key: "getIndex",
- value: function getIndex(blot) {
- return blot.offset(this.scroll);
- }
- }, {
- key: "getLength",
- value: function getLength() {
- return this.scroll.length();
- }
- }, {
- key: "getLeaf",
- value: function getLeaf(index) {
- return this.scroll.leaf(index);
- }
- }, {
- key: "getLine",
- value: function getLine(index) {
- return this.scroll.line(index);
- }
- }, {
- key: "getLines",
- value: function getLines() {
- var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
- var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE;
-
- if (typeof index !== "number") {
- return this.scroll.lines(index.index, index.length);
- } else {
- return this.scroll.lines(index, length);
- }
- }
- }, {
- key: "getModule",
- value: function getModule(name) {
- return this.theme.modules[name];
- }
- }, {
- key: "getSelection",
- value: function getSelection() {
- var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
-
- if (focus) this.focus();
- this.update(); // Make sure we access getRange with editor in consistent state
- return this.selection.getRange()[0];
- }
- }, {
- key: "getText",
- value: function getText() {
- var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
- var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;
-
- var _overload9 = overload(index, length);
-
- var _overload10 = _slicedToArray(_overload9, 2);
-
- index = _overload10[0];
- length = _overload10[1];
-
- return this.editor.getText(index, length);
- }
- }, {
- key: "hasFocus",
- value: function hasFocus() {
- return this.selection.hasFocus();
- }
- }, {
- key: "insertEmbed",
- value: function insertEmbed(index, embed, value) {
- var _this7 = this;
-
- var source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API;
-
- return modify.call(this, function () {
- return _this7.editor.insertEmbed(index, embed, value);
- }, source, index);
- }
- }, {
- key: "insertText",
- value: function insertText(index, text, name, value, source) {
- var _this8 = this;
-
- var formats = void 0;
-
- var _overload11 = overload(index, 0, name, value, source);
-
- var _overload12 = _slicedToArray(_overload11, 4);
-
- index = _overload12[0];
- formats = _overload12[2];
- source = _overload12[3];
-
- return modify.call(this, function () {
- return _this8.editor.insertText(index, text, formats);
- }, source, index, text.length);
- }
- }, {
- key: "isEnabled",
- value: function isEnabled() {
- return !this.container.classList.contains("ql-disabled");
- }
- }, {
- key: "off",
- value: function off() {
- return this.emitter.off.apply(this.emitter, arguments);
- }
- }, {
- key: "on",
- value: function on() {
- return this.emitter.on.apply(this.emitter, arguments);
- }
- }, {
- key: "once",
- value: function once() {
- return this.emitter.once.apply(this.emitter, arguments);
- }
- }, {
- key: "pasteHTML",
- value: function pasteHTML(index, html, source) {
- this.clipboard.dangerouslyPasteHTML(index, html, source);
- }
- }, {
- key: "removeFormat",
- value: function removeFormat(index, length, source) {
- var _this9 = this;
-
- var _overload13 = overload(index, length, source);
-
- var _overload14 = _slicedToArray(_overload13, 4);
-
- index = _overload14[0];
- length = _overload14[1];
- source = _overload14[3];
-
- return modify.call(this, function () {
- return _this9.editor.removeFormat(index, length);
- }, source, index);
- }
- }, {
- key: "scrollIntoView",
- value: function scrollIntoView() {
- this.selection.scrollIntoView(this.scrollingContainer);
- }
- }, {
- key: "setContents",
- value: function setContents(delta) {
- var _this10 = this;
-
- var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API;
-
- return modify.call(this, function () {
- delta = new _quillDelta2.default(delta);
- var length = _this10.getLength();
- var deleted = _this10.editor.deleteText(0, length);
- var applied = _this10.editor.applyDelta(delta);
- var lastOp = applied.ops[applied.ops.length - 1];
- if (lastOp != null && typeof lastOp.insert === "string" && lastOp.insert[lastOp.insert.length - 1] === "\n") {
- _this10.editor.deleteText(_this10.getLength() - 1, 1);
- applied.delete(1);
- }
- var ret = deleted.compose(applied);
- return ret;
- }, source);
- }
- }, {
- key: "setSelection",
- value: function setSelection(index, length, source) {
- if (index == null) {
- this.selection.setRange(null, length || Quill.sources.API);
- } else {
- var _overload15 = overload(index, length, source);
-
- var _overload16 = _slicedToArray(_overload15, 4);
-
- index = _overload16[0];
- length = _overload16[1];
- source = _overload16[3];
-
- this.selection.setRange(new _selection.Range(index, length), source);
- if (source !== _emitter4.default.sources.SILENT) {
- this.selection.scrollIntoView(this.scrollingContainer);
- }
- }
- }
- }, {
- key: "setText",
- value: function setText(text) {
- var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API;
-
- var delta = new _quillDelta2.default().insert(text);
- return this.setContents(delta, source);
- }
- }, {
- key: "update",
- value: function update() {
- var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER;
-
- var change = this.scroll.update(source); // Will update selection before selection.update() does if text changes
- this.selection.update(source);
- return change;
- }
- }, {
- key: "updateContents",
- value: function updateContents(delta) {
- var _this11 = this;
-
- var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API;
-
- return modify.call(this, function () {
- delta = new _quillDelta2.default(delta);
- return _this11.editor.applyDelta(delta, source);
- }, source, true);
- }
- }]);
-
- return Quill;
- }();
-
- Quill.DEFAULTS = {
- bounds: null,
- formats: null,
- modules: {},
- placeholder: "",
- readOnly: false,
- scrollingContainer: null,
- strict: true,
- theme: "default"
- };
- Quill.events = _emitter4.default.events;
- Quill.sources = _emitter4.default.sources;
- // eslint-disable-next-line no-undef
- Quill.version = false ? "dev" : "1.3.7";
-
- Quill.imports = {
- delta: _quillDelta2.default,
- parchment: _parchment2.default,
- "core/module": _module2.default,
- "core/theme": _theme2.default
- };
-
- function expandConfig(container, userConfig) {
- userConfig = (0, _extend2.default)(true, {
- container: container,
- modules: {
- clipboard: true,
- keyboard: true,
- history: true
- }
- }, userConfig);
- if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) {
- userConfig.theme = _theme2.default;
- } else {
- userConfig.theme = Quill.import("themes/" + userConfig.theme);
- if (userConfig.theme == null) {
- throw new Error("Invalid theme " + userConfig.theme + ". Did you register it?");
- }
- }
- var themeConfig = (0, _extend2.default)(true, {}, userConfig.theme.DEFAULTS);
- [themeConfig, userConfig].forEach(function (config) {
- config.modules = config.modules || {};
- Object.keys(config.modules).forEach(function (module) {
- if (config.modules[module] === true) {
- config.modules[module] = {};
- }
- });
- });
- var moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules));
- var moduleConfig = moduleNames.reduce(function (config, name) {
- var moduleClass = Quill.import("modules/" + name);
- if (moduleClass == null) {
- debug.error("Cannot load " + name + " module. Are you sure you registered it?");
- } else {
- config[name] = moduleClass.DEFAULTS || {};
- }
- return config;
- }, {});
- // Special case toolbar shorthand
- if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) {
- userConfig.modules.toolbar = {
- container: userConfig.modules.toolbar
- };
- }
- userConfig = (0, _extend2.default)(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig);
- ["bounds", "container", "scrollingContainer"].forEach(function (key) {
- if (typeof userConfig[key] === "string") {
- userConfig[key] = document.querySelector(userConfig[key]);
- }
- });
- userConfig.modules = Object.keys(userConfig.modules).reduce(function (config, name) {
- if (userConfig.modules[name]) {
- config[name] = userConfig.modules[name];
- }
- return config;
- }, {});
- return userConfig;
- }
-
- // Handle selection preservation and TEXT_CHANGE emission
- // common to modification APIs
- function modify(modifier, source, index, shift) {
- if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {
- return new _quillDelta2.default();
- }
- var range = index == null ? null : this.getSelection();
- var oldDelta = this.editor.delta;
- var change = modifier();
- if (range != null) {
- if (index === true) index = range.index;
- if (shift == null) {
- range = shiftRange(range, change, source);
- } else if (shift !== 0) {
- range = shiftRange(range, index, shift, source);
- }
- this.setSelection(range, _emitter4.default.sources.SILENT);
- }
- if (change.length() > 0) {
- var _emitter;
-
- var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];
- (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));
- if (source !== _emitter4.default.sources.SILENT) {
- var _emitter2;
-
- (_emitter2 = this.emitter).emit.apply(_emitter2, args);
- }
- }
- return change;
- }
-
- function overload(index, length, name, value, source) {
- var formats = {};
- if (typeof index.index === "number" && typeof index.length === "number") {
- // Allow for throwaway end (used by insertText/insertEmbed)
- if (typeof length !== "number") {
- source = value, value = name, name = length, length = index.length, index = index.index;
- } else {
- length = index.length, index = index.index;
- }
- } else if (typeof length !== "number") {
- source = value, value = name, name = length, length = 0;
- }
- // Handle format being object, two format name/value strings or excluded
- if ((typeof name === "undefined" ? "undefined" : _typeof(name)) === "object") {
- formats = name;
- source = value;
- } else if (typeof name === "string") {
- if (value != null) {
- formats[name] = value;
- } else {
- source = name;
- }
- }
- // Handle optional source
- source = source || _emitter4.default.sources.API;
- return [index, length, formats, source];
- }
-
- function shiftRange(range, index, length, source) {
- if (range == null) return null;
- var start = void 0,
- end = void 0;
- if (index instanceof _quillDelta2.default) {
- var _map = [range.index, range.index + range.length].map(function (pos) {
- return index.transformPosition(pos, source !== _emitter4.default.sources.USER);
- });
-
- var _map2 = _slicedToArray(_map, 2);
-
- start = _map2[0];
- end = _map2[1];
- } else {
- var _map3 = [range.index, range.index + range.length].map(function (pos) {
- if (pos < index || pos === index && source === _emitter4.default.sources.USER) return pos;
- if (length >= 0) {
- return pos + length;
- } else {
- return Math.max(index, pos + length);
- }
- });
-
- var _map4 = _slicedToArray(_map3, 2);
-
- start = _map4[0];
- end = _map4[1];
- }
- return new _selection.Range(start, end - start);
- }
-
- exports.expandConfig = expandConfig;
- exports.overload = overload;
- exports.default = Quill;
- exports.DeltaTransformer = _delta2.default;
-
- /***/
- }),
-/* 6 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _text = __webpack_require__(7);
-
- var _text2 = _interopRequireDefault(_text);
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var Inline = function (_Parchment$Inline) {
- _inherits(Inline, _Parchment$Inline);
-
- function Inline() {
- _classCallCheck(this, Inline);
-
- return _possibleConstructorReturn(this, (Inline.__proto__ || Object.getPrototypeOf(Inline)).apply(this, arguments));
- }
-
- _createClass(Inline, [{
- key: 'formatAt',
- value: function formatAt(index, length, name, value) {
- if (Inline.compare(this.statics.blotName, name) < 0 && _parchment2.default.query(name, _parchment2.default.Scope.BLOT)) {
- var blot = this.isolate(index, length);
- if (value) {
- blot.wrap(name, value);
- }
- } else {
- _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'formatAt', this).call(this, index, length, name, value);
- }
- }
- }, {
- key: 'optimize',
- value: function optimize(context) {
- _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'optimize', this).call(this, context);
- if (this.parent instanceof Inline && Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) {
- var parent = this.parent.isolate(this.offset(), this.length());
- this.moveChildren(parent);
- parent.wrap(this);
- }
- }
- }], [{
- key: 'compare',
- value: function compare(self, other) {
- var selfIndex = Inline.order.indexOf(self);
- var otherIndex = Inline.order.indexOf(other);
- if (selfIndex >= 0 || otherIndex >= 0) {
- return selfIndex - otherIndex;
- } else if (self === other) {
- return 0;
- } else if (self < other) {
- return -1;
- } else {
- return 1;
- }
- }
- }]);
-
- return Inline;
- }(_parchment2.default.Inline);
-
- Inline.allowedChildren = [Inline, _parchment2.default.Embed, _text2.default];
- // Lower index means deeper in the DOM tree, since not found (-1) is for embeds
- Inline.order = ['cursor', 'inline', // Must be lower
- 'underline', 'strike', 'italic', 'bold', 'script', 'link', 'code' // Must be higher
- ];
-
- exports.default = Inline;
-
- /***/
- }),
-/* 7 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var TextBlot = function (_Parchment$Text) {
- _inherits(TextBlot, _Parchment$Text);
-
- function TextBlot() {
- _classCallCheck(this, TextBlot);
-
- return _possibleConstructorReturn(this, (TextBlot.__proto__ || Object.getPrototypeOf(TextBlot)).apply(this, arguments));
- }
-
- return TextBlot;
- }(_parchment2.default.Text);
-
- exports.default = TextBlot;
-
- /***/
- }),
-/* 8 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _eventemitter = __webpack_require__(72);
-
- var _eventemitter2 = _interopRequireDefault(_eventemitter);
-
- var _logger = __webpack_require__(10);
-
- var _logger2 = _interopRequireDefault(_logger);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var debug = (0, _logger2.default)('quill:events');
-
- var EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click'];
-
- EVENTS.forEach(function (eventName) {
- document.addEventListener(eventName, function () {
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- [].slice.call(document.querySelectorAll('.ql-container')).forEach(function (node) {
- // TODO use WeakMap
- if (node.__quill && node.__quill.emitter) {
- var _node$__quill$emitter;
-
- (_node$__quill$emitter = node.__quill.emitter).handleDOM.apply(_node$__quill$emitter, args);
- }
- });
- });
- });
-
- var Emitter = function (_EventEmitter) {
- _inherits(Emitter, _EventEmitter);
-
- function Emitter() {
- _classCallCheck(this, Emitter);
-
- var _this = _possibleConstructorReturn(this, (Emitter.__proto__ || Object.getPrototypeOf(Emitter)).call(this));
-
- _this.listeners = {};
- _this.on('error', debug.error);
- return _this;
- }
-
- _createClass(Emitter, [{
- key: 'emit',
- value: function emit() {
- debug.log.apply(debug, arguments);
- _get(Emitter.prototype.__proto__ || Object.getPrototypeOf(Emitter.prototype), 'emit', this).apply(this, arguments);
- }
- }, {
- key: 'handleDOM',
- value: function handleDOM(event) {
- for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
- args[_key2 - 1] = arguments[_key2];
- }
-
- (this.listeners[event.type] || []).forEach(function (_ref) {
- var node = _ref.node,
- handler = _ref.handler;
-
- if (event.target === node || node.contains(event.target)) {
- handler.apply(undefined, [event].concat(args));
- }
- });
- }
- }, {
- key: 'listenDOM',
- value: function listenDOM(eventName, node, handler) {
- if (!this.listeners[eventName]) {
- this.listeners[eventName] = [];
- }
- this.listeners[eventName].push({ node: node, handler: handler });
- }
- }]);
-
- return Emitter;
- }(_eventemitter2.default);
-
- Emitter.events = {
- EDITOR_CHANGE: 'editor-change',
- SCROLL_BEFORE_UPDATE: 'scroll-before-update',
- SCROLL_OPTIMIZE: 'scroll-optimize',
- SCROLL_UPDATE: 'scroll-update',
- SELECTION_CHANGE: 'selection-change',
- TEXT_CHANGE: 'text-change'
- };
- Emitter.sources = {
- API: 'api',
- SILENT: 'silent',
- USER: 'user'
- };
-
- exports.default = Emitter;
-
- /***/
- }),
-/* 9 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- var Module = function Module(quill) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
-
- _classCallCheck(this, Module);
-
- this.quill = quill;
- this.options = options;
- };
-
- Module.DEFAULTS = {};
-
- exports.default = Module;
-
- /***/
- }),
-/* 10 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var levels = ['error', 'warn', 'log', 'info'];
- var level = 'warn';
-
- function debug(method) {
- if (levels.indexOf(method) <= levels.indexOf(level)) {
- var _console;
-
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
-
- (_console = console)[method].apply(_console, args); // eslint-disable-line no-console
- }
- }
-
- function namespace(ns) {
- return levels.reduce(function (logger, method) {
- logger[method] = debug.bind(console, method, ns);
- return logger;
- }, {});
- }
-
- debug.level = namespace.level = function (newLevel) {
- level = newLevel;
- };
-
- exports.default = namespace;
-
- /***/
- }),
-/* 11 */
-/***/ (function (module, exports, __webpack_require__) {
-
- var objectKeys = __webpack_require__(36);
- var isArguments = __webpack_require__(59);
- var is = __webpack_require__(60);
- var isRegex = __webpack_require__(61);
- var flags = __webpack_require__(64);
- var isDate = __webpack_require__(71);
-
- var getTime = Date.prototype.getTime;
-
- function deepEqual(actual, expected, options) {
- var opts = options || {};
-
- // 7.1. All identical values are equivalent, as determined by ===.
- if (opts.strict ? is(actual, expected) : actual === expected) {
- return true;
- }
-
- // 7.3. Other pairs that do not both pass typeof value == 'object', equivalence is determined by ==.
- if (!actual || !expected || (typeof actual !== 'object' && typeof expected !== 'object')) {
- return opts.strict ? is(actual, expected) : actual == expected;
- }
-
- /*
- * 7.4. For all other Object pairs, including Array objects, equivalence is
- * determined by having the same number of owned properties (as verified
- * with Object.prototype.hasOwnProperty.call), the same set of keys
- * (although not necessarily the same order), equivalent values for every
- * corresponding key, and an identical 'prototype' property. Note: this
- * accounts for both named and indexed properties on Arrays.
- */
- // eslint-disable-next-line no-use-before-define
- return objEquiv(actual, expected, opts);
- }
-
- function isUndefinedOrNull(value) {
- return value === null || value === undefined;
- }
-
- function isBuffer(x) {
- if (!x || typeof x !== 'object' || typeof x.length !== 'number') {
- return false;
- }
- if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {
- return false;
- }
- if (x.length > 0 && typeof x[0] !== 'number') {
- return false;
- }
- return true;
- }
-
- function objEquiv(a, b, opts) {
- /* eslint max-statements: [2, 50] */
- var i, key;
- if (typeof a !== typeof b) { return false; }
- if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) { return false; }
-
- // an identical 'prototype' property.
- if (a.prototype !== b.prototype) { return false; }
-
- if (isArguments(a) !== isArguments(b)) { return false; }
-
- var aIsRegex = isRegex(a);
- var bIsRegex = isRegex(b);
- if (aIsRegex !== bIsRegex) { return false; }
- if (aIsRegex || bIsRegex) {
- return a.source === b.source && flags(a) === flags(b);
- }
-
- if (isDate(a) && isDate(b)) {
- return getTime.call(a) === getTime.call(b);
- }
-
- var aIsBuffer = isBuffer(a);
- var bIsBuffer = isBuffer(b);
- if (aIsBuffer !== bIsBuffer) { return false; }
- if (aIsBuffer || bIsBuffer) { // && would work too, because both are true or both false here
- if (a.length !== b.length) { return false; }
- for (i = 0; i < a.length; i++) {
- if (a[i] !== b[i]) { return false; }
- }
- return true;
- }
-
- if (typeof a !== typeof b) { return false; }
-
- try {
- var ka = objectKeys(a);
- var kb = objectKeys(b);
- } catch (e) { // happens when one is a string literal and the other isn't
- return false;
- }
- // having the same number of owned properties (keys incorporates hasOwnProperty)
- if (ka.length !== kb.length) { return false; }
-
- // the same set of keys (although not necessarily the same order),
- ka.sort();
- kb.sort();
- // ~~~cheap key test
- for (i = ka.length - 1; i >= 0; i--) {
- if (ka[i] != kb[i]) { return false; }
- }
- // equivalent values for every corresponding key, and ~~~possibly expensive deep test
- for (i = ka.length - 1; i >= 0; i--) {
- key = ka[i];
- if (!deepEqual(a[key], b[key], opts)) { return false; }
- }
-
- return true;
- }
-
- module.exports = deepEqual;
-
-
- /***/
- }),
-/* 12 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- Object.defineProperty(exports, "__esModule", { value: true });
- var Registry = __webpack_require__(2);
- var Attributor = /** @class */ (function () {
- function Attributor(attrName, keyName, options) {
- if (options === void 0) { options = {}; }
- this.attrName = attrName;
- this.keyName = keyName;
- var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE;
- if (options.scope != null) {
- // Ignore type bits, force attribute bit
- this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit;
- }
- else {
- this.scope = Registry.Scope.ATTRIBUTE;
- }
- if (options.whitelist != null)
- this.whitelist = options.whitelist;
- }
- Attributor.keys = function (node) {
- return [].map.call(node.attributes, function (item) {
- return item.name;
- });
- };
- Attributor.prototype.add = function (node, value) {
- if (!this.canAdd(node, value))
- return false;
- node.setAttribute(this.keyName, value);
- return true;
- };
- Attributor.prototype.canAdd = function (node, value) {
- var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE));
- if (match == null)
- return false;
- if (this.whitelist == null)
- return true;
- if (typeof value === 'string') {
- return this.whitelist.indexOf(value.replace(/["']/g, '')) > -1;
- }
- else {
- return this.whitelist.indexOf(value) > -1;
- }
- };
- Attributor.prototype.remove = function (node) {
- node.removeAttribute(this.keyName);
- };
- Attributor.prototype.value = function (node) {
- var value = node.getAttribute(this.keyName);
- if (this.canAdd(node, value) && value) {
- return value;
- }
- return '';
- };
- return Attributor;
- }());
- exports.default = Attributor;
-
-
- /***/
- }),
-/* 13 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = exports.Code = undefined;
-
- var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _quillDelta = __webpack_require__(1);
-
- var _quillDelta2 = _interopRequireDefault(_quillDelta);
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _block = __webpack_require__(4);
-
- var _block2 = _interopRequireDefault(_block);
-
- var _inline = __webpack_require__(6);
-
- var _inline2 = _interopRequireDefault(_inline);
-
- var _text = __webpack_require__(7);
-
- var _text2 = _interopRequireDefault(_text);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var Code = function (_Inline) {
- _inherits(Code, _Inline);
-
- function Code() {
- _classCallCheck(this, Code);
-
- return _possibleConstructorReturn(this, (Code.__proto__ || Object.getPrototypeOf(Code)).apply(this, arguments));
- }
-
- return Code;
- }(_inline2.default);
-
- Code.blotName = 'code';
- Code.tagName = 'CODE';
-
- var CodeBlock = function (_Block) {
- _inherits(CodeBlock, _Block);
-
- function CodeBlock() {
- _classCallCheck(this, CodeBlock);
-
- return _possibleConstructorReturn(this, (CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock)).apply(this, arguments));
- }
-
- _createClass(CodeBlock, [{
- key: 'delta',
- value: function delta() {
- var _this3 = this;
-
- var text = this.domNode.textContent;
- if (text.endsWith('\n')) {
- // Should always be true
- text = text.slice(0, -1);
- }
- return text.split('\n').reduce(function (delta, frag) {
- return delta.insert(frag).insert('\n', _this3.formats());
- }, new _quillDelta2.default());
- }
- }, {
- key: 'format',
- value: function format(name, value) {
- if (name === this.statics.blotName && value) return;
-
- var _descendant = this.descendant(_text2.default, this.length() - 1),
- _descendant2 = _slicedToArray(_descendant, 1),
- text = _descendant2[0];
-
- if (text != null) {
- text.deleteAt(text.length() - 1, 1);
- }
- _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'format', this).call(this, name, value);
- }
- }, {
- key: 'formatAt',
- value: function formatAt(index, length, name, value) {
- if (length === 0) return;
- if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK) == null || name === this.statics.blotName && value === this.statics.formats(this.domNode)) {
- return;
- }
- var nextNewline = this.newlineIndex(index);
- if (nextNewline < 0 || nextNewline >= index + length) return;
- var prevNewline = this.newlineIndex(index, true) + 1;
- var isolateLength = nextNewline - prevNewline + 1;
- var blot = this.isolate(prevNewline, isolateLength);
- var next = blot.next;
- blot.format(name, value);
- if (next instanceof CodeBlock) {
- next.formatAt(0, index - prevNewline + length - isolateLength, name, value);
- }
- }
- }, {
- key: 'insertAt',
- value: function insertAt(index, value, def) {
- if (def != null) return;
-
- var _descendant3 = this.descendant(_text2.default, index),
- _descendant4 = _slicedToArray(_descendant3, 2),
- text = _descendant4[0],
- offset = _descendant4[1];
-
- text.insertAt(offset, value);
- }
- }, {
- key: 'length',
- value: function length() {
- var length = this.domNode.textContent.length;
- if (!this.domNode.textContent.endsWith('\n')) {
- return length + 1;
- }
- return length;
- }
- }, {
- key: 'newlineIndex',
- value: function newlineIndex(searchIndex) {
- var reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
-
- if (!reverse) {
- var offset = this.domNode.textContent.slice(searchIndex).indexOf('\n');
- return offset > -1 ? searchIndex + offset : -1;
- } else {
- return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\n');
- }
- }
- }, {
- key: 'optimize',
- value: function optimize(context) {
- if (!this.domNode.textContent.endsWith('\n')) {
- this.appendChild(_parchment2.default.create('text', '\n'));
- }
- _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'optimize', this).call(this, context);
- var next = this.next;
- if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) {
- next.optimize(context);
- next.moveChildren(this);
- next.remove();
- }
- }
- }, {
- key: 'replace',
- value: function replace(target) {
- _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'replace', this).call(this, target);
- [].slice.call(this.domNode.querySelectorAll('*')).forEach(function (node) {
- var blot = _parchment2.default.find(node);
- if (blot == null) {
- node.parentNode.removeChild(node);
- } else if (blot instanceof _parchment2.default.Embed) {
- blot.remove();
- } else {
- blot.unwrap();
- }
- });
- }
- }], [{
- key: 'create',
- value: function create(value) {
- var domNode = _get(CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock), 'create', this).call(this, value);
- domNode.setAttribute('spellcheck', false);
- return domNode;
- }
- }, {
- key: 'formats',
- value: function formats() {
- return true;
- }
- }]);
-
- return CodeBlock;
- }(_block2.default);
-
- CodeBlock.blotName = 'code-block';
- CodeBlock.tagName = 'PRE';
- CodeBlock.TAB = ' ';
-
- exports.Code = Code;
- exports.default = CodeBlock;
-
- /***/
- }),
-/* 14 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
-
- var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _quillDelta = __webpack_require__(1);
-
- var _quillDelta2 = _interopRequireDefault(_quillDelta);
-
- var _op = __webpack_require__(22);
-
- var _op2 = _interopRequireDefault(_op);
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _code = __webpack_require__(13);
-
- var _code2 = _interopRequireDefault(_code);
-
- var _cursor = __webpack_require__(26);
-
- var _cursor2 = _interopRequireDefault(_cursor);
-
- var _block = __webpack_require__(4);
-
- var _block2 = _interopRequireDefault(_block);
-
- var _break = __webpack_require__(16);
-
- var _break2 = _interopRequireDefault(_break);
-
- var _clone = __webpack_require__(23);
-
- var _clone2 = _interopRequireDefault(_clone);
-
- var _deepEqual = __webpack_require__(11);
-
- var _deepEqual2 = _interopRequireDefault(_deepEqual);
-
- var _extend = __webpack_require__(3);
-
- var _extend2 = _interopRequireDefault(_extend);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- var ASCII = /^[ -~]*$/;
-
- var Editor = function () {
- function Editor(scroll) {
- _classCallCheck(this, Editor);
-
- this.scroll = scroll;
- this.delta = this.getDelta();
- }
-
- _createClass(Editor, [{
- key: 'applyDelta',
- value: function applyDelta(delta) {
- var _this = this;
-
- var consumeNextNewline = false;
- this.scroll.update();
- var scrollLength = this.scroll.length();
- this.scroll.batchStart();
- delta = normalizeDelta(delta);
- delta.reduce(function (index, op) {
- var length = op.retain || op.delete || op.insert.length || 1;
- var attributes = op.attributes || {};
- if (op.insert != null) {
- if (typeof op.insert === 'string') {
- var text = op.insert;
- if (text.endsWith('\n') && consumeNextNewline) {
- consumeNextNewline = false;
- text = text.slice(0, -1);
- }
- if (index >= scrollLength && !text.endsWith('\n')) {
- consumeNextNewline = true;
- }
- _this.scroll.insertAt(index, text);
-
- var _scroll$line = _this.scroll.line(index),
- _scroll$line2 = _slicedToArray(_scroll$line, 2),
- line = _scroll$line2[0],
- offset = _scroll$line2[1];
-
- var formats = (0, _extend2.default)({}, (0, _block.bubbleFormats)(line));
- if (line instanceof _block2.default) {
- var _line$descendant = line.descendant(_parchment2.default.Leaf, offset),
- _line$descendant2 = _slicedToArray(_line$descendant, 1),
- leaf = _line$descendant2[0];
-
- formats = (0, _extend2.default)(formats, (0, _block.bubbleFormats)(leaf));
- }
- attributes = _op2.default.attributes.diff(formats, attributes) || {};
- } else if (_typeof(op.insert) === 'object') {
- var key = Object.keys(op.insert)[0]; // There should only be one key
- if (key == null) return index;
- _this.scroll.insertAt(index, key, op.insert[key]);
- }
- scrollLength += length;
- }
- Object.keys(attributes).forEach(function (name) {
- _this.scroll.formatAt(index, length, name, attributes[name]);
- });
- return index + length;
- }, 0);
- delta.reduce(function (index, op) {
- if (typeof op.delete === 'number') {
- _this.scroll.deleteAt(index, op.delete);
- return index;
- }
- return index + (op.retain || op.insert.length || 1);
- }, 0);
- this.scroll.batchEnd();
- return this.update(delta);
- }
- }, {
- key: 'deleteText',
- value: function deleteText(index, length) {
- this.scroll.deleteAt(index, length);
- return this.update(new _quillDelta2.default().retain(index).delete(length));
- }
- }, {
- key: 'formatLine',
- value: function formatLine(index, length) {
- var _this2 = this;
-
- var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
-
- this.scroll.update();
- Object.keys(formats).forEach(function (format) {
- if (_this2.scroll.whitelist != null && !_this2.scroll.whitelist[format]) return;
- var lines = _this2.scroll.lines(index, Math.max(length, 1));
- var lengthRemaining = length;
- lines.forEach(function (line) {
- var lineLength = line.length();
- if (!(line instanceof _code2.default)) {
- line.format(format, formats[format]);
- } else {
- var codeIndex = index - line.offset(_this2.scroll);
- var codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1;
- line.formatAt(codeIndex, codeLength, format, formats[format]);
- }
- lengthRemaining -= lineLength;
- });
- });
- this.scroll.optimize();
- return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats)));
- }
- }, {
- key: 'formatText',
- value: function formatText(index, length) {
- var _this3 = this;
-
- var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
-
- Object.keys(formats).forEach(function (format) {
- _this3.scroll.formatAt(index, length, format, formats[format]);
- });
- return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats)));
- }
- }, {
- key: 'getContents',
- value: function getContents(index, length) {
- return this.delta.slice(index, index + length);
- }
- }, {
- key: 'getDelta',
- value: function getDelta() {
- return this.scroll.lines().reduce(function (delta, line) {
- return delta.concat(line.delta());
- }, new _quillDelta2.default());
- }
- }, {
- key: 'getFormat',
- value: function getFormat(index) {
- var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
-
- var lines = [],
- leaves = [];
- if (length === 0) {
- this.scroll.path(index).forEach(function (path) {
- var _path = _slicedToArray(path, 1),
- blot = _path[0];
-
- if (blot instanceof _block2.default) {
- lines.push(blot);
- } else if (blot instanceof _parchment2.default.Leaf) {
- leaves.push(blot);
- }
- });
- } else {
- lines = this.scroll.lines(index, length);
- leaves = this.scroll.descendants(_parchment2.default.Leaf, index, length);
- }
- var formatsArr = [lines, leaves].map(function (blots) {
- if (blots.length === 0) return {};
- var formats = (0, _block.bubbleFormats)(blots.shift());
- while (Object.keys(formats).length > 0) {
- var blot = blots.shift();
- if (blot == null) return formats;
- formats = combineFormats((0, _block.bubbleFormats)(blot), formats);
- }
- return formats;
- });
- return _extend2.default.apply(_extend2.default, formatsArr);
- }
- }, {
- key: 'getText',
- value: function getText(index, length) {
- return this.getContents(index, length).filter(function (op) {
- return typeof op.insert === 'string';
- }).map(function (op) {
- return op.insert;
- }).join('');
- }
- }, {
- key: 'insertEmbed',
- value: function insertEmbed(index, embed, value) {
- this.scroll.insertAt(index, embed, value);
- return this.update(new _quillDelta2.default().retain(index).insert(_defineProperty({}, embed, value)));
- }
- }, {
- key: 'insertText',
- value: function insertText(index, text) {
- var _this4 = this;
-
- var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
-
- text = text.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
- this.scroll.insertAt(index, text);
- Object.keys(formats).forEach(function (format) {
- _this4.scroll.formatAt(index, text.length, format, formats[format]);
- });
- return this.update(new _quillDelta2.default().retain(index).insert(text, (0, _clone2.default)(formats)));
- }
- }, {
- key: 'isBlank',
- value: function isBlank() {
- if (this.scroll.children.length == 0) return true;
- if (this.scroll.children.length > 1) return false;
- var block = this.scroll.children.head;
- if (block.statics.blotName !== _block2.default.blotName) return false;
- if (block.children.length > 1) return false;
- return block.children.head instanceof _break2.default;
- }
- }, {
- key: 'removeFormat',
- value: function removeFormat(index, length) {
- var text = this.getText(index, length);
-
- var _scroll$line3 = this.scroll.line(index + length),
- _scroll$line4 = _slicedToArray(_scroll$line3, 2),
- line = _scroll$line4[0],
- offset = _scroll$line4[1];
-
- var suffixLength = 0,
- suffix = new _quillDelta2.default();
- if (line != null) {
- if (!(line instanceof _code2.default)) {
- suffixLength = line.length() - offset;
- } else {
- suffixLength = line.newlineIndex(offset) - offset + 1;
- }
- suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\n');
- }
- var contents = this.getContents(index, length + suffixLength);
- var diff = contents.diff(new _quillDelta2.default().insert(text).concat(suffix));
- var delta = new _quillDelta2.default().retain(index).concat(diff);
- return this.applyDelta(delta);
- }
- }, {
- key: 'update',
- value: function update(change) {
- var mutations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- var cursorIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
-
- var oldDelta = this.delta;
- if (mutations.length === 1 && mutations[0].type === 'characterData' && mutations[0].target.data.match(ASCII) && _parchment2.default.find(mutations[0].target)) {
- // Optimization for character changes
- var textBlot = _parchment2.default.find(mutations[0].target);
- var formats = (0, _block.bubbleFormats)(textBlot);
- var index = textBlot.offset(this.scroll);
- var oldValue = mutations[0].oldValue.replace(_cursor2.default.CONTENTS, '');
- var oldText = new _quillDelta2.default().insert(oldValue);
- var newText = new _quillDelta2.default().insert(textBlot.value());
- var diffDelta = new _quillDelta2.default().retain(index).concat(oldText.diff(newText, cursorIndex));
- change = diffDelta.reduce(function (delta, op) {
- if (op.insert) {
- return delta.insert(op.insert, formats);
- } else {
- return delta.push(op);
- }
- }, new _quillDelta2.default());
- this.delta = oldDelta.compose(change);
- } else {
- this.delta = this.getDelta();
- if (!change || !(0, _deepEqual2.default)(oldDelta.compose(change), this.delta)) {
- change = oldDelta.diff(this.delta, cursorIndex);
- }
- }
- return change;
- }
- }]);
-
- return Editor;
- }();
-
- function combineFormats(formats, combined) {
- return Object.keys(combined).reduce(function (merged, name) {
- if (formats[name] == null) return merged;
- if (combined[name] === formats[name]) {
- merged[name] = combined[name];
- } else if (Array.isArray(combined[name])) {
- if (combined[name].indexOf(formats[name]) < 0) {
- merged[name] = combined[name].concat([formats[name]]);
- }
- } else {
- merged[name] = [combined[name], formats[name]];
- }
- return merged;
- }, {});
- }
-
- function normalizeDelta(delta) {
- return delta.reduce(function (delta, op) {
- if (op.insert === 1) {
- var attributes = (0, _clone2.default)(op.attributes);
- delete attributes['image'];
- return delta.insert({ image: op.attributes.image }, attributes);
- }
- if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) {
- op = (0, _clone2.default)(op);
- if (op.attributes.list) {
- op.attributes.list = 'ordered';
- } else {
- op.attributes.list = 'bullet';
- delete op.attributes.bullet;
- }
- }
- if (typeof op.insert === 'string') {
- var text = op.insert.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
- return delta.insert(text, op.attributes);
- }
- return delta.push(op);
- }, new _quillDelta2.default());
- }
-
- exports.default = Editor;
-
- /***/
- }),
-/* 15 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = exports.Range = undefined;
-
- var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _clone = __webpack_require__(23);
-
- var _clone2 = _interopRequireDefault(_clone);
-
- var _deepEqual = __webpack_require__(11);
-
- var _deepEqual2 = _interopRequireDefault(_deepEqual);
-
- var _emitter3 = __webpack_require__(8);
-
- var _emitter4 = _interopRequireDefault(_emitter3);
-
- var _logger = __webpack_require__(10);
-
- var _logger2 = _interopRequireDefault(_logger);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- var debug = (0, _logger2.default)('quill:selection');
-
- var Range = function Range(index) {
- var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
-
- _classCallCheck(this, Range);
-
- this.index = index;
- this.length = length;
- };
-
- var Selection = function () {
- function Selection(scroll, emitter) {
- var _this = this;
-
- _classCallCheck(this, Selection);
-
- this.emitter = emitter;
- this.scroll = scroll;
- this.composing = false;
- this.mouseDown = false;
- this.root = this.scroll.domNode;
- this.cursor = _parchment2.default.create('cursor', this);
- // savedRange is last non-null range
- this.lastRange = this.savedRange = new Range(0, 0);
- this.handleComposition();
- this.handleDragging();
- this.emitter.listenDOM('selectionchange', document, function () {
- if (!_this.mouseDown) {
- setTimeout(_this.update.bind(_this, _emitter4.default.sources.USER), 1);
- }
- });
- this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type, delta) {
- if (type === _emitter4.default.events.TEXT_CHANGE && delta.length() > 0) {
- _this.update(_emitter4.default.sources.SILENT);
- }
- });
- this.emitter.on(_emitter4.default.events.SCROLL_BEFORE_UPDATE, function () {
- if (!_this.hasFocus()) return;
- var native = _this.getNativeRange();
- if (native == null) return;
- if (native.start.node === _this.cursor.textNode) return; // cursor.restore() will handle
- // TODO unclear if this has negative side effects
- _this.emitter.once(_emitter4.default.events.SCROLL_UPDATE, function () {
- try {
- _this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset);
- } catch (ignored) { }
- });
- });
- this.emitter.on(_emitter4.default.events.SCROLL_OPTIMIZE, function (mutations, context) {
- if (context.range) {
- var _context$range = context.range,
- startNode = _context$range.startNode,
- startOffset = _context$range.startOffset,
- endNode = _context$range.endNode,
- endOffset = _context$range.endOffset;
-
- _this.setNativeRange(startNode, startOffset, endNode, endOffset);
- }
- });
- this.update(_emitter4.default.sources.SILENT);
- }
-
- _createClass(Selection, [{
- key: 'handleComposition',
- value: function handleComposition() {
- var _this2 = this;
-
- this.root.addEventListener('compositionstart', function () {
- _this2.composing = true;
- });
- this.root.addEventListener('compositionend', function () {
- _this2.composing = false;
- if (_this2.cursor.parent) {
- var range = _this2.cursor.restore();
- if (!range) return;
- setTimeout(function () {
- _this2.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset);
- }, 1);
- }
- });
- }
- }, {
- key: 'handleDragging',
- value: function handleDragging() {
- var _this3 = this;
-
- this.emitter.listenDOM('mousedown', document.body, function () {
- _this3.mouseDown = true;
- });
- this.emitter.listenDOM('mouseup', document.body, function () {
- _this3.mouseDown = false;
- _this3.update(_emitter4.default.sources.USER);
- });
- }
- }, {
- key: 'focus',
- value: function focus() {
- if (this.hasFocus()) return;
- this.root.focus();
- this.setRange(this.savedRange);
- }
- }, {
- key: 'format',
- value: function format(_format, value) {
- if (this.scroll.whitelist != null && !this.scroll.whitelist[_format]) return;
- this.scroll.update();
- var nativeRange = this.getNativeRange();
- if (nativeRange == null || !nativeRange.native.collapsed || _parchment2.default.query(_format, _parchment2.default.Scope.BLOCK)) return;
- if (nativeRange.start.node !== this.cursor.textNode) {
- var blot = _parchment2.default.find(nativeRange.start.node, false);
- if (blot == null) return;
- // TODO Give blot ability to not split
- if (blot instanceof _parchment2.default.Leaf) {
- var after = blot.split(nativeRange.start.offset);
- blot.parent.insertBefore(this.cursor, after);
- } else {
- blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen
- }
- this.cursor.attach();
- }
- this.cursor.format(_format, value);
- this.scroll.optimize();
- this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length);
- this.update();
- }
- }, {
- key: 'getBounds',
- value: function getBounds(index) {
- var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
-
- var scrollLength = this.scroll.length();
- index = Math.min(index, scrollLength - 1);
- length = Math.min(index + length, scrollLength - 1) - index;
- var node = void 0,
- _scroll$leaf = this.scroll.leaf(index),
- _scroll$leaf2 = _slicedToArray(_scroll$leaf, 2),
- leaf = _scroll$leaf2[0],
- offset = _scroll$leaf2[1];
- if (leaf == null) return null;
-
- var _leaf$position = leaf.position(offset, true);
-
- var _leaf$position2 = _slicedToArray(_leaf$position, 2);
-
- node = _leaf$position2[0];
- offset = _leaf$position2[1];
-
- var range = document.createRange();
- if (length > 0) {
- range.setStart(node, offset);
-
- var _scroll$leaf3 = this.scroll.leaf(index + length);
-
- var _scroll$leaf4 = _slicedToArray(_scroll$leaf3, 2);
-
- leaf = _scroll$leaf4[0];
- offset = _scroll$leaf4[1];
-
- if (leaf == null) return null;
-
- var _leaf$position3 = leaf.position(offset, true);
-
- var _leaf$position4 = _slicedToArray(_leaf$position3, 2);
-
- node = _leaf$position4[0];
- offset = _leaf$position4[1];
-
- range.setEnd(node, offset);
- return range.getBoundingClientRect();
- } else {
- var side = 'left';
- var rect = void 0;
- if (node instanceof Text) {
- if (offset < node.data.length) {
- range.setStart(node, offset);
- range.setEnd(node, offset + 1);
- } else {
- range.setStart(node, offset - 1);
- range.setEnd(node, offset);
- side = 'right';
- }
- rect = range.getBoundingClientRect();
- } else {
- rect = leaf.domNode.getBoundingClientRect();
- if (offset > 0) side = 'right';
- }
- return {
- bottom: rect.top + rect.height,
- height: rect.height,
- left: rect[side],
- right: rect[side],
- top: rect.top,
- width: 0
- };
- }
- }
- }, {
- key: 'getNativeRange',
- value: function getNativeRange() {
- var selection = document.getSelection();
- if (selection == null || selection.rangeCount <= 0) return null;
- var nativeRange = selection.getRangeAt(0);
- if (nativeRange == null) return null;
- var range = this.normalizeNative(nativeRange);
- debug.info('getNativeRange', range);
- return range;
- }
- }, {
- key: 'getRange',
- value: function getRange() {
- var normalized = this.getNativeRange();
- if (normalized == null) return [null, null];
- var range = this.normalizedToRange(normalized);
- return [range, normalized];
- }
- }, {
- key: 'hasFocus',
- value: function hasFocus() {
- return document.activeElement === this.root;
- }
- }, {
- key: 'normalizedToRange',
- value: function normalizedToRange(range) {
- var _this4 = this;
-
- var positions = [[range.start.node, range.start.offset]];
- if (!range.native.collapsed) {
- positions.push([range.end.node, range.end.offset]);
- }
- var indexes = positions.map(function (position) {
- var _position = _slicedToArray(position, 2),
- node = _position[0],
- offset = _position[1];
-
- var blot = _parchment2.default.find(node, true);
- var index = blot.offset(_this4.scroll);
- if (offset === 0) {
- return index;
- } else if (blot instanceof _parchment2.default.Container) {
- return index + blot.length();
- } else {
- return index + blot.index(node, offset);
- }
- });
- var end = Math.min(Math.max.apply(Math, _toConsumableArray(indexes)), this.scroll.length() - 1);
- var start = Math.min.apply(Math, [end].concat(_toConsumableArray(indexes)));
- return new Range(start, end - start);
- }
- }, {
- key: 'normalizeNative',
- value: function normalizeNative(nativeRange) {
- if (!contains(this.root, nativeRange.startContainer) || !nativeRange.collapsed && !contains(this.root, nativeRange.endContainer)) {
- return null;
- }
- var range = {
- start: { node: nativeRange.startContainer, offset: nativeRange.startOffset },
- end: { node: nativeRange.endContainer, offset: nativeRange.endOffset },
- native: nativeRange
- };
- [range.start, range.end].forEach(function (position) {
- var node = position.node,
- offset = position.offset;
- while (!(node instanceof Text) && node.childNodes.length > 0) {
- if (node.childNodes.length > offset) {
- node = node.childNodes[offset];
- offset = 0;
- } else if (node.childNodes.length === offset) {
- node = node.lastChild;
- offset = node instanceof Text ? node.data.length : node.childNodes.length + 1;
- } else {
- break;
- }
- }
- position.node = node, position.offset = offset;
- });
- return range;
- }
- }, {
- key: 'rangeToNative',
- value: function rangeToNative(range) {
- var _this5 = this;
-
- var indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length];
- var args = [];
- var scrollLength = this.scroll.length();
- indexes.forEach(function (index, i) {
- index = Math.min(scrollLength - 1, index);
- var node = void 0,
- _scroll$leaf5 = _this5.scroll.leaf(index),
- _scroll$leaf6 = _slicedToArray(_scroll$leaf5, 2),
- leaf = _scroll$leaf6[0],
- offset = _scroll$leaf6[1];
- var _leaf$position5 = leaf.position(offset, i !== 0);
-
- var _leaf$position6 = _slicedToArray(_leaf$position5, 2);
-
- node = _leaf$position6[0];
- offset = _leaf$position6[1];
-
- args.push(node, offset);
- });
- if (args.length < 2) {
- args = args.concat(args);
- }
- return args;
- }
- }, {
- key: 'scrollIntoView',
- value: function scrollIntoView(scrollingContainer) {
- var range = this.lastRange;
- if (range == null) return;
- var bounds = this.getBounds(range.index, range.length);
- if (bounds == null) return;
- var limit = this.scroll.length() - 1;
-
- var _scroll$line = this.scroll.line(Math.min(range.index, limit)),
- _scroll$line2 = _slicedToArray(_scroll$line, 1),
- first = _scroll$line2[0];
-
- var last = first;
- if (range.length > 0) {
- var _scroll$line3 = this.scroll.line(Math.min(range.index + range.length, limit));
-
- var _scroll$line4 = _slicedToArray(_scroll$line3, 1);
-
- last = _scroll$line4[0];
- }
- if (first == null || last == null) return;
- var scrollBounds = scrollingContainer.getBoundingClientRect();
- if (bounds.top < scrollBounds.top) {
- scrollingContainer.scrollTop -= scrollBounds.top - bounds.top;
- } else if (bounds.bottom > scrollBounds.bottom) {
- scrollingContainer.scrollTop += bounds.bottom - scrollBounds.bottom;
- }
- }
- }, {
- key: 'setNativeRange',
- value: function setNativeRange(startNode, startOffset) {
- var endNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : startNode;
- var endOffset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : startOffset;
- var force = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
-
- debug.info('setNativeRange', startNode, startOffset, endNode, endOffset);
- if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) {
- return;
- }
- var selection = document.getSelection();
- if (selection == null) return;
- if (startNode != null) {
- if (!this.hasFocus()) this.root.focus();
- var native = (this.getNativeRange() || {}).native;
- if (native == null || force || startNode !== native.startContainer || startOffset !== native.startOffset || endNode !== native.endContainer || endOffset !== native.endOffset) {
-
- if (startNode.tagName == "BR") {
- startOffset = [].indexOf.call(startNode.parentNode.childNodes, startNode);
- startNode = startNode.parentNode;
- }
- if (endNode.tagName == "BR") {
- endOffset = [].indexOf.call(endNode.parentNode.childNodes, endNode);
- endNode = endNode.parentNode;
- }
- var range = document.createRange();
- range.setStart(startNode, startOffset);
- range.setEnd(endNode, endOffset);
- selection.removeAllRanges();
- selection.addRange(range);
- }
- } else {
- selection.removeAllRanges();
- this.root.blur();
- document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs)
- }
- }
- }, {
- key: 'setRange',
- value: function setRange(range) {
- var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API;
-
- if (typeof force === 'string') {
- source = force;
- force = false;
- }
- debug.info('setRange', range);
- if (range != null) {
- var args = this.rangeToNative(range);
- this.setNativeRange.apply(this, _toConsumableArray(args).concat([force]));
- } else {
- this.setNativeRange(null);
- }
- this.update(source);
- }
- }, {
- key: 'update',
- value: function update() {
- var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER;
-
- var oldRange = this.lastRange;
-
- var _getRange = this.getRange(),
- _getRange2 = _slicedToArray(_getRange, 2),
- lastRange = _getRange2[0],
- nativeRange = _getRange2[1];
-
- this.lastRange = lastRange;
- if (this.lastRange != null) {
- this.savedRange = this.lastRange;
- }
- if (!(0, _deepEqual2.default)(oldRange, this.lastRange)) {
- var _emitter;
-
- if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) {
- this.cursor.restore();
- }
- var args = [_emitter4.default.events.SELECTION_CHANGE, (0, _clone2.default)(this.lastRange), (0, _clone2.default)(oldRange), source];
- (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));
- if (source !== _emitter4.default.sources.SILENT) {
- var _emitter2;
-
- (_emitter2 = this.emitter).emit.apply(_emitter2, args);
- }
- }
- }
- }]);
-
- return Selection;
- }();
-
- function contains(parent, descendant) {
- try {
- // Firefox inserts inaccessible nodes around video elements
- descendant.parentNode;
- } catch (e) {
- return false;
- }
- // IE11 has bug with Text nodes
- // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect
- if (descendant instanceof Text) {
- descendant = descendant.parentNode;
- }
- return parent.contains(descendant);
- }
-
- exports.Range = Range;
- exports.default = Selection;
-
- /***/
- }),
-/* 16 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var Break = function (_Parchment$Embed) {
- _inherits(Break, _Parchment$Embed);
-
- function Break() {
- _classCallCheck(this, Break);
-
- return _possibleConstructorReturn(this, (Break.__proto__ || Object.getPrototypeOf(Break)).apply(this, arguments));
- }
-
- _createClass(Break, [{
- key: 'insertInto',
- value: function insertInto(parent, ref) {
- if (parent.children.length === 0) {
- _get(Break.prototype.__proto__ || Object.getPrototypeOf(Break.prototype), 'insertInto', this).call(this, parent, ref);
- } else {
- this.remove();
- }
- }
- }, {
- key: 'length',
- value: function length() {
- return 0;
- }
- }, {
- key: 'value',
- value: function value() {
- return '';
- }
- }], [{
- key: 'value',
- value: function value() {
- return undefined;
- }
- }]);
-
- return Break;
- }(_parchment2.default.Embed);
-
- Break.blotName = 'break';
- Break.tagName = 'BR';
-
- exports.default = Break;
-
- /***/
- }),
-/* 17 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var linked_list_1 = __webpack_require__(50);
- var shadow_1 = __webpack_require__(32);
- var Registry = __webpack_require__(2);
- var ContainerBlot = /** @class */ (function (_super) {
- __extends(ContainerBlot, _super);
- function ContainerBlot(domNode) {
- var _this = _super.call(this, domNode) || this;
- _this.build();
- return _this;
- }
- ContainerBlot.prototype.appendChild = function (other) {
- this.insertBefore(other);
- };
- ContainerBlot.prototype.attach = function () {
- _super.prototype.attach.call(this);
- this.children.forEach(function (child) {
- child.attach();
- });
- };
- ContainerBlot.prototype.build = function () {
- var _this = this;
- this.children = new linked_list_1.default();
- // Need to be reversed for if DOM nodes already in order
- [].slice
- .call(this.domNode.childNodes)
- .reverse()
- .forEach(function (node) {
- try {
- var child = makeBlot(node);
- _this.insertBefore(child, _this.children.head || undefined);
- }
- catch (err) {
- if (err instanceof Registry.ParchmentError)
- return;
- else
- throw err;
- }
- });
- };
- ContainerBlot.prototype.deleteAt = function (index, length) {
- if (index === 0 && length === this.length()) {
- return this.remove();
- }
- this.children.forEachAt(index, length, function (child, offset, length) {
- child.deleteAt(offset, length);
- });
- };
- ContainerBlot.prototype.descendant = function (criteria, index) {
- var _a = this.children.find(index), child = _a[0], offset = _a[1];
- if ((criteria.blotName == null && criteria(child)) ||
- (criteria.blotName != null && child instanceof criteria)) {
- return [child, offset];
- }
- else if (child instanceof ContainerBlot) {
- return child.descendant(criteria, offset);
- }
- else {
- return [null, -1];
- }
- };
- ContainerBlot.prototype.descendants = function (criteria, index, length) {
- if (index === void 0) { index = 0; }
- if (length === void 0) { length = Number.MAX_VALUE; }
- var descendants = [];
- var lengthLeft = length;
- this.children.forEachAt(index, length, function (child, index, length) {
- if ((criteria.blotName == null && criteria(child)) ||
- (criteria.blotName != null && child instanceof criteria)) {
- descendants.push(child);
- }
- if (child instanceof ContainerBlot) {
- descendants = descendants.concat(child.descendants(criteria, index, lengthLeft));
- }
- lengthLeft -= length;
- });
- return descendants;
- };
- ContainerBlot.prototype.detach = function () {
- this.children.forEach(function (child) {
- child.detach();
- });
- _super.prototype.detach.call(this);
- };
- ContainerBlot.prototype.formatAt = function (index, length, name, value) {
- this.children.forEachAt(index, length, function (child, offset, length) {
- child.formatAt(offset, length, name, value);
- });
- };
- ContainerBlot.prototype.insertAt = function (index, value, def) {
- var _a = this.children.find(index), child = _a[0], offset = _a[1];
- if (child) {
- child.insertAt(offset, value, def);
- }
- else {
- var blot = def == null ? Registry.create('text', value) : Registry.create(value, def);
- this.appendChild(blot);
- }
- };
- ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) {
- if (this.statics.allowedChildren != null &&
- !this.statics.allowedChildren.some(function (child) {
- return childBlot instanceof child;
- })) {
- throw new Registry.ParchmentError("Cannot insert " + childBlot.statics.blotName + " into " + this.statics.blotName);
- }
- childBlot.insertInto(this, refBlot);
- };
- ContainerBlot.prototype.length = function () {
- return this.children.reduce(function (memo, child) {
- return memo + child.length();
- }, 0);
- };
- ContainerBlot.prototype.moveChildren = function (targetParent, refNode) {
- this.children.forEach(function (child) {
- targetParent.insertBefore(child, refNode);
- });
- };
- ContainerBlot.prototype.optimize = function (context) {
- _super.prototype.optimize.call(this, context);
- if (this.children.length === 0) {
- if (this.statics.defaultChild != null) {
- var child = Registry.create(this.statics.defaultChild);
- this.appendChild(child);
- child.optimize(context);
- }
- else {
- this.remove();
- }
- }
- };
- ContainerBlot.prototype.path = function (index, inclusive) {
- if (inclusive === void 0) { inclusive = false; }
- var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1];
- var position = [[this, index]];
- if (child instanceof ContainerBlot) {
- return position.concat(child.path(offset, inclusive));
- }
- else if (child != null) {
- position.push([child, offset]);
- }
- return position;
- };
- ContainerBlot.prototype.removeChild = function (child) {
- this.children.remove(child);
- };
- ContainerBlot.prototype.replace = function (target) {
- if (target instanceof ContainerBlot) {
- target.moveChildren(this);
- }
- _super.prototype.replace.call(this, target);
- };
- ContainerBlot.prototype.split = function (index, force) {
- if (force === void 0) { force = false; }
- if (!force) {
- if (index === 0)
- return this;
- if (index === this.length())
- return this.next;
- }
- var after = this.clone();
- this.parent.insertBefore(after, this.next);
- this.children.forEachAt(index, this.length(), function (child, offset, length) {
- child = child.split(offset, force);
- after.appendChild(child);
- });
- return after;
- };
- ContainerBlot.prototype.unwrap = function () {
- this.moveChildren(this.parent, this.next);
- this.remove();
- };
- ContainerBlot.prototype.update = function (mutations, context) {
- var _this = this;
- var addedNodes = [];
- var removedNodes = [];
- mutations.forEach(function (mutation) {
- if (mutation.target === _this.domNode && mutation.type === 'childList') {
- addedNodes.push.apply(addedNodes, mutation.addedNodes);
- removedNodes.push.apply(removedNodes, mutation.removedNodes);
- }
- });
- removedNodes.forEach(function (node) {
- // Check node has actually been removed
- // One exception is Chrome does not immediately remove IFRAMEs
- // from DOM but MutationRecord is correct in its reported removal
- if (node.parentNode != null &&
- // @ts-ignore
- node.tagName !== 'IFRAME' &&
- document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {
- return;
- }
- var blot = Registry.find(node);
- if (blot == null)
- return;
- if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) {
- blot.detach();
- }
- });
- addedNodes
- .filter(function (node) {
- return node.parentNode == _this.domNode;
- })
- .sort(function (a, b) {
- if (a === b)
- return 0;
- if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) {
- return 1;
- }
- return -1;
- })
- .forEach(function (node) {
- var refBlot = null;
- if (node.nextSibling != null) {
- refBlot = Registry.find(node.nextSibling);
- }
- var blot = makeBlot(node);
- if (blot.next != refBlot || blot.next == null) {
- if (blot.parent != null) {
- blot.parent.removeChild(_this);
- }
- _this.insertBefore(blot, refBlot || undefined);
- }
- });
- };
- return ContainerBlot;
- }(shadow_1.default));
- function makeBlot(node) {
- var blot = Registry.find(node);
- if (blot == null) {
- try {
- blot = Registry.create(node);
- }
- catch (e) {
- blot = Registry.create(Registry.Scope.INLINE);
- [].slice.call(node.childNodes).forEach(function (child) {
- // @ts-ignore
- blot.domNode.appendChild(child);
- });
- if (node.parentNode) {
- node.parentNode.replaceChild(blot.domNode, node);
- }
- blot.attach();
- }
- }
- return blot;
- }
- exports.default = ContainerBlot;
-
-
- /***/
- }),
-/* 18 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var attributor_1 = __webpack_require__(12);
- var store_1 = __webpack_require__(33);
- var container_1 = __webpack_require__(17);
- var Registry = __webpack_require__(2);
- var FormatBlot = /** @class */ (function (_super) {
- __extends(FormatBlot, _super);
- function FormatBlot(domNode) {
- var _this = _super.call(this, domNode) || this;
- _this.attributes = new store_1.default(_this.domNode);
- return _this;
- }
- FormatBlot.formats = function (domNode) {
- if (typeof this.tagName === 'string') {
- return true;
- }
- else if (Array.isArray(this.tagName)) {
- return domNode.tagName.toLowerCase();
- }
- return undefined;
- };
- FormatBlot.prototype.format = function (name, value) {
- var format = Registry.query(name);
- if (format instanceof attributor_1.default) {
- this.attributes.attribute(format, value);
- }
- else if (value) {
- if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) {
- this.replaceWith(name, value);
- }
- }
- };
- FormatBlot.prototype.formats = function () {
- var formats = this.attributes.values();
- var format = this.statics.formats(this.domNode);
- if (format != null) {
- formats[this.statics.blotName] = format;
- }
- return formats;
- };
- FormatBlot.prototype.replaceWith = function (name, value) {
- var replacement = _super.prototype.replaceWith.call(this, name, value);
- this.attributes.copy(replacement);
- return replacement;
- };
- FormatBlot.prototype.update = function (mutations, context) {
- var _this = this;
- _super.prototype.update.call(this, mutations, context);
- if (mutations.some(function (mutation) {
- return mutation.target === _this.domNode && mutation.type === 'attributes';
- })) {
- this.attributes.build();
- }
- };
- FormatBlot.prototype.wrap = function (name, value) {
- var wrapper = _super.prototype.wrap.call(this, name, value);
- if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) {
- this.attributes.move(wrapper);
- }
- return wrapper;
- };
- return FormatBlot;
- }(container_1.default));
- exports.default = FormatBlot;
-
-
- /***/
- }),
-/* 19 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var shadow_1 = __webpack_require__(32);
- var Registry = __webpack_require__(2);
- var LeafBlot = /** @class */ (function (_super) {
- __extends(LeafBlot, _super);
- function LeafBlot() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- LeafBlot.value = function (domNode) {
- return true;
- };
- LeafBlot.prototype.index = function (node, offset) {
- if (this.domNode === node ||
- this.domNode.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {
- return Math.min(offset, 1);
- }
- return -1;
- };
- LeafBlot.prototype.position = function (index, inclusive) {
- var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode);
- if (index > 0)
- offset += 1;
- return [this.parent.domNode, offset];
- };
- LeafBlot.prototype.value = function () {
- var _a;
- return _a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a;
- };
- LeafBlot.scope = Registry.Scope.INLINE_BLOT;
- return LeafBlot;
- }(shadow_1.default));
- exports.default = LeafBlot;
-
-
- /***/
- }),
-/* 20 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var implementation = __webpack_require__(63);
-
- module.exports = Function.prototype.bind || implementation;
-
-
- /***/
- }),
-/* 21 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var keys = __webpack_require__(36);
- var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
-
- var toStr = Object.prototype.toString;
- var concat = Array.prototype.concat;
- var origDefineProperty = Object.defineProperty;
-
- var isFunction = function (fn) {
- return typeof fn === 'function' && toStr.call(fn) === '[object Function]';
- };
-
- var arePropertyDescriptorsSupported = function () {
- var obj = {};
- try {
- origDefineProperty(obj, 'x', { enumerable: false, value: obj });
- // eslint-disable-next-line no-unused-vars, no-restricted-syntax
- for (var _ in obj) { // jscs:ignore disallowUnusedVariables
- return false;
- }
- return obj.x === obj;
- } catch (e) { /* this is IE 8. */
- return false;
- }
- };
- var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();
-
- var defineProperty = function (object, name, value, predicate) {
- if (name in object && (!isFunction(predicate) || !predicate())) {
- return;
- }
- if (supportsDescriptors) {
- origDefineProperty(object, name, {
- configurable: true,
- enumerable: false,
- value: value,
- writable: true
- });
- } else {
- object[name] = value;
- }
- };
-
- var defineProperties = function (object, map) {
- var predicates = arguments.length > 2 ? arguments[2] : {};
- var props = keys(map);
- if (hasSymbols) {
- props = concat.call(props, Object.getOwnPropertySymbols(map));
- }
- for (var i = 0; i < props.length; i += 1) {
- defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
- }
- };
-
- defineProperties.supportsDescriptors = !!supportsDescriptors;
-
- module.exports = defineProperties;
-
-
- /***/
- }),
-/* 22 */
-/***/ (function (module, exports, __webpack_require__) {
-
- var equal = __webpack_require__(11);
- var extend = __webpack_require__(3);
-
-
- var lib = {
- attributes: {
- compose: function (a, b, keepNull) {
- if (typeof a !== 'object') a = {};
- if (typeof b !== 'object') b = {};
- var attributes = extend(true, {}, b);
- if (!keepNull) {
- attributes = Object.keys(attributes).reduce(function (copy, key) {
- if (attributes[key] != null) {
- copy[key] = attributes[key];
- }
- return copy;
- }, {});
- }
- for (var key in a) {
- if (a[key] !== undefined && b[key] === undefined) {
- attributes[key] = a[key];
- }
- }
- return Object.keys(attributes).length > 0 ? attributes : undefined;
- },
-
- diff: function (a, b) {
- if (typeof a !== 'object') a = {};
- if (typeof b !== 'object') b = {};
- var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) {
- if (!equal(a[key], b[key])) {
- attributes[key] = b[key] === undefined ? null : b[key];
- }
- return attributes;
- }, {});
- return Object.keys(attributes).length > 0 ? attributes : undefined;
- },
-
- transform: function (a, b, priority) {
- if (typeof a !== 'object') return b;
- if (typeof b !== 'object') return undefined;
- if (!priority) return b; // b simply overwrites us without priority
- var attributes = Object.keys(b).reduce(function (attributes, key) {
- if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value
- return attributes;
- }, {});
- return Object.keys(attributes).length > 0 ? attributes : undefined;
- }
- },
-
- iterator: function (ops) {
- return new Iterator(ops);
- },
-
- length: function (op) {
- if (typeof op['delete'] === 'number') {
- return op['delete'];
- } else if (typeof op.retain === 'number') {
- return op.retain;
- } else {
- return typeof op.insert === 'string' ? op.insert.length : 1;
- }
- }
- };
-
-
- function Iterator(ops) {
- this.ops = ops;
- this.index = 0;
- this.offset = 0;
- };
-
- Iterator.prototype.hasNext = function () {
- return this.peekLength() < Infinity;
- };
-
- Iterator.prototype.next = function (length) {
- if (!length) length = Infinity;
- var nextOp = this.ops[this.index];
- if (nextOp) {
- var offset = this.offset;
- var opLength = lib.length(nextOp)
- if (length >= opLength - offset) {
- length = opLength - offset;
- this.index += 1;
- this.offset = 0;
- } else {
- this.offset += length;
- }
- if (typeof nextOp['delete'] === 'number') {
- return { 'delete': length };
- } else {
- var retOp = {};
- if (nextOp.attributes) {
- retOp.attributes = nextOp.attributes;
- }
- if (typeof nextOp.retain === 'number') {
- retOp.retain = length;
- } else if (typeof nextOp.insert === 'string') {
- retOp.insert = nextOp.insert.substr(offset, length);
- } else {
- // offset should === 0, length should === 1
- retOp.insert = nextOp.insert;
- }
- return retOp;
- }
- } else {
- return { retain: Infinity };
- }
- };
-
- Iterator.prototype.peek = function () {
- return this.ops[this.index];
- };
-
- Iterator.prototype.peekLength = function () {
- if (this.ops[this.index]) {
- // Should never return 0 if our index is being managed correctly
- return lib.length(this.ops[this.index]) - this.offset;
- } else {
- return Infinity;
- }
- };
-
- Iterator.prototype.peekType = function () {
- if (this.ops[this.index]) {
- if (typeof this.ops[this.index]['delete'] === 'number') {
- return 'delete';
- } else if (typeof this.ops[this.index].retain === 'number') {
- return 'retain';
- } else {
- return 'insert';
- }
- }
- return 'retain';
- };
-
- Iterator.prototype.rest = function () {
- if (!this.hasNext()) {
- return [];
- } else if (this.offset === 0) {
- return this.ops.slice(this.index);
- } else {
- var offset = this.offset;
- var index = this.index;
- var next = this.next();
- var rest = this.ops.slice(this.index);
- this.offset = offset;
- this.index = index;
- return [next].concat(rest);
- }
- };
-
-
- module.exports = lib;
-
-
- /***/
- }),
-/* 23 */
-/***/ (function (module, exports) {
-
- var clone = (function () {
- 'use strict';
-
- function _instanceof(obj, type) {
- return type != null && obj instanceof type;
- }
-
- var nativeMap;
- try {
- nativeMap = Map;
- } catch (_) {
- // maybe a reference error because no `Map`. Give it a dummy value that no
- // value will ever be an instanceof.
- nativeMap = function () { };
- }
-
- var nativeSet;
- try {
- nativeSet = Set;
- } catch (_) {
- nativeSet = function () { };
- }
-
- var nativePromise;
- try {
- nativePromise = Promise;
- } catch (_) {
- nativePromise = function () { };
- }
-
- /**
- * Clones (copies) an Object using deep copying.
- *
- * This function supports circular references by default, but if you are certain
- * there are no circular references in your object, you can save some CPU time
- * by calling clone(obj, false).
- *
- * Caution: if `circular` is false and `parent` contains circular references,
- * your program may enter an infinite loop and crash.
- *
- * @param `parent` - the object to be cloned
- * @param `circular` - set to true if the object to be cloned may contain
- * circular references. (optional - true by default)
- * @param `depth` - set to a number if the object is only to be cloned to
- * a particular depth. (optional - defaults to Infinity)
- * @param `prototype` - sets the prototype to be used when cloning an object.
- * (optional - defaults to parent prototype).
- * @param `includeNonEnumerable` - set to true if the non-enumerable properties
- * should be cloned as well. Non-enumerable properties on the prototype
- * chain will be ignored. (optional - false by default)
- */
- function clone(parent, circular, depth, prototype, includeNonEnumerable) {
- if (typeof circular === 'object') {
- depth = circular.depth;
- prototype = circular.prototype;
- includeNonEnumerable = circular.includeNonEnumerable;
- circular = circular.circular;
- }
- // maintain two arrays for circular references, where corresponding parents
- // and children have the same index
- var allParents = [];
- var allChildren = [];
-
- var useBuffer = typeof Buffer != 'undefined';
-
- if (typeof circular == 'undefined')
- circular = true;
-
- if (typeof depth == 'undefined')
- depth = Infinity;
-
- // recurse this function so we don't reset allParents and allChildren
- function _clone(parent, depth) {
- // cloning null always returns null
- if (parent === null)
- return null;
-
- if (depth === 0)
- return parent;
-
- var child;
- var proto;
- if (typeof parent != 'object') {
- return parent;
- }
-
- if (_instanceof(parent, nativeMap)) {
- child = new nativeMap();
- } else if (_instanceof(parent, nativeSet)) {
- child = new nativeSet();
- } else if (_instanceof(parent, nativePromise)) {
- child = new nativePromise(function (resolve, reject) {
- parent.then(function (value) {
- resolve(_clone(value, depth - 1));
- }, function (err) {
- reject(_clone(err, depth - 1));
- });
- });
- } else if (clone.__isArray(parent)) {
- child = [];
- } else if (clone.__isRegExp(parent)) {
- child = new RegExp(parent.source, __getRegExpFlags(parent));
- if (parent.lastIndex) child.lastIndex = parent.lastIndex;
- } else if (clone.__isDate(parent)) {
- child = new Date(parent.getTime());
- } else if (useBuffer && Buffer.isBuffer(parent)) {
- if (Buffer.allocUnsafe) {
- // Node.js >= 4.5.0
- child = Buffer.allocUnsafe(parent.length);
- } else {
- // Older Node.js versions
- child = new Buffer(parent.length);
- }
- parent.copy(child);
- return child;
- } else if (_instanceof(parent, Error)) {
- child = Object.create(parent);
- } else {
- if (typeof prototype == 'undefined') {
- proto = Object.getPrototypeOf(parent);
- child = Object.create(proto);
- }
- else {
- child = Object.create(prototype);
- proto = prototype;
- }
- }
-
- if (circular) {
- var index = allParents.indexOf(parent);
-
- if (index != -1) {
- return allChildren[index];
- }
- allParents.push(parent);
- allChildren.push(child);
- }
-
- if (_instanceof(parent, nativeMap)) {
- parent.forEach(function (value, key) {
- var keyChild = _clone(key, depth - 1);
- var valueChild = _clone(value, depth - 1);
- child.set(keyChild, valueChild);
- });
- }
- if (_instanceof(parent, nativeSet)) {
- parent.forEach(function (value) {
- var entryChild = _clone(value, depth - 1);
- child.add(entryChild);
- });
- }
-
- for (var i in parent) {
- var attrs;
- if (proto) {
- attrs = Object.getOwnPropertyDescriptor(proto, i);
- }
-
- if (attrs && attrs.set == null) {
- continue;
- }
- child[i] = _clone(parent[i], depth - 1);
- }
-
- if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(parent);
- for (var i = 0; i < symbols.length; i++) {
- // Don't need to worry about cloning a symbol because it is a primitive,
- // like a number or string.
- var symbol = symbols[i];
- var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);
- if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {
- continue;
- }
- child[symbol] = _clone(parent[symbol], depth - 1);
- if (!descriptor.enumerable) {
- Object.defineProperty(child, symbol, {
- enumerable: false
- });
- }
- }
- }
-
- if (includeNonEnumerable) {
- var allPropertyNames = Object.getOwnPropertyNames(parent);
- for (var i = 0; i < allPropertyNames.length; i++) {
- var propertyName = allPropertyNames[i];
- var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);
- if (descriptor && descriptor.enumerable) {
- continue;
- }
- child[propertyName] = _clone(parent[propertyName], depth - 1);
- Object.defineProperty(child, propertyName, {
- enumerable: false
- });
- }
- }
-
- return child;
- }
-
- return _clone(parent, depth);
- }
-
- /**
- * Simple flat clone using prototype, accepts only objects, usefull for property
- * override on FLAT configuration object (no nested props).
- *
- * USE WITH CAUTION! This may not behave as you wish if you do not know how this
- * works.
- */
- clone.clonePrototype = function clonePrototype(parent) {
- if (parent === null)
- return null;
-
- var c = function () { };
- c.prototype = parent;
- return new c();
- };
-
- // private utility functions
-
- function __objToStr(o) {
- return Object.prototype.toString.call(o);
- }
- clone.__objToStr = __objToStr;
-
- function __isDate(o) {
- return typeof o === 'object' && __objToStr(o) === '[object Date]';
- }
- clone.__isDate = __isDate;
-
- function __isArray(o) {
- return typeof o === 'object' && __objToStr(o) === '[object Array]';
- }
- clone.__isArray = __isArray;
-
- function __isRegExp(o) {
- return typeof o === 'object' && __objToStr(o) === '[object RegExp]';
- }
- clone.__isRegExp = __isRegExp;
-
- function __getRegExpFlags(re) {
- var flags = '';
- if (re.global) flags += 'g';
- if (re.ignoreCase) flags += 'i';
- if (re.multiline) flags += 'm';
- return flags;
- }
- clone.__getRegExpFlags = __getRegExpFlags;
-
- return clone;
- })();
-
- if (typeof module === 'object' && module.exports) {
- module.exports = clone;
- }
-
-
- /***/
- }),
-/* 24 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _emitter = __webpack_require__(8);
-
- var _emitter2 = _interopRequireDefault(_emitter);
-
- var _block = __webpack_require__(4);
-
- var _block2 = _interopRequireDefault(_block);
-
- var _break = __webpack_require__(16);
-
- var _break2 = _interopRequireDefault(_break);
-
- var _code = __webpack_require__(13);
-
- var _code2 = _interopRequireDefault(_code);
-
- var _container = __webpack_require__(27);
-
- var _container2 = _interopRequireDefault(_container);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- function isLine(blot) {
- return blot instanceof _block2.default || blot instanceof _block.BlockEmbed;
- }
-
- var Scroll = function (_Parchment$Scroll) {
- _inherits(Scroll, _Parchment$Scroll);
-
- function Scroll(domNode, config) {
- _classCallCheck(this, Scroll);
-
- var _this = _possibleConstructorReturn(this, (Scroll.__proto__ || Object.getPrototypeOf(Scroll)).call(this, domNode));
-
- _this.emitter = config.emitter;
- if (Array.isArray(config.whitelist)) {
- _this.whitelist = config.whitelist.reduce(function (whitelist, format) {
- whitelist[format] = true;
- return whitelist;
- }, {});
- }
- // Some reason fixes composition issues with character languages in Windows/Chrome, Safari
- _this.domNode.addEventListener('DOMNodeInserted', function () { });
- _this.optimize();
- _this.enable();
- return _this;
- }
-
- _createClass(Scroll, [{
- key: 'batchStart',
- value: function batchStart() {
- this.batch = true;
- }
- }, {
- key: 'batchEnd',
- value: function batchEnd() {
- this.batch = false;
- this.optimize();
- }
- }, {
- key: 'deleteAt',
- value: function deleteAt(index, length) {
- var _line = this.line(index),
- _line2 = _slicedToArray(_line, 2),
- first = _line2[0],
- offset = _line2[1];
-
- var _line3 = this.line(index + length),
- _line4 = _slicedToArray(_line3, 1),
- last = _line4[0];
-
- _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'deleteAt', this).call(this, index, length);
- if (last != null && first !== last && offset > 0) {
- if (first instanceof _block.BlockEmbed || last instanceof _block.BlockEmbed) {
- this.optimize();
- return;
- }
- if (first instanceof _code2.default) {
- var newlineIndex = first.newlineIndex(first.length(), true);
- if (newlineIndex > -1) {
- first = first.split(newlineIndex + 1);
- if (first === last) {
- this.optimize();
- return;
- }
- }
- } else if (last instanceof _code2.default) {
- var _newlineIndex = last.newlineIndex(0);
- if (_newlineIndex > -1) {
- last.split(_newlineIndex + 1);
- }
- }
- var ref = last.children.head instanceof _break2.default ? null : last.children.head;
- first.moveChildren(last, ref);
- first.remove();
- }
- this.optimize();
- }
- }, {
- key: 'enable',
- value: function enable() {
- var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
-
- this.domNode.setAttribute('contenteditable', enabled);
- }
- }, {
- key: 'formatAt',
- value: function formatAt(index, length, format, value) {
- if (this.whitelist != null && !this.whitelist[format]) return;
- _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'formatAt', this).call(this, index, length, format, value);
- this.optimize();
- }
- }, {
- key: 'insertAt',
- value: function insertAt(index, value, def) {
- if (def != null && this.whitelist != null && !this.whitelist[value]) return;
- if (index >= this.length()) {
- if (def == null || _parchment2.default.query(value, _parchment2.default.Scope.BLOCK) == null) {
- var blot = _parchment2.default.create(this.statics.defaultChild);
- this.appendChild(blot);
- if (def == null && value.endsWith('\n')) {
- value = value.slice(0, -1);
- }
- blot.insertAt(0, value, def);
- } else {
- var embed = _parchment2.default.create(value, def);
- this.appendChild(embed);
- }
- } else {
- _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertAt', this).call(this, index, value, def);
- }
- this.optimize();
- }
- }, {
- key: 'insertBefore',
- value: function insertBefore(blot, ref) {
- if (blot.statics.scope === _parchment2.default.Scope.INLINE_BLOT) {
- var wrapper = _parchment2.default.create(this.statics.defaultChild);
- wrapper.appendChild(blot);
- blot = wrapper;
- }
- _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertBefore', this).call(this, blot, ref);
- }
- }, {
- key: 'leaf',
- value: function leaf(index) {
- return this.path(index).pop() || [null, -1];
- }
- }, {
- key: 'line',
- value: function line(index) {
- if (index === this.length()) {
- return this.line(index - 1);
- }
- return this.descendant(isLine, index);
- }
- }, {
- key: 'lines',
- value: function lines() {
- var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
- var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE;
-
- var getLines = function getLines(blot, index, length) {
- var lines = [],
- lengthLeft = length;
- blot.children.forEachAt(index, length, function (child, index, length) {
- if (isLine(child)) {
- lines.push(child);
- } else if (child instanceof _parchment2.default.Container) {
- lines = lines.concat(getLines(child, index, lengthLeft));
- }
- lengthLeft -= length;
- });
- return lines;
- };
- return getLines(this, index, length);
- }
- }, {
- key: 'optimize',
- value: function optimize() {
- var mutations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
- var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
-
- if (this.batch === true) return;
- _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'optimize', this).call(this, mutations, context);
- if (mutations.length > 0) {
- this.emitter.emit(_emitter2.default.events.SCROLL_OPTIMIZE, mutations, context);
- }
- }
- }, {
- key: 'path',
- value: function path(index) {
- return _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'path', this).call(this, index).slice(1); // Exclude self
- }
- }, {
- key: 'update',
- value: function update(mutations) {
- if (this.batch === true) return;
- var source = _emitter2.default.sources.USER;
- if (typeof mutations === 'string') {
- source = mutations;
- }
- if (!Array.isArray(mutations)) {
- mutations = this.observer.takeRecords();
- }
- if (mutations.length > 0) {
- this.emitter.emit(_emitter2.default.events.SCROLL_BEFORE_UPDATE, source, mutations);
- }
- _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'update', this).call(this, mutations.concat([])); // pass copy
- if (mutations.length > 0) {
- this.emitter.emit(_emitter2.default.events.SCROLL_UPDATE, source, mutations);
- }
- }
- }]);
-
- return Scroll;
- }(_parchment2.default.Scroll);
-
- Scroll.blotName = 'scroll';
- Scroll.className = 'ql-editor';
- Scroll.tagName = 'DIV';
- Scroll.defaultChild = 'block';
- Scroll.allowedChildren = [_block2.default, _block.BlockEmbed, _container2.default];
-
- exports.default = Scroll;
-
- /***/
- }),
-/* 25 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.SHORTKEY = exports.default = undefined;
-
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
-
- var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _clone = __webpack_require__(23);
-
- var _clone2 = _interopRequireDefault(_clone);
-
- var _deepEqual = __webpack_require__(11);
-
- var _deepEqual2 = _interopRequireDefault(_deepEqual);
-
- var _extend = __webpack_require__(3);
-
- var _extend2 = _interopRequireDefault(_extend);
-
- var _quillDelta = __webpack_require__(1);
-
- var _quillDelta2 = _interopRequireDefault(_quillDelta);
-
- var _op = __webpack_require__(22);
-
- var _op2 = _interopRequireDefault(_op);
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _quill = __webpack_require__(5);
-
- var _quill2 = _interopRequireDefault(_quill);
-
- var _logger = __webpack_require__(10);
-
- var _logger2 = _interopRequireDefault(_logger);
-
- var _module = __webpack_require__(9);
-
- var _module2 = _interopRequireDefault(_module);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var debug = (0, _logger2.default)('quill:keyboard');
-
- var SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey';
-
- var Keyboard = function (_Module) {
- _inherits(Keyboard, _Module);
-
- _createClass(Keyboard, null, [{
- key: 'match',
- value: function match(evt, binding) {
- binding = normalize(binding);
- if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function (key) {
- return !!binding[key] !== evt[key] && binding[key] !== null;
- })) {
- return false;
- }
- return binding.key === (evt.which || evt.keyCode);
- }
- }]);
-
- function Keyboard(quill, options) {
- _classCallCheck(this, Keyboard);
-
- var _this = _possibleConstructorReturn(this, (Keyboard.__proto__ || Object.getPrototypeOf(Keyboard)).call(this, quill, options));
-
- _this.bindings = {};
- Object.keys(_this.options.bindings).forEach(function (name) {
- if (name === 'list autofill' && quill.scroll.whitelist != null && !quill.scroll.whitelist['list']) {
- return;
- }
- if (_this.options.bindings[name]) {
- _this.addBinding(_this.options.bindings[name]);
- }
- });
- _this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter);
- _this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function () { });
- if (/Firefox/i.test(navigator.userAgent)) {
- // Need to handle delete and backspace for Firefox in the general case #1171
- _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true }, handleBackspace);
- _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true }, handleDelete);
- } else {
- _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace);
- _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^.?$/ }, handleDelete);
- }
- _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange);
- _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange);
- _this.addBinding({ key: Keyboard.keys.BACKSPACE, altKey: null, ctrlKey: null, metaKey: null, shiftKey: null }, { collapsed: true, offset: 0 }, handleBackspace);
- _this.listen();
- return _this;
- }
-
- _createClass(Keyboard, [{
- key: 'addBinding',
- value: function addBinding(key) {
- var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
-
- var binding = normalize(key);
- if (binding == null || binding.key == null) {
- return debug.warn('Attempted to add invalid keyboard binding', binding);
- }
- if (typeof context === 'function') {
- context = { handler: context };
- }
- if (typeof handler === 'function') {
- handler = { handler: handler };
- }
- binding = (0, _extend2.default)(binding, context, handler);
- this.bindings[binding.key] = this.bindings[binding.key] || [];
- this.bindings[binding.key].push(binding);
- }
- }, {
- key: 'listen',
- value: function listen() {
- var _this2 = this;
-
- this.quill.root.addEventListener('keydown', function (evt) {
- if (evt.defaultPrevented) return;
- var which = evt.which || evt.keyCode;
- var bindings = (_this2.bindings[which] || []).filter(function (binding) {
- return Keyboard.match(evt, binding);
- });
- if (bindings.length === 0) return;
- var range = _this2.quill.getSelection();
- if (range == null || !_this2.quill.hasFocus()) return;
-
- var _quill$getLine = _this2.quill.getLine(range.index),
- _quill$getLine2 = _slicedToArray(_quill$getLine, 2),
- line = _quill$getLine2[0],
- offset = _quill$getLine2[1];
-
- var _quill$getLeaf = _this2.quill.getLeaf(range.index),
- _quill$getLeaf2 = _slicedToArray(_quill$getLeaf, 2),
- leafStart = _quill$getLeaf2[0],
- offsetStart = _quill$getLeaf2[1];
-
- var _ref = range.length === 0 ? [leafStart, offsetStart] : _this2.quill.getLeaf(range.index + range.length),
- _ref2 = _slicedToArray(_ref, 2),
- leafEnd = _ref2[0],
- offsetEnd = _ref2[1];
-
- var prefixText = leafStart instanceof _parchment2.default.Text ? leafStart.value().slice(0, offsetStart) : '';
- var suffixText = leafEnd instanceof _parchment2.default.Text ? leafEnd.value().slice(offsetEnd) : '';
- var curContext = {
- collapsed: range.length === 0,
- empty: range.length === 0 && line.length() <= 1,
- format: _this2.quill.getFormat(range),
- offset: offset,
- prefix: prefixText,
- suffix: suffixText
- };
- var prevented = bindings.some(function (binding) {
- if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false;
- if (binding.empty != null && binding.empty !== curContext.empty) return false;
- if (binding.offset != null && binding.offset !== curContext.offset) return false;
- if (Array.isArray(binding.format)) {
- // any format is present
- if (binding.format.every(function (name) {
- return curContext.format[name] == null;
- })) {
- return false;
- }
- } else if (_typeof(binding.format) === 'object') {
- // all formats must match
- if (!Object.keys(binding.format).every(function (name) {
- if (binding.format[name] === true) return curContext.format[name] != null;
- if (binding.format[name] === false) return curContext.format[name] == null;
- return (0, _deepEqual2.default)(binding.format[name], curContext.format[name]);
- })) {
- return false;
- }
- }
- if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false;
- if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false;
- return binding.handler.call(_this2, range, curContext) !== true;
- });
- if (prevented) {
- evt.preventDefault();
- }
- });
- }
- }]);
-
- return Keyboard;
- }(_module2.default);
-
- Keyboard.keys = {
- BACKSPACE: 8,
- TAB: 9,
- ENTER: 13,
- ESCAPE: 27,
- LEFT: 37,
- UP: 38,
- RIGHT: 39,
- DOWN: 40,
- DELETE: 46
- };
-
- Keyboard.DEFAULTS = {
- bindings: {
- 'bold': makeFormatHandler('bold'),
- 'italic': makeFormatHandler('italic'),
- 'underline': makeFormatHandler('underline'),
- 'indent': {
- // highlight tab or tab at beginning of list, indent or blockquote
- key: Keyboard.keys.TAB,
- format: ['blockquote', 'indent', 'list'],
- handler: function handler(range, context) {
- if (context.collapsed && context.offset !== 0) return true;
- this.quill.format('indent', '+1', _quill2.default.sources.USER);
- }
- },
- 'outdent': {
- key: Keyboard.keys.TAB,
- shiftKey: true,
- format: ['blockquote', 'indent', 'list'],
- // highlight tab or tab at beginning of list, indent or blockquote
- handler: function handler(range, context) {
- if (context.collapsed && context.offset !== 0) return true;
- this.quill.format('indent', '-1', _quill2.default.sources.USER);
- }
- },
- 'outdent backspace': {
- key: Keyboard.keys.BACKSPACE,
- collapsed: true,
- shiftKey: null,
- metaKey: null,
- ctrlKey: null,
- altKey: null,
- format: ['indent', 'list'],
- offset: 0,
- handler: function handler(range, context) {
- if (context.format.indent != null) {
- this.quill.format('indent', '-1', _quill2.default.sources.USER);
- } else if (context.format.list != null) {
- this.quill.format('list', false, _quill2.default.sources.USER);
- }
- }
- },
- 'indent code-block': makeCodeBlockHandler(true),
- 'outdent code-block': makeCodeBlockHandler(false),
- 'remove tab': {
- key: Keyboard.keys.TAB,
- shiftKey: true,
- collapsed: true,
- prefix: /\t$/,
- handler: function handler(range) {
- this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER);
- }
- },
- 'tab': {
- key: Keyboard.keys.TAB,
- handler: function handler(range) {
- this.quill.history.cutoff();
- var delta = new _quillDelta2.default().retain(range.index).delete(range.length).insert('\t');
- this.quill.updateContents(delta, _quill2.default.sources.USER);
- this.quill.history.cutoff();
- this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);
- }
- },
- 'list empty enter': {
- key: Keyboard.keys.ENTER,
- collapsed: true,
- format: ['list'],
- empty: true,
- handler: function handler(range, context) {
- this.quill.format('list', false, _quill2.default.sources.USER);
- if (context.format.indent) {
- this.quill.format('indent', false, _quill2.default.sources.USER);
- }
- }
- },
- 'checklist enter': {
- key: Keyboard.keys.ENTER,
- collapsed: true,
- format: { list: 'checked' },
- handler: function handler(range) {
- var _quill$getLine3 = this.quill.getLine(range.index),
- _quill$getLine4 = _slicedToArray(_quill$getLine3, 2),
- line = _quill$getLine4[0],
- offset = _quill$getLine4[1];
-
- var formats = (0, _extend2.default)({}, line.formats(), { list: 'checked' });
- var delta = new _quillDelta2.default().retain(range.index).insert('\n', formats).retain(line.length() - offset - 1).retain(1, { list: 'unchecked' });
- this.quill.updateContents(delta, _quill2.default.sources.USER);
- this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);
- this.quill.scrollIntoView();
- }
- },
- 'header enter': {
- key: Keyboard.keys.ENTER,
- collapsed: true,
- format: ['header'],
- suffix: /^$/,
- handler: function handler(range, context) {
- var _quill$getLine5 = this.quill.getLine(range.index),
- _quill$getLine6 = _slicedToArray(_quill$getLine5, 2),
- line = _quill$getLine6[0],
- offset = _quill$getLine6[1];
-
- var delta = new _quillDelta2.default().retain(range.index).insert('\n', context.format).retain(line.length() - offset - 1).retain(1, { header: null });
- this.quill.updateContents(delta, _quill2.default.sources.USER);
- this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);
- this.quill.scrollIntoView();
- }
- },
- 'list autofill': {
- key: ' ',
- collapsed: true,
- format: { list: false },
- prefix: /^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,
- handler: function handler(range, context) {
- var length = context.prefix.length;
-
- var _quill$getLine7 = this.quill.getLine(range.index),
- _quill$getLine8 = _slicedToArray(_quill$getLine7, 2),
- line = _quill$getLine8[0],
- offset = _quill$getLine8[1];
-
- if (offset > length) return true;
- var value = void 0;
- switch (context.prefix.trim()) {
- case '[]': case '[ ]':
- value = 'unchecked';
- break;
- case '[x]':
- value = 'checked';
- break;
- case '-': case '*':
- value = 'bullet';
- break;
- default:
- value = 'ordered';
- }
- this.quill.insertText(range.index, ' ', _quill2.default.sources.USER);
- this.quill.history.cutoff();
- var delta = new _quillDelta2.default().retain(range.index - offset).delete(length + 1).retain(line.length() - 2 - offset).retain(1, { list: value });
- this.quill.updateContents(delta, _quill2.default.sources.USER);
- this.quill.history.cutoff();
- this.quill.setSelection(range.index - length, _quill2.default.sources.SILENT);
- }
- },
- 'code exit': {
- key: Keyboard.keys.ENTER,
- collapsed: true,
- format: ['code-block'],
- prefix: /\n\n$/,
- suffix: /^\s+$/,
- handler: function handler(range) {
- var _quill$getLine9 = this.quill.getLine(range.index),
- _quill$getLine10 = _slicedToArray(_quill$getLine9, 2),
- line = _quill$getLine10[0],
- offset = _quill$getLine10[1];
-
- var delta = new _quillDelta2.default().retain(range.index + line.length() - offset - 2).retain(1, { 'code-block': null }).delete(1);
- this.quill.updateContents(delta, _quill2.default.sources.USER);
- }
- },
- 'embed left': makeEmbedArrowHandler(Keyboard.keys.LEFT, false),
- 'embed left shift': makeEmbedArrowHandler(Keyboard.keys.LEFT, true),
- 'embed right': makeEmbedArrowHandler(Keyboard.keys.RIGHT, false),
- 'embed right shift': makeEmbedArrowHandler(Keyboard.keys.RIGHT, true)
- }
- };
-
- function makeEmbedArrowHandler(key, shiftKey) {
- var _ref3;
-
- var where = key === Keyboard.keys.LEFT ? 'prefix' : 'suffix';
- return _ref3 = {
- key: key,
- shiftKey: shiftKey,
- altKey: null
- }, _defineProperty(_ref3, where, /^$/), _defineProperty(_ref3, 'handler', function handler(range) {
- var index = range.index;
- if (key === Keyboard.keys.RIGHT) {
- index += range.length + 1;
- }
-
- var _quill$getLeaf3 = this.quill.getLeaf(index),
- _quill$getLeaf4 = _slicedToArray(_quill$getLeaf3, 1),
- leaf = _quill$getLeaf4[0];
-
- if (!(leaf instanceof _parchment2.default.Embed)) return true;
- if (key === Keyboard.keys.LEFT) {
- if (shiftKey) {
- this.quill.setSelection(range.index - 1, range.length + 1, _quill2.default.sources.USER);
- } else {
- this.quill.setSelection(range.index - 1, _quill2.default.sources.USER);
- }
- } else {
- if (shiftKey) {
- this.quill.setSelection(range.index, range.length + 1, _quill2.default.sources.USER);
- } else {
- this.quill.setSelection(range.index + range.length + 1, _quill2.default.sources.USER);
- }
- }
- return false;
- }), _ref3;
- }
-
- function handleBackspace(range, context) {
- if (range.index === 0 || this.quill.getLength() <= 1) return;
-
- var _quill$getLine11 = this.quill.getLine(range.index),
- _quill$getLine12 = _slicedToArray(_quill$getLine11, 1),
- line = _quill$getLine12[0];
-
- var formats = {};
- if (context.offset === 0) {
- var _quill$getLine13 = this.quill.getLine(range.index - 1),
- _quill$getLine14 = _slicedToArray(_quill$getLine13, 1),
- prev = _quill$getLine14[0];
-
- if (prev != null && prev.length() > 1) {
- var curFormats = line.formats();
- var prevFormats = this.quill.getFormat(range.index - 1, 1);
- formats = _op2.default.attributes.diff(curFormats, prevFormats) || {};
- }
- }
- // Check for astral symbols
- var length = /[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(context.prefix) ? 2 : 1;
- this.quill.deleteText(range.index - length, length, _quill2.default.sources.USER);
- if (Object.keys(formats).length > 0) {
- this.quill.formatLine(range.index - length, length, formats, _quill2.default.sources.USER);
- }
- this.quill.focus();
- }
-
- function handleDelete(range, context) {
- // Check for astral symbols
- var length = /^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(context.suffix) ? 2 : 1;
- if (range.index >= this.quill.getLength() - length) return;
- var formats = {},
- nextLength = 0;
-
- var _quill$getLine15 = this.quill.getLine(range.index),
- _quill$getLine16 = _slicedToArray(_quill$getLine15, 1),
- line = _quill$getLine16[0];
-
- if (context.offset >= line.length() - 1) {
- var _quill$getLine17 = this.quill.getLine(range.index + 1),
- _quill$getLine18 = _slicedToArray(_quill$getLine17, 1),
- next = _quill$getLine18[0];
-
- if (next) {
- var curFormats = line.formats();
- var nextFormats = this.quill.getFormat(range.index, 1);
- formats = _op2.default.attributes.diff(curFormats, nextFormats) || {};
- nextLength = next.length();
- }
- }
- this.quill.deleteText(range.index, length, _quill2.default.sources.USER);
- if (Object.keys(formats).length > 0) {
- this.quill.formatLine(range.index + nextLength - 1, length, formats, _quill2.default.sources.USER);
- }
- }
-
- function handleDeleteRange(range) {
- var lines = this.quill.getLines(range);
- var formats = {};
- if (lines.length > 1) {
- var firstFormats = lines[0].formats();
- var lastFormats = lines[lines.length - 1].formats();
- formats = _op2.default.attributes.diff(lastFormats, firstFormats) || {};
- }
- this.quill.deleteText(range, _quill2.default.sources.USER);
- if (Object.keys(formats).length > 0) {
- this.quill.formatLine(range.index, 1, formats, _quill2.default.sources.USER);
- }
- this.quill.setSelection(range.index, _quill2.default.sources.SILENT);
- this.quill.focus();
- }
-
- function handleEnter(range, context) {
- var _this3 = this;
-
- if (range.length > 0) {
- this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change
- }
- var lineFormats = Object.keys(context.format).reduce(function (lineFormats, format) {
- if (_parchment2.default.query(format, _parchment2.default.Scope.BLOCK) && !Array.isArray(context.format[format])) {
- lineFormats[format] = context.format[format];
- }
- return lineFormats;
- }, {});
- this.quill.insertText(range.index, '\n', lineFormats, _quill2.default.sources.USER);
- // Earlier scroll.deleteAt might have messed up our selection,
- // so insertText's built in selection preservation is not reliable
- this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);
- this.quill.focus();
- Object.keys(context.format).forEach(function (name) {
- if (lineFormats[name] != null) return;
- if (Array.isArray(context.format[name])) return;
- if (name === 'link') return;
- _this3.quill.format(name, context.format[name], _quill2.default.sources.USER);
- });
- }
-
- function makeCodeBlockHandler(indent) {
- return {
- key: Keyboard.keys.TAB,
- shiftKey: !indent,
- format: { 'code-block': true },
- handler: function handler(range) {
- var CodeBlock = _parchment2.default.query('code-block');
- var index = range.index,
- length = range.length;
-
- var _quill$scroll$descend = this.quill.scroll.descendant(CodeBlock, index),
- _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2),
- block = _quill$scroll$descend2[0],
- offset = _quill$scroll$descend2[1];
-
- if (block == null) return;
- var scrollIndex = this.quill.getIndex(block);
- var start = block.newlineIndex(offset, true) + 1;
- var end = block.newlineIndex(scrollIndex + offset + length);
- var lines = block.domNode.textContent.slice(start, end).split('\n');
- offset = 0;
- lines.forEach(function (line, i) {
- if (indent) {
- block.insertAt(start + offset, CodeBlock.TAB);
- offset += CodeBlock.TAB.length;
- if (i === 0) {
- index += CodeBlock.TAB.length;
- } else {
- length += CodeBlock.TAB.length;
- }
- } else if (line.startsWith(CodeBlock.TAB)) {
- block.deleteAt(start + offset, CodeBlock.TAB.length);
- offset -= CodeBlock.TAB.length;
- if (i === 0) {
- index -= CodeBlock.TAB.length;
- } else {
- length -= CodeBlock.TAB.length;
- }
- }
- offset += line.length + 1;
- });
- this.quill.update(_quill2.default.sources.USER);
- this.quill.setSelection(index, length, _quill2.default.sources.SILENT);
- }
- };
- }
-
- function makeFormatHandler(format) {
- return {
- key: format[0].toUpperCase(),
- shortKey: true,
- handler: function handler(range, context) {
- this.quill.format(format, !context.format[format], _quill2.default.sources.USER);
- }
- };
- }
-
- function normalize(binding) {
- if (typeof binding === 'string' || typeof binding === 'number') {
- return normalize({ key: binding });
- }
- if ((typeof binding === 'undefined' ? 'undefined' : _typeof(binding)) === 'object') {
- binding = (0, _clone2.default)(binding, false);
- }
- if (typeof binding.key === 'string') {
- if (Keyboard.keys[binding.key.toUpperCase()] != null) {
- binding.key = Keyboard.keys[binding.key.toUpperCase()];
- } else if (binding.key.length === 1) {
- binding.key = binding.key.toUpperCase().charCodeAt(0);
- } else {
- return null;
- }
- }
- if (binding.shortKey) {
- binding[SHORTKEY] = binding.shortKey;
- delete binding.shortKey;
- }
- return binding;
- }
-
- exports.default = Keyboard;
- exports.SHORTKEY = SHORTKEY;
-
- /***/
- }),
-/* 26 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _text = __webpack_require__(7);
-
- var _text2 = _interopRequireDefault(_text);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var Cursor = function (_Parchment$Embed) {
- _inherits(Cursor, _Parchment$Embed);
-
- _createClass(Cursor, null, [{
- key: 'value',
- value: function value() {
- return undefined;
- }
- }]);
-
- function Cursor(domNode, selection) {
- _classCallCheck(this, Cursor);
-
- var _this = _possibleConstructorReturn(this, (Cursor.__proto__ || Object.getPrototypeOf(Cursor)).call(this, domNode));
-
- _this.selection = selection;
- _this.textNode = document.createTextNode(Cursor.CONTENTS);
- _this.domNode.appendChild(_this.textNode);
- _this._length = 0;
- return _this;
- }
-
- _createClass(Cursor, [{
- key: 'detach',
- value: function detach() {
- // super.detach() will also clear domNode.__blot
- if (this.parent != null) this.parent.removeChild(this);
- }
- }, {
- key: 'format',
- value: function format(name, value) {
- if (this._length !== 0) {
- return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'format', this).call(this, name, value);
- }
- var target = this,
- index = 0;
- while (target != null && target.statics.scope !== _parchment2.default.Scope.BLOCK_BLOT) {
- index += target.offset(target.parent);
- target = target.parent;
- }
- if (target != null) {
- this._length = Cursor.CONTENTS.length;
- target.optimize();
- target.formatAt(index, Cursor.CONTENTS.length, name, value);
- this._length = 0;
- }
- }
- }, {
- key: 'index',
- value: function index(node, offset) {
- if (node === this.textNode) return 0;
- return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'index', this).call(this, node, offset);
- }
- }, {
- key: 'length',
- value: function length() {
- return this._length;
- }
- }, {
- key: 'position',
- value: function position() {
- return [this.textNode, this.textNode.data.length];
- }
- }, {
- key: 'remove',
- value: function remove() {
- _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'remove', this).call(this);
- this.parent = null;
- }
- }, {
- key: 'restore',
- value: function restore() {
- if (this.selection.composing || this.parent == null) return;
- var textNode = this.textNode;
- var range = this.selection.getNativeRange();
- var restoreText = void 0,
- start = void 0,
- end = void 0;
- if (range != null && range.start.node === textNode && range.end.node === textNode) {
- var _ref = [textNode, range.start.offset, range.end.offset];
- restoreText = _ref[0];
- start = _ref[1];
- end = _ref[2];
- }
- // Link format will insert text outside of anchor tag
- while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) {
- this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode);
- }
- if (this.textNode.data !== Cursor.CONTENTS) {
- var text = this.textNode.data.split(Cursor.CONTENTS).join('');
- if (this.next instanceof _text2.default) {
- restoreText = this.next.domNode;
- this.next.insertAt(0, text);
- this.textNode.data = Cursor.CONTENTS;
- } else {
- this.textNode.data = text;
- this.parent.insertBefore(_parchment2.default.create(this.textNode), this);
- this.textNode = document.createTextNode(Cursor.CONTENTS);
- this.domNode.appendChild(this.textNode);
- }
- }
- this.remove();
- if (start != null) {
- var _map = [start, end].map(function (offset) {
- return Math.max(0, Math.min(restoreText.data.length, offset - 1));
- });
-
- var _map2 = _slicedToArray(_map, 2);
-
- start = _map2[0];
- end = _map2[1];
-
- return {
- startNode: restoreText,
- startOffset: start,
- endNode: restoreText,
- endOffset: end
- };
- }
- }
- }, {
- key: 'update',
- value: function update(mutations, context) {
- var _this2 = this;
-
- if (mutations.some(function (mutation) {
- return mutation.type === 'characterData' && mutation.target === _this2.textNode;
- })) {
- var range = this.restore();
- if (range) context.range = range;
- }
- }
- }, {
- key: 'value',
- value: function value() {
- return '';
- }
- }]);
-
- return Cursor;
- }(_parchment2.default.Embed);
-
- Cursor.blotName = 'cursor';
- Cursor.className = 'ql-cursor';
- Cursor.tagName = 'span';
- Cursor.CONTENTS = '\uFEFF'; // Zero width no break space
-
-
- exports.default = Cursor;
-
- /***/
- }),
-/* 27 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _block = __webpack_require__(4);
-
- var _block2 = _interopRequireDefault(_block);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var Container = function (_Parchment$Container) {
- _inherits(Container, _Parchment$Container);
-
- function Container() {
- _classCallCheck(this, Container);
-
- return _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).apply(this, arguments));
- }
-
- return Container;
- }(_parchment2.default.Container);
-
- Container.allowedChildren = [_block2.default, _block.BlockEmbed, Container];
-
- exports.default = Container;
-
- /***/
- }),
-/* 28 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.ColorStyle = exports.ColorClass = exports.ColorAttributor = undefined;
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var ColorAttributor = function (_Parchment$Attributor) {
- _inherits(ColorAttributor, _Parchment$Attributor);
-
- function ColorAttributor() {
- _classCallCheck(this, ColorAttributor);
-
- return _possibleConstructorReturn(this, (ColorAttributor.__proto__ || Object.getPrototypeOf(ColorAttributor)).apply(this, arguments));
- }
-
- _createClass(ColorAttributor, [{
- key: 'value',
- value: function value(domNode) {
- var value = _get(ColorAttributor.prototype.__proto__ || Object.getPrototypeOf(ColorAttributor.prototype), 'value', this).call(this, domNode);
- if (!value.startsWith('rgb(')) return value;
- value = value.replace(/^[^\d]+/, '').replace(/[^\d]+$/, '');
- return '#' + value.split(',').map(function (component) {
- return ('00' + parseInt(component).toString(16)).slice(-2);
- }).join('');
- }
- }]);
-
- return ColorAttributor;
- }(_parchment2.default.Attributor.Style);
-
- var ColorClass = new _parchment2.default.Attributor.Class('color', 'ql-color', {
- scope: _parchment2.default.Scope.INLINE
- });
- var ColorStyle = new ColorAttributor('color', 'color', {
- scope: _parchment2.default.Scope.INLINE
- });
-
- exports.ColorAttributor = ColorAttributor;
- exports.ColorClass = ColorClass;
- exports.ColorStyle = ColorStyle;
-
- /***/
- }),
-/* 29 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.sanitize = exports.default = undefined;
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _inline = __webpack_require__(6);
-
- var _inline2 = _interopRequireDefault(_inline);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var Link = function (_Inline) {
- _inherits(Link, _Inline);
-
- function Link() {
- _classCallCheck(this, Link);
-
- return _possibleConstructorReturn(this, (Link.__proto__ || Object.getPrototypeOf(Link)).apply(this, arguments));
- }
-
- _createClass(Link, [{
- key: 'format',
- value: function format(name, value) {
- if (name !== this.statics.blotName || !value) return _get(Link.prototype.__proto__ || Object.getPrototypeOf(Link.prototype), 'format', this).call(this, name, value);
- value = this.constructor.sanitize(value);
- this.domNode.setAttribute('href', value);
- }
- }], [{
- key: 'create',
- value: function create(value) {
- var node = _get(Link.__proto__ || Object.getPrototypeOf(Link), 'create', this).call(this, value);
- value = this.sanitize(value);
- node.setAttribute('href', value);
- node.setAttribute('rel', 'noopener noreferrer');
- node.setAttribute('target', '_blank');
- return node;
- }
- }, {
- key: 'formats',
- value: function formats(domNode) {
- return domNode.getAttribute('href');
- }
- }, {
- key: 'sanitize',
- value: function sanitize(url) {
- return _sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL;
- }
- }]);
-
- return Link;
- }(_inline2.default);
-
- Link.blotName = 'link';
- Link.tagName = 'A';
- Link.SANITIZED_URL = 'about:blank';
- Link.PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel'];
-
- function _sanitize(url, protocols) {
- var anchor = document.createElement('a');
- anchor.href = url;
- var protocol = anchor.href.slice(0, anchor.href.indexOf(':'));
- return protocols.indexOf(protocol) > -1;
- }
-
- exports.default = Link;
- exports.sanitize = _sanitize;
-
- /***/
- }),
-/* 30 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _keyboard = __webpack_require__(25);
-
- var _keyboard2 = _interopRequireDefault(_keyboard);
-
- var _unfoldMoreHorizontal = __webpack_require__(131);
-
- var _unfoldMoreHorizontal2 = _interopRequireDefault(_unfoldMoreHorizontal);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- var optionsCounter = 0;
-
- function toggleAriaAttribute(element, attribute) {
- element.setAttribute(attribute, !(element.getAttribute(attribute) === "true"));
- }
-
- var Picker = function () {
- function Picker(select) {
- var _this = this;
-
- _classCallCheck(this, Picker);
-
- this.select = select;
- this.container = document.createElement("span");
- this.buildPicker();
- this.select.style.display = "none";
- this.select.parentNode.insertBefore(this.container, this.select);
-
- this.label.addEventListener("mousedown", function () {
- _this.togglePicker();
- });
- this.label.addEventListener("keydown", function (event) {
- switch (event.keyCode) {
- // Allows the "Enter" key to open the picker
- case _keyboard2.default.keys.ENTER:
- _this.togglePicker();
- break;
-
- // Allows the "Escape" key to close the picker
- case _keyboard2.default.keys.ESCAPE:
- _this.escape();
- event.preventDefault();
- break;
- default:
- }
- });
- this.select.addEventListener("change", this.update.bind(this));
- }
-
- _createClass(Picker, [{
- key: "togglePicker",
- value: function togglePicker() {
- this.container.classList.toggle("ql-expanded");
- // Toggle aria-expanded and aria-hidden to make the picker accessible
- toggleAriaAttribute(this.label, "aria-expanded");
- toggleAriaAttribute(this.options, "aria-hidden");
- }
- }, {
- key: "buildItem",
- value: function buildItem(option) {
- var _this2 = this;
-
- var item = document.createElement("span");
- item.tabIndex = "0";
- item.setAttribute("role", "button");
-
- item.classList.add("ql-picker-item");
- if (option.hasAttribute("value")) {
- item.setAttribute("data-value", option.getAttribute("value"));
- }
- if (option.textContent) {
- item.setAttribute("data-label", option.textContent);
- }
- item.addEventListener("click", function () {
- _this2.selectItem(item, true);
- });
- item.addEventListener("keydown", function (event) {
- switch (event.keyCode) {
- // Allows the "Enter" key to select an item
- case _keyboard2.default.keys.ENTER:
- _this2.selectItem(item, true);
- event.preventDefault();
- break;
-
- // Allows the "Escape" key to close the picker
- case _keyboard2.default.keys.ESCAPE:
- _this2.escape();
- event.preventDefault();
- break;
- default:
- }
- });
-
- return item;
- }
- }, {
- key: "buildLabel",
- value: function buildLabel() {
- var label = document.createElement("span");
- label.classList.add("ql-picker-label");
- label.innerHTML = _unfoldMoreHorizontal2.default;
- label.tabIndex = "0";
- label.setAttribute("role", "button");
- label.setAttribute("aria-expanded", "false");
- this.container.appendChild(label);
- return label;
- }
- }, {
- key: "buildOptions",
- value: function buildOptions() {
- var _this3 = this;
-
- var options = document.createElement("span");
- options.classList.add("ql-picker-options");
-
- // Don't want screen readers to read this until options are visible
- options.setAttribute("aria-hidden", "true");
- options.tabIndex = "-1";
-
- // Need a unique id for aria-controls
- options.id = "ql-picker-options-" + optionsCounter;
- optionsCounter += 1;
- this.label.setAttribute("aria-controls", options.id);
-
- this.options = options;
-
- [].slice.call(this.select.options).forEach(function (option) {
- var item = _this3.buildItem(option);
- options.appendChild(item);
- if (option.selected === true) {
- _this3.selectItem(item);
- }
- });
- this.container.appendChild(options);
- }
- }, {
- key: "buildPicker",
- value: function buildPicker() {
- var _this4 = this;
-
- [].slice.call(this.select.attributes).forEach(function (item) {
- _this4.container.setAttribute(item.name, item.value);
- });
- this.container.classList.add("ql-picker");
- this.label = this.buildLabel();
- this.buildOptions();
- }
- }, {
- key: "escape",
- value: function escape() {
- var _this5 = this;
-
- // Close menu and return focus to trigger label
- this.close();
- // Need setTimeout for accessibility to ensure that the browser executes
- // focus on the next process thread and after any DOM content changes
- setTimeout(function () {
- return _this5.label.focus();
- }, 1);
- }
- }, {
- key: "close",
- value: function close() {
- this.container.classList.remove("ql-expanded");
- this.label.setAttribute("aria-expanded", "false");
- this.options.setAttribute("aria-hidden", "true");
- }
- }, {
- key: "selectItem",
- value: function selectItem(item) {
- var trigger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
-
- var selected = this.container.querySelector(".ql-selected");
- if (item === selected) return;
- if (selected != null) {
- selected.classList.remove("ql-selected");
- }
- if (item == null) return;
- item.classList.add("ql-selected");
- this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item);
- if (item.hasAttribute("data-value")) {
- this.label.setAttribute("data-value", item.getAttribute("data-value"));
- } else {
- this.label.removeAttribute("data-value");
- }
- if (item.hasAttribute("data-label")) {
- this.label.setAttribute("data-label", item.getAttribute("data-label"));
- } else {
- this.label.removeAttribute("data-label");
- }
- if (trigger) {
- if (typeof Event === "function") {
- this.select.dispatchEvent(new Event("change"));
- } else if ((typeof Event === "undefined" ? "undefined" : _typeof(Event)) === "object") {
- // IE11
- var event = document.createEvent("Event");
- event.initEvent("change", true, true);
- this.select.dispatchEvent(event);
- }
- this.close();
- }
- }
- }, {
- key: "update",
- value: function update() {
- var option = void 0;
- if (this.select.selectedIndex > -1) {
- var item = this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];
- option = this.select.options[this.select.selectedIndex];
- this.selectItem(item);
- } else {
- this.selectItem(null);
- }
- var isActive = option != null && option !== this.select.querySelector("option[selected]");
- this.label.classList.toggle("ql-active", isActive);
- }
- }]);
-
- return Picker;
- }();
-
- exports.default = Picker;
-
- /***/
- }),
-/* 31 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _quill = __webpack_require__(5);
-
- var _quill2 = _interopRequireDefault(_quill);
-
- var _block = __webpack_require__(4);
-
- var _block2 = _interopRequireDefault(_block);
-
- var _break = __webpack_require__(16);
-
- var _break2 = _interopRequireDefault(_break);
-
- var _container = __webpack_require__(27);
-
- var _container2 = _interopRequireDefault(_container);
-
- var _cursor = __webpack_require__(26);
-
- var _cursor2 = _interopRequireDefault(_cursor);
-
- var _embed = __webpack_require__(41);
-
- var _embed2 = _interopRequireDefault(_embed);
-
- var _inline = __webpack_require__(6);
-
- var _inline2 = _interopRequireDefault(_inline);
-
- var _scroll = __webpack_require__(24);
-
- var _scroll2 = _interopRequireDefault(_scroll);
-
- var _text = __webpack_require__(7);
-
- var _text2 = _interopRequireDefault(_text);
-
- var _clipboard = __webpack_require__(74);
-
- var _clipboard2 = _interopRequireDefault(_clipboard);
-
- var _history = __webpack_require__(48);
-
- var _history2 = _interopRequireDefault(_history);
-
- var _keyboard = __webpack_require__(25);
-
- var _keyboard2 = _interopRequireDefault(_keyboard);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- _quill2.default.register({
- 'blots/block': _block2.default,
- 'blots/block/embed': _block.BlockEmbed,
- 'blots/break': _break2.default,
- 'blots/container': _container2.default,
- 'blots/cursor': _cursor2.default,
- 'blots/embed': _embed2.default,
- 'blots/inline': _inline2.default,
- 'blots/scroll': _scroll2.default,
- 'blots/text': _text2.default,
-
- 'modules/clipboard': _clipboard2.default,
- 'modules/history': _history2.default,
- 'modules/keyboard': _keyboard2.default
- });
-
- _parchment2.default.register(_block2.default, _break2.default, _cursor2.default, _inline2.default, _scroll2.default, _text2.default);
-
- exports.default = _quill2.default;
-
- /***/
- }),
-/* 32 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- Object.defineProperty(exports, "__esModule", { value: true });
- var Registry = __webpack_require__(2);
- var ShadowBlot = /** @class */ (function () {
- function ShadowBlot(domNode) {
- this.domNode = domNode;
- // @ts-ignore
- this.domNode[Registry.DATA_KEY] = { blot: this };
- }
- Object.defineProperty(ShadowBlot.prototype, "statics", {
- // Hack for accessing inherited static methods
- get: function () {
- return this.constructor;
- },
- enumerable: true,
- configurable: true
- });
- ShadowBlot.create = function (value) {
- if (this.tagName == null) {
- throw new Registry.ParchmentError('Blot definition missing tagName');
- }
- var node;
- if (Array.isArray(this.tagName)) {
- if (typeof value === 'string') {
- value = value.toUpperCase();
- if (parseInt(value).toString() === value) {
- value = parseInt(value);
- }
- }
- if (typeof value === 'number') {
- node = document.createElement(this.tagName[value - 1]);
- }
- else if (this.tagName.indexOf(value) > -1) {
- node = document.createElement(value);
- }
- else {
- node = document.createElement(this.tagName[0]);
- }
- }
- else {
- node = document.createElement(this.tagName);
- }
- if (this.className) {
- node.classList.add(this.className);
- }
- return node;
- };
- ShadowBlot.prototype.attach = function () {
- if (this.parent != null) {
- this.scroll = this.parent.scroll;
- }
- };
- ShadowBlot.prototype.clone = function () {
- var domNode = this.domNode.cloneNode(false);
- return Registry.create(domNode);
- };
- ShadowBlot.prototype.detach = function () {
- if (this.parent != null)
- this.parent.removeChild(this);
- // @ts-ignore
- delete this.domNode[Registry.DATA_KEY];
- };
- ShadowBlot.prototype.deleteAt = function (index, length) {
- var blot = this.isolate(index, length);
- blot.remove();
- };
- ShadowBlot.prototype.formatAt = function (index, length, name, value) {
- var blot = this.isolate(index, length);
- if (Registry.query(name, Registry.Scope.BLOT) != null && value) {
- blot.wrap(name, value);
- }
- else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) {
- var parent = Registry.create(this.statics.scope);
- blot.wrap(parent);
- parent.format(name, value);
- }
- };
- ShadowBlot.prototype.insertAt = function (index, value, def) {
- var blot = def == null ? Registry.create('text', value) : Registry.create(value, def);
- var ref = this.split(index);
- this.parent.insertBefore(blot, ref);
- };
- ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) {
- if (refBlot === void 0) { refBlot = null; }
- if (this.parent != null) {
- this.parent.children.remove(this);
- }
- var refDomNode = null;
- parentBlot.children.insertBefore(this, refBlot);
- if (refBlot != null) {
- refDomNode = refBlot.domNode;
- }
- if (this.domNode.parentNode != parentBlot.domNode ||
- this.domNode.nextSibling != refDomNode) {
- parentBlot.domNode.insertBefore(this.domNode, refDomNode);
- }
- this.parent = parentBlot;
- this.attach();
- };
- ShadowBlot.prototype.isolate = function (index, length) {
- var target = this.split(index);
- target.split(length);
- return target;
- };
- ShadowBlot.prototype.length = function () {
- return 1;
- };
- ShadowBlot.prototype.offset = function (root) {
- if (root === void 0) { root = this.parent; }
- if (this.parent == null || this == root)
- return 0;
- return this.parent.children.offset(this) + this.parent.offset(root);
- };
- ShadowBlot.prototype.optimize = function (context) {
- // TODO clean up once we use WeakMap
- // @ts-ignore
- if (this.domNode[Registry.DATA_KEY] != null) {
- // @ts-ignore
- delete this.domNode[Registry.DATA_KEY].mutations;
- }
- };
- ShadowBlot.prototype.remove = function () {
- if (this.domNode.parentNode != null) {
- this.domNode.parentNode.removeChild(this.domNode);
- }
- this.detach();
- };
- ShadowBlot.prototype.replace = function (target) {
- if (target.parent == null)
- return;
- target.parent.insertBefore(this, target.next);
- target.remove();
- };
- ShadowBlot.prototype.replaceWith = function (name, value) {
- var replacement = typeof name === 'string' ? Registry.create(name, value) : name;
- replacement.replace(this);
- return replacement;
- };
- ShadowBlot.prototype.split = function (index, force) {
- return index === 0 ? this : this.next;
- };
- ShadowBlot.prototype.update = function (mutations, context) {
- // Nothing to do by default
- };
- ShadowBlot.prototype.wrap = function (name, value) {
- var wrapper = typeof name === 'string' ? Registry.create(name, value) : name;
- if (this.parent != null) {
- this.parent.insertBefore(wrapper, this.next);
- }
- wrapper.appendChild(this);
- return wrapper;
- };
- ShadowBlot.blotName = 'abstract';
- return ShadowBlot;
- }());
- exports.default = ShadowBlot;
-
-
- /***/
- }),
-/* 33 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- Object.defineProperty(exports, "__esModule", { value: true });
- var attributor_1 = __webpack_require__(12);
- var class_1 = __webpack_require__(34);
- var style_1 = __webpack_require__(35);
- var Registry = __webpack_require__(2);
- var AttributorStore = /** @class */ (function () {
- function AttributorStore(domNode) {
- this.attributes = {};
- this.domNode = domNode;
- this.build();
- }
- AttributorStore.prototype.attribute = function (attribute, value) {
- // verb
- if (value) {
- if (attribute.add(this.domNode, value)) {
- if (attribute.value(this.domNode) != null) {
- this.attributes[attribute.attrName] = attribute;
- }
- else {
- delete this.attributes[attribute.attrName];
- }
- }
- }
- else {
- attribute.remove(this.domNode);
- delete this.attributes[attribute.attrName];
- }
- };
- AttributorStore.prototype.build = function () {
- var _this = this;
- this.attributes = {};
- var attributes = attributor_1.default.keys(this.domNode);
- var classes = class_1.default.keys(this.domNode);
- var styles = style_1.default.keys(this.domNode);
- attributes
- .concat(classes)
- .concat(styles)
- .forEach(function (name) {
- var attr = Registry.query(name, Registry.Scope.ATTRIBUTE);
- if (attr instanceof attributor_1.default) {
- _this.attributes[attr.attrName] = attr;
- }
- });
- };
- AttributorStore.prototype.copy = function (target) {
- var _this = this;
- Object.keys(this.attributes).forEach(function (key) {
- var value = _this.attributes[key].value(_this.domNode);
- target.format(key, value);
- });
- };
- AttributorStore.prototype.move = function (target) {
- var _this = this;
- this.copy(target);
- Object.keys(this.attributes).forEach(function (key) {
- _this.attributes[key].remove(_this.domNode);
- });
- this.attributes = {};
- };
- AttributorStore.prototype.values = function () {
- var _this = this;
- return Object.keys(this.attributes).reduce(function (attributes, name) {
- attributes[name] = _this.attributes[name].value(_this.domNode);
- return attributes;
- }, {});
- };
- return AttributorStore;
- }());
- exports.default = AttributorStore;
-
-
- /***/
- }),
-/* 34 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var attributor_1 = __webpack_require__(12);
- function match(node, prefix) {
- var className = node.getAttribute('class') || '';
- return className.split(/\s+/).filter(function (name) {
- return name.indexOf(prefix + "-") === 0;
- });
- }
- var ClassAttributor = /** @class */ (function (_super) {
- __extends(ClassAttributor, _super);
- function ClassAttributor() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- ClassAttributor.keys = function (node) {
- return (node.getAttribute('class') || '').split(/\s+/).map(function (name) {
- return name
- .split('-')
- .slice(0, -1)
- .join('-');
- });
- };
- ClassAttributor.prototype.add = function (node, value) {
- if (!this.canAdd(node, value))
- return false;
- this.remove(node);
- node.classList.add(this.keyName + "-" + value);
- return true;
- };
- ClassAttributor.prototype.remove = function (node) {
- var matches = match(node, this.keyName);
- matches.forEach(function (name) {
- node.classList.remove(name);
- });
- if (node.classList.length === 0) {
- node.removeAttribute('class');
- }
- };
- ClassAttributor.prototype.value = function (node) {
- var result = match(node, this.keyName)[0] || '';
- var value = result.slice(this.keyName.length + 1); // +1 for hyphen
- return this.canAdd(node, value) ? value : '';
- };
- return ClassAttributor;
- }(attributor_1.default));
- exports.default = ClassAttributor;
-
-
- /***/
- }),
-/* 35 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var attributor_1 = __webpack_require__(12);
- function camelize(name) {
- var parts = name.split('-');
- var rest = parts
- .slice(1)
- .map(function (part) {
- return part[0].toUpperCase() + part.slice(1);
- })
- .join('');
- return parts[0] + rest;
- }
- var StyleAttributor = /** @class */ (function (_super) {
- __extends(StyleAttributor, _super);
- function StyleAttributor() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- StyleAttributor.keys = function (node) {
- return (node.getAttribute('style') || '').split(';').map(function (value) {
- var arr = value.split(':');
- return arr[0].trim();
- });
- };
- StyleAttributor.prototype.add = function (node, value) {
- if (!this.canAdd(node, value))
- return false;
- // @ts-ignore
- node.style[camelize(this.keyName)] = value;
- return true;
- };
- StyleAttributor.prototype.remove = function (node) {
- // @ts-ignore
- node.style[camelize(this.keyName)] = '';
- if (!node.getAttribute('style')) {
- node.removeAttribute('style');
- }
- };
- StyleAttributor.prototype.value = function (node) {
- // @ts-ignore
- var value = node.style[camelize(this.keyName)];
- return this.canAdd(node, value) ? value : '';
- };
- return StyleAttributor;
- }(attributor_1.default));
- exports.default = StyleAttributor;
-
-
- /***/
- }),
-/* 36 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var slice = Array.prototype.slice;
- var isArgs = __webpack_require__(37);
-
- var origKeys = Object.keys;
- var keysShim = origKeys ? function keys(o) { return origKeys(o); } : __webpack_require__(58);
-
- var originalKeys = Object.keys;
-
- keysShim.shim = function shimObjectKeys() {
- if (Object.keys) {
- var keysWorksWithArguments = (function () {
- // Safari 5.0 bug
- var args = Object.keys(arguments);
- return args && args.length === arguments.length;
- }(1, 2));
- if (!keysWorksWithArguments) {
- Object.keys = function keys(object) { // eslint-disable-line func-name-matching
- if (isArgs(object)) {
- return originalKeys(slice.call(object));
- }
- return originalKeys(object);
- };
- }
- } else {
- Object.keys = keysShim;
- }
- return Object.keys || keysShim;
- };
-
- module.exports = keysShim;
-
-
- /***/
- }),
-/* 37 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var toStr = Object.prototype.toString;
-
- module.exports = function isArguments(value) {
- var str = toStr.call(value);
- var isArgs = str === '[object Arguments]';
- if (!isArgs) {
- isArgs = str !== '[object Array]' &&
- value !== null &&
- typeof value === 'object' &&
- typeof value.length === 'number' &&
- value.length >= 0 &&
- toStr.call(value.callee) === '[object Function]';
- }
- return isArgs;
- };
-
-
- /***/
- }),
-/* 38 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var $Object = Object;
- var $TypeError = TypeError;
-
- module.exports = function flags() {
- if (this != null && this !== $Object(this)) {
- throw new $TypeError('RegExp.prototype.flags getter called on non-object');
- }
- var result = '';
- if (this.global) {
- result += 'g';
- }
- if (this.ignoreCase) {
- result += 'i';
- }
- if (this.multiline) {
- result += 'm';
- }
- if (this.dotAll) {
- result += 's';
- }
- if (this.unicode) {
- result += 'u';
- }
- if (this.sticky) {
- result += 'y';
- }
- return result;
- };
-
-
- /***/
- }),
-/* 39 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var implementation = __webpack_require__(38);
-
- var supportsDescriptors = __webpack_require__(21).supportsDescriptors;
- var $gOPD = Object.getOwnPropertyDescriptor;
- var $TypeError = TypeError;
-
- module.exports = function getPolyfill() {
- if (!supportsDescriptors) {
- throw new $TypeError('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');
- }
- if ((/a/mig).flags === 'gim') {
- var descriptor = $gOPD(RegExp.prototype, 'flags');
- if (descriptor && typeof descriptor.get === 'function' && typeof (/a/).dotAll === 'boolean') {
- return descriptor.get;
- }
- }
- return implementation;
- };
-
-
- /***/
- }),
-/* 40 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- var Theme = function () {
- function Theme(quill, options) {
- _classCallCheck(this, Theme);
-
- this.quill = quill;
- this.options = options;
- this.modules = {};
- }
-
- _createClass(Theme, [{
- key: 'init',
- value: function init() {
- var _this = this;
-
- Object.keys(this.options.modules).forEach(function (name) {
- if (_this.modules[name] == null) {
- _this.addModule(name);
- }
- });
- }
- }, {
- key: 'addModule',
- value: function addModule(name) {
- var moduleClass = this.quill.constructor.import('modules/' + name);
- this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {});
- return this.modules[name];
- }
- }]);
-
- return Theme;
- }();
-
- Theme.DEFAULTS = {
- modules: {}
- };
- Theme.themes = {
- 'default': Theme
- };
-
- exports.default = Theme;
-
- /***/
- }),
-/* 41 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _text = __webpack_require__(7);
-
- var _text2 = _interopRequireDefault(_text);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var GUARD_TEXT = '\uFEFF';
-
- var Embed = function (_Parchment$Embed) {
- _inherits(Embed, _Parchment$Embed);
-
- function Embed(node) {
- _classCallCheck(this, Embed);
-
- var _this = _possibleConstructorReturn(this, (Embed.__proto__ || Object.getPrototypeOf(Embed)).call(this, node));
-
- _this.contentNode = document.createElement('span');
- _this.contentNode.setAttribute('contenteditable', false);
- [].slice.call(_this.domNode.childNodes).forEach(function (childNode) {
- _this.contentNode.appendChild(childNode);
- });
- _this.leftGuard = document.createTextNode(GUARD_TEXT);
- _this.rightGuard = document.createTextNode(GUARD_TEXT);
- _this.domNode.appendChild(_this.leftGuard);
- _this.domNode.appendChild(_this.contentNode);
- _this.domNode.appendChild(_this.rightGuard);
- return _this;
- }
-
- _createClass(Embed, [{
- key: 'index',
- value: function index(node, offset) {
- if (node === this.leftGuard) return 0;
- if (node === this.rightGuard) return 1;
- return _get(Embed.prototype.__proto__ || Object.getPrototypeOf(Embed.prototype), 'index', this).call(this, node, offset);
- }
- }, {
- key: 'restore',
- value: function restore(node) {
- var range = void 0,
- textNode = void 0;
- var text = node.data.split(GUARD_TEXT).join('');
- if (node === this.leftGuard) {
- if (this.prev instanceof _text2.default) {
- var prevLength = this.prev.length();
- this.prev.insertAt(prevLength, text);
- range = {
- startNode: this.prev.domNode,
- startOffset: prevLength + text.length
- };
- } else {
- textNode = document.createTextNode(text);
- this.parent.insertBefore(_parchment2.default.create(textNode), this);
- range = {
- startNode: textNode,
- startOffset: text.length
- };
- }
- } else if (node === this.rightGuard) {
- if (this.next instanceof _text2.default) {
- this.next.insertAt(0, text);
- range = {
- startNode: this.next.domNode,
- startOffset: text.length
- };
- } else {
- textNode = document.createTextNode(text);
- this.parent.insertBefore(_parchment2.default.create(textNode), this.next);
- range = {
- startNode: textNode,
- startOffset: text.length
- };
- }
- }
- node.data = GUARD_TEXT;
- return range;
- }
- }, {
- key: 'update',
- value: function update(mutations, context) {
- var _this2 = this;
-
- mutations.forEach(function (mutation) {
- if (mutation.type === 'characterData' && (mutation.target === _this2.leftGuard || mutation.target === _this2.rightGuard)) {
- var range = _this2.restore(mutation.target);
- if (range) context.range = range;
- }
- });
- }
- }]);
-
- return Embed;
- }(_parchment2.default.Embed);
-
- exports.default = Embed;
-
- /***/
- }),
-/* 42 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.AlignStyle = exports.AlignClass = exports.AlignAttribute = undefined;
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- var config = {
- scope: _parchment2.default.Scope.BLOCK,
- whitelist: ['right', 'center', 'justify']
- };
-
- var AlignAttribute = new _parchment2.default.Attributor.Attribute('align', 'align', config);
- var AlignClass = new _parchment2.default.Attributor.Class('align', 'ql-align', config);
- var AlignStyle = new _parchment2.default.Attributor.Style('align', 'text-align', config);
-
- exports.AlignAttribute = AlignAttribute;
- exports.AlignClass = AlignClass;
- exports.AlignStyle = AlignStyle;
-
- /***/
- }),
-/* 43 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.DiffStyle = exports.DiffClass = exports.BackgroundStyle = exports.BackgroundClass = undefined;
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _color = __webpack_require__(28);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- var BackgroundClass = new _parchment2.default.Attributor.Class("background", "ql-bg", {
- scope: _parchment2.default.Scope.INLINE
- });
- var BackgroundStyle = new _color.ColorAttributor("background", "background-color", {
- scope: _parchment2.default.Scope.INLINE
- });
-
- var DiffClass = new _parchment2.default.Attributor.Class("diff", "ql-diff", {
- scope: _parchment2.default.Scope.INLINE
- });
- var DiffStyle = new _color.ColorAttributor("diff", "background-color", {
- scope: _parchment2.default.Scope.INLINE
- });
-
- exports.BackgroundClass = BackgroundClass;
- exports.BackgroundStyle = BackgroundStyle;
- exports.DiffClass = DiffClass;
- exports.DiffStyle = DiffStyle;
-
- /***/
- }),
-/* 44 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.DirectionStyle = exports.DirectionClass = exports.DirectionAttribute = undefined;
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- var config = {
- scope: _parchment2.default.Scope.BLOCK,
- whitelist: ['rtl']
- };
-
- var DirectionAttribute = new _parchment2.default.Attributor.Attribute('direction', 'dir', config);
- var DirectionClass = new _parchment2.default.Attributor.Class('direction', 'ql-direction', config);
- var DirectionStyle = new _parchment2.default.Attributor.Style('direction', 'direction', config);
-
- exports.DirectionAttribute = DirectionAttribute;
- exports.DirectionClass = DirectionClass;
- exports.DirectionStyle = DirectionStyle;
-
- /***/
- }),
-/* 45 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.FontClass = exports.FontStyle = undefined;
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var config = {
- scope: _parchment2.default.Scope.INLINE,
- whitelist: ['serif', 'monospace']
- };
-
- var FontClass = new _parchment2.default.Attributor.Class('font', 'ql-font', config);
-
- var FontStyleAttributor = function (_Parchment$Attributor) {
- _inherits(FontStyleAttributor, _Parchment$Attributor);
-
- function FontStyleAttributor() {
- _classCallCheck(this, FontStyleAttributor);
-
- return _possibleConstructorReturn(this, (FontStyleAttributor.__proto__ || Object.getPrototypeOf(FontStyleAttributor)).apply(this, arguments));
- }
-
- _createClass(FontStyleAttributor, [{
- key: 'value',
- value: function value(node) {
- return _get(FontStyleAttributor.prototype.__proto__ || Object.getPrototypeOf(FontStyleAttributor.prototype), 'value', this).call(this, node).replace(/["']/g, '');
- }
- }]);
-
- return FontStyleAttributor;
- }(_parchment2.default.Attributor.Style);
-
- var FontStyle = new FontStyleAttributor('font', 'font-family', config);
-
- exports.FontStyle = FontStyle;
- exports.FontClass = FontClass;
-
- /***/
- }),
-/* 46 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.SizeStyle = exports.SizeClass = undefined;
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- var SizeClass = new _parchment2.default.Attributor.Class('size', 'ql-size', {
- scope: _parchment2.default.Scope.INLINE,
- whitelist: ['small', 'large', 'huge']
- });
- var SizeStyle = new _parchment2.default.Attributor.Style('size', 'font-size', {
- scope: _parchment2.default.Scope.INLINE,
- whitelist: ['10px', '18px', '32px']
- });
-
- exports.SizeClass = SizeClass;
- exports.SizeStyle = SizeStyle;
-
- /***/
- }),
-/* 47 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- module.exports = {
- align: {
- "": __webpack_require__(94),
- center: __webpack_require__(95),
- right: __webpack_require__(96),
- justify: __webpack_require__(97)
- },
- background: __webpack_require__(98),
- blockquote: __webpack_require__(99),
- bold: __webpack_require__(100),
- clean: __webpack_require__(101),
- code: __webpack_require__(102),
- "code-block": __webpack_require__(103),
- color: __webpack_require__(104),
- direction: {
- "": __webpack_require__(105),
- rtl: __webpack_require__(106)
- },
- float: {
- center: __webpack_require__(107),
- full: __webpack_require__(108),
- left: __webpack_require__(109),
- right: __webpack_require__(110)
- },
- formula: __webpack_require__(111),
- header: {
- "1": __webpack_require__(112),
- "2": __webpack_require__(113),
- "3": __webpack_require__(114),
- "4": __webpack_require__(115),
- "5": __webpack_require__(116),
- "6": __webpack_require__(117)
- },
- italic: __webpack_require__(118),
- image: __webpack_require__(119),
- indent: {
- "+1": __webpack_require__(120),
- "-1": __webpack_require__(121)
- },
- link: __webpack_require__(122),
- list: {
- ordered: __webpack_require__(123),
- bullet: __webpack_require__(124),
- check: __webpack_require__(125)
- },
- script: {
- sub: __webpack_require__(126),
- super: __webpack_require__(127)
- },
- strike: __webpack_require__(128),
- underline: __webpack_require__(129),
- video: __webpack_require__(130)
- };
-
- /***/
- }),
-/* 48 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.getLastChangeIndex = exports.default = undefined;
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _quill = __webpack_require__(5);
-
- var _quill2 = _interopRequireDefault(_quill);
-
- var _module = __webpack_require__(9);
-
- var _module2 = _interopRequireDefault(_module);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var History = function (_Module) {
- _inherits(History, _Module);
-
- function History(quill, options) {
- _classCallCheck(this, History);
-
- var _this = _possibleConstructorReturn(this, (History.__proto__ || Object.getPrototypeOf(History)).call(this, quill, options));
-
- _this.lastRecorded = 0;
- _this.ignoreChange = false;
- _this.clear();
- _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (eventName, delta, oldDelta, source) {
- if (eventName !== _quill2.default.events.TEXT_CHANGE || _this.ignoreChange) return;
- if (!_this.options.userOnly || source === _quill2.default.sources.USER) {
- _this.record(delta, oldDelta);
- } else {
- _this.transform(delta);
- }
- });
- _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, _this.undo.bind(_this));
- _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, _this.redo.bind(_this));
- if (/Win/i.test(navigator.platform)) {
- _this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, _this.redo.bind(_this));
- }
- return _this;
- }
-
- _createClass(History, [{
- key: 'change',
- value: function change(source, dest) {
- if (this.stack[source].length === 0) return;
- var delta = this.stack[source].pop();
- this.stack[dest].push(delta);
- this.lastRecorded = 0;
- this.ignoreChange = true;
- this.quill.updateContents(delta[source], _quill2.default.sources.USER);
- this.ignoreChange = false;
- var index = getLastChangeIndex(delta[source]);
- this.quill.setSelection(index);
- }
- }, {
- key: 'clear',
- value: function clear() {
- this.stack = { undo: [], redo: [] };
- }
- }, {
- key: 'cutoff',
- value: function cutoff() {
- this.lastRecorded = 0;
- }
- }, {
- key: 'record',
- value: function record(changeDelta, oldDelta) {
- if (changeDelta.ops.length === 0) return;
- this.stack.redo = [];
- var undoDelta = this.quill.getContents().diff(oldDelta);
- var timestamp = Date.now();
- if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) {
- var delta = this.stack.undo.pop();
- undoDelta = undoDelta.compose(delta.undo);
- changeDelta = delta.redo.compose(changeDelta);
- } else {
- this.lastRecorded = timestamp;
- }
- this.stack.undo.push({
- redo: changeDelta,
- undo: undoDelta
- });
- if (this.stack.undo.length > this.options.maxStack) {
- this.stack.undo.shift();
- }
- }
- }, {
- key: 'redo',
- value: function redo() {
- this.change('redo', 'undo');
- }
- }, {
- key: 'transform',
- value: function transform(delta) {
- this.stack.undo.forEach(function (change) {
- change.undo = delta.transform(change.undo, true);
- change.redo = delta.transform(change.redo, true);
- });
- this.stack.redo.forEach(function (change) {
- change.undo = delta.transform(change.undo, true);
- change.redo = delta.transform(change.redo, true);
- });
- }
- }, {
- key: 'undo',
- value: function undo() {
- this.change('undo', 'redo');
- }
- }]);
-
- return History;
- }(_module2.default);
-
- History.DEFAULTS = {
- delay: 1000,
- maxStack: 100,
- userOnly: false
- };
-
- function endsWithNewlineChange(delta) {
- var lastOp = delta.ops[delta.ops.length - 1];
- if (lastOp == null) return false;
- if (lastOp.insert != null) {
- return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\n');
- }
- if (lastOp.attributes != null) {
- return Object.keys(lastOp.attributes).some(function (attr) {
- return _parchment2.default.query(attr, _parchment2.default.Scope.BLOCK) != null;
- });
- }
- return false;
- }
-
- function getLastChangeIndex(delta) {
- var deleteLength = delta.reduce(function (length, op) {
- length += op.delete || 0;
- return length;
- }, 0);
- var changeIndex = delta.length() - deleteLength;
- if (endsWithNewlineChange(delta)) {
- changeIndex -= 1;
- }
- return changeIndex;
- }
-
- exports.default = History;
- exports.getLastChangeIndex = getLastChangeIndex;
-
- /***/
- }),
-/* 49 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = exports.BaseTooltip = undefined;
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _extend = __webpack_require__(3);
-
- var _extend2 = _interopRequireDefault(_extend);
-
- var _quillDelta = __webpack_require__(1);
-
- var _quillDelta2 = _interopRequireDefault(_quillDelta);
-
- var _emitter = __webpack_require__(8);
-
- var _emitter2 = _interopRequireDefault(_emitter);
-
- var _keyboard = __webpack_require__(25);
-
- var _keyboard2 = _interopRequireDefault(_keyboard);
-
- var _theme = __webpack_require__(40);
-
- var _theme2 = _interopRequireDefault(_theme);
-
- var _colorPicker = __webpack_require__(77);
-
- var _colorPicker2 = _interopRequireDefault(_colorPicker);
-
- var _iconPicker = __webpack_require__(78);
-
- var _iconPicker2 = _interopRequireDefault(_iconPicker);
-
- var _picker = __webpack_require__(30);
-
- var _picker2 = _interopRequireDefault(_picker);
-
- var _tooltip = __webpack_require__(79);
-
- var _tooltip2 = _interopRequireDefault(_tooltip);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var ALIGNS = [false, 'center', 'right', 'justify'];
-
- var COLORS = ["#000000", "#e60000", "#ff9900", "#ffff00", "#008a00", "#0066cc", "#9933ff", "#ffffff", "#facccc", "#ffebcc", "#ffffcc", "#cce8cc", "#cce0f5", "#ebd6ff", "#bbbbbb", "#f06666", "#ffc266", "#ffff66", "#66b966", "#66a3e0", "#c285ff", "#888888", "#a10000", "#b26b00", "#b2b200", "#006100", "#0047b2", "#6b24b2", "#444444", "#5c0000", "#663d00", "#666600", "#003700", "#002966", "#3d1466"];
-
- var FONTS = [false, 'serif', 'monospace'];
-
- var HEADERS = ['1', '2', '3', false];
-
- var SIZES = ['small', false, 'large', 'huge'];
-
- var BaseTheme = function (_Theme) {
- _inherits(BaseTheme, _Theme);
-
- function BaseTheme(quill, options) {
- _classCallCheck(this, BaseTheme);
-
- var _this = _possibleConstructorReturn(this, (BaseTheme.__proto__ || Object.getPrototypeOf(BaseTheme)).call(this, quill, options));
-
- var listener = function listener(e) {
- if (!document.body.contains(quill.root)) {
- return document.body.removeEventListener('click', listener);
- }
- if (_this.tooltip != null && !_this.tooltip.root.contains(e.target) && document.activeElement !== _this.tooltip.textbox && !_this.quill.hasFocus()) {
- _this.tooltip.hide();
- }
- if (_this.pickers != null) {
- _this.pickers.forEach(function (picker) {
- if (!picker.container.contains(e.target)) {
- picker.close();
- }
- });
- }
- };
- quill.emitter.listenDOM('click', document.body, listener);
- return _this;
- }
-
- _createClass(BaseTheme, [{
- key: 'addModule',
- value: function addModule(name) {
- var module = _get(BaseTheme.prototype.__proto__ || Object.getPrototypeOf(BaseTheme.prototype), 'addModule', this).call(this, name);
- if (name === 'toolbar') {
- this.extendToolbar(module);
- }
- return module;
- }
- }, {
- key: 'buildButtons',
- value: function buildButtons(buttons, icons) {
- buttons.forEach(function (button) {
- var className = button.getAttribute('class') || '';
- className.split(/\s+/).forEach(function (name) {
- if (!name.startsWith('ql-')) return;
- name = name.slice('ql-'.length);
- if (icons[name] == null) return;
- if (name === 'direction') {
- button.innerHTML = icons[name][''] + icons[name]['rtl'];
- } else if (typeof icons[name] === 'string') {
- button.innerHTML = icons[name];
- } else {
- var value = button.value || '';
- if (value != null && icons[name][value]) {
- button.innerHTML = icons[name][value];
- }
- }
- });
- });
- }
- }, {
- key: 'buildPickers',
- value: function buildPickers(selects, icons) {
- var _this2 = this;
-
- this.pickers = selects.map(function (select) {
- if (select.classList.contains('ql-align')) {
- if (select.querySelector('option') == null) {
- fillSelect(select, ALIGNS);
- }
- return new _iconPicker2.default(select, icons.align);
- } else if (select.classList.contains('ql-background') || select.classList.contains('ql-color')) {
- var format = select.classList.contains('ql-background') ? 'background' : 'color';
- if (select.querySelector('option') == null) {
- fillSelect(select, COLORS, format === 'background' ? '#ffffff' : '#000000');
- }
- return new _colorPicker2.default(select, icons[format]);
- } else {
- if (select.querySelector('option') == null) {
- if (select.classList.contains('ql-font')) {
- fillSelect(select, FONTS);
- } else if (select.classList.contains('ql-header')) {
- fillSelect(select, HEADERS);
- } else if (select.classList.contains('ql-size')) {
- fillSelect(select, SIZES);
- }
- }
- return new _picker2.default(select);
- }
- });
- var update = function update() {
- _this2.pickers.forEach(function (picker) {
- picker.update();
- });
- };
- this.quill.on(_emitter2.default.events.EDITOR_CHANGE, update);
- }
- }]);
-
- return BaseTheme;
- }(_theme2.default);
-
- BaseTheme.DEFAULTS = (0, _extend2.default)(true, {}, _theme2.default.DEFAULTS, {
- modules: {
- toolbar: {
- handlers: {
- formula: function formula() {
- this.quill.theme.tooltip.edit('formula');
- },
- image: function image() {
- var _this3 = this;
-
- var fileInput = this.container.querySelector('input.ql-image[type=file]');
- if (fileInput == null) {
- fileInput = document.createElement('input');
- fileInput.setAttribute('type', 'file');
- fileInput.setAttribute('accept', 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon');
- fileInput.classList.add('ql-image');
- fileInput.addEventListener('change', function () {
- if (fileInput.files != null && fileInput.files[0] != null) {
- var reader = new FileReader();
- reader.onload = function (e) {
- var range = _this3.quill.getSelection(true);
- _this3.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert({ image: e.target.result }), _emitter2.default.sources.USER);
- _this3.quill.setSelection(range.index + 1, _emitter2.default.sources.SILENT);
- fileInput.value = "";
- };
- reader.readAsDataURL(fileInput.files[0]);
- }
- });
- this.container.appendChild(fileInput);
- }
- fileInput.click();
- },
- video: function video() {
- this.quill.theme.tooltip.edit('video');
- }
- }
- }
- }
- });
-
- var BaseTooltip = function (_Tooltip) {
- _inherits(BaseTooltip, _Tooltip);
-
- function BaseTooltip(quill, boundsContainer) {
- _classCallCheck(this, BaseTooltip);
-
- var _this4 = _possibleConstructorReturn(this, (BaseTooltip.__proto__ || Object.getPrototypeOf(BaseTooltip)).call(this, quill, boundsContainer));
-
- _this4.textbox = _this4.root.querySelector('input[type="text"]');
- _this4.listen();
- return _this4;
- }
-
- _createClass(BaseTooltip, [{
- key: 'listen',
- value: function listen() {
- var _this5 = this;
-
- this.textbox.addEventListener('keydown', function (event) {
- if (_keyboard2.default.match(event, 'enter')) {
- _this5.save();
- event.preventDefault();
- } else if (_keyboard2.default.match(event, 'escape')) {
- _this5.cancel();
- event.preventDefault();
- }
- });
- }
- }, {
- key: 'cancel',
- value: function cancel() {
- this.hide();
- }
- }, {
- key: 'edit',
- value: function edit() {
- var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'link';
- var preview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
-
- this.root.classList.remove('ql-hidden');
- this.root.classList.add('ql-editing');
- if (preview != null) {
- this.textbox.value = preview;
- } else if (mode !== this.root.getAttribute('data-mode')) {
- this.textbox.value = '';
- }
- this.position(this.quill.getBounds(this.quill.selection.savedRange));
- this.textbox.select();
- this.textbox.setAttribute('placeholder', this.textbox.getAttribute('data-' + mode) || '');
- this.root.setAttribute('data-mode', mode);
- }
- }, {
- key: 'restoreFocus',
- value: function restoreFocus() {
- var scrollTop = this.quill.scrollingContainer.scrollTop;
- this.quill.focus();
- this.quill.scrollingContainer.scrollTop = scrollTop;
- }
- }, {
- key: 'save',
- value: function save() {
- var value = this.textbox.value;
- switch (this.root.getAttribute('data-mode')) {
- case 'link':
- {
- var scrollTop = this.quill.root.scrollTop;
- if (this.linkRange) {
- this.quill.formatText(this.linkRange, 'link', value, _emitter2.default.sources.USER);
- delete this.linkRange;
- } else {
- this.restoreFocus();
- this.quill.format('link', value, _emitter2.default.sources.USER);
- }
- this.quill.root.scrollTop = scrollTop;
- break;
- }
- case 'video':
- {
- value = extractVideoUrl(value);
- } // eslint-disable-next-line no-fallthrough
- case 'formula':
- {
- if (!value) break;
- var range = this.quill.getSelection(true);
- if (range != null) {
- var index = range.index + range.length;
- this.quill.insertEmbed(index, this.root.getAttribute('data-mode'), value, _emitter2.default.sources.USER);
- if (this.root.getAttribute('data-mode') === 'formula') {
- this.quill.insertText(index + 1, ' ', _emitter2.default.sources.USER);
- }
- this.quill.setSelection(index + 2, _emitter2.default.sources.USER);
- }
- break;
- }
- default:
- }
- this.textbox.value = '';
- this.hide();
- }
- }]);
-
- return BaseTooltip;
- }(_tooltip2.default);
-
- function extractVideoUrl(url) {
- var match = url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/) || url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);
- if (match) {
- return (match[1] || 'https') + '://www.youtube.com/embed/' + match[2] + '?showinfo=0';
- }
- if (match = url.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/)) {
- // eslint-disable-line no-cond-assign
- return (match[1] || 'https') + '://player.vimeo.com/video/' + match[2] + '/';
- }
- return url;
- }
-
- function fillSelect(select, values) {
- var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
-
- values.forEach(function (value) {
- var option = document.createElement('option');
- if (value === defaultValue) {
- option.setAttribute('selected', 'selected');
- } else {
- option.setAttribute('value', value);
- }
- select.appendChild(option);
- });
- }
-
- exports.BaseTooltip = BaseTooltip;
- exports.default = BaseTheme;
-
- /***/
- }),
-/* 50 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- Object.defineProperty(exports, "__esModule", { value: true });
- var LinkedList = /** @class */ (function () {
- function LinkedList() {
- this.head = this.tail = null;
- this.length = 0;
- }
- LinkedList.prototype.append = function () {
- var nodes = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- nodes[_i] = arguments[_i];
- }
- this.insertBefore(nodes[0], null);
- if (nodes.length > 1) {
- this.append.apply(this, nodes.slice(1));
- }
- };
- LinkedList.prototype.contains = function (node) {
- var cur, next = this.iterator();
- while ((cur = next())) {
- if (cur === node)
- return true;
- }
- return false;
- };
- LinkedList.prototype.insertBefore = function (node, refNode) {
- if (!node)
- return;
- node.next = refNode;
- if (refNode != null) {
- node.prev = refNode.prev;
- if (refNode.prev != null) {
- refNode.prev.next = node;
- }
- refNode.prev = node;
- if (refNode === this.head) {
- this.head = node;
- }
- }
- else if (this.tail != null) {
- this.tail.next = node;
- node.prev = this.tail;
- this.tail = node;
- }
- else {
- node.prev = null;
- this.head = this.tail = node;
- }
- this.length += 1;
- };
- LinkedList.prototype.offset = function (target) {
- var index = 0, cur = this.head;
- while (cur != null) {
- if (cur === target)
- return index;
- index += cur.length();
- cur = cur.next;
- }
- return -1;
- };
- LinkedList.prototype.remove = function (node) {
- if (!this.contains(node))
- return;
- if (node.prev != null)
- node.prev.next = node.next;
- if (node.next != null)
- node.next.prev = node.prev;
- if (node === this.head)
- this.head = node.next;
- if (node === this.tail)
- this.tail = node.prev;
- this.length -= 1;
- };
- LinkedList.prototype.iterator = function (curNode) {
- if (curNode === void 0) { curNode = this.head; }
- // TODO use yield when we can
- return function () {
- var ret = curNode;
- if (curNode != null)
- curNode = curNode.next;
- return ret;
- };
- };
- LinkedList.prototype.find = function (index, inclusive) {
- if (inclusive === void 0) { inclusive = false; }
- var cur, next = this.iterator();
- while ((cur = next())) {
- var length = cur.length();
- if (index < length ||
- (inclusive && index === length && (cur.next == null || cur.next.length() !== 0))) {
- return [cur, index];
- }
- index -= length;
- }
- return [null, 0];
- };
- LinkedList.prototype.forEach = function (callback) {
- var cur, next = this.iterator();
- while ((cur = next())) {
- callback(cur);
- }
- };
- LinkedList.prototype.forEachAt = function (index, length, callback) {
- if (length <= 0)
- return;
- var _a = this.find(index), startNode = _a[0], offset = _a[1];
- var cur, curIndex = index - offset, next = this.iterator(startNode);
- while ((cur = next()) && curIndex < index + length) {
- var curLength = cur.length();
- if (index > curIndex) {
- callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index));
- }
- else {
- callback(cur, 0, Math.min(curLength, index + length - curIndex));
- }
- curIndex += curLength;
- }
- };
- LinkedList.prototype.map = function (callback) {
- return this.reduce(function (memo, cur) {
- memo.push(callback(cur));
- return memo;
- }, []);
- };
- LinkedList.prototype.reduce = function (callback, memo) {
- var cur, next = this.iterator();
- while ((cur = next())) {
- memo = callback(memo, cur);
- }
- return memo;
- };
- return LinkedList;
- }());
- exports.default = LinkedList;
-
-
- /***/
- }),
-/* 51 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var container_1 = __webpack_require__(17);
- var Registry = __webpack_require__(2);
- var OBSERVER_CONFIG = {
- attributes: true,
- characterData: true,
- characterDataOldValue: true,
- childList: true,
- subtree: true,
- };
- var MAX_OPTIMIZE_ITERATIONS = 100;
- var ScrollBlot = /** @class */ (function (_super) {
- __extends(ScrollBlot, _super);
- function ScrollBlot(node) {
- var _this = _super.call(this, node) || this;
- _this.scroll = _this;
- _this.observer = new MutationObserver(function (mutations) {
- _this.update(mutations);
- });
- _this.observer.observe(_this.domNode, OBSERVER_CONFIG);
- _this.attach();
- return _this;
- }
- ScrollBlot.prototype.detach = function () {
- _super.prototype.detach.call(this);
- this.observer.disconnect();
- };
- ScrollBlot.prototype.deleteAt = function (index, length) {
- this.update();
- if (index === 0 && length === this.length()) {
- this.children.forEach(function (child) {
- child.remove();
- });
- }
- else {
- _super.prototype.deleteAt.call(this, index, length);
- }
- };
- ScrollBlot.prototype.formatAt = function (index, length, name, value) {
- this.update();
- _super.prototype.formatAt.call(this, index, length, name, value);
- };
- ScrollBlot.prototype.insertAt = function (index, value, def) {
- this.update();
- _super.prototype.insertAt.call(this, index, value, def);
- };
- ScrollBlot.prototype.optimize = function (mutations, context) {
- var _this = this;
- if (mutations === void 0) { mutations = []; }
- if (context === void 0) { context = {}; }
- _super.prototype.optimize.call(this, context);
- // We must modify mutations directly, cannot make copy and then modify
- var records = [].slice.call(this.observer.takeRecords());
- // Array.push currently seems to be implemented by a non-tail recursive function
- // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords());
- while (records.length > 0)
- mutations.push(records.pop());
- // TODO use WeakMap
- var mark = function (blot, markParent) {
- if (markParent === void 0) { markParent = true; }
- if (blot == null || blot === _this)
- return;
- if (blot.domNode.parentNode == null)
- return;
- // @ts-ignore
- if (blot.domNode[Registry.DATA_KEY].mutations == null) {
- // @ts-ignore
- blot.domNode[Registry.DATA_KEY].mutations = [];
- }
- if (markParent)
- mark(blot.parent);
- };
- var optimize = function (blot) {
- // Post-order traversal
- if (
- // @ts-ignore
- blot.domNode[Registry.DATA_KEY] == null ||
- // @ts-ignore
- blot.domNode[Registry.DATA_KEY].mutations == null) {
- return;
- }
- if (blot instanceof container_1.default) {
- blot.children.forEach(optimize);
- }
- blot.optimize(context);
- };
- var remaining = mutations;
- for (var i = 0; remaining.length > 0; i += 1) {
- if (i >= MAX_OPTIMIZE_ITERATIONS) {
- throw new Error('[Parchment] Maximum optimize iterations reached');
- }
- remaining.forEach(function (mutation) {
- var blot = Registry.find(mutation.target, true);
- if (blot == null)
- return;
- if (blot.domNode === mutation.target) {
- if (mutation.type === 'childList') {
- mark(Registry.find(mutation.previousSibling, false));
- [].forEach.call(mutation.addedNodes, function (node) {
- var child = Registry.find(node, false);
- mark(child, false);
- if (child instanceof container_1.default) {
- child.children.forEach(function (grandChild) {
- mark(grandChild, false);
- });
- }
- });
- }
- else if (mutation.type === 'attributes') {
- mark(blot.prev);
- }
- }
- mark(blot);
- });
- this.children.forEach(optimize);
- remaining = [].slice.call(this.observer.takeRecords());
- records = remaining.slice();
- while (records.length > 0)
- mutations.push(records.pop());
- }
- };
- ScrollBlot.prototype.update = function (mutations, context) {
- var _this = this;
- if (context === void 0) { context = {}; }
- mutations = mutations || this.observer.takeRecords();
- // TODO use WeakMap
- mutations
- .map(function (mutation) {
- var blot = Registry.find(mutation.target, true);
- if (blot == null)
- return null;
- // @ts-ignore
- if (blot.domNode[Registry.DATA_KEY].mutations == null) {
- // @ts-ignore
- blot.domNode[Registry.DATA_KEY].mutations = [mutation];
- return blot;
- }
- else {
- // @ts-ignore
- blot.domNode[Registry.DATA_KEY].mutations.push(mutation);
- return null;
- }
- })
- .forEach(function (blot) {
- if (blot == null ||
- blot === _this ||
- //@ts-ignore
- blot.domNode[Registry.DATA_KEY] == null)
- return;
- // @ts-ignore
- blot.update(blot.domNode[Registry.DATA_KEY].mutations || [], context);
- });
- // @ts-ignore
- if (this.domNode[Registry.DATA_KEY].mutations != null) {
- // @ts-ignore
- _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations, context);
- }
- this.optimize(mutations, context);
- };
- ScrollBlot.blotName = 'scroll';
- ScrollBlot.defaultChild = 'block';
- ScrollBlot.scope = Registry.Scope.BLOCK_BLOT;
- ScrollBlot.tagName = 'DIV';
- return ScrollBlot;
- }(container_1.default));
- exports.default = ScrollBlot;
-
-
- /***/
- }),
-/* 52 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var format_1 = __webpack_require__(18);
- var Registry = __webpack_require__(2);
- // Shallow object comparison
- function isEqual(obj1, obj2) {
- if (Object.keys(obj1).length !== Object.keys(obj2).length)
- return false;
- // @ts-ignore
- for (var prop in obj1) {
- // @ts-ignore
- if (obj1[prop] !== obj2[prop])
- return false;
- }
- return true;
- }
- var InlineBlot = /** @class */ (function (_super) {
- __extends(InlineBlot, _super);
- function InlineBlot() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- InlineBlot.formats = function (domNode) {
- if (domNode.tagName === InlineBlot.tagName)
- return undefined;
- return _super.formats.call(this, domNode);
- };
- InlineBlot.prototype.format = function (name, value) {
- var _this = this;
- if (name === this.statics.blotName && !value) {
- this.children.forEach(function (child) {
- if (!(child instanceof format_1.default)) {
- child = child.wrap(InlineBlot.blotName, true);
- }
- _this.attributes.copy(child);
- });
- this.unwrap();
- }
- else {
- _super.prototype.format.call(this, name, value);
- }
- };
- InlineBlot.prototype.formatAt = function (index, length, name, value) {
- if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) {
- var blot = this.isolate(index, length);
- blot.format(name, value);
- }
- else {
- _super.prototype.formatAt.call(this, index, length, name, value);
- }
- };
- InlineBlot.prototype.optimize = function (context) {
- _super.prototype.optimize.call(this, context);
- var formats = this.formats();
- if (Object.keys(formats).length === 0) {
- return this.unwrap(); // unformatted span
- }
- var next = this.next;
- if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) {
- next.moveChildren(this);
- next.remove();
- }
- };
- InlineBlot.blotName = 'inline';
- InlineBlot.scope = Registry.Scope.INLINE_BLOT;
- InlineBlot.tagName = 'SPAN';
- return InlineBlot;
- }(format_1.default));
- exports.default = InlineBlot;
-
-
- /***/
- }),
-/* 53 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var format_1 = __webpack_require__(18);
- var Registry = __webpack_require__(2);
- var BlockBlot = /** @class */ (function (_super) {
- __extends(BlockBlot, _super);
- function BlockBlot() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- BlockBlot.formats = function (domNode) {
- var tagName = Registry.query(BlockBlot.blotName).tagName;
- if (domNode.tagName === tagName)
- return undefined;
- return _super.formats.call(this, domNode);
- };
- BlockBlot.prototype.format = function (name, value) {
- if (Registry.query(name, Registry.Scope.BLOCK) == null) {
- return;
- }
- else if (name === this.statics.blotName && !value) {
- this.replaceWith(BlockBlot.blotName);
- }
- else {
- _super.prototype.format.call(this, name, value);
- }
- };
- BlockBlot.prototype.formatAt = function (index, length, name, value) {
- if (Registry.query(name, Registry.Scope.BLOCK) != null) {
- this.format(name, value);
- }
- else {
- _super.prototype.formatAt.call(this, index, length, name, value);
- }
- };
- BlockBlot.prototype.insertAt = function (index, value, def) {
- if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) {
- // Insert text or inline
- _super.prototype.insertAt.call(this, index, value, def);
- }
- else {
- var after = this.split(index);
- var blot = Registry.create(value, def);
- after.parent.insertBefore(blot, after);
- }
- };
- BlockBlot.prototype.update = function (mutations, context) {
- if (navigator.userAgent.match(/Trident/)) {
- this.build();
- }
- else {
- _super.prototype.update.call(this, mutations, context);
- }
- };
- BlockBlot.blotName = 'block';
- BlockBlot.scope = Registry.Scope.BLOCK_BLOT;
- BlockBlot.tagName = 'P';
- return BlockBlot;
- }(format_1.default));
- exports.default = BlockBlot;
-
-
- /***/
- }),
-/* 54 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var leaf_1 = __webpack_require__(19);
- var EmbedBlot = /** @class */ (function (_super) {
- __extends(EmbedBlot, _super);
- function EmbedBlot() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- EmbedBlot.formats = function (domNode) {
- return undefined;
- };
- EmbedBlot.prototype.format = function (name, value) {
- // super.formatAt wraps, which is what we want in general,
- // but this allows subclasses to overwrite for formats
- // that just apply to particular embeds
- _super.prototype.formatAt.call(this, 0, this.length(), name, value);
- };
- EmbedBlot.prototype.formatAt = function (index, length, name, value) {
- if (index === 0 && length === this.length()) {
- this.format(name, value);
- }
- else {
- _super.prototype.formatAt.call(this, index, length, name, value);
- }
- };
- EmbedBlot.prototype.formats = function () {
- return this.statics.formats(this.domNode);
- };
- return EmbedBlot;
- }(leaf_1.default));
- exports.default = EmbedBlot;
-
-
- /***/
- }),
-/* 55 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var leaf_1 = __webpack_require__(19);
- var Registry = __webpack_require__(2);
- var TextBlot = /** @class */ (function (_super) {
- __extends(TextBlot, _super);
- function TextBlot(node) {
- var _this = _super.call(this, node) || this;
- _this.text = _this.statics.value(_this.domNode);
- return _this;
- }
- TextBlot.create = function (value) {
- return document.createTextNode(value);
- };
- TextBlot.value = function (domNode) {
- var text = domNode.data;
- // @ts-ignore
- if (text['normalize'])
- text = text['normalize']();
- return text;
- };
- TextBlot.prototype.deleteAt = function (index, length) {
- this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length);
- };
- TextBlot.prototype.index = function (node, offset) {
- if (this.domNode === node) {
- return offset;
- }
- return -1;
- };
- TextBlot.prototype.insertAt = function (index, value, def) {
- if (def == null) {
- this.text = this.text.slice(0, index) + value + this.text.slice(index);
- this.domNode.data = this.text;
- }
- else {
- _super.prototype.insertAt.call(this, index, value, def);
- }
- };
- TextBlot.prototype.length = function () {
- return this.text.length;
- };
- TextBlot.prototype.optimize = function (context) {
- _super.prototype.optimize.call(this, context);
- this.text = this.statics.value(this.domNode);
- if (this.text.length === 0) {
- this.remove();
- }
- else if (this.next instanceof TextBlot && this.next.prev === this) {
- this.insertAt(this.length(), this.next.value());
- this.next.remove();
- }
- };
- TextBlot.prototype.position = function (index, inclusive) {
- if (inclusive === void 0) { inclusive = false; }
- return [this.domNode, index];
- };
- TextBlot.prototype.split = function (index, force) {
- if (force === void 0) { force = false; }
- if (!force) {
- if (index === 0)
- return this;
- if (index === this.length())
- return this.next;
- }
- var after = Registry.create(this.domNode.splitText(index));
- this.parent.insertBefore(after, this.next);
- this.text = this.statics.value(this.domNode);
- return after;
- };
- TextBlot.prototype.update = function (mutations, context) {
- var _this = this;
- if (mutations.some(function (mutation) {
- return mutation.type === 'characterData' && mutation.target === _this.domNode;
- })) {
- this.text = this.statics.value(this.domNode);
- }
- };
- TextBlot.prototype.value = function () {
- return this.text;
- };
- TextBlot.blotName = 'text';
- TextBlot.scope = Registry.Scope.INLINE_BLOT;
- return TextBlot;
- }(leaf_1.default));
- exports.default = TextBlot;
-
-
- /***/
- }),
-/* 56 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var elem = document.createElement('div');
- elem.classList.toggle('test-class', false);
- if (elem.classList.contains('test-class')) {
- var _toggle = DOMTokenList.prototype.toggle;
- DOMTokenList.prototype.toggle = function (token, force) {
- if (arguments.length > 1 && !this.contains(token) === !force) {
- return force;
- } else {
- return _toggle.call(this, token);
- }
- };
- }
-
- if (!String.prototype.startsWith) {
- String.prototype.startsWith = function (searchString, position) {
- position = position || 0;
- return this.substr(position, searchString.length) === searchString;
- };
- }
-
- if (!String.prototype.endsWith) {
- String.prototype.endsWith = function (searchString, position) {
- var subjectString = this.toString();
- if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {
- position = subjectString.length;
- }
- position -= searchString.length;
- var lastIndex = subjectString.indexOf(searchString, position);
- return lastIndex !== -1 && lastIndex === position;
- };
- }
-
- if (!Array.prototype.find) {
- Object.defineProperty(Array.prototype, "find", {
- value: function value(predicate) {
- if (this === null) {
- throw new TypeError('Array.prototype.find called on null or undefined');
- }
- if (typeof predicate !== 'function') {
- throw new TypeError('predicate must be a function');
- }
- var list = Object(this);
- var length = list.length >>> 0;
- var thisArg = arguments[1];
- var value;
-
- for (var i = 0; i < length; i++) {
- value = list[i];
- if (predicate.call(thisArg, value, i, list)) {
- return value;
- }
- }
- return undefined;
- }
- });
- }
-
- document.addEventListener("DOMContentLoaded", function () {
- // Disable resizing in Firefox
- document.execCommand("enableObjectResizing", false, false);
- // Disable automatic linkifying in IE11
- document.execCommand("autoUrlDetect", false, false);
- });
-
- /***/
- }),
-/* 57 */
-/***/ (function (module, exports) {
-
- /**
- * This library modifies the diff-patch-match library by Neil Fraser
- * by removing the patch and match functionality and certain advanced
- * options in the diff function. The original license is as follows:
- *
- * ===
- *
- * Diff Match and Patch
- *
- * Copyright 2006 Google Inc.
- * http://code.google.com/p/google-diff-match-patch/
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
- /**
- * The data structure representing a diff is an array of tuples:
- * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]
- * which means: delete 'Hello', add 'Goodbye' and keep ' world.'
- */
- var DIFF_DELETE = -1;
- var DIFF_INSERT = 1;
- var DIFF_EQUAL = 0;
-
-
- /**
- * Find the differences between two texts. Simplifies the problem by stripping
- * any common prefix or suffix off the texts before diffing.
- * @param {string} text1 Old string to be diffed.
- * @param {string} text2 New string to be diffed.
- * @param {Int} cursor_pos Expected edit position in text1 (optional)
- * @return {Array} Array of diff tuples.
- */
- function diff_main(text1, text2, cursor_pos) {
- // Check for equality (speedup).
- if (text1 == text2) {
- if (text1) {
- return [[DIFF_EQUAL, text1]];
- }
- return [];
- }
-
- // Check cursor_pos within bounds
- if (cursor_pos < 0 || text1.length < cursor_pos) {
- cursor_pos = null;
- }
-
- // Trim off common prefix (speedup).
- var commonlength = diff_commonPrefix(text1, text2);
- var commonprefix = text1.substring(0, commonlength);
- text1 = text1.substring(commonlength);
- text2 = text2.substring(commonlength);
-
- // Trim off common suffix (speedup).
- commonlength = diff_commonSuffix(text1, text2);
- var commonsuffix = text1.substring(text1.length - commonlength);
- text1 = text1.substring(0, text1.length - commonlength);
- text2 = text2.substring(0, text2.length - commonlength);
-
- // Compute the diff on the middle block.
- var diffs = diff_compute_(text1, text2);
-
- // Restore the prefix and suffix.
- if (commonprefix) {
- diffs.unshift([DIFF_EQUAL, commonprefix]);
- }
- if (commonsuffix) {
- diffs.push([DIFF_EQUAL, commonsuffix]);
- }
- diff_cleanupMerge(diffs);
- if (cursor_pos != null) {
- diffs = fix_cursor(diffs, cursor_pos);
- }
- diffs = fix_emoji(diffs);
- return diffs;
- };
-
-
- /**
- * Find the differences between two texts. Assumes that the texts do not
- * have any common prefix or suffix.
- * @param {string} text1 Old string to be diffed.
- * @param {string} text2 New string to be diffed.
- * @return {Array} Array of diff tuples.
- */
- function diff_compute_(text1, text2) {
- var diffs;
-
- if (!text1) {
- // Just add some text (speedup).
- return [[DIFF_INSERT, text2]];
- }
-
- if (!text2) {
- // Just delete some text (speedup).
- return [[DIFF_DELETE, text1]];
- }
-
- var longtext = text1.length > text2.length ? text1 : text2;
- var shorttext = text1.length > text2.length ? text2 : text1;
- var i = longtext.indexOf(shorttext);
- if (i != -1) {
- // Shorter text is inside the longer text (speedup).
- diffs = [[DIFF_INSERT, longtext.substring(0, i)],
- [DIFF_EQUAL, shorttext],
- [DIFF_INSERT, longtext.substring(i + shorttext.length)]];
- // Swap insertions for deletions if diff is reversed.
- if (text1.length > text2.length) {
- diffs[0][0] = diffs[2][0] = DIFF_DELETE;
- }
- return diffs;
- }
-
- if (shorttext.length == 1) {
- // Single character string.
- // After the previous speedup, the character can't be an equality.
- return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
- }
-
- // Check to see if the problem can be split in two.
- var hm = diff_halfMatch_(text1, text2);
- if (hm) {
- // A half-match was found, sort out the return data.
- var text1_a = hm[0];
- var text1_b = hm[1];
- var text2_a = hm[2];
- var text2_b = hm[3];
- var mid_common = hm[4];
- // Send both pairs off for separate processing.
- var diffs_a = diff_main(text1_a, text2_a);
- var diffs_b = diff_main(text1_b, text2_b);
- // Merge the results.
- return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);
- }
-
- return diff_bisect_(text1, text2);
- };
-
-
- /**
- * Find the 'middle snake' of a diff, split the problem in two
- * and return the recursively constructed diff.
- * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.
- * @param {string} text1 Old string to be diffed.
- * @param {string} text2 New string to be diffed.
- * @return {Array} Array of diff tuples.
- * @private
- */
- function diff_bisect_(text1, text2) {
- // Cache the text lengths to prevent multiple calls.
- var text1_length = text1.length;
- var text2_length = text2.length;
- var max_d = Math.ceil((text1_length + text2_length) / 2);
- var v_offset = max_d;
- var v_length = 2 * max_d;
- var v1 = new Array(v_length);
- var v2 = new Array(v_length);
- // Setting all elements to -1 is faster in Chrome & Firefox than mixing
- // integers and undefined.
- for (var x = 0; x < v_length; x++) {
- v1[x] = -1;
- v2[x] = -1;
- }
- v1[v_offset + 1] = 0;
- v2[v_offset + 1] = 0;
- var delta = text1_length - text2_length;
- // If the total number of characters is odd, then the front path will collide
- // with the reverse path.
- var front = (delta % 2 != 0);
- // Offsets for start and end of k loop.
- // Prevents mapping of space beyond the grid.
- var k1start = 0;
- var k1end = 0;
- var k2start = 0;
- var k2end = 0;
- for (var d = 0; d < max_d; d++) {
- // Walk the front path one step.
- for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {
- var k1_offset = v_offset + k1;
- var x1;
- if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) {
- x1 = v1[k1_offset + 1];
- } else {
- x1 = v1[k1_offset - 1] + 1;
- }
- var y1 = x1 - k1;
- while (x1 < text1_length && y1 < text2_length &&
- text1.charAt(x1) == text2.charAt(y1)) {
- x1++;
- y1++;
- }
- v1[k1_offset] = x1;
- if (x1 > text1_length) {
- // Ran off the right of the graph.
- k1end += 2;
- } else if (y1 > text2_length) {
- // Ran off the bottom of the graph.
- k1start += 2;
- } else if (front) {
- var k2_offset = v_offset + delta - k1;
- if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) {
- // Mirror x2 onto top-left coordinate system.
- var x2 = text1_length - v2[k2_offset];
- if (x1 >= x2) {
- // Overlap detected.
- return diff_bisectSplit_(text1, text2, x1, y1);
- }
- }
- }
- }
-
- // Walk the reverse path one step.
- for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {
- var k2_offset = v_offset + k2;
- var x2;
- if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) {
- x2 = v2[k2_offset + 1];
- } else {
- x2 = v2[k2_offset - 1] + 1;
- }
- var y2 = x2 - k2;
- while (x2 < text1_length && y2 < text2_length &&
- text1.charAt(text1_length - x2 - 1) ==
- text2.charAt(text2_length - y2 - 1)) {
- x2++;
- y2++;
- }
- v2[k2_offset] = x2;
- if (x2 > text1_length) {
- // Ran off the left of the graph.
- k2end += 2;
- } else if (y2 > text2_length) {
- // Ran off the top of the graph.
- k2start += 2;
- } else if (!front) {
- var k1_offset = v_offset + delta - k2;
- if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) {
- var x1 = v1[k1_offset];
- var y1 = v_offset + x1 - k1_offset;
- // Mirror x2 onto top-left coordinate system.
- x2 = text1_length - x2;
- if (x1 >= x2) {
- // Overlap detected.
- return diff_bisectSplit_(text1, text2, x1, y1);
- }
- }
- }
- }
- }
- // Diff took too long and hit the deadline or
- // number of diffs equals number of characters, no commonality at all.
- return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
- };
-
-
- /**
- * Given the location of the 'middle snake', split the diff in two parts
- * and recurse.
- * @param {string} text1 Old string to be diffed.
- * @param {string} text2 New string to be diffed.
- * @param {number} x Index of split point in text1.
- * @param {number} y Index of split point in text2.
- * @return {Array} Array of diff tuples.
- */
- function diff_bisectSplit_(text1, text2, x, y) {
- var text1a = text1.substring(0, x);
- var text2a = text2.substring(0, y);
- var text1b = text1.substring(x);
- var text2b = text2.substring(y);
-
- // Compute both diffs serially.
- var diffs = diff_main(text1a, text2a);
- var diffsb = diff_main(text1b, text2b);
-
- return diffs.concat(diffsb);
- };
-
-
- /**
- * Determine the common prefix of two strings.
- * @param {string} text1 First string.
- * @param {string} text2 Second string.
- * @return {number} The number of characters common to the start of each
- * string.
- */
- function diff_commonPrefix(text1, text2) {
- // Quick check for common null cases.
- if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) {
- return 0;
- }
- // Binary search.
- // Performance analysis: http://neil.fraser.name/news/2007/10/09/
- var pointermin = 0;
- var pointermax = Math.min(text1.length, text2.length);
- var pointermid = pointermax;
- var pointerstart = 0;
- while (pointermin < pointermid) {
- if (text1.substring(pointerstart, pointermid) ==
- text2.substring(pointerstart, pointermid)) {
- pointermin = pointermid;
- pointerstart = pointermin;
- } else {
- pointermax = pointermid;
- }
- pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
- }
- return pointermid;
- };
-
-
- /**
- * Determine the common suffix of two strings.
- * @param {string} text1 First string.
- * @param {string} text2 Second string.
- * @return {number} The number of characters common to the end of each string.
- */
- function diff_commonSuffix(text1, text2) {
- // Quick check for common null cases.
- if (!text1 || !text2 ||
- text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) {
- return 0;
- }
- // Binary search.
- // Performance analysis: http://neil.fraser.name/news/2007/10/09/
- var pointermin = 0;
- var pointermax = Math.min(text1.length, text2.length);
- var pointermid = pointermax;
- var pointerend = 0;
- while (pointermin < pointermid) {
- if (text1.substring(text1.length - pointermid, text1.length - pointerend) ==
- text2.substring(text2.length - pointermid, text2.length - pointerend)) {
- pointermin = pointermid;
- pointerend = pointermin;
- } else {
- pointermax = pointermid;
- }
- pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
- }
- return pointermid;
- };
-
-
- /**
- * Do the two texts share a substring which is at least half the length of the
- * longer text?
- * This speedup can produce non-minimal diffs.
- * @param {string} text1 First string.
- * @param {string} text2 Second string.
- * @return {Array.<string>} Five element Array, containing the prefix of
- * text1, the suffix of text1, the prefix of text2, the suffix of
- * text2 and the common middle. Or null if there was no match.
- */
- function diff_halfMatch_(text1, text2) {
- var longtext = text1.length > text2.length ? text1 : text2;
- var shorttext = text1.length > text2.length ? text2 : text1;
- if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {
- return null; // Pointless.
- }
-
- /**
- * Does a substring of shorttext exist within longtext such that the substring
- * is at least half the length of longtext?
- * Closure, but does not reference any external variables.
- * @param {string} longtext Longer string.
- * @param {string} shorttext Shorter string.
- * @param {number} i Start index of quarter length substring within longtext.
- * @return {Array.<string>} Five element Array, containing the prefix of
- * longtext, the suffix of longtext, the prefix of shorttext, the suffix
- * of shorttext and the common middle. Or null if there was no match.
- * @private
- */
- function diff_halfMatchI_(longtext, shorttext, i) {
- // Start with a 1/4 length substring at position i as a seed.
- var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));
- var j = -1;
- var best_common = '';
- var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;
- while ((j = shorttext.indexOf(seed, j + 1)) != -1) {
- var prefixLength = diff_commonPrefix(longtext.substring(i),
- shorttext.substring(j));
- var suffixLength = diff_commonSuffix(longtext.substring(0, i),
- shorttext.substring(0, j));
- if (best_common.length < suffixLength + prefixLength) {
- best_common = shorttext.substring(j - suffixLength, j) +
- shorttext.substring(j, j + prefixLength);
- best_longtext_a = longtext.substring(0, i - suffixLength);
- best_longtext_b = longtext.substring(i + prefixLength);
- best_shorttext_a = shorttext.substring(0, j - suffixLength);
- best_shorttext_b = shorttext.substring(j + prefixLength);
- }
- }
- if (best_common.length * 2 >= longtext.length) {
- return [best_longtext_a, best_longtext_b,
- best_shorttext_a, best_shorttext_b, best_common];
- } else {
- return null;
- }
- }
-
- // First check if the second quarter is the seed for a half-match.
- var hm1 = diff_halfMatchI_(longtext, shorttext,
- Math.ceil(longtext.length / 4));
- // Check again based on the third quarter.
- var hm2 = diff_halfMatchI_(longtext, shorttext,
- Math.ceil(longtext.length / 2));
- var hm;
- if (!hm1 && !hm2) {
- return null;
- } else if (!hm2) {
- hm = hm1;
- } else if (!hm1) {
- hm = hm2;
- } else {
- // Both matched. Select the longest.
- hm = hm1[4].length > hm2[4].length ? hm1 : hm2;
- }
-
- // A half-match was found, sort out the return data.
- var text1_a, text1_b, text2_a, text2_b;
- if (text1.length > text2.length) {
- text1_a = hm[0];
- text1_b = hm[1];
- text2_a = hm[2];
- text2_b = hm[3];
- } else {
- text2_a = hm[0];
- text2_b = hm[1];
- text1_a = hm[2];
- text1_b = hm[3];
- }
- var mid_common = hm[4];
- return [text1_a, text1_b, text2_a, text2_b, mid_common];
- };
-
-
- /**
- * Reorder and merge like edit sections. Merge equalities.
- * Any edit section can move as long as it doesn't cross an equality.
- * @param {Array} diffs Array of diff tuples.
- */
- function diff_cleanupMerge(diffs) {
- diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.
- var pointer = 0;
- var count_delete = 0;
- var count_insert = 0;
- var text_delete = '';
- var text_insert = '';
- var commonlength;
- while (pointer < diffs.length) {
- switch (diffs[pointer][0]) {
- case DIFF_INSERT:
- count_insert++;
- text_insert += diffs[pointer][1];
- pointer++;
- break;
- case DIFF_DELETE:
- count_delete++;
- text_delete += diffs[pointer][1];
- pointer++;
- break;
- case DIFF_EQUAL:
- // Upon reaching an equality, check for prior redundancies.
- if (count_delete + count_insert > 1) {
- if (count_delete !== 0 && count_insert !== 0) {
- // Factor out any common prefixies.
- commonlength = diff_commonPrefix(text_insert, text_delete);
- if (commonlength !== 0) {
- if ((pointer - count_delete - count_insert) > 0 &&
- diffs[pointer - count_delete - count_insert - 1][0] ==
- DIFF_EQUAL) {
- diffs[pointer - count_delete - count_insert - 1][1] +=
- text_insert.substring(0, commonlength);
- } else {
- diffs.splice(0, 0, [DIFF_EQUAL,
- text_insert.substring(0, commonlength)]);
- pointer++;
- }
- text_insert = text_insert.substring(commonlength);
- text_delete = text_delete.substring(commonlength);
- }
- // Factor out any common suffixies.
- commonlength = diff_commonSuffix(text_insert, text_delete);
- if (commonlength !== 0) {
- diffs[pointer][1] = text_insert.substring(text_insert.length -
- commonlength) + diffs[pointer][1];
- text_insert = text_insert.substring(0, text_insert.length -
- commonlength);
- text_delete = text_delete.substring(0, text_delete.length -
- commonlength);
- }
- }
- // Delete the offending records and add the merged ones.
- if (count_delete === 0) {
- diffs.splice(pointer - count_insert,
- count_delete + count_insert, [DIFF_INSERT, text_insert]);
- } else if (count_insert === 0) {
- diffs.splice(pointer - count_delete,
- count_delete + count_insert, [DIFF_DELETE, text_delete]);
- } else {
- diffs.splice(pointer - count_delete - count_insert,
- count_delete + count_insert, [DIFF_DELETE, text_delete],
- [DIFF_INSERT, text_insert]);
- }
- pointer = pointer - count_delete - count_insert +
- (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1;
- } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {
- // Merge this equality with the previous one.
- diffs[pointer - 1][1] += diffs[pointer][1];
- diffs.splice(pointer, 1);
- } else {
- pointer++;
- }
- count_insert = 0;
- count_delete = 0;
- text_delete = '';
- text_insert = '';
- break;
- }
- }
- if (diffs[diffs.length - 1][1] === '') {
- diffs.pop(); // Remove the dummy entry at the end.
- }
-
- // Second pass: look for single edits surrounded on both sides by equalities
- // which can be shifted sideways to eliminate an equality.
- // e.g: A<ins>BA</ins>C -> <ins>AB</ins>AC
- var changes = false;
- pointer = 1;
- // Intentionally ignore the first and last element (don't need checking).
- while (pointer < diffs.length - 1) {
- if (diffs[pointer - 1][0] == DIFF_EQUAL &&
- diffs[pointer + 1][0] == DIFF_EQUAL) {
- // This is a single edit surrounded by equalities.
- if (diffs[pointer][1].substring(diffs[pointer][1].length -
- diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {
- // Shift the edit over the previous equality.
- diffs[pointer][1] = diffs[pointer - 1][1] +
- diffs[pointer][1].substring(0, diffs[pointer][1].length -
- diffs[pointer - 1][1].length);
- diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];
- diffs.splice(pointer - 1, 1);
- changes = true;
- } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==
- diffs[pointer + 1][1]) {
- // Shift the edit over the next equality.
- diffs[pointer - 1][1] += diffs[pointer + 1][1];
- diffs[pointer][1] =
- diffs[pointer][1].substring(diffs[pointer + 1][1].length) +
- diffs[pointer + 1][1];
- diffs.splice(pointer + 1, 1);
- changes = true;
- }
- }
- pointer++;
- }
- // If shifts were made, the diff needs reordering and another shift sweep.
- if (changes) {
- diff_cleanupMerge(diffs);
- }
- };
-
-
- var diff = diff_main;
- diff.INSERT = DIFF_INSERT;
- diff.DELETE = DIFF_DELETE;
- diff.EQUAL = DIFF_EQUAL;
-
- module.exports = diff;
-
- /*
- * Modify a diff such that the cursor position points to the start of a change:
- * E.g.
- * cursor_normalize_diff([[DIFF_EQUAL, 'abc']], 1)
- * => [1, [[DIFF_EQUAL, 'a'], [DIFF_EQUAL, 'bc']]]
- * cursor_normalize_diff([[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xyz']], 2)
- * => [2, [[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xy'], [DIFF_DELETE, 'z']]]
- *
- * @param {Array} diffs Array of diff tuples
- * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds!
- * @return {Array} A tuple [cursor location in the modified diff, modified diff]
- */
- function cursor_normalize_diff(diffs, cursor_pos) {
- if (cursor_pos === 0) {
- return [DIFF_EQUAL, diffs];
- }
- for (var current_pos = 0, i = 0; i < diffs.length; i++) {
- var d = diffs[i];
- if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) {
- var next_pos = current_pos + d[1].length;
- if (cursor_pos === next_pos) {
- return [i + 1, diffs];
- } else if (cursor_pos < next_pos) {
- // copy to prevent side effects
- diffs = diffs.slice();
- // split d into two diff changes
- var split_pos = cursor_pos - current_pos;
- var d_left = [d[0], d[1].slice(0, split_pos)];
- var d_right = [d[0], d[1].slice(split_pos)];
- diffs.splice(i, 1, d_left, d_right);
- return [i + 1, diffs];
- } else {
- current_pos = next_pos;
- }
- }
- }
- throw new Error('cursor_pos is out of bounds!')
- }
-
- /*
- * Modify a diff such that the edit position is "shifted" to the proposed edit location (cursor_position).
- *
- * Case 1)
- * Check if a naive shift is possible:
- * [0, X], [ 1, Y] -> [ 1, Y], [0, X] (if X + Y === Y + X)
- * [0, X], [-1, Y] -> [-1, Y], [0, X] (if X + Y === Y + X) - holds same result
- * Case 2)
- * Check if the following shifts are possible:
- * [0, 'pre'], [ 1, 'prefix'] -> [ 1, 'pre'], [0, 'pre'], [ 1, 'fix']
- * [0, 'pre'], [-1, 'prefix'] -> [-1, 'pre'], [0, 'pre'], [-1, 'fix']
- * ^ ^
- * d d_next
- *
- * @param {Array} diffs Array of diff tuples
- * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds!
- * @return {Array} Array of diff tuples
- */
- function fix_cursor(diffs, cursor_pos) {
- var norm = cursor_normalize_diff(diffs, cursor_pos);
- var ndiffs = norm[1];
- var cursor_pointer = norm[0];
- var d = ndiffs[cursor_pointer];
- var d_next = ndiffs[cursor_pointer + 1];
-
- if (d == null) {
- // Text was deleted from end of original string,
- // cursor is now out of bounds in new string
- return diffs;
- } else if (d[0] !== DIFF_EQUAL) {
- // A modification happened at the cursor location.
- // This is the expected outcome, so we can return the original diff.
- return diffs;
- } else {
- if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) {
- // Case 1)
- // It is possible to perform a naive shift
- ndiffs.splice(cursor_pointer, 2, d_next, d)
- return merge_tuples(ndiffs, cursor_pointer, 2)
- } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) {
- // Case 2)
- // d[1] is a prefix of d_next[1]
- // We can assume that d_next[0] !== 0, since d[0] === 0
- // Shift edit locations..
- ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]);
- var suffix = d_next[1].slice(d[1].length);
- if (suffix.length > 0) {
- ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]);
- }
- return merge_tuples(ndiffs, cursor_pointer, 3)
- } else {
- // Not possible to perform any modification
- return diffs;
- }
- }
- }
-
- /*
- * Check diff did not split surrogate pairs.
- * Ex. [0, '\uD83D'], [-1, '\uDC36'], [1, '\uDC2F'] -> [-1, '\uD83D\uDC36'], [1, '\uD83D\uDC2F']
- * '\uD83D\uDC36' === '🐶', '\uD83D\uDC2F' === '🐯'
- *
- * @param {Array} diffs Array of diff tuples
- * @return {Array} Array of diff tuples
- */
- function fix_emoji(diffs) {
- var compact = false;
- var starts_with_pair_end = function (str) {
- return str.charCodeAt(0) >= 0xDC00 && str.charCodeAt(0) <= 0xDFFF;
- }
- var ends_with_pair_start = function (str) {
- return str.charCodeAt(str.length - 1) >= 0xD800 && str.charCodeAt(str.length - 1) <= 0xDBFF;
- }
- for (var i = 2; i < diffs.length; i += 1) {
- if (diffs[i - 2][0] === DIFF_EQUAL && ends_with_pair_start(diffs[i - 2][1]) &&
- diffs[i - 1][0] === DIFF_DELETE && starts_with_pair_end(diffs[i - 1][1]) &&
- diffs[i][0] === DIFF_INSERT && starts_with_pair_end(diffs[i][1])) {
- compact = true;
-
- diffs[i - 1][1] = diffs[i - 2][1].slice(-1) + diffs[i - 1][1];
- diffs[i][1] = diffs[i - 2][1].slice(-1) + diffs[i][1];
-
- diffs[i - 2][1] = diffs[i - 2][1].slice(0, -1);
- }
- }
- if (!compact) {
- return diffs;
- }
- var fixed_diffs = [];
- for (var i = 0; i < diffs.length; i += 1) {
- if (diffs[i][1].length > 0) {
- fixed_diffs.push(diffs[i]);
- }
- }
- return fixed_diffs;
- }
-
- /*
- * Try to merge tuples with their neigbors in a given range.
- * E.g. [0, 'a'], [0, 'b'] -> [0, 'ab']
- *
- * @param {Array} diffs Array of diff tuples.
- * @param {Int} start Position of the first element to merge (diffs[start] is also merged with diffs[start - 1]).
- * @param {Int} length Number of consecutive elements to check.
- * @return {Array} Array of merged diff tuples.
- */
- function merge_tuples(diffs, start, length) {
- // Check from (start-1) to (start+length).
- for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) {
- if (i + 1 < diffs.length) {
- var left_d = diffs[i];
- var right_d = diffs[i + 1];
- if (left_d[0] === right_d[1]) {
- diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]);
- }
- }
- }
- return diffs;
- }
-
-
- /***/
- }),
-/* 58 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var keysShim;
- if (!Object.keys) {
- // modified from https://github.com/es-shims/es5-shim
- var has = Object.prototype.hasOwnProperty;
- var toStr = Object.prototype.toString;
- var isArgs = __webpack_require__(37); // eslint-disable-line global-require
- var isEnumerable = Object.prototype.propertyIsEnumerable;
- var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
- var hasProtoEnumBug = isEnumerable.call(function () { }, 'prototype');
- var dontEnums = [
- 'toString',
- 'toLocaleString',
- 'valueOf',
- 'hasOwnProperty',
- 'isPrototypeOf',
- 'propertyIsEnumerable',
- 'constructor'
- ];
- var equalsConstructorPrototype = function (o) {
- var ctor = o.constructor;
- return ctor && ctor.prototype === o;
- };
- var excludedKeys = {
- $applicationCache: true,
- $console: true,
- $external: true,
- $frame: true,
- $frameElement: true,
- $frames: true,
- $innerHeight: true,
- $innerWidth: true,
- $onmozfullscreenchange: true,
- $onmozfullscreenerror: true,
- $outerHeight: true,
- $outerWidth: true,
- $pageXOffset: true,
- $pageYOffset: true,
- $parent: true,
- $scrollLeft: true,
- $scrollTop: true,
- $scrollX: true,
- $scrollY: true,
- $self: true,
- $webkitIndexedDB: true,
- $webkitStorageInfo: true,
- $window: true
- };
- var hasAutomationEqualityBug = (function () {
- /* global window */
- if (typeof window === 'undefined') { return false; }
- for (var k in window) {
- try {
- if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
- try {
- equalsConstructorPrototype(window[k]);
- } catch (e) {
- return true;
- }
- }
- } catch (e) {
- return true;
- }
- }
- return false;
- }());
- var equalsConstructorPrototypeIfNotBuggy = function (o) {
- /* global window */
- if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
- return equalsConstructorPrototype(o);
- }
- try {
- return equalsConstructorPrototype(o);
- } catch (e) {
- return false;
- }
- };
-
- keysShim = function keys(object) {
- var isObject = object !== null && typeof object === 'object';
- var isFunction = toStr.call(object) === '[object Function]';
- var isArguments = isArgs(object);
- var isString = isObject && toStr.call(object) === '[object String]';
- var theKeys = [];
-
- if (!isObject && !isFunction && !isArguments) {
- throw new TypeError('Object.keys called on a non-object');
- }
-
- var skipProto = hasProtoEnumBug && isFunction;
- if (isString && object.length > 0 && !has.call(object, 0)) {
- for (var i = 0; i < object.length; ++i) {
- theKeys.push(String(i));
- }
- }
-
- if (isArguments && object.length > 0) {
- for (var j = 0; j < object.length; ++j) {
- theKeys.push(String(j));
- }
- } else {
- for (var name in object) {
- if (!(skipProto && name === 'prototype') && has.call(object, name)) {
- theKeys.push(String(name));
- }
- }
- }
-
- if (hasDontEnumBug) {
- var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
-
- for (var k = 0; k < dontEnums.length; ++k) {
- if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
- theKeys.push(dontEnums[k]);
- }
- }
- }
- return theKeys;
- };
- }
- module.exports = keysShim;
-
-
- /***/
- }),
-/* 59 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
- var toStr = Object.prototype.toString;
-
- var isStandardArguments = function isArguments(value) {
- if (hasToStringTag && value && typeof value === 'object' && Symbol.toStringTag in value) {
- return false;
- }
- return toStr.call(value) === '[object Arguments]';
- };
-
- var isLegacyArguments = function isArguments(value) {
- if (isStandardArguments(value)) {
- return true;
- }
- return value !== null &&
- typeof value === 'object' &&
- typeof value.length === 'number' &&
- value.length >= 0 &&
- toStr.call(value) !== '[object Array]' &&
- toStr.call(value.callee) === '[object Function]';
- };
-
- var supportsStandardArguments = (function () {
- return isStandardArguments(arguments);
- }());
-
- isStandardArguments.isLegacyArguments = isLegacyArguments; // for tests
-
- module.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments;
-
-
- /***/
- }),
-/* 60 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- // http://www.ecma-international.org/ecma-262/6.0/#sec-object.is
-
- var numberIsNaN = function (value) {
- return value !== value;
- };
-
- module.exports = function is(a, b) {
- if (a === 0 && b === 0) {
- return 1 / a === 1 / b;
- }
- if (a === b) {
- return true;
- }
- if (numberIsNaN(a) && numberIsNaN(b)) {
- return true;
- }
- return false;
- };
-
-
-
- /***/
- }),
-/* 61 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var has = __webpack_require__(62);
- var regexExec = RegExp.prototype.exec;
- var gOPD = Object.getOwnPropertyDescriptor;
-
- var tryRegexExecCall = function tryRegexExec(value) {
- try {
- var lastIndex = value.lastIndex;
- value.lastIndex = 0; // eslint-disable-line no-param-reassign
-
- regexExec.call(value);
- return true;
- } catch (e) {
- return false;
- } finally {
- value.lastIndex = lastIndex; // eslint-disable-line no-param-reassign
- }
- };
- var toStr = Object.prototype.toString;
- var regexClass = '[object RegExp]';
- var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
-
- module.exports = function isRegex(value) {
- if (!value || typeof value !== 'object') {
- return false;
- }
- if (!hasToStringTag) {
- return toStr.call(value) === regexClass;
- }
-
- var descriptor = gOPD(value, 'lastIndex');
- var hasLastIndexDataProperty = descriptor && has(descriptor, 'value');
- if (!hasLastIndexDataProperty) {
- return false;
- }
-
- return tryRegexExecCall(value);
- };
-
-
- /***/
- }),
-/* 62 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var bind = __webpack_require__(20);
-
- module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
-
-
- /***/
- }),
-/* 63 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- /* eslint no-invalid-this: 1 */
-
- var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
- var slice = Array.prototype.slice;
- var toStr = Object.prototype.toString;
- var funcType = '[object Function]';
-
- module.exports = function bind(that) {
- var target = this;
- if (typeof target !== 'function' || toStr.call(target) !== funcType) {
- throw new TypeError(ERROR_MESSAGE + target);
- }
- var args = slice.call(arguments, 1);
-
- var bound;
- var binder = function () {
- if (this instanceof bound) {
- var result = target.apply(
- this,
- args.concat(slice.call(arguments))
- );
- if (Object(result) === result) {
- return result;
- }
- return this;
- } else {
- return target.apply(
- that,
- args.concat(slice.call(arguments))
- );
- }
- };
-
- var boundLength = Math.max(0, target.length - args.length);
- var boundArgs = [];
- for (var i = 0; i < boundLength; i++) {
- boundArgs.push('$' + i);
- }
-
- bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
-
- if (target.prototype) {
- var Empty = function Empty() { };
- Empty.prototype = target.prototype;
- bound.prototype = new Empty();
- Empty.prototype = null;
- }
-
- return bound;
- };
-
-
- /***/
- }),
-/* 64 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var define = __webpack_require__(21);
- var callBind = __webpack_require__(65);
-
- var implementation = __webpack_require__(38);
- var getPolyfill = __webpack_require__(39);
- var shim = __webpack_require__(70);
-
- var flagsBound = callBind(implementation);
-
- define(flagsBound, {
- getPolyfill: getPolyfill,
- implementation: implementation,
- shim: shim
- });
-
- module.exports = flagsBound;
-
-
- /***/
- }),
-/* 65 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var bind = __webpack_require__(20);
-
- var GetIntrinsic = __webpack_require__(66);
-
- var $Function = GetIntrinsic('%Function%');
- var $apply = $Function.apply;
- var $call = $Function.call;
-
- module.exports = function callBind() {
- return bind.apply($call, arguments);
- };
-
- module.exports.apply = function applyBind() {
- return bind.apply($apply, arguments);
- };
-
-
- /***/
- }),
-/* 66 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- /* globals
- Atomics,
- SharedArrayBuffer,
- */
-
- var undefined;
-
- var $TypeError = TypeError;
-
- var $gOPD = Object.getOwnPropertyDescriptor;
- if ($gOPD) {
- try {
- $gOPD({}, '');
- } catch (e) {
- $gOPD = null; // this is IE 8, which has a broken gOPD
- }
- }
-
- var throwTypeError = function () { throw new $TypeError(); };
- var ThrowTypeError = $gOPD
- ? (function () {
- try {
- // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
- arguments.callee; // IE 8 does not throw here
- return throwTypeError;
- } catch (calleeThrows) {
- try {
- // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
- return $gOPD(arguments, 'callee').get;
- } catch (gOPDthrows) {
- return throwTypeError;
- }
- }
- }())
- : throwTypeError;
-
- var hasSymbols = __webpack_require__(67)();
-
- var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
-
- var generator; // = function * () {};
- var generatorFunction = generator ? getProto(generator) : undefined;
- var asyncFn; // async function() {};
- var asyncFunction = asyncFn ? asyncFn.constructor : undefined;
- var asyncGen; // async function * () {};
- var asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined;
- var asyncGenIterator = asyncGen ? asyncGen() : undefined;
-
- var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
-
- var INTRINSICS = {
- '%Array%': Array,
- '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
- '%ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype,
- '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
- '%ArrayPrototype%': Array.prototype,
- '%ArrayProto_entries%': Array.prototype.entries,
- '%ArrayProto_forEach%': Array.prototype.forEach,
- '%ArrayProto_keys%': Array.prototype.keys,
- '%ArrayProto_values%': Array.prototype.values,
- '%AsyncFromSyncIteratorPrototype%': undefined,
- '%AsyncFunction%': asyncFunction,
- '%AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined,
- '%AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined,
- '%AsyncGeneratorFunction%': asyncGenFunction,
- '%AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined,
- '%AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined,
- '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
- '%Boolean%': Boolean,
- '%BooleanPrototype%': Boolean.prototype,
- '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
- '%DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype,
- '%Date%': Date,
- '%DatePrototype%': Date.prototype,
- '%decodeURI%': decodeURI,
- '%decodeURIComponent%': decodeURIComponent,
- '%encodeURI%': encodeURI,
- '%encodeURIComponent%': encodeURIComponent,
- '%Error%': Error,
- '%ErrorPrototype%': Error.prototype,
- '%eval%': eval, // eslint-disable-line no-eval
- '%EvalError%': EvalError,
- '%EvalErrorPrototype%': EvalError.prototype,
- '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
- '%Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype,
- '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
- '%Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype,
- '%Function%': Function,
- '%FunctionPrototype%': Function.prototype,
- '%Generator%': generator ? getProto(generator()) : undefined,
- '%GeneratorFunction%': generatorFunction,
- '%GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined,
- '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
- '%Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype,
- '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
- '%Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype,
- '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
- '%Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype,
- '%isFinite%': isFinite,
- '%isNaN%': isNaN,
- '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
- '%JSON%': typeof JSON === 'object' ? JSON : undefined,
- '%JSONParse%': typeof JSON === 'object' ? JSON.parse : undefined,
- '%Map%': typeof Map === 'undefined' ? undefined : Map,
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
- '%MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype,
- '%Math%': Math,
- '%Number%': Number,
- '%NumberPrototype%': Number.prototype,
- '%Object%': Object,
- '%ObjectPrototype%': Object.prototype,
- '%ObjProto_toString%': Object.prototype.toString,
- '%ObjProto_valueOf%': Object.prototype.valueOf,
- '%parseFloat%': parseFloat,
- '%parseInt%': parseInt,
- '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
- '%PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype,
- '%PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then,
- '%Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all,
- '%Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject,
- '%Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve,
- '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
- '%RangeError%': RangeError,
- '%RangeErrorPrototype%': RangeError.prototype,
- '%ReferenceError%': ReferenceError,
- '%ReferenceErrorPrototype%': ReferenceError.prototype,
- '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
- '%RegExp%': RegExp,
- '%RegExpPrototype%': RegExp.prototype,
- '%Set%': typeof Set === 'undefined' ? undefined : Set,
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
- '%SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype,
- '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
- '%SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype,
- '%String%': String,
- '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
- '%StringPrototype%': String.prototype,
- '%Symbol%': hasSymbols ? Symbol : undefined,
- '%SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined,
- '%SyntaxError%': SyntaxError,
- '%SyntaxErrorPrototype%': SyntaxError.prototype,
- '%ThrowTypeError%': ThrowTypeError,
- '%TypedArray%': TypedArray,
- '%TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined,
- '%TypeError%': $TypeError,
- '%TypeErrorPrototype%': $TypeError.prototype,
- '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
- '%Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype,
- '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
- '%Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype,
- '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
- '%Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype,
- '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
- '%Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype,
- '%URIError%': URIError,
- '%URIErrorPrototype%': URIError.prototype,
- '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
- '%WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype,
- '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet,
- '%WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype
- };
-
- var bind = __webpack_require__(20);
- var $replace = bind.call(Function.call, String.prototype.replace);
-
- /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
- var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
- var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
- var stringToPath = function stringToPath(string) {
- var result = [];
- $replace(string, rePropName, function (match, number, quote, subString) {
- result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : (number || match);
- });
- return result;
- };
- /* end adaptation */
-
- var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
- if (!(name in INTRINSICS)) {
- throw new SyntaxError('intrinsic ' + name + ' does not exist!');
- }
-
- // istanbul ignore if // hopefully this is impossible to test :-)
- if (typeof INTRINSICS[name] === 'undefined' && !allowMissing) {
- throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
- }
-
- return INTRINSICS[name];
- };
-
- module.exports = function GetIntrinsic(name, allowMissing) {
- if (typeof name !== 'string' || name.length === 0) {
- throw new TypeError('intrinsic name must be a non-empty string');
- }
- if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
- throw new TypeError('"allowMissing" argument must be a boolean');
- }
-
- var parts = stringToPath(name);
-
- var value = getBaseIntrinsic('%' + (parts.length > 0 ? parts[0] : '') + '%', allowMissing);
- for (var i = 1; i < parts.length; i += 1) {
- if (value != null) {
- if ($gOPD && (i + 1) >= parts.length) {
- var desc = $gOPD(value, parts[i]);
- if (!allowMissing && !(parts[i] in value)) {
- throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
- }
- value = desc ? (desc.get || desc.value) : value[parts[i]];
- } else {
- value = value[parts[i]];
- }
- }
- }
- return value;
- };
-
-
- /***/
- }),
-/* 67 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-/* WEBPACK VAR INJECTION */(function (global) {
-
- var origSymbol = global.Symbol;
- var hasSymbolSham = __webpack_require__(69);
-
- module.exports = function hasNativeSymbols() {
- if (typeof origSymbol !== 'function') { return false; }
- if (typeof Symbol !== 'function') { return false; }
- if (typeof origSymbol('foo') !== 'symbol') { return false; }
- if (typeof Symbol('bar') !== 'symbol') { return false; }
-
- return hasSymbolSham();
- };
-
- /* WEBPACK VAR INJECTION */
- }.call(exports, __webpack_require__(68)))
-
- /***/
- }),
-/* 68 */
-/***/ (function (module, exports) {
-
- var g;
-
- // This works in non-strict mode
- g = (function () {
- return this;
- })();
-
- try {
- // This works if eval is allowed (see CSP)
- g = g || Function("return this")() || (1, eval)("this");
- } catch (e) {
- // This works if the window reference is available
- if (typeof window === "object")
- g = window;
- }
-
- // g can still be undefined, but nothing to do about it...
- // We return undefined, instead of nothing here, so it's
- // easier to handle this case. if(!global) { ...}
-
- module.exports = g;
-
-
- /***/
- }),
-/* 69 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- /* eslint complexity: [2, 18], max-statements: [2, 33] */
- module.exports = function hasSymbols() {
- if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
- if (typeof Symbol.iterator === 'symbol') { return true; }
-
- var obj = {};
- var sym = Symbol('test');
- var symObj = Object(sym);
- if (typeof sym === 'string') { return false; }
-
- if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
- if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
-
- // temp disabled per https://github.com/ljharb/object.assign/issues/17
- // if (sym instanceof Symbol) { return false; }
- // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
- // if (!(symObj instanceof Symbol)) { return false; }
-
- // if (typeof Symbol.prototype.toString !== 'function') { return false; }
- // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
-
- var symVal = 42;
- obj[sym] = symVal;
- for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax
- if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
-
- if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
-
- var syms = Object.getOwnPropertySymbols(obj);
- if (syms.length !== 1 || syms[0] !== sym) { return false; }
-
- if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
-
- if (typeof Object.getOwnPropertyDescriptor === 'function') {
- var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
- if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
- }
-
- return true;
- };
-
-
- /***/
- }),
-/* 70 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var supportsDescriptors = __webpack_require__(21).supportsDescriptors;
- var getPolyfill = __webpack_require__(39);
- var gOPD = Object.getOwnPropertyDescriptor;
- var defineProperty = Object.defineProperty;
- var TypeErr = TypeError;
- var getProto = Object.getPrototypeOf;
- var regex = /a/;
-
- module.exports = function shimFlags() {
- if (!supportsDescriptors || !getProto) {
- throw new TypeErr('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');
- }
- var polyfill = getPolyfill();
- var proto = getProto(regex);
- var descriptor = gOPD(proto, 'flags');
- if (!descriptor || descriptor.get !== polyfill) {
- defineProperty(proto, 'flags', {
- configurable: true,
- enumerable: false,
- get: polyfill
- });
- }
- return polyfill;
- };
-
-
- /***/
- }),
-/* 71 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var getDay = Date.prototype.getDay;
- var tryDateObject = function tryDateGetDayCall(value) {
- try {
- getDay.call(value);
- return true;
- } catch (e) {
- return false;
- }
- };
-
- var toStr = Object.prototype.toString;
- var dateClass = '[object Date]';
- var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
-
- module.exports = function isDateObject(value) {
- if (typeof value !== 'object' || value === null) {
- return false;
- }
- return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass;
- };
-
-
- /***/
- }),
-/* 72 */
-/***/ (function (module, exports) {
-
- 'use strict';
-
- var has = Object.prototype.hasOwnProperty
- , prefix = '~';
-
- /**
- * Constructor to create a storage for our `EE` objects.
- * An `Events` instance is a plain object whose properties are event names.
- *
- * @constructor
- * @api private
- */
- function Events() { }
-
- //
- // We try to not inherit from `Object.prototype`. In some engines creating an
- // instance in this way is faster than calling `Object.create(null)` directly.
- // If `Object.create(null)` is not supported we prefix the event names with a
- // character to make sure that the built-in object properties are not
- // overridden or used as an attack vector.
- //
- if (Object.create) {
- Events.prototype = Object.create(null);
-
- //
- // This hack is needed because the `__proto__` property is still inherited in
- // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
- //
- if (!new Events().__proto__) prefix = false;
- }
-
- /**
- * Representation of a single event listener.
- *
- * @param {Function} fn The listener function.
- * @param {Mixed} context The context to invoke the listener with.
- * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
- * @constructor
- * @api private
- */
- function EE(fn, context, once) {
- this.fn = fn;
- this.context = context;
- this.once = once || false;
- }
-
- /**
- * Minimal `EventEmitter` interface that is molded against the Node.js
- * `EventEmitter` interface.
- *
- * @constructor
- * @api public
- */
- function EventEmitter() {
- this._events = new Events();
- this._eventsCount = 0;
- }
-
- /**
- * Return an array listing the events for which the emitter has registered
- * listeners.
- *
- * @returns {Array}
- * @api public
- */
- EventEmitter.prototype.eventNames = function eventNames() {
- var names = []
- , events
- , name;
-
- if (this._eventsCount === 0) return names;
-
- for (name in (events = this._events)) {
- if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
- }
-
- if (Object.getOwnPropertySymbols) {
- return names.concat(Object.getOwnPropertySymbols(events));
- }
-
- return names;
- };
-
- /**
- * Return the listeners registered for a given event.
- *
- * @param {String|Symbol} event The event name.
- * @param {Boolean} exists Only check if there are listeners.
- * @returns {Array|Boolean}
- * @api public
- */
- EventEmitter.prototype.listeners = function listeners(event, exists) {
- var evt = prefix ? prefix + event : event
- , available = this._events[evt];
-
- if (exists) return !!available;
- if (!available) return [];
- if (available.fn) return [available.fn];
-
- for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {
- ee[i] = available[i].fn;
- }
-
- return ee;
- };
-
- /**
- * Calls each of the listeners registered for a given event.
- *
- * @param {String|Symbol} event The event name.
- * @returns {Boolean} `true` if the event had listeners, else `false`.
- * @api public
- */
- EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
- var evt = prefix ? prefix + event : event;
-
- if (!this._events[evt]) return false;
-
- var listeners = this._events[evt]
- , len = arguments.length
- , args
- , i;
-
- if (listeners.fn) {
- if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
-
- switch (len) {
- case 1: return listeners.fn.call(listeners.context), true;
- case 2: return listeners.fn.call(listeners.context, a1), true;
- case 3: return listeners.fn.call(listeners.context, a1, a2), true;
- case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
- case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
- case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
- }
-
- for (i = 1, args = new Array(len - 1); i < len; i++) {
- args[i - 1] = arguments[i];
- }
-
- listeners.fn.apply(listeners.context, args);
- } else {
- var length = listeners.length
- , j;
-
- for (i = 0; i < length; i++) {
- if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
-
- switch (len) {
- case 1: listeners[i].fn.call(listeners[i].context); break;
- case 2: listeners[i].fn.call(listeners[i].context, a1); break;
- case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
- case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
- default:
- if (!args) for (j = 1, args = new Array(len - 1); j < len; j++) {
- args[j - 1] = arguments[j];
- }
-
- listeners[i].fn.apply(listeners[i].context, args);
- }
- }
- }
-
- return true;
- };
-
- /**
- * Add a listener for a given event.
- *
- * @param {String|Symbol} event The event name.
- * @param {Function} fn The listener function.
- * @param {Mixed} [context=this] The context to invoke the listener with.
- * @returns {EventEmitter} `this`.
- * @api public
- */
- EventEmitter.prototype.on = function on(event, fn, context) {
- var listener = new EE(fn, context || this)
- , evt = prefix ? prefix + event : event;
-
- if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
- else if (!this._events[evt].fn) this._events[evt].push(listener);
- else this._events[evt] = [this._events[evt], listener];
-
- return this;
- };
-
- /**
- * Add a one-time listener for a given event.
- *
- * @param {String|Symbol} event The event name.
- * @param {Function} fn The listener function.
- * @param {Mixed} [context=this] The context to invoke the listener with.
- * @returns {EventEmitter} `this`.
- * @api public
- */
- EventEmitter.prototype.once = function once(event, fn, context) {
- var listener = new EE(fn, context || this, true)
- , evt = prefix ? prefix + event : event;
-
- if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
- else if (!this._events[evt].fn) this._events[evt].push(listener);
- else this._events[evt] = [this._events[evt], listener];
-
- return this;
- };
-
- /**
- * Remove the listeners of a given event.
- *
- * @param {String|Symbol} event The event name.
- * @param {Function} fn Only remove the listeners that match this function.
- * @param {Mixed} context Only remove the listeners that have this context.
- * @param {Boolean} once Only remove one-time listeners.
- * @returns {EventEmitter} `this`.
- * @api public
- */
- EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
- var evt = prefix ? prefix + event : event;
-
- if (!this._events[evt]) return this;
- if (!fn) {
- if (--this._eventsCount === 0) this._events = new Events();
- else delete this._events[evt];
- return this;
- }
-
- var listeners = this._events[evt];
-
- if (listeners.fn) {
- if (
- listeners.fn === fn
- && (!once || listeners.once)
- && (!context || listeners.context === context)
- ) {
- if (--this._eventsCount === 0) this._events = new Events();
- else delete this._events[evt];
- }
- } else {
- for (var i = 0, events = [], length = listeners.length; i < length; i++) {
- if (
- listeners[i].fn !== fn
- || (once && !listeners[i].once)
- || (context && listeners[i].context !== context)
- ) {
- events.push(listeners[i]);
- }
- }
-
- //
- // Reset the array, or remove it completely if we have no more listeners.
- //
- if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
- else if (--this._eventsCount === 0) this._events = new Events();
- else delete this._events[evt];
- }
-
- return this;
- };
-
- /**
- * Remove all listeners, or those of the specified event.
- *
- * @param {String|Symbol} [event] The event name.
- * @returns {EventEmitter} `this`.
- * @api public
- */
- EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
- var evt;
-
- if (event) {
- evt = prefix ? prefix + event : event;
- if (this._events[evt]) {
- if (--this._eventsCount === 0) this._events = new Events();
- else delete this._events[evt];
- }
- } else {
- this._events = new Events();
- this._eventsCount = 0;
- }
-
- return this;
- };
-
- //
- // Alias methods names because people roll like that.
- //
- EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
- EventEmitter.prototype.addListener = EventEmitter.prototype.on;
-
- //
- // This function doesn't apply anymore.
- //
- EventEmitter.prototype.setMaxListeners = function setMaxListeners() {
- return this;
- };
-
- //
- // Expose the prefix.
- //
- EventEmitter.prefixed = prefix;
-
- //
- // Allow `EventEmitter` to be imported as module namespace.
- //
- EventEmitter.EventEmitter = EventEmitter;
-
- //
- // Expose the module.
- //
- if ('undefined' !== typeof module) {
- module.exports = EventEmitter;
- }
-
-
- /***/
- }),
-/* 73 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _quillDelta = __webpack_require__(1);
-
- var _quillDelta2 = _interopRequireDefault(_quillDelta);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- var DeltaTransformer = function () {
- function DeltaTransformer() {
- _classCallCheck(this, DeltaTransformer);
- }
-
- _createClass(DeltaTransformer, [{
- key: "highlightDifference",
- value: function highlightDifference(first, second, color) {
- var firstDelta = new _quillDelta2.default(first);
- var secondDelta = new _quillDelta2.default(second);
- var diff = secondDelta.diff(firstDelta);
- var colored = diff.map(function (op) {
- if (op.insert) {
- if (!op.attributes) op.attributes = {};
- if (op.attributes.background) return op;
- op.attributes.diff = color;
- }
- return op;
- });
- return secondDelta.compose(new _quillDelta2.default(colored));
- }
- }, {
- key: "cleanDifference",
- value: function cleanDifference(delta) {
- return delta.ops.map(function (op) {
- if (op.attributes && op.attributes.diff) {
- delete op.attributes.diff;
- }
- return op;
- });
- }
- }]);
-
- return DeltaTransformer;
- }();
-
- exports.default = DeltaTransformer;
-
- /***/
- }),
-/* 74 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.matchText = exports.matchSpacing = exports.matchNewline = exports.matchBlot = exports.matchAttributor = exports.default = undefined;
-
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
-
- var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _extend2 = __webpack_require__(3);
-
- var _extend3 = _interopRequireDefault(_extend2);
-
- var _quillDelta = __webpack_require__(1);
-
- var _quillDelta2 = _interopRequireDefault(_quillDelta);
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _quill = __webpack_require__(5);
-
- var _quill2 = _interopRequireDefault(_quill);
-
- var _logger = __webpack_require__(10);
-
- var _logger2 = _interopRequireDefault(_logger);
-
- var _module = __webpack_require__(9);
-
- var _module2 = _interopRequireDefault(_module);
-
- var _align = __webpack_require__(42);
-
- var _background = __webpack_require__(43);
-
- var _code = __webpack_require__(13);
-
- var _code2 = _interopRequireDefault(_code);
-
- var _color = __webpack_require__(28);
-
- var _direction = __webpack_require__(44);
-
- var _font = __webpack_require__(45);
-
- var _size = __webpack_require__(46);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var debug = (0, _logger2.default)("quill:clipboard");
-
- var DOM_KEY = "__ql-matcher";
-
- var CLIPBOARD_CONFIG = [[Node.TEXT_NODE, matchText], [Node.TEXT_NODE, matchNewline], ["br", matchBreak], [Node.ELEMENT_NODE, matchNewline], [Node.ELEMENT_NODE, matchBlot], [Node.ELEMENT_NODE, matchSpacing], [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ["li", matchIndent], ["b", matchAlias.bind(matchAlias, "bold")], ["i", matchAlias.bind(matchAlias, "italic")], ["style", matchIgnore]];
-
- var ATTRIBUTE_ATTRIBUTORS = [_align.AlignAttribute, _direction.DirectionAttribute].reduce(function (memo, attr) {
- memo[attr.keyName] = attr;
- return memo;
- }, {});
-
- var STYLE_ATTRIBUTORS = [_align.AlignStyle, _background.BackgroundStyle, _color.ColorStyle, _direction.DirectionStyle, _font.FontStyle, _size.SizeStyle].reduce(function (memo, attr) {
- memo[attr.keyName] = attr;
- return memo;
- }, {});
-
- var Clipboard = function (_Module) {
- _inherits(Clipboard, _Module);
-
- function Clipboard(quill, options) {
- _classCallCheck(this, Clipboard);
-
- var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this, quill, options));
-
- _this.quill.root.addEventListener("paste", _this.onPaste.bind(_this));
- _this.container = _this.quill.addContainer("ql-clipboard");
- _this.container.setAttribute("contenteditable", true);
- _this.container.setAttribute("tabindex", -1);
- _this.matchers = [];
- CLIPBOARD_CONFIG.concat(_this.options.matchers).forEach(function (_ref) {
- var _ref2 = _slicedToArray(_ref, 2),
- selector = _ref2[0],
- matcher = _ref2[1];
-
- if (!options.matchVisual && matcher === matchSpacing) return;
- _this.addMatcher(selector, matcher);
- });
- return _this;
- }
-
- _createClass(Clipboard, [{
- key: "addMatcher",
- value: function addMatcher(selector, matcher) {
- this.matchers.push([selector, matcher]);
- }
- }, {
- key: "convert",
- value: function convert(html) {
- if (typeof html === "string") {
- this.container.innerHTML = html.replace(/\>\r?\n +\</g, "><"); // Remove spaces between tags
- return this.convert();
- }
- var formats = this.quill.getFormat(this.quill.selection.savedRange.index);
- if (formats[_code2.default.blotName]) {
- var text = this.container.innerText;
- this.container.innerHTML = "";
- return new _quillDelta2.default().insert(text, _defineProperty({}, _code2.default.blotName, formats[_code2.default.blotName]));
- }
-
- var _prepareMatching = this.prepareMatching(),
- _prepareMatching2 = _slicedToArray(_prepareMatching, 2),
- elementMatchers = _prepareMatching2[0],
- textMatchers = _prepareMatching2[1];
-
- var delta = traverse(this.container, elementMatchers, textMatchers);
- // Remove trailing newline
- if (deltaEndsWith(delta, "\n") && delta.ops[delta.ops.length - 1].attributes == null) {
- delta = delta.compose(new _quillDelta2.default().retain(delta.length() - 1).delete(1));
- }
- debug.log("convert", this.container.innerHTML, delta);
- this.container.innerHTML = "";
- return delta;
- }
- }, {
- key: "dangerouslyPasteHTML",
- value: function dangerouslyPasteHTML(index, html) {
- var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _quill2.default.sources.API;
-
- if (typeof index === "string") {
- this.quill.setContents(this.convert(index), html);
- this.quill.setSelection(0, _quill2.default.sources.SILENT);
- } else {
- var paste = this.convert(html);
- this.quill.updateContents(new _quillDelta2.default().retain(index).concat(paste), source);
- this.quill.setSelection(index + paste.length(), _quill2.default.sources.SILENT);
- }
- }
- }, {
- key: "onPaste",
- value: function onPaste(e) {
- var _this2 = this;
-
- var text = e.clipboardData.getData("Text");
- var isVeryLargeText = false;
- if (text.length > 25000) {
- e.preventDefault();
- this.container.innerHTML = text;
- isVeryLargeText = true;
- }
- if (!this.quill.isEnabled()) return;
- var range = this.quill.getSelection();
- var delta = new _quillDelta2.default().retain(range.index);
- var scrollTop = this.quill.scrollingContainer.scrollTop;
- this.container.focus();
- this.quill.selection.update(_quill2.default.sources.SILENT);
- setTimeout(function () {
- if (isVeryLargeText) {
- _this2.quill.deleteText(range.index, range.length, _quill2.default.sources.SILENT);
- _this2.quill.insertText(range.index, _this2.container.innerHTML, _quill2.default.sources.USER);
- _this2.quill.setSelection(range.index + _this2.container.innerHTML.length, _quill2.default.sources.SILENT);
- } else {
- delta = delta.concat(_this2.convert()).delete(range.length);
- _this2.quill.updateContents(delta, _quill2.default.sources.USER);
- // range.length contributes to delta.length()
- _this2.quill.setSelection(delta.length() - range.length, _quill2.default.sources.SILENT);
- }
- _this2.quill.scrollingContainer.scrollTop = scrollTop;
- _this2.quill.focus();
- }, 1);
- }
- }, {
- key: "prepareMatching",
- value: function prepareMatching() {
- var _this3 = this;
-
- var elementMatchers = [],
- textMatchers = [];
- this.matchers.forEach(function (pair) {
- var _pair = _slicedToArray(pair, 2),
- selector = _pair[0],
- matcher = _pair[1];
-
- switch (selector) {
- case Node.TEXT_NODE:
- textMatchers.push(matcher);
- break;
- case Node.ELEMENT_NODE:
- elementMatchers.push(matcher);
- break;
- default:
- [].forEach.call(_this3.container.querySelectorAll(selector), function (node) {
- // TODO use weakmap
- node[DOM_KEY] = node[DOM_KEY] || [];
- node[DOM_KEY].push(matcher);
- });
- break;
- }
- });
- return [elementMatchers, textMatchers];
- }
- }]);
-
- return Clipboard;
- }(_module2.default);
-
- Clipboard.DEFAULTS = {
- matchers: [],
- matchVisual: true
- };
-
- function applyFormat(delta, format, value) {
- if ((typeof format === "undefined" ? "undefined" : _typeof(format)) === "object") {
- return Object.keys(format).reduce(function (delta, key) {
- return applyFormat(delta, key, format[key]);
- }, delta);
- } else {
- return delta.reduce(function (delta, op) {
- if (op.attributes && op.attributes[format]) {
- return delta.push(op);
- } else {
- return delta.insert(op.insert, (0, _extend3.default)({}, _defineProperty({}, format, value), op.attributes));
- }
- }, new _quillDelta2.default());
- }
- }
-
- function computeStyle(node) {
- if (node.nodeType !== Node.ELEMENT_NODE) return {};
- var DOM_KEY = "__ql-computed-style";
- return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node));
- }
-
- function deltaEndsWith(delta, text) {
- var endText = "";
- for (var i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) {
- var op = delta.ops[i];
- if (typeof op.insert !== "string") break;
- endText = op.insert + endText;
- }
- return endText.slice(-1 * text.length) === text;
- }
-
- function isLine(node) {
- if (node.childNodes.length === 0) return false; // Exclude embed blocks
- var style = computeStyle(node);
- return ["block", "list-item"].indexOf(style.display) > -1;
- }
-
- function traverse(node, elementMatchers, textMatchers) {
- // Post-order
- if (node.nodeType === node.TEXT_NODE) {
- return textMatchers.reduce(function (delta, matcher) {
- return matcher(node, delta);
- }, new _quillDelta2.default());
- } else if (node.nodeType === node.ELEMENT_NODE) {
- return [].reduce.call(node.childNodes || [], function (delta, childNode) {
- var childrenDelta = traverse(childNode, elementMatchers, textMatchers);
- if (childNode.nodeType === node.ELEMENT_NODE) {
- childrenDelta = elementMatchers.reduce(function (childrenDelta, matcher) {
- return matcher(childNode, childrenDelta);
- }, childrenDelta);
- childrenDelta = (childNode[DOM_KEY] || []).reduce(function (childrenDelta, matcher) {
- return matcher(childNode, childrenDelta);
- }, childrenDelta);
- }
- return delta.concat(childrenDelta);
- }, new _quillDelta2.default());
- } else {
- return new _quillDelta2.default();
- }
- }
-
- function matchAlias(format, node, delta) {
- return applyFormat(delta, format, true);
- }
-
- function matchAttributor(node, delta) {
- var attributes = _parchment2.default.Attributor.Attribute.keys(node);
- var classes = _parchment2.default.Attributor.Class.keys(node);
- var styles = _parchment2.default.Attributor.Style.keys(node);
- var formats = {};
- attributes.concat(classes).concat(styles).forEach(function (name) {
- var attr = _parchment2.default.query(name, _parchment2.default.Scope.ATTRIBUTE);
- if (attr != null) {
- formats[attr.attrName] = attr.value(node);
- if (formats[attr.attrName]) return;
- }
- attr = ATTRIBUTE_ATTRIBUTORS[name];
- if (attr != null && (attr.attrName === name || attr.keyName === name)) {
- formats[attr.attrName] = attr.value(node) || undefined;
- }
- attr = STYLE_ATTRIBUTORS[name];
- if (attr != null && (attr.attrName === name || attr.keyName === name)) {
- attr = STYLE_ATTRIBUTORS[name];
- formats[attr.attrName] = attr.value(node) || undefined;
- }
- });
- if (Object.keys(formats).length > 0) {
- delta = applyFormat(delta, formats);
- }
- return delta;
- }
-
- function matchBlot(node, delta) {
- var match = _parchment2.default.query(node);
- if (match == null) return delta;
- if (match.prototype instanceof _parchment2.default.Embed) {
- var embed = {};
- var value = match.value(node);
- if (value != null) {
- embed[match.blotName] = value;
- delta = new _quillDelta2.default().insert(embed, match.formats(node));
- }
- } else if (typeof match.formats === "function") {
- delta = applyFormat(delta, match.blotName, match.formats(node));
- }
- return delta;
- }
-
- function matchBreak(node, delta) {
- if (!deltaEndsWith(delta, "\n")) {
- delta.insert("\n");
- }
- return delta;
- }
-
- function matchIgnore() {
- return new _quillDelta2.default();
- }
-
- function matchIndent(node, delta) {
- var match = _parchment2.default.query(node);
- if (match == null || match.blotName !== "list-item" || !deltaEndsWith(delta, "\n")) {
- return delta;
- }
- var indent = -1,
- parent = node.parentNode;
- while (!parent.classList.contains("ql-clipboard")) {
- if ((_parchment2.default.query(parent) || {}).blotName === "list") {
- indent += 1;
- }
- parent = parent.parentNode;
- }
- if (indent <= 0) return delta;
- return delta.compose(new _quillDelta2.default().retain(delta.length() - 1).retain(1, { indent: indent }));
- }
-
- function matchNewline(node, delta) {
- if (!deltaEndsWith(delta, "\n")) {
- if (isLine(node) || delta.length() > 0 && node.nextSibling && isLine(node.nextSibling)) {
- delta.insert("\n");
- }
- }
- return delta;
- }
-
- function matchSpacing(node, delta) {
- if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, "\n\n")) {
- var nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom);
- if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight * 1.5) {
- delta.insert("\n");
- }
- }
- return delta;
- }
-
- function matchStyles(node, delta) {
- var formats = {};
- var style = node.style || {};
- if (style.fontStyle && computeStyle(node).fontStyle === "italic") {
- formats.italic = true;
- }
- if (style.fontWeight && (computeStyle(node).fontWeight.startsWith("bold") || parseInt(computeStyle(node).fontWeight) >= 700)) {
- formats.bold = true;
- }
- if (Object.keys(formats).length > 0) {
- delta = applyFormat(delta, formats);
- }
- if (parseFloat(style.textIndent || 0) > 0) {
- // Could be 0.5in
- delta = new _quillDelta2.default().insert("\t").concat(delta);
- }
- return delta;
- }
-
- function matchText(node, delta) {
- var text = node.data;
- // Word represents empty line with <o:p>&nbsp;</o:p>
- if (node.parentNode.tagName === "O:P") {
- return delta.insert(text.trim());
- }
- if (text.trim().length === 0 && node.parentNode.classList.contains("ql-clipboard")) {
- return delta;
- }
- if (!computeStyle(node.parentNode).whiteSpace.startsWith("pre")) {
- // eslint-disable-next-line func-style
- var replacer = function replacer(collapse, match) {
- match = match.replace(/[^\u00a0]/g, ""); // \u00a0 is nbsp;
- return match.length < 1 && collapse ? " " : match;
- };
- text = text.replace(/\r\n/g, " ").replace(/\n/g, " ");
- text = text.replace(/\s\s+/g, replacer.bind(replacer, true)); // collapse whitespace
- if (node.previousSibling == null && isLine(node.parentNode) || node.previousSibling != null && isLine(node.previousSibling)) {
- text = text.replace(/^\s+/, replacer.bind(replacer, false));
- }
- if (node.nextSibling == null && isLine(node.parentNode) || node.nextSibling != null && isLine(node.nextSibling)) {
- text = text.replace(/\s+$/, replacer.bind(replacer, false));
- }
- }
- return delta.insert(text);
- }
-
- exports.default = Clipboard;
- exports.matchAttributor = matchAttributor;
- exports.matchBlot = matchBlot;
- exports.matchNewline = matchNewline;
- exports.matchSpacing = matchSpacing;
- exports.matchText = matchText;
-
- /***/
- }),
-/* 75 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _inline = __webpack_require__(6);
-
- var _inline2 = _interopRequireDefault(_inline);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var Bold = function (_Inline) {
- _inherits(Bold, _Inline);
-
- function Bold() {
- _classCallCheck(this, Bold);
-
- return _possibleConstructorReturn(this, (Bold.__proto__ || Object.getPrototypeOf(Bold)).apply(this, arguments));
- }
-
- _createClass(Bold, [{
- key: 'optimize',
- value: function optimize(context) {
- _get(Bold.prototype.__proto__ || Object.getPrototypeOf(Bold.prototype), 'optimize', this).call(this, context);
- if (this.domNode.tagName !== this.statics.tagName[0]) {
- this.replaceWith(this.statics.blotName);
- }
- }
- }], [{
- key: 'create',
- value: function create() {
- return _get(Bold.__proto__ || Object.getPrototypeOf(Bold), 'create', this).call(this);
- }
- }, {
- key: 'formats',
- value: function formats() {
- return true;
- }
- }]);
-
- return Bold;
- }(_inline2.default);
-
- Bold.blotName = 'bold';
- Bold.tagName = ['STRONG', 'B'];
-
- exports.default = Bold;
-
- /***/
- }),
-/* 76 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.addControls = exports.default = undefined;
-
- var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _quillDelta = __webpack_require__(1);
-
- var _quillDelta2 = _interopRequireDefault(_quillDelta);
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _quill = __webpack_require__(5);
-
- var _quill2 = _interopRequireDefault(_quill);
-
- var _logger = __webpack_require__(10);
-
- var _logger2 = _interopRequireDefault(_logger);
-
- var _module = __webpack_require__(9);
-
- var _module2 = _interopRequireDefault(_module);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var debug = (0, _logger2.default)('quill:toolbar');
-
- var Toolbar = function (_Module) {
- _inherits(Toolbar, _Module);
-
- function Toolbar(quill, options) {
- _classCallCheck(this, Toolbar);
-
- var _this = _possibleConstructorReturn(this, (Toolbar.__proto__ || Object.getPrototypeOf(Toolbar)).call(this, quill, options));
-
- if (Array.isArray(_this.options.container)) {
- var container = document.createElement('div');
- addControls(container, _this.options.container);
- quill.container.parentNode.insertBefore(container, quill.container);
- _this.container = container;
- } else if (typeof _this.options.container === 'string') {
- _this.container = document.querySelector(_this.options.container);
- } else {
- _this.container = _this.options.container;
- }
- if (!(_this.container instanceof HTMLElement)) {
- var _ret;
-
- return _ret = debug.error('Container required for toolbar', _this.options), _possibleConstructorReturn(_this, _ret);
- }
- _this.container.classList.add('ql-toolbar');
- _this.controls = [];
- _this.handlers = {};
- Object.keys(_this.options.handlers).forEach(function (format) {
- _this.addHandler(format, _this.options.handlers[format]);
- });
- [].forEach.call(_this.container.querySelectorAll('button, select'), function (input) {
- _this.attach(input);
- });
- _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (type, range) {
- if (type === _quill2.default.events.SELECTION_CHANGE) {
- _this.update(range);
- }
- });
- _this.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () {
- var _this$quill$selection = _this.quill.selection.getRange(),
- _this$quill$selection2 = _slicedToArray(_this$quill$selection, 1),
- range = _this$quill$selection2[0]; // quill.getSelection triggers update
-
-
- _this.update(range);
- });
- return _this;
- }
-
- _createClass(Toolbar, [{
- key: 'addHandler',
- value: function addHandler(format, handler) {
- this.handlers[format] = handler;
- }
- }, {
- key: 'attach',
- value: function attach(input) {
- var _this2 = this;
-
- var format = [].find.call(input.classList, function (className) {
- return className.indexOf('ql-') === 0;
- });
- if (!format) return;
- format = format.slice('ql-'.length);
- if (input.tagName === 'BUTTON') {
- input.setAttribute('type', 'button');
- }
- if (this.handlers[format] == null) {
- if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) {
- debug.warn('ignoring attaching to disabled format', format, input);
- return;
- }
- if (_parchment2.default.query(format) == null) {
- debug.warn('ignoring attaching to nonexistent format', format, input);
- return;
- }
- }
- var eventName = input.tagName === 'SELECT' ? 'change' : 'click';
- input.addEventListener(eventName, function (e) {
- var value = void 0;
- if (input.tagName === 'SELECT') {
- if (input.selectedIndex < 0) return;
- var selected = input.options[input.selectedIndex];
- if (selected.hasAttribute('selected')) {
- value = false;
- } else {
- value = selected.value || false;
- }
- } else {
- if (input.classList.contains('ql-active')) {
- value = false;
- } else {
- value = input.value || !input.hasAttribute('value');
- }
- e.preventDefault();
- }
- _this2.quill.focus();
-
- var _quill$selection$getR = _this2.quill.selection.getRange(),
- _quill$selection$getR2 = _slicedToArray(_quill$selection$getR, 1),
- range = _quill$selection$getR2[0];
-
- if (_this2.handlers[format] != null) {
- _this2.handlers[format].call(_this2, value);
- } else if (_parchment2.default.query(format).prototype instanceof _parchment2.default.Embed) {
- value = prompt('Enter ' + format);
- if (!value) return;
- _this2.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert(_defineProperty({}, format, value)), _quill2.default.sources.USER);
- } else {
- _this2.quill.format(format, value, _quill2.default.sources.USER);
- }
- _this2.update(range);
- });
- // TODO use weakmap
- this.controls.push([format, input]);
- }
- }, {
- key: 'update',
- value: function update(range) {
- var formats = range == null ? {} : this.quill.getFormat(range);
- this.controls.forEach(function (pair) {
- var _pair = _slicedToArray(pair, 2),
- format = _pair[0],
- input = _pair[1];
-
- if (input.tagName === 'SELECT') {
- var option = void 0;
- if (range == null) {
- option = null;
- } else if (formats[format] == null) {
- option = input.querySelector('option[selected]');
- } else if (!Array.isArray(formats[format])) {
- var value = formats[format];
- if (typeof value === 'string') {
- value = value.replace(/\"/g, '\\"');
- }
- option = input.querySelector('option[value="' + value + '"]');
- }
- if (option == null) {
- input.value = ''; // TODO make configurable?
- input.selectedIndex = -1;
- } else {
- option.selected = true;
- }
- } else {
- if (range == null) {
- input.classList.remove('ql-active');
- } else if (input.hasAttribute('value')) {
- // both being null should match (default values)
- // '1' should match with 1 (headers)
- var isActive = formats[format] === input.getAttribute('value') || formats[format] != null && formats[format].toString() === input.getAttribute('value') || formats[format] == null && !input.getAttribute('value');
- input.classList.toggle('ql-active', isActive);
- } else {
- input.classList.toggle('ql-active', formats[format] != null);
- }
- }
- });
- }
- }]);
-
- return Toolbar;
- }(_module2.default);
-
- Toolbar.DEFAULTS = {};
-
- function addButton(container, format, value) {
- var input = document.createElement('button');
- input.setAttribute('type', 'button');
- input.classList.add('ql-' + format);
- if (value != null) {
- input.value = value;
- }
- container.appendChild(input);
- }
-
- function addControls(container, groups) {
- if (!Array.isArray(groups[0])) {
- groups = [groups];
- }
- groups.forEach(function (controls) {
- var group = document.createElement('span');
- group.classList.add('ql-formats');
- controls.forEach(function (control) {
- if (typeof control === 'string') {
- addButton(group, control);
- } else {
- var format = Object.keys(control)[0];
- var value = control[format];
- if (Array.isArray(value)) {
- addSelect(group, format, value);
- } else {
- addButton(group, format, value);
- }
- }
- });
- container.appendChild(group);
- });
- }
-
- function addSelect(container, format, values) {
- var input = document.createElement('select');
- input.classList.add('ql-' + format);
- values.forEach(function (value) {
- var option = document.createElement('option');
- if (value !== false) {
- option.setAttribute('value', value);
- } else {
- option.setAttribute('selected', 'selected');
- }
- input.appendChild(option);
- });
- container.appendChild(input);
- }
-
- Toolbar.DEFAULTS = {
- container: null,
- handlers: {
- clean: function clean() {
- var _this3 = this;
-
- var range = this.quill.getSelection();
- if (range == null) return;
- if (range.length == 0) {
- var formats = this.quill.getFormat();
- Object.keys(formats).forEach(function (name) {
- // Clean functionality in existing apps only clean inline formats
- if (_parchment2.default.query(name, _parchment2.default.Scope.INLINE) != null) {
- _this3.quill.format(name, false);
- }
- });
- } else {
- this.quill.removeFormat(range, _quill2.default.sources.USER);
- }
- },
- direction: function direction(value) {
- var align = this.quill.getFormat()['align'];
- if (value === 'rtl' && align == null) {
- this.quill.format('align', 'right', _quill2.default.sources.USER);
- } else if (!value && align === 'right') {
- this.quill.format('align', false, _quill2.default.sources.USER);
- }
- this.quill.format('direction', value, _quill2.default.sources.USER);
- },
- indent: function indent(value) {
- var range = this.quill.getSelection();
- var formats = this.quill.getFormat(range);
- var indent = parseInt(formats.indent || 0);
- if (value === '+1' || value === '-1') {
- var modifier = value === '+1' ? 1 : -1;
- if (formats.direction === 'rtl') modifier *= -1;
- this.quill.format('indent', indent + modifier, _quill2.default.sources.USER);
- }
- },
- link: function link(value) {
- if (value === true) {
- value = prompt('Enter link URL:');
- }
- this.quill.format('link', value, _quill2.default.sources.USER);
- },
- list: function list(value) {
- var range = this.quill.getSelection();
- var formats = this.quill.getFormat(range);
- if (value === 'check') {
- if (formats['list'] === 'checked' || formats['list'] === 'unchecked') {
- this.quill.format('list', false, _quill2.default.sources.USER);
- } else {
- this.quill.format('list', 'unchecked', _quill2.default.sources.USER);
- }
- } else {
- this.quill.format('list', value, _quill2.default.sources.USER);
- }
- }
- }
- };
-
- exports.default = Toolbar;
- exports.addControls = addControls;
-
- /***/
- }),
-/* 77 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _picker = __webpack_require__(30);
-
- var _picker2 = _interopRequireDefault(_picker);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var ColorPicker = function (_Picker) {
- _inherits(ColorPicker, _Picker);
-
- function ColorPicker(select, label) {
- _classCallCheck(this, ColorPicker);
-
- var _this = _possibleConstructorReturn(this, (ColorPicker.__proto__ || Object.getPrototypeOf(ColorPicker)).call(this, select));
-
- _this.label.innerHTML = label;
- _this.container.classList.add('ql-color-picker');
- [].slice.call(_this.container.querySelectorAll('.ql-picker-item'), 0, 7).forEach(function (item) {
- item.classList.add('ql-primary');
- });
- return _this;
- }
-
- _createClass(ColorPicker, [{
- key: 'buildItem',
- value: function buildItem(option) {
- var item = _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'buildItem', this).call(this, option);
- item.style.backgroundColor = option.getAttribute('value') || '';
- return item;
- }
- }, {
- key: 'selectItem',
- value: function selectItem(item, trigger) {
- _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'selectItem', this).call(this, item, trigger);
- var colorLabel = this.label.querySelector('.ql-color-label');
- var value = item ? item.getAttribute('data-value') || '' : '';
- if (colorLabel) {
- if (colorLabel.tagName === 'line') {
- colorLabel.style.stroke = value;
- } else {
- colorLabel.style.fill = value;
- }
- }
- }
- }]);
-
- return ColorPicker;
- }(_picker2.default);
-
- exports.default = ColorPicker;
-
- /***/
- }),
-/* 78 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _picker = __webpack_require__(30);
-
- var _picker2 = _interopRequireDefault(_picker);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var IconPicker = function (_Picker) {
- _inherits(IconPicker, _Picker);
-
- function IconPicker(select, icons) {
- _classCallCheck(this, IconPicker);
-
- var _this = _possibleConstructorReturn(this, (IconPicker.__proto__ || Object.getPrototypeOf(IconPicker)).call(this, select));
-
- _this.container.classList.add('ql-icon-picker');
- [].forEach.call(_this.container.querySelectorAll('.ql-picker-item'), function (item) {
- item.innerHTML = icons[item.getAttribute('data-value') || ''];
- });
- _this.defaultItem = _this.container.querySelector('.ql-selected');
- _this.selectItem(_this.defaultItem);
- return _this;
- }
-
- _createClass(IconPicker, [{
- key: 'selectItem',
- value: function selectItem(item, trigger) {
- _get(IconPicker.prototype.__proto__ || Object.getPrototypeOf(IconPicker.prototype), 'selectItem', this).call(this, item, trigger);
- item = item || this.defaultItem;
- this.label.innerHTML = item.innerHTML;
- }
- }]);
-
- return IconPicker;
- }(_picker2.default);
-
- exports.default = IconPicker;
-
- /***/
- }),
-/* 79 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- var Tooltip = function () {
- function Tooltip(quill, boundsContainer) {
- var _this = this;
-
- _classCallCheck(this, Tooltip);
-
- this.quill = quill;
- this.boundsContainer = boundsContainer || document.body;
- this.root = quill.addContainer('ql-tooltip');
- this.root.innerHTML = this.constructor.TEMPLATE;
- if (this.quill.root === this.quill.scrollingContainer) {
- this.quill.root.addEventListener('scroll', function () {
- _this.root.style.marginTop = -1 * _this.quill.root.scrollTop + 'px';
- });
- }
- this.hide();
- }
-
- _createClass(Tooltip, [{
- key: 'hide',
- value: function hide() {
- this.root.classList.add('ql-hidden');
- }
- }, {
- key: 'position',
- value: function position(reference) {
- var left = reference.left + reference.width / 2 - this.root.offsetWidth / 2;
- // root.scrollTop should be 0 if scrollContainer !== root
- var top = reference.bottom + this.quill.root.scrollTop;
- this.root.style.left = left + 'px';
- this.root.style.top = top + 'px';
- this.root.classList.remove('ql-flip');
- var containerBounds = this.boundsContainer.getBoundingClientRect();
- var rootBounds = this.root.getBoundingClientRect();
- var shift = 0;
- if (rootBounds.right > containerBounds.right) {
- shift = containerBounds.right - rootBounds.right;
- this.root.style.left = left + shift + 'px';
- }
- if (rootBounds.left < containerBounds.left) {
- shift = containerBounds.left - rootBounds.left;
- this.root.style.left = left + shift + 'px';
- }
- if (rootBounds.bottom > containerBounds.bottom) {
- var height = rootBounds.bottom - rootBounds.top;
- var verticalShift = reference.bottom - reference.top + height;
- this.root.style.top = top - verticalShift + 'px';
- this.root.classList.add('ql-flip');
- }
- return shift;
- }
- }, {
- key: 'show',
- value: function show() {
- this.root.classList.remove('ql-editing');
- this.root.classList.remove('ql-hidden');
- }
- }]);
-
- return Tooltip;
- }();
-
- exports.default = Tooltip;
-
- /***/
- }),
-/* 80 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _extend = __webpack_require__(3);
-
- var _extend2 = _interopRequireDefault(_extend);
-
- var _emitter = __webpack_require__(8);
-
- var _emitter2 = _interopRequireDefault(_emitter);
-
- var _base = __webpack_require__(49);
-
- var _base2 = _interopRequireDefault(_base);
-
- var _link = __webpack_require__(29);
-
- var _link2 = _interopRequireDefault(_link);
-
- var _selection = __webpack_require__(15);
-
- var _icons = __webpack_require__(47);
-
- var _icons2 = _interopRequireDefault(_icons);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var TOOLBAR_CONFIG = [[{ header: ['1', '2', '3', false] }], ['bold', 'italic', 'underline', 'link'], [{ list: 'ordered' }, { list: 'bullet' }], ['clean']];
-
- var SnowTheme = function (_BaseTheme) {
- _inherits(SnowTheme, _BaseTheme);
-
- function SnowTheme(quill, options) {
- _classCallCheck(this, SnowTheme);
-
- if (options.modules.toolbar != null && options.modules.toolbar.container == null) {
- options.modules.toolbar.container = TOOLBAR_CONFIG;
- }
-
- var _this = _possibleConstructorReturn(this, (SnowTheme.__proto__ || Object.getPrototypeOf(SnowTheme)).call(this, quill, options));
-
- _this.quill.container.classList.add('ql-snow');
- return _this;
- }
-
- _createClass(SnowTheme, [{
- key: 'extendToolbar',
- value: function extendToolbar(toolbar) {
- toolbar.container.classList.add('ql-snow');
- this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default);
- this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default);
- this.tooltip = new SnowTooltip(this.quill, this.options.bounds);
- if (toolbar.container.querySelector('.ql-link')) {
- this.quill.keyboard.addBinding({ key: 'K', shortKey: true }, function (range, context) {
- toolbar.handlers['link'].call(toolbar, !context.format.link);
- });
- }
- }
- }]);
-
- return SnowTheme;
- }(_base2.default);
-
- SnowTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, {
- modules: {
- toolbar: {
- handlers: {
- link: function link(value) {
- if (value) {
- var range = this.quill.getSelection();
- if (range == null || range.length == 0) return;
- var preview = this.quill.getText(range);
- if (/^\S+@\S+\.\S+$/.test(preview) && preview.indexOf('mailto:') !== 0) {
- preview = 'mailto:' + preview;
- }
- var tooltip = this.quill.theme.tooltip;
- tooltip.edit('link', preview);
- } else {
- this.quill.format('link', false);
- }
- }
- }
- }
- }
- });
-
- var SnowTooltip = function (_BaseTooltip) {
- _inherits(SnowTooltip, _BaseTooltip);
-
- function SnowTooltip(quill, bounds) {
- _classCallCheck(this, SnowTooltip);
-
- var _this2 = _possibleConstructorReturn(this, (SnowTooltip.__proto__ || Object.getPrototypeOf(SnowTooltip)).call(this, quill, bounds));
-
- _this2.preview = _this2.root.querySelector('a.ql-preview');
- return _this2;
- }
-
- _createClass(SnowTooltip, [{
- key: 'listen',
- value: function listen() {
- var _this3 = this;
-
- _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'listen', this).call(this);
- this.root.querySelector('a.ql-action').addEventListener('click', function (event) {
- if (_this3.root.classList.contains('ql-editing')) {
- _this3.save();
- } else {
- _this3.edit('link', _this3.preview.textContent);
- }
- event.preventDefault();
- });
- this.root.querySelector('a.ql-remove').addEventListener('click', function (event) {
- if (_this3.linkRange != null) {
- var range = _this3.linkRange;
- _this3.restoreFocus();
- _this3.quill.formatText(range, 'link', false, _emitter2.default.sources.USER);
- delete _this3.linkRange;
- }
- event.preventDefault();
- _this3.hide();
- });
- this.quill.on(_emitter2.default.events.SELECTION_CHANGE, function (range, oldRange, source) {
- if (range == null) return;
- if (range.length === 0 && source === _emitter2.default.sources.USER) {
- var _quill$scroll$descend = _this3.quill.scroll.descendant(_link2.default, range.index),
- _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2),
- link = _quill$scroll$descend2[0],
- offset = _quill$scroll$descend2[1];
-
- if (link != null) {
- _this3.linkRange = new _selection.Range(range.index - offset, link.length());
- var preview = _link2.default.formats(link.domNode);
- _this3.preview.textContent = preview;
- _this3.preview.setAttribute('href', preview);
- _this3.show();
- _this3.position(_this3.quill.getBounds(_this3.linkRange));
- return;
- }
- } else {
- delete _this3.linkRange;
- }
- _this3.hide();
- });
- }
- }, {
- key: 'show',
- value: function show() {
- _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'show', this).call(this);
- this.root.removeAttribute('data-mode');
- }
- }]);
-
- return SnowTooltip;
- }(_base.BaseTooltip);
-
- SnowTooltip.TEMPLATE = ['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>', '<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">', '<a class="ql-action"></a>', '<a class="ql-remove"></a>'].join('');
-
- exports.default = SnowTheme;
-
- /***/
- }),
-/* 81 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _core = __webpack_require__(31);
-
- var _core2 = _interopRequireDefault(_core);
-
- var _align = __webpack_require__(42);
-
- var _direction = __webpack_require__(44);
-
- var _indent = __webpack_require__(82);
-
- var _blockquote = __webpack_require__(83);
-
- var _blockquote2 = _interopRequireDefault(_blockquote);
-
- var _header = __webpack_require__(84);
-
- var _header2 = _interopRequireDefault(_header);
-
- var _list = __webpack_require__(85);
-
- var _list2 = _interopRequireDefault(_list);
-
- var _background = __webpack_require__(43);
-
- var _color = __webpack_require__(28);
-
- var _font = __webpack_require__(45);
-
- var _size = __webpack_require__(46);
-
- var _bold = __webpack_require__(75);
-
- var _bold2 = _interopRequireDefault(_bold);
-
- var _italic = __webpack_require__(86);
-
- var _italic2 = _interopRequireDefault(_italic);
-
- var _link = __webpack_require__(29);
-
- var _link2 = _interopRequireDefault(_link);
-
- var _script = __webpack_require__(87);
-
- var _script2 = _interopRequireDefault(_script);
-
- var _strike = __webpack_require__(88);
-
- var _strike2 = _interopRequireDefault(_strike);
-
- var _underline = __webpack_require__(89);
-
- var _underline2 = _interopRequireDefault(_underline);
-
- var _image = __webpack_require__(90);
-
- var _image2 = _interopRequireDefault(_image);
-
- var _video = __webpack_require__(91);
-
- var _video2 = _interopRequireDefault(_video);
-
- var _code = __webpack_require__(13);
-
- var _code2 = _interopRequireDefault(_code);
-
- var _formula = __webpack_require__(92);
-
- var _formula2 = _interopRequireDefault(_formula);
-
- var _syntax = __webpack_require__(93);
-
- var _syntax2 = _interopRequireDefault(_syntax);
-
- var _toolbar = __webpack_require__(76);
-
- var _toolbar2 = _interopRequireDefault(_toolbar);
-
- var _icons = __webpack_require__(47);
-
- var _icons2 = _interopRequireDefault(_icons);
-
- var _picker = __webpack_require__(30);
-
- var _picker2 = _interopRequireDefault(_picker);
-
- var _colorPicker = __webpack_require__(77);
-
- var _colorPicker2 = _interopRequireDefault(_colorPicker);
-
- var _iconPicker = __webpack_require__(78);
-
- var _iconPicker2 = _interopRequireDefault(_iconPicker);
-
- var _tooltip = __webpack_require__(79);
-
- var _tooltip2 = _interopRequireDefault(_tooltip);
-
- var _bubble = __webpack_require__(132);
-
- var _bubble2 = _interopRequireDefault(_bubble);
-
- var _snow = __webpack_require__(80);
-
- var _snow2 = _interopRequireDefault(_snow);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- _core2.default.register({
- "attributors/attribute/direction": _direction.DirectionAttribute,
-
- "attributors/class/align": _align.AlignClass,
- "attributors/class/background": _background.BackgroundClass,
- "attributors/class/diff": _background.DiffClass,
- "attributors/class/color": _color.ColorClass,
- "attributors/class/direction": _direction.DirectionClass,
- "attributors/class/font": _font.FontClass,
- "attributors/class/size": _size.SizeClass,
-
- "attributors/style/align": _align.AlignStyle,
- "attributors/style/background": _background.BackgroundStyle,
- "attributors/style/diff": _background.DiffStyle,
- "attributors/style/color": _color.ColorStyle,
- "attributors/style/direction": _direction.DirectionStyle,
- "attributors/style/font": _font.FontStyle,
- "attributors/style/size": _size.SizeStyle
- }, true);
-
- _core2.default.register({
- "formats/align": _align.AlignClass,
- "formats/direction": _direction.DirectionClass,
- "formats/indent": _indent.IndentClass,
-
- "formats/background": _background.BackgroundStyle,
- "formats/diff": _background.DiffStyle,
- "formats/color": _color.ColorStyle,
- "formats/font": _font.FontClass,
- "formats/size": _size.SizeClass,
-
- "formats/blockquote": _blockquote2.default,
- "formats/code-block": _code2.default,
- "formats/header": _header2.default,
- "formats/list": _list2.default,
-
- "formats/bold": _bold2.default,
- "formats/code": _code.Code,
- "formats/italic": _italic2.default,
- "formats/link": _link2.default,
- "formats/script": _script2.default,
- "formats/strike": _strike2.default,
- "formats/underline": _underline2.default,
-
- "formats/image": _image2.default,
- "formats/video": _video2.default,
-
- "formats/list/item": _list.ListItem,
-
- "modules/formula": _formula2.default,
- "modules/syntax": _syntax2.default,
- "modules/toolbar": _toolbar2.default,
-
- "themes/bubble": _bubble2.default,
- "themes/snow": _snow2.default,
-
- "ui/icons": _icons2.default,
- "ui/picker": _picker2.default,
- "ui/icon-picker": _iconPicker2.default,
- "ui/color-picker": _colorPicker2.default,
- "ui/tooltip": _tooltip2.default
- }, true);
-
- exports.default = _core2.default;
-
- /***/
- }),
-/* 82 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.IndentClass = undefined;
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var IdentAttributor = function (_Parchment$Attributor) {
- _inherits(IdentAttributor, _Parchment$Attributor);
-
- function IdentAttributor() {
- _classCallCheck(this, IdentAttributor);
-
- return _possibleConstructorReturn(this, (IdentAttributor.__proto__ || Object.getPrototypeOf(IdentAttributor)).apply(this, arguments));
- }
-
- _createClass(IdentAttributor, [{
- key: 'add',
- value: function add(node, value) {
- if (value === '+1' || value === '-1') {
- var indent = this.value(node) || 0;
- value = value === '+1' ? indent + 1 : indent - 1;
- }
- if (value === 0) {
- this.remove(node);
- return true;
- } else {
- return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'add', this).call(this, node, value);
- }
- }
- }, {
- key: 'canAdd',
- value: function canAdd(node, value) {
- return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'canAdd', this).call(this, node, value) || _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'canAdd', this).call(this, node, parseInt(value));
- }
- }, {
- key: 'value',
- value: function value(node) {
- return parseInt(_get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'value', this).call(this, node)) || undefined; // Don't return NaN
- }
- }]);
-
- return IdentAttributor;
- }(_parchment2.default.Attributor.Class);
-
- var IndentClass = new IdentAttributor('indent', 'ql-indent', {
- scope: _parchment2.default.Scope.BLOCK,
- whitelist: [1, 2, 3, 4, 5, 6, 7, 8]
- });
-
- exports.IndentClass = IndentClass;
-
- /***/
- }),
-/* 83 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _block = __webpack_require__(4);
-
- var _block2 = _interopRequireDefault(_block);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var Blockquote = function (_Block) {
- _inherits(Blockquote, _Block);
-
- function Blockquote() {
- _classCallCheck(this, Blockquote);
-
- return _possibleConstructorReturn(this, (Blockquote.__proto__ || Object.getPrototypeOf(Blockquote)).apply(this, arguments));
- }
-
- return Blockquote;
- }(_block2.default);
-
- Blockquote.blotName = 'blockquote';
- Blockquote.tagName = 'blockquote';
-
- exports.default = Blockquote;
-
- /***/
- }),
-/* 84 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _block = __webpack_require__(4);
-
- var _block2 = _interopRequireDefault(_block);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var Header = function (_Block) {
- _inherits(Header, _Block);
-
- function Header() {
- _classCallCheck(this, Header);
-
- return _possibleConstructorReturn(this, (Header.__proto__ || Object.getPrototypeOf(Header)).apply(this, arguments));
- }
-
- _createClass(Header, null, [{
- key: 'formats',
- value: function formats(domNode) {
- return this.tagName.indexOf(domNode.tagName) + 1;
- }
- }]);
-
- return Header;
- }(_block2.default);
-
- Header.blotName = 'header';
- Header.tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'];
-
- exports.default = Header;
-
- /***/
- }),
-/* 85 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = exports.ListItem = undefined;
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _block = __webpack_require__(4);
-
- var _block2 = _interopRequireDefault(_block);
-
- var _container = __webpack_require__(27);
-
- var _container2 = _interopRequireDefault(_container);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var ListItem = function (_Block) {
- _inherits(ListItem, _Block);
-
- function ListItem() {
- _classCallCheck(this, ListItem);
-
- return _possibleConstructorReturn(this, (ListItem.__proto__ || Object.getPrototypeOf(ListItem)).apply(this, arguments));
- }
-
- _createClass(ListItem, [{
- key: 'format',
- value: function format(name, value) {
- if (name === List.blotName && !value) {
- this.replaceWith(_parchment2.default.create(this.statics.scope));
- } else {
- _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'format', this).call(this, name, value);
- }
- }
- }, {
- key: 'remove',
- value: function remove() {
- if (this.prev == null && this.next == null) {
- this.parent.remove();
- } else {
- _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'remove', this).call(this);
- }
- }
- }, {
- key: 'replaceWith',
- value: function replaceWith(name, value) {
- this.parent.isolate(this.offset(this.parent), this.length());
- if (name === this.parent.statics.blotName) {
- this.parent.replaceWith(name, value);
- return this;
- } else {
- this.parent.unwrap();
- return _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'replaceWith', this).call(this, name, value);
- }
- }
- }], [{
- key: 'formats',
- value: function formats(domNode) {
- return domNode.tagName === this.tagName ? undefined : _get(ListItem.__proto__ || Object.getPrototypeOf(ListItem), 'formats', this).call(this, domNode);
- }
- }]);
-
- return ListItem;
- }(_block2.default);
-
- ListItem.blotName = 'list-item';
- ListItem.tagName = 'LI';
-
- var List = function (_Container) {
- _inherits(List, _Container);
-
- _createClass(List, null, [{
- key: 'create',
- value: function create(value) {
- var tagName = value === 'ordered' ? 'OL' : 'UL';
- var node = _get(List.__proto__ || Object.getPrototypeOf(List), 'create', this).call(this, tagName);
- if (value === 'checked' || value === 'unchecked') {
- node.setAttribute('data-checked', value === 'checked');
- }
- return node;
- }
- }, {
- key: 'formats',
- value: function formats(domNode) {
- if (domNode.tagName === 'OL') return 'ordered';
- if (domNode.tagName === 'UL') {
- if (domNode.hasAttribute('data-checked')) {
- return domNode.getAttribute('data-checked') === 'true' ? 'checked' : 'unchecked';
- } else {
- return 'bullet';
- }
- }
- return undefined;
- }
- }]);
-
- function List(domNode) {
- _classCallCheck(this, List);
-
- var _this2 = _possibleConstructorReturn(this, (List.__proto__ || Object.getPrototypeOf(List)).call(this, domNode));
-
- var listEventHandler = function listEventHandler(e) {
- if (e.target.parentNode !== domNode) return;
- var format = _this2.statics.formats(domNode);
- var blot = _parchment2.default.find(e.target);
- if (format === 'checked') {
- blot.format('list', 'unchecked');
- } else if (format === 'unchecked') {
- blot.format('list', 'checked');
- }
- };
-
- domNode.addEventListener('touchstart', listEventHandler);
- domNode.addEventListener('mousedown', listEventHandler);
- return _this2;
- }
-
- _createClass(List, [{
- key: 'format',
- value: function format(name, value) {
- if (this.children.length > 0) {
- this.children.tail.format(name, value);
- }
- }
- }, {
- key: 'formats',
- value: function formats() {
- // We don't inherit from FormatBlot
- return _defineProperty({}, this.statics.blotName, this.statics.formats(this.domNode));
- }
- }, {
- key: 'insertBefore',
- value: function insertBefore(blot, ref) {
- if (blot instanceof ListItem) {
- _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'insertBefore', this).call(this, blot, ref);
- } else {
- var index = ref == null ? this.length() : ref.offset(this);
- var after = this.split(index);
- after.parent.insertBefore(blot, after);
- }
- }
- }, {
- key: 'optimize',
- value: function optimize(context) {
- _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'optimize', this).call(this, context);
- var next = this.next;
- if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && next.domNode.tagName === this.domNode.tagName && next.domNode.getAttribute('data-checked') === this.domNode.getAttribute('data-checked')) {
- next.moveChildren(this);
- next.remove();
- }
- }
- }, {
- key: 'replace',
- value: function replace(target) {
- if (target.statics.blotName !== this.statics.blotName) {
- var item = _parchment2.default.create(this.statics.defaultChild);
- target.moveChildren(item);
- this.appendChild(item);
- }
- _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'replace', this).call(this, target);
- }
- }]);
-
- return List;
- }(_container2.default);
-
- List.blotName = 'list';
- List.scope = _parchment2.default.Scope.BLOCK_BLOT;
- List.tagName = ['OL', 'UL'];
- List.defaultChild = 'list-item';
- List.allowedChildren = [ListItem];
-
- exports.ListItem = ListItem;
- exports.default = List;
-
- /***/
- }),
-/* 86 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _bold = __webpack_require__(75);
-
- var _bold2 = _interopRequireDefault(_bold);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var Italic = function (_Bold) {
- _inherits(Italic, _Bold);
-
- function Italic() {
- _classCallCheck(this, Italic);
-
- return _possibleConstructorReturn(this, (Italic.__proto__ || Object.getPrototypeOf(Italic)).apply(this, arguments));
- }
-
- return Italic;
- }(_bold2.default);
-
- Italic.blotName = 'italic';
- Italic.tagName = ['EM', 'I'];
-
- exports.default = Italic;
-
- /***/
- }),
-/* 87 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _inline = __webpack_require__(6);
-
- var _inline2 = _interopRequireDefault(_inline);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var Script = function (_Inline) {
- _inherits(Script, _Inline);
-
- function Script() {
- _classCallCheck(this, Script);
-
- return _possibleConstructorReturn(this, (Script.__proto__ || Object.getPrototypeOf(Script)).apply(this, arguments));
- }
-
- _createClass(Script, null, [{
- key: 'create',
- value: function create(value) {
- if (value === 'super') {
- return document.createElement('sup');
- } else if (value === 'sub') {
- return document.createElement('sub');
- } else {
- return _get(Script.__proto__ || Object.getPrototypeOf(Script), 'create', this).call(this, value);
- }
- }
- }, {
- key: 'formats',
- value: function formats(domNode) {
- if (domNode.tagName === 'SUB') return 'sub';
- if (domNode.tagName === 'SUP') return 'super';
- return undefined;
- }
- }]);
-
- return Script;
- }(_inline2.default);
-
- Script.blotName = 'script';
- Script.tagName = ['SUB', 'SUP'];
-
- exports.default = Script;
-
- /***/
- }),
-/* 88 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _inline = __webpack_require__(6);
-
- var _inline2 = _interopRequireDefault(_inline);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var Strike = function (_Inline) {
- _inherits(Strike, _Inline);
-
- function Strike() {
- _classCallCheck(this, Strike);
-
- return _possibleConstructorReturn(this, (Strike.__proto__ || Object.getPrototypeOf(Strike)).apply(this, arguments));
- }
-
- return Strike;
- }(_inline2.default);
-
- Strike.blotName = 'strike';
- Strike.tagName = 'S';
-
- exports.default = Strike;
-
- /***/
- }),
-/* 89 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _inline = __webpack_require__(6);
-
- var _inline2 = _interopRequireDefault(_inline);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var Underline = function (_Inline) {
- _inherits(Underline, _Inline);
-
- function Underline() {
- _classCallCheck(this, Underline);
-
- return _possibleConstructorReturn(this, (Underline.__proto__ || Object.getPrototypeOf(Underline)).apply(this, arguments));
- }
-
- return Underline;
- }(_inline2.default);
-
- Underline.blotName = 'underline';
- Underline.tagName = 'U';
-
- exports.default = Underline;
-
- /***/
- }),
-/* 90 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _link = __webpack_require__(29);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var ATTRIBUTES = ['alt', 'height', 'width'];
-
- var Image = function (_Parchment$Embed) {
- _inherits(Image, _Parchment$Embed);
-
- function Image() {
- _classCallCheck(this, Image);
-
- return _possibleConstructorReturn(this, (Image.__proto__ || Object.getPrototypeOf(Image)).apply(this, arguments));
- }
-
- _createClass(Image, [{
- key: 'format',
- value: function format(name, value) {
- if (ATTRIBUTES.indexOf(name) > -1) {
- if (value) {
- this.domNode.setAttribute(name, value);
- } else {
- this.domNode.removeAttribute(name);
- }
- } else {
- _get(Image.prototype.__proto__ || Object.getPrototypeOf(Image.prototype), 'format', this).call(this, name, value);
- }
- }
- }], [{
- key: 'create',
- value: function create(value) {
- var node = _get(Image.__proto__ || Object.getPrototypeOf(Image), 'create', this).call(this, value);
- if (typeof value === 'string') {
- node.setAttribute('src', this.sanitize(value));
- }
- return node;
- }
- }, {
- key: 'formats',
- value: function formats(domNode) {
- return ATTRIBUTES.reduce(function (formats, attribute) {
- if (domNode.hasAttribute(attribute)) {
- formats[attribute] = domNode.getAttribute(attribute);
- }
- return formats;
- }, {});
- }
- }, {
- key: 'match',
- value: function match(url) {
- return (/\.(jpe?g|gif|png)$/.test(url) || /^data:image\/.+;base64/.test(url)
- );
- }
- }, {
- key: 'sanitize',
- value: function sanitize(url) {
- return (0, _link.sanitize)(url, ['http', 'https', 'data']) ? url : '//:0';
- }
- }, {
- key: 'value',
- value: function value(domNode) {
- return domNode.getAttribute('src');
- }
- }]);
-
- return Image;
- }(_parchment2.default.Embed);
-
- Image.blotName = 'image';
- Image.tagName = 'IMG';
-
- exports.default = Image;
-
- /***/
- }),
-/* 91 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _block = __webpack_require__(4);
-
- var _link = __webpack_require__(29);
-
- var _link2 = _interopRequireDefault(_link);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var ATTRIBUTES = ['height', 'width'];
-
- var Video = function (_BlockEmbed) {
- _inherits(Video, _BlockEmbed);
-
- function Video() {
- _classCallCheck(this, Video);
-
- return _possibleConstructorReturn(this, (Video.__proto__ || Object.getPrototypeOf(Video)).apply(this, arguments));
- }
-
- _createClass(Video, [{
- key: 'format',
- value: function format(name, value) {
- if (ATTRIBUTES.indexOf(name) > -1) {
- if (value) {
- this.domNode.setAttribute(name, value);
- } else {
- this.domNode.removeAttribute(name);
- }
- } else {
- _get(Video.prototype.__proto__ || Object.getPrototypeOf(Video.prototype), 'format', this).call(this, name, value);
- }
- }
- }], [{
- key: 'create',
- value: function create(value) {
- var node = _get(Video.__proto__ || Object.getPrototypeOf(Video), 'create', this).call(this, value);
- node.setAttribute('frameborder', '0');
- node.setAttribute('allowfullscreen', true);
- node.setAttribute('src', this.sanitize(value));
- return node;
- }
- }, {
- key: 'formats',
- value: function formats(domNode) {
- return ATTRIBUTES.reduce(function (formats, attribute) {
- if (domNode.hasAttribute(attribute)) {
- formats[attribute] = domNode.getAttribute(attribute);
- }
- return formats;
- }, {});
- }
- }, {
- key: 'sanitize',
- value: function sanitize(url) {
- return _link2.default.sanitize(url);
- }
- }, {
- key: 'value',
- value: function value(domNode) {
- return domNode.getAttribute('src');
- }
- }]);
-
- return Video;
- }(_block.BlockEmbed);
-
- Video.blotName = 'video';
- Video.className = 'ql-video';
- Video.tagName = 'IFRAME';
-
- exports.default = Video;
-
- /***/
- }),
-/* 92 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = exports.FormulaBlot = undefined;
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _embed = __webpack_require__(41);
-
- var _embed2 = _interopRequireDefault(_embed);
-
- var _quill = __webpack_require__(5);
-
- var _quill2 = _interopRequireDefault(_quill);
-
- var _module = __webpack_require__(9);
-
- var _module2 = _interopRequireDefault(_module);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var FormulaBlot = function (_Embed) {
- _inherits(FormulaBlot, _Embed);
-
- function FormulaBlot() {
- _classCallCheck(this, FormulaBlot);
-
- return _possibleConstructorReturn(this, (FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot)).apply(this, arguments));
- }
-
- _createClass(FormulaBlot, null, [{
- key: 'create',
- value: function create(value) {
- var node = _get(FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot), 'create', this).call(this, value);
- if (typeof value === 'string') {
- window.katex.render(value, node, {
- throwOnError: false,
- errorColor: '#f00'
- });
- node.setAttribute('data-value', value);
- }
- return node;
- }
- }, {
- key: 'value',
- value: function value(domNode) {
- return domNode.getAttribute('data-value');
- }
- }]);
-
- return FormulaBlot;
- }(_embed2.default);
-
- FormulaBlot.blotName = 'formula';
- FormulaBlot.className = 'ql-formula';
- FormulaBlot.tagName = 'SPAN';
-
- var Formula = function (_Module) {
- _inherits(Formula, _Module);
-
- _createClass(Formula, null, [{
- key: 'register',
- value: function register() {
- _quill2.default.register(FormulaBlot, true);
- }
- }]);
-
- function Formula() {
- _classCallCheck(this, Formula);
-
- var _this2 = _possibleConstructorReturn(this, (Formula.__proto__ || Object.getPrototypeOf(Formula)).call(this));
-
- if (window.katex == null) {
- throw new Error('Formula module requires KaTeX.');
- }
- return _this2;
- }
-
- return Formula;
- }(_module2.default);
-
- exports.FormulaBlot = FormulaBlot;
- exports.default = Formula;
-
- /***/
- }),
-/* 93 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = exports.CodeToken = exports.CodeBlock = undefined;
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _parchment = __webpack_require__(0);
-
- var _parchment2 = _interopRequireDefault(_parchment);
-
- var _quill = __webpack_require__(5);
-
- var _quill2 = _interopRequireDefault(_quill);
-
- var _module = __webpack_require__(9);
-
- var _module2 = _interopRequireDefault(_module);
-
- var _code = __webpack_require__(13);
-
- var _code2 = _interopRequireDefault(_code);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var SyntaxCodeBlock = function (_CodeBlock) {
- _inherits(SyntaxCodeBlock, _CodeBlock);
-
- function SyntaxCodeBlock() {
- _classCallCheck(this, SyntaxCodeBlock);
-
- return _possibleConstructorReturn(this, (SyntaxCodeBlock.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock)).apply(this, arguments));
- }
-
- _createClass(SyntaxCodeBlock, [{
- key: 'replaceWith',
- value: function replaceWith(block) {
- this.domNode.textContent = this.domNode.textContent;
- this.attach();
- _get(SyntaxCodeBlock.prototype.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock.prototype), 'replaceWith', this).call(this, block);
- }
- }, {
- key: 'highlight',
- value: function highlight(_highlight) {
- var text = this.domNode.textContent;
- if (this.cachedText !== text) {
- if (text.trim().length > 0 || this.cachedText == null) {
- this.domNode.innerHTML = _highlight(text);
- this.domNode.normalize();
- this.attach();
- }
- this.cachedText = text;
- }
- }
- }]);
-
- return SyntaxCodeBlock;
- }(_code2.default);
-
- SyntaxCodeBlock.className = 'ql-syntax';
-
- var CodeToken = new _parchment2.default.Attributor.Class('token', 'hljs', {
- scope: _parchment2.default.Scope.INLINE
- });
-
- var Syntax = function (_Module) {
- _inherits(Syntax, _Module);
-
- _createClass(Syntax, null, [{
- key: 'register',
- value: function register() {
- _quill2.default.register(CodeToken, true);
- _quill2.default.register(SyntaxCodeBlock, true);
- }
- }]);
-
- function Syntax(quill, options) {
- _classCallCheck(this, Syntax);
-
- var _this2 = _possibleConstructorReturn(this, (Syntax.__proto__ || Object.getPrototypeOf(Syntax)).call(this, quill, options));
-
- if (typeof _this2.options.highlight !== 'function') {
- throw new Error('Syntax module requires highlight.js. Please include the library on the page before Quill.');
- }
- var timer = null;
- _this2.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () {
- clearTimeout(timer);
- timer = setTimeout(function () {
- _this2.highlight();
- timer = null;
- }, _this2.options.interval);
- });
- _this2.highlight();
- return _this2;
- }
-
- _createClass(Syntax, [{
- key: 'highlight',
- value: function highlight() {
- var _this3 = this;
-
- if (this.quill.selection.composing) return;
- this.quill.update(_quill2.default.sources.USER);
- var range = this.quill.getSelection();
- this.quill.scroll.descendants(SyntaxCodeBlock).forEach(function (code) {
- code.highlight(_this3.options.highlight);
- });
- this.quill.update(_quill2.default.sources.SILENT);
- if (range != null) {
- this.quill.setSelection(range, _quill2.default.sources.SILENT);
- }
- }
- }]);
-
- return Syntax;
- }(_module2.default);
-
- Syntax.DEFAULTS = {
- highlight: function () {
- if (window.hljs == null) return null;
- return function (text) {
- var result = window.hljs.highlightAuto(text);
- return result.value;
- };
- }(),
- interval: 1000
- };
-
- exports.CodeBlock = SyntaxCodeBlock;
- exports.CodeToken = CodeToken;
- exports.default = Syntax;
-
- /***/
- }),
-/* 94 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-align-left width=24 height=24 viewBox=\"0 0 24 24\"><path d=M3,3H21V5H3V3M3,7H15V9H3V7M3,11H21V13H3V11M3,15H15V17H3V15M3,19H21V21H3V19Z /></svg>";
-
- /***/
- }),
-/* 95 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-align-center width=24 height=24 viewBox=\"0 0 24 24\"><path d=M3,3H21V5H3V3M7,7H17V9H7V7M3,11H21V13H3V11M7,15H17V17H7V15M3,19H21V21H3V19Z /></svg>";
-
- /***/
- }),
-/* 96 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-align-right width=24 height=24 viewBox=\"0 0 24 24\"><path d=M3,3H21V5H3V3M9,7H21V9H9V7M3,11H21V13H3V11M9,15H21V17H9V15M3,19H21V21H3V19Z /></svg>";
-
- /***/
- }),
-/* 97 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-align-justify width=24 height=24 viewBox=\"0 0 24 24\"><path d=M3,3H21V5H3V3M3,7H21V9H3V7M3,11H21V13H3V11M3,15H21V17H3V15M3,19H21V21H3V19Z /></svg>";
-
- /***/
- }),
-/* 98 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-color-highlight width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M4,17L6.75,14.25L6.72,14.23C6.14,13.64 6.14,12.69 6.72,12.11L11.46,7.37L15.7,11.61L10.96,16.35C10.39,16.93 9.46,16.93 8.87,16.37L8.24,17H4M15.91,2.91C16.5,2.33 17.45,2.33 18.03,2.91L20.16,5.03C20.74,5.62 20.74,6.57 20.16,7.16L16.86,10.45L12.62,6.21L15.91,2.91Z\"/></svg>";
-
- /***/
- }),
-/* 99 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-quote-open width=24 height=24 viewBox=\"0 0 24 24\"><path d=M10,7L8,11H11V17H5V11L7,7H10M18,7L16,11H19V17H13V11L15,7H18Z /></svg>";
-
- /***/
- }),
-/* 100 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-bold width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M13.5,15.5H10V12.5H13.5A1.5,1.5 0 0,1 15,14A1.5,1.5 0 0,1 13.5,15.5M10,6.5H13A1.5,1.5 0 0,1 14.5,8A1.5,1.5 0 0,1 13,9.5H10M15.6,10.79C16.57,10.11 17.25,9 17.25,8C17.25,5.74 15.5,4 13.25,4H7V18H14.04C16.14,18 17.75,16.3 17.75,14.21C17.75,12.69 16.89,11.39 15.6,10.79Z\"/></svg>";
-
- /***/
- }),
-/* 101 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-clear width=24 height=24 viewBox=\"0 0 24 24\"><path d=M6,5V5.18L8.82,8H11.22L10.5,9.68L12.6,11.78L14.21,8H20V5H6M3.27,5L2,6.27L8.97,13.24L6.5,19H9.5L11.07,15.34L16.73,21L18,19.73L3.55,5.27L3.27,5Z /></svg>";
-
- /***/
- }),
-/* 102 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-code-tags width=24 height=24 viewBox=\"0 0 24 24\"><path d=M14.6,16.6L19.2,12L14.6,7.4L16,6L22,12L16,18L14.6,16.6M9.4,16.6L4.8,12L9.4,7.4L8,6L2,12L8,18L9.4,16.6Z /></svg>";
-
- /***/
- }),
-/* 103 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-code-braces width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M8,3A2,2 0 0,0 6,5V9A2,2 0 0,1 4,11H3V13H4A2,2 0 0,1 6,15V19A2,2 0 0,0 8,21H10V19H8V14A2,2 0 0,0 6,12A2,2 0 0,0 8,10V5H10V3M16,3A2,2 0 0,1 18,5V9A2,2 0 0,0 20,11H21V13H20A2,2 0 0,0 18,15V19A2,2 0 0,1 16,21H14V19H16V14A2,2 0 0,1 18,12A2,2 0 0,1 16,10V5H14V3H16Z\"/></svg>";
-
- /***/
- }),
-/* 104 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-color-text width=24 height=24 viewBox=\"0 0 24 24\"><path d=M9.62,12L12,5.67L14.37,12M11,3L5.5,17H7.75L8.87,14H15.12L16.25,17H18.5L13,3H11Z /></svg>";
-
- /***/
- }),
-/* 105 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-textdirection-l-to-r width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M21,18L17,14V17H5V19H17V22M9,10V15H11V4H13V15H15V4H17V2H9A4,4 0 0,0 5,6A4,4 0 0,0 9,10Z\"/></svg>";
-
- /***/
- }),
-/* 106 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-textdirection-r-to-l width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M8,17V14L4,18L8,22V19H20V17M10,10V15H12V4H14V15H16V4H18V2H10A4,4 0 0,0 6,6A4,4 0 0,0 10,10Z\"/></svg>";
-
- /***/
- }),
-/* 107 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-float-center width=24 height=24 viewBox=\"0 0 24 24\"><path d=M9,7H15V13H9V7M3,3H21V5H3V3M3,15H21V17H3V15M3,19H17V21H3V19Z /></svg>";
-
- /***/
- }),
-/* 108 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-float-none width=24 height=24 viewBox=\"0 0 24 24\"><path d=M3,7H9V13H3V7M3,3H21V5H3V3M21,11V13H11V11H21M3,15H17V17H3V15M3,19H21V21H3V19Z /></svg>";
-
- /***/
- }),
-/* 109 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-float-left width=24 height=24 viewBox=\"0 0 24 24\"><path d=M3,7H9V13H3V7M3,3H21V5H3V3M21,7V9H11V7H21M21,11V13H11V11H21M3,15H17V17H3V15M3,19H21V21H3V19Z /></svg>";
-
- /***/
- }),
-/* 110 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-float-right width=24 height=24 viewBox=\"0 0 24 24\"><path d=M15,7H21V13H15V7M3,3H21V5H3V3M13,7V9H3V7H13M9,11V13H3V11H9M3,15H17V17H3V15M3,19H21V21H3V19Z /></svg>";
-
- /***/
- }),
-/* 111 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-function-variant width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M12.42,5.29C11.32,5.19 10.35,6 10.25,7.11L10,10H12.82V12H9.82L9.38,17.07C9.18,19.27 7.24,20.9 5.04,20.7C3.79,20.59 2.66,19.9 2,18.83L3.5,17.33C3.83,18.38 4.96,18.97 6,18.63C6.78,18.39 7.33,17.7 7.4,16.89L7.82,12H4.82V10H8L8.27,6.93C8.46,4.73 10.39,3.1 12.6,3.28C13.86,3.39 15,4.09 15.66,5.17L14.16,6.67C13.91,5.9 13.23,5.36 12.42,5.29M22,13.65L20.59,12.24L17.76,15.07L14.93,12.24L13.5,13.65L16.35,16.5L13.5,19.31L14.93,20.72L17.76,17.89L20.59,20.72L22,19.31L19.17,16.5L22,13.65Z\"/></svg>";
-
- /***/
- }),
-/* 112 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-header-1 width=24 height=24 viewBox=\"0 0 24 24\"><path d=M3,4H5V10H9V4H11V18H9V12H5V18H3V4M14,18V16H16V6.31L13.5,7.75V5.44L16,4H18V16H20V18H14Z /></svg>";
-
- /***/
- }),
-/* 113 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-header-2 width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M3,4H5V10H9V4H11V18H9V12H5V18H3V4M21,18H15A2,2 0 0,1 13,16C13,15.47 13.2,15 13.54,14.64L18.41,9.41C18.78,9.05 19,8.55 19,8A2,2 0 0,0 17,6A2,2 0 0,0 15,8H13A4,4 0 0,1 17,4A4,4 0 0,1 21,8C21,9.1 20.55,10.1 19.83,10.83L15,16H21V18Z\"/></svg>";
-
- /***/
- }),
-/* 114 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-header-3 width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M3,4H5V10H9V4H11V18H9V12H5V18H3V4M15,4H19A2,2 0 0,1 21,6V16A2,2 0 0,1 19,18H15A2,2 0 0,1 13,16V15H15V16H19V12H15V10H19V6H15V7H13V6A2,2 0 0,1 15,4Z\"/></svg>";
-
- /***/
- }),
-/* 115 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-header-4 width=24 height=24 viewBox=\"0 0 24 24\"><path d=M3,4H5V10H9V4H11V18H9V12H5V18H3V4M18,18V13H13V11L18,4H20V11H21V13H20V18H18M18,11V7.42L15.45,11H18Z /></svg>";
-
- /***/
- }),
-/* 116 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-header-5 width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M3,4H5V10H9V4H11V18H9V12H5V18H3V4M15,4H20V6H15V10H17A4,4 0 0,1 21,14A4,4 0 0,1 17,18H15A2,2 0 0,1 13,16V15H15V16H17A2,2 0 0,0 19,14A2,2 0 0,0 17,12H15A2,2 0 0,1 13,10V6A2,2 0 0,1 15,4Z\"/></svg>";
-
- /***/
- }),
-/* 117 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-header-6 width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M3,4H5V10H9V4H11V18H9V12H5V18H3V4M15,4H19A2,2 0 0,1 21,6V7H19V6H15V10H19A2,2 0 0,1 21,12V16A2,2 0 0,1 19,18H15A2,2 0 0,1 13,16V6A2,2 0 0,1 15,4M15,12V16H19V12H15Z\"/></svg>";
-
- /***/
- }),
-/* 118 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-italic width=24 height=24 viewBox=\"0 0 24 24\"><path d=M10,4V7H12.21L8.79,15H6V18H14V15H11.79L15.21,7H18V4H10Z /></svg>";
-
- /***/
- }),
-/* 119 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-image width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z\"/></svg>";
-
- /***/
- }),
-/* 120 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-indent-increase width=24 height=24 viewBox=\"0 0 24 24\"><path d=M11,13H21V11H11M11,9H21V7H11M3,3V5H21V3M11,17H21V15H11M3,8V16L7,12M3,21H21V19H3V21Z /></svg>";
-
- /***/
- }),
-/* 121 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-indent-decrease width=24 height=24 viewBox=\"0 0 24 24\"><path d=M11,13H21V11H11M11,9H21V7H11M3,3V5H21V3M3,21H21V19H3M3,12L7,16V8M11,17H21V15H11V17Z /></svg>";
-
- /***/
- }),
-/* 122 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-link width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z\"/></svg>";
-
- /***/
- }),
-/* 123 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-list-numbered width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M7,13V11H21V13H7M7,19V17H21V19H7M7,7V5H21V7H7M3,8V5H2V4H4V8H3M2,17V16H5V20H2V19H4V18.5H3V17.5H4V17H2M4.25,10A0.75,0.75 0 0,1 5,10.75C5,10.95 4.92,11.14 4.79,11.27L3.12,13H5V14H2V13.08L4,11H2V10H4.25Z\"/></svg>";
-
- /***/
- }),
-/* 124 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-list-bulleted-square width=24 height=24 viewBox=\"0 0 24 24\"><path d=M3,4H7V8H3V4M9,5V7H21V5H9M3,10H7V14H3V10M9,11V13H21V11H9M3,16H7V20H3V16M9,17V19H21V17H9 /></svg>";
-
- /***/
- }),
-/* 125 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-list-checks width=24 height=24 viewBox=\"0 0 24 24\"><path d=M3,5H9V11H3V5M5,7V9H7V7H5M11,7H21V9H11V7M11,15H21V17H11V15M5,20L1.5,16.5L2.91,15.09L5,17.17L9.59,12.59L11,14L5,20Z /></svg>";
-
- /***/
- }),
-/* 126 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-subscript width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M16,7.41L11.41,12L16,16.59L14.59,18L10,13.41L5.41,18L4,16.59L8.59,12L4,7.41L5.41,6L10,10.59L14.59,6L16,7.41M21.85,21.03H16.97V20.03L17.86,19.23C18.62,18.58 19.18,18.04 19.56,17.6C19.93,17.16 20.12,16.75 20.13,16.36C20.14,16.08 20.05,15.85 19.86,15.66C19.68,15.5 19.39,15.38 19,15.38C18.69,15.38 18.42,15.44 18.16,15.56L17.5,15.94L17.05,14.77C17.32,14.56 17.64,14.38 18.03,14.24C18.42,14.1 18.85,14 19.32,14C20.1,14.04 20.7,14.25 21.1,14.66C21.5,15.07 21.72,15.59 21.72,16.23C21.71,16.79 21.53,17.31 21.18,17.78C20.84,18.25 20.42,18.7 19.91,19.14L19.27,19.66V19.68H21.85V21.03Z\"/></svg>";
-
- /***/
- }),
-/* 127 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-superscript width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M16,7.41L11.41,12L16,16.59L14.59,18L10,13.41L5.41,18L4,16.59L8.59,12L4,7.41L5.41,6L10,10.59L14.59,6L16,7.41M21.85,9H16.97V8L17.86,7.18C18.62,6.54 19.18,6 19.56,5.55C19.93,5.11 20.12,4.7 20.13,4.32C20.14,4.04 20.05,3.8 19.86,3.62C19.68,3.43 19.39,3.34 19,3.33C18.69,3.34 18.42,3.4 18.16,3.5L17.5,3.89L17.05,2.72C17.32,2.5 17.64,2.33 18.03,2.19C18.42,2.05 18.85,2 19.32,2C20.1,2 20.7,2.2 21.1,2.61C21.5,3 21.72,3.54 21.72,4.18C21.71,4.74 21.53,5.26 21.18,5.73C20.84,6.21 20.42,6.66 19.91,7.09L19.27,7.61V7.63H21.85V9Z\"/></svg>";
-
- /***/
- }),
-/* 128 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-strikethrough width=24 height=24 viewBox=\"0 0 24 24\"><path d=M3,14H21V12H3M5,4V7H10V10H14V7H19V4M10,19H14V16H10V19Z /></svg>";
-
- /***/
- }),
-/* 129 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-underline width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M5,21H19V19H5V21M12,17A6,6 0 0,0 18,11V3H15.5V11A3.5,3.5 0 0,1 12,14.5A3.5,3.5 0 0,1 8.5,11V3H6V11A6,6 0 0,0 12,17Z\"/></svg>";
-
- /***/
- }),
-/* 130 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-video width=24 height=24 viewBox=\"0 0 24 24\"><path d=\"M17,10.5V7A1,1 0 0,0 16,6H4A1,1 0 0,0 3,7V17A1,1 0 0,0 4,18H16A1,1 0 0,0 17,17V13.5L21,17.5V6.5L17,10.5Z\"/></svg>";
-
- /***/
- }),
-/* 131 */
-/***/ (function (module, exports) {
-
- module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-unfold-more-horizontal width=24 height=24 viewBox=\"0 0 24 24\"><path d=M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z /></svg>";
-
- /***/
- }),
-/* 132 */
-/***/ (function (module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = exports.BubbleTooltip = undefined;
-
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
- var _extend = __webpack_require__(3);
-
- var _extend2 = _interopRequireDefault(_extend);
-
- var _emitter = __webpack_require__(8);
-
- var _emitter2 = _interopRequireDefault(_emitter);
-
- var _base = __webpack_require__(49);
-
- var _base2 = _interopRequireDefault(_base);
-
- var _selection = __webpack_require__(15);
-
- var _icons = __webpack_require__(47);
-
- var _icons2 = _interopRequireDefault(_icons);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
- var TOOLBAR_CONFIG = [['bold', 'italic', 'link'], [{ header: 1 }, { header: 2 }, 'blockquote']];
-
- var BubbleTheme = function (_BaseTheme) {
- _inherits(BubbleTheme, _BaseTheme);
-
- function BubbleTheme(quill, options) {
- _classCallCheck(this, BubbleTheme);
-
- if (options.modules.toolbar != null && options.modules.toolbar.container == null) {
- options.modules.toolbar.container = TOOLBAR_CONFIG;
- }
-
- var _this = _possibleConstructorReturn(this, (BubbleTheme.__proto__ || Object.getPrototypeOf(BubbleTheme)).call(this, quill, options));
-
- _this.quill.container.classList.add('ql-bubble');
- return _this;
- }
-
- _createClass(BubbleTheme, [{
- key: 'extendToolbar',
- value: function extendToolbar(toolbar) {
- this.tooltip = new BubbleTooltip(this.quill, this.options.bounds);
- this.tooltip.root.appendChild(toolbar.container);
- this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default);
- this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default);
- }
- }]);
-
- return BubbleTheme;
- }(_base2.default);
-
- BubbleTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, {
- modules: {
- toolbar: {
- handlers: {
- link: function link(value) {
- if (!value) {
- this.quill.format('link', false);
- } else {
- this.quill.theme.tooltip.edit();
- }
- }
- }
- }
- }
- });
-
- var BubbleTooltip = function (_BaseTooltip) {
- _inherits(BubbleTooltip, _BaseTooltip);
-
- function BubbleTooltip(quill, bounds) {
- _classCallCheck(this, BubbleTooltip);
-
- var _this2 = _possibleConstructorReturn(this, (BubbleTooltip.__proto__ || Object.getPrototypeOf(BubbleTooltip)).call(this, quill, bounds));
-
- _this2.quill.on(_emitter2.default.events.EDITOR_CHANGE, function (type, range, oldRange, source) {
- if (type !== _emitter2.default.events.SELECTION_CHANGE) return;
- if (range != null && range.length > 0 && source === _emitter2.default.sources.USER) {
- _this2.show();
- // Lock our width so we will expand beyond our offsetParent boundaries
- _this2.root.style.left = '0px';
- _this2.root.style.width = '';
- _this2.root.style.width = _this2.root.offsetWidth + 'px';
- var lines = _this2.quill.getLines(range.index, range.length);
- if (lines.length === 1) {
- _this2.position(_this2.quill.getBounds(range));
- } else {
- var lastLine = lines[lines.length - 1];
- var index = _this2.quill.getIndex(lastLine);
- var length = Math.min(lastLine.length() - 1, range.index + range.length - index);
- var _bounds = _this2.quill.getBounds(new _selection.Range(index, length));
- _this2.position(_bounds);
- }
- } else if (document.activeElement !== _this2.textbox && _this2.quill.hasFocus()) {
- _this2.hide();
- }
- });
- return _this2;
- }
-
- _createClass(BubbleTooltip, [{
- key: 'listen',
- value: function listen() {
- var _this3 = this;
-
- _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'listen', this).call(this);
- this.root.querySelector('.ql-close').addEventListener('click', function () {
- _this3.root.classList.remove('ql-editing');
- });
- this.quill.on(_emitter2.default.events.SCROLL_OPTIMIZE, function () {
- // Let selection be restored by toolbar handlers before repositioning
- setTimeout(function () {
- if (_this3.root.classList.contains('ql-hidden')) return;
- var range = _this3.quill.getSelection();
- if (range != null) {
- _this3.position(_this3.quill.getBounds(range));
- }
- }, 1);
- });
- }
- }, {
- key: 'cancel',
- value: function cancel() {
- this.show();
- }
- }, {
- key: 'position',
- value: function position(reference) {
- var shift = _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'position', this).call(this, reference);
- var arrow = this.root.querySelector('.ql-tooltip-arrow');
- arrow.style.marginLeft = '';
- if (shift === 0) return shift;
- arrow.style.marginLeft = -1 * shift - arrow.offsetWidth / 2 + 'px';
- }
- }]);
-
- return BubbleTooltip;
- }(_base.BaseTooltip);
-
- BubbleTooltip.TEMPLATE = ['<span class="ql-tooltip-arrow"></span>', '<div class="ql-tooltip-editor">', '<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">', '<a class="ql-close"></a>', '</div>'].join('');
-
- exports.BubbleTooltip = BubbleTooltip;
- exports.default = BubbleTheme;
-
- /***/
- }),
-/* 133 */
-/***/ (function (module, exports, __webpack_require__) {
-
- module.exports = __webpack_require__(81);
-
-
- /***/
- })
-/******/])["default"];
- });
-
-
-
-
- }).call(this, require("buffer").Buffer)
- }, { "buffer": 4 }], 3: [function (require, module, exports) {
- 'use strict'
-
- exports.byteLength = byteLength
- exports.toByteArray = toByteArray
- exports.fromByteArray = fromByteArray
-
- var lookup = []
- var revLookup = []
- var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
-
- var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
- for (var i = 0, len = code.length; i < len; ++i) {
- lookup[i] = code[i]
- revLookup[code.charCodeAt(i)] = i
- }
-
- // Support decoding URL-safe base64 strings, as Node.js does.
- // See: https://en.wikipedia.org/wiki/Base64#URL_applications
- revLookup['-'.charCodeAt(0)] = 62
- revLookup['_'.charCodeAt(0)] = 63
-
- function getLens(b64) {
- var len = b64.length
-
- if (len % 4 > 0) {
- throw new Error('Invalid string. Length must be a multiple of 4')
- }
-
- // Trim off extra bytes after placeholder bytes are found
- // See: https://github.com/beatgammit/base64-js/issues/42
- var validLen = b64.indexOf('=')
- if (validLen === -1) validLen = len
-
- var placeHoldersLen = validLen === len
- ? 0
- : 4 - (validLen % 4)
-
- return [validLen, placeHoldersLen]
- }
-
- // base64 is 4/3 + up to two characters of the original data
- function byteLength(b64) {
- var lens = getLens(b64)
- var validLen = lens[0]
- var placeHoldersLen = lens[1]
- return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
- }
-
- function _byteLength(b64, validLen, placeHoldersLen) {
- return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
- }
-
- function toByteArray(b64) {
- var tmp
- var lens = getLens(b64)
- var validLen = lens[0]
- var placeHoldersLen = lens[1]
-
- var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
-
- var curByte = 0
-
- // if there are placeholders, only get up to the last complete 4 chars
- var len = placeHoldersLen > 0
- ? validLen - 4
- : validLen
-
- for (var i = 0; i < len; i += 4) {
- tmp =
- (revLookup[b64.charCodeAt(i)] << 18) |
- (revLookup[b64.charCodeAt(i + 1)] << 12) |
- (revLookup[b64.charCodeAt(i + 2)] << 6) |
- revLookup[b64.charCodeAt(i + 3)]
- arr[curByte++] = (tmp >> 16) & 0xFF
- arr[curByte++] = (tmp >> 8) & 0xFF
- arr[curByte++] = tmp & 0xFF
- }
-
- if (placeHoldersLen === 2) {
- tmp =
- (revLookup[b64.charCodeAt(i)] << 2) |
- (revLookup[b64.charCodeAt(i + 1)] >> 4)
- arr[curByte++] = tmp & 0xFF
- }
-
- if (placeHoldersLen === 1) {
- tmp =
- (revLookup[b64.charCodeAt(i)] << 10) |
- (revLookup[b64.charCodeAt(i + 1)] << 4) |
- (revLookup[b64.charCodeAt(i + 2)] >> 2)
- arr[curByte++] = (tmp >> 8) & 0xFF
- arr[curByte++] = tmp & 0xFF
- }
-
- return arr
- }
-
- function tripletToBase64(num) {
- return lookup[num >> 18 & 0x3F] +
- lookup[num >> 12 & 0x3F] +
- lookup[num >> 6 & 0x3F] +
- lookup[num & 0x3F]
- }
-
- function encodeChunk(uint8, start, end) {
- var tmp
- var output = []
- for (var i = start; i < end; i += 3) {
- tmp =
- ((uint8[i] << 16) & 0xFF0000) +
- ((uint8[i + 1] << 8) & 0xFF00) +
- (uint8[i + 2] & 0xFF)
- output.push(tripletToBase64(tmp))
- }
- return output.join('')
- }
-
- function fromByteArray(uint8) {
- var tmp
- var len = uint8.length
- var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
- var parts = []
- var maxChunkLength = 16383 // must be multiple of 3
-
- // go through the array every three bytes, we'll deal with trailing stuff later
- for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
- parts.push(encodeChunk(
- uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
- ))
- }
-
- // pad the end with zeros, but make sure to not forget the extra bytes
- if (extraBytes === 1) {
- tmp = uint8[len - 1]
- parts.push(
- lookup[tmp >> 2] +
- lookup[(tmp << 4) & 0x3F] +
- '=='
- )
- } else if (extraBytes === 2) {
- tmp = (uint8[len - 2] << 8) + uint8[len - 1]
- parts.push(
- lookup[tmp >> 10] +
- lookup[(tmp >> 4) & 0x3F] +
- lookup[(tmp << 2) & 0x3F] +
- '='
- )
- }
-
- return parts.join('')
- }
-
- }, {}], 4: [function (require, module, exports) {
- /*!
- * The buffer module from node.js, for the browser.
- *
- * @author Feross Aboukhadijeh <https://feross.org>
- * @license MIT
- */
- /* eslint-disable no-proto */
-
- 'use strict'
-
- var base64 = require('base64-js')
- var ieee754 = require('ieee754')
-
- exports.Buffer = Buffer
- exports.SlowBuffer = SlowBuffer
- exports.INSPECT_MAX_BYTES = 50
-
- var K_MAX_LENGTH = 0x7fffffff
- exports.kMaxLength = K_MAX_LENGTH
-
- /**
- * If `Buffer.TYPED_ARRAY_SUPPORT`:
- * === true Use Uint8Array implementation (fastest)
- * === false Print warning and recommend using `buffer` v4.x which has an Object
- * implementation (most compatible, even IE6)
- *
- * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
- * Opera 11.6+, iOS 4.2+.
- *
- * We report that the browser does not support typed arrays if the are not subclassable
- * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
- * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
- * for __proto__ and has a buggy typed array implementation.
- */
- Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport()
-
- if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&
- typeof console.error === 'function') {
- console.error(
- 'This browser lacks typed array (Uint8Array) support which is required by ' +
- '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'
- )
- }
-
- function typedArraySupport() {
- // Can typed array instances can be augmented?
- try {
- var arr = new Uint8Array(1)
- arr.__proto__ = { __proto__: Uint8Array.prototype, foo: function () { return 42 } }
- return arr.foo() === 42
- } catch (e) {
- return false
- }
- }
-
- Object.defineProperty(Buffer.prototype, 'parent', {
- enumerable: true,
- get: function () {
- if (!Buffer.isBuffer(this)) return undefined
- return this.buffer
- }
- })
-
- Object.defineProperty(Buffer.prototype, 'offset', {
- enumerable: true,
- get: function () {
- if (!Buffer.isBuffer(this)) return undefined
- return this.byteOffset
- }
- })
-
- function createBuffer(length) {
- if (length > K_MAX_LENGTH) {
- throw new RangeError('The value "' + length + '" is invalid for option "size"')
- }
- // Return an augmented `Uint8Array` instance
- var buf = new Uint8Array(length)
- buf.__proto__ = Buffer.prototype
- return buf
- }
-
- /**
- * The Buffer constructor returns instances of `Uint8Array` that have their
- * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
- * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
- * and the `Uint8Array` methods. Square bracket notation works as expected -- it
- * returns a single octet.
- *
- * The `Uint8Array` prototype remains unmodified.
- */
-
- function Buffer(arg, encodingOrOffset, length) {
- // Common case.
- if (typeof arg === 'number') {
- if (typeof encodingOrOffset === 'string') {
- throw new TypeError(
- 'The "string" argument must be of type string. Received type number'
- )
- }
- return allocUnsafe(arg)
- }
- return from(arg, encodingOrOffset, length)
- }
-
- // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
- if (typeof Symbol !== 'undefined' && Symbol.species != null &&
- Buffer[Symbol.species] === Buffer) {
- Object.defineProperty(Buffer, Symbol.species, {
- value: null,
- configurable: true,
- enumerable: false,
- writable: false
- })
- }
-
- Buffer.poolSize = 8192 // not used by this implementation
-
- function from(value, encodingOrOffset, length) {
- if (typeof value === 'string') {
- return fromString(value, encodingOrOffset)
- }
-
- if (ArrayBuffer.isView(value)) {
- return fromArrayLike(value)
- }
-
- if (value == null) {
- throw TypeError(
- 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
- 'or Array-like Object. Received type ' + (typeof value)
- )
- }
-
- if (isInstance(value, ArrayBuffer) ||
- (value && isInstance(value.buffer, ArrayBuffer))) {
- return fromArrayBuffer(value, encodingOrOffset, length)
- }
-
- if (typeof value === 'number') {
- throw new TypeError(
- 'The "value" argument must not be of type number. Received type number'
- )
- }
-
- var valueOf = value.valueOf && value.valueOf()
- if (valueOf != null && valueOf !== value) {
- return Buffer.from(valueOf, encodingOrOffset, length)
- }
-
- var b = fromObject(value)
- if (b) return b
-
- if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&
- typeof value[Symbol.toPrimitive] === 'function') {
- return Buffer.from(
- value[Symbol.toPrimitive]('string'), encodingOrOffset, length
- )
- }
-
- throw new TypeError(
- 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
- 'or Array-like Object. Received type ' + (typeof value)
- )
- }
-
- /**
- * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
- * if value is a number.
- * Buffer.from(str[, encoding])
- * Buffer.from(array)
- * Buffer.from(buffer)
- * Buffer.from(arrayBuffer[, byteOffset[, length]])
- **/
- Buffer.from = function (value, encodingOrOffset, length) {
- return from(value, encodingOrOffset, length)
- }
-
- // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
- // https://github.com/feross/buffer/pull/148
- Buffer.prototype.__proto__ = Uint8Array.prototype
- Buffer.__proto__ = Uint8Array
-
- function assertSize(size) {
- if (typeof size !== 'number') {
- throw new TypeError('"size" argument must be of type number')
- } else if (size < 0) {
- throw new RangeError('The value "' + size + '" is invalid for option "size"')
- }
- }
-
- function alloc(size, fill, encoding) {
- assertSize(size)
- if (size <= 0) {
- return createBuffer(size)
- }
- if (fill !== undefined) {
- // Only pay attention to encoding if it's a string. This
- // prevents accidentally sending in a number that would
- // be interpretted as a start offset.
- return typeof encoding === 'string'
- ? createBuffer(size).fill(fill, encoding)
- : createBuffer(size).fill(fill)
- }
- return createBuffer(size)
- }
-
- /**
- * Creates a new filled Buffer instance.
- * alloc(size[, fill[, encoding]])
- **/
- Buffer.alloc = function (size, fill, encoding) {
- return alloc(size, fill, encoding)
- }
-
- function allocUnsafe(size) {
- assertSize(size)
- return createBuffer(size < 0 ? 0 : checked(size) | 0)
- }
-
- /**
- * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
- * */
- Buffer.allocUnsafe = function (size) {
- return allocUnsafe(size)
- }
- /**
- * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
- */
- Buffer.allocUnsafeSlow = function (size) {
- return allocUnsafe(size)
- }
-
- function fromString(string, encoding) {
- if (typeof encoding !== 'string' || encoding === '') {
- encoding = 'utf8'
- }
-
- if (!Buffer.isEncoding(encoding)) {
- throw new TypeError('Unknown encoding: ' + encoding)
- }
-
- var length = byteLength(string, encoding) | 0
- var buf = createBuffer(length)
-
- var actual = buf.write(string, encoding)
-
- if (actual !== length) {
- // Writing a hex string, for example, that contains invalid characters will
- // cause everything after the first invalid character to be ignored. (e.g.
- // 'abxxcd' will be treated as 'ab')
- buf = buf.slice(0, actual)
- }
-
- return buf
- }
-
- function fromArrayLike(array) {
- var length = array.length < 0 ? 0 : checked(array.length) | 0
- var buf = createBuffer(length)
- for (var i = 0; i < length; i += 1) {
- buf[i] = array[i] & 255
- }
- return buf
- }
-
- function fromArrayBuffer(array, byteOffset, length) {
- if (byteOffset < 0 || array.byteLength < byteOffset) {
- throw new RangeError('"offset" is outside of buffer bounds')
- }
-
- if (array.byteLength < byteOffset + (length || 0)) {
- throw new RangeError('"length" is outside of buffer bounds')
- }
-
- var buf
- if (byteOffset === undefined && length === undefined) {
- buf = new Uint8Array(array)
- } else if (length === undefined) {
- buf = new Uint8Array(array, byteOffset)
- } else {
- buf = new Uint8Array(array, byteOffset, length)
- }
-
- // Return an augmented `Uint8Array` instance
- buf.__proto__ = Buffer.prototype
- return buf
- }
-
- function fromObject(obj) {
- if (Buffer.isBuffer(obj)) {
- var len = checked(obj.length) | 0
- var buf = createBuffer(len)
-
- if (buf.length === 0) {
- return buf
- }
-
- obj.copy(buf, 0, 0, len)
- return buf
- }
-
- if (obj.length !== undefined) {
- if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {
- return createBuffer(0)
- }
- return fromArrayLike(obj)
- }
-
- if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
- return fromArrayLike(obj.data)
- }
- }
-
- function checked(length) {
- // Note: cannot use `length < K_MAX_LENGTH` here because that fails when
- // length is NaN (which is otherwise coerced to zero.)
- if (length >= K_MAX_LENGTH) {
- throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
- 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')
- }
- return length | 0
- }
-
- function SlowBuffer(length) {
- if (+length != length) { // eslint-disable-line eqeqeq
- length = 0
- }
- return Buffer.alloc(+length)
- }
-
- Buffer.isBuffer = function isBuffer(b) {
- return b != null && b._isBuffer === true &&
- b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false
- }
-
- Buffer.compare = function compare(a, b) {
- if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)
- if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)
- if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
- throw new TypeError(
- 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
- )
- }
-
- if (a === b) return 0
-
- var x = a.length
- var y = b.length
-
- for (var i = 0, len = Math.min(x, y); i < len; ++i) {
- if (a[i] !== b[i]) {
- x = a[i]
- y = b[i]
- break
- }
- }
-
- if (x < y) return -1
- if (y < x) return 1
- return 0
- }
-
- Buffer.isEncoding = function isEncoding(encoding) {
- switch (String(encoding).toLowerCase()) {
- case 'hex':
- case 'utf8':
- case 'utf-8':
- case 'ascii':
- case 'latin1':
- case 'binary':
- case 'base64':
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return true
- default:
- return false
- }
- }
-
- Buffer.concat = function concat(list, length) {
- if (!Array.isArray(list)) {
- throw new TypeError('"list" argument must be an Array of Buffers')
- }
-
- if (list.length === 0) {
- return Buffer.alloc(0)
- }
-
- var i
- if (length === undefined) {
- length = 0
- for (i = 0; i < list.length; ++i) {
- length += list[i].length
- }
- }
-
- var buffer = Buffer.allocUnsafe(length)
- var pos = 0
- for (i = 0; i < list.length; ++i) {
- var buf = list[i]
- if (isInstance(buf, Uint8Array)) {
- buf = Buffer.from(buf)
- }
- if (!Buffer.isBuffer(buf)) {
- throw new TypeError('"list" argument must be an Array of Buffers')
- }
- buf.copy(buffer, pos)
- pos += buf.length
- }
- return buffer
- }
-
- function byteLength(string, encoding) {
- if (Buffer.isBuffer(string)) {
- return string.length
- }
- if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {
- return string.byteLength
- }
- if (typeof string !== 'string') {
- throw new TypeError(
- 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' +
- 'Received type ' + typeof string
- )
- }
-
- var len = string.length
- var mustMatch = (arguments.length > 2 && arguments[2] === true)
- if (!mustMatch && len === 0) return 0
-
- // Use a for loop to avoid recursion
- var loweredCase = false
- for (; ;) {
- switch (encoding) {
- case 'ascii':
- case 'latin1':
- case 'binary':
- return len
- case 'utf8':
- case 'utf-8':
- return utf8ToBytes(string).length
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return len * 2
- case 'hex':
- return len >>> 1
- case 'base64':
- return base64ToBytes(string).length
- default:
- if (loweredCase) {
- return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8
- }
- encoding = ('' + encoding).toLowerCase()
- loweredCase = true
- }
- }
- }
- Buffer.byteLength = byteLength
-
- function slowToString(encoding, start, end) {
- var loweredCase = false
-
- // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
- // property of a typed array.
-
- // This behaves neither like String nor Uint8Array in that we set start/end
- // to their upper/lower bounds if the value passed is out of range.
- // undefined is handled specially as per ECMA-262 6th Edition,
- // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
- if (start === undefined || start < 0) {
- start = 0
- }
- // Return early if start > this.length. Done here to prevent potential uint32
- // coercion fail below.
- if (start > this.length) {
- return ''
- }
-
- if (end === undefined || end > this.length) {
- end = this.length
- }
-
- if (end <= 0) {
- return ''
- }
-
- // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
- end >>>= 0
- start >>>= 0
-
- if (end <= start) {
- return ''
- }
-
- if (!encoding) encoding = 'utf8'
-
- while (true) {
- switch (encoding) {
- case 'hex':
- return hexSlice(this, start, end)
-
- case 'utf8':
- case 'utf-8':
- return utf8Slice(this, start, end)
-
- case 'ascii':
- return asciiSlice(this, start, end)
-
- case 'latin1':
- case 'binary':
- return latin1Slice(this, start, end)
-
- case 'base64':
- return base64Slice(this, start, end)
-
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return utf16leSlice(this, start, end)
-
- default:
- if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
- encoding = (encoding + '').toLowerCase()
- loweredCase = true
- }
- }
- }
-
- // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)
- // to detect a Buffer instance. It's not possible to use `instanceof Buffer`
- // reliably in a browserify context because there could be multiple different
- // copies of the 'buffer' package in use. This method works even for Buffer
- // instances that were created from another copy of the `buffer` package.
- // See: https://github.com/feross/buffer/issues/154
- Buffer.prototype._isBuffer = true
-
- function swap(b, n, m) {
- var i = b[n]
- b[n] = b[m]
- b[m] = i
- }
-
- Buffer.prototype.swap16 = function swap16() {
- var len = this.length
- if (len % 2 !== 0) {
- throw new RangeError('Buffer size must be a multiple of 16-bits')
- }
- for (var i = 0; i < len; i += 2) {
- swap(this, i, i + 1)
- }
- return this
- }
-
- Buffer.prototype.swap32 = function swap32() {
- var len = this.length
- if (len % 4 !== 0) {
- throw new RangeError('Buffer size must be a multiple of 32-bits')
- }
- for (var i = 0; i < len; i += 4) {
- swap(this, i, i + 3)
- swap(this, i + 1, i + 2)
- }
- return this
- }
-
- Buffer.prototype.swap64 = function swap64() {
- var len = this.length
- if (len % 8 !== 0) {
- throw new RangeError('Buffer size must be a multiple of 64-bits')
- }
- for (var i = 0; i < len; i += 8) {
- swap(this, i, i + 7)
- swap(this, i + 1, i + 6)
- swap(this, i + 2, i + 5)
- swap(this, i + 3, i + 4)
- }
- return this
- }
-
- Buffer.prototype.toString = function toString() {
- var length = this.length
- if (length === 0) return ''
- if (arguments.length === 0) return utf8Slice(this, 0, length)
- return slowToString.apply(this, arguments)
- }
-
- Buffer.prototype.toLocaleString = Buffer.prototype.toString
-
- Buffer.prototype.equals = function equals(b) {
- if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
- if (this === b) return true
- return Buffer.compare(this, b) === 0
- }
-
- Buffer.prototype.inspect = function inspect() {
- var str = ''
- var max = exports.INSPECT_MAX_BYTES
- str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()
- if (this.length > max) str += ' ... '
- return '<Buffer ' + str + '>'
- }
-
- Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {
- if (isInstance(target, Uint8Array)) {
- target = Buffer.from(target, target.offset, target.byteLength)
- }
- if (!Buffer.isBuffer(target)) {
- throw new TypeError(
- 'The "target" argument must be one of type Buffer or Uint8Array. ' +
- 'Received type ' + (typeof target)
- )
- }
-
- if (start === undefined) {
- start = 0
- }
- if (end === undefined) {
- end = target ? target.length : 0
- }
- if (thisStart === undefined) {
- thisStart = 0
- }
- if (thisEnd === undefined) {
- thisEnd = this.length
- }
-
- if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
- throw new RangeError('out of range index')
- }
-
- if (thisStart >= thisEnd && start >= end) {
- return 0
- }
- if (thisStart >= thisEnd) {
- return -1
- }
- if (start >= end) {
- return 1
- }
-
- start >>>= 0
- end >>>= 0
- thisStart >>>= 0
- thisEnd >>>= 0
-
- if (this === target) return 0
-
- var x = thisEnd - thisStart
- var y = end - start
- var len = Math.min(x, y)
-
- var thisCopy = this.slice(thisStart, thisEnd)
- var targetCopy = target.slice(start, end)
-
- for (var i = 0; i < len; ++i) {
- if (thisCopy[i] !== targetCopy[i]) {
- x = thisCopy[i]
- y = targetCopy[i]
- break
- }
- }
-
- if (x < y) return -1
- if (y < x) return 1
- return 0
- }
-
- // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
- // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
- //
- // Arguments:
- // - buffer - a Buffer to search
- // - val - a string, Buffer, or number
- // - byteOffset - an index into `buffer`; will be clamped to an int32
- // - encoding - an optional encoding, relevant is val is a string
- // - dir - true for indexOf, false for lastIndexOf
- function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
- // Empty buffer means no match
- if (buffer.length === 0) return -1
-
- // Normalize byteOffset
- if (typeof byteOffset === 'string') {
- encoding = byteOffset
- byteOffset = 0
- } else if (byteOffset > 0x7fffffff) {
- byteOffset = 0x7fffffff
- } else if (byteOffset < -0x80000000) {
- byteOffset = -0x80000000
- }
- byteOffset = +byteOffset // Coerce to Number.
- if (numberIsNaN(byteOffset)) {
- // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
- byteOffset = dir ? 0 : (buffer.length - 1)
- }
-
- // Normalize byteOffset: negative offsets start from the end of the buffer
- if (byteOffset < 0) byteOffset = buffer.length + byteOffset
- if (byteOffset >= buffer.length) {
- if (dir) return -1
- else byteOffset = buffer.length - 1
- } else if (byteOffset < 0) {
- if (dir) byteOffset = 0
- else return -1
- }
-
- // Normalize val
- if (typeof val === 'string') {
- val = Buffer.from(val, encoding)
- }
-
- // Finally, search either indexOf (if dir is true) or lastIndexOf
- if (Buffer.isBuffer(val)) {
- // Special case: looking for empty string/buffer always fails
- if (val.length === 0) {
- return -1
- }
- return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
- } else if (typeof val === 'number') {
- val = val & 0xFF // Search for a byte value [0-255]
- if (typeof Uint8Array.prototype.indexOf === 'function') {
- if (dir) {
- return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
- } else {
- return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
- }
- }
- return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)
- }
-
- throw new TypeError('val must be string, number or Buffer')
- }
-
- function arrayIndexOf(arr, val, byteOffset, encoding, dir) {
- var indexSize = 1
- var arrLength = arr.length
- var valLength = val.length
-
- if (encoding !== undefined) {
- encoding = String(encoding).toLowerCase()
- if (encoding === 'ucs2' || encoding === 'ucs-2' ||
- encoding === 'utf16le' || encoding === 'utf-16le') {
- if (arr.length < 2 || val.length < 2) {
- return -1
- }
- indexSize = 2
- arrLength /= 2
- valLength /= 2
- byteOffset /= 2
- }
- }
-
- function read(buf, i) {
- if (indexSize === 1) {
- return buf[i]
- } else {
- return buf.readUInt16BE(i * indexSize)
- }
- }
-
- var i
- if (dir) {
- var foundIndex = -1
- for (i = byteOffset; i < arrLength; i++) {
- if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
- if (foundIndex === -1) foundIndex = i
- if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
- } else {
- if (foundIndex !== -1) i -= i - foundIndex
- foundIndex = -1
- }
- }
- } else {
- if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
- for (i = byteOffset; i >= 0; i--) {
- var found = true
- for (var j = 0; j < valLength; j++) {
- if (read(arr, i + j) !== read(val, j)) {
- found = false
- break
- }
- }
- if (found) return i
- }
- }
-
- return -1
- }
-
- Buffer.prototype.includes = function includes(val, byteOffset, encoding) {
- return this.indexOf(val, byteOffset, encoding) !== -1
- }
-
- Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) {
- return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
- }
-
- Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
- return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
- }
-
- function hexWrite(buf, string, offset, length) {
- offset = Number(offset) || 0
- var remaining = buf.length - offset
- if (!length) {
- length = remaining
- } else {
- length = Number(length)
- if (length > remaining) {
- length = remaining
- }
- }
-
- var strLen = string.length
-
- if (length > strLen / 2) {
- length = strLen / 2
- }
- for (var i = 0; i < length; ++i) {
- var parsed = parseInt(string.substr(i * 2, 2), 16)
- if (numberIsNaN(parsed)) return i
- buf[offset + i] = parsed
- }
- return i
- }
-
- function utf8Write(buf, string, offset, length) {
- return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
- }
-
- function asciiWrite(buf, string, offset, length) {
- return blitBuffer(asciiToBytes(string), buf, offset, length)
- }
-
- function latin1Write(buf, string, offset, length) {
- return asciiWrite(buf, string, offset, length)
- }
-
- function base64Write(buf, string, offset, length) {
- return blitBuffer(base64ToBytes(string), buf, offset, length)
- }
-
- function ucs2Write(buf, string, offset, length) {
- return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
- }
-
- Buffer.prototype.write = function write(string, offset, length, encoding) {
- // Buffer#write(string)
- if (offset === undefined) {
- encoding = 'utf8'
- length = this.length
- offset = 0
- // Buffer#write(string, encoding)
- } else if (length === undefined && typeof offset === 'string') {
- encoding = offset
- length = this.length
- offset = 0
- // Buffer#write(string, offset[, length][, encoding])
- } else if (isFinite(offset)) {
- offset = offset >>> 0
- if (isFinite(length)) {
- length = length >>> 0
- if (encoding === undefined) encoding = 'utf8'
- } else {
- encoding = length
- length = undefined
- }
- } else {
- throw new Error(
- 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
- )
- }
-
- var remaining = this.length - offset
- if (length === undefined || length > remaining) length = remaining
-
- if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
- throw new RangeError('Attempt to write outside buffer bounds')
- }
-
- if (!encoding) encoding = 'utf8'
-
- var loweredCase = false
- for (; ;) {
- switch (encoding) {
- case 'hex':
- return hexWrite(this, string, offset, length)
-
- case 'utf8':
- case 'utf-8':
- return utf8Write(this, string, offset, length)
-
- case 'ascii':
- return asciiWrite(this, string, offset, length)
-
- case 'latin1':
- case 'binary':
- return latin1Write(this, string, offset, length)
-
- case 'base64':
- // Warning: maxLength not taken into account in base64Write
- return base64Write(this, string, offset, length)
-
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return ucs2Write(this, string, offset, length)
-
- default:
- if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
- encoding = ('' + encoding).toLowerCase()
- loweredCase = true
- }
- }
- }
-
- Buffer.prototype.toJSON = function toJSON() {
- return {
- type: 'Buffer',
- data: Array.prototype.slice.call(this._arr || this, 0)
- }
- }
-
- function base64Slice(buf, start, end) {
- if (start === 0 && end === buf.length) {
- return base64.fromByteArray(buf)
- } else {
- return base64.fromByteArray(buf.slice(start, end))
- }
- }
-
- function utf8Slice(buf, start, end) {
- end = Math.min(buf.length, end)
- var res = []
-
- var i = start
- while (i < end) {
- var firstByte = buf[i]
- var codePoint = null
- var bytesPerSequence = (firstByte > 0xEF) ? 4
- : (firstByte > 0xDF) ? 3
- : (firstByte > 0xBF) ? 2
- : 1
-
- if (i + bytesPerSequence <= end) {
- var secondByte, thirdByte, fourthByte, tempCodePoint
-
- switch (bytesPerSequence) {
- case 1:
- if (firstByte < 0x80) {
- codePoint = firstByte
- }
- break
- case 2:
- secondByte = buf[i + 1]
- if ((secondByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
- if (tempCodePoint > 0x7F) {
- codePoint = tempCodePoint
- }
- }
- break
- case 3:
- secondByte = buf[i + 1]
- thirdByte = buf[i + 2]
- if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
- if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
- codePoint = tempCodePoint
- }
- }
- break
- case 4:
- secondByte = buf[i + 1]
- thirdByte = buf[i + 2]
- fourthByte = buf[i + 3]
- if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
- if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
- codePoint = tempCodePoint
- }
- }
- }
- }
-
- if (codePoint === null) {
- // we did not generate a valid codePoint so insert a
- // replacement char (U+FFFD) and advance only 1 byte
- codePoint = 0xFFFD
- bytesPerSequence = 1
- } else if (codePoint > 0xFFFF) {
- // encode to utf16 (surrogate pair dance)
- codePoint -= 0x10000
- res.push(codePoint >>> 10 & 0x3FF | 0xD800)
- codePoint = 0xDC00 | codePoint & 0x3FF
- }
-
- res.push(codePoint)
- i += bytesPerSequence
- }
-
- return decodeCodePointsArray(res)
- }
-
- // Based on http://stackoverflow.com/a/22747272/680742, the browser with
- // the lowest limit is Chrome, with 0x10000 args.
- // We go 1 magnitude less, for safety
- var MAX_ARGUMENTS_LENGTH = 0x1000
-
- function decodeCodePointsArray(codePoints) {
- var len = codePoints.length
- if (len <= MAX_ARGUMENTS_LENGTH) {
- return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
- }
-
- // Decode in chunks to avoid "call stack size exceeded".
- var res = ''
- var i = 0
- while (i < len) {
- res += String.fromCharCode.apply(
- String,
- codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
- )
- }
- return res
- }
-
- function asciiSlice(buf, start, end) {
- var ret = ''
- end = Math.min(buf.length, end)
-
- for (var i = start; i < end; ++i) {
- ret += String.fromCharCode(buf[i] & 0x7F)
- }
- return ret
- }
-
- function latin1Slice(buf, start, end) {
- var ret = ''
- end = Math.min(buf.length, end)
-
- for (var i = start; i < end; ++i) {
- ret += String.fromCharCode(buf[i])
- }
- return ret
- }
-
- function hexSlice(buf, start, end) {
- var len = buf.length
-
- if (!start || start < 0) start = 0
- if (!end || end < 0 || end > len) end = len
-
- var out = ''
- for (var i = start; i < end; ++i) {
- out += toHex(buf[i])
- }
- return out
- }
-
- function utf16leSlice(buf, start, end) {
- var bytes = buf.slice(start, end)
- var res = ''
- for (var i = 0; i < bytes.length; i += 2) {
- res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))
- }
- return res
- }
-
- Buffer.prototype.slice = function slice(start, end) {
- var len = this.length
- start = ~~start
- end = end === undefined ? len : ~~end
-
- if (start < 0) {
- start += len
- if (start < 0) start = 0
- } else if (start > len) {
- start = len
- }
-
- if (end < 0) {
- end += len
- if (end < 0) end = 0
- } else if (end > len) {
- end = len
- }
-
- if (end < start) end = start
-
- var newBuf = this.subarray(start, end)
- // Return an augmented `Uint8Array` instance
- newBuf.__proto__ = Buffer.prototype
- return newBuf
- }
-
- /*
- * Need to make sure that buffer isn't trying to write out of bounds.
- */
- function checkOffset(offset, ext, length) {
- if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
- if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
- }
-
- Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) {
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
-
- var val = this[offset]
- var mul = 1
- var i = 0
- while (++i < byteLength && (mul *= 0x100)) {
- val += this[offset + i] * mul
- }
-
- return val
- }
-
- Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) {
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) {
- checkOffset(offset, byteLength, this.length)
- }
-
- var val = this[offset + --byteLength]
- var mul = 1
- while (byteLength > 0 && (mul *= 0x100)) {
- val += this[offset + --byteLength] * mul
- }
-
- return val
- }
-
- Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 1, this.length)
- return this[offset]
- }
-
- Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 2, this.length)
- return this[offset] | (this[offset + 1] << 8)
- }
-
- Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 2, this.length)
- return (this[offset] << 8) | this[offset + 1]
- }
-
- Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return ((this[offset]) |
- (this[offset + 1] << 8) |
- (this[offset + 2] << 16)) +
- (this[offset + 3] * 0x1000000)
- }
-
- Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return (this[offset] * 0x1000000) +
- ((this[offset + 1] << 16) |
- (this[offset + 2] << 8) |
- this[offset + 3])
- }
-
- Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) {
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
-
- var val = this[offset]
- var mul = 1
- var i = 0
- while (++i < byteLength && (mul *= 0x100)) {
- val += this[offset + i] * mul
- }
- mul *= 0x80
-
- if (val >= mul) val -= Math.pow(2, 8 * byteLength)
-
- return val
- }
-
- Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) {
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
-
- var i = byteLength
- var mul = 1
- var val = this[offset + --i]
- while (i > 0 && (mul *= 0x100)) {
- val += this[offset + --i] * mul
- }
- mul *= 0x80
-
- if (val >= mul) val -= Math.pow(2, 8 * byteLength)
-
- return val
- }
-
- Buffer.prototype.readInt8 = function readInt8(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 1, this.length)
- if (!(this[offset] & 0x80)) return (this[offset])
- return ((0xff - this[offset] + 1) * -1)
- }
-
- Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 2, this.length)
- var val = this[offset] | (this[offset + 1] << 8)
- return (val & 0x8000) ? val | 0xFFFF0000 : val
- }
-
- Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 2, this.length)
- var val = this[offset + 1] | (this[offset] << 8)
- return (val & 0x8000) ? val | 0xFFFF0000 : val
- }
-
- Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return (this[offset]) |
- (this[offset + 1] << 8) |
- (this[offset + 2] << 16) |
- (this[offset + 3] << 24)
- }
-
- Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return (this[offset] << 24) |
- (this[offset + 1] << 16) |
- (this[offset + 2] << 8) |
- (this[offset + 3])
- }
-
- Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
- return ieee754.read(this, offset, true, 23, 4)
- }
-
- Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
- return ieee754.read(this, offset, false, 23, 4)
- }
-
- Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 8, this.length)
- return ieee754.read(this, offset, true, 52, 8)
- }
-
- Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 8, this.length)
- return ieee754.read(this, offset, false, 52, 8)
- }
-
- function checkInt(buf, value, offset, ext, max, min) {
- if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
- if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
- if (offset + ext > buf.length) throw new RangeError('Index out of range')
- }
-
- Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) {
- value = +value
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) {
- var maxBytes = Math.pow(2, 8 * byteLength) - 1
- checkInt(this, value, offset, byteLength, maxBytes, 0)
- }
-
- var mul = 1
- var i = 0
- this[offset] = value & 0xFF
- while (++i < byteLength && (mul *= 0x100)) {
- this[offset + i] = (value / mul) & 0xFF
- }
-
- return offset + byteLength
- }
-
- Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) {
- value = +value
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) {
- var maxBytes = Math.pow(2, 8 * byteLength) - 1
- checkInt(this, value, offset, byteLength, maxBytes, 0)
- }
-
- var i = byteLength - 1
- var mul = 1
- this[offset + i] = value & 0xFF
- while (--i >= 0 && (mul *= 0x100)) {
- this[offset + i] = (value / mul) & 0xFF
- }
-
- return offset + byteLength
- }
-
- Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
- this[offset] = (value & 0xff)
- return offset + 1
- }
-
- Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- return offset + 2
- }
-
- Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
- this[offset] = (value >>> 8)
- this[offset + 1] = (value & 0xff)
- return offset + 2
- }
-
- Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
- this[offset + 3] = (value >>> 24)
- this[offset + 2] = (value >>> 16)
- this[offset + 1] = (value >>> 8)
- this[offset] = (value & 0xff)
- return offset + 4
- }
-
- Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
- this[offset] = (value >>> 24)
- this[offset + 1] = (value >>> 16)
- this[offset + 2] = (value >>> 8)
- this[offset + 3] = (value & 0xff)
- return offset + 4
- }
-
- Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) {
- var limit = Math.pow(2, (8 * byteLength) - 1)
-
- checkInt(this, value, offset, byteLength, limit - 1, -limit)
- }
-
- var i = 0
- var mul = 1
- var sub = 0
- this[offset] = value & 0xFF
- while (++i < byteLength && (mul *= 0x100)) {
- if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
- sub = 1
- }
- this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
- }
-
- return offset + byteLength
- }
-
- Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) {
- var limit = Math.pow(2, (8 * byteLength) - 1)
-
- checkInt(this, value, offset, byteLength, limit - 1, -limit)
- }
-
- var i = byteLength - 1
- var mul = 1
- var sub = 0
- this[offset + i] = value & 0xFF
- while (--i >= 0 && (mul *= 0x100)) {
- if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
- sub = 1
- }
- this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
- }
-
- return offset + byteLength
- }
-
- Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
- if (value < 0) value = 0xff + value + 1
- this[offset] = (value & 0xff)
- return offset + 1
- }
-
- Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- return offset + 2
- }
-
- Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
- this[offset] = (value >>> 8)
- this[offset + 1] = (value & 0xff)
- return offset + 2
- }
-
- Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- this[offset + 2] = (value >>> 16)
- this[offset + 3] = (value >>> 24)
- return offset + 4
- }
-
- Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
- if (value < 0) value = 0xffffffff + value + 1
- this[offset] = (value >>> 24)
- this[offset + 1] = (value >>> 16)
- this[offset + 2] = (value >>> 8)
- this[offset + 3] = (value & 0xff)
- return offset + 4
- }
-
- function checkIEEE754(buf, value, offset, ext, max, min) {
- if (offset + ext > buf.length) throw new RangeError('Index out of range')
- if (offset < 0) throw new RangeError('Index out of range')
- }
-
- function writeFloat(buf, value, offset, littleEndian, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) {
- checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
- }
- ieee754.write(buf, value, offset, littleEndian, 23, 4)
- return offset + 4
- }
-
- Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {
- return writeFloat(this, value, offset, true, noAssert)
- }
-
- Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {
- return writeFloat(this, value, offset, false, noAssert)
- }
-
- function writeDouble(buf, value, offset, littleEndian, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) {
- checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
- }
- ieee754.write(buf, value, offset, littleEndian, 52, 8)
- return offset + 8
- }
-
- Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {
- return writeDouble(this, value, offset, true, noAssert)
- }
-
- Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {
- return writeDouble(this, value, offset, false, noAssert)
- }
-
- // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
- Buffer.prototype.copy = function copy(target, targetStart, start, end) {
- if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')
- if (!start) start = 0
- if (!end && end !== 0) end = this.length
- if (targetStart >= target.length) targetStart = target.length
- if (!targetStart) targetStart = 0
- if (end > 0 && end < start) end = start
-
- // Copy 0 bytes; we're done
- if (end === start) return 0
- if (target.length === 0 || this.length === 0) return 0
-
- // Fatal error conditions
- if (targetStart < 0) {
- throw new RangeError('targetStart out of bounds')
- }
- if (start < 0 || start >= this.length) throw new RangeError('Index out of range')
- if (end < 0) throw new RangeError('sourceEnd out of bounds')
-
- // Are we oob?
- if (end > this.length) end = this.length
- if (target.length - targetStart < end - start) {
- end = target.length - targetStart + start
- }
-
- var len = end - start
-
- if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {
- // Use built-in when available, missing from IE11
- this.copyWithin(targetStart, start, end)
- } else if (this === target && start < targetStart && targetStart < end) {
- // descending copy from end
- for (var i = len - 1; i >= 0; --i) {
- target[i + targetStart] = this[i + start]
- }
- } else {
- Uint8Array.prototype.set.call(
- target,
- this.subarray(start, end),
- targetStart
- )
- }
-
- return len
- }
-
- // Usage:
- // buffer.fill(number[, offset[, end]])
- // buffer.fill(buffer[, offset[, end]])
- // buffer.fill(string[, offset[, end]][, encoding])
- Buffer.prototype.fill = function fill(val, start, end, encoding) {
- // Handle string cases:
- if (typeof val === 'string') {
- if (typeof start === 'string') {
- encoding = start
- start = 0
- end = this.length
- } else if (typeof end === 'string') {
- encoding = end
- end = this.length
- }
- if (encoding !== undefined && typeof encoding !== 'string') {
- throw new TypeError('encoding must be a string')
- }
- if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
- throw new TypeError('Unknown encoding: ' + encoding)
- }
- if (val.length === 1) {
- var code = val.charCodeAt(0)
- if ((encoding === 'utf8' && code < 128) ||
- encoding === 'latin1') {
- // Fast path: If `val` fits into a single byte, use that numeric value.
- val = code
- }
- }
- } else if (typeof val === 'number') {
- val = val & 255
- }
-
- // Invalid ranges are not set to a default, so can range check early.
- if (start < 0 || this.length < start || this.length < end) {
- throw new RangeError('Out of range index')
- }
-
- if (end <= start) {
- return this
- }
-
- start = start >>> 0
- end = end === undefined ? this.length : end >>> 0
-
- if (!val) val = 0
-
- var i
- if (typeof val === 'number') {
- for (i = start; i < end; ++i) {
- this[i] = val
- }
- } else {
- var bytes = Buffer.isBuffer(val)
- ? val
- : Buffer.from(val, encoding)
- var len = bytes.length
- if (len === 0) {
- throw new TypeError('The value "' + val +
- '" is invalid for argument "value"')
- }
- for (i = 0; i < end - start; ++i) {
- this[i + start] = bytes[i % len]
- }
- }
-
- return this
- }
-
- // HELPER FUNCTIONS
- // ================
-
- var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g
-
- function base64clean(str) {
- // Node takes equal signs as end of the Base64 encoding
- str = str.split('=')[0]
- // Node strips out invalid characters like \n and \t from the string, base64-js does not
- str = str.trim().replace(INVALID_BASE64_RE, '')
- // Node converts strings with length < 2 to ''
- if (str.length < 2) return ''
- // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
- while (str.length % 4 !== 0) {
- str = str + '='
- }
- return str
- }
-
- function toHex(n) {
- if (n < 16) return '0' + n.toString(16)
- return n.toString(16)
- }
-
- function utf8ToBytes(string, units) {
- units = units || Infinity
- var codePoint
- var length = string.length
- var leadSurrogate = null
- var bytes = []
-
- for (var i = 0; i < length; ++i) {
- codePoint = string.charCodeAt(i)
-
- // is surrogate component
- if (codePoint > 0xD7FF && codePoint < 0xE000) {
- // last char was a lead
- if (!leadSurrogate) {
- // no lead yet
- if (codePoint > 0xDBFF) {
- // unexpected trail
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- continue
- } else if (i + 1 === length) {
- // unpaired lead
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- continue
- }
-
- // valid lead
- leadSurrogate = codePoint
-
- continue
- }
-
- // 2 leads in a row
- if (codePoint < 0xDC00) {
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- leadSurrogate = codePoint
- continue
- }
-
- // valid surrogate pair
- codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
- } else if (leadSurrogate) {
- // valid bmp char, but last char was a lead
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- }
-
- leadSurrogate = null
-
- // encode utf8
- if (codePoint < 0x80) {
- if ((units -= 1) < 0) break
- bytes.push(codePoint)
- } else if (codePoint < 0x800) {
- if ((units -= 2) < 0) break
- bytes.push(
- codePoint >> 0x6 | 0xC0,
- codePoint & 0x3F | 0x80
- )
- } else if (codePoint < 0x10000) {
- if ((units -= 3) < 0) break
- bytes.push(
- codePoint >> 0xC | 0xE0,
- codePoint >> 0x6 & 0x3F | 0x80,
- codePoint & 0x3F | 0x80
- )
- } else if (codePoint < 0x110000) {
- if ((units -= 4) < 0) break
- bytes.push(
- codePoint >> 0x12 | 0xF0,
- codePoint >> 0xC & 0x3F | 0x80,
- codePoint >> 0x6 & 0x3F | 0x80,
- codePoint & 0x3F | 0x80
- )
- } else {
- throw new Error('Invalid code point')
- }
- }
-
- return bytes
- }
-
- function asciiToBytes(str) {
- var byteArray = []
- for (var i = 0; i < str.length; ++i) {
- // Node's code seems to be doing this and not & 0x7F..
- byteArray.push(str.charCodeAt(i) & 0xFF)
- }
- return byteArray
- }
-
- function utf16leToBytes(str, units) {
- var c, hi, lo
- var byteArray = []
- for (var i = 0; i < str.length; ++i) {
- if ((units -= 2) < 0) break
-
- c = str.charCodeAt(i)
- hi = c >> 8
- lo = c % 256
- byteArray.push(lo)
- byteArray.push(hi)
- }
-
- return byteArray
- }
-
- function base64ToBytes(str) {
- return base64.toByteArray(base64clean(str))
- }
-
- function blitBuffer(src, dst, offset, length) {
- for (var i = 0; i < length; ++i) {
- if ((i + offset >= dst.length) || (i >= src.length)) break
- dst[i + offset] = src[i]
- }
- return i
- }
-
- // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass
- // the `instanceof` check but they should be treated as of that type.
- // See: https://github.com/feross/buffer/issues/166
- function isInstance(obj, type) {
- return obj instanceof type ||
- (obj != null && obj.constructor != null && obj.constructor.name != null &&
- obj.constructor.name === type.name)
- }
- function numberIsNaN(obj) {
- // For IE11 support
- return obj !== obj // eslint-disable-line no-self-compare
- }
-
- }, { "base64-js": 3, "ieee754": 5 }], 5: [function (require, module, exports) {
- exports.read = function (buffer, offset, isLE, mLen, nBytes) {
- var e, m
- var eLen = (nBytes * 8) - mLen - 1
- var eMax = (1 << eLen) - 1
- var eBias = eMax >> 1
- var nBits = -7
- var i = isLE ? (nBytes - 1) : 0
- var d = isLE ? -1 : 1
- var s = buffer[offset + i]
-
- i += d
-
- e = s & ((1 << (-nBits)) - 1)
- s >>= (-nBits)
- nBits += eLen
- for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) { }
-
- m = e & ((1 << (-nBits)) - 1)
- e >>= (-nBits)
- nBits += mLen
- for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) { }
-
- if (e === 0) {
- e = 1 - eBias
- } else if (e === eMax) {
- return m ? NaN : ((s ? -1 : 1) * Infinity)
- } else {
- m = m + Math.pow(2, mLen)
- e = e - eBias
- }
- return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
- }
-
- exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
- var e, m, c
- var eLen = (nBytes * 8) - mLen - 1
- var eMax = (1 << eLen) - 1
- var eBias = eMax >> 1
- var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
- var i = isLE ? 0 : (nBytes - 1)
- var d = isLE ? 1 : -1
- var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
-
- value = Math.abs(value)
-
- if (isNaN(value) || value === Infinity) {
- m = isNaN(value) ? 1 : 0
- e = eMax
- } else {
- e = Math.floor(Math.log(value) / Math.LN2)
- if (value * (c = Math.pow(2, -e)) < 1) {
- e--
- c *= 2
- }
- if (e + eBias >= 1) {
- value += rt / c
- } else {
- value += rt * Math.pow(2, 1 - eBias)
- }
- if (value * c >= 2) {
- e++
- c /= 2
- }
-
- if (e + eBias >= eMax) {
- m = 0
- e = eMax
- } else if (e + eBias >= 1) {
- m = ((value * c) - 1) * Math.pow(2, mLen)
- e = e + eBias
- } else {
- m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
- e = 0
- }
- }
-
- for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) { }
-
- e = (e << mLen) | m
- eLen += mLen
- for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) { }
-
- buffer[offset + i - d] |= s * 128
- }
-
- }, {}]
- }, {}, [1]);
+ loadAction()
</script>
diff --git a/apps/mobile/html/Web.bundle/site/quill.js b/apps/mobile/html/Web.bundle/site/quill.js
new file mode 100644
index 000000000..991cc0495
--- /dev/null
+++ b/apps/mobile/html/Web.bundle/site/quill.js
@@ -0,0 +1 @@
+!function(){return function t(e,n,r){function o(a,l){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!l&&u)return u(a,!0);if(i)return i(a,!0);var s=new Error("Cannot find module '"+a+"'");throw s.code="MODULE_NOT_FOUND",s}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){return o(e[a][1][t]||t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}}()({1:[function(t,e,n){requiring=t},{quill:2}],2:[function(t,e,n){(function(t){var r,o;r="undefined"!=typeof self?self:this,o=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=133)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(17),o=n(18),i=n(19),a=n(51),l=n(52),u=n(53),s=n(54),c=n(55),f=n(12),p=n(34),h=n(35),d=n(33),y=n(2),v={Scope:y.Scope,create:y.create,find:y.find,query:y.query,register:y.register,Container:r.default,Format:o.default,Leaf:i.default,Embed:s.default,Scroll:a.default,Block:u.default,Inline:l.default,Text:c.default,Attributor:{Attribute:f.default,Class:p.default,Style:h.default,Store:d.default}};e.default=v},function(t,e,n){var r=n(57),o=n(11),i=n(3),a=n(22),l=String.fromCharCode(0),u=function(t){Array.isArray(t)?this.ops=t:null!=t&&Array.isArray(t.ops)?this.ops=t.ops:this.ops=[]};u.prototype.insert=function(t,e){var n={};return 0===t.length?this:(n.insert=t,null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n))},u.prototype.delete=function(t){return t<=0?this:this.push({delete:t})},u.prototype.retain=function(t,e){if(t<=0)return this;var n={retain:t};return null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n)},u.prototype.push=function(t){var e=this.ops.length,n=this.ops[e-1];if(t=i(!0,{},t),"object"==typeof n){if("number"==typeof t.delete&&"number"==typeof n.delete)return this.ops[e-1]={delete:n.delete+t.delete},this;if("number"==typeof n.delete&&null!=t.insert&&(e-=1,"object"!=typeof(n=this.ops[e-1])))return this.ops.unshift(t),this;if(o(t.attributes,n.attributes)){if("string"==typeof t.insert&&"string"==typeof n.insert)return this.ops[e-1]={insert:n.insert+t.insert},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if("number"==typeof t.retain&&"number"==typeof n.retain)return this.ops[e-1]={retain:n.retain+t.retain},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this},u.prototype.chop=function(){var t=this.ops[this.ops.length-1];return t&&t.retain&&!t.attributes&&this.ops.pop(),this},u.prototype.filter=function(t){return this.ops.filter(t)},u.prototype.forEach=function(t){this.ops.forEach(t)},u.prototype.map=function(t){return this.ops.map(t)},u.prototype.partition=function(t){var e=[],n=[];return this.forEach(function(r){(t(r)?e:n).push(r)}),[e,n]},u.prototype.reduce=function(t,e){return this.ops.reduce(t,e)},u.prototype.changeLength=function(){return this.reduce(function(t,e){return e.insert?t+a.length(e):e.delete?t-e.delete:t},0)},u.prototype.length=function(){return this.reduce(function(t,e){return t+a.length(e)},0)},u.prototype.slice=function(t,e){t=t||0,"number"!=typeof e&&(e=1/0);for(var n=[],r=a.iterator(this.ops),o=0;o<e&&r.hasNext();){var i;o<t?i=r.next(t-o):(i=r.next(e-o),n.push(i)),o+=a.length(i)}return new u(n)},u.prototype.compose=function(t){var e=a.iterator(this.ops),n=a.iterator(t.ops),r=[],i=n.peek();if(null!=i&&"number"==typeof i.retain&&null==i.attributes){for(var l=i.retain;"insert"===e.peekType()&&e.peekLength()<=l;)l-=e.peekLength(),r.push(e.next());i.retain-l>0&&n.next(i.retain-l)}for(var s=new u(r);e.hasNext()||n.hasNext();)if("insert"===n.peekType())s.push(n.next());else if("delete"===e.peekType())s.push(e.next());else{var c=Math.min(e.peekLength(),n.peekLength()),f=e.next(c),p=n.next(c);if("number"==typeof p.retain){var h={};"number"==typeof f.retain?h.retain=c:h.insert=f.insert;var d=a.attributes.compose(f.attributes,p.attributes,"number"==typeof f.retain);if(d&&(h.attributes=d),s.push(h),!n.hasNext()&&o(s.ops[s.ops.length-1],h)){var y=new u(e.rest());return s.concat(y).chop()}}else"number"==typeof p.delete&&"number"==typeof f.retain&&s.push(p)}return s.chop()},u.prototype.concat=function(t){var e=new u(this.ops.slice());return t.ops.length>0&&(e.push(t.ops[0]),e.ops=e.ops.concat(t.ops.slice(1))),e},u.prototype.diff=function(t,e){if(this.ops===t.ops)return new u;var n=[this,t].map(function(e){return e.map(function(n){if(null!=n.insert)return"string"==typeof n.insert?n.insert:l;throw new Error("diff() called "+(e===t?"on":"with")+" non-document")}).join("")}),i=new u,s=r(n[0],n[1],e),c=a.iterator(this.ops),f=a.iterator(t.ops);return s.forEach(function(t){for(var e=t[1].length;e>0;){var n=0;switch(t[0]){case r.INSERT:n=Math.min(f.peekLength(),e),i.push(f.next(n));break;case r.DELETE:n=Math.min(e,c.peekLength()),c.next(n),i.delete(n);break;case r.EQUAL:n=Math.min(c.peekLength(),f.peekLength(),e);var l=c.next(n),u=f.next(n);o(l.insert,u.insert)?i.retain(n,a.attributes.diff(l.attributes,u.attributes)):i.push(u).delete(n)}e-=n}}),i.chop()},u.prototype.eachLine=function(t,e){e=e||"\n";for(var n=a.iterator(this.ops),r=new u,o=0;n.hasNext();){if("insert"!==n.peekType())return;var i=n.peek(),l=a.length(i)-n.peekLength(),s="string"==typeof i.insert?i.insert.indexOf(e,l)-l:-1;if(s<0)r.push(n.next());else if(s>0)r.push(n.next(s));else{if(!1===t(r,n.next(1).attributes||{},o))return;o+=1,r=new u}}r.length()>0&&t(r,{},o)},u.prototype.transform=function(t,e){if(e=!!e,"number"==typeof t)return this.transformPosition(t,e);for(var n=a.iterator(this.ops),r=a.iterator(t.ops),o=new u;n.hasNext()||r.hasNext();)if("insert"!==n.peekType()||!e&&"insert"===r.peekType())if("insert"===r.peekType())o.push(r.next());else{var i=Math.min(n.peekLength(),r.peekLength()),l=n.next(i),s=r.next(i);if(l.delete)continue;s.delete?o.push(s):o.retain(i,a.attributes.transform(l.attributes,s.attributes,e))}else o.retain(a.length(n.next()));return o.chop()},u.prototype.transformPosition=function(t,e){e=!!e;for(var n=a.iterator(this.ops),r=0;n.hasNext()&&r<=t;){var o=n.peekLength(),i=n.peekType();n.next(),"delete"!==i?("insert"===i&&(r<t||!e)&&(t+=o),r+=o):t-=Math.min(o,t-r)}return t},t.exports=u},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){function e(e){var n=this;return e="[Parchment] "+e,(n=t.call(this,e)||this).message=e,n.name=n.constructor.name,n}return o(e,t),e}(Error);e.ParchmentError=i;var a,l={},u={},s={},c={};function f(t,e){var n;if(void 0===e&&(e=a.ANY),"string"==typeof t)n=c[t]||l[t];else if(t instanceof Text||t.nodeType===Node.TEXT_NODE)n=c.text;else if("number"==typeof t)t&a.LEVEL&a.BLOCK?n=c.block:t&a.LEVEL&a.INLINE&&(n=c.inline);else if(t instanceof HTMLElement){var r=(t.getAttribute("class")||"").split(/\s+/);for(var o in r)if(n=u[r[o]])break;n=n||s[t.tagName]}return null==n?null:e&a.LEVEL&n.scope&&e&a.TYPE&n.scope?n:null}e.DATA_KEY="__blot",function(t){t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY"}(a=e.Scope||(e.Scope={})),e.create=function(t,e){var n=f(t);if(null==n)throw new i("Unable to create "+t+" blot");var r=n,o=t instanceof Node||t.nodeType===Node.TEXT_NODE?t:r.create(e);return new r(o,e)},e.find=function t(n,r){return void 0===r&&(r=!1),null==n?null:null!=n[e.DATA_KEY]?n[e.DATA_KEY].blot:r?t(n.parentNode,r):null},e.query=f,e.register=function t(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(e.length>1)return e.map(function(e){return t(e)});var r=e[0];if("string"!=typeof r.blotName&&"string"!=typeof r.attrName)throw new i("Invalid definition");if("abstract"===r.blotName)throw new i("Cannot register abstract class");c[r.blotName||r.attrName]=r,"string"==typeof r.keyName?l[r.keyName]=r:(null!=r.className&&(u[r.className]=r),null!=r.tagName&&(Array.isArray(r.tagName)?r.tagName=r.tagName.map(function(t){return t.toUpperCase()}):r.tagName=r.tagName.toUpperCase(),(Array.isArray(r.tagName)?r.tagName:[r.tagName]).forEach(function(t){null!=s[t]&&null!=r.className||(s[t]=r)})));return r}},function(t,e){"use strict";var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,o=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===r.call(t)},l=function(t){if(!t||"[object Object]"!==r.call(t))return!1;var e,o=n.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&n.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!o&&!i)return!1;for(e in t);return void 0===e||n.call(t,e)},u=function(t,e){o&&"__proto__"===e.name?o(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue},s=function(t,e){if("__proto__"===e){if(!n.call(t,e))return;if(i)return i(t,e).value}return t[e]};t.exports=function t(){var e,n,r,o,i,c,f=arguments[0],p=1,h=arguments.length,d=!1;for("boolean"==typeof f&&(d=f,f=arguments[1]||{},p=2),(null==f||"object"!=typeof f&&"function"!=typeof f)&&(f={});p<h;++p)if(null!=(e=arguments[p]))for(n in e)r=s(f,n),f!==(o=s(e,n))&&(d&&o&&(l(o)||(i=a(o)))?(i?(i=!1,c=r&&a(r)?r:[]):c=r&&l(r)?r:{},u(f,{name:n,newValue:t(d,c,o)})):void 0!==o&&u(f,{name:n,newValue:o}));return f}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BlockEmbed=e.bubbleFormats=void 0;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0},i=f(n(3)),a=f(n(1)),l=f(n(0)),u=f(n(16)),s=f(n(6)),c=f(n(7));function f(t){return t&&t.__esModule?t:{default:t}}function p(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function d(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var y=function(t){function e(){return p(this,e),h(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return d(e,l.default.Embed),r(e,[{key:"attach",value:function(){o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"attach",this).call(this),this.attributes=new l.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return(new a.default).insert(this.value(),(0,i.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(t,e){var n=l.default.query(t,l.default.Scope.BLOCK_ATTRIBUTE);null!=n&&this.attributes.attribute(n,e)}},{key:"formatAt",value:function(t,e,n,r){this.format(n,r)}},{key:"insertAt",value:function(t,n,r){if("string"==typeof n&&n.endsWith("\n")){var i=l.default.create(v.blotName);this.parent.insertBefore(i,0===t?this:this.next),i.insertAt(0,n.slice(0,-1))}else o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertAt",this).call(this,t,n,r)}}]),e}();y.scope=l.default.Scope.BLOCK_BLOT;var v=function(t){function e(t){p(this,e);var n=h(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.cache={},n}return d(e,l.default.Block),r(e,[{key:"delta",value:function(){return null==this.cache.delta&&(this.cache.delta=this.descendants(l.default.Leaf).reduce(function(t,e){return 0===e.length()?t:t.insert(e.value(),b(e))},new a.default).insert("\n",b(this))),this.cache.delta}},{key:"deleteAt",value:function(t,n){o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"deleteAt",this).call(this,t,n),this.cache={}}},{key:"formatAt",value:function(t,n,r,i){n<=0||(l.default.query(r,l.default.Scope.BLOCK)?t+n===this.length()&&this.format(r,i):o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"formatAt",this).call(this,t,Math.min(n,this.length()-t-1),r,i),this.cache={})}},{key:"insertAt",value:function(t,n,r){if(null!=r)return o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertAt",this).call(this,t,n,r);if(0!==n.length){var i=n.split("\n"),a=i.shift();a.length>0&&(t<this.length()-1||null==this.children.tail?o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertAt",this).call(this,Math.min(t,this.length()-1),a):this.children.tail.insertAt(this.children.tail.length(),a),this.cache={});var l=this;i.reduce(function(t,e){return(l=l.split(t,!0)).insertAt(0,e),e.length},t+a.length)}}},{key:"insertBefore",value:function(t,n){var r=this.children.head;o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertBefore",this).call(this,t,n),r instanceof u.default&&r.remove(),this.cache={}}},{key:"length",value:function(){return null==this.cache.length&&(this.cache.length=o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"length",this).call(this)+1),this.cache.length}},{key:"moveChildren",value:function(t,n){o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"moveChildren",this).call(this,t,n),this.cache={}}},{key:"optimize",value:function(t){o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t),this.cache={}}},{key:"path",value:function(t){return o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"path",this).call(this,t,!0)}},{key:"removeChild",value:function(t){o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"removeChild",this).call(this,t),this.cache={}}},{key:"split",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(n&&(0===t||t>=this.length()-1)){var r=this.clone();return 0===t?(this.parent.insertBefore(r,this),this):(this.parent.insertBefore(r,this.next),r)}var i=o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"split",this).call(this,t,n);return this.cache={},i}}]),e}();function b(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null==t?e:("function"==typeof t.formats&&(e=(0,i.default)(e,t.formats())),null==t.parent||"scroll"==t.parent.blotName||t.parent.statics.scope!==t.statics.scope?e:b(t.parent,e))}v.blotName="block",v.tagName="P",v.defaultChild="break",v.allowedChildren=[s.default,l.default.Embed,c.default],e.bubbleFormats=b,e.BlockEmbed=y,e.default=v},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DeltaTransformer=e.default=e.overload=e.expandConfig=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&l.return&&l.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();n(56);var a=b(n(1)),l=b(n(14)),u=b(n(8)),s=b(n(9)),c=b(n(0)),f=n(15),p=b(f),h=b(n(3)),d=b(n(10)),y=b(n(40)),v=b(n(73));function b(t){return t&&t.__esModule?t:{default:t}}function g(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var m=(0,d.default)("quill"),w=function(){function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=_(e,r),this.container=this.options.container,null==this.container)return m.error("Invalid Quill container",e);this.options.debug&&t.debug(this.options.debug);var o=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new u.default,this.scroll=c.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new l.default(this.scroll),this.selection=new p.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(u.default.events.EDITOR_CHANGE,function(t){t===u.default.events.TEXT_CHANGE&&n.root.classList.toggle("ql-blank",n.editor.isBlank())}),this.emitter.on(u.default.events.SCROLL_UPDATE,function(t,e){var r=n.selection.lastRange,o=r&&0===r.length?r.index:void 0;O.call(n,function(){return n.editor.update(null,e,o)},t)});var i=this.clipboard.convert("<div class='ql-editor' style=\"white-space: normal;\">"+o+"<p><br></p></div>");this.setContents(i),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return i(t,null,[{key:"debug",value:function(t){!0===t&&(t="log"),d.default.level(t)}},{key:"find",value:function(t){return t.__quill||c.default.find(t)}},{key:"import",value:function(t){return null==this.imports[t]&&m.error("Cannot import "+t+". Are you sure it was registered?"),this.imports[t]}},{key:"register",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof t){var o=t.attrName||t.blotName;"string"==typeof o?this.register("formats/"+o,t,e):Object.keys(t).forEach(function(r){n.register(r,t[r],e)})}else null==this.imports[t]||r||m.warn("Overwriting "+t+" with",e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&"abstract"!==e.blotName?c.default.register(e):t.startsWith("modules")&&"function"==typeof e.register&&e.register()}}]),i(t,[{key:"addContainer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof t){var n=t;(t=document.createElement("div")).classList.add(n)}return this.container.insertBefore(t,e),t}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(t,e,n){var r=this,i=x(t,e,n),a=o(i,4);return t=a[0],e=a[1],n=a[3],O.call(this,function(){return r.editor.deleteText(t,e)},n,t,-1*e)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t)}},{key:"focus",value:function(){var t=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=t,this.scrollIntoView()}},{key:"format",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.default.sources.API;return O.call(this,function(){var r=n.getSelection(!0),o=new a.default;if(null==r)return o;if(c.default.query(t,c.default.Scope.BLOCK))o=n.editor.formatLine(r.index,r.length,g({},t,e));else{if(0===r.length)return n.selection.format(t,e),o;o=n.editor.formatText(r.index,r.length,g({},t,e))}return n.setSelection(r,u.default.sources.SILENT),o},r)}},{key:"formatLine",value:function(t,e,n,r,i){var a,l=this,u=x(t,e,n,r,i),s=o(u,4);return t=s[0],e=s[1],a=s[2],i=s[3],O.call(this,function(){return l.editor.formatLine(t,e,a)},i,t,0)}},{key:"formatText",value:function(t,e,n,r,i){var a,l=this,u=x(t,e,n,r,i),s=o(u,4);return t=s[0],e=s[1],a=s[2],i=s[3],O.call(this,function(){return l.editor.formatText(t,e,a)},i,t,0)}},{key:"getBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=void 0;n="number"==typeof t?this.selection.getBounds(t,e):this.selection.getBounds(t.index,t.length);var r=this.container.getBoundingClientRect();return{bottom:n.bottom-r.top,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,width:n.width}}},{key:"getContents",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t,n=x(t,e),r=o(n,2);return t=r[0],e=r[1],this.editor.getContents(t,e)}},{key:"getFormat",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof t?this.editor.getFormat(t,e):this.editor.getFormat(t.index,t.length)}},{key:"getIndex",value:function(t){return t.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(t){return this.scroll.leaf(t)}},{key:"getLine",value:function(t){return this.scroll.line(t)}},{key:"getLines",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof t?this.scroll.lines(t.index,t.length):this.scroll.lines(t,e)}},{key:"getModule",value:function(t){return this.theme.modules[t]}},{key:"getSelection",value:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t,n=x(t,e),r=o(n,2);return t=r[0],e=r[1],this.editor.getText(t,e)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(e,n,r){var o=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.sources.API;return O.call(this,function(){return o.editor.insertEmbed(e,n,r)},i,e)}},{key:"insertText",value:function(t,e,n,r,i){var a,l=this,u=x(t,0,n,r,i),s=o(u,4);return t=s[0],a=s[2],i=s[3],O.call(this,function(){return l.editor.insertText(t,e,a)},i,t,e.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(t,e,n){this.clipboard.dangerouslyPasteHTML(t,e,n)}},{key:"removeFormat",value:function(t,e,n){var r=this,i=x(t,e,n),a=o(i,4);return t=a[0],e=a[1],n=a[3],O.call(this,function(){return r.editor.removeFormat(t,e)},n,t)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.sources.API;return O.call(this,function(){t=new a.default(t);var n=e.getLength(),r=e.editor.deleteText(0,n),o=e.editor.applyDelta(t),i=o.ops[o.ops.length-1];return null!=i&&"string"==typeof i.insert&&"\n"===i.insert[i.insert.length-1]&&(e.editor.deleteText(e.getLength()-1,1),o.delete(1)),r.compose(o)},n)}},{key:"setSelection",value:function(e,n,r){if(null==e)this.selection.setRange(null,n||t.sources.API);else{var i=x(e,n,r),a=o(i,4);e=a[0],n=a[1],r=a[3],this.selection.setRange(new f.Range(e,n),r),r!==u.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.sources.API,n=(new a.default).insert(t);return this.setContents(n,e)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u.default.sources.USER,e=this.scroll.update(t);return this.selection.update(t),e}},{key:"updateContents",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.sources.API;return O.call(this,function(){return t=new a.default(t),e.editor.applyDelta(t,n)},n,!0)}}]),t}();function _(t,e){if((e=(0,h.default)(!0,{container:t,modules:{clipboard:!0,keyboard:!0,history:!0}},e)).theme&&e.theme!==w.DEFAULTS.theme){if(e.theme=w.import("themes/"+e.theme),null==e.theme)throw new Error("Invalid theme "+e.theme+". Did you register it?")}else e.theme=y.default;var n=(0,h.default)(!0,{},e.theme.DEFAULTS);[n,e].forEach(function(t){t.modules=t.modules||{},Object.keys(t.modules).forEach(function(e){!0===t.modules[e]&&(t.modules[e]={})})});var r=Object.keys(n.modules).concat(Object.keys(e.modules)).reduce(function(t,e){var n=w.import("modules/"+e);return null==n?m.error("Cannot load "+e+" module. Are you sure you registered it?"):t[e]=n.DEFAULTS||{},t},{});return null!=e.modules&&e.modules.toolbar&&e.modules.toolbar.constructor!==Object&&(e.modules.toolbar={container:e.modules.toolbar}),e=(0,h.default)(!0,{},w.DEFAULTS,{modules:r},n,e),["bounds","container","scrollingContainer"].forEach(function(t){"string"==typeof e[t]&&(e[t]=document.querySelector(e[t]))}),e.modules=Object.keys(e.modules).reduce(function(t,n){return e.modules[n]&&(t[n]=e.modules[n]),t},{}),e}function O(t,e,n,r){if(this.options.strict&&!this.isEnabled()&&e===u.default.sources.USER)return new a.default;var o=null==n?null:this.getSelection(),i=this.editor.delta,l=t();if(null!=o&&(!0===n&&(n=o.index),null==r?o=E(o,l,e):0!==r&&(o=E(o,n,r,e)),this.setSelection(o,u.default.sources.SILENT)),l.length()>0){var s,c,f=[u.default.events.TEXT_CHANGE,l,i,e];if((s=this.emitter).emit.apply(s,[u.default.events.EDITOR_CHANGE].concat(f)),e!==u.default.sources.SILENT)(c=this.emitter).emit.apply(c,f)}return l}function x(t,e,n,o,i){var a={};return"number"==typeof t.index&&"number"==typeof t.length?"number"!=typeof e?(i=o,o=n,n=e,e=t.length,t=t.index):(e=t.length,t=t.index):"number"!=typeof e&&(i=o,o=n,n=e,e=0),"object"===(void 0===n?"undefined":r(n))?(a=n,i=o):"string"==typeof n&&(null!=o?a[n]=o:i=n),[t,e,a,i=i||u.default.sources.API]}function E(t,e,n,r){if(null==t)return null;var i=void 0,l=void 0;if(e instanceof a.default){var s=[t.index,t.index+t.length].map(function(t){return e.transformPosition(t,r!==u.default.sources.USER)}),c=o(s,2);i=c[0],l=c[1]}else{var p=[t.index,t.index+t.length].map(function(t){return t<e||t===e&&r===u.default.sources.USER?t:n>=0?t+n:Math.max(e,t+n)}),h=o(p,2);i=h[0],l=h[1]}return new f.Range(i,l-i)}w.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},w.events=u.default.events,w.sources=u.default.sources,w.version="1.3.7",w.imports={delta:a.default,parchment:c.default,"core/module":s.default,"core/theme":y.default},e.expandConfig=_,e.overload=x,e.default=w,e.DeltaTransformer=v.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0},i=l(n(7)),a=l(n(0));function l(t){return t&&t.__esModule?t:{default:t}}var u=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,a.default.Inline),r(e,[{key:"formatAt",value:function(t,n,r,i){if(e.compare(this.statics.blotName,r)<0&&a.default.query(r,a.default.Scope.BLOT)){var l=this.isolate(t,n);i&&l.wrap(r,i)}else o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"formatAt",this).call(this,t,n,r,i)}},{key:"optimize",value:function(t){if(o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t),this.parent instanceof e&&e.compare(this.statics.blotName,this.parent.statics.blotName)>0){var n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}}],[{key:"compare",value:function(t,n){var r=e.order.indexOf(t),o=e.order.indexOf(n);return r>=0||o>=0?r-o:t===n?0:t<n?-1:1}}]),e}();u.allowedChildren=[u,a.default.Embed,i.default],u.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],e.default=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=n(0),i=(r=o)&&r.__esModule?r:{default:r};var a=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,i.default.Text),e}();e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=i(n(72));function i(t){return t&&t.__esModule?t:{default:t}}var a=(0,i(n(10)).default)("quill:events");["selectionchange","mousedown","mouseup","click"].forEach(function(t){document.addEventListener(t,function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(t){var n;t.__quill&&t.__quill.emitter&&(n=t.__quill.emitter).handleDOM.apply(n,e)})})});var l=function(t){function e(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var t=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.listeners={},t.on("error",a.error),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.default),r(e,[{key:"emit",value:function(){a.log.apply(a,arguments),function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0}(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];(this.listeners[t.type]||[]).forEach(function(e){var r=e.node,o=e.handler;(t.target===r||r.contains(t.target))&&o.apply(void 0,[t].concat(n))})}},{key:"listenDOM",value:function(t,e,n){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push({node:e,handler:n})}}]),e}();l.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},l.sources={API:"api",SILENT:"silent",USER:"user"},e.default=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.quill=e,this.options=n};r.DEFAULTS={},e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=["error","warn","log","info"],o="warn";function i(t){if(r.indexOf(t)<=r.indexOf(o)){for(var e,n=arguments.length,i=Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];(e=console)[t].apply(e,i)}}function a(t){return r.reduce(function(e,n){return e[n]=i.bind(console,n,t),e},{})}i.level=a.level=function(t){o=t},e.default=a},function(t,e,n){var r=n(36),o=n(59),i=n(60),a=n(61),l=n(64),u=n(71),s=Date.prototype.getTime;function c(t,e,n){var h=n||{};return!(h.strict?!i(t,e):t!==e)||(!t||!e||"object"!=typeof t&&"object"!=typeof e?h.strict?i(t,e):t==e:function(t,e,n){var i,h;if(typeof t!=typeof e)return!1;if(f(t)||f(e))return!1;if(t.prototype!==e.prototype)return!1;if(o(t)!==o(e))return!1;var d=a(t),y=a(e);if(d!==y)return!1;if(d||y)return t.source===e.source&&l(t)===l(e);if(u(t)&&u(e))return s.call(t)===s.call(e);var v=p(t),b=p(e);if(v!==b)return!1;if(v||b){if(t.length!==e.length)return!1;for(i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}if(typeof t!=typeof e)return!1;try{var g=r(t),m=r(e)}catch(t){return!1}if(g.length!==m.length)return!1;for(g.sort(),m.sort(),i=g.length-1;i>=0;i--)if(g[i]!=m[i])return!1;for(i=g.length-1;i>=0;i--)if(h=g[i],!c(t[h],e[h],n))return!1;return!0}(t,e,h))}function f(t){return null==t}function p(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}t.exports=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),o=function(){function t(t,e,n){void 0===n&&(n={}),this.attrName=t,this.keyName=e;var o=r.Scope.TYPE&r.Scope.ATTRIBUTE;null!=n.scope?this.scope=n.scope&r.Scope.LEVEL|o:this.scope=r.Scope.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}return t.keys=function(t){return[].map.call(t.attributes,function(t){return t.name})},t.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.setAttribute(this.keyName,e),!0)},t.prototype.canAdd=function(t,e){return null!=r.query(t,r.Scope.BLOT&(this.scope|r.Scope.TYPE))&&(null==this.whitelist||("string"==typeof e?this.whitelist.indexOf(e.replace(/["']/g,""))>-1:this.whitelist.indexOf(e)>-1))},t.prototype.remove=function(t){t.removeAttribute(this.keyName)},t.prototype.value=function(t){var e=t.getAttribute(this.keyName);return this.canAdd(t,e)&&e?e:""},t}();e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Code=void 0;var r=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&l.return&&l.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0},a=f(n(1)),l=f(n(0)),u=f(n(4)),s=f(n(6)),c=f(n(7));function f(t){return t&&t.__esModule?t:{default:t}}function p(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function d(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var y=function(t){function e(){return p(this,e),h(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return d(e,s.default),e}();y.blotName="code",y.tagName="CODE";var v=function(t){function e(){return p(this,e),h(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return d(e,u.default),o(e,[{key:"delta",value:function(){var t=this,e=this.domNode.textContent;return e.endsWith("\n")&&(e=e.slice(0,-1)),e.split("\n").reduce(function(e,n){return e.insert(n).insert("\n",t.formats())},new a.default)}},{key:"format",value:function(t,n){if(t!==this.statics.blotName||!n){var o=this.descendant(c.default,this.length()-1),a=r(o,1)[0];null!=a&&a.deleteAt(a.length()-1,1),i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n)}}},{key:"formatAt",value:function(t,n,r,o){if(0!==n&&null!=l.default.query(r,l.default.Scope.BLOCK)&&(r!==this.statics.blotName||o!==this.statics.formats(this.domNode))){var i=this.newlineIndex(t);if(!(i<0||i>=t+n)){var a=this.newlineIndex(t,!0)+1,u=i-a+1,s=this.isolate(a,u),c=s.next;s.format(r,o),c instanceof e&&c.formatAt(0,t-a+n-u,r,o)}}}},{key:"insertAt",value:function(t,e,n){if(null==n){var o=this.descendant(c.default,t),i=r(o,2),a=i[0],l=i[1];a.insertAt(l,e)}}},{key:"length",value:function(){var t=this.domNode.textContent.length;return this.domNode.textContent.endsWith("\n")?t:t+1}},{key:"newlineIndex",value:function(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])return this.domNode.textContent.slice(0,t).lastIndexOf("\n");var e=this.domNode.textContent.slice(t).indexOf("\n");return e>-1?t+e:-1}},{key:"optimize",value:function(t){this.domNode.textContent.endsWith("\n")||this.appendChild(l.default.create("text","\n")),i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===n.statics.formats(n.domNode)&&(n.optimize(t),n.moveChildren(this),n.remove())}},{key:"replace",value:function(t){i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"replace",this).call(this,t),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(t){var e=l.default.find(t);null==e?t.parentNode.removeChild(t):e instanceof l.default.Embed?e.remove():e.unwrap()})}}],[{key:"create",value:function(t){var n=i(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return n.setAttribute("spellcheck",!1),n}},{key:"formats",value:function(){return!0}}]),e}();v.blotName="code-block",v.tagName="PRE",v.TAB=" ",e.Code=y,e.default=v},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&l.return&&l.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=b(n(1)),l=b(n(22)),u=b(n(0)),s=b(n(13)),c=b(n(26)),f=n(4),p=b(f),h=b(n(16)),d=b(n(23)),y=b(n(11)),v=b(n(3));function b(t){return t&&t.__esModule?t:{default:t}}var g=/^[ -~]*$/,m=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.scroll=e,this.delta=this.getDelta()}return i(t,[{key:"applyDelta",value:function(t){var e=this,n=!1;this.scroll.update();var i=this.scroll.length();return this.scroll.batchStart(),(t=function(t){return t.reduce(function(t,e){if(1===e.insert){var n=(0,d.default)(e.attributes);return delete n.image,t.insert({image:e.attributes.image},n)}if(null==e.attributes||!0!==e.attributes.list&&!0!==e.attributes.bullet||((e=(0,d.default)(e)).attributes.list?e.attributes.list="ordered":(e.attributes.list="bullet",delete e.attributes.bullet)),"string"==typeof e.insert){var r=e.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return t.insert(r,e.attributes)}return t.push(e)},new a.default)}(t)).reduce(function(t,a){var s=a.retain||a.delete||a.insert.length||1,c=a.attributes||{};if(null!=a.insert){if("string"==typeof a.insert){var h=a.insert;h.endsWith("\n")&&n&&(n=!1,h=h.slice(0,-1)),t>=i&&!h.endsWith("\n")&&(n=!0),e.scroll.insertAt(t,h);var d=e.scroll.line(t),y=o(d,2),b=y[0],g=y[1],m=(0,v.default)({},(0,f.bubbleFormats)(b));if(b instanceof p.default){var w=b.descendant(u.default.Leaf,g),_=o(w,1)[0];m=(0,v.default)(m,(0,f.bubbleFormats)(_))}c=l.default.attributes.diff(m,c)||{}}else if("object"===r(a.insert)){var O=Object.keys(a.insert)[0];if(null==O)return t;e.scroll.insertAt(t,O,a.insert[O])}i+=s}return Object.keys(c).forEach(function(n){e.scroll.formatAt(t,s,n,c[n])}),t+s},0),t.reduce(function(t,n){return"number"==typeof n.delete?(e.scroll.deleteAt(t,n.delete),t):t+(n.retain||n.insert.length||1)},0),this.scroll.batchEnd(),this.update(t)}},{key:"deleteText",value:function(t,e){return this.scroll.deleteAt(t,e),this.update((new a.default).retain(t).delete(e))}},{key:"formatLine",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.scroll.update(),Object.keys(r).forEach(function(o){if(null==n.scroll.whitelist||n.scroll.whitelist[o]){var i=n.scroll.lines(t,Math.max(e,1)),a=e;i.forEach(function(e){var i=e.length();if(e instanceof s.default){var l=t-e.offset(n.scroll),u=e.newlineIndex(l+a)-l+1;e.formatAt(l,u,o,r[o])}else e.format(o,r[o]);a-=i})}}),this.scroll.optimize(),this.update((new a.default).retain(t).retain(e,(0,d.default)(r)))}},{key:"formatText",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.keys(r).forEach(function(o){n.scroll.formatAt(t,e,o,r[o])}),this.update((new a.default).retain(t).retain(e,(0,d.default)(r)))}},{key:"getContents",value:function(t,e){return this.delta.slice(t,t+e)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(t,e){return t.concat(e.delta())},new a.default)}},{key:"getFormat",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=[];0===e?this.scroll.path(t).forEach(function(t){var e=o(t,1)[0];e instanceof p.default?n.push(e):e instanceof u.default.Leaf&&r.push(e)}):(n=this.scroll.lines(t,e),r=this.scroll.descendants(u.default.Leaf,t,e));var i=[n,r].map(function(t){if(0===t.length)return{};for(var e=(0,f.bubbleFormats)(t.shift());Object.keys(e).length>0;){var n=t.shift();if(null==n)return e;e=w((0,f.bubbleFormats)(n),e)}return e});return v.default.apply(v.default,i)}},{key:"getText",value:function(t,e){return this.getContents(t,e).filter(function(t){return"string"==typeof t.insert}).map(function(t){return t.insert}).join("")}},{key:"insertEmbed",value:function(t,e,n){return this.scroll.insertAt(t,e,n),this.update((new a.default).retain(t).insert(function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({},e,n)))}},{key:"insertText",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(t,e),Object.keys(r).forEach(function(o){n.scroll.formatAt(t,e.length,o,r[o])}),this.update((new a.default).retain(t).insert(e,(0,d.default)(r)))}},{key:"isBlank",value:function(){if(0==this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;var t=this.scroll.children.head;return t.statics.blotName===p.default.blotName&&(!(t.children.length>1)&&t.children.head instanceof h.default)}},{key:"removeFormat",value:function(t,e){var n=this.getText(t,e),r=this.scroll.line(t+e),i=o(r,2),l=i[0],u=i[1],c=0,f=new a.default;null!=l&&(c=l instanceof s.default?l.newlineIndex(u)-u+1:l.length()-u,f=l.delta().slice(u,u+c-1).insert("\n"));var p=this.getContents(t,e+c).diff((new a.default).insert(n).concat(f)),h=(new a.default).retain(t).concat(p);return this.applyDelta(h)}},{key:"update",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=this.delta;if(1===e.length&&"characterData"===e[0].type&&e[0].target.data.match(g)&&u.default.find(e[0].target)){var o=u.default.find(e[0].target),i=(0,f.bubbleFormats)(o),l=o.offset(this.scroll),s=e[0].oldValue.replace(c.default.CONTENTS,""),p=(new a.default).insert(s),h=(new a.default).insert(o.value());t=(new a.default).retain(l).concat(p.diff(h,n)).reduce(function(t,e){return e.insert?t.insert(e.insert,i):t.push(e)},new a.default),this.delta=r.compose(t)}else this.delta=this.getDelta(),t&&(0,y.default)(r.compose(t),this.delta)||(t=r.diff(this.delta,n));return t}}]),t}();function w(t,e){return Object.keys(e).reduce(function(n,r){return null==t[r]?n:(e[r]===t[r]?n[r]=e[r]:Array.isArray(e[r])?e[r].indexOf(t[r])<0&&(n[r]=e[r].concat([t[r]])):n[r]=[e[r],t[r]],n)},{})}e.default=m},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Range=void 0;var r=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&l.return&&l.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=s(n(0)),a=s(n(23)),l=s(n(11)),u=s(n(8));function s(t){return t&&t.__esModule?t:{default:t}}function c(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var p=(0,s(n(10)).default)("quill:selection"),h=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;f(this,t),this.index=e,this.length=n},d=function(){function t(e,n){var r=this;f(this,t),this.emitter=n,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=i.default.create("cursor",this),this.lastRange=this.savedRange=new h(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){r.mouseDown||setTimeout(r.update.bind(r,u.default.sources.USER),1)}),this.emitter.on(u.default.events.EDITOR_CHANGE,function(t,e){t===u.default.events.TEXT_CHANGE&&e.length()>0&&r.update(u.default.sources.SILENT)}),this.emitter.on(u.default.events.SCROLL_BEFORE_UPDATE,function(){if(r.hasFocus()){var t=r.getNativeRange();null!=t&&t.start.node!==r.cursor.textNode&&r.emitter.once(u.default.events.SCROLL_UPDATE,function(){try{r.setNativeRange(t.start.node,t.start.offset,t.end.node,t.end.offset)}catch(t){}})}}),this.emitter.on(u.default.events.SCROLL_OPTIMIZE,function(t,e){if(e.range){var n=e.range,o=n.startNode,i=n.startOffset,a=n.endNode,l=n.endOffset;r.setNativeRange(o,i,a,l)}}),this.update(u.default.sources.SILENT)}return o(t,[{key:"handleComposition",value:function(){var t=this;this.root.addEventListener("compositionstart",function(){t.composing=!0}),this.root.addEventListener("compositionend",function(){if(t.composing=!1,t.cursor.parent){var e=t.cursor.restore();if(!e)return;setTimeout(function(){t.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)},1)}})}},{key:"handleDragging",value:function(){var t=this;this.emitter.listenDOM("mousedown",document.body,function(){t.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){t.mouseDown=!1,t.update(u.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(t,e){if(null==this.scroll.whitelist||this.scroll.whitelist[t]){this.scroll.update();var n=this.getNativeRange();if(null!=n&&n.native.collapsed&&!i.default.query(t,i.default.Scope.BLOCK)){if(n.start.node!==this.cursor.textNode){var r=i.default.find(n.start.node,!1);if(null==r)return;if(r instanceof i.default.Leaf){var o=r.split(n.start.offset);r.parent.insertBefore(this.cursor,o)}else r.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(t,e),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.scroll.length();t=Math.min(t,n-1),e=Math.min(t+e,n-1)-t;var o=void 0,i=this.scroll.leaf(t),a=r(i,2),l=a[0],u=a[1];if(null==l)return null;var s=l.position(u,!0),c=r(s,2);o=c[0],u=c[1];var f=document.createRange();if(e>0){f.setStart(o,u);var p=this.scroll.leaf(t+e),h=r(p,2);if(l=h[0],u=h[1],null==l)return null;var d=l.position(u,!0),y=r(d,2);return o=y[0],u=y[1],f.setEnd(o,u),f.getBoundingClientRect()}var v="left",b=void 0;return o instanceof Text?(u<o.data.length?(f.setStart(o,u),f.setEnd(o,u+1)):(f.setStart(o,u-1),f.setEnd(o,u),v="right"),b=f.getBoundingClientRect()):(b=l.domNode.getBoundingClientRect(),u>0&&(v="right")),{bottom:b.top+b.height,height:b.height,left:b[v],right:b[v],top:b.top,width:0}}},{key:"getNativeRange",value:function(){var t=document.getSelection();if(null==t||t.rangeCount<=0)return null;var e=t.getRangeAt(0);if(null==e)return null;var n=this.normalizeNative(e);return p.info("getNativeRange",n),n}},{key:"getRange",value:function(){var t=this.getNativeRange();return null==t?[null,null]:[this.normalizedToRange(t),t]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(t){var e=this,n=[[t.start.node,t.start.offset]];t.native.collapsed||n.push([t.end.node,t.end.offset]);var o=n.map(function(t){var n=r(t,2),o=n[0],a=n[1],l=i.default.find(o,!0),u=l.offset(e.scroll);return 0===a?u:l instanceof i.default.Container?u+l.length():u+l.index(o,a)}),a=Math.min(Math.max.apply(Math,c(o)),this.scroll.length()-1),l=Math.min.apply(Math,[a].concat(c(o)));return new h(l,a-l)}},{key:"normalizeNative",value:function(t){if(!y(this.root,t.startContainer)||!t.collapsed&&!y(this.root,t.endContainer))return null;var e={start:{node:t.startContainer,offset:t.startOffset},end:{node:t.endContainer,offset:t.endOffset},native:t};return[e.start,e.end].forEach(function(t){for(var e=t.node,n=t.offset;!(e instanceof Text)&&e.childNodes.length>0;)if(e.childNodes.length>n)e=e.childNodes[n],n=0;else{if(e.childNodes.length!==n)break;n=(e=e.lastChild)instanceof Text?e.data.length:e.childNodes.length+1}t.node=e,t.offset=n}),e}},{key:"rangeToNative",value:function(t){var e=this,n=t.collapsed?[t.index]:[t.index,t.index+t.length],o=[],i=this.scroll.length();return n.forEach(function(t,n){t=Math.min(i-1,t);var a,l=e.scroll.leaf(t),u=r(l,2),s=u[0],c=u[1],f=s.position(c,0!==n),p=r(f,2);a=p[0],c=p[1],o.push(a,c)}),o.length<2&&(o=o.concat(o)),o}},{key:"scrollIntoView",value:function(t){var e=this.lastRange;if(null!=e){var n=this.getBounds(e.index,e.length);if(null!=n){var o=this.scroll.length()-1,i=this.scroll.line(Math.min(e.index,o)),a=r(i,1)[0],l=a;if(e.length>0){var u=this.scroll.line(Math.min(e.index+e.length,o));l=r(u,1)[0]}if(null!=a&&null!=l){var s=t.getBoundingClientRect();n.top<s.top?t.scrollTop-=s.top-n.top:n.bottom>s.bottom&&(t.scrollTop+=n.bottom-s.bottom)}}}}},{key:"setNativeRange",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(p.info("setNativeRange",t,e,n,r),null==t||null!=this.root.parentNode&&null!=t.parentNode&&null!=n.parentNode){var i=document.getSelection();if(null!=i)if(null!=t){this.hasFocus()||this.root.focus();var a=(this.getNativeRange()||{}).native;if(null==a||o||t!==a.startContainer||e!==a.startOffset||n!==a.endContainer||r!==a.endOffset){"BR"==t.tagName&&(e=[].indexOf.call(t.parentNode.childNodes,t),t=t.parentNode),"BR"==n.tagName&&(r=[].indexOf.call(n.parentNode.childNodes,n),n=n.parentNode);var l=document.createRange();l.setStart(t,e),l.setEnd(n,r),i.removeAllRanges(),i.addRange(l)}}else i.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.default.sources.API;if("string"==typeof e&&(n=e,e=!1),p.info("setRange",t),null!=t){var r=this.rangeToNative(t);this.setNativeRange.apply(this,c(r).concat([e]))}else this.setNativeRange(null);this.update(n)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u.default.sources.USER,e=this.lastRange,n=this.getRange(),o=r(n,2),i=o[0],s=o[1];if(this.lastRange=i,null!=this.lastRange&&(this.savedRange=this.lastRange),!(0,l.default)(e,this.lastRange)){var c;!this.composing&&null!=s&&s.native.collapsed&&s.start.node!==this.cursor.textNode&&this.cursor.restore();var f,p=[u.default.events.SELECTION_CHANGE,(0,a.default)(this.lastRange),(0,a.default)(e),t];if((c=this.emitter).emit.apply(c,[u.default.events.EDITOR_CHANGE].concat(p)),t!==u.default.sources.SILENT)(f=this.emitter).emit.apply(f,p)}}}]),t}();function y(t,e){try{e.parentNode}catch(t){return!1}return e instanceof Text&&(e=e.parentNode),t.contains(e)}e.Range=h,e.default=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=n(0),a=(r=i)&&r.__esModule?r:{default:r};var l=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,a.default.Embed),o(e,[{key:"insertInto",value:function(t,n){0===t.children.length?function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0}(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertInto",this).call(this,t,n):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),e}();l.blotName="break",l.tagName="BR",e.default=l},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(50),a=n(32),l=n(2),u=function(t){function e(e){var n=t.call(this,e)||this;return n.build(),n}return o(e,t),e.prototype.appendChild=function(t){this.insertBefore(t)},e.prototype.attach=function(){t.prototype.attach.call(this),this.children.forEach(function(t){t.attach()})},e.prototype.build=function(){var t=this;this.children=new i.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(e){try{var n=s(e);t.insertBefore(n,t.children.head||void 0)}catch(t){if(t instanceof l.ParchmentError)return;throw t}})},e.prototype.deleteAt=function(t,e){if(0===t&&e===this.length())return this.remove();this.children.forEachAt(t,e,function(t,e,n){t.deleteAt(e,n)})},e.prototype.descendant=function(t,n){var r=this.children.find(n),o=r[0],i=r[1];return null==t.blotName&&t(o)||null!=t.blotName&&o instanceof t?[o,i]:o instanceof e?o.descendant(t,i):[null,-1]},e.prototype.descendants=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=Number.MAX_VALUE);var o=[],i=r;return this.children.forEachAt(n,r,function(n,r,a){(null==t.blotName&&t(n)||null!=t.blotName&&n instanceof t)&&o.push(n),n instanceof e&&(o=o.concat(n.descendants(t,r,i))),i-=a}),o},e.prototype.detach=function(){this.children.forEach(function(t){t.detach()}),t.prototype.detach.call(this)},e.prototype.formatAt=function(t,e,n,r){this.children.forEachAt(t,e,function(t,e,o){t.formatAt(e,o,n,r)})},e.prototype.insertAt=function(t,e,n){var r=this.children.find(t),o=r[0],i=r[1];if(o)o.insertAt(i,e,n);else{var a=null==n?l.create("text",e):l.create(e,n);this.appendChild(a)}},e.prototype.insertBefore=function(t,e){if(null!=this.statics.allowedChildren&&!this.statics.allowedChildren.some(function(e){return t instanceof e}))throw new l.ParchmentError("Cannot insert "+t.statics.blotName+" into "+this.statics.blotName);t.insertInto(this,e)},e.prototype.length=function(){return this.children.reduce(function(t,e){return t+e.length()},0)},e.prototype.moveChildren=function(t,e){this.children.forEach(function(n){t.insertBefore(n,e)})},e.prototype.optimize=function(e){if(t.prototype.optimize.call(this,e),0===this.children.length)if(null!=this.statics.defaultChild){var n=l.create(this.statics.defaultChild);this.appendChild(n),n.optimize(e)}else this.remove()},e.prototype.path=function(t,n){void 0===n&&(n=!1);var r=this.children.find(t,n),o=r[0],i=r[1],a=[[this,t]];return o instanceof e?a.concat(o.path(i,n)):(null!=o&&a.push([o,i]),a)},e.prototype.removeChild=function(t){this.children.remove(t)},e.prototype.replace=function(n){n instanceof e&&n.moveChildren(this),t.prototype.replace.call(this,n)},e.prototype.split=function(t,e){if(void 0===e&&(e=!1),!e){if(0===t)return this;if(t===this.length())return this.next}var n=this.clone();return this.parent.insertBefore(n,this.next),this.children.forEachAt(t,this.length(),function(t,r,o){t=t.split(r,e),n.appendChild(t)}),n},e.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},e.prototype.update=function(t,e){var n=this,r=[],o=[];t.forEach(function(t){t.target===n.domNode&&"childList"===t.type&&(r.push.apply(r,t.addedNodes),o.push.apply(o,t.removedNodes))}),o.forEach(function(t){if(!(null!=t.parentNode&&"IFRAME"!==t.tagName&&document.body.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var e=l.find(t);null!=e&&(null!=e.domNode.parentNode&&e.domNode.parentNode!==n.domNode||e.detach())}}),r.filter(function(t){return t.parentNode==n.domNode}).sort(function(t,e){return t===e?0:t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(t){var e=null;null!=t.nextSibling&&(e=l.find(t.nextSibling));var r=s(t);r.next==e&&null!=r.next||(null!=r.parent&&r.parent.removeChild(n),n.insertBefore(r,e||void 0))})},e}(a.default);function s(t){var e=l.find(t);if(null==e)try{e=l.create(t)}catch(n){e=l.create(l.Scope.INLINE),[].slice.call(t.childNodes).forEach(function(t){e.domNode.appendChild(t)}),t.parentNode&&t.parentNode.replaceChild(e.domNode,t),e.attach()}return e}e.default=u},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(12),a=n(33),l=n(17),u=n(2),s=function(t){function e(e){var n=t.call(this,e)||this;return n.attributes=new a.default(n.domNode),n}return o(e,t),e.formats=function(t){return"string"==typeof this.tagName||(Array.isArray(this.tagName)?t.tagName.toLowerCase():void 0)},e.prototype.format=function(t,e){var n=u.query(t);n instanceof i.default?this.attributes.attribute(n,e):e&&(null==n||t===this.statics.blotName&&this.formats()[t]===e||this.replaceWith(t,e))},e.prototype.formats=function(){var t=this.attributes.values(),e=this.statics.formats(this.domNode);return null!=e&&(t[this.statics.blotName]=e),t},e.prototype.replaceWith=function(e,n){var r=t.prototype.replaceWith.call(this,e,n);return this.attributes.copy(r),r},e.prototype.update=function(e,n){var r=this;t.prototype.update.call(this,e,n),e.some(function(t){return t.target===r.domNode&&"attributes"===t.type})&&this.attributes.build()},e.prototype.wrap=function(n,r){var o=t.prototype.wrap.call(this,n,r);return o instanceof e&&o.statics.scope===this.statics.scope&&this.attributes.move(o),o},e}(l.default);e.default=s},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(32),a=n(2),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.value=function(t){return!0},e.prototype.index=function(t,e){return this.domNode===t||this.domNode.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(e,1):-1},e.prototype.position=function(t,e){var n=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return t>0&&(n+=1),[this.parent.domNode,n]},e.prototype.value=function(){var t;return(t={})[this.statics.blotName]=this.statics.value(this.domNode)||!0,t},e.scope=a.Scope.INLINE_BLOT,e}(i.default);e.default=l},function(t,e,n){"use strict";var r=n(63);t.exports=Function.prototype.bind||r},function(t,e,n){"use strict";var r=n(36),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,l=Object.defineProperty,u=l&&function(){var t={};try{for(var e in l(t,"x",{enumerable:!1,value:t}),t)return!1;return t.x===t}catch(t){return!1}}(),s=function(t,e,n,r){var o;e in t&&("function"!=typeof(o=r)||"[object Function]"!==i.call(o)||!r())||(u?l(t,e,{configurable:!0,enumerable:!1,value:n,writable:!0}):t[e]=n)},c=function(t,e){var n=arguments.length>2?arguments[2]:{},i=r(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var l=0;l<i.length;l+=1)s(t,i[l],e[i[l]],n[i[l]])};c.supportsDescriptors=!!u,t.exports=c},function(t,e,n){var r=n(11),o=n(3),i={attributes:{compose:function(t,e,n){"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var r=o(!0,{},e);for(var i in n||(r=Object.keys(r).reduce(function(t,e){return null!=r[e]&&(t[e]=r[e]),t},{})),t)void 0!==t[i]&&void 0===e[i]&&(r[i]=t[i]);return Object.keys(r).length>0?r:void 0},diff:function(t,e){"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var n=Object.keys(t).concat(Object.keys(e)).reduce(function(n,o){return r(t[o],e[o])||(n[o]=void 0===e[o]?null:e[o]),n},{});return Object.keys(n).length>0?n:void 0},transform:function(t,e,n){if("object"!=typeof t)return e;if("object"==typeof e){if(!n)return e;var r=Object.keys(e).reduce(function(n,r){return void 0===t[r]&&(n[r]=e[r]),n},{});return Object.keys(r).length>0?r:void 0}}},iterator:function(t){return new a(t)},length:function(t){return"number"==typeof t.delete?t.delete:"number"==typeof t.retain?t.retain:"string"==typeof t.insert?t.insert.length:1}};function a(t){this.ops=t,this.index=0,this.offset=0}a.prototype.hasNext=function(){return this.peekLength()<1/0},a.prototype.next=function(t){t||(t=1/0);var e=this.ops[this.index];if(e){var n=this.offset,r=i.length(e);if(t>=r-n?(t=r-n,this.index+=1,this.offset=0):this.offset+=t,"number"==typeof e.delete)return{delete:t};var o={};return e.attributes&&(o.attributes=e.attributes),"number"==typeof e.retain?o.retain=t:"string"==typeof e.insert?o.insert=e.insert.substr(n,t):o.insert=e.insert,o}return{retain:1/0}},a.prototype.peek=function(){return this.ops[this.index]},a.prototype.peekLength=function(){return this.ops[this.index]?i.length(this.ops[this.index])-this.offset:1/0},a.prototype.peekType=function(){return this.ops[this.index]?"number"==typeof this.ops[this.index].delete?"delete":"number"==typeof this.ops[this.index].retain?"retain":"insert":"retain"},a.prototype.rest=function(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);var t=this.offset,e=this.index,n=this.next(),r=this.ops.slice(this.index);return this.offset=t,this.index=e,[n].concat(r)}return[]},t.exports=i},function(e,n){var r=function(){"use strict";function e(t,e){return null!=e&&t instanceof e}var n,r,o;try{n=Map}catch(t){n=function(){}}try{r=Set}catch(t){r=function(){}}try{o=Promise}catch(t){o=function(){}}function i(a,u,s,c,f){"object"==typeof u&&(s=u.depth,c=u.prototype,f=u.includeNonEnumerable,u=u.circular);var p=[],h=[],d=void 0!==t;return void 0===u&&(u=!0),void 0===s&&(s=1/0),function a(s,y){if(null===s)return null;if(0===y)return s;var v,b;if("object"!=typeof s)return s;if(e(s,n))v=new n;else if(e(s,r))v=new r;else if(e(s,o))v=new o(function(t,e){s.then(function(e){t(a(e,y-1))},function(t){e(a(t,y-1))})});else if(i.__isArray(s))v=[];else if(i.__isRegExp(s))v=new RegExp(s.source,l(s)),s.lastIndex&&(v.lastIndex=s.lastIndex);else if(i.__isDate(s))v=new Date(s.getTime());else{if(d&&t.isBuffer(s))return v=t.allocUnsafe?t.allocUnsafe(s.length):new t(s.length),s.copy(v),v;e(s,Error)?v=Object.create(s):void 0===c?(b=Object.getPrototypeOf(s),v=Object.create(b)):(v=Object.create(c),b=c)}if(u){var g=p.indexOf(s);if(-1!=g)return h[g];p.push(s),h.push(v)}for(var m in e(s,n)&&s.forEach(function(t,e){var n=a(e,y-1),r=a(t,y-1);v.set(n,r)}),e(s,r)&&s.forEach(function(t){var e=a(t,y-1);v.add(e)}),s){var w;b&&(w=Object.getOwnPropertyDescriptor(b,m)),w&&null==w.set||(v[m]=a(s[m],y-1))}if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(s);for(m=0;m<_.length;m++){var O=_[m];(!(E=Object.getOwnPropertyDescriptor(s,O))||E.enumerable||f)&&(v[O]=a(s[O],y-1),E.enumerable||Object.defineProperty(v,O,{enumerable:!1}))}}if(f){var x=Object.getOwnPropertyNames(s);for(m=0;m<x.length;m++){var E,k=x[m];(E=Object.getOwnPropertyDescriptor(s,k))&&E.enumerable||(v[k]=a(s[k],y-1),Object.defineProperty(v,k,{enumerable:!1}))}}return v}(a,s)}function a(t){return Object.prototype.toString.call(t)}function l(t){var e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),e}return i.clonePrototype=function(t){if(null===t)return null;var e=function(){};return e.prototype=t,new e},i.__objToStr=a,i.__isDate=function(t){return"object"==typeof t&&"[object Date]"===a(t)},i.__isArray=function(t){return"object"==typeof t&&"[object Array]"===a(t)},i.__isRegExp=function(t){return"object"==typeof t&&"[object RegExp]"===a(t)},i.__getRegExpFlags=l,i}();"object"==typeof e&&e.exports&&(e.exports=r)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&l.return&&l.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0},a=h(n(0)),l=h(n(8)),u=n(4),s=h(u),c=h(n(16)),f=h(n(13)),p=h(n(27));function h(t){return t&&t.__esModule?t:{default:t}}function d(t){return t instanceof s.default||t instanceof u.BlockEmbed}var y=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.emitter=n.emitter,Array.isArray(n.whitelist)&&(r.whitelist=n.whitelist.reduce(function(t,e){return t[e]=!0,t},{})),r.domNode.addEventListener("DOMNodeInserted",function(){}),r.optimize(),r.enable(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,a.default.Scroll),o(e,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(t,n){var o=this.line(t),a=r(o,2),l=a[0],s=a[1],p=this.line(t+n),h=r(p,1)[0];if(i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"deleteAt",this).call(this,t,n),null!=h&&l!==h&&s>0){if(l instanceof u.BlockEmbed||h instanceof u.BlockEmbed)return void this.optimize();if(l instanceof f.default){var d=l.newlineIndex(l.length(),!0);if(d>-1&&(l=l.split(d+1))===h)return void this.optimize()}else if(h instanceof f.default){var y=h.newlineIndex(0);y>-1&&h.split(y+1)}var v=h.children.head instanceof c.default?null:h.children.head;l.moveChildren(h,v),l.remove()}this.optimize()}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",t)}},{key:"formatAt",value:function(t,n,r,o){(null==this.whitelist||this.whitelist[r])&&(i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"formatAt",this).call(this,t,n,r,o),this.optimize())}},{key:"insertAt",value:function(t,n,r){if(null==r||null==this.whitelist||this.whitelist[n]){if(t>=this.length())if(null==r||null==a.default.query(n,a.default.Scope.BLOCK)){var o=a.default.create(this.statics.defaultChild);this.appendChild(o),null==r&&n.endsWith("\n")&&(n=n.slice(0,-1)),o.insertAt(0,n,r)}else{var l=a.default.create(n,r);this.appendChild(l)}else i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertAt",this).call(this,t,n,r);this.optimize()}}},{key:"insertBefore",value:function(t,n){if(t.statics.scope===a.default.Scope.INLINE_BLOT){var r=a.default.create(this.statics.defaultChild);r.appendChild(t),t=r}i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertBefore",this).call(this,t,n)}},{key:"leaf",value:function(t){return this.path(t).pop()||[null,-1]}},{key:"line",value:function(t){return t===this.length()?this.line(t-1):this.descendant(d,t)}},{key:"lines",value:function(){return function t(e,n,r){var o=[],i=r;return e.children.forEachAt(n,r,function(e,n,r){d(e)?o.push(e):e instanceof a.default.Container&&(o=o.concat(t(e,n,i))),i-=r}),o}(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE)}},{key:"optimize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!0!==this.batch&&(i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t,n),t.length>0&&this.emitter.emit(l.default.events.SCROLL_OPTIMIZE,t,n))}},{key:"path",value:function(t){return i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"path",this).call(this,t).slice(1)}},{key:"update",value:function(t){if(!0!==this.batch){var n=l.default.sources.USER;"string"==typeof t&&(n=t),Array.isArray(t)||(t=this.observer.takeRecords()),t.length>0&&this.emitter.emit(l.default.events.SCROLL_BEFORE_UPDATE,n,t),i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"update",this).call(this,t.concat([])),t.length>0&&this.emitter.emit(l.default.events.SCROLL_UPDATE,n,t)}}}]),e}();y.blotName="scroll",y.className="ql-editor",y.tagName="DIV",y.defaultChild="block",y.allowedChildren=[s.default,u.BlockEmbed,p.default],e.default=y},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SHORTKEY=e.default=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&l.return&&l.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=y(n(23)),l=y(n(11)),u=y(n(3)),s=y(n(1)),c=y(n(22)),f=y(n(0)),p=y(n(5)),h=y(n(10)),d=y(n(9));function y(t){return t&&t.__esModule?t:{default:t}}function v(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var b=(0,h.default)("quill:keyboard"),g=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",m=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.bindings={},Object.keys(r.options.bindings).forEach(function(e){("list autofill"!==e||null==t.scroll.whitelist||t.scroll.whitelist.list)&&r.options.bindings[e]&&r.addBinding(r.options.bindings[e])}),r.addBinding({key:e.keys.ENTER,shiftKey:null},E),r.addBinding({key:e.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(r.addBinding({key:e.keys.BACKSPACE},{collapsed:!0},_),r.addBinding({key:e.keys.DELETE},{collapsed:!0},O)):(r.addBinding({key:e.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},_),r.addBinding({key:e.keys.DELETE},{collapsed:!0,suffix:/^.?$/},O)),r.addBinding({key:e.keys.BACKSPACE},{collapsed:!1},x),r.addBinding({key:e.keys.DELETE},{collapsed:!1},x),r.addBinding({key:e.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},_),r.listen(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,d.default),i(e,null,[{key:"match",value:function(t,e){return e=j(e),!["altKey","ctrlKey","metaKey","shiftKey"].some(function(n){return!!e[n]!==t[n]&&null!==e[n]})&&e.key===(t.which||t.keyCode)}}]),i(e,[{key:"addBinding",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=j(t);if(null==r||null==r.key)return b.warn("Attempted to add invalid keyboard binding",r);"function"==typeof e&&(e={handler:e}),"function"==typeof n&&(n={handler:n}),r=(0,u.default)(r,e,n),this.bindings[r.key]=this.bindings[r.key]||[],this.bindings[r.key].push(r)}},{key:"listen",value:function(){var t=this;this.quill.root.addEventListener("keydown",function(n){if(!n.defaultPrevented){var i=n.which||n.keyCode,a=(t.bindings[i]||[]).filter(function(t){return e.match(n,t)});if(0!==a.length){var u=t.quill.getSelection();if(null!=u&&t.quill.hasFocus()){var s=t.quill.getLine(u.index),c=o(s,2),p=c[0],h=c[1],d=t.quill.getLeaf(u.index),y=o(d,2),v=y[0],b=y[1],g=0===u.length?[v,b]:t.quill.getLeaf(u.index+u.length),m=o(g,2),w=m[0],_=m[1],O=v instanceof f.default.Text?v.value().slice(0,b):"",x=w instanceof f.default.Text?w.value().slice(_):"",E={collapsed:0===u.length,empty:0===u.length&&p.length()<=1,format:t.quill.getFormat(u),offset:h,prefix:O,suffix:x};a.some(function(e){if(null!=e.collapsed&&e.collapsed!==E.collapsed)return!1;if(null!=e.empty&&e.empty!==E.empty)return!1;if(null!=e.offset&&e.offset!==E.offset)return!1;if(Array.isArray(e.format)){if(e.format.every(function(t){return null==E.format[t]}))return!1}else if("object"===r(e.format)&&!Object.keys(e.format).every(function(t){return!0===e.format[t]?null!=E.format[t]:!1===e.format[t]?null==E.format[t]:(0,l.default)(e.format[t],E.format[t])}))return!1;return!(null!=e.prefix&&!e.prefix.test(E.prefix))&&(!(null!=e.suffix&&!e.suffix.test(E.suffix))&&!0!==e.handler.call(t,u,E))})&&n.preventDefault()}}}})}}]),e}();function w(t,e){var n,r=t===m.keys.LEFT?"prefix":"suffix";return v(n={key:t,shiftKey:e,altKey:null},r,/^$/),v(n,"handler",function(n){var r=n.index;t===m.keys.RIGHT&&(r+=n.length+1);var i=this.quill.getLeaf(r);return!(o(i,1)[0]instanceof f.default.Embed)||(t===m.keys.LEFT?e?this.quill.setSelection(n.index-1,n.length+1,p.default.sources.USER):this.quill.setSelection(n.index-1,p.default.sources.USER):e?this.quill.setSelection(n.index,n.length+1,p.default.sources.USER):this.quill.setSelection(n.index+n.length+1,p.default.sources.USER),!1)}),n}function _(t,e){if(!(0===t.index||this.quill.getLength()<=1)){var n=this.quill.getLine(t.index),r=o(n,1)[0],i={};if(0===e.offset){var a=this.quill.getLine(t.index-1),l=o(a,1)[0];if(null!=l&&l.length()>1){var u=r.formats(),s=this.quill.getFormat(t.index-1,1);i=c.default.attributes.diff(u,s)||{}}}var f=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;this.quill.deleteText(t.index-f,f,p.default.sources.USER),Object.keys(i).length>0&&this.quill.formatLine(t.index-f,f,i,p.default.sources.USER),this.quill.focus()}}function O(t,e){var n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(!(t.index>=this.quill.getLength()-n)){var r={},i=0,a=this.quill.getLine(t.index),l=o(a,1)[0];if(e.offset>=l.length()-1){var u=this.quill.getLine(t.index+1),s=o(u,1)[0];if(s){var f=l.formats(),h=this.quill.getFormat(t.index,1);r=c.default.attributes.diff(f,h)||{},i=s.length()}}this.quill.deleteText(t.index,n,p.default.sources.USER),Object.keys(r).length>0&&this.quill.formatLine(t.index+i-1,n,r,p.default.sources.USER)}}function x(t){var e=this.quill.getLines(t),n={};if(e.length>1){var r=e[0].formats(),o=e[e.length-1].formats();n=c.default.attributes.diff(o,r)||{}}this.quill.deleteText(t,p.default.sources.USER),Object.keys(n).length>0&&this.quill.formatLine(t.index,1,n,p.default.sources.USER),this.quill.setSelection(t.index,p.default.sources.SILENT),this.quill.focus()}function E(t,e){var n=this;t.length>0&&this.quill.scroll.deleteAt(t.index,t.length);var r=Object.keys(e.format).reduce(function(t,n){return f.default.query(n,f.default.Scope.BLOCK)&&!Array.isArray(e.format[n])&&(t[n]=e.format[n]),t},{});this.quill.insertText(t.index,"\n",r,p.default.sources.USER),this.quill.setSelection(t.index+1,p.default.sources.SILENT),this.quill.focus(),Object.keys(e.format).forEach(function(t){null==r[t]&&(Array.isArray(e.format[t])||"link"!==t&&n.quill.format(t,e.format[t],p.default.sources.USER))})}function k(t){return{key:m.keys.TAB,shiftKey:!t,format:{"code-block":!0},handler:function(e){var n=f.default.query("code-block"),r=e.index,i=e.length,a=this.quill.scroll.descendant(n,r),l=o(a,2),u=l[0],s=l[1];if(null!=u){var c=this.quill.getIndex(u),h=u.newlineIndex(s,!0)+1,d=u.newlineIndex(c+s+i),y=u.domNode.textContent.slice(h,d).split("\n");s=0,y.forEach(function(e,o){t?(u.insertAt(h+s,n.TAB),s+=n.TAB.length,0===o?r+=n.TAB.length:i+=n.TAB.length):e.startsWith(n.TAB)&&(u.deleteAt(h+s,n.TAB.length),s-=n.TAB.length,0===o?r-=n.TAB.length:i-=n.TAB.length),s+=e.length+1}),this.quill.update(p.default.sources.USER),this.quill.setSelection(r,i,p.default.sources.SILENT)}}}}function A(t){return{key:t[0].toUpperCase(),shortKey:!0,handler:function(e,n){this.quill.format(t,!n.format[t],p.default.sources.USER)}}}function j(t){if("string"==typeof t||"number"==typeof t)return j({key:t});if("object"===(void 0===t?"undefined":r(t))&&(t=(0,a.default)(t,!1)),"string"==typeof t.key)if(null!=m.keys[t.key.toUpperCase()])t.key=m.keys[t.key.toUpperCase()];else{if(1!==t.key.length)return null;t.key=t.key.toUpperCase().charCodeAt(0)}return t.shortKey&&(t[g]=t.shortKey,delete t.shortKey),t}m.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},m.DEFAULTS={bindings:{bold:A("bold"),italic:A("italic"),underline:A("underline"),indent:{key:m.keys.TAB,format:["blockquote","indent","list"],handler:function(t,e){if(e.collapsed&&0!==e.offset)return!0;this.quill.format("indent","+1",p.default.sources.USER)}},outdent:{key:m.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(t,e){if(e.collapsed&&0!==e.offset)return!0;this.quill.format("indent","-1",p.default.sources.USER)}},"outdent backspace":{key:m.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(t,e){null!=e.format.indent?this.quill.format("indent","-1",p.default.sources.USER):null!=e.format.list&&this.quill.format("list",!1,p.default.sources.USER)}},"indent code-block":k(!0),"outdent code-block":k(!1),"remove tab":{key:m.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(t){this.quill.deleteText(t.index-1,1,p.default.sources.USER)}},tab:{key:m.keys.TAB,handler:function(t){this.quill.history.cutoff();var e=(new s.default).retain(t.index).delete(t.length).insert("\t");this.quill.updateContents(e,p.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,p.default.sources.SILENT)}},"list empty enter":{key:m.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(t,e){this.quill.format("list",!1,p.default.sources.USER),e.format.indent&&this.quill.format("indent",!1,p.default.sources.USER)}},"checklist enter":{key:m.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(t){var e=this.quill.getLine(t.index),n=o(e,2),r=n[0],i=n[1],a=(0,u.default)({},r.formats(),{list:"checked"}),l=(new s.default).retain(t.index).insert("\n",a).retain(r.length()-i-1).retain(1,{list:"unchecked"});this.quill.updateContents(l,p.default.sources.USER),this.quill.setSelection(t.index+1,p.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:m.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(t,e){var n=this.quill.getLine(t.index),r=o(n,2),i=r[0],a=r[1],l=(new s.default).retain(t.index).insert("\n",e.format).retain(i.length()-a-1).retain(1,{header:null});this.quill.updateContents(l,p.default.sources.USER),this.quill.setSelection(t.index+1,p.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(t,e){var n=e.prefix.length,r=this.quill.getLine(t.index),i=o(r,2),a=i[0],l=i[1];if(l>n)return!0;var u=void 0;switch(e.prefix.trim()){case"[]":case"[ ]":u="unchecked";break;case"[x]":u="checked";break;case"-":case"*":u="bullet";break;default:u="ordered"}this.quill.insertText(t.index," ",p.default.sources.USER),this.quill.history.cutoff();var c=(new s.default).retain(t.index-l).delete(n+1).retain(a.length()-2-l).retain(1,{list:u});this.quill.updateContents(c,p.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-n,p.default.sources.SILENT)}},"code exit":{key:m.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(t){var e=this.quill.getLine(t.index),n=o(e,2),r=n[0],i=n[1],a=(new s.default).retain(t.index+r.length()-i-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(a,p.default.sources.USER)}},"embed left":w(m.keys.LEFT,!1),"embed left shift":w(m.keys.LEFT,!0),"embed right":w(m.keys.RIGHT,!1),"embed right shift":w(m.keys.RIGHT,!0)}},e.default=m,e.SHORTKEY=g},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&l.return&&l.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0},i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=u(n(0)),l=u(n(7));function u(t){return t&&t.__esModule?t:{default:t}}var s=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.selection=n,r.textNode=document.createTextNode(e.CONTENTS),r.domNode.appendChild(r.textNode),r._length=0,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,a.default.Embed),i(e,null,[{key:"value",value:function(){}}]),i(e,[{key:"detach",value:function(){null!=this.parent&&this.parent.removeChild(this)}},{key:"format",value:function(t,n){if(0!==this._length)return o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n);for(var r=this,i=0;null!=r&&r.statics.scope!==a.default.Scope.BLOCK_BLOT;)i+=r.offset(r.parent),r=r.parent;null!=r&&(this._length=e.CONTENTS.length,r.optimize(),r.formatAt(i,e.CONTENTS.length,t,n),this._length=0)}},{key:"index",value:function(t,n){return t===this.textNode?0:o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"index",this).call(this,t,n)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!this.selection.composing&&null!=this.parent){var t=this.textNode,n=this.selection.getNativeRange(),o=void 0,i=void 0,u=void 0;if(null!=n&&n.start.node===t&&n.end.node===t){var s=[t,n.start.offset,n.end.offset];o=s[0],i=s[1],u=s[2]}for(;null!=this.domNode.lastChild&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==e.CONTENTS){var c=this.textNode.data.split(e.CONTENTS).join("");this.next instanceof l.default?(o=this.next.domNode,this.next.insertAt(0,c),this.textNode.data=e.CONTENTS):(this.textNode.data=c,this.parent.insertBefore(a.default.create(this.textNode),this),this.textNode=document.createTextNode(e.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),null!=i){var f=[i,u].map(function(t){return Math.max(0,Math.min(o.data.length,t-1))}),p=r(f,2);return i=p[0],u=p[1],{startNode:o,startOffset:i,endNode:o,endOffset:u}}}}},{key:"update",value:function(t,e){var n=this;if(t.some(function(t){return"characterData"===t.type&&t.target===n.textNode})){var r=this.restore();r&&(e.range=r)}}},{key:"value",value:function(){return""}}]),e}();s.blotName="cursor",s.className="ql-cursor",s.tagName="span",s.CONTENTS="\ufeff",e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=a(n(0)),o=n(4),i=a(o);function a(t){return t&&t.__esModule?t:{default:t}}var l=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.default.Container),e}();l.allowedChildren=[i.default,o.BlockEmbed,l],e.default=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ColorStyle=e.ColorClass=e.ColorAttributor=void 0;var r,o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=n(0),a=(r=i)&&r.__esModule?r:{default:r};var l=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,a.default.Attributor.Style),o(e,[{key:"value",value:function(t){var n=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0}(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"value",this).call(this,t);return n.startsWith("rgb(")?(n=n.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+n.split(",").map(function(t){return("00"+parseInt(t).toString(16)).slice(-2)}).join("")):n}}]),e}(),u=new a.default.Attributor.Class("color","ql-color",{scope:a.default.Scope.INLINE}),s=new l("color","color",{scope:a.default.Scope.INLINE});e.ColorAttributor=l,e.ColorClass=u,e.ColorStyle=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sanitize=e.default=void 0;var r,o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0},a=n(6),l=(r=a)&&r.__esModule?r:{default:r};var u=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,l.default),o(e,[{key:"format",value:function(t,n){if(t!==this.statics.blotName||!n)return i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n);n=this.constructor.sanitize(n),this.domNode.setAttribute("href",n)}}],[{key:"create",value:function(t){var n=i(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return t=this.sanitize(t),n.setAttribute("href",t),n.setAttribute("rel","noopener noreferrer"),n.setAttribute("target","_blank"),n}},{key:"formats",value:function(t){return t.getAttribute("href")}},{key:"sanitize",value:function(t){return s(t,this.PROTOCOL_WHITELIST)?t:this.SANITIZED_URL}}]),e}();function s(t,e){var n=document.createElement("a");n.href=t;var r=n.href.slice(0,n.href.indexOf(":"));return e.indexOf(r)>-1}u.blotName="link",u.tagName="A",u.SANITIZED_URL="about:blank",u.PROTOCOL_WHITELIST=["http","https","mailto","tel"],e.default=u,e.sanitize=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=l(n(25)),a=l(n(131));function l(t){return t&&t.__esModule?t:{default:t}}var u=0;function s(t,e){t.setAttribute(e,!("true"===t.getAttribute(e)))}var c=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.select=e,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){n.togglePicker()}),this.label.addEventListener("keydown",function(t){switch(t.keyCode){case i.default.keys.ENTER:n.togglePicker();break;case i.default.keys.ESCAPE:n.escape(),t.preventDefault()}}),this.select.addEventListener("change",this.update.bind(this))}return o(t,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),s(this.label,"aria-expanded"),s(this.options,"aria-hidden")}},{key:"buildItem",value:function(t){var e=this,n=document.createElement("span");return n.tabIndex="0",n.setAttribute("role","button"),n.classList.add("ql-picker-item"),t.hasAttribute("value")&&n.setAttribute("data-value",t.getAttribute("value")),t.textContent&&n.setAttribute("data-label",t.textContent),n.addEventListener("click",function(){e.selectItem(n,!0)}),n.addEventListener("keydown",function(t){switch(t.keyCode){case i.default.keys.ENTER:e.selectItem(n,!0),t.preventDefault();break;case i.default.keys.ESCAPE:e.escape(),t.preventDefault()}}),n}},{key:"buildLabel",value:function(){var t=document.createElement("span");return t.classList.add("ql-picker-label"),t.innerHTML=a.default,t.tabIndex="0",t.setAttribute("role","button"),t.setAttribute("aria-expanded","false"),this.container.appendChild(t),t}},{key:"buildOptions",value:function(){var t=this,e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id="ql-picker-options-"+u,u+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,[].slice.call(this.select.options).forEach(function(n){var r=t.buildItem(n);e.appendChild(r),!0===n.selected&&t.selectItem(r)}),this.container.appendChild(e)}},{key:"buildPicker",value:function(){var t=this;[].slice.call(this.select.attributes).forEach(function(e){t.container.setAttribute(e.name,e.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var t=this;this.close(),setTimeout(function(){return t.label.focus()},1)}},{key:"close",value:function(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.container.querySelector(".ql-selected");if(t!==n&&(null!=n&&n.classList.remove("ql-selected"),null!=t&&(t.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(t.parentNode.children,t),t.hasAttribute("data-value")?this.label.setAttribute("data-value",t.getAttribute("data-value")):this.label.removeAttribute("data-value"),t.hasAttribute("data-label")?this.label.setAttribute("data-label",t.getAttribute("data-label")):this.label.removeAttribute("data-label"),e))){if("function"==typeof Event)this.select.dispatchEvent(new Event("change"));else if("object"===("undefined"==typeof Event?"undefined":r(Event))){var o=document.createEvent("Event");o.initEvent("change",!0,!0),this.select.dispatchEvent(o)}this.close()}}},{key:"update",value:function(){var t=void 0;if(this.select.selectedIndex>-1){var e=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(e)}else this.selectItem(null);var n=null!=t&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}]),t}();e.default=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=b(n(0)),o=b(n(5)),i=n(4),a=b(i),l=b(n(16)),u=b(n(27)),s=b(n(26)),c=b(n(41)),f=b(n(6)),p=b(n(24)),h=b(n(7)),d=b(n(74)),y=b(n(48)),v=b(n(25));function b(t){return t&&t.__esModule?t:{default:t}}o.default.register({"blots/block":a.default,"blots/block/embed":i.BlockEmbed,"blots/break":l.default,"blots/container":u.default,"blots/cursor":s.default,"blots/embed":c.default,"blots/inline":f.default,"blots/scroll":p.default,"blots/text":h.default,"modules/clipboard":d.default,"modules/history":y.default,"modules/keyboard":v.default}),r.default.register(a.default,l.default,s.default,f.default,p.default,h.default),e.default=o.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),o=function(){function t(t){this.domNode=t,this.domNode[r.DATA_KEY]={blot:this}}return Object.defineProperty(t.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),t.create=function(t){if(null==this.tagName)throw new r.ParchmentError("Blot definition missing tagName");var e;return Array.isArray(this.tagName)?("string"==typeof t&&(t=t.toUpperCase(),parseInt(t).toString()===t&&(t=parseInt(t))),e="number"==typeof t?document.createElement(this.tagName[t-1]):this.tagName.indexOf(t)>-1?document.createElement(t):document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e},t.prototype.attach=function(){null!=this.parent&&(this.scroll=this.parent.scroll)},t.prototype.clone=function(){var t=this.domNode.cloneNode(!1);return r.create(t)},t.prototype.detach=function(){null!=this.parent&&this.parent.removeChild(this),delete this.domNode[r.DATA_KEY]},t.prototype.deleteAt=function(t,e){this.isolate(t,e).remove()},t.prototype.formatAt=function(t,e,n,o){var i=this.isolate(t,e);if(null!=r.query(n,r.Scope.BLOT)&&o)i.wrap(n,o);else if(null!=r.query(n,r.Scope.ATTRIBUTE)){var a=r.create(this.statics.scope);i.wrap(a),a.format(n,o)}},t.prototype.insertAt=function(t,e,n){var o=null==n?r.create("text",e):r.create(e,n),i=this.split(t);this.parent.insertBefore(o,i)},t.prototype.insertInto=function(t,e){void 0===e&&(e=null),null!=this.parent&&this.parent.children.remove(this);var n=null;t.children.insertBefore(this,e),null!=e&&(n=e.domNode),this.domNode.parentNode==t.domNode&&this.domNode.nextSibling==n||t.domNode.insertBefore(this.domNode,n),this.parent=t,this.attach()},t.prototype.isolate=function(t,e){var n=this.split(t);return n.split(e),n},t.prototype.length=function(){return 1},t.prototype.offset=function(t){return void 0===t&&(t=this.parent),null==this.parent||this==t?0:this.parent.children.offset(this)+this.parent.offset(t)},t.prototype.optimize=function(t){null!=this.domNode[r.DATA_KEY]&&delete this.domNode[r.DATA_KEY].mutations},t.prototype.remove=function(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},t.prototype.replace=function(t){null!=t.parent&&(t.parent.insertBefore(this,t.next),t.remove())},t.prototype.replaceWith=function(t,e){var n="string"==typeof t?r.create(t,e):t;return n.replace(this),n},t.prototype.split=function(t,e){return 0===t?this:this.next},t.prototype.update=function(t,e){},t.prototype.wrap=function(t,e){var n="string"==typeof t?r.create(t,e):t;return null!=this.parent&&this.parent.insertBefore(n,this.next),n.appendChild(this),n},t.blotName="abstract",t}();e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),o=n(34),i=n(35),a=n(2),l=function(){function t(t){this.attributes={},this.domNode=t,this.build()}return t.prototype.attribute=function(t,e){e?t.add(this.domNode,e)&&(null!=t.value(this.domNode)?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])},t.prototype.build=function(){var t=this;this.attributes={};var e=r.default.keys(this.domNode),n=o.default.keys(this.domNode),l=i.default.keys(this.domNode);e.concat(n).concat(l).forEach(function(e){var n=a.query(e,a.Scope.ATTRIBUTE);n instanceof r.default&&(t.attributes[n.attrName]=n)})},t.prototype.copy=function(t){var e=this;Object.keys(this.attributes).forEach(function(n){var r=e.attributes[n].value(e.domNode);t.format(n,r)})},t.prototype.move=function(t){var e=this;this.copy(t),Object.keys(this.attributes).forEach(function(t){e.attributes[t].remove(e.domNode)}),this.attributes={}},t.prototype.values=function(){var t=this;return Object.keys(this.attributes).reduce(function(e,n){return e[n]=t.attributes[n].value(t.domNode),e},{})},t}();e.default=l},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function i(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(function(t){return 0===t.indexOf(e+"-")})}Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.keys=function(t){return(t.getAttribute("class")||"").split(/\s+/).map(function(t){return t.split("-").slice(0,-1).join("-")})},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(this.remove(t),t.classList.add(this.keyName+"-"+e),!0)},e.prototype.remove=function(t){i(t,this.keyName).forEach(function(e){t.classList.remove(e)}),0===t.classList.length&&t.removeAttribute("class")},e.prototype.value=function(t){var e=(i(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""},e}(n(12).default);e.default=a},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function i(t){var e=t.split("-"),n=e.slice(1).map(function(t){return t[0].toUpperCase()+t.slice(1)}).join("");return e[0]+n}Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.keys=function(t){return(t.getAttribute("style")||"").split(";").map(function(t){return t.split(":")[0].trim()})},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.style[i(this.keyName)]=e,!0)},e.prototype.remove=function(t){t.style[i(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")},e.prototype.value=function(t){var e=t.style[i(this.keyName)];return this.canAdd(t,e)?e:""},e}(n(12).default);e.default=a},function(t,e,n){"use strict";var r=Array.prototype.slice,o=n(37),i=Object.keys,a=i?function(t){return i(t)}:n(58),l=Object.keys;a.shim=function(){Object.keys?function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2)||(Object.keys=function(t){return o(t)?l(r.call(t)):l(t)}):Object.keys=a;return Object.keys||a},t.exports=a},function(t,e,n){"use strict";var r=Object.prototype.toString;t.exports=function(t){var e=r.call(t),n="[object Arguments]"===e;return n||(n="[object Array]"!==e&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===r.call(t.callee)),n}},function(t,e,n){"use strict";var r=Object,o=TypeError;t.exports=function(){if(null!=this&&this!==r(this))throw new o("RegExp.prototype.flags getter called on non-object");var t="";return this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.sticky&&(t+="y"),t}},function(t,e,n){"use strict";var r=n(38),o=n(21).supportsDescriptors,i=Object.getOwnPropertyDescriptor,a=TypeError;t.exports=function(){if(!o)throw new a("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");if("gim"===/a/gim.flags){var t=i(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof/a/.dotAll)return t.get}return r}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var o=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.quill=e,this.options=n,this.modules={}}return r(t,[{key:"init",value:function(){var t=this;Object.keys(this.options.modules).forEach(function(e){null==t.modules[e]&&t.addModule(e)})}},{key:"addModule",value:function(t){var e=this.quill.constructor.import("modules/"+t);return this.modules[t]=new e(this.quill,this.options.modules[t]||{}),this.modules[t]}}]),t}();o.DEFAULTS={modules:{}},o.themes={default:o},e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=a(n(0)),i=a(n(7));function a(t){return t&&t.__esModule?t:{default:t}}var l="\ufeff",u=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.contentNode=document.createElement("span"),n.contentNode.setAttribute("contenteditable",!1),[].slice.call(n.domNode.childNodes).forEach(function(t){n.contentNode.appendChild(t)}),n.leftGuard=document.createTextNode(l),n.rightGuard=document.createTextNode(l),n.domNode.appendChild(n.leftGuard),n.domNode.appendChild(n.contentNode),n.domNode.appendChild(n.rightGuard),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.default.Embed),r(e,[{key:"index",value:function(t,n){return t===this.leftGuard?0:t===this.rightGuard?1:function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0}(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"index",this).call(this,t,n)}},{key:"restore",value:function(t){var e=void 0,n=void 0,r=t.data.split(l).join("");if(t===this.leftGuard)if(this.prev instanceof i.default){var a=this.prev.length();this.prev.insertAt(a,r),e={startNode:this.prev.domNode,startOffset:a+r.length}}else n=document.createTextNode(r),this.parent.insertBefore(o.default.create(n),this),e={startNode:n,startOffset:r.length};else t===this.rightGuard&&(this.next instanceof i.default?(this.next.insertAt(0,r),e={startNode:this.next.domNode,startOffset:r.length}):(n=document.createTextNode(r),this.parent.insertBefore(o.default.create(n),this.next),e={startNode:n,startOffset:r.length}));return t.data=l,e}},{key:"update",value:function(t,e){var n=this;t.forEach(function(t){if("characterData"===t.type&&(t.target===n.leftGuard||t.target===n.rightGuard)){var r=n.restore(t.target);r&&(e.range=r)}})}}]),e}();e.default=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AlignStyle=e.AlignClass=e.AlignAttribute=void 0;var r,o=n(0),i=(r=o)&&r.__esModule?r:{default:r};var a={scope:i.default.Scope.BLOCK,whitelist:["right","center","justify"]},l=new i.default.Attributor.Attribute("align","align",a),u=new i.default.Attributor.Class("align","ql-align",a),s=new i.default.Attributor.Style("align","text-align",a);e.AlignAttribute=l,e.AlignClass=u,e.AlignStyle=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DiffStyle=e.DiffClass=e.BackgroundStyle=e.BackgroundClass=void 0;var r,o=n(0),i=(r=o)&&r.__esModule?r:{default:r},a=n(28);var l=new i.default.Attributor.Class("background","ql-bg",{scope:i.default.Scope.INLINE}),u=new a.ColorAttributor("background","background-color",{scope:i.default.Scope.INLINE}),s=new i.default.Attributor.Class("diff","ql-diff",{scope:i.default.Scope.INLINE}),c=new a.ColorAttributor("diff","background-color",{scope:i.default.Scope.INLINE});e.BackgroundClass=l,e.BackgroundStyle=u,e.DiffClass=s,e.DiffStyle=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirectionStyle=e.DirectionClass=e.DirectionAttribute=void 0;var r,o=n(0),i=(r=o)&&r.__esModule?r:{default:r};var a={scope:i.default.Scope.BLOCK,whitelist:["rtl"]},l=new i.default.Attributor.Attribute("direction","dir",a),u=new i.default.Attributor.Class("direction","ql-direction",a),s=new i.default.Attributor.Style("direction","direction",a);e.DirectionAttribute=l,e.DirectionClass=u,e.DirectionStyle=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FontClass=e.FontStyle=void 0;var r,o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=n(0),a=(r=i)&&r.__esModule?r:{default:r};var l={scope:a.default.Scope.INLINE,whitelist:["serif","monospace"]},u=new a.default.Attributor.Class("font","ql-font",l),s=new(function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,a.default.Attributor.Style),o(e,[{key:"value",value:function(t){return function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0}(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"value",this).call(this,t).replace(/["']/g,"")}}]),e}())("font","font-family",l);e.FontStyle=s,e.FontClass=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SizeStyle=e.SizeClass=void 0;var r,o=n(0),i=(r=o)&&r.__esModule?r:{default:r};var a=new i.default.Attributor.Class("size","ql-size",{scope:i.default.Scope.INLINE,whitelist:["small","large","huge"]}),l=new i.default.Attributor.Style("size","font-size",{scope:i.default.Scope.INLINE,whitelist:["10px","18px","32px"]});e.SizeClass=a,e.SizeStyle=l},function(t,e,n){"use strict";t.exports={align:{"":n(94),center:n(95),right:n(96),justify:n(97)},background:n(98),blockquote:n(99),bold:n(100),clean:n(101),code:n(102),"code-block":n(103),color:n(104),direction:{"":n(105),rtl:n(106)},float:{center:n(107),full:n(108),left:n(109),right:n(110)},formula:n(111),header:{1:n(112),2:n(113),3:n(114),4:n(115),5:n(116),6:n(117)},italic:n(118),image:n(119),indent:{"+1":n(120),"-1":n(121)},link:n(122),list:{ordered:n(123),bullet:n(124),check:n(125)},script:{sub:n(126),super:n(127)},strike:n(128),underline:n(129),video:n(130)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getLastChangeIndex=e.default=void 0;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=l(n(0)),i=l(n(5)),a=l(n(9));function l(t){return t&&t.__esModule?t:{default:t}}var u=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.lastRecorded=0,r.ignoreChange=!1,r.clear(),r.quill.on(i.default.events.EDITOR_CHANGE,function(t,e,n,o){t!==i.default.events.TEXT_CHANGE||r.ignoreChange||(r.options.userOnly&&o!==i.default.sources.USER?r.transform(e):r.record(e,n))}),r.quill.keyboard.addBinding({key:"Z",shortKey:!0},r.undo.bind(r)),r.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},r.redo.bind(r)),/Win/i.test(navigator.platform)&&r.quill.keyboard.addBinding({key:"Y",shortKey:!0},r.redo.bind(r)),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,a.default),r(e,[{key:"change",value:function(t,e){if(0!==this.stack[t].length){var n=this.stack[t].pop();this.stack[e].push(n),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(n[t],i.default.sources.USER),this.ignoreChange=!1;var r=s(n[t]);this.quill.setSelection(r)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(t,e){if(0!==t.ops.length){this.stack.redo=[];var n=this.quill.getContents().diff(e),r=Date.now();if(this.lastRecorded+this.options.delay>r&&this.stack.undo.length>0){var o=this.stack.undo.pop();n=n.compose(o.undo),t=o.redo.compose(t)}else this.lastRecorded=r;this.stack.undo.push({redo:t,undo:n}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(t){this.stack.undo.forEach(function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)}),this.stack.redo.forEach(function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),e}();function s(t){var e=t.reduce(function(t,e){return t+=e.delete||0},0),n=t.length()-e;return function(t){var e=t.ops[t.ops.length-1];return null!=e&&(null!=e.insert?"string"==typeof e.insert&&e.insert.endsWith("\n"):null!=e.attributes&&Object.keys(e.attributes).some(function(t){return null!=o.default.query(t,o.default.Scope.BLOCK)}))}(t)&&(n-=1),n}u.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1},e.default=u,e.getLastChangeIndex=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BaseTooltip=void 0;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=h(n(3)),i=h(n(1)),a=h(n(8)),l=h(n(25)),u=h(n(40)),s=h(n(77)),c=h(n(78)),f=h(n(30)),p=h(n(79));function h(t){return t&&t.__esModule?t:{default:t}}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function y(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function v(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var b=[!1,"center","right","justify"],g=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],m=[!1,"serif","monospace"],w=["1","2","3",!1],_=["small",!1,"large","huge"],O=function(t){function e(t,n){d(this,e);var r=y(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return t.emitter.listenDOM("click",document.body,function e(n){if(!document.body.contains(t.root))return document.body.removeEventListener("click",e);null==r.tooltip||r.tooltip.root.contains(n.target)||document.activeElement===r.tooltip.textbox||r.quill.hasFocus()||r.tooltip.hide(),null!=r.pickers&&r.pickers.forEach(function(t){t.container.contains(n.target)||t.close()})}),r}return v(e,u.default),r(e,[{key:"addModule",value:function(t){var n=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0}(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"addModule",this).call(this,t);return"toolbar"===t&&this.extendToolbar(n),n}},{key:"buildButtons",value:function(t,e){t.forEach(function(t){(t.getAttribute("class")||"").split(/\s+/).forEach(function(n){if(n.startsWith("ql-")&&(n=n.slice("ql-".length),null!=e[n]))if("direction"===n)t.innerHTML=e[n][""]+e[n].rtl;else if("string"==typeof e[n])t.innerHTML=e[n];else{var r=t.value||"";null!=r&&e[n][r]&&(t.innerHTML=e[n][r])}})})}},{key:"buildPickers",value:function(t,e){var n=this;this.pickers=t.map(function(t){if(t.classList.contains("ql-align"))return null==t.querySelector("option")&&E(t,b),new c.default(t,e.align);if(t.classList.contains("ql-background")||t.classList.contains("ql-color")){var n=t.classList.contains("ql-background")?"background":"color";return null==t.querySelector("option")&&E(t,g,"background"===n?"#ffffff":"#000000"),new s.default(t,e[n])}return null==t.querySelector("option")&&(t.classList.contains("ql-font")?E(t,m):t.classList.contains("ql-header")?E(t,w):t.classList.contains("ql-size")&&E(t,_)),new f.default(t)});this.quill.on(a.default.events.EDITOR_CHANGE,function(){n.pickers.forEach(function(t){t.update()})})}}]),e}();O.DEFAULTS=(0,o.default)(!0,{},u.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var t=this,e=this.container.querySelector("input.ql-image[type=file]");null==e&&((e=document.createElement("input")).setAttribute("type","file"),e.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),e.classList.add("ql-image"),e.addEventListener("change",function(){if(null!=e.files&&null!=e.files[0]){var n=new FileReader;n.onload=function(n){var r=t.quill.getSelection(!0);t.quill.updateContents((new i.default).retain(r.index).delete(r.length).insert({image:n.target.result}),a.default.sources.USER),t.quill.setSelection(r.index+1,a.default.sources.SILENT),e.value=""},n.readAsDataURL(e.files[0])}}),this.container.appendChild(e)),e.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var x=function(t){function e(t,n){d(this,e);var r=y(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.textbox=r.root.querySelector('input[type="text"]'),r.listen(),r}return v(e,p.default),r(e,[{key:"listen",value:function(){var t=this;this.textbox.addEventListener("keydown",function(e){l.default.match(e,"enter")?(t.save(),e.preventDefault()):l.default.match(e,"escape")&&(t.cancel(),e.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"link",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null!=e?this.textbox.value=e:t!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+t)||""),this.root.setAttribute("data-mode",t)}},{key:"restoreFocus",value:function(){var t=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=t}},{key:"save",value:function(){var t=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":var e=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",t,a.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,a.default.sources.USER)),this.quill.root.scrollTop=e;break;case"video":t=function(t){var e=t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);if(e)return(e[1]||"https")+"://www.youtube.com/embed/"+e[2]+"?showinfo=0";if(e=t.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))return(e[1]||"https")+"://player.vimeo.com/video/"+e[2]+"/";return t}(t);case"formula":if(!t)break;var n=this.quill.getSelection(!0);if(null!=n){var r=n.index+n.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),t,a.default.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(r+1," ",a.default.sources.USER),this.quill.setSelection(r+2,a.default.sources.USER)}}this.textbox.value="",this.hide()}}]),e}();function E(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e.forEach(function(e){var r=document.createElement("option");e===n?r.setAttribute("selected","selected"):r.setAttribute("value",e),t.appendChild(r)})}e.BaseTooltip=x,e.default=O},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){this.head=this.tail=null,this.length=0}return t.prototype.append=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.insertBefore(t[0],null),t.length>1&&this.append.apply(this,t.slice(1))},t.prototype.contains=function(t){for(var e,n=this.iterator();e=n();)if(e===t)return!0;return!1},t.prototype.insertBefore=function(t,e){t&&(t.next=e,null!=e?(t.prev=e.prev,null!=e.prev&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):null!=this.tail?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)},t.prototype.offset=function(t){for(var e=0,n=this.head;null!=n;){if(n===t)return e;e+=n.length(),n=n.next}return-1},t.prototype.remove=function(t){this.contains(t)&&(null!=t.prev&&(t.prev.next=t.next),null!=t.next&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)},t.prototype.iterator=function(t){return void 0===t&&(t=this.head),function(){var e=t;return null!=t&&(t=t.next),e}},t.prototype.find=function(t,e){void 0===e&&(e=!1);for(var n,r=this.iterator();n=r();){var o=n.length();if(t<o||e&&t===o&&(null==n.next||0!==n.next.length()))return[n,t];t-=o}return[null,0]},t.prototype.forEach=function(t){for(var e,n=this.iterator();e=n();)t(e)},t.prototype.forEachAt=function(t,e,n){if(!(e<=0))for(var r,o=this.find(t),i=o[0],a=t-o[1],l=this.iterator(i);(r=l())&&a<t+e;){var u=r.length();t>a?n(r,t-a,Math.min(e,a+u-t)):n(r,0,Math.min(u,t+e-a)),a+=u}},t.prototype.map=function(t){return this.reduce(function(e,n){return e.push(t(n)),e},[])},t.prototype.reduce=function(t,e){for(var n,r=this.iterator();n=r();)e=t(e,n);return e},t}();e.default=r},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(17),a=n(2),l={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},u=function(t){function e(e){var n=t.call(this,e)||this;return n.scroll=n,n.observer=new MutationObserver(function(t){n.update(t)}),n.observer.observe(n.domNode,l),n.attach(),n}return o(e,t),e.prototype.detach=function(){t.prototype.detach.call(this),this.observer.disconnect()},e.prototype.deleteAt=function(e,n){this.update(),0===e&&n===this.length()?this.children.forEach(function(t){t.remove()}):t.prototype.deleteAt.call(this,e,n)},e.prototype.formatAt=function(e,n,r,o){this.update(),t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.insertAt=function(e,n,r){this.update(),t.prototype.insertAt.call(this,e,n,r)},e.prototype.optimize=function(e,n){var r=this;void 0===e&&(e=[]),void 0===n&&(n={}),t.prototype.optimize.call(this,n);for(var o=[].slice.call(this.observer.takeRecords());o.length>0;)e.push(o.pop());for(var l=function(t,e){void 0===e&&(e=!0),null!=t&&t!==r&&null!=t.domNode.parentNode&&(null==t.domNode[a.DATA_KEY].mutations&&(t.domNode[a.DATA_KEY].mutations=[]),e&&l(t.parent))},u=function(t){null!=t.domNode[a.DATA_KEY]&&null!=t.domNode[a.DATA_KEY].mutations&&(t instanceof i.default&&t.children.forEach(u),t.optimize(n))},s=e,c=0;s.length>0;c+=1){if(c>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(s.forEach(function(t){var e=a.find(t.target,!0);null!=e&&(e.domNode===t.target&&("childList"===t.type?(l(a.find(t.previousSibling,!1)),[].forEach.call(t.addedNodes,function(t){var e=a.find(t,!1);l(e,!1),e instanceof i.default&&e.children.forEach(function(t){l(t,!1)})})):"attributes"===t.type&&l(e.prev)),l(e))}),this.children.forEach(u),o=(s=[].slice.call(this.observer.takeRecords())).slice();o.length>0;)e.push(o.pop())}},e.prototype.update=function(e,n){var r=this;void 0===n&&(n={}),(e=e||this.observer.takeRecords()).map(function(t){var e=a.find(t.target,!0);return null==e?null:null==e.domNode[a.DATA_KEY].mutations?(e.domNode[a.DATA_KEY].mutations=[t],e):(e.domNode[a.DATA_KEY].mutations.push(t),null)}).forEach(function(t){null!=t&&t!==r&&null!=t.domNode[a.DATA_KEY]&&t.update(t.domNode[a.DATA_KEY].mutations||[],n)}),null!=this.domNode[a.DATA_KEY].mutations&&t.prototype.update.call(this,this.domNode[a.DATA_KEY].mutations,n),this.optimize(e,n)},e.blotName="scroll",e.defaultChild="block",e.scope=a.Scope.BLOCK_BLOT,e.tagName="DIV",e}(i.default);e.default=u},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(18),a=n(2);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.formats=function(n){if(n.tagName!==e.tagName)return t.formats.call(this,n)},e.prototype.format=function(n,r){var o=this;n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):(this.children.forEach(function(t){t instanceof i.default||(t=t.wrap(e.blotName,!0)),o.attributes.copy(t)}),this.unwrap())},e.prototype.formatAt=function(e,n,r,o){null!=this.formats()[r]||a.query(r,a.Scope.ATTRIBUTE)?this.isolate(e,n).format(r,o):t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.optimize=function(n){t.prototype.optimize.call(this,n);var r=this.formats();if(0===Object.keys(r).length)return this.unwrap();var o=this.next;o instanceof e&&o.prev===this&&function(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(t[n]!==e[n])return!1;return!0}(r,o.formats())&&(o.moveChildren(this),o.remove())},e.blotName="inline",e.scope=a.Scope.INLINE_BLOT,e.tagName="SPAN",e}(i.default);e.default=l},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(18),a=n(2),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.formats=function(n){var r=a.query(e.blotName).tagName;if(n.tagName!==r)return t.formats.call(this,n)},e.prototype.format=function(n,r){null!=a.query(n,a.Scope.BLOCK)&&(n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):this.replaceWith(e.blotName))},e.prototype.formatAt=function(e,n,r,o){null!=a.query(r,a.Scope.BLOCK)?this.format(r,o):t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.insertAt=function(e,n,r){if(null==r||null!=a.query(n,a.Scope.INLINE))t.prototype.insertAt.call(this,e,n,r);else{var o=this.split(e),i=a.create(n,r);o.parent.insertBefore(i,o)}},e.prototype.update=function(e,n){navigator.userAgent.match(/Trident/)?this.build():t.prototype.update.call(this,e,n)},e.blotName="block",e.scope=a.Scope.BLOCK_BLOT,e.tagName="P",e}(i.default);e.default=l},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.formats=function(t){},e.prototype.format=function(e,n){t.prototype.formatAt.call(this,0,this.length(),e,n)},e.prototype.formatAt=function(e,n,r,o){0===e&&n===this.length()?this.format(r,o):t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.formats=function(){return this.statics.formats(this.domNode)},e}(n(19).default);e.default=i},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(19),a=n(2),l=function(t){function e(e){var n=t.call(this,e)||this;return n.text=n.statics.value(n.domNode),n}return o(e,t),e.create=function(t){return document.createTextNode(t)},e.value=function(t){var e=t.data;return e.normalize&&(e=e.normalize()),e},e.prototype.deleteAt=function(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)},e.prototype.index=function(t,e){return this.domNode===t?e:-1},e.prototype.insertAt=function(e,n,r){null==r?(this.text=this.text.slice(0,e)+n+this.text.slice(e),this.domNode.data=this.text):t.prototype.insertAt.call(this,e,n,r)},e.prototype.length=function(){return this.text.length},e.prototype.optimize=function(n){t.prototype.optimize.call(this,n),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof e&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},e.prototype.position=function(t,e){return void 0===e&&(e=!1),[this.domNode,t]},e.prototype.split=function(t,e){if(void 0===e&&(e=!1),!e){if(0===t)return this;if(t===this.length())return this.next}var n=a.create(this.domNode.splitText(t));return this.parent.insertBefore(n,this.next),this.text=this.statics.value(this.domNode),n},e.prototype.update=function(t,e){var n=this;t.some(function(t){return"characterData"===t.type&&t.target===n.domNode})&&(this.text=this.statics.value(this.domNode))},e.prototype.value=function(){return this.text},e.blotName="text",e.scope=a.Scope.INLINE_BLOT,e}(i.default);e.default=l},function(t,e,n){"use strict";var r=document.createElement("div");if(r.classList.toggle("test-class",!1),r.classList.contains("test-class")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return arguments.length>1&&!this.contains(t)==!e?e:o.call(this,t)}}String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return e=e||0,this.substr(e,t.length)===t}),String.prototype.endsWith||(String.prototype.endsWith=function(t,e){var n=this.toString();("number"!=typeof e||!isFinite(e)||Math.floor(e)!==e||e>n.length)&&(e=n.length),e-=t.length;var r=n.indexOf(t,e);return-1!==r&&r===e}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var e,n=Object(this),r=n.length>>>0,o=arguments[1],i=0;i<r;i++)if(e=n[i],t.call(o,e,i,n))return e}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(t,e){var n=-1,r=1,o=0;function i(t,e,s){if(t==e)return t?[[o,t]]:[];(s<0||t.length<s)&&(s=null);var f=l(t,e),p=t.substring(0,f);f=u(t=t.substring(f),e=e.substring(f));var h=t.substring(t.length-f),d=function(t,e){var s;if(!t)return[[r,e]];if(!e)return[[n,t]];var c=t.length>e.length?t:e,f=t.length>e.length?e:t,p=c.indexOf(f);if(-1!=p)return s=[[r,c.substring(0,p)],[o,f],[r,c.substring(p+f.length)]],t.length>e.length&&(s[0][0]=s[2][0]=n),s;if(1==f.length)return[[n,t],[r,e]];var h=function(t,e){var n=t.length>e.length?t:e,r=t.length>e.length?e:t;if(n.length<4||2*r.length<n.length)return null;function o(t,e,n){for(var r,o,i,a,s=t.substring(n,n+Math.floor(t.length/4)),c=-1,f="";-1!=(c=e.indexOf(s,c+1));){var p=l(t.substring(n),e.substring(c)),h=u(t.substring(0,n),e.substring(0,c));f.length<h+p&&(f=e.substring(c-h,c)+e.substring(c,c+p),r=t.substring(0,n-h),o=t.substring(n+p),i=e.substring(0,c-h),a=e.substring(c+p))}return 2*f.length>=t.length?[r,o,i,a,f]:null}var i,a,s,c,f,p=o(n,r,Math.ceil(n.length/4)),h=o(n,r,Math.ceil(n.length/2));if(!p&&!h)return null;i=h?p&&p[4].length>h[4].length?p:h:p;t.length>e.length?(a=i[0],s=i[1],c=i[2],f=i[3]):(c=i[0],f=i[1],a=i[2],s=i[3]);var d=i[4];return[a,s,c,f,d]}(t,e);if(h){var d=h[0],y=h[1],v=h[2],b=h[3],g=h[4],m=i(d,v),w=i(y,b);return m.concat([[o,g]],w)}return function(t,e){for(var o=t.length,i=e.length,l=Math.ceil((o+i)/2),u=l,s=2*l,c=new Array(s),f=new Array(s),p=0;p<s;p++)c[p]=-1,f[p]=-1;c[u+1]=0,f[u+1]=0;for(var h=o-i,d=h%2!=0,y=0,v=0,b=0,g=0,m=0;m<l;m++){for(var w=-m+y;w<=m-v;w+=2){for(var _=u+w,O=(j=w==-m||w!=m&&c[_-1]<c[_+1]?c[_+1]:c[_-1]+1)-w;j<o&&O<i&&t.charAt(j)==e.charAt(O);)j++,O++;if(c[_]=j,j>o)v+=2;else if(O>i)y+=2;else if(d){var x=u+h-w;if(x>=0&&x<s&&-1!=f[x]){var E=o-f[x];if(j>=E)return a(t,e,j,O)}}}for(var k=-m+b;k<=m-g;k+=2){for(var x=u+k,A=(E=k==-m||k!=m&&f[x-1]<f[x+1]?f[x+1]:f[x-1]+1)-k;E<o&&A<i&&t.charAt(o-E-1)==e.charAt(i-A-1);)E++,A++;if(f[x]=E,E>o)g+=2;else if(A>i)b+=2;else if(!d){var _=u+h-k;if(_>=0&&_<s&&-1!=c[_]){var j=c[_],O=u+j-_;if(j>=(E=o-E))return a(t,e,j,O)}}}}return[[n,t],[r,e]]}(t,e)}(t=t.substring(0,t.length-f),e=e.substring(0,e.length-f));return p&&d.unshift([o,p]),h&&d.push([o,h]),function t(e){e.push([o,""]);var i=0;var a=0;var s=0;var c="";var f="";var p;for(;i<e.length;)switch(e[i][0]){case r:s++,f+=e[i][1],i++;break;case n:a++,c+=e[i][1],i++;break;case o:a+s>1?(0!==a&&0!==s&&(0!==(p=l(f,c))&&(i-a-s>0&&e[i-a-s-1][0]==o?e[i-a-s-1][1]+=f.substring(0,p):(e.splice(0,0,[o,f.substring(0,p)]),i++),f=f.substring(p),c=c.substring(p)),0!==(p=u(f,c))&&(e[i][1]=f.substring(f.length-p)+e[i][1],f=f.substring(0,f.length-p),c=c.substring(0,c.length-p))),0===a?e.splice(i-s,a+s,[r,f]):0===s?e.splice(i-a,a+s,[n,c]):e.splice(i-a-s,a+s,[n,c],[r,f]),i=i-a-s+(a?1:0)+(s?1:0)+1):0!==i&&e[i-1][0]==o?(e[i-1][1]+=e[i][1],e.splice(i,1)):i++,s=0,a=0,c="",f=""}""===e[e.length-1][1]&&e.pop();var h=!1;i=1;for(;i<e.length-1;)e[i-1][0]==o&&e[i+1][0]==o&&(e[i][1].substring(e[i][1].length-e[i-1][1].length)==e[i-1][1]?(e[i][1]=e[i-1][1]+e[i][1].substring(0,e[i][1].length-e[i-1][1].length),e[i+1][1]=e[i-1][1]+e[i+1][1],e.splice(i-1,1),h=!0):e[i][1].substring(0,e[i+1][1].length)==e[i+1][1]&&(e[i-1][1]+=e[i+1][1],e[i][1]=e[i][1].substring(e[i+1][1].length)+e[i+1][1],e.splice(i+1,1),h=!0)),i++;h&&t(e)}(d),null!=s&&(d=function(t,e){var r=function(t,e){if(0===e)return[o,t];for(var r=0,i=0;i<t.length;i++){var a=t[i];if(a[0]===n||a[0]===o){var l=r+a[1].length;if(e===l)return[i+1,t];if(e<l){t=t.slice();var u=e-r,s=[a[0],a[1].slice(0,u)],c=[a[0],a[1].slice(u)];return t.splice(i,1,s,c),[i+1,t]}r=l}}throw new Error("cursor_pos is out of bounds!")}(t,e),i=r[1],a=r[0],l=i[a],u=i[a+1];if(null==l)return t;if(l[0]!==o)return t;if(null!=u&&l[1]+u[1]===u[1]+l[1])return i.splice(a,2,u,l),c(i,a,2);if(null!=u&&0===u[1].indexOf(l[1])){i.splice(a,2,[u[0],l[1]],[0,l[1]]);var s=u[1].slice(l[1].length);return s.length>0&&i.splice(a+2,0,[u[0],s]),c(i,a,3)}return t}(d,s)),d=function(t){for(var e=!1,i=function(t){return t.charCodeAt(0)>=56320&&t.charCodeAt(0)<=57343},a=2;a<t.length;a+=1)t[a-2][0]===o&&((l=t[a-2][1]).charCodeAt(l.length-1)>=55296&&l.charCodeAt(l.length-1)<=56319)&&t[a-1][0]===n&&i(t[a-1][1])&&t[a][0]===r&&i(t[a][1])&&(e=!0,t[a-1][1]=t[a-2][1].slice(-1)+t[a-1][1],t[a][1]=t[a-2][1].slice(-1)+t[a][1],t[a-2][1]=t[a-2][1].slice(0,-1));var l;if(!e)return t;for(var u=[],a=0;a<t.length;a+=1)t[a][1].length>0&&u.push(t[a]);return u}(d)}function a(t,e,n,r){var o=t.substring(0,n),a=e.substring(0,r),l=t.substring(n),u=e.substring(r),s=i(o,a),c=i(l,u);return s.concat(c)}function l(t,e){if(!t||!e||t.charAt(0)!=e.charAt(0))return 0;for(var n=0,r=Math.min(t.length,e.length),o=r,i=0;n<o;)t.substring(i,o)==e.substring(i,o)?i=n=o:r=o,o=Math.floor((r-n)/2+n);return o}function u(t,e){if(!t||!e||t.charAt(t.length-1)!=e.charAt(e.length-1))return 0;for(var n=0,r=Math.min(t.length,e.length),o=r,i=0;n<o;)t.substring(t.length-o,t.length-i)==e.substring(e.length-o,e.length-i)?i=n=o:r=o,o=Math.floor((r-n)/2+n);return o}var s=i;function c(t,e,n){for(var r=e+n-1;r>=0&&r>=e-1;r--)if(r+1<t.length){var o=t[r],i=t[r+1];o[0]===i[1]&&t.splice(r,2,[o[0],o[1]+i[1]])}return t}s.INSERT=r,s.DELETE=n,s.EQUAL=o,t.exports=s},function(t,e,n){"use strict";var r;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=n(37),l=Object.prototype.propertyIsEnumerable,u=!l.call({toString:null},"toString"),s=l.call(function(){},"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&o.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();r=function(t){var e=null!==t&&"object"==typeof t,n="[object Function]"===i.call(t),r=a(t),l=e&&"[object String]"===i.call(t),p=[];if(!e&&!n&&!r)throw new TypeError("Object.keys called on a non-object");var d=s&&n;if(l&&t.length>0&&!o.call(t,0))for(var y=0;y<t.length;++y)p.push(String(y));if(r&&t.length>0)for(var v=0;v<t.length;++v)p.push(String(v));else for(var b in t)d&&"prototype"===b||!o.call(t,b)||p.push(String(b));if(u)for(var g=function(t){if("undefined"==typeof window||!h)return f(t);try{return f(t)}catch(t){return!1}}(t),m=0;m<c.length;++m)g&&"constructor"===c[m]||!o.call(t,c[m])||p.push(c[m]);return p}}t.exports=r},function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,o=Object.prototype.toString,i=function(t){return!(r&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===o.call(t)},a=function(t){return!!i(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==o.call(t)&&"[object Function]"===o.call(t.callee)},l=function(){return i(arguments)}();i.isLegacyArguments=a,t.exports=l?i:a},function(t,e,n){"use strict";var r=function(t){return t!=t};t.exports=function(t,e){return 0===t&&0===e?1/t==1/e:t===e||!(!r(t)||!r(e))}},function(t,e,n){"use strict";var r=n(62),o=RegExp.prototype.exec,i=Object.getOwnPropertyDescriptor,a=Object.prototype.toString,l="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!l)return"[object RegExp]"===a.call(t);var e=i(t,"lastIndex");return!(!e||!r(e,"value"))&&function(t){try{var e=t.lastIndex;return t.lastIndex=0,o.call(t),!0}catch(t){return!1}finally{t.lastIndex=e}}(t)}},function(t,e,n){"use strict";var r=n(20);t.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},function(t,e,n){"use strict";var r=Array.prototype.slice,o=Object.prototype.toString;t.exports=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==o.call(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var n,i=r.call(arguments,1),a=Math.max(0,e.length-i.length),l=[],u=0;u<a;u++)l.push("$"+u);if(n=Function("binder","return function ("+l.join(",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof n){var o=e.apply(this,i.concat(r.call(arguments)));return Object(o)===o?o:this}return e.apply(t,i.concat(r.call(arguments)))}),e.prototype){var s=function(){};s.prototype=e.prototype,n.prototype=new s,s.prototype=null}return n}},function(t,e,n){"use strict";var r=n(21),o=n(65),i=n(38),a=n(39),l=n(70),u=o(i);r(u,{getPolyfill:a,implementation:i,shim:l}),t.exports=u},function(t,e,n){"use strict";var r=n(20),o=n(66)("%Function%"),i=o.apply,a=o.call;t.exports=function(){return r.apply(a,arguments)},t.exports.apply=function(){return r.apply(i,arguments)}},function(t,e,n){"use strict";var r=TypeError,o=Object.getOwnPropertyDescriptor;if(o)try{o({},"")}catch(t){o=null}var i=function(){throw new r},a=o?function(){try{return arguments.callee,i}catch(t){try{return o(arguments,"callee").get}catch(t){return i}}}():i,l=n(67)(),u=Object.getPrototypeOf||function(t){return t.__proto__},s=void 0,c="undefined"==typeof Uint8Array?void 0:u(Uint8Array),f={"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayBufferPrototype%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer.prototype,"%ArrayIteratorPrototype%":l?u([][Symbol.iterator]()):void 0,"%ArrayPrototype%":Array.prototype,"%ArrayProto_entries%":Array.prototype.entries,"%ArrayProto_forEach%":Array.prototype.forEach,"%ArrayProto_keys%":Array.prototype.keys,"%ArrayProto_values%":Array.prototype.values,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":void 0,"%AsyncFunctionPrototype%":void 0,"%AsyncGenerator%":void 0,"%AsyncGeneratorFunction%":void 0,"%AsyncGeneratorPrototype%":void 0,"%AsyncIteratorPrototype%":s&&l&&Symbol.asyncIterator?s[Symbol.asyncIterator]():void 0,"%Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"%Boolean%":Boolean,"%BooleanPrototype%":Boolean.prototype,"%DataView%":"undefined"==typeof DataView?void 0:DataView,"%DataViewPrototype%":"undefined"==typeof DataView?void 0:DataView.prototype,"%Date%":Date,"%DatePrototype%":Date.prototype,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%ErrorPrototype%":Error.prototype,"%eval%":eval,"%EvalError%":EvalError,"%EvalErrorPrototype%":EvalError.prototype,"%Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"%Float32ArrayPrototype%":"undefined"==typeof Float32Array?void 0:Float32Array.prototype,"%Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"%Float64ArrayPrototype%":"undefined"==typeof Float64Array?void 0:Float64Array.prototype,"%Function%":Function,"%FunctionPrototype%":Function.prototype,"%Generator%":void 0,"%GeneratorFunction%":void 0,"%GeneratorPrototype%":void 0,"%Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"%Int8ArrayPrototype%":"undefined"==typeof Int8Array?void 0:Int8Array.prototype,"%Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"%Int16ArrayPrototype%":"undefined"==typeof Int16Array?void 0:Int8Array.prototype,"%Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"%Int32ArrayPrototype%":"undefined"==typeof Int32Array?void 0:Int32Array.prototype,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":l?u(u([][Symbol.iterator]())):void 0,"%JSON%":"object"==typeof JSON?JSON:void 0,"%JSONParse%":"object"==typeof JSON?JSON.parse:void 0,"%Map%":"undefined"==typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&l?u((new Map)[Symbol.iterator]()):void 0,"%MapPrototype%":"undefined"==typeof Map?void 0:Map.prototype,"%Math%":Math,"%Number%":Number,"%NumberPrototype%":Number.prototype,"%Object%":Object,"%ObjectPrototype%":Object.prototype,"%ObjProto_toString%":Object.prototype.toString,"%ObjProto_valueOf%":Object.prototype.valueOf,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?void 0:Promise,"%PromisePrototype%":"undefined"==typeof Promise?void 0:Promise.prototype,"%PromiseProto_then%":"undefined"==typeof Promise?void 0:Promise.prototype.then,"%Promise_all%":"undefined"==typeof Promise?void 0:Promise.all,"%Promise_reject%":"undefined"==typeof Promise?void 0:Promise.reject,"%Promise_resolve%":"undefined"==typeof Promise?void 0:Promise.resolve,"%Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"%RangeError%":RangeError,"%RangeErrorPrototype%":RangeError.prototype,"%ReferenceError%":ReferenceError,"%ReferenceErrorPrototype%":ReferenceError.prototype,"%Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%RegExpPrototype%":RegExp.prototype,"%Set%":"undefined"==typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&l?u((new Set)[Symbol.iterator]()):void 0,"%SetPrototype%":"undefined"==typeof Set?void 0:Set.prototype,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%SharedArrayBufferPrototype%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer.prototype,"%String%":String,"%StringIteratorPrototype%":l?u(""[Symbol.iterator]()):void 0,"%StringPrototype%":String.prototype,"%Symbol%":l?Symbol:void 0,"%SymbolPrototype%":l?Symbol.prototype:void 0,"%SyntaxError%":SyntaxError,"%SyntaxErrorPrototype%":SyntaxError.prototype,"%ThrowTypeError%":a,"%TypedArray%":c,"%TypedArrayPrototype%":c?c.prototype:void 0,"%TypeError%":r,"%TypeErrorPrototype%":r.prototype,"%Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"%Uint8ArrayPrototype%":"undefined"==typeof Uint8Array?void 0:Uint8Array.prototype,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint8ClampedArrayPrototype%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray.prototype,"%Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"%Uint16ArrayPrototype%":"undefined"==typeof Uint16Array?void 0:Uint16Array.prototype,"%Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"%Uint32ArrayPrototype%":"undefined"==typeof Uint32Array?void 0:Uint32Array.prototype,"%URIError%":URIError,"%URIErrorPrototype%":URIError.prototype,"%WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"%WeakMapPrototype%":"undefined"==typeof WeakMap?void 0:WeakMap.prototype,"%WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet,"%WeakSetPrototype%":"undefined"==typeof WeakSet?void 0:WeakSet.prototype},p=n(20).call(Function.call,String.prototype.replace),h=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,d=/\\(\\)?/g;t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new TypeError('"allowMissing" argument must be a boolean');for(var n,i=(n=[],p(t,h,function(t,e,r,o){n[n.length]=r?p(o,d,"$1"):e||t}),n),a=function(t,e){if(!(t in f))throw new SyntaxError("intrinsic "+t+" does not exist!");if(void 0===f[t]&&!e)throw new r("intrinsic "+t+" exists, but is not available. Please file an issue!");return f[t]}("%"+(i.length>0?i[0]:"")+"%",e),l=1;l<i.length;l+=1)if(null!=a)if(o&&l+1>=i.length){var u=o(a,i[l]);if(!(e||i[l]in a))throw new r("base intrinsic for "+t+" exists, but the property is not available.");a=u?u.get||u.value:a[i[l]]}else a=a[i[l]];return a}},function(t,e,n){"use strict";(function(e){var r=e.Symbol,o=n(69);t.exports=function(){return"function"==typeof r&&("function"==typeof Symbol&&("symbol"==typeof r("foo")&&("symbol"==typeof Symbol("bar")&&o())))}}).call(e,n(68))},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),n=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var r=Object.getOwnPropertySymbols(t);if(1!==r.length||r[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},function(t,e,n){"use strict";var r=n(21).supportsDescriptors,o=n(39),i=Object.getOwnPropertyDescriptor,a=Object.defineProperty,l=TypeError,u=Object.getPrototypeOf,s=/a/;t.exports=function(){if(!r||!u)throw new l("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=o(),e=u(s),n=i(e,"flags");return n&&n.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},function(t,e,n){"use strict";var r=Date.prototype.getDay,o=Object.prototype.toString,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return r.call(t),!0}catch(t){return!1}}(t):"[object Date]"===o.call(t))}},function(t,e){"use strict";var n=Object.prototype.hasOwnProperty,r="~";function o(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function a(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,e,o=[];if(0===this._eventsCount)return o;for(e in t=this._events)n.call(t,e)&&o.push(r?e.slice(1):e);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(t)):o},a.prototype.listeners=function(t,e){var n=r?r+t:t,o=this._events[n];if(e)return!!o;if(!o)return[];if(o.fn)return[o.fn];for(var i=0,a=o.length,l=new Array(a);i<a;i++)l[i]=o[i].fn;return l},a.prototype.emit=function(t,e,n,o,i,a){var l=r?r+t:t;if(!this._events[l])return!1;var u,s,c=this._events[l],f=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),f){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,n),!0;case 4:return c.fn.call(c.context,e,n,o),!0;case 5:return c.fn.call(c.context,e,n,o,i),!0;case 6:return c.fn.call(c.context,e,n,o,i,a),!0}for(s=1,u=new Array(f-1);s<f;s++)u[s-1]=arguments[s];c.fn.apply(c.context,u)}else{var p,h=c.length;for(s=0;s<h;s++)switch(c[s].once&&this.removeListener(t,c[s].fn,void 0,!0),f){case 1:c[s].fn.call(c[s].context);break;case 2:c[s].fn.call(c[s].context,e);break;case 3:c[s].fn.call(c[s].context,e,n);break;case 4:c[s].fn.call(c[s].context,e,n,o);break;default:if(!u)for(p=1,u=new Array(f-1);p<f;p++)u[p-1]=arguments[p];c[s].fn.apply(c[s].context,u)}}return!0},a.prototype.on=function(t,e,n){var o=new i(e,n||this),a=r?r+t:t;return this._events[a]?this._events[a].fn?this._events[a]=[this._events[a],o]:this._events[a].push(o):(this._events[a]=o,this._eventsCount++),this},a.prototype.once=function(t,e,n){var o=new i(e,n||this,!0),a=r?r+t:t;return this._events[a]?this._events[a].fn?this._events[a]=[this._events[a],o]:this._events[a].push(o):(this._events[a]=o,this._eventsCount++),this},a.prototype.removeListener=function(t,e,n,i){var a=r?r+t:t;if(!this._events[a])return this;if(!e)return 0==--this._eventsCount?this._events=new o:delete this._events[a],this;var l=this._events[a];if(l.fn)l.fn!==e||i&&!l.once||n&&l.context!==n||(0==--this._eventsCount?this._events=new o:delete this._events[a]);else{for(var u=0,s=[],c=l.length;u<c;u++)(l[u].fn!==e||i&&!l[u].once||n&&l[u].context!==n)&&s.push(l[u]);s.length?this._events[a]=1===s.length?s[0]:s:0==--this._eventsCount?this._events=new o:delete this._events[a]}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&(0==--this._eventsCount?this._events=new o:delete this._events[e])):(this._events=new o,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prototype.setMaxListeners=function(){return this},a.prefixed=r,a.EventEmitter=a,void 0!==t&&(t.exports=a)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=n(1),a=(r=i)&&r.__esModule?r:{default:r};var l=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return o(t,[{key:"highlightDifference",value:function(t,e,n){var r=new a.default(t),o=new a.default(e),i=o.diff(r).map(function(t){if(t.insert){if(t.attributes||(t.attributes={}),t.attributes.background)return t;t.attributes.diff=n}return t});return o.compose(new a.default(i))}},{key:"cleanDifference",value:function(t){return t.ops.map(function(t){return t.attributes&&t.attributes.diff&&delete t.attributes.diff,t})}}]),t}();e.default=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.matchText=e.matchSpacing=e.matchNewline=e.matchBlot=e.matchAttributor=e.default=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&l.return&&l.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=m(n(3)),l=m(n(1)),u=m(n(0)),s=m(n(5)),c=m(n(10)),f=m(n(9)),p=n(42),h=n(43),d=m(n(13)),y=n(28),v=n(44),b=n(45),g=n(46);function m(t){return t&&t.__esModule?t:{default:t}}function w(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var _=(0,c.default)("quill:clipboard"),O="__ql-matcher",x=[[Node.TEXT_NODE,H],[Node.TEXT_NODE,M],["br",function(t,e){T(e,"\n")||e.insert("\n");return e}],[Node.ELEMENT_NODE,M],[Node.ELEMENT_NODE,C],[Node.ELEMENT_NODE,q],[Node.ELEMENT_NODE,L],[Node.ELEMENT_NODE,function(t,e){var n={},r=t.style||{};r.fontStyle&&"italic"===N(t).fontStyle&&(n.italic=!0);r.fontWeight&&(N(t).fontWeight.startsWith("bold")||parseInt(N(t).fontWeight)>=700)&&(n.bold=!0);Object.keys(n).length>0&&(e=j(e,n));parseFloat(r.textIndent||0)>0&&(e=(new l.default).insert("\t").concat(e));return e}],["li",function(t,e){var n=u.default.query(t);if(null==n||"list-item"!==n.blotName||!T(e,"\n"))return e;var r=-1,o=t.parentNode;for(;!o.classList.contains("ql-clipboard");)"list"===(u.default.query(o)||{}).blotName&&(r+=1),o=o.parentNode;return r<=0?e:e.compose((new l.default).retain(e.length()-1).retain(1,{indent:r}))}],["b",P.bind(P,"bold")],["i",P.bind(P,"italic")],["style",function(){return new l.default}]],E=[p.AlignAttribute,v.DirectionAttribute].reduce(function(t,e){return t[e.keyName]=e,t},{}),k=[p.AlignStyle,h.BackgroundStyle,y.ColorStyle,v.DirectionStyle,b.FontStyle,g.SizeStyle].reduce(function(t,e){return t[e.keyName]=e,t},{}),A=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.quill.root.addEventListener("paste",r.onPaste.bind(r)),r.container=r.quill.addContainer("ql-clipboard"),r.container.setAttribute("contenteditable",!0),r.container.setAttribute("tabindex",-1),r.matchers=[],x.concat(r.options.matchers).forEach(function(t){var e=o(t,2),i=e[0],a=e[1];(n.matchVisual||a!==q)&&r.addMatcher(i,a)}),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,f.default),i(e,[{key:"addMatcher",value:function(t,e){this.matchers.push([t,e])}},{key:"convert",value:function(t){if("string"==typeof t)return this.container.innerHTML=t.replace(/\>\r?\n +\</g,"><"),this.convert();var e=this.quill.getFormat(this.quill.selection.savedRange.index);if(e[d.default.blotName]){var n=this.container.innerText;return this.container.innerHTML="",(new l.default).insert(n,w({},d.default.blotName,e[d.default.blotName]))}var r=this.prepareMatching(),i=o(r,2),a=i[0],u=i[1],s=function t(e,n,r){return e.nodeType===e.TEXT_NODE?r.reduce(function(t,n){return n(e,t)},new l.default):e.nodeType===e.ELEMENT_NODE?[].reduce.call(e.childNodes||[],function(o,i){var a=t(i,n,r);return i.nodeType===e.ELEMENT_NODE&&(a=n.reduce(function(t,e){return e(i,t)},a),a=(i[O]||[]).reduce(function(t,e){return e(i,t)},a)),o.concat(a)},new l.default):new l.default}(this.container,a,u);return T(s,"\n")&&null==s.ops[s.ops.length-1].attributes&&(s=s.compose((new l.default).retain(s.length()-1).delete(1))),_.log("convert",this.container.innerHTML,s),this.container.innerHTML="",s}},{key:"dangerouslyPasteHTML",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.default.sources.API;if("string"==typeof t)this.quill.setContents(this.convert(t),e),this.quill.setSelection(0,s.default.sources.SILENT);else{var r=this.convert(e);this.quill.updateContents((new l.default).retain(t).concat(r),n),this.quill.setSelection(t+r.length(),s.default.sources.SILENT)}}},{key:"onPaste",value:function(t){var e=this,n=t.clipboardData.getData("Text"),r=!1;if(n.length>25e3&&(t.preventDefault(),this.container.innerHTML=n,r=!0),this.quill.isEnabled()){var o=this.quill.getSelection(),i=(new l.default).retain(o.index),a=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(s.default.sources.SILENT),setTimeout(function(){r?(e.quill.deleteText(o.index,o.length,s.default.sources.SILENT),e.quill.insertText(o.index,e.container.innerHTML,s.default.sources.USER),e.quill.setSelection(o.index+e.container.innerHTML.length,s.default.sources.SILENT)):(i=i.concat(e.convert()).delete(o.length),e.quill.updateContents(i,s.default.sources.USER),e.quill.setSelection(i.length()-o.length,s.default.sources.SILENT)),e.quill.scrollingContainer.scrollTop=a,e.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var t=this,e=[],n=[];return this.matchers.forEach(function(r){var i=o(r,2),a=i[0],l=i[1];switch(a){case Node.TEXT_NODE:n.push(l);break;case Node.ELEMENT_NODE:e.push(l);break;default:[].forEach.call(t.container.querySelectorAll(a),function(t){t[O]=t[O]||[],t[O].push(l)})}}),[e,n]}}]),e}();function j(t,e,n){return"object"===(void 0===e?"undefined":r(e))?Object.keys(e).reduce(function(t,n){return j(t,n,e[n])},t):t.reduce(function(t,r){return r.attributes&&r.attributes[e]?t.push(r):t.insert(r.insert,(0,a.default)({},w({},e,n),r.attributes))},new l.default)}function N(t){if(t.nodeType!==Node.ELEMENT_NODE)return{};return t["__ql-computed-style"]||(t["__ql-computed-style"]=window.getComputedStyle(t))}function T(t,e){for(var n="",r=t.ops.length-1;r>=0&&n.length<e.length;--r){var o=t.ops[r];if("string"!=typeof o.insert)break;n=o.insert+n}return n.slice(-1*e.length)===e}function S(t){if(0===t.childNodes.length)return!1;var e=N(t);return["block","list-item"].indexOf(e.display)>-1}function P(t,e,n){return j(n,t,!0)}function L(t,e){var n=u.default.Attributor.Attribute.keys(t),r=u.default.Attributor.Class.keys(t),o=u.default.Attributor.Style.keys(t),i={};return n.concat(r).concat(o).forEach(function(e){var n=u.default.query(e,u.default.Scope.ATTRIBUTE);null!=n&&(i[n.attrName]=n.value(t),i[n.attrName])||(null==(n=E[e])||n.attrName!==e&&n.keyName!==e||(i[n.attrName]=n.value(t)||void 0),null==(n=k[e])||n.attrName!==e&&n.keyName!==e||(n=k[e],i[n.attrName]=n.value(t)||void 0))}),Object.keys(i).length>0&&(e=j(e,i)),e}function C(t,e){var n=u.default.query(t);if(null==n)return e;if(n.prototype instanceof u.default.Embed){var r={},o=n.value(t);null!=o&&(r[n.blotName]=o,e=(new l.default).insert(r,n.formats(t)))}else"function"==typeof n.formats&&(e=j(e,n.blotName,n.formats(t)));return e}function M(t,e){return T(e,"\n")||(S(t)||e.length()>0&&t.nextSibling&&S(t.nextSibling))&&e.insert("\n"),e}function q(t,e){if(S(t)&&null!=t.nextElementSibling&&!T(e,"\n\n")){var n=t.offsetHeight+parseFloat(N(t).marginTop)+parseFloat(N(t).marginBottom);t.nextElementSibling.offsetTop>t.offsetTop+1.5*n&&e.insert("\n")}return e}function H(t,e){var n=t.data;if("O:P"===t.parentNode.tagName)return e.insert(n.trim());if(0===n.trim().length&&t.parentNode.classList.contains("ql-clipboard"))return e;if(!N(t.parentNode).whiteSpace.startsWith("pre")){var r=function(t,e){return(e=e.replace(/[^\u00a0]/g,"")).length<1&&t?" ":e};n=(n=n.replace(/\r\n/g," ").replace(/\n/g," ")).replace(/\s\s+/g,r.bind(r,!0)),(null==t.previousSibling&&S(t.parentNode)||null!=t.previousSibling&&S(t.previousSibling))&&(n=n.replace(/^\s+/,r.bind(r,!1))),(null==t.nextSibling&&S(t.parentNode)||null!=t.nextSibling&&S(t.nextSibling))&&(n=n.replace(/\s+$/,r.bind(r,!1)))}return e.insert(n)}A.DEFAULTS={matchers:[],matchVisual:!0},e.default=A,e.matchAttributor=L,e.matchBlot=C,e.matchNewline=M,e.matchSpacing=q,e.matchText=H},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0},a=n(6),l=(r=a)&&r.__esModule?r:{default:r};var u=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,l.default),o(e,[{key:"optimize",value:function(t){i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return i(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),e}();u.blotName="bold",u.tagName=["STRONG","B"],e.default=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.addControls=e.default=void 0;var r=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&l.return&&l.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=c(n(1)),a=c(n(0)),l=c(n(5)),u=c(n(10)),s=c(n(9));function c(t){return t&&t.__esModule?t:{default:t}}function f(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var p=(0,u.default)("quill:toolbar"),h=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o,i=f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));if(Array.isArray(i.options.container)){var a=document.createElement("div");y(a,i.options.container),t.container.parentNode.insertBefore(a,t.container),i.container=a}else"string"==typeof i.options.container?i.container=document.querySelector(i.options.container):i.container=i.options.container;return i.container instanceof HTMLElement?(i.container.classList.add("ql-toolbar"),i.controls=[],i.handlers={},Object.keys(i.options.handlers).forEach(function(t){i.addHandler(t,i.options.handlers[t])}),[].forEach.call(i.container.querySelectorAll("button, select"),function(t){i.attach(t)}),i.quill.on(l.default.events.EDITOR_CHANGE,function(t,e){t===l.default.events.SELECTION_CHANGE&&i.update(e)}),i.quill.on(l.default.events.SCROLL_OPTIMIZE,function(){var t=i.quill.selection.getRange(),e=r(t,1)[0];i.update(e)}),i):(o=p.error("Container required for toolbar",i.options),f(i,o))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,s.default),o(e,[{key:"addHandler",value:function(t,e){this.handlers[t]=e}},{key:"attach",value:function(t){var e=this,n=[].find.call(t.classList,function(t){return 0===t.indexOf("ql-")});if(n){if(n=n.slice("ql-".length),"BUTTON"===t.tagName&&t.setAttribute("type","button"),null==this.handlers[n]){if(null!=this.quill.scroll.whitelist&&null==this.quill.scroll.whitelist[n])return void p.warn("ignoring attaching to disabled format",n,t);if(null==a.default.query(n))return void p.warn("ignoring attaching to nonexistent format",n,t)}var o="SELECT"===t.tagName?"change":"click";t.addEventListener(o,function(o){var u=void 0;if("SELECT"===t.tagName){if(t.selectedIndex<0)return;var s=t.options[t.selectedIndex];u=!s.hasAttribute("selected")&&(s.value||!1)}else u=!t.classList.contains("ql-active")&&(t.value||!t.hasAttribute("value")),o.preventDefault();e.quill.focus();var c=e.quill.selection.getRange(),f=r(c,1)[0];if(null!=e.handlers[n])e.handlers[n].call(e,u);else if(a.default.query(n).prototype instanceof a.default.Embed){if(!(u=prompt("Enter "+n)))return;e.quill.updateContents((new i.default).retain(f.index).delete(f.length).insert(function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({},n,u)),l.default.sources.USER)}else e.quill.format(n,u,l.default.sources.USER);e.update(f)}),this.controls.push([n,t])}}},{key:"update",value:function(t){var e=null==t?{}:this.quill.getFormat(t);this.controls.forEach(function(n){var o=r(n,2),i=o[0],a=o[1];if("SELECT"===a.tagName){var l=void 0;if(null==t)l=null;else if(null==e[i])l=a.querySelector("option[selected]");else if(!Array.isArray(e[i])){var u=e[i];"string"==typeof u&&(u=u.replace(/\"/g,'\\"')),l=a.querySelector('option[value="'+u+'"]')}null==l?(a.value="",a.selectedIndex=-1):l.selected=!0}else if(null==t)a.classList.remove("ql-active");else if(a.hasAttribute("value")){var s=e[i]===a.getAttribute("value")||null!=e[i]&&e[i].toString()===a.getAttribute("value")||null==e[i]&&!a.getAttribute("value");a.classList.toggle("ql-active",s)}else a.classList.toggle("ql-active",null!=e[i])})}}]),e}();function d(t,e,n){var r=document.createElement("button");r.setAttribute("type","button"),r.classList.add("ql-"+e),null!=n&&(r.value=n),t.appendChild(r)}function y(t,e){Array.isArray(e[0])||(e=[e]),e.forEach(function(e){var n=document.createElement("span");n.classList.add("ql-formats"),e.forEach(function(t){if("string"==typeof t)d(n,t);else{var e=Object.keys(t)[0],r=t[e];Array.isArray(r)?function(t,e,n){var r=document.createElement("select");r.classList.add("ql-"+e),n.forEach(function(t){var e=document.createElement("option");!1!==t?e.setAttribute("value",t):e.setAttribute("selected","selected"),r.appendChild(e)}),t.appendChild(r)}(n,e,r):d(n,e,r)}}),t.appendChild(n)})}h.DEFAULTS={},h.DEFAULTS={container:null,handlers:{clean:function(){var t=this,e=this.quill.getSelection();if(null!=e)if(0==e.length){var n=this.quill.getFormat();Object.keys(n).forEach(function(e){null!=a.default.query(e,a.default.Scope.INLINE)&&t.quill.format(e,!1)})}else this.quill.removeFormat(e,l.default.sources.USER)},direction:function(t){var e=this.quill.getFormat().align;"rtl"===t&&null==e?this.quill.format("align","right",l.default.sources.USER):t||"right"!==e||this.quill.format("align",!1,l.default.sources.USER),this.quill.format("direction",t,l.default.sources.USER)},indent:function(t){var e=this.quill.getSelection(),n=this.quill.getFormat(e),r=parseInt(n.indent||0);if("+1"===t||"-1"===t){var o="+1"===t?1:-1;"rtl"===n.direction&&(o*=-1),this.quill.format("indent",r+o,l.default.sources.USER)}},link:function(t){!0===t&&(t=prompt("Enter link URL:")),this.quill.format("link",t,l.default.sources.USER)},list:function(t){var e=this.quill.getSelection(),n=this.quill.getFormat(e);"check"===t?"checked"===n.list||"unchecked"===n.list?this.quill.format("list",!1,l.default.sources.USER):this.quill.format("list","unchecked",l.default.sources.USER):this.quill.format("list",t,l.default.sources.USER)}}},e.default=h,e.addControls=y},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0},a=n(30),l=(r=a)&&r.__esModule?r:{default:r};var u=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.label.innerHTML=n,r.container.classList.add("ql-color-picker"),[].slice.call(r.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(t){t.classList.add("ql-primary")}),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,l.default),o(e,[{key:"buildItem",value:function(t){var n=i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"buildItem",this).call(this,t);return n.style.backgroundColor=t.getAttribute("value")||"",n}},{key:"selectItem",value:function(t,n){i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"selectItem",this).call(this,t,n);var r=this.label.querySelector(".ql-color-label"),o=t&&t.getAttribute("data-value")||"";r&&("line"===r.tagName?r.style.stroke=o:r.style.fill=o)}}]),e}();e.default=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=n(30),a=(r=i)&&r.__esModule?r:{default:r};var l=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.container.classList.add("ql-icon-picker"),[].forEach.call(r.container.querySelectorAll(".ql-picker-item"),function(t){t.innerHTML=n[t.getAttribute("data-value")||""]}),r.defaultItem=r.container.querySelector(".ql-selected"),r.selectItem(r.defaultItem),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,a.default),o(e,[{key:"selectItem",value:function(t,n){(function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0})(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"selectItem",this).call(this,t,n),t=t||this.defaultItem,this.label.innerHTML=t.innerHTML}}]),e}();e.default=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var o=function(){function t(e,n){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.quill=e,this.boundsContainer=n||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){r.root.style.marginTop=-1*r.quill.root.scrollTop+"px"}),this.hide()}return r(t,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(t){var e=t.left+t.width/2-this.root.offsetWidth/2,n=t.bottom+this.quill.root.scrollTop;this.root.style.left=e+"px",this.root.style.top=n+"px",this.root.classList.remove("ql-flip");var r=this.boundsContainer.getBoundingClientRect(),o=this.root.getBoundingClientRect(),i=0;if(o.right>r.right&&(i=r.right-o.right,this.root.style.left=e+i+"px"),o.left<r.left&&(i=r.left-o.left,this.root.style.left=e+i+"px"),o.bottom>r.bottom){var a=o.bottom-o.top,l=t.bottom-t.top+a;this.root.style.top=n-l+"px",this.root.classList.add("ql-flip")}return i}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),t}();e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&l.return&&l.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0},i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=h(n(3)),l=h(n(8)),u=n(49),s=h(u),c=h(n(29)),f=n(15),p=h(n(47));function h(t){return t&&t.__esModule?t:{default:t}}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function y(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function v(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var b=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],g=function(t){function e(t,n){d(this,e),null!=n.modules.toolbar&&null==n.modules.toolbar.container&&(n.modules.toolbar.container=b);var r=y(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.quill.container.classList.add("ql-snow"),r}return v(e,s.default),i(e,[{key:"extendToolbar",value:function(t){t.container.classList.add("ql-snow"),this.buildButtons([].slice.call(t.container.querySelectorAll("button")),p.default),this.buildPickers([].slice.call(t.container.querySelectorAll("select")),p.default),this.tooltip=new m(this.quill,this.options.bounds),t.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(e,n){t.handlers.link.call(t,!n.format.link)})}}]),e}();g.DEFAULTS=(0,a.default)(!0,{},s.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(t){if(t){var e=this.quill.getSelection();if(null==e||0==e.length)return;var n=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(n)&&0!==n.indexOf("mailto:")&&(n="mailto:"+n),this.quill.theme.tooltip.edit("link",n)}else this.quill.format("link",!1)}}}}});var m=function(t){function e(t,n){d(this,e);var r=y(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.preview=r.root.querySelector("a.ql-preview"),r}return v(e,u.BaseTooltip),i(e,[{key:"listen",value:function(){var t=this;o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(e){t.root.classList.contains("ql-editing")?t.save():t.edit("link",t.preview.textContent),e.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(e){if(null!=t.linkRange){var n=t.linkRange;t.restoreFocus(),t.quill.formatText(n,"link",!1,l.default.sources.USER),delete t.linkRange}e.preventDefault(),t.hide()}),this.quill.on(l.default.events.SELECTION_CHANGE,function(e,n,o){if(null!=e){if(0===e.length&&o===l.default.sources.USER){var i=t.quill.scroll.descendant(c.default,e.index),a=r(i,2),u=a[0],s=a[1];if(null!=u){t.linkRange=new f.Range(e.index-s,u.length());var p=c.default.formats(u.domNode);return t.preview.textContent=p,t.preview.setAttribute("href",p),t.show(),void t.position(t.quill.getBounds(t.linkRange))}}else delete t.linkRange;t.hide()}})}},{key:"show",value:function(){o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),e}();m.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),e.default=g},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=q(n(31)),o=n(42),i=n(44),a=n(82),l=q(n(83)),u=q(n(84)),s=n(85),c=q(s),f=n(43),p=n(28),h=n(45),d=n(46),y=q(n(75)),v=q(n(86)),b=q(n(29)),g=q(n(87)),m=q(n(88)),w=q(n(89)),_=q(n(90)),O=q(n(91)),x=n(13),E=q(x),k=q(n(92)),A=q(n(93)),j=q(n(76)),N=q(n(47)),T=q(n(30)),S=q(n(77)),P=q(n(78)),L=q(n(79)),C=q(n(132)),M=q(n(80));function q(t){return t&&t.__esModule?t:{default:t}}r.default.register({"attributors/attribute/direction":i.DirectionAttribute,"attributors/class/align":o.AlignClass,"attributors/class/background":f.BackgroundClass,"attributors/class/diff":f.DiffClass,"attributors/class/color":p.ColorClass,"attributors/class/direction":i.DirectionClass,"attributors/class/font":h.FontClass,"attributors/class/size":d.SizeClass,"attributors/style/align":o.AlignStyle,"attributors/style/background":f.BackgroundStyle,"attributors/style/diff":f.DiffStyle,"attributors/style/color":p.ColorStyle,"attributors/style/direction":i.DirectionStyle,"attributors/style/font":h.FontStyle,"attributors/style/size":d.SizeStyle},!0),r.default.register({"formats/align":o.AlignClass,"formats/direction":i.DirectionClass,"formats/indent":a.IndentClass,"formats/background":f.BackgroundStyle,"formats/diff":f.DiffStyle,"formats/color":p.ColorStyle,"formats/font":h.FontClass,"formats/size":d.SizeClass,"formats/blockquote":l.default,"formats/code-block":E.default,"formats/header":u.default,"formats/list":c.default,"formats/bold":y.default,"formats/code":x.Code,"formats/italic":v.default,"formats/link":b.default,"formats/script":g.default,"formats/strike":m.default,"formats/underline":w.default,"formats/image":_.default,"formats/video":O.default,"formats/list/item":s.ListItem,"modules/formula":k.default,"modules/syntax":A.default,"modules/toolbar":j.default,"themes/bubble":C.default,"themes/snow":M.default,"ui/icons":N.default,"ui/picker":T.default,"ui/icon-picker":P.default,"ui/color-picker":S.default,"ui/tooltip":L.default},!0),e.default=r.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IndentClass=void 0;var r,o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0},a=n(0),l=(r=a)&&r.__esModule?r:{default:r};var u=new(function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,l.default.Attributor.Class),o(e,[{key:"add",value:function(t,n){if("+1"===n||"-1"===n){var r=this.value(t)||0;n="+1"===n?r+1:r-1}return 0===n?(this.remove(t),!0):i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"add",this).call(this,t,n)}},{key:"canAdd",value:function(t,n){return i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"canAdd",this).call(this,t,n)||i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"canAdd",this).call(this,t,parseInt(n))}},{key:"value",value:function(t){return parseInt(i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"value",this).call(this,t))||void 0}}]),e}())("indent","ql-indent",{scope:l.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});e.IndentClass=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=n(4),i=(r=o)&&r.__esModule?r:{default:r};var a=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,i.default),e}();a.blotName="blockquote",a.tagName="blockquote",e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=n(4),a=(r=i)&&r.__esModule?r:{default:r};var l=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,a.default),o(e,null,[{key:"formats",value:function(t){return this.tagName.indexOf(t.tagName)+1}}]),e}();l.blotName="header",l.tagName=["H1","H2","H3","H4","H5","H6"],e.default=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.ListItem=void 0;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0},i=u(n(0)),a=u(n(4)),l=u(n(27));function u(t){return t&&t.__esModule?t:{default:t}}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function f(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var p=function(t){function e(){return s(this,e),c(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return f(e,a.default),r(e,[{key:"format",value:function(t,n){t!==h.blotName||n?o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n):this.replaceWith(i.default.create(this.statics.scope))}},{key:"remove",value:function(){null==this.prev&&null==this.next?this.parent.remove():o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(t,n){return this.parent.isolate(this.offset(this.parent),this.length()),t===this.parent.statics.blotName?(this.parent.replaceWith(t,n),this):(this.parent.unwrap(),o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"replaceWith",this).call(this,t,n))}}],[{key:"formats",value:function(t){return t.tagName===this.tagName?void 0:o(e.__proto__||Object.getPrototypeOf(e),"formats",this).call(this,t)}}]),e}();p.blotName="list-item",p.tagName="LI";var h=function(t){function e(t){s(this,e);var n=c(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t)),r=function(e){if(e.target.parentNode===t){var r=n.statics.formats(t),o=i.default.find(e.target);"checked"===r?o.format("list","unchecked"):"unchecked"===r&&o.format("list","checked")}};return t.addEventListener("touchstart",r),t.addEventListener("mousedown",r),n}return f(e,l.default),r(e,null,[{key:"create",value:function(t){var n="ordered"===t?"OL":"UL",r=o(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,n);return"checked"!==t&&"unchecked"!==t||r.setAttribute("data-checked","checked"===t),r}},{key:"formats",value:function(t){return"OL"===t.tagName?"ordered":"UL"===t.tagName?t.hasAttribute("data-checked")?"true"===t.getAttribute("data-checked")?"checked":"unchecked":"bullet":void 0}}]),r(e,[{key:"format",value:function(t,e){this.children.length>0&&this.children.tail.format(t,e)}},{key:"formats",value:function(){return t={},e=this.statics.blotName,n=this.statics.formats(this.domNode),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t;var t,e,n}},{key:"insertBefore",value:function(t,n){if(t instanceof p)o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertBefore",this).call(this,t,n);else{var r=null==n?this.length():n.offset(this),i=this.split(r);i.parent.insertBefore(t,i)}}},{key:"optimize",value:function(t){o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&n.domNode.tagName===this.domNode.tagName&&n.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(n.moveChildren(this),n.remove())}},{key:"replace",value:function(t){if(t.statics.blotName!==this.statics.blotName){var n=i.default.create(this.statics.defaultChild);t.moveChildren(n),this.appendChild(n)}o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"replace",this).call(this,t)}}]),e}();h.blotName="list",h.scope=i.default.Scope.BLOCK_BLOT,h.tagName=["OL","UL"],h.defaultChild="list-item",h.allowedChildren=[p],e.ListItem=p,e.default=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=n(75),i=(r=o)&&r.__esModule?r:{default:r};var a=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,i.default),e}();a.blotName="italic",a.tagName=["EM","I"],e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=n(6),a=(r=i)&&r.__esModule?r:{default:r};var l=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,a.default),o(e,null,[{key:"create",value:function(t){return"super"===t?document.createElement("sup"):"sub"===t?document.createElement("sub"):function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0}(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t)}},{key:"formats",value:function(t){return"SUB"===t.tagName?"sub":"SUP"===t.tagName?"super":void 0}}]),e}();l.blotName="script",l.tagName=["SUB","SUP"],e.default=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=n(6),i=(r=o)&&r.__esModule?r:{default:r};var a=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,i.default),e}();a.blotName="strike",a.tagName="S",e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=n(6),i=(r=o)&&r.__esModule?r:{default:r};var a=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,i.default),e}();a.blotName="underline",a.tagName="U",e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0},a=n(0),l=(r=a)&&r.__esModule?r:{default:r},u=n(29);var s=["alt","height","width"],c=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,l.default.Embed),o(e,[{key:"format",value:function(t,n){s.indexOf(t)>-1?n?this.domNode.setAttribute(t,n):this.domNode.removeAttribute(t):i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n)}}],[{key:"create",value:function(t){var n=i(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return"string"==typeof t&&n.setAttribute("src",this.sanitize(t)),n}},{key:"formats",value:function(t){return s.reduce(function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e},{})}},{key:"match",value:function(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}},{key:"sanitize",value:function(t){return(0,u.sanitize)(t,["http","https","data"])?t:"//:0"}},{key:"value",value:function(t){return t.getAttribute("src")}}]),e}();c.blotName="image",c.tagName="IMG",e.default=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0},a=n(4),l=n(29),u=(r=l)&&r.__esModule?r:{default:r};var s=["height","width"],c=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,a.BlockEmbed),o(e,[{key:"format",value:function(t,n){s.indexOf(t)>-1?n?this.domNode.setAttribute(t,n):this.domNode.removeAttribute(t):i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n)}}],[{key:"create",value:function(t){var n=i(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen",!0),n.setAttribute("src",this.sanitize(t)),n}},{key:"formats",value:function(t){return s.reduce(function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e},{})}},{key:"sanitize",value:function(t){return u.default.sanitize(t)}},{key:"value",value:function(t){return t.getAttribute("src")}}]),e}();c.blotName="video",c.className="ql-video",c.tagName="IFRAME",e.default=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.FormulaBlot=void 0;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=l(n(41)),i=l(n(5)),a=l(n(9));function l(t){return t&&t.__esModule?t:{default:t}}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var f=function(t){function e(){return u(this,e),s(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return c(e,o.default),r(e,null,[{key:"create",value:function(t){var n=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0}(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return"string"==typeof t&&(window.katex.render(t,n,{throwOnError:!1,errorColor:"#f00"}),n.setAttribute("data-value",t)),n}},{key:"value",value:function(t){return t.getAttribute("data-value")}}]),e}();f.blotName="formula",f.className="ql-formula",f.tagName="SPAN";var p=function(t){function e(){u(this,e);var t=s(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));if(null==window.katex)throw new Error("Formula module requires KaTeX.");return t}return c(e,a.default),r(e,null,[{key:"register",value:function(){i.default.register(f,!0)}}]),e}();e.FormulaBlot=f,e.default=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.CodeToken=e.CodeBlock=void 0;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=u(n(0)),i=u(n(5)),a=u(n(9)),l=u(n(13));function u(t){return t&&t.__esModule?t:{default:t}}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function f(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var p=function(t){function e(){return s(this,e),c(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return f(e,l.default),r(e,[{key:"replaceWith",value:function(t){this.domNode.textContent=this.domNode.textContent,this.attach(),function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0}(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"replaceWith",this).call(this,t)}},{key:"highlight",value:function(t){var e=this.domNode.textContent;this.cachedText!==e&&((e.trim().length>0||null==this.cachedText)&&(this.domNode.innerHTML=t(e),this.domNode.normalize(),this.attach()),this.cachedText=e)}}]),e}();p.className="ql-syntax";var h=new o.default.Attributor.Class("token","hljs",{scope:o.default.Scope.INLINE}),d=function(t){function e(t,n){s(this,e);var r=c(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));if("function"!=typeof r.options.highlight)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var o=null;return r.quill.on(i.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(o),o=setTimeout(function(){r.highlight(),o=null},r.options.interval)}),r.highlight(),r}return f(e,a.default),r(e,null,[{key:"register",value:function(){i.default.register(h,!0),i.default.register(p,!0)}}]),r(e,[{key:"highlight",value:function(){var t=this;if(!this.quill.selection.composing){this.quill.update(i.default.sources.USER);var e=this.quill.getSelection();this.quill.scroll.descendants(p).forEach(function(e){e.highlight(t.options.highlight)}),this.quill.update(i.default.sources.SILENT),null!=e&&this.quill.setSelection(e,i.default.sources.SILENT)}}}]),e}();d.DEFAULTS={highlight:null==window.hljs?null:function(t){return window.hljs.highlightAuto(t).value},interval:1e3},e.CodeBlock=p,e.CodeToken=h,e.default=d},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-align-left width=24 height=24 viewBox="0 0 24 24"><path d=M3,3H21V5H3V3M3,7H15V9H3V7M3,11H21V13H3V11M3,15H15V17H3V15M3,19H21V21H3V19Z /></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-align-center width=24 height=24 viewBox="0 0 24 24"><path d=M3,3H21V5H3V3M7,7H17V9H7V7M3,11H21V13H3V11M7,15H17V17H7V15M3,19H21V21H3V19Z /></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-align-right width=24 height=24 viewBox="0 0 24 24"><path d=M3,3H21V5H3V3M9,7H21V9H9V7M3,11H21V13H3V11M9,15H21V17H9V15M3,19H21V21H3V19Z /></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-align-justify width=24 height=24 viewBox="0 0 24 24"><path d=M3,3H21V5H3V3M3,7H21V9H3V7M3,11H21V13H3V11M3,15H21V17H3V15M3,19H21V21H3V19Z /></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-color-highlight width=24 height=24 viewBox="0 0 24 24"><path d="M4,17L6.75,14.25L6.72,14.23C6.14,13.64 6.14,12.69 6.72,12.11L11.46,7.37L15.7,11.61L10.96,16.35C10.39,16.93 9.46,16.93 8.87,16.37L8.24,17H4M15.91,2.91C16.5,2.33 17.45,2.33 18.03,2.91L20.16,5.03C20.74,5.62 20.74,6.57 20.16,7.16L16.86,10.45L12.62,6.21L15.91,2.91Z"/></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-quote-open width=24 height=24 viewBox="0 0 24 24"><path d=M10,7L8,11H11V17H5V11L7,7H10M18,7L16,11H19V17H13V11L15,7H18Z /></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-bold width=24 height=24 viewBox="0 0 24 24"><path d="M13.5,15.5H10V12.5H13.5A1.5,1.5 0 0,1 15,14A1.5,1.5 0 0,1 13.5,15.5M10,6.5H13A1.5,1.5 0 0,1 14.5,8A1.5,1.5 0 0,1 13,9.5H10M15.6,10.79C16.57,10.11 17.25,9 17.25,8C17.25,5.74 15.5,4 13.25,4H7V18H14.04C16.14,18 17.75,16.3 17.75,14.21C17.75,12.69 16.89,11.39 15.6,10.79Z"/></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-clear width=24 height=24 viewBox="0 0 24 24"><path d=M6,5V5.18L8.82,8H11.22L10.5,9.68L12.6,11.78L14.21,8H20V5H6M3.27,5L2,6.27L8.97,13.24L6.5,19H9.5L11.07,15.34L16.73,21L18,19.73L3.55,5.27L3.27,5Z /></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-code-tags width=24 height=24 viewBox="0 0 24 24"><path d=M14.6,16.6L19.2,12L14.6,7.4L16,6L22,12L16,18L14.6,16.6M9.4,16.6L4.8,12L9.4,7.4L8,6L2,12L8,18L9.4,16.6Z /></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-code-braces width=24 height=24 viewBox="0 0 24 24"><path d="M8,3A2,2 0 0,0 6,5V9A2,2 0 0,1 4,11H3V13H4A2,2 0 0,1 6,15V19A2,2 0 0,0 8,21H10V19H8V14A2,2 0 0,0 6,12A2,2 0 0,0 8,10V5H10V3M16,3A2,2 0 0,1 18,5V9A2,2 0 0,0 20,11H21V13H20A2,2 0 0,0 18,15V19A2,2 0 0,1 16,21H14V19H16V14A2,2 0 0,1 18,12A2,2 0 0,1 16,10V5H14V3H16Z"/></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-color-text width=24 height=24 viewBox="0 0 24 24"><path d=M9.62,12L12,5.67L14.37,12M11,3L5.5,17H7.75L8.87,14H15.12L16.25,17H18.5L13,3H11Z /></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-textdirection-l-to-r width=24 height=24 viewBox="0 0 24 24"><path d="M21,18L17,14V17H5V19H17V22M9,10V15H11V4H13V15H15V4H17V2H9A4,4 0 0,0 5,6A4,4 0 0,0 9,10Z"/></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-textdirection-r-to-l width=24 height=24 viewBox="0 0 24 24"><path d="M8,17V14L4,18L8,22V19H20V17M10,10V15H12V4H14V15H16V4H18V2H10A4,4 0 0,0 6,6A4,4 0 0,0 10,10Z"/></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-float-center width=24 height=24 viewBox="0 0 24 24"><path d=M9,7H15V13H9V7M3,3H21V5H3V3M3,15H21V17H3V15M3,19H17V21H3V19Z /></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-float-none width=24 height=24 viewBox="0 0 24 24"><path d=M3,7H9V13H3V7M3,3H21V5H3V3M21,11V13H11V11H21M3,15H17V17H3V15M3,19H21V21H3V19Z /></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-float-left width=24 height=24 viewBox="0 0 24 24"><path d=M3,7H9V13H3V7M3,3H21V5H3V3M21,7V9H11V7H21M21,11V13H11V11H21M3,15H17V17H3V15M3,19H21V21H3V19Z /></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-float-right width=24 height=24 viewBox="0 0 24 24"><path d=M15,7H21V13H15V7M3,3H21V5H3V3M13,7V9H3V7H13M9,11V13H3V11H9M3,15H17V17H3V15M3,19H21V21H3V19Z /></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-function-variant width=24 height=24 viewBox="0 0 24 24"><path d="M12.42,5.29C11.32,5.19 10.35,6 10.25,7.11L10,10H12.82V12H9.82L9.38,17.07C9.18,19.27 7.24,20.9 5.04,20.7C3.79,20.59 2.66,19.9 2,18.83L3.5,17.33C3.83,18.38 4.96,18.97 6,18.63C6.78,18.39 7.33,17.7 7.4,16.89L7.82,12H4.82V10H8L8.27,6.93C8.46,4.73 10.39,3.1 12.6,3.28C13.86,3.39 15,4.09 15.66,5.17L14.16,6.67C13.91,5.9 13.23,5.36 12.42,5.29M22,13.65L20.59,12.24L17.76,15.07L14.93,12.24L13.5,13.65L16.35,16.5L13.5,19.31L14.93,20.72L17.76,17.89L20.59,20.72L22,19.31L19.17,16.5L22,13.65Z"/></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-header-1 width=24 height=24 viewBox="0 0 24 24"><path d=M3,4H5V10H9V4H11V18H9V12H5V18H3V4M14,18V16H16V6.31L13.5,7.75V5.44L16,4H18V16H20V18H14Z /></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-header-2 width=24 height=24 viewBox="0 0 24 24"><path d="M3,4H5V10H9V4H11V18H9V12H5V18H3V4M21,18H15A2,2 0 0,1 13,16C13,15.47 13.2,15 13.54,14.64L18.41,9.41C18.78,9.05 19,8.55 19,8A2,2 0 0,0 17,6A2,2 0 0,0 15,8H13A4,4 0 0,1 17,4A4,4 0 0,1 21,8C21,9.1 20.55,10.1 19.83,10.83L15,16H21V18Z"/></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-header-3 width=24 height=24 viewBox="0 0 24 24"><path d="M3,4H5V10H9V4H11V18H9V12H5V18H3V4M15,4H19A2,2 0 0,1 21,6V16A2,2 0 0,1 19,18H15A2,2 0 0,1 13,16V15H15V16H19V12H15V10H19V6H15V7H13V6A2,2 0 0,1 15,4Z"/></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-header-4 width=24 height=24 viewBox="0 0 24 24"><path d=M3,4H5V10H9V4H11V18H9V12H5V18H3V4M18,18V13H13V11L18,4H20V11H21V13H20V18H18M18,11V7.42L15.45,11H18Z /></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-header-5 width=24 height=24 viewBox="0 0 24 24"><path d="M3,4H5V10H9V4H11V18H9V12H5V18H3V4M15,4H20V6H15V10H17A4,4 0 0,1 21,14A4,4 0 0,1 17,18H15A2,2 0 0,1 13,16V15H15V16H17A2,2 0 0,0 19,14A2,2 0 0,0 17,12H15A2,2 0 0,1 13,10V6A2,2 0 0,1 15,4Z"/></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-header-6 width=24 height=24 viewBox="0 0 24 24"><path d="M3,4H5V10H9V4H11V18H9V12H5V18H3V4M15,4H19A2,2 0 0,1 21,6V7H19V6H15V10H19A2,2 0 0,1 21,12V16A2,2 0 0,1 19,18H15A2,2 0 0,1 13,16V6A2,2 0 0,1 15,4M15,12V16H19V12H15Z"/></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-italic width=24 height=24 viewBox="0 0 24 24"><path d=M10,4V7H12.21L8.79,15H6V18H14V15H11.79L15.21,7H18V4H10Z /></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-image width=24 height=24 viewBox="0 0 24 24"><path d="M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z"/></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-indent-increase width=24 height=24 viewBox="0 0 24 24"><path d=M11,13H21V11H11M11,9H21V7H11M3,3V5H21V3M11,17H21V15H11M3,8V16L7,12M3,21H21V19H3V21Z /></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-indent-decrease width=24 height=24 viewBox="0 0 24 24"><path d=M11,13H21V11H11M11,9H21V7H11M3,3V5H21V3M3,21H21V19H3M3,12L7,16V8M11,17H21V15H11V17Z /></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-link width=24 height=24 viewBox="0 0 24 24"><path d="M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z"/></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-list-numbered width=24 height=24 viewBox="0 0 24 24"><path d="M7,13V11H21V13H7M7,19V17H21V19H7M7,7V5H21V7H7M3,8V5H2V4H4V8H3M2,17V16H5V20H2V19H4V18.5H3V17.5H4V17H2M4.25,10A0.75,0.75 0 0,1 5,10.75C5,10.95 4.92,11.14 4.79,11.27L3.12,13H5V14H2V13.08L4,11H2V10H4.25Z"/></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-list-bulleted-square width=24 height=24 viewBox="0 0 24 24"><path d=M3,4H7V8H3V4M9,5V7H21V5H9M3,10H7V14H3V10M9,11V13H21V11H9M3,16H7V20H3V16M9,17V19H21V17H9 /></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-list-checks width=24 height=24 viewBox="0 0 24 24"><path d=M3,5H9V11H3V5M5,7V9H7V7H5M11,7H21V9H11V7M11,15H21V17H11V15M5,20L1.5,16.5L2.91,15.09L5,17.17L9.59,12.59L11,14L5,20Z /></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-subscript width=24 height=24 viewBox="0 0 24 24"><path d="M16,7.41L11.41,12L16,16.59L14.59,18L10,13.41L5.41,18L4,16.59L8.59,12L4,7.41L5.41,6L10,10.59L14.59,6L16,7.41M21.85,21.03H16.97V20.03L17.86,19.23C18.62,18.58 19.18,18.04 19.56,17.6C19.93,17.16 20.12,16.75 20.13,16.36C20.14,16.08 20.05,15.85 19.86,15.66C19.68,15.5 19.39,15.38 19,15.38C18.69,15.38 18.42,15.44 18.16,15.56L17.5,15.94L17.05,14.77C17.32,14.56 17.64,14.38 18.03,14.24C18.42,14.1 18.85,14 19.32,14C20.1,14.04 20.7,14.25 21.1,14.66C21.5,15.07 21.72,15.59 21.72,16.23C21.71,16.79 21.53,17.31 21.18,17.78C20.84,18.25 20.42,18.7 19.91,19.14L19.27,19.66V19.68H21.85V21.03Z"/></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-superscript width=24 height=24 viewBox="0 0 24 24"><path d="M16,7.41L11.41,12L16,16.59L14.59,18L10,13.41L5.41,18L4,16.59L8.59,12L4,7.41L5.41,6L10,10.59L14.59,6L16,7.41M21.85,9H16.97V8L17.86,7.18C18.62,6.54 19.18,6 19.56,5.55C19.93,5.11 20.12,4.7 20.13,4.32C20.14,4.04 20.05,3.8 19.86,3.62C19.68,3.43 19.39,3.34 19,3.33C18.69,3.34 18.42,3.4 18.16,3.5L17.5,3.89L17.05,2.72C17.32,2.5 17.64,2.33 18.03,2.19C18.42,2.05 18.85,2 19.32,2C20.1,2 20.7,2.2 21.1,2.61C21.5,3 21.72,3.54 21.72,4.18C21.71,4.74 21.53,5.26 21.18,5.73C20.84,6.21 20.42,6.66 19.91,7.09L19.27,7.61V7.63H21.85V9Z"/></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-strikethrough width=24 height=24 viewBox="0 0 24 24"><path d=M3,14H21V12H3M5,4V7H10V10H14V7H19V4M10,19H14V16H10V19Z /></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-format-underline width=24 height=24 viewBox="0 0 24 24"><path d="M5,21H19V19H5V21M12,17A6,6 0 0,0 18,11V3H15.5V11A3.5,3.5 0 0,1 12,14.5A3.5,3.5 0 0,1 8.5,11V3H6V11A6,6 0 0,0 12,17Z"/></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-video width=24 height=24 viewBox="0 0 24 24"><path d="M17,10.5V7A1,1 0 0,0 16,6H4A1,1 0 0,0 3,7V17A1,1 0 0,0 4,18H16A1,1 0 0,0 17,17V13.5L21,17.5V6.5L17,10.5Z"/></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8"?><!doctype html><svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink version=1.1 id=mdi-unfold-more-horizontal width=24 height=24 viewBox="0 0 24 24"><path d=M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z /></svg>'},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BubbleTooltip=void 0;var r=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=f(n(3)),a=f(n(8)),l=n(49),u=f(l),s=n(15),c=f(n(47));function f(t){return t&&t.__esModule?t:{default:t}}function p(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function d(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var y=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],v=function(t){function e(t,n){p(this,e),null!=n.modules.toolbar&&null==n.modules.toolbar.container&&(n.modules.toolbar.container=y);var r=h(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.quill.container.classList.add("ql-bubble"),r}return d(e,u.default),o(e,[{key:"extendToolbar",value:function(t){this.tooltip=new b(this.quill,this.options.bounds),this.tooltip.root.appendChild(t.container),this.buildButtons([].slice.call(t.container.querySelectorAll("button")),c.default),this.buildPickers([].slice.call(t.container.querySelectorAll("select")),c.default)}}]),e}();v.DEFAULTS=(0,i.default)(!0,{},u.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(t){t?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var b=function(t){function e(t,n){p(this,e);var r=h(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.quill.on(a.default.events.EDITOR_CHANGE,function(t,e,n,o){if(t===a.default.events.SELECTION_CHANGE)if(null!=e&&e.length>0&&o===a.default.sources.USER){r.show(),r.root.style.left="0px",r.root.style.width="",r.root.style.width=r.root.offsetWidth+"px";var i=r.quill.getLines(e.index,e.length);if(1===i.length)r.position(r.quill.getBounds(e));else{var l=i[i.length-1],u=r.quill.getIndex(l),c=Math.min(l.length()-1,e.index+e.length-u),f=r.quill.getBounds(new s.Range(u,c));r.position(f)}}else document.activeElement!==r.textbox&&r.quill.hasFocus()&&r.hide()}),r}return d(e,l.BaseTooltip),o(e,[{key:"listen",value:function(){var t=this;r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){t.root.classList.remove("ql-editing")}),this.quill.on(a.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!t.root.classList.contains("ql-hidden")){var e=t.quill.getSelection();null!=e&&t.position(t.quill.getBounds(e))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(t){var n=r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"position",this).call(this,t),o=this.root.querySelector(".ql-tooltip-arrow");if(o.style.marginLeft="",0===n)return n;o.style.marginLeft=-1*n-o.offsetWidth/2+"px"}}]),e}();b.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),e.BubbleTooltip=b,e.default=v},function(t,e,n){t.exports=n(81)}]).default},"object"==typeof n&&"object"==typeof e?e.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof n?n.Quill=o():r.Quill=o()}).call(this,t("buffer").Buffer)},{buffer:4}],3:[function(t,e,n){"use strict";n.byteLength=function(t){var e=s(t),n=e[0],r=e[1];return 3*(n+r)/4-r},n.toByteArray=function(t){for(var e,n=s(t),r=n[0],a=n[1],l=new i(function(t,e,n){return 3*(e+n)/4-n}(0,r,a)),u=0,c=a>0?r-4:r,f=0;f<c;f+=4)e=o[t.charCodeAt(f)]<<18|o[t.charCodeAt(f+1)]<<12|o[t.charCodeAt(f+2)]<<6|o[t.charCodeAt(f+3)],l[u++]=e>>16&255,l[u++]=e>>8&255,l[u++]=255&e;2===a&&(e=o[t.charCodeAt(f)]<<2|o[t.charCodeAt(f+1)]>>4,l[u++]=255&e);1===a&&(e=o[t.charCodeAt(f)]<<10|o[t.charCodeAt(f+1)]<<4|o[t.charCodeAt(f+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e);return l},n.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],a=0,l=n-o;a<l;a+=16383)i.push(c(t,a,a+16383>l?l:a+16383));1===o?(e=t[n-1],i.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],i.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,u=a.length;l<u;++l)r[l]=a[l],o[a.charCodeAt(l)]=l;function s(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function c(t,e,n){for(var o,i,a=[],l=e;l<n;l+=3)o=(t[l]<<16&16711680)+(t[l+1]<<8&65280)+(255&t[l+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},{}],4:[function(t,e,n){"use strict";var r=t("base64-js"),o=t("ieee754");n.Buffer=l,n.SlowBuffer=function(t){+t!=t&&(t=0);return l.alloc(+t)},n.INSPECT_MAX_BYTES=50;var i=2147483647;function a(t){if(t>i)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=l.prototype,e}function l(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return c(t)}return u(t,e,n)}function u(t,e,n){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!l.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var n=0|h(t,e),r=a(n),o=r.write(t,e);o!==n&&(r=r.slice(0,o));return r}(t,e);if(ArrayBuffer.isView(t))return f(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(V(t,ArrayBuffer)||t&&V(t.buffer,ArrayBuffer))return function(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;r=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n);return r.__proto__=l.prototype,r}(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=t.valueOf&&t.valueOf();if(null!=r&&r!==t)return l.from(r,e,n);var o=function(t){if(l.isBuffer(t)){var e=0|p(t.length),n=a(e);return 0===n.length?n:(t.copy(n,0,0,e),n)}if(void 0!==t.length)return"number"!=typeof t.length||U(t.length)?a(0):f(t);if("Buffer"===t.type&&Array.isArray(t.data))return f(t.data)}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return l.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function c(t){return s(t),a(t<0?0:0|p(t))}function f(t){for(var e=t.length<0?0:0|p(t.length),n=a(e),r=0;r<e;r+=1)n[r]=255&t[r];return n}function p(t){if(t>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|t}function h(t,e){if(l.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||V(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var o=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return I(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return B(t).length;default:if(o)return r?-1:I(t).length;e=(""+e).toLowerCase(),o=!0}}function d(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function y(t,e,n,r,o){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),U(n=+n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof e&&(e=l.from(e,r)),l.isBuffer(e))return 0===e.length?-1:v(t,e,n,r,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):v(t,[e],n,r,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,n,r,o){var i,a=1,l=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,l/=2,u/=2,n/=2}function s(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var c=-1;for(i=n;i<l;i++)if(s(t,i)===s(e,-1===c?0:i-c)){if(-1===c&&(c=i),i-c+1===u)return c*a}else-1!==c&&(i-=i-c),c=-1}else for(n+u>l&&(n=l-u),i=n;i>=0;i--){for(var f=!0,p=0;p<u;p++)if(s(t,i+p)!==s(e,p)){f=!1;break}if(f)return i}return-1}function b(t,e,n,r){n=Number(n)||0;var o=t.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=e.length;r>i/2&&(r=i/2);for(var a=0;a<r;++a){var l=parseInt(e.substr(2*a,2),16);if(U(l))return a;t[n+a]=l}return a}function g(t,e,n,r){return R(I(e,t.length-n),t,n,r)}function m(t,e,n,r){return R(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function w(t,e,n,r){return m(t,e,n,r)}function _(t,e,n,r){return R(B(e),t,n,r)}function O(t,e,n,r){return R(function(t,e){for(var n,r,o,i=[],a=0;a<t.length&&!((e-=2)<0);++a)n=t.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(e,t.length-n),t,n,r)}function x(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function E(t,e,n){n=Math.min(t.length,n);for(var r=[],o=e;o<n;){var i,a,l,u,s=t[o],c=null,f=s>239?4:s>223?3:s>191?2:1;if(o+f<=n)switch(f){case 1:s<128&&(c=s);break;case 2:128==(192&(i=t[o+1]))&&(u=(31&s)<<6|63&i)>127&&(c=u);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(u=(15&s)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:i=t[o+1],a=t[o+2],l=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&l)&&(u=(15&s)<<18|(63&i)<<12|(63&a)<<6|63&l)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),o+=f}return function(t){var e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=k));return n}(r)}n.kMaxLength=i,l.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),l.poolSize=8192,l.from=function(t,e,n){return u(t,e,n)},l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,l.alloc=function(t,e,n){return function(t,e,n){return s(t),t<=0?a(t):void 0!==e?"string"==typeof n?a(t).fill(e,n):a(t).fill(e):a(t)}(t,e,n)},l.allocUnsafe=function(t){return c(t)},l.allocUnsafeSlow=function(t){return c(t)},l.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==l.prototype},l.compare=function(t,e){if(V(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),V(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(t)||!l.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var n=t.length,r=e.length,o=0,i=Math.min(n,r);o<i;++o)if(t[o]!==e[o]){n=t[o],r=e[o];break}return n<r?-1:r<n?1:0},l.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return l.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=l.allocUnsafe(e),o=0;for(n=0;n<t.length;++n){var i=t[n];if(V(i,Uint8Array)&&(i=l.from(i)),!l.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(r,o),o+=i.length}return r},l.byteLength=h,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)d(this,e,e+1);return this},l.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)d(this,e,e+3),d(this,e+1,e+2);return this},l.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)d(this,e,e+7),d(this,e+1,e+6),d(this,e+2,e+5),d(this,e+3,e+4);return this},l.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?E(this,0,t):function(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return N(this,e,n);case"utf8":case"utf-8":return E(this,e,n);case"ascii":return A(this,e,n);case"latin1":case"binary":return j(this,e,n);case"base64":return x(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===l.compare(this,t)},l.prototype.inspect=function(){var t="",e=n.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},l.prototype.compare=function(t,e,n,r,o){if(V(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),e<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&e>=n)return 0;if(r>=o)return-1;if(e>=n)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0),u=Math.min(i,a),s=this.slice(r,o),c=t.slice(e,n),f=0;f<u;++f)if(s[f]!==c[f]){i=s[f],a=c[f];break}return i<a?-1:a<i?1:0},l.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},l.prototype.indexOf=function(t,e,n){return y(this,t,e,n,!0)},l.prototype.lastIndexOf=function(t,e,n){return y(this,t,e,n,!1)},l.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-e;if((void 0===n||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return g(this,t,e,n);case"ascii":return m(this,t,e,n);case"latin1":case"binary":return w(this,t,e,n);case"base64":return _(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,e,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function A(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o<n;++o)r+=String.fromCharCode(127&t[o]);return r}function j(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o<n;++o)r+=String.fromCharCode(t[o]);return r}function N(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=e;i<n;++i)o+=H(t[i]);return o}function T(t,e,n){for(var r=t.slice(e,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function S(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,n,r,o,i){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function L(t,e,n,r,o,i){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function C(t,e,n,r,i){return e=+e,n>>>=0,i||L(t,0,n,4),o.write(t,e,n,r,23,4),n+4}function M(t,e,n,r,i){return e=+e,n>>>=0,i||L(t,0,n,8),o.write(t,e,n,r,52,8),n+8}l.prototype.slice=function(t,e){var n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t);var r=this.subarray(t,e);return r.__proto__=l.prototype,r},l.prototype.readUIntLE=function(t,e,n){t>>>=0,e>>>=0,n||S(t,e,this.length);for(var r=this[t],o=1,i=0;++i<e&&(o*=256);)r+=this[t+i]*o;return r},l.prototype.readUIntBE=function(t,e,n){t>>>=0,e>>>=0,n||S(t,e,this.length);for(var r=this[t+--e],o=1;e>0&&(o*=256);)r+=this[t+--e]*o;return r},l.prototype.readUInt8=function(t,e){return t>>>=0,e||S(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return t>>>=0,e||S(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return t>>>=0,e||S(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return t>>>=0,e||S(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return t>>>=0,e||S(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||S(t,e,this.length);for(var r=this[t],o=1,i=0;++i<e&&(o*=256);)r+=this[t+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*e)),r},l.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||S(t,e,this.length);for(var r=e,o=1,i=this[t+--r];r>0&&(o*=256);)i+=this[t+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},l.prototype.readInt8=function(t,e){return t>>>=0,e||S(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){t>>>=0,e||S(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(t,e){t>>>=0,e||S(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(t,e){return t>>>=0,e||S(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return t>>>=0,e||S(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return t>>>=0,e||S(t,4,this.length),o.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return t>>>=0,e||S(t,4,this.length),o.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return t>>>=0,e||S(t,8,this.length),o.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return t>>>=0,e||S(t,8,this.length),o.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e>>>=0,n>>>=0,r)||P(this,t,e,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[e]=255&t;++i<n&&(o*=256);)this[e+i]=t/o&255;return e+n},l.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e>>>=0,n>>>=0,r)||P(this,t,e,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+n},l.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,1,255,0),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},l.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var o=Math.pow(2,8*n-1);P(this,t,e,n,o-1,-o)}var i=0,a=1,l=0;for(this[e]=255&t;++i<n&&(a*=256);)t<0&&0===l&&0!==this[e+i-1]&&(l=1),this[e+i]=(t/a>>0)-l&255;return e+n},l.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var o=Math.pow(2,8*n-1);P(this,t,e,n,o-1,-o)}var i=n-1,a=1,l=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===l&&0!==this[e+i+1]&&(l=1),this[e+i]=(t/a>>0)-l&255;return e+n},l.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},l.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeFloatLE=function(t,e,n){return C(this,t,e,!0,n)},l.prototype.writeFloatBE=function(t,e,n){return C(this,t,e,!1,n)},l.prototype.writeDoubleLE=function(t,e,n){return M(this,t,e,!0,n)},l.prototype.writeDoubleBE=function(t,e,n){return M(this,t,e,!1,n)},l.prototype.copy=function(t,e,n,r){if(!l.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var o=r-n;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,n,r);else if(this===t&&n<e&&e<r)for(var i=o-1;i>=0;--i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,r),e);return o},l.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===t.length){var o=t.charCodeAt(0);("utf8"===r&&o<128||"latin1"===r)&&(t=o)}}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var i;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i<n;++i)this[i]=t;else{var a=l.isBuffer(t)?t:l.from(t,r),u=a.length;if(0===u)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<n-e;++i)this[i+e]=a[i%u]}return this};var q=/[^+\/0-9A-Za-z-_]/g;function H(t){return t<16?"0"+t.toString(16):t.toString(16)}function I(t,e){var n;e=e||1/0;for(var r=t.length,o=null,i=[],a=0;a<r;++a){if((n=t.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function B(t){return r.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function R(t,e,n,r){for(var o=0;o<r&&!(o+n>=e.length||o>=t.length);++o)e[o+n]=t[o];return o}function V(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function U(t){return t!=t}},{"base64-js":3,ieee754:5}],5:[function(t,e,n){n.read=function(t,e,n,r,o){var i,a,l=8*o-r-1,u=(1<<l)-1,s=u>>1,c=-7,f=n?o-1:0,p=n?-1:1,h=t[e+f];for(f+=p,i=h&(1<<-c)-1,h>>=-c,c+=l;c>0;i=256*i+t[e+f],f+=p,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=r;c>0;a=256*a+t[e+f],f+=p,c-=8);if(0===i)i=1-s;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=s}return(h?-1:1)*a*Math.pow(2,i-r)},n.write=function(t,e,n,r,o,i){var a,l,u,s=8*i-o-1,c=(1<<s)-1,f=c>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,d=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+f>=1?p/u:p*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=c?(l=0,a=c):a+f>=1?(l=(e*u-1)*Math.pow(2,o),a+=f):(l=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[n+h]=255&l,h+=d,l/=256,o-=8);for(a=a<<o|l,s+=o;s>0;t[n+h]=255&a,h+=d,a/=256,s-=8);t[n+h-d]|=128*y}},{}]},{},[1]);
\ No newline at end of file
diff --git a/apps/mobile/html/Web.bundle/site/styles.css b/apps/mobile/html/Web.bundle/site/styles.css
new file mode 100644
index 000000000..7583225f8
--- /dev/null
+++ b/apps/mobile/html/Web.bundle/site/styles.css
@@ -0,0 +1,1088 @@
+/*!
+* Quill Editor v1.3.6
+* https://quilljs.com/
+* Copyright (c) 2014, Jason Chen
+* Copyright (c) 2013, salesforce.com
+*/
+.ql-container {
+ box-sizing: border-box;
+ font-family: 'Noto Sans', sans-serif;
+
+ margin: 0px;
+ position: relative;
+
+ height: calc(100% - 105px) !important;
+}
+
+.ql-container.ql-disabled .ql-tooltip {
+ visibility: hidden;
+}
+
+.ql-container.ql-disabled .ql-editor ul[data-checked]>li::before {
+ pointer-events: none;
+}
+
+.ql-clipboard {
+ left: -100000px;
+ height: 1px;
+ overflow-y: hidden;
+ position: absolute;
+ top: 50%;
+}
+
+.ql-clipboard p {
+ margin: 0;
+ padding: 0;
+}
+
+.ql-editor {
+ box-sizing: border-box;
+ line-height: 1.42;
+ height: 100%;
+ outline: none;
+ overflow-y: auto;
+ padding: 12px 12px;
+ tab-size: 4;
+ -moz-tab-size: 4;
+ text-align: left;
+ white-space: pre-wrap;
+ word-wrap: break-word;
+}
+
+.ql-editor>* {
+ cursor: text;
+}
+
+.ql-editor p,
+.ql-editor ol,
+.ql-editor ul,
+.ql-editor pre,
+.ql-editor blockquote,
+.ql-editor h1,
+.ql-editor h2,
+.ql-editor h3,
+.ql-editor h4,
+.ql-editor h5,
+.ql-editor h6 {
+ margin: 0;
+ padding: 0;
+ counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
+}
+
+.ql-editor ol,
+.ql-editor ul {
+ padding-left: 1.5em;
+}
+
+.ql-editor ol>li,
+.ql-editor ul>li {
+ list-style-type: none;
+}
+
+.ql-editor ul>li::before {
+ content: '\2022';
+}
+
+.ql-editor ul[data-checked='true'],
+.ql-editor ul[data-checked='false'] {
+ pointer-events: none;
+}
+
+.ql-editor ul[data-checked='true']>li *,
+.ql-editor ul[data-checked='false']>li * {
+ pointer-events: all;
+}
+
+.ql-editor ul[data-checked='true']>li::before {
+ content: '\2611';
+}
+
+.ql-editor ul[data-checked='false']>li::before {
+ content: '\2610';
+}
+
+.ql-editor li::before {
+ display: inline-block;
+ white-space: nowrap;
+ width: 1.2em;
+}
+
+.ql-editor li:not(.ql-direction-rtl)::before {
+ margin-left: -1.5em;
+ margin-right: 0.3em;
+ text-align: right;
+}
+
+.ql-editor li.ql-direction-rtl::before {
+ margin-left: 0.3em;
+ margin-right: -1.5em;
+}
+
+.ql-editor ol li:not(.ql-direction-rtl),
+.ql-editor ul li:not(.ql-direction-rtl) {
+ padding-left: 0.1em;
+}
+
+.ql-editor ol li.ql-direction-rtl,
+.ql-editor ul li.ql-direction-rtl {
+ padding-right: 2.5em;
+}
+
+.ql-editor ol li {
+ counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
+ counter-increment: list-0;
+}
+
+.ql-editor ol li:before {
+ content: counter(list-0, decimal) '. ';
+}
+
+.ql-editor ol li.ql-indent-1 {
+ counter-increment: list-1;
+}
+
+.ql-editor ol li.ql-indent-1:before {
+ content: counter(list-1, lower-alpha) '. ';
+}
+
+.ql-editor ol li.ql-indent-1 {
+ counter-reset: list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
+}
+
+.ql-editor ol li.ql-indent-2 {
+ counter-increment: list-2;
+}
+
+.ql-editor ol li.ql-indent-2:before {
+ content: counter(list-2, lower-roman) '. ';
+}
+
+.ql-editor ol li.ql-indent-2 {
+ counter-reset: list-3 list-4 list-5 list-6 list-7 list-8 list-9;
+}
+
+.ql-editor ol li.ql-indent-3 {
+ counter-increment: list-3;
+}
+
+.ql-editor ol li.ql-indent-3:before {
+ content: counter(list-3, decimal) '. ';
+}
+
+.ql-editor ol li.ql-indent-3 {
+ counter-reset: list-4 list-5 list-6 list-7 list-8 list-9;
+}
+
+.ql-editor ol li.ql-indent-4 {
+ counter-increment: list-4;
+}
+
+.ql-editor ol li.ql-indent-4:before {
+ content: counter(list-4, lower-alpha) '. ';
+}
+
+.ql-editor ol li.ql-indent-4 {
+ counter-reset: list-5 list-6 list-7 list-8 list-9;
+}
+
+.ql-editor ol li.ql-indent-5 {
+ counter-increment: list-5;
+}
+
+.ql-editor ol li.ql-indent-5:before {
+ content: counter(list-5, lower-roman) '. ';
+}
+
+.ql-editor ol li.ql-indent-5 {
+ counter-reset: list-6 list-7 list-8 list-9;
+}
+
+.ql-editor ol li.ql-indent-6 {
+ counter-increment: list-6;
+}
+
+.ql-editor ol li.ql-indent-6:before {
+ content: counter(list-6, decimal) '. ';
+}
+
+.ql-editor ol li.ql-indent-6 {
+ counter-reset: list-7 list-8 list-9;
+}
+
+.ql-editor ol li.ql-indent-7 {
+ counter-increment: list-7;
+}
+
+.ql-editor ol li.ql-indent-7:before {
+ content: counter(list-7, lower-alpha) '. ';
+}
+
+.ql-editor ol li.ql-indent-7 {
+ counter-reset: list-8 list-9;
+}
+
+.ql-editor ol li.ql-indent-8 {
+ counter-increment: list-8;
+}
+
+.ql-editor ol li.ql-indent-8:before {
+ content: counter(list-8, lower-roman) '. ';
+}
+
+.ql-editor ol li.ql-indent-8 {
+ counter-reset: list-9;
+}
+
+.ql-editor ol li.ql-indent-9 {
+ counter-increment: list-9;
+}
+
+.ql-editor ol li.ql-indent-9:before {
+ content: counter(list-9, decimal) '. ';
+}
+
+.ql-editor .ql-indent-1:not(.ql-direction-rtl) {
+ padding-left: 1.5em;
+}
+
+.ql-editor li.ql-indent-1:not(.ql-direction-rtl) {
+ padding-left: 2em;
+}
+
+.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right {
+ padding-right: 1.5em;
+}
+
+.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right {
+ padding-right: 2em;
+}
+
+.ql-editor .ql-indent-2:not(.ql-direction-rtl) {
+ padding-left: 3em;
+}
+
+.ql-editor li.ql-indent-2:not(.ql-direction-rtl) {
+ padding-left: 3.5em;
+}
+
+.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right {
+ padding-right: 3em;
+}
+
+.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right {
+ padding-right: 3.5em;
+}
+
+.ql-editor .ql-indent-3:not(.ql-direction-rtl) {
+ padding-left: 4.5em;
+}
+
+.ql-editor li.ql-indent-3:not(.ql-direction-rtl) {
+ padding-left: 5em;
+}
+
+.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right {
+ padding-right: 4.5em;
+}
+
+.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right {
+ padding-right: 5em;
+}
+
+.ql-editor .ql-indent-4:not(.ql-direction-rtl) {
+ padding-left: 6em;
+}
+
+.ql-editor li.ql-indent-4:not(.ql-direction-rtl) {
+ padding-left: 6.5em;
+}
+
+.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right {
+ padding-right: 6em;
+}
+
+.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right {
+ padding-right: 6.5em;
+}
+
+.ql-editor .ql-indent-5:not(.ql-direction-rtl) {
+ padding-left: 7.5em;
+}
+
+.ql-editor li.ql-indent-5:not(.ql-direction-rtl) {
+ padding-left: 8em;
+}
+
+.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right {
+ padding-right: 7.5em;
+}
+
+.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right {
+ padding-right: 8em;
+}
+
+.ql-editor .ql-indent-6:not(.ql-direction-rtl) {
+ padding-left: 9em;
+}
+
+.ql-editor li.ql-indent-6:not(.ql-direction-rtl) {
+ padding-left: 9.5em;
+}
+
+.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right {
+ padding-right: 9em;
+}
+
+.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right {
+ padding-right: 9.5em;
+}
+
+.ql-editor .ql-indent-7:not(.ql-direction-rtl) {
+ padding-left: 10.5em;
+}
+
+.ql-editor li.ql-indent-7:not(.ql-direction-rtl) {
+ padding-left: 11em;
+}
+
+.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right {
+ padding-right: 10.5em;
+}
+
+.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right {
+ padding-right: 11em;
+}
+
+.ql-editor .ql-indent-8:not(.ql-direction-rtl) {
+ padding-left: 12em;
+}
+
+.ql-editor li.ql-indent-8:not(.ql-direction-rtl) {
+ padding-left: 12.5em;
+}
+
+.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right {
+ padding-right: 12em;
+}
+
+.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right {
+ padding-right: 12.5em;
+}
+
+.ql-editor .ql-indent-9:not(.ql-direction-rtl) {
+ padding-left: 13.5em;
+}
+
+.ql-editor li.ql-indent-9:not(.ql-direction-rtl) {
+ padding-left: 14em;
+}
+
+.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right {
+ padding-right: 13.5em;
+}
+
+.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right {
+ padding-right: 14em;
+}
+
+.ql-editor .ql-video {
+ display: block;
+ max-width: 100%;
+}
+
+.ql-editor .ql-video.ql-align-center {
+ margin: 0 auto;
+}
+
+.ql-editor .ql-video.ql-align-right {
+ margin: 0 0 0 auto;
+}
+
+.ql-editor .ql-bg-black {
+ background-color: #000;
+}
+
+.ql-editor .ql-bg-red {
+ background-color: #e60000;
+}
+
+.ql-editor .ql-bg-orange {
+ background-color: #f90;
+}
+
+.ql-editor .ql-bg-yellow {
+ background-color: #ff0;
+}
+
+.ql-editor .ql-bg-green {
+ background-color: #008a00;
+}
+
+.ql-editor .ql-bg-blue {
+ background-color: #06c;
+}
+
+.ql-editor .ql-bg-purple {
+ background-color: #93f;
+}
+
+.ql-editor .ql-color-white {
+ color: #fff;
+}
+
+.ql-editor .ql-color-red {
+ color: #e60000;
+}
+
+.ql-editor .ql-color-orange {
+ color: #f90;
+}
+
+.ql-editor .ql-color-yellow {
+ color: #ff0;
+}
+
+.ql-editor .ql-color-green {
+ color: #008a00;
+}
+
+.ql-editor .ql-color-blue {
+ color: #06c;
+}
+
+.ql-editor .ql-color-purple {
+ color: #93f;
+}
+
+.ql-editor .ql-font-serif {
+ font-family: Georgia, Times New Roman, serif;
+}
+
+.ql-editor .ql-font-monospace {
+ font-family: Monaco, Courier New, monospace;
+}
+
+.ql-editor .ql-size-small {
+ font-size: 0.75em;
+}
+
+.ql-editor .ql-size-large {
+ font-size: 1.5em;
+}
+
+.ql-editor .ql-size-huge {
+ font-size: 2.5em;
+}
+
+.ql-editor .ql-direction-rtl {
+ direction: rtl;
+ text-align: inherit;
+}
+
+.ql-editor .ql-align-center {
+ text-align: center;
+}
+
+.ql-editor .ql-align-justify {
+ text-align: justify;
+}
+
+.ql-editor .ql-align-right {
+ text-align: right;
+}
+
+.ql-editor.ql-blank::before {
+
+ content: attr(data-placeholder);
+ left: 12px;
+ pointer-events: none;
+ position: absolute;
+ right: 12px;
+}
+
+.ql-snow.ql-toolbar:after,
+.ql-snow .ql-toolbar:after {
+ clear: both;
+ content: '';
+ display: table;
+}
+
+.ql-snow.ql-toolbar button,
+.ql-snow .ql-toolbar button {
+ background: none;
+ border: none;
+ cursor: pointer;
+ display: inline-block;
+ float: left;
+ height: 32px;
+ padding: 5px 15px;
+ width: 36px;
+}
+
+.ql-snow.ql-toolbar button svg,
+.ql-snow .ql-toolbar button svg {
+ float: left;
+ height: 100%;
+}
+
+.ql-snow.ql-toolbar button:active:hover,
+.ql-snow .ql-toolbar button:active:hover {
+ outline: none;
+}
+
+.ql-snow.ql-toolbar input.ql-image[type='file'],
+.ql-snow .ql-toolbar input.ql-image[type='file'] {
+ display: none;
+}
+
+.ql-snow {
+ box-sizing: border-box;
+ justify-content: center;
+ flex-direction: column;
+}
+
+.ql-snow * {
+ box-sizing: border-box;
+}
+
+.ql-snow .ql-hidden {
+ display: none;
+}
+
+.ql-snow .ql-out-bottom,
+.ql-snow .ql-out-top {
+ visibility: hidden;
+}
+
+.ql-snow .ql-tooltip {
+ position: absolute;
+ border-radius: 5px;
+}
+
+.ql-snow .ql-tooltip a {
+ cursor: pointer;
+ text-decoration: none;
+}
+
+.ql-snow .ql-tooltip.ql-flip {
+ transform: translateY(-10px);
+}
+
+.ql-snow .ql-formats {
+ display: inline-block;
+ vertical-align: middle;
+}
+
+.ql-snow .ql-formats:after {
+ clear: both;
+ content: '';
+ display: table;
+}
+
+
+.ql-snow .ql-empty {
+ fill: none;
+}
+
+.ql-snow .ql-even {
+ fill-rule: evenodd;
+}
+
+.ql-snow .ql-thin,
+.ql-snow .ql-stroke.ql-thin {
+ stroke-width: 1;
+}
+
+.ql-snow .ql-transparent {
+ opacity: 0.4;
+}
+
+.ql-snow .ql-direction svg:last-child {
+ display: none;
+}
+
+.ql-snow .ql-direction.ql-active svg:last-child {
+ display: inline;
+}
+
+.ql-snow .ql-direction.ql-active svg:first-child {
+ display: none;
+}
+
+.ql-snow .ql-editor h1 {
+ font-size: 2em;
+ font-family: 'DM Serif Text', sans-serif;
+ font-weight: 400 !important;
+}
+
+.ql-snow .ql-editor h2 {
+ font-size: 1.5em;
+ font-family: 'DM Serif Text', sans-serif;
+ font-weight: 400 !important;
+}
+
+.ql-snow .ql-editor h3 {
+ font-size: 1.17em;
+ font-family: 'DM Serif Text', sans-serif;
+ font-weight: 400 !important;
+}
+
+.ql-snow .ql-editor h4 {
+ font-size: 1em;
+ font-family: 'DM Serif Text', sans-serif;
+ font-weight: 400 !important;
+}
+
+.ql-snow .ql-editor h5 {
+ font-size: 0.83em;
+ font-family: 'DM Serif Text', sans-serif;
+ font-weight: 400 !important;
+}
+
+.ql-snow .ql-editor h6 {
+ font-size: 0.67em;
+ font-family: 'DM Serif Text', sans-serif;
+ font-weight: 400 !important;
+}
+
+.ql-snow .ql-editor a {
+ text-decoration: underline;
+}
+
+.ql-snow .ql-editor pre {
+ white-space: pre-wrap;
+ margin-bottom: 5px;
+ margin-top: 5px;
+ padding: 5px 10px;
+}
+
+.ql-snow .ql-editor code {
+ font-size: 85%;
+ padding: 2px 4px;
+}
+
+.ql-snow .ql-editor img {
+ max-width: 100%;
+}
+
+.ql-snow .ql-picker-label {
+ cursor: pointer;
+ display: inline-block;
+ height: 100%;
+ padding-left: 8px;
+ padding-right: 2px;
+
+ position: relative;
+ width: 110%;
+}
+
+.ql-snow .ql-picker-label::before {
+ display: inline-block;
+ line-height: 22px;
+}
+
+.ql-snow .ql-picker-options .ql-picker-item {
+ cursor: pointer;
+ display: block;
+ padding-bottom: 5px;
+ padding-top: 5px;
+}
+
+.ql-snow .ql-picker.ql-expanded .ql-picker-options {
+ display: block;
+ margin-top: -1px;
+ top: 100%;
+ z-index: 1;
+}
+
+.ql-snow .ql-color-picker,
+.ql-snow .ql-icon-picker {
+ width: 30px;
+}
+
+.ql-snow .ql-color-picker .ql-picker-label,
+.ql-snow .ql-icon-picker .ql-picker-label {
+ padding: 2px 4px;
+}
+
+.ql-snow .ql-color-picker .ql-picker-label svg,
+.ql-snow .ql-icon-picker .ql-picker-label svg {
+ right: 4px;
+}
+
+.ql-snow .ql-icon-picker .ql-picker-options {
+ padding: 4px 0px;
+}
+
+.ql-snow .ql-icon-picker .ql-picker-item {
+ height: 30px;
+ width: 30px;
+ padding: 2px 4px;
+}
+
+.ql-snow .ql-color-picker .ql-picker-options {
+ padding: 3px 5px;
+ width: 194px;
+}
+
+.ql-snow .ql-color-picker .ql-picker-item {
+ border: 1px solid transparent;
+ float: left;
+ height: 20px;
+ margin: 3px;
+ padding: 0px;
+ width: 20px;
+}
+
+.ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg {
+ position: absolute;
+ margin-top: -9px;
+ right: 0;
+ top: 50%;
+ width: 20px;
+}
+
+.ql-snow .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before,
+.ql-snow .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before,
+.ql-snow .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before,
+.ql-snow .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before,
+.ql-snow .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before,
+.ql-snow .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before {
+ content: attr(data-label);
+}
+
+.ql-snow .ql-picker.ql-header {
+ width: 98px;
+}
+
+.ql-snow .ql-picker.ql-header .ql-picker-label::before,
+.ql-snow .ql-picker.ql-header .ql-picker-item::before {
+ content: 'Normal';
+}
+
+.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='1']::before,
+.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='1']::before {
+ content: 'Heading 1';
+}
+
+.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='2']::before,
+.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='2']::before {
+ content: 'Heading 2';
+}
+
+.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='3']::before,
+.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='3']::before {
+ content: 'Heading 3';
+}
+
+.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='4']::before,
+.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='4']::before {
+ content: 'Heading 4';
+}
+
+.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='5']::before,
+.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='5']::before {
+ content: 'Heading 5';
+}
+
+.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='6']::before,
+.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='6']::before {
+ content: 'Heading 6';
+}
+
+.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='1']::before {
+ font-size: 2em;
+}
+
+.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='2']::before {
+ font-size: 1.5em;
+}
+
+.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='3']::before {
+ font-size: 1.17em;
+}
+
+.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='4']::before {
+ font-size: 1em;
+}
+
+.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='5']::before {
+ font-size: 0.83em;
+}
+
+.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='6']::before {
+ font-size: 0.67em;
+}
+
+.ql-snow .ql-picker.ql-font {
+ width: 108px;
+}
+
+.ql-snow .ql-picker.ql-font .ql-picker-label::before,
+.ql-snow .ql-picker.ql-font .ql-picker-item::before {
+ content: 'Sans Serif';
+}
+
+.ql-snow .ql-picker.ql-font .ql-picker-label[data-value='serif']::before,
+.ql-snow .ql-picker.ql-font .ql-picker-item[data-value='serif']::before {
+ content: 'Serif';
+}
+
+.ql-snow .ql-picker.ql-font .ql-picker-label[data-value='monospace']::before,
+.ql-snow .ql-picker.ql-font .ql-picker-item[data-value='monospace']::before {
+ content: 'Monospace';
+}
+
+.ql-snow .ql-picker.ql-font .ql-picker-item[data-value='serif']::before {
+ font-family: Georgia, Times New Roman, serif;
+}
+
+.ql-snow .ql-picker.ql-font .ql-picker-item[data-value='monospace']::before {
+ font-family: Monaco, Courier New, monospace;
+}
+
+.ql-snow .ql-picker.ql-size {
+ width: 98px;
+}
+
+.ql-snow .ql-picker.ql-size .ql-picker-label::before,
+.ql-snow .ql-picker.ql-size .ql-picker-item::before {
+ content: 'Normal';
+}
+
+.ql-snow .ql-picker.ql-size .ql-picker-label[data-value='small']::before,
+.ql-snow .ql-picker.ql-size .ql-picker-item[data-value='small']::before {
+ content: 'Small';
+}
+
+.ql-snow .ql-picker.ql-size .ql-picker-label[data-value='large']::before,
+.ql-snow .ql-picker.ql-size .ql-picker-item[data-value='large']::before {
+ content: 'Large';
+}
+
+.ql-snow .ql-picker.ql-size .ql-picker-label[data-value='huge']::before,
+.ql-snow .ql-picker.ql-size .ql-picker-item[data-value='huge']::before {
+ content: 'Huge';
+}
+
+.ql-snow .ql-picker.ql-size .ql-picker-item[data-value='small']::before {
+ font-size: 10px;
+}
+
+.ql-snow .ql-picker.ql-size .ql-picker-item[data-value='large']::before {
+ font-size: 18px;
+}
+
+.ql-snow .ql-picker.ql-size .ql-picker-item[data-value='huge']::before {
+ font-size: 32px;
+}
+
+.ql-toolbar.ql-snow {
+ box-sizing: border-box;
+ font-family: 'Noto Sans', sans-serif;
+ padding: 8px;
+}
+
+.ql-toolbar.ql-snow .ql-formats {
+ margin-right: 15px;
+}
+
+.ql-toolbar.ql-snow .ql-picker-label {
+ border: 1px solid transparent;
+}
+
+.ql-toolbar.ql-snow+.ql-container.ql-snow {
+ border-top: 0px;
+}
+
+.ql-snow .ql-tooltip::before {
+ content: 'Visit URL:';
+ line-height: 26px;
+ margin-right: 8px;
+}
+
+.ql-snow .ql-tooltip a.ql-preview {
+ display: inline-block;
+ max-width: 200px;
+ overflow-x: hidden;
+ text-overflow: ellipsis;
+ vertical-align: top;
+}
+
+.ql-snow .ql-tooltip a.ql-remove::before {
+ content: 'Remove';
+ margin-left: 8px;
+}
+
+.ql-snow .ql-tooltip a {
+ line-height: 26px;
+}
+
+.ql-snow .ql-tooltip.ql-editing a.ql-preview,
+.ql-snow .ql-tooltip.ql-editing a.ql-remove {
+ display: none;
+}
+
+.ql-snow .ql-tooltip.ql-editing input[type='text'] {
+ display: inline-block;
+}
+
+.ql-snow .ql-tooltip.ql-editing a.ql-action::after {
+ border-right: 0px;
+ content: 'Save';
+ padding-right: 0px;
+}
+
+.ql-snow .ql-tooltip[data-mode='link']::before {
+ content: 'Enter link:';
+}
+
+.ql-snow .ql-tooltip[data-mode='formula']::before {
+ content: 'Enter formula:';
+}
+
+.ql-snow .ql-tooltip[data-mode='video']::before {
+ content: 'Enter video:';
+}
+
+
+
+.ql-snow .ql-picker.ql-expanded .ql-picker-label {
+ color: #f0f0f0;
+ z-index: 2;
+}
+
+.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-fill {
+ fill: #f0f0f0;
+}
+
+.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-stroke {
+ stroke: #f0f0f0;
+}
+
+.ql-snow .ql-color-picker.ql-background .ql-picker-item {
+ background-color: white;
+}
+
+.ql-snow .ql-color-picker.ql-color .ql-picker-item {
+ background-color: white;
+}
+
+.ql-toolbar.ql-snow .ql-picker-options {
+ border: 1px solid transparent;
+ box-shadow: rgba(0, 0, 0, 0.2) 0 2px 8px;
+}
+
+.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label {
+ border-color: #f0f0f0;
+}
+
+.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options {
+ border-color: #f0f0f0;
+}
+
+.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item.ql-selected,
+.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item:hover {
+ border-color: black;
+}
+
+.ql-snow .ql-tooltip {
+ background-color: white;
+ box-shadow: 0px 0px 5px #000;
+ color: gray;
+ padding: 5px 12px;
+ white-space: nowrap;
+ position: absolute;
+ font-size: 12px;
+}
+
+.ql-snow .ql-tooltip a.ql-action::after {
+ border-right: 1px solid black;
+ content: 'Edit';
+ margin-left: 16px;
+ padding-right: 8px;
+}
+
+.ql-snow a {
+ color: blue;
+}
+
+.ql-container.ql-snow {
+ border: 1px solid #f0f0f0;
+}
+
+.ql-toolbar {
+ background-color: white;
+ border-top: 1px solid black
+}
+
+.ql-editor.ql-blank::before {
+ color: black
+}
+
+#formBox {
+ margin-block-end:0px
+}
+
+
+#formBox input {
+ font-family: "DM Serif Text", sans-serif;
+ font-weight: 400 !important;
+ width: 100%;
+ background-color: transparent;
+ border: none;
+ height: 50;
+ outline: none;
+ z-index: 10;
+}
+
+
+#titlebar {
+ background-color: transparent;
+}
+
+.app-body {
+ margin: 0px;
+ overflow: hidden;
+}
+
+.floating-toolbar {
+ position: fixed;
+ bottom: 0;
+ width: 100%;
+ background-color: white;
+}
+
+#editor {
+ border: hidden !important;
+
+}
+
+.info-bar {
+ display: flex;
+ color: gray;
+ font-size: 11px;
+ position: absolute;
+ margin-top: -18px;
+ font-family: 'DM Sans', serif;
+ padding-left: 6px;
+}
+
+#titlebar input:focus {
+ outline: none;
+}
+
+#infowords {
+ margin-right: 5px;
+ margin-left: 5px;
+}
+
+#infodate {
+ margin-right: 5px;
+ margin-left: 5px;
+}
+
+#infosaved {
+ margin-right: 5px;
+ margin-left: 5px;
+}
\ No newline at end of file