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}1zbH-SY=$xv
zGnm%?F?43*O&Za&s-SJ1u#67XF4s`ClzAmF40);yvQ`fGNI*fDJEe
zD+v2cIsD^v;2l3x5wb7Cw1UCSitNm<6}|49-0w@L|K%y^FL$`xcJWEcV~w8YuiAUK
z;uu#@95It3d??JN^sbfk554h|@oi7O@m;QcbLY;Ts{-L4J@jwa-Td#*($7x<-IuRo
z=Sb(a;2fi14=J#%%yn1{r;9tL{t+~>hpOtDdDAvBwoaC_O
zX5~3@(lX+VNwD_IVC{SI3NtL{S^Lq^i3zDm>B(v4Btskmi7+YWJ^{}d#J(jwLl%3)
zyzD=LGjM73OP$?UrK2=YdK++*=1OmieT!XL&Hd8R@bl-~TG0O<%oQ&@jJXhN<+BWh
z(EIX9&ikM2LxElNQ%SFlJNtyK(r&M?Yu4gsui%8Y=*s{20Vr+u8Qk#WSK`LjKoHS<
zO^FuZ4v$&QbBHlSs(JPuqCw3wuR2xD3-~@HOU<)46vb*j65ccWHkSQG!IusIXR3)n
zNdms#Qt}+WhT5m*d6eIy<~7JarRD{^Gd!&3MU=mz<|D~E@@F+4MVz#8VruKw!1!oz
zGO#+ZX==njzEH4`TNfCg7!HnFOI*bZh06k?fpPz2V8GgUrFCNarqapDLF?dnaI3X7
zI64^^83|g)#)F#!{gbYt$;q+GqM|{y+|?i4iZ9uw@KxMatZ*D(#0Bv+TL3ybfG_T*
z@a3Ezr59^)v9fjY7!!!o1~HNq@5@}+&x^HOhL)ppYrj0-09yCqTR1CPZ^z7~D4oO`
zQ7d2^qisd5RUVaLH-amOk}
zX!?T#fr$R#NTGia>xyK#zQAB`JRoPs16zaJ10v{t0+oX!LH}eS!%fYO21f%?N~w&W
zhEcpQIFA215{Dj(0Fia(@@03RNqAZ`0&_d*Zo$(%&}{h?)#sF=aC+Hx(k_PDz-9g9bcG^d`(5-YEy#mbf{{b%pk~IJT
literal 0
HcmV?d00001
diff --git a/public/assets/addons/summernote/font/summernote.woff b/public/assets/addons/summernote/font/summernote.woff
new file mode 100644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n3i}%=6Z2652n&Fi3QqmMcoA(z!
zP>5Id>!^ccnrF}>0>a~Eb02O@AIjTjV5vA`wjm4M!y{AozhtY75H=&xp}nRb)5Zuh
zlRO@Ls+1cPwH&-@>g84zDRNIPV(hCInTQk}z(QJ
zOV|Am2S!LE5~ETguAJ&6B3(7H*8FwD$R2?p#o&Ulx@X0Z(%a^&5{c5Pj&jkF
zw~=04qf(i#z9dpmG)|E7_wZOBPu78fy3}?gb5%gDiH$E&FdNu}rammU+$de_3+qL0hHvXW;0-sm?-rw5=8%qO69v$+J
yUP2gGz@9@MF*@%Gfdm%eJ4yLf4MPpoPb{waRH{B$+{K!W;}^KinuExX9QZ$#0P6_=
literal 0
HcmV?d00001
diff --git a/public/assets/addons/summernote/font/summernote.woff2 b/public/assets/addons/summernote/font/summernote.woff2
new file mode 100644
index 0000000000000000000000000000000000000000..67580535ec6e1760d3c97aafd7d178071994cae2
GIT binary patch
literal 6948
zcmV+<8{6b}Pew8T0RR9102?F#3jhEB05(Jb02CTR?4D9=7IZ5@mr!
zCv?zGprJYQl3c=9A`X}M2Tbk1o@3!&Z!FY|n4S{j`S5mc+x}uoJWK=j__)5*sKn8WN_naLHamxz>)-74FG;Bf77SV^J}eFv1@5jD
z1-S&^frkG7|C*n6-e=7IQnJggyFzVO7oEGgZ|3LC+`Pa~dYb(CkYAp~z|xeLlRc{l
zWC0z!WO2%q6iERq0!JjvvO?F0R%#Z)mj5U2X}Sj97#&4I~h2c9Z&=HGyd$X=VW>
zj*(?Uoc%#$;$-PZJL-RXojx2ZPV^$Rm?Atz#vvk-bbJ|
z#1?qI{zgf-35_6-cFx<F?YNjxS-eG&2Y$XY@t`m059@El$7~KvSd0~uFe;=qs)o~7fT+}sk54tF(I6CN8K2&WF^A-tK6l9y&Y5d#
zA$AhoB#T(3aEY?=C>!t?@c{Z_I@aV(V<1oqRl?kXA^?S+0vltZ^hXD~VEVu@sS)3E
z6dyP{j^YqUw@jvi%#5K@6GKED(aE=_ncItHEe_~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^L
z2@PHs-A@c{cl}`K&Ts6gsQcN>m(AX5q#<34HEWzw7;wV|5&
zea{w^>|_@J`8|LBXL@Zgra}i^8w%H0GW{t~R-(t>3f)DG*Sb3AlmFst-RA`FQI=(w
zvjDXro7&Nf&b~rM-KhQDM_uOrOb^LBU-E69IH|ry=0WW+-QN-2bQPf6?SEKned+ic
zU4Kd^UMA%}v_}UV@5{BL$qfI(momoenO&N|0-)4Qs{xgn9oB7wY*Cud>k9BMu2yTA
zO90(0zx)Xbk!#%nWwVbF01)tVPadgN%x{|&_BsFgf8J~T;{WJS(JIC$i85<9r2~6<
zh7C&_ouxFXjcC=qnU=9IpI=OvqXf@RE0`&SgGS_6Aaj7QF}ZsVS)2$f&ov{2Hc7&wZJwxJ)r)K
z(H(U#t-%_+>yuWyS`XCrPfOTyR2OP*PaE*&{lWzq9<1ShKm7UqIfnk=vF*m8z8~BUeE|sfw&5as^11%64ly
zx@Mmw<|kdLh>`+Yh(N(-F%~JdDBIKXR{C<(Lt8Zp%uqV3t4Ab}DJZCD=opw-
z*f_X&;>1gkh)*Dikf;nKa`MN)f>moPyjpYc!NAl8@Ta;6m9?G2%IfDS)t*Y?mrb%O
z?w3!|=^djW&8u$lD+^PTUvk{YtX8?+GLIs=^l2|bh2Bt&zI<*7-;O;AeF9m{429!{1A@QE9LC)OR!ZS0@q9L+C=x(1KYx
zNgF$mgHwUTp#x>~_3)&1l*J=ZO`NsZ9W7WMvI)4(=b?*D>XCjM&X;pw&gUGJGgo^@
znW+8YLKzQ2NS8r-nKUuIz-fs}p8H>uhu_s*Bvvy~L8rBWkDi8AHt3IG7Y&u}6D
literal 0
HcmV?d00001
diff --git a/public/assets/addons/summernote/js/summernote.js b/public/assets/addons/summernote/js/summernote.js
new file mode 100644
index 0000000..22e37a2
--- /dev/null
+++ b/public/assets/addons/summernote/js/summernote.js
@@ -0,0 +1,10229 @@
+/*!
+ *
+ * Super simple WYSIWYG editor v0.8.20
+ * https://summernote.org
+ *
+ *
+ * Copyright 2013- Alan Hong and contributors
+ * Summernote may be freely distributed under the MIT license.
+ *
+ * Date: 2021-10-14T21:15Z
+ *
+ */
+(function webpackUniversalModuleDefinition(root, factory) {
+ if(typeof exports === 'object' && typeof module === 'object')
+ module.exports = factory(require("jquery"));
+ else if(typeof define === 'function' && define.amd)
+ define(["jquery"], factory);
+ else {
+ var a = typeof exports === 'object' ? factory(require("jquery")) : factory(root["jquery"]);
+ for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
+ }
+})(self, function(__WEBPACK_EXTERNAL_MODULE__1145__) {
+return /******/ (() => { // webpackBootstrap
+/******/ "use strict";
+/******/ var __webpack_modules__ = ({
+
+/***/ 9770:
+/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {
+
+/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1145);
+/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
+
+(jquery__WEBPACK_IMPORTED_MODULE_0___default().summernote) = (jquery__WEBPACK_IMPORTED_MODULE_0___default().summernote) || {
+ lang: {}
+};
+jquery__WEBPACK_IMPORTED_MODULE_0___default().extend((jquery__WEBPACK_IMPORTED_MODULE_0___default().summernote.lang), {
+ 'en-US': {
+ font: {
+ bold: 'Bold',
+ italic: 'Italic',
+ underline: 'Underline',
+ clear: 'Remove Font Style',
+ height: 'Line Height',
+ name: 'Font Family',
+ strikethrough: 'Strikethrough',
+ subscript: 'Subscript',
+ superscript: 'Superscript',
+ size: 'Font Size',
+ sizeunit: 'Font Size Unit'
+ },
+ image: {
+ image: 'Picture',
+ insert: 'Insert Image',
+ resizeFull: 'Resize full',
+ resizeHalf: 'Resize half',
+ resizeQuarter: 'Resize quarter',
+ resizeNone: 'Original size',
+ floatLeft: 'Float Left',
+ floatRight: 'Float Right',
+ floatNone: 'Remove float',
+ shapeRounded: 'Shape: Rounded',
+ shapeCircle: 'Shape: Circle',
+ shapeThumbnail: 'Shape: Thumbnail',
+ shapeNone: 'Shape: None',
+ dragImageHere: 'Drag image or text here',
+ dropImage: 'Drop image or Text',
+ selectFromFiles: 'Select from files',
+ maximumFileSize: 'Maximum file size',
+ maximumFileSizeError: 'Maximum file size exceeded.',
+ url: 'Image URL',
+ remove: 'Remove Image',
+ original: 'Original'
+ },
+ video: {
+ video: 'Video',
+ videoLink: 'Video Link',
+ insert: 'Insert Video',
+ url: 'Video URL',
+ providers: '(YouTube, Google Drive, Vimeo, Vine, Instagram, DailyMotion, Youku, Peertube)'
+ },
+ link: {
+ link: 'Link',
+ insert: 'Insert Link',
+ unlink: 'Unlink',
+ edit: 'Edit',
+ textToDisplay: 'Text to display',
+ url: 'To what URL should this link go?',
+ openInNewWindow: 'Open in new window',
+ useProtocol: 'Use default protocol'
+ },
+ table: {
+ table: 'Table',
+ addRowAbove: 'Add row above',
+ addRowBelow: 'Add row below',
+ addColLeft: 'Add column left',
+ addColRight: 'Add column right',
+ delRow: 'Delete row',
+ delCol: 'Delete column',
+ delTable: 'Delete table'
+ },
+ hr: {
+ insert: 'Insert Horizontal Rule'
+ },
+ style: {
+ style: 'Style',
+ p: 'Normal',
+ blockquote: 'Quote',
+ pre: 'Code',
+ h1: 'Header 1',
+ h2: 'Header 2',
+ h3: 'Header 3',
+ h4: 'Header 4',
+ h5: 'Header 5',
+ h6: 'Header 6'
+ },
+ lists: {
+ unordered: 'Unordered list',
+ ordered: 'Ordered list'
+ },
+ options: {
+ help: 'Help',
+ fullscreen: 'Full Screen',
+ codeview: 'Code View'
+ },
+ paragraph: {
+ paragraph: 'Paragraph',
+ outdent: 'Outdent',
+ indent: 'Indent',
+ left: 'Align left',
+ center: 'Align center',
+ right: 'Align right',
+ justify: 'Justify full'
+ },
+ color: {
+ recent: 'Recent Color',
+ more: 'More Color',
+ background: 'Background Color',
+ foreground: 'Text Color',
+ transparent: 'Transparent',
+ setTransparent: 'Set transparent',
+ reset: 'Reset',
+ resetToDefault: 'Reset to default',
+ cpSelect: 'Select'
+ },
+ shortcut: {
+ shortcuts: 'Keyboard shortcuts',
+ close: 'Close',
+ textFormatting: 'Text formatting',
+ action: 'Action',
+ paragraphFormatting: 'Paragraph formatting',
+ documentStyle: 'Document Style',
+ extraKeys: 'Extra keys'
+ },
+ help: {
+ 'escape': 'Escape',
+ 'insertParagraph': 'Insert Paragraph',
+ 'undo': 'Undo the last command',
+ 'redo': 'Redo the last command',
+ 'tab': 'Tab',
+ 'untab': 'Untab',
+ 'bold': 'Set a bold style',
+ 'italic': 'Set a italic style',
+ 'underline': 'Set a underline style',
+ 'strikethrough': 'Set a strikethrough style',
+ 'removeFormat': 'Clean a style',
+ 'justifyLeft': 'Set left align',
+ 'justifyCenter': 'Set center align',
+ 'justifyRight': 'Set right align',
+ 'justifyFull': 'Set full align',
+ 'insertUnorderedList': 'Toggle unordered list',
+ 'insertOrderedList': 'Toggle ordered list',
+ 'outdent': 'Outdent on current paragraph',
+ 'indent': 'Indent on current paragraph',
+ 'formatPara': 'Change current block\'s format as a paragraph(P tag)',
+ 'formatH1': 'Change current block\'s format as H1',
+ 'formatH2': 'Change current block\'s format as H2',
+ 'formatH3': 'Change current block\'s format as H3',
+ 'formatH4': 'Change current block\'s format as H4',
+ 'formatH5': 'Change current block\'s format as H5',
+ 'formatH6': 'Change current block\'s format as H6',
+ 'insertHorizontalRule': 'Insert horizontal rule',
+ 'linkDialog.show': 'Show Link Dialog'
+ },
+ history: {
+ undo: 'Undo',
+ redo: 'Redo'
+ },
+ specialChar: {
+ specialChar: 'SPECIAL CHARACTERS',
+ select: 'Select Special characters'
+ },
+ output: {
+ noSelection: 'No Selection Made!'
+ }
+ }
+});
+
+/***/ }),
+
+/***/ 1145:
+/***/ ((module) => {
+
+module.exports = __WEBPACK_EXTERNAL_MODULE__1145__;
+
+/***/ })
+
+/******/ });
+/************************************************************************/
+/******/ // The module cache
+/******/ var __webpack_module_cache__ = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/ // Check if module is in cache
+/******/ var cachedModule = __webpack_module_cache__[moduleId];
+/******/ if (cachedModule !== undefined) {
+/******/ return cachedModule.exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = __webpack_module_cache__[moduleId] = {
+/******/ // no module.id needed
+/******/ // no module.loaded needed
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/************************************************************************/
+/******/ /* webpack/runtime/compat get default export */
+/******/ (() => {
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = (module) => {
+/******/ var getter = module && module.__esModule ?
+/******/ () => (module['default']) :
+/******/ () => (module);
+/******/ __webpack_require__.d(getter, { a: getter });
+/******/ return getter;
+/******/ };
+/******/ })();
+/******/
+/******/ /* webpack/runtime/define property getters */
+/******/ (() => {
+/******/ // define getter functions for harmony exports
+/******/ __webpack_require__.d = (exports, definition) => {
+/******/ for(var key in definition) {
+/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
+/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
+/******/ }
+/******/ }
+/******/ };
+/******/ })();
+/******/
+/******/ /* webpack/runtime/hasOwnProperty shorthand */
+/******/ (() => {
+/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
+/******/ })();
+/******/
+/******/ /* webpack/runtime/make namespace object */
+/******/ (() => {
+/******/ // define __esModule on exports
+/******/ __webpack_require__.r = (exports) => {
+/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
+/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
+/******/ }
+/******/ Object.defineProperty(exports, '__esModule', { value: true });
+/******/ };
+/******/ })();
+/******/
+/************************************************************************/
+var __webpack_exports__ = {};
+// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
+(() => {
+// ESM COMPAT FLAG
+__webpack_require__.r(__webpack_exports__);
+
+// EXTERNAL MODULE: external "jQuery"
+var external_jQuery_ = __webpack_require__(1145);
+var external_jQuery_default = /*#__PURE__*/__webpack_require__.n(external_jQuery_);
+// EXTERNAL MODULE: ./src/lang/summernote-en-US.js
+var summernote_en_US = __webpack_require__(9770);
+;// CONCATENATED MODULE: ./src/js/core/env.js
+
+/**
+ * returns whether font is installed or not.
+ *
+ * @param {String} fontName
+ * @return {Boolean}
+ */
+
+var genericFontFamilies = ['sans-serif', 'serif', 'monospace', 'cursive', 'fantasy'];
+
+function validFontName(fontName) {
+ return external_jQuery_default().inArray(fontName.toLowerCase(), genericFontFamilies) === -1 ? "'".concat(fontName, "'") : fontName;
+}
+
+function isFontInstalled(fontName) {
+ var testFontName = fontName === 'Comic Sans MS' ? 'Courier New' : 'Comic Sans MS';
+ var testText = 'mmmmmmmmmmwwwww';
+ var testSize = '200px';
+ var canvas = document.createElement('canvas');
+ var context = canvas.getContext('2d');
+ context.font = testSize + " '" + testFontName + "'";
+ var originalWidth = context.measureText(testText).width;
+ context.font = testSize + ' ' + validFontName(fontName) + ', "' + testFontName + '"';
+ var width = context.measureText(testText).width;
+ return originalWidth !== width;
+}
+
+var userAgent = navigator.userAgent;
+var isMSIE = /MSIE|Trident/i.test(userAgent);
+var browserVersion;
+
+if (isMSIE) {
+ var matches = /MSIE (\d+[.]\d+)/.exec(userAgent);
+
+ if (matches) {
+ browserVersion = parseFloat(matches[1]);
+ }
+
+ matches = /Trident\/.*rv:([0-9]{1,}[.0-9]{0,})/.exec(userAgent);
+
+ if (matches) {
+ browserVersion = parseFloat(matches[1]);
+ }
+}
+
+var isEdge = /Edge\/\d+/.test(userAgent);
+var isSupportTouch = 'ontouchstart' in window || navigator.MaxTouchPoints > 0 || navigator.msMaxTouchPoints > 0; // [workaround] IE doesn't have input events for contentEditable
+// - see: https://goo.gl/4bfIvA
+
+var inputEventName = isMSIE ? 'DOMCharacterDataModified DOMSubtreeModified DOMNodeInserted' : 'input';
+/**
+ * @class core.env
+ *
+ * Object which check platform and agent
+ *
+ * @singleton
+ * @alternateClassName env
+ */
+
+/* harmony default export */ const env = ({
+ isMac: navigator.appVersion.indexOf('Mac') > -1,
+ isMSIE: isMSIE,
+ isEdge: isEdge,
+ isFF: !isEdge && /firefox/i.test(userAgent),
+ isPhantom: /PhantomJS/i.test(userAgent),
+ isWebkit: !isEdge && /webkit/i.test(userAgent),
+ isChrome: !isEdge && /chrome/i.test(userAgent),
+ isSafari: !isEdge && /safari/i.test(userAgent) && !/chrome/i.test(userAgent),
+ browserVersion: browserVersion,
+ isSupportTouch: isSupportTouch,
+ isFontInstalled: isFontInstalled,
+ isW3CRangeSupport: !!document.createRange,
+ inputEventName: inputEventName,
+ genericFontFamilies: genericFontFamilies,
+ validFontName: validFontName
+});
+;// CONCATENATED MODULE: ./src/js/core/func.js
+
+/**
+ * @class core.func
+ *
+ * func utils (for high-order func's arg)
+ *
+ * @singleton
+ * @alternateClassName func
+ */
+
+function eq(itemA) {
+ return function (itemB) {
+ return itemA === itemB;
+ };
+}
+
+function eq2(itemA, itemB) {
+ return itemA === itemB;
+}
+
+function peq2(propName) {
+ return function (itemA, itemB) {
+ return itemA[propName] === itemB[propName];
+ };
+}
+
+function ok() {
+ return true;
+}
+
+function fail() {
+ return false;
+}
+
+function not(f) {
+ return function () {
+ return !f.apply(f, arguments);
+ };
+}
+
+function and(fA, fB) {
+ return function (item) {
+ return fA(item) && fB(item);
+ };
+}
+
+function func_self(a) {
+ return a;
+}
+
+function invoke(obj, method) {
+ return function () {
+ return obj[method].apply(obj, arguments);
+ };
+}
+
+var idCounter = 0;
+/**
+ * reset globally-unique id
+ *
+ */
+
+function resetUniqueId() {
+ idCounter = 0;
+}
+/**
+ * generate a globally-unique id
+ *
+ * @param {String} [prefix]
+ */
+
+
+function uniqueId(prefix) {
+ var id = ++idCounter + '';
+ return prefix ? prefix + id : id;
+}
+/**
+ * returns bnd (bounds) from rect
+ *
+ * - IE Compatibility Issue: http://goo.gl/sRLOAo
+ * - Scroll Issue: http://goo.gl/sNjUc
+ *
+ * @param {Rect} rect
+ * @return {Object} bounds
+ * @return {Number} bounds.top
+ * @return {Number} bounds.left
+ * @return {Number} bounds.width
+ * @return {Number} bounds.height
+ */
+
+
+function rect2bnd(rect) {
+ var $document = external_jQuery_default()(document);
+ return {
+ top: rect.top + $document.scrollTop(),
+ left: rect.left + $document.scrollLeft(),
+ width: rect.right - rect.left,
+ height: rect.bottom - rect.top
+ };
+}
+/**
+ * returns a copy of the object where the keys have become the values and the values the keys.
+ * @param {Object} obj
+ * @return {Object}
+ */
+
+
+function invertObject(obj) {
+ var inverted = {};
+
+ for (var key in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
+ inverted[obj[key]] = key;
+ }
+ }
+
+ return inverted;
+}
+/**
+ * @param {String} namespace
+ * @param {String} [prefix]
+ * @return {String}
+ */
+
+
+function namespaceToCamel(namespace, prefix) {
+ prefix = prefix || '';
+ return prefix + namespace.split('.').map(function (name) {
+ return name.substring(0, 1).toUpperCase() + name.substring(1);
+ }).join('');
+}
+/**
+ * Returns a function, that, as long as it continues to be invoked, will not
+ * be triggered. The function will be called after it stops being called for
+ * N milliseconds. If `immediate` is passed, trigger the function on the
+ * leading edge, instead of the trailing.
+ * @param {Function} func
+ * @param {Number} wait
+ * @param {Boolean} immediate
+ * @return {Function}
+ */
+
+
+function debounce(func, wait, immediate) {
+ var timeout;
+ return function () {
+ var context = this;
+ var args = arguments;
+
+ var later = function later() {
+ timeout = null;
+
+ if (!immediate) {
+ func.apply(context, args);
+ }
+ };
+
+ var callNow = immediate && !timeout;
+ clearTimeout(timeout);
+ timeout = setTimeout(later, wait);
+
+ if (callNow) {
+ func.apply(context, args);
+ }
+ };
+}
+/**
+ *
+ * @param {String} url
+ * @return {Boolean}
+ */
+
+
+function isValidUrl(url) {
+ var expression = /[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/gi;
+ return expression.test(url);
+}
+
+/* harmony default export */ const func = ({
+ eq: eq,
+ eq2: eq2,
+ peq2: peq2,
+ ok: ok,
+ fail: fail,
+ self: func_self,
+ not: not,
+ and: and,
+ invoke: invoke,
+ resetUniqueId: resetUniqueId,
+ uniqueId: uniqueId,
+ rect2bnd: rect2bnd,
+ invertObject: invertObject,
+ namespaceToCamel: namespaceToCamel,
+ debounce: debounce,
+ isValidUrl: isValidUrl
+});
+;// CONCATENATED MODULE: ./src/js/core/lists.js
+
+/**
+ * returns the first item of an array.
+ *
+ * @param {Array} array
+ */
+
+function head(array) {
+ return array[0];
+}
+/**
+ * returns the last item of an array.
+ *
+ * @param {Array} array
+ */
+
+
+function last(array) {
+ return array[array.length - 1];
+}
+/**
+ * returns everything but the last entry of the array.
+ *
+ * @param {Array} array
+ */
+
+
+function initial(array) {
+ return array.slice(0, array.length - 1);
+}
+/**
+ * returns the rest of the items in an array.
+ *
+ * @param {Array} array
+ */
+
+
+function tail(array) {
+ return array.slice(1);
+}
+/**
+ * returns item of array
+ */
+
+
+function find(array, pred) {
+ for (var idx = 0, len = array.length; idx < len; idx++) {
+ var item = array[idx];
+
+ if (pred(item)) {
+ return item;
+ }
+ }
+}
+/**
+ * returns true if all of the values in the array pass the predicate truth test.
+ */
+
+
+function lists_all(array, pred) {
+ for (var idx = 0, len = array.length; idx < len; idx++) {
+ if (!pred(array[idx])) {
+ return false;
+ }
+ }
+
+ return true;
+}
+/**
+ * returns true if the value is present in the list.
+ */
+
+
+function contains(array, item) {
+ if (array && array.length && item) {
+ if (array.indexOf) {
+ return array.indexOf(item) !== -1;
+ } else if (array.contains) {
+ // `DOMTokenList` doesn't implement `.indexOf`, but it implements `.contains`
+ return array.contains(item);
+ }
+ }
+
+ return false;
+}
+/**
+ * get sum from a list
+ *
+ * @param {Array} array - array
+ * @param {Function} fn - iterator
+ */
+
+
+function sum(array, fn) {
+ fn = fn || func.self;
+ return array.reduce(function (memo, v) {
+ return memo + fn(v);
+ }, 0);
+}
+/**
+ * returns a copy of the collection with array type.
+ * @param {Collection} collection - collection eg) node.childNodes, ...
+ */
+
+
+function from(collection) {
+ var result = [];
+ var length = collection.length;
+ var idx = -1;
+
+ while (++idx < length) {
+ result[idx] = collection[idx];
+ }
+
+ return result;
+}
+/**
+ * returns whether list is empty or not
+ */
+
+
+function isEmpty(array) {
+ return !array || !array.length;
+}
+/**
+ * cluster elements by predicate function.
+ *
+ * @param {Array} array - array
+ * @param {Function} fn - predicate function for cluster rule
+ * @param {Array[]}
+ */
+
+
+function clusterBy(array, fn) {
+ if (!array.length) {
+ return [];
+ }
+
+ var aTail = tail(array);
+ return aTail.reduce(function (memo, v) {
+ var aLast = last(memo);
+
+ if (fn(last(aLast), v)) {
+ aLast[aLast.length] = v;
+ } else {
+ memo[memo.length] = [v];
+ }
+
+ return memo;
+ }, [[head(array)]]);
+}
+/**
+ * returns a copy of the array with all false values removed
+ *
+ * @param {Array} array - array
+ * @param {Function} fn - predicate function for cluster rule
+ */
+
+
+function compact(array) {
+ var aResult = [];
+
+ for (var idx = 0, len = array.length; idx < len; idx++) {
+ if (array[idx]) {
+ aResult.push(array[idx]);
+ }
+ }
+
+ return aResult;
+}
+/**
+ * produces a duplicate-free version of the array
+ *
+ * @param {Array} array
+ */
+
+
+function unique(array) {
+ var results = [];
+
+ for (var idx = 0, len = array.length; idx < len; idx++) {
+ if (!contains(results, array[idx])) {
+ results.push(array[idx]);
+ }
+ }
+
+ return results;
+}
+/**
+ * returns next item.
+ * @param {Array} array
+ */
+
+
+function next(array, item) {
+ if (array && array.length && item) {
+ var idx = array.indexOf(item);
+ return idx === -1 ? null : array[idx + 1];
+ }
+
+ return null;
+}
+/**
+ * returns prev item.
+ * @param {Array} array
+ */
+
+
+function prev(array, item) {
+ if (array && array.length && item) {
+ var idx = array.indexOf(item);
+ return idx === -1 ? null : array[idx - 1];
+ }
+
+ return null;
+}
+/**
+ * @class core.list
+ *
+ * list utils
+ *
+ * @singleton
+ * @alternateClassName list
+ */
+
+
+/* harmony default export */ const lists = ({
+ head: head,
+ last: last,
+ initial: initial,
+ tail: tail,
+ prev: prev,
+ next: next,
+ find: find,
+ contains: contains,
+ all: lists_all,
+ sum: sum,
+ from: from,
+ isEmpty: isEmpty,
+ clusterBy: clusterBy,
+ compact: compact,
+ unique: unique
+});
+;// CONCATENATED MODULE: ./src/js/core/dom.js
+
+
+
+
+var NBSP_CHAR = String.fromCharCode(160);
+var ZERO_WIDTH_NBSP_CHAR = "\uFEFF";
+/**
+ * @method isEditable
+ *
+ * returns whether node is `note-editable` or not.
+ *
+ * @param {Node} node
+ * @return {Boolean}
+ */
+
+function isEditable(node) {
+ return node && external_jQuery_default()(node).hasClass('note-editable');
+}
+/**
+ * @method isControlSizing
+ *
+ * returns whether node is `note-control-sizing` or not.
+ *
+ * @param {Node} node
+ * @return {Boolean}
+ */
+
+
+function isControlSizing(node) {
+ return node && external_jQuery_default()(node).hasClass('note-control-sizing');
+}
+/**
+ * @method makePredByNodeName
+ *
+ * returns predicate which judge whether nodeName is same
+ *
+ * @param {String} nodeName
+ * @return {Function}
+ */
+
+
+function makePredByNodeName(nodeName) {
+ nodeName = nodeName.toUpperCase();
+ return function (node) {
+ return node && node.nodeName.toUpperCase() === nodeName;
+ };
+}
+/**
+ * @method isText
+ *
+ *
+ *
+ * @param {Node} node
+ * @return {Boolean} true if node's type is text(3)
+ */
+
+
+function isText(node) {
+ return node && node.nodeType === 3;
+}
+/**
+ * @method isElement
+ *
+ *
+ *
+ * @param {Node} node
+ * @return {Boolean} true if node's type is element(1)
+ */
+
+
+function isElement(node) {
+ return node && node.nodeType === 1;
+}
+/**
+ * ex) br, col, embed, hr, img, input, ...
+ * @see http://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements
+ */
+
+
+function isVoid(node) {
+ return node && /^BR|^IMG|^HR|^IFRAME|^BUTTON|^INPUT|^AUDIO|^VIDEO|^EMBED/.test(node.nodeName.toUpperCase());
+}
+
+function isPara(node) {
+ if (isEditable(node)) {
+ return false;
+ } // Chrome(v31.0), FF(v25.0.1) use DIV for paragraph
+
+
+ return node && /^DIV|^P|^LI|^H[1-7]/.test(node.nodeName.toUpperCase());
+}
+
+function isHeading(node) {
+ return node && /^H[1-7]/.test(node.nodeName.toUpperCase());
+}
+
+var isPre = makePredByNodeName('PRE');
+var isLi = makePredByNodeName('LI');
+
+function isPurePara(node) {
+ return isPara(node) && !isLi(node);
+}
+
+var isTable = makePredByNodeName('TABLE');
+var isData = makePredByNodeName('DATA');
+
+function isInline(node) {
+ return !isBodyContainer(node) && !isList(node) && !isHr(node) && !isPara(node) && !isTable(node) && !isBlockquote(node) && !isData(node);
+}
+
+function isList(node) {
+ return node && /^UL|^OL/.test(node.nodeName.toUpperCase());
+}
+
+var isHr = makePredByNodeName('HR');
+
+function isCell(node) {
+ return node && /^TD|^TH/.test(node.nodeName.toUpperCase());
+}
+
+var isBlockquote = makePredByNodeName('BLOCKQUOTE');
+
+function isBodyContainer(node) {
+ return isCell(node) || isBlockquote(node) || isEditable(node);
+}
+
+var isAnchor = makePredByNodeName('A');
+
+function isParaInline(node) {
+ return isInline(node) && !!ancestor(node, isPara);
+}
+
+function isBodyInline(node) {
+ return isInline(node) && !ancestor(node, isPara);
+}
+
+var isBody = makePredByNodeName('BODY');
+/**
+ * returns whether nodeB is closest sibling of nodeA
+ *
+ * @param {Node} nodeA
+ * @param {Node} nodeB
+ * @return {Boolean}
+ */
+
+function isClosestSibling(nodeA, nodeB) {
+ return nodeA.nextSibling === nodeB || nodeA.previousSibling === nodeB;
+}
+/**
+ * returns array of closest siblings with node
+ *
+ * @param {Node} node
+ * @param {function} [pred] - predicate function
+ * @return {Node[]}
+ */
+
+
+function withClosestSiblings(node, pred) {
+ pred = pred || func.ok;
+ var siblings = [];
+
+ if (node.previousSibling && pred(node.previousSibling)) {
+ siblings.push(node.previousSibling);
+ }
+
+ siblings.push(node);
+
+ if (node.nextSibling && pred(node.nextSibling)) {
+ siblings.push(node.nextSibling);
+ }
+
+ return siblings;
+}
+/**
+ * blank HTML for cursor position
+ * - [workaround] old IE only works with
+ * - [workaround] IE11 and other browser works with bogus br
+ */
+
+
+var blankHTML = env.isMSIE && env.browserVersion < 11 ? ' ' : '
';
+/**
+ * @method nodeLength
+ *
+ * returns #text's text size or element's childNodes size
+ *
+ * @param {Node} node
+ */
+
+function nodeLength(node) {
+ if (isText(node)) {
+ return node.nodeValue.length;
+ }
+
+ if (node) {
+ return node.childNodes.length;
+ }
+
+ return 0;
+}
+/**
+ * returns whether deepest child node is empty or not.
+ *
+ * @param {Node} node
+ * @return {Boolean}
+ */
+
+
+function deepestChildIsEmpty(node) {
+ do {
+ if (node.firstElementChild === null || node.firstElementChild.innerHTML === '') break;
+ } while (node = node.firstElementChild);
+
+ return dom_isEmpty(node);
+}
+/**
+ * returns whether node is empty or not.
+ *
+ * @param {Node} node
+ * @return {Boolean}
+ */
+
+
+function dom_isEmpty(node) {
+ var len = nodeLength(node);
+
+ if (len === 0) {
+ return true;
+ } else if (!isText(node) && len === 1 && node.innerHTML === blankHTML) {
+ // ex)
,
+ return true;
+ } else if (lists.all(node.childNodes, isText) && node.innerHTML === '') {
+ // ex) ,
+ return true;
+ }
+
+ return false;
+}
+/**
+ * padding blankHTML if node is empty (for cursor position)
+ */
+
+
+function paddingBlankHTML(node) {
+ if (!isVoid(node) && !nodeLength(node)) {
+ node.innerHTML = blankHTML;
+ }
+}
+/**
+ * find nearest ancestor predicate hit
+ *
+ * @param {Node} node
+ * @param {Function} pred - predicate function
+ */
+
+
+function ancestor(node, pred) {
+ while (node) {
+ if (pred(node)) {
+ return node;
+ }
+
+ if (isEditable(node)) {
+ break;
+ }
+
+ node = node.parentNode;
+ }
+
+ return null;
+}
+/**
+ * find nearest ancestor only single child blood line and predicate hit
+ *
+ * @param {Node} node
+ * @param {Function} pred - predicate function
+ */
+
+
+function singleChildAncestor(node, pred) {
+ node = node.parentNode;
+
+ while (node) {
+ if (nodeLength(node) !== 1) {
+ break;
+ }
+
+ if (pred(node)) {
+ return node;
+ }
+
+ if (isEditable(node)) {
+ break;
+ }
+
+ node = node.parentNode;
+ }
+
+ return null;
+}
+/**
+ * returns new array of ancestor nodes (until predicate hit).
+ *
+ * @param {Node} node
+ * @param {Function} [optional] pred - predicate function
+ */
+
+
+function listAncestor(node, pred) {
+ pred = pred || func.fail;
+ var ancestors = [];
+ ancestor(node, function (el) {
+ if (!isEditable(el)) {
+ ancestors.push(el);
+ }
+
+ return pred(el);
+ });
+ return ancestors;
+}
+/**
+ * find farthest ancestor predicate hit
+ */
+
+
+function lastAncestor(node, pred) {
+ var ancestors = listAncestor(node);
+ return lists.last(ancestors.filter(pred));
+}
+/**
+ * returns common ancestor node between two nodes.
+ *
+ * @param {Node} nodeA
+ * @param {Node} nodeB
+ */
+
+
+function commonAncestor(nodeA, nodeB) {
+ var ancestors = listAncestor(nodeA);
+
+ for (var n = nodeB; n; n = n.parentNode) {
+ if (ancestors.indexOf(n) > -1) return n;
+ }
+
+ return null; // difference document area
+}
+/**
+ * listing all previous siblings (until predicate hit).
+ *
+ * @param {Node} node
+ * @param {Function} [optional] pred - predicate function
+ */
+
+
+function listPrev(node, pred) {
+ pred = pred || func.fail;
+ var nodes = [];
+
+ while (node) {
+ if (pred(node)) {
+ break;
+ }
+
+ nodes.push(node);
+ node = node.previousSibling;
+ }
+
+ return nodes;
+}
+/**
+ * listing next siblings (until predicate hit).
+ *
+ * @param {Node} node
+ * @param {Function} [pred] - predicate function
+ */
+
+
+function listNext(node, pred) {
+ pred = pred || func.fail;
+ var nodes = [];
+
+ while (node) {
+ if (pred(node)) {
+ break;
+ }
+
+ nodes.push(node);
+ node = node.nextSibling;
+ }
+
+ return nodes;
+}
+/**
+ * listing descendant nodes
+ *
+ * @param {Node} node
+ * @param {Function} [pred] - predicate function
+ */
+
+
+function listDescendant(node, pred) {
+ var descendants = [];
+ pred = pred || func.ok; // start DFS(depth first search) with node
+
+ (function fnWalk(current) {
+ if (node !== current && pred(current)) {
+ descendants.push(current);
+ }
+
+ for (var idx = 0, len = current.childNodes.length; idx < len; idx++) {
+ fnWalk(current.childNodes[idx]);
+ }
+ })(node);
+
+ return descendants;
+}
+/**
+ * wrap node with new tag.
+ *
+ * @param {Node} node
+ * @param {Node} tagName of wrapper
+ * @return {Node} - wrapper
+ */
+
+
+function wrap(node, wrapperName) {
+ var parent = node.parentNode;
+ var wrapper = external_jQuery_default()('<' + wrapperName + '>')[0];
+ parent.insertBefore(wrapper, node);
+ wrapper.appendChild(node);
+ return wrapper;
+}
+/**
+ * insert node after preceding
+ *
+ * @param {Node} node
+ * @param {Node} preceding - predicate function
+ */
+
+
+function insertAfter(node, preceding) {
+ var next = preceding.nextSibling;
+ var parent = preceding.parentNode;
+
+ if (next) {
+ parent.insertBefore(node, next);
+ } else {
+ parent.appendChild(node);
+ }
+
+ return node;
+}
+/**
+ * append elements.
+ *
+ * @param {Node} node
+ * @param {Collection} aChild
+ */
+
+
+function appendChildNodes(node, aChild) {
+ external_jQuery_default().each(aChild, function (idx, child) {
+ node.appendChild(child);
+ });
+ return node;
+}
+/**
+ * returns whether boundaryPoint is left edge or not.
+ *
+ * @param {BoundaryPoint} point
+ * @return {Boolean}
+ */
+
+
+function isLeftEdgePoint(point) {
+ return point.offset === 0;
+}
+/**
+ * returns whether boundaryPoint is right edge or not.
+ *
+ * @param {BoundaryPoint} point
+ * @return {Boolean}
+ */
+
+
+function isRightEdgePoint(point) {
+ return point.offset === nodeLength(point.node);
+}
+/**
+ * returns whether boundaryPoint is edge or not.
+ *
+ * @param {BoundaryPoint} point
+ * @return {Boolean}
+ */
+
+
+function isEdgePoint(point) {
+ return isLeftEdgePoint(point) || isRightEdgePoint(point);
+}
+/**
+ * returns whether node is left edge of ancestor or not.
+ *
+ * @param {Node} node
+ * @param {Node} ancestor
+ * @return {Boolean}
+ */
+
+
+function isLeftEdgeOf(node, ancestor) {
+ while (node && node !== ancestor) {
+ if (position(node) !== 0) {
+ return false;
+ }
+
+ node = node.parentNode;
+ }
+
+ return true;
+}
+/**
+ * returns whether node is right edge of ancestor or not.
+ *
+ * @param {Node} node
+ * @param {Node} ancestor
+ * @return {Boolean}
+ */
+
+
+function isRightEdgeOf(node, ancestor) {
+ if (!ancestor) {
+ return false;
+ }
+
+ while (node && node !== ancestor) {
+ if (position(node) !== nodeLength(node.parentNode) - 1) {
+ return false;
+ }
+
+ node = node.parentNode;
+ }
+
+ return true;
+}
+/**
+ * returns whether point is left edge of ancestor or not.
+ * @param {BoundaryPoint} point
+ * @param {Node} ancestor
+ * @return {Boolean}
+ */
+
+
+function isLeftEdgePointOf(point, ancestor) {
+ return isLeftEdgePoint(point) && isLeftEdgeOf(point.node, ancestor);
+}
+/**
+ * returns whether point is right edge of ancestor or not.
+ * @param {BoundaryPoint} point
+ * @param {Node} ancestor
+ * @return {Boolean}
+ */
+
+
+function isRightEdgePointOf(point, ancestor) {
+ return isRightEdgePoint(point) && isRightEdgeOf(point.node, ancestor);
+}
+/**
+ * returns offset from parent.
+ *
+ * @param {Node} node
+ */
+
+
+function position(node) {
+ var offset = 0;
+
+ while (node = node.previousSibling) {
+ offset += 1;
+ }
+
+ return offset;
+}
+
+function hasChildren(node) {
+ return !!(node && node.childNodes && node.childNodes.length);
+}
+/**
+ * returns previous boundaryPoint
+ *
+ * @param {BoundaryPoint} point
+ * @param {Boolean} isSkipInnerOffset
+ * @return {BoundaryPoint}
+ */
+
+
+function prevPoint(point, isSkipInnerOffset) {
+ var node;
+ var offset;
+
+ if (point.offset === 0) {
+ if (isEditable(point.node)) {
+ return null;
+ }
+
+ node = point.node.parentNode;
+ offset = position(point.node);
+ } else if (hasChildren(point.node)) {
+ node = point.node.childNodes[point.offset - 1];
+ offset = nodeLength(node);
+ } else {
+ node = point.node;
+ offset = isSkipInnerOffset ? 0 : point.offset - 1;
+ }
+
+ return {
+ node: node,
+ offset: offset
+ };
+}
+/**
+ * returns next boundaryPoint
+ *
+ * @param {BoundaryPoint} point
+ * @param {Boolean} isSkipInnerOffset
+ * @return {BoundaryPoint}
+ */
+
+
+function nextPoint(point, isSkipInnerOffset) {
+ var node, offset;
+
+ if (nodeLength(point.node) === point.offset) {
+ if (isEditable(point.node)) {
+ return null;
+ }
+
+ var nextTextNode = getNextTextNode(point.node);
+
+ if (nextTextNode) {
+ node = nextTextNode;
+ offset = 0;
+ } else {
+ node = point.node.parentNode;
+ offset = position(point.node) + 1;
+ }
+ } else if (hasChildren(point.node)) {
+ node = point.node.childNodes[point.offset];
+ offset = 0;
+ } else {
+ node = point.node;
+ offset = isSkipInnerOffset ? nodeLength(point.node) : point.offset + 1;
+ }
+
+ return {
+ node: node,
+ offset: offset
+ };
+}
+/**
+ * returns next boundaryPoint with empty node
+ *
+ * @param {BoundaryPoint} point
+ * @param {Boolean} isSkipInnerOffset
+ * @return {BoundaryPoint}
+ */
+
+
+function nextPointWithEmptyNode(point, isSkipInnerOffset) {
+ var node,
+ offset = 0; // if node is empty string node, return current node's sibling.
+
+ if (dom_isEmpty(point.node)) {
+ if (point.node === null) {
+ return null;
+ }
+
+ node = point.node.nextSibling;
+ offset = 0;
+ return {
+ node: node,
+ offset: offset
+ };
+ }
+
+ if (nodeLength(point.node) === point.offset) {
+ if (isEditable(point.node)) {
+ return null;
+ }
+
+ node = point.node.parentNode;
+ offset = position(point.node) + 1; // if next node is editable , return current node's sibling node.
+
+ if (isEditable(node)) {
+ node = point.node.nextSibling;
+ offset = 0;
+ }
+ } else if (hasChildren(point.node)) {
+ node = point.node.childNodes[point.offset];
+ offset = 0;
+
+ if (dom_isEmpty(node)) {
+ if (!dom_isEmpty(point.node.nextSibling)) {
+ return {
+ node: point.node.nextSibling,
+ offset: offset
+ };
+ }
+
+ return null;
+ }
+ } else {
+ node = point.node;
+ offset = isSkipInnerOffset ? nodeLength(point.node) : point.offset + 1;
+
+ if (dom_isEmpty(node)) {
+ return null;
+ }
+ }
+
+ return {
+ node: node,
+ offset: offset
+ };
+}
+/*
+* returns the next Text node index or 0 if not found.
+*/
+
+
+function getNextTextNode(actual) {
+ if (!actual.nextSibling) return undefined;
+ if (actual.parent !== actual.nextSibling.parent) return undefined;
+ if (isText(actual.nextSibling)) return actual.nextSibling;else return getNextTextNode(actual.nextSibling);
+}
+/**
+ * returns whether pointA and pointB is same or not.
+ *
+ * @param {BoundaryPoint} pointA
+ * @param {BoundaryPoint} pointB
+ * @return {Boolean}
+ */
+
+
+function isSamePoint(pointA, pointB) {
+ return pointA.node === pointB.node && pointA.offset === pointB.offset;
+}
+/**
+ * returns whether point is visible (can set cursor) or not.
+ *
+ * @param {BoundaryPoint} point
+ * @return {Boolean}
+ */
+
+
+function isVisiblePoint(point) {
+ if (isText(point.node) || !hasChildren(point.node) || dom_isEmpty(point.node)) {
+ return true;
+ }
+
+ var leftNode = point.node.childNodes[point.offset - 1];
+ var rightNode = point.node.childNodes[point.offset];
+
+ if ((!leftNode || isVoid(leftNode)) && (!rightNode || isVoid(rightNode)) || isTable(rightNode)) {
+ return true;
+ }
+
+ return false;
+}
+/**
+ * @method prevPointUtil
+ *
+ * @param {BoundaryPoint} point
+ * @param {Function} pred
+ * @return {BoundaryPoint}
+ */
+
+
+function prevPointUntil(point, pred) {
+ while (point) {
+ if (pred(point)) {
+ return point;
+ }
+
+ point = prevPoint(point);
+ }
+
+ return null;
+}
+/**
+ * @method nextPointUntil
+ *
+ * @param {BoundaryPoint} point
+ * @param {Function} pred
+ * @return {BoundaryPoint}
+ */
+
+
+function nextPointUntil(point, pred) {
+ while (point) {
+ if (pred(point)) {
+ return point;
+ }
+
+ point = nextPoint(point);
+ }
+
+ return null;
+}
+/**
+ * returns whether point has character or not.
+ *
+ * @param {Point} point
+ * @return {Boolean}
+ */
+
+
+function isCharPoint(point) {
+ if (!isText(point.node)) {
+ return false;
+ }
+
+ var ch = point.node.nodeValue.charAt(point.offset - 1);
+ return ch && ch !== ' ' && ch !== NBSP_CHAR;
+}
+/**
+ * returns whether point has space or not.
+ *
+ * @param {Point} point
+ * @return {Boolean}
+ */
+
+
+function isSpacePoint(point) {
+ if (!isText(point.node)) {
+ return false;
+ }
+
+ var ch = point.node.nodeValue.charAt(point.offset - 1);
+ return ch === ' ' || ch === NBSP_CHAR;
+}
+/**
+ * @method walkPoint
+ *
+ * @param {BoundaryPoint} startPoint
+ * @param {BoundaryPoint} endPoint
+ * @param {Function} handler
+ * @param {Boolean} isSkipInnerOffset
+ */
+
+
+function walkPoint(startPoint, endPoint, handler, isSkipInnerOffset) {
+ var point = startPoint;
+
+ while (point) {
+ handler(point);
+
+ if (isSamePoint(point, endPoint)) {
+ break;
+ }
+
+ var isSkipOffset = isSkipInnerOffset && startPoint.node !== point.node && endPoint.node !== point.node;
+ point = nextPointWithEmptyNode(point, isSkipOffset);
+ }
+}
+/**
+ * @method makeOffsetPath
+ *
+ * return offsetPath(array of offset) from ancestor
+ *
+ * @param {Node} ancestor - ancestor node
+ * @param {Node} node
+ */
+
+
+function makeOffsetPath(ancestor, node) {
+ var ancestors = listAncestor(node, func.eq(ancestor));
+ return ancestors.map(position).reverse();
+}
+/**
+ * @method fromOffsetPath
+ *
+ * return element from offsetPath(array of offset)
+ *
+ * @param {Node} ancestor - ancestor node
+ * @param {array} offsets - offsetPath
+ */
+
+
+function fromOffsetPath(ancestor, offsets) {
+ var current = ancestor;
+
+ for (var i = 0, len = offsets.length; i < len; i++) {
+ if (current.childNodes.length <= offsets[i]) {
+ current = current.childNodes[current.childNodes.length - 1];
+ } else {
+ current = current.childNodes[offsets[i]];
+ }
+ }
+
+ return current;
+}
+/**
+ * @method splitNode
+ *
+ * split element or #text
+ *
+ * @param {BoundaryPoint} point
+ * @param {Object} [options]
+ * @param {Boolean} [options.isSkipPaddingBlankHTML] - default: false
+ * @param {Boolean} [options.isNotSplitEdgePoint] - default: false
+ * @param {Boolean} [options.isDiscardEmptySplits] - default: false
+ * @return {Node} right node of boundaryPoint
+ */
+
+
+function splitNode(point, options) {
+ var isSkipPaddingBlankHTML = options && options.isSkipPaddingBlankHTML;
+ var isNotSplitEdgePoint = options && options.isNotSplitEdgePoint;
+ var isDiscardEmptySplits = options && options.isDiscardEmptySplits;
+
+ if (isDiscardEmptySplits) {
+ isSkipPaddingBlankHTML = true;
+ } // edge case
+
+
+ if (isEdgePoint(point) && (isText(point.node) || isNotSplitEdgePoint)) {
+ if (isLeftEdgePoint(point)) {
+ return point.node;
+ } else if (isRightEdgePoint(point)) {
+ return point.node.nextSibling;
+ }
+ } // split #text
+
+
+ if (isText(point.node)) {
+ return point.node.splitText(point.offset);
+ } else {
+ var childNode = point.node.childNodes[point.offset];
+ var clone = insertAfter(point.node.cloneNode(false), point.node);
+ appendChildNodes(clone, listNext(childNode));
+
+ if (!isSkipPaddingBlankHTML) {
+ paddingBlankHTML(point.node);
+ paddingBlankHTML(clone);
+ }
+
+ if (isDiscardEmptySplits) {
+ if (dom_isEmpty(point.node)) {
+ remove(point.node);
+ }
+
+ if (dom_isEmpty(clone)) {
+ remove(clone);
+ return point.node.nextSibling;
+ }
+ }
+
+ return clone;
+ }
+}
+/**
+ * @method splitTree
+ *
+ * split tree by point
+ *
+ * @param {Node} root - split root
+ * @param {BoundaryPoint} point
+ * @param {Object} [options]
+ * @param {Boolean} [options.isSkipPaddingBlankHTML] - default: false
+ * @param {Boolean} [options.isNotSplitEdgePoint] - default: false
+ * @return {Node} right node of boundaryPoint
+ */
+
+
+function splitTree(root, point, options) {
+ // ex) [#text, , ]
+ var ancestors = listAncestor(point.node, func.eq(root));
+
+ if (!ancestors.length) {
+ return null;
+ } else if (ancestors.length === 1) {
+ return splitNode(point, options);
+ }
+
+ return ancestors.reduce(function (node, parent) {
+ if (node === point.node) {
+ node = splitNode(point, options);
+ }
+
+ return splitNode({
+ node: parent,
+ offset: node ? position(node) : nodeLength(parent)
+ }, options);
+ });
+}
+/**
+ * split point
+ *
+ * @param {Point} point
+ * @param {Boolean} isInline
+ * @return {Object}
+ */
+
+
+function splitPoint(point, isInline) {
+ // find splitRoot, container
+ // - inline: splitRoot is a child of paragraph
+ // - block: splitRoot is a child of bodyContainer
+ var pred = isInline ? isPara : isBodyContainer;
+ var ancestors = listAncestor(point.node, pred);
+ var topAncestor = lists.last(ancestors) || point.node;
+ var splitRoot, container;
+
+ if (pred(topAncestor)) {
+ splitRoot = ancestors[ancestors.length - 2];
+ container = topAncestor;
+ } else {
+ splitRoot = topAncestor;
+ container = splitRoot.parentNode;
+ } // if splitRoot is exists, split with splitTree
+
+
+ var pivot = splitRoot && splitTree(splitRoot, point, {
+ isSkipPaddingBlankHTML: isInline,
+ isNotSplitEdgePoint: isInline
+ }); // if container is point.node, find pivot with point.offset
+
+ if (!pivot && container === point.node) {
+ pivot = point.node.childNodes[point.offset];
+ }
+
+ return {
+ rightNode: pivot,
+ container: container
+ };
+}
+
+function create(nodeName) {
+ return document.createElement(nodeName);
+}
+
+function createText(text) {
+ return document.createTextNode(text);
+}
+/**
+ * @method remove
+ *
+ * remove node, (isRemoveChild: remove child or not)
+ *
+ * @param {Node} node
+ * @param {Boolean} isRemoveChild
+ */
+
+
+function remove(node, isRemoveChild) {
+ if (!node || !node.parentNode) {
+ return;
+ }
+
+ if (node.removeNode) {
+ return node.removeNode(isRemoveChild);
+ }
+
+ var parent = node.parentNode;
+
+ if (!isRemoveChild) {
+ var nodes = [];
+
+ for (var i = 0, len = node.childNodes.length; i < len; i++) {
+ nodes.push(node.childNodes[i]);
+ }
+
+ for (var _i = 0, _len = nodes.length; _i < _len; _i++) {
+ parent.insertBefore(nodes[_i], node);
+ }
+ }
+
+ parent.removeChild(node);
+}
+/**
+ * @method removeWhile
+ *
+ * @param {Node} node
+ * @param {Function} pred
+ */
+
+
+function removeWhile(node, pred) {
+ while (node) {
+ if (isEditable(node) || !pred(node)) {
+ break;
+ }
+
+ var parent = node.parentNode;
+ remove(node);
+ node = parent;
+ }
+}
+/**
+ * @method replace
+ *
+ * replace node with provided nodeName
+ *
+ * @param {Node} node
+ * @param {String} nodeName
+ * @return {Node} - new node
+ */
+
+
+function replace(node, nodeName) {
+ if (node.nodeName.toUpperCase() === nodeName.toUpperCase()) {
+ return node;
+ }
+
+ var newNode = create(nodeName);
+
+ if (node.style.cssText) {
+ newNode.style.cssText = node.style.cssText;
+ }
+
+ appendChildNodes(newNode, lists.from(node.childNodes));
+ insertAfter(newNode, node);
+ remove(node);
+ return newNode;
+}
+
+var isTextarea = makePredByNodeName('TEXTAREA');
+/**
+ * @param {jQuery} $node
+ * @param {Boolean} [stripLinebreaks] - default: false
+ */
+
+function value($node, stripLinebreaks) {
+ var val = isTextarea($node[0]) ? $node.val() : $node.html();
+
+ if (stripLinebreaks) {
+ return val.replace(/[\n\r]/g, '');
+ }
+
+ return val;
+}
+/**
+ * @method html
+ *
+ * get the HTML contents of node
+ *
+ * @param {jQuery} $node
+ * @param {Boolean} [isNewlineOnBlock]
+ */
+
+
+function html($node, isNewlineOnBlock) {
+ var markup = value($node);
+
+ if (isNewlineOnBlock) {
+ var regexTag = /<(\/?)(\b(?!!)[^>\s]*)(.*?)(\s*\/?>)/g;
+ markup = markup.replace(regexTag, function (match, endSlash, name) {
+ name = name.toUpperCase();
+ var isEndOfInlineContainer = /^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(name) && !!endSlash;
+ var isBlockNode = /^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(name);
+ return match + (isEndOfInlineContainer || isBlockNode ? '\n' : '');
+ });
+ markup = markup.trim();
+ }
+
+ return markup;
+}
+
+function posFromPlaceholder(placeholder) {
+ var $placeholder = external_jQuery_default()(placeholder);
+ var pos = $placeholder.offset();
+ var height = $placeholder.outerHeight(true); // include margin
+
+ return {
+ left: pos.left,
+ top: pos.top + height
+ };
+}
+
+function attachEvents($node, events) {
+ Object.keys(events).forEach(function (key) {
+ $node.on(key, events[key]);
+ });
+}
+
+function detachEvents($node, events) {
+ Object.keys(events).forEach(function (key) {
+ $node.off(key, events[key]);
+ });
+}
+/**
+ * @method isCustomStyleTag
+ *
+ * assert if a node contains a "note-styletag" class,
+ * which implies that's a custom-made style tag node
+ *
+ * @param {Node} an HTML DOM node
+ */
+
+
+function isCustomStyleTag(node) {
+ return node && !isText(node) && lists.contains(node.classList, 'note-styletag');
+}
+
+/* harmony default export */ const dom = ({
+ /** @property {String} NBSP_CHAR */
+ NBSP_CHAR: NBSP_CHAR,
+
+ /** @property {String} ZERO_WIDTH_NBSP_CHAR */
+ ZERO_WIDTH_NBSP_CHAR: ZERO_WIDTH_NBSP_CHAR,
+
+ /** @property {String} blank */
+ blank: blankHTML,
+
+ /** @property {String} emptyPara */
+ emptyPara: "
".concat(blankHTML, "
"),
+ makePredByNodeName: makePredByNodeName,
+ isEditable: isEditable,
+ isControlSizing: isControlSizing,
+ isText: isText,
+ isElement: isElement,
+ isVoid: isVoid,
+ isPara: isPara,
+ isPurePara: isPurePara,
+ isHeading: isHeading,
+ isInline: isInline,
+ isBlock: func.not(isInline),
+ isBodyInline: isBodyInline,
+ isBody: isBody,
+ isParaInline: isParaInline,
+ isPre: isPre,
+ isList: isList,
+ isTable: isTable,
+ isData: isData,
+ isCell: isCell,
+ isBlockquote: isBlockquote,
+ isBodyContainer: isBodyContainer,
+ isAnchor: isAnchor,
+ isDiv: makePredByNodeName('DIV'),
+ isLi: isLi,
+ isBR: makePredByNodeName('BR'),
+ isSpan: makePredByNodeName('SPAN'),
+ isB: makePredByNodeName('B'),
+ isU: makePredByNodeName('U'),
+ isS: makePredByNodeName('S'),
+ isI: makePredByNodeName('I'),
+ isImg: makePredByNodeName('IMG'),
+ isTextarea: isTextarea,
+ deepestChildIsEmpty: deepestChildIsEmpty,
+ isEmpty: dom_isEmpty,
+ isEmptyAnchor: func.and(isAnchor, dom_isEmpty),
+ isClosestSibling: isClosestSibling,
+ withClosestSiblings: withClosestSiblings,
+ nodeLength: nodeLength,
+ isLeftEdgePoint: isLeftEdgePoint,
+ isRightEdgePoint: isRightEdgePoint,
+ isEdgePoint: isEdgePoint,
+ isLeftEdgeOf: isLeftEdgeOf,
+ isRightEdgeOf: isRightEdgeOf,
+ isLeftEdgePointOf: isLeftEdgePointOf,
+ isRightEdgePointOf: isRightEdgePointOf,
+ prevPoint: prevPoint,
+ nextPoint: nextPoint,
+ nextPointWithEmptyNode: nextPointWithEmptyNode,
+ isSamePoint: isSamePoint,
+ isVisiblePoint: isVisiblePoint,
+ prevPointUntil: prevPointUntil,
+ nextPointUntil: nextPointUntil,
+ isCharPoint: isCharPoint,
+ isSpacePoint: isSpacePoint,
+ walkPoint: walkPoint,
+ ancestor: ancestor,
+ singleChildAncestor: singleChildAncestor,
+ listAncestor: listAncestor,
+ lastAncestor: lastAncestor,
+ listNext: listNext,
+ listPrev: listPrev,
+ listDescendant: listDescendant,
+ commonAncestor: commonAncestor,
+ wrap: wrap,
+ insertAfter: insertAfter,
+ appendChildNodes: appendChildNodes,
+ position: position,
+ hasChildren: hasChildren,
+ makeOffsetPath: makeOffsetPath,
+ fromOffsetPath: fromOffsetPath,
+ splitTree: splitTree,
+ splitPoint: splitPoint,
+ create: create,
+ createText: createText,
+ remove: remove,
+ removeWhile: removeWhile,
+ replace: replace,
+ html: html,
+ value: value,
+ posFromPlaceholder: posFromPlaceholder,
+ attachEvents: attachEvents,
+ detachEvents: detachEvents,
+ isCustomStyleTag: isCustomStyleTag
+});
+;// CONCATENATED MODULE: ./src/js/Context.js
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } }
+
+function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
+
+
+
+
+
+
+var Context = /*#__PURE__*/function () {
+ /**
+ * @param {jQuery} $note
+ * @param {Object} options
+ */
+ function Context($note, options) {
+ _classCallCheck(this, Context);
+
+ this.$note = $note;
+ this.memos = {};
+ this.modules = {};
+ this.layoutInfo = {};
+ this.options = external_jQuery_default().extend(true, {}, options); // init ui with options
+
+ (external_jQuery_default()).summernote.ui = external_jQuery_default().summernote.ui_template(this.options);
+ this.ui = (external_jQuery_default()).summernote.ui;
+ this.initialize();
+ }
+ /**
+ * create layout and initialize modules and other resources
+ */
+
+
+ _createClass(Context, [{
+ key: "initialize",
+ value: function initialize() {
+ this.layoutInfo = this.ui.createLayout(this.$note);
+
+ this._initialize();
+
+ this.$note.hide();
+ return this;
+ }
+ /**
+ * destroy modules and other resources and remove layout
+ */
+
+ }, {
+ key: "destroy",
+ value: function destroy() {
+ this._destroy();
+
+ this.$note.removeData('summernote');
+ this.ui.removeLayout(this.$note, this.layoutInfo);
+ }
+ /**
+ * destory modules and other resources and initialize it again
+ */
+
+ }, {
+ key: "reset",
+ value: function reset() {
+ var disabled = this.isDisabled();
+ this.code(dom.emptyPara);
+
+ this._destroy();
+
+ this._initialize();
+
+ if (disabled) {
+ this.disable();
+ }
+ }
+ }, {
+ key: "_initialize",
+ value: function _initialize() {
+ var _this = this;
+
+ // set own id
+ this.options.id = func.uniqueId(external_jQuery_default().now()); // set default container for tooltips, popovers, and dialogs
+
+ this.options.container = this.options.container || this.layoutInfo.editor; // add optional buttons
+
+ var buttons = external_jQuery_default().extend({}, this.options.buttons);
+ Object.keys(buttons).forEach(function (key) {
+ _this.memo('button.' + key, buttons[key]);
+ });
+ var modules = external_jQuery_default().extend({}, this.options.modules, (external_jQuery_default()).summernote.plugins || {}); // add and initialize modules
+
+ Object.keys(modules).forEach(function (key) {
+ _this.module(key, modules[key], true);
+ });
+ Object.keys(this.modules).forEach(function (key) {
+ _this.initializeModule(key);
+ });
+ }
+ }, {
+ key: "_destroy",
+ value: function _destroy() {
+ var _this2 = this;
+
+ // destroy modules with reversed order
+ Object.keys(this.modules).reverse().forEach(function (key) {
+ _this2.removeModule(key);
+ });
+ Object.keys(this.memos).forEach(function (key) {
+ _this2.removeMemo(key);
+ }); // trigger custom onDestroy callback
+
+ this.triggerEvent('destroy', this);
+ }
+ }, {
+ key: "code",
+ value: function code(html) {
+ var isActivated = this.invoke('codeview.isActivated');
+
+ if (html === undefined) {
+ this.invoke('codeview.sync');
+ return isActivated ? this.layoutInfo.codable.val() : this.layoutInfo.editable.html();
+ } else {
+ if (isActivated) {
+ this.invoke('codeview.sync', html);
+ } else {
+ this.layoutInfo.editable.html(html);
+ }
+
+ this.$note.val(html);
+ this.triggerEvent('change', html, this.layoutInfo.editable);
+ }
+ }
+ }, {
+ key: "isDisabled",
+ value: function isDisabled() {
+ return this.layoutInfo.editable.attr('contenteditable') === 'false';
+ }
+ }, {
+ key: "enable",
+ value: function enable() {
+ this.layoutInfo.editable.attr('contenteditable', true);
+ this.invoke('toolbar.activate', true);
+ this.triggerEvent('disable', false);
+ this.options.editing = true;
+ }
+ }, {
+ key: "disable",
+ value: function disable() {
+ // close codeview if codeview is opend
+ if (this.invoke('codeview.isActivated')) {
+ this.invoke('codeview.deactivate');
+ }
+
+ this.layoutInfo.editable.attr('contenteditable', false);
+ this.options.editing = false;
+ this.invoke('toolbar.deactivate', true);
+ this.triggerEvent('disable', true);
+ }
+ }, {
+ key: "triggerEvent",
+ value: function triggerEvent() {
+ var namespace = lists.head(arguments);
+ var args = lists.tail(lists.from(arguments));
+ var callback = this.options.callbacks[func.namespaceToCamel(namespace, 'on')];
+
+ if (callback) {
+ callback.apply(this.$note[0], args);
+ }
+
+ this.$note.trigger('summernote.' + namespace, args);
+ }
+ }, {
+ key: "initializeModule",
+ value: function initializeModule(key) {
+ var module = this.modules[key];
+ module.shouldInitialize = module.shouldInitialize || func.ok;
+
+ if (!module.shouldInitialize()) {
+ return;
+ } // initialize module
+
+
+ if (module.initialize) {
+ module.initialize();
+ } // attach events
+
+
+ if (module.events) {
+ dom.attachEvents(this.$note, module.events);
+ }
+ }
+ }, {
+ key: "module",
+ value: function module(key, ModuleClass, withoutIntialize) {
+ if (arguments.length === 1) {
+ return this.modules[key];
+ }
+
+ this.modules[key] = new ModuleClass(this);
+
+ if (!withoutIntialize) {
+ this.initializeModule(key);
+ }
+ }
+ }, {
+ key: "removeModule",
+ value: function removeModule(key) {
+ var module = this.modules[key];
+
+ if (module.shouldInitialize()) {
+ if (module.events) {
+ dom.detachEvents(this.$note, module.events);
+ }
+
+ if (module.destroy) {
+ module.destroy();
+ }
+ }
+
+ delete this.modules[key];
+ }
+ }, {
+ key: "memo",
+ value: function memo(key, obj) {
+ if (arguments.length === 1) {
+ return this.memos[key];
+ }
+
+ this.memos[key] = obj;
+ }
+ }, {
+ key: "removeMemo",
+ value: function removeMemo(key) {
+ if (this.memos[key] && this.memos[key].destroy) {
+ this.memos[key].destroy();
+ }
+
+ delete this.memos[key];
+ }
+ /**
+ * Some buttons need to change their visual style immediately once they get pressed
+ */
+
+ }, {
+ key: "createInvokeHandlerAndUpdateState",
+ value: function createInvokeHandlerAndUpdateState(namespace, value) {
+ var _this3 = this;
+
+ return function (event) {
+ _this3.createInvokeHandler(namespace, value)(event);
+
+ _this3.invoke('buttons.updateCurrentStyle');
+ };
+ }
+ }, {
+ key: "createInvokeHandler",
+ value: function createInvokeHandler(namespace, value) {
+ var _this4 = this;
+
+ return function (event) {
+ event.preventDefault();
+ var $target = external_jQuery_default()(event.target);
+
+ _this4.invoke(namespace, value || $target.closest('[data-value]').data('value'), $target);
+ };
+ }
+ }, {
+ key: "invoke",
+ value: function invoke() {
+ var namespace = lists.head(arguments);
+ var args = lists.tail(lists.from(arguments));
+ var splits = namespace.split('.');
+ var hasSeparator = splits.length > 1;
+ var moduleName = hasSeparator && lists.head(splits);
+ var methodName = hasSeparator ? lists.last(splits) : lists.head(splits);
+ var module = this.modules[moduleName || 'editor'];
+
+ if (!moduleName && this[methodName]) {
+ return this[methodName].apply(this, args);
+ } else if (module && module[methodName] && module.shouldInitialize()) {
+ return module[methodName].apply(module, args);
+ }
+ }
+ }]);
+
+ return Context;
+}();
+
+
+;// CONCATENATED MODULE: ./src/js/summernote.js
+
+
+
+
+external_jQuery_default().fn.extend({
+ /**
+ * Summernote API
+ *
+ * @param {Object|String}
+ * @return {this}
+ */
+ summernote: function summernote() {
+ var type = external_jQuery_default().type(lists.head(arguments));
+ var isExternalAPICalled = type === 'string';
+ var hasInitOptions = type === 'object';
+ var options = external_jQuery_default().extend({}, (external_jQuery_default()).summernote.options, hasInitOptions ? lists.head(arguments) : {}); // Update options
+
+ options.langInfo = external_jQuery_default().extend(true, {}, (external_jQuery_default()).summernote.lang["en-US"], (external_jQuery_default()).summernote.lang[options.lang]);
+ options.icons = external_jQuery_default().extend(true, {}, (external_jQuery_default()).summernote.options.icons, options.icons);
+ options.tooltip = options.tooltip === 'auto' ? !env.isSupportTouch : options.tooltip;
+ this.each(function (idx, note) {
+ var $note = external_jQuery_default()(note);
+
+ if (!$note.data('summernote')) {
+ var context = new Context($note, options);
+ $note.data('summernote', context);
+ $note.data('summernote').triggerEvent('init', context.layoutInfo);
+ }
+ });
+ var $note = this.first();
+
+ if ($note.length) {
+ var context = $note.data('summernote');
+
+ if (isExternalAPICalled) {
+ return context.invoke.apply(context, lists.from(arguments));
+ } else if (options.focus) {
+ context.invoke('editor.focus');
+ }
+ }
+
+ return this;
+ }
+});
+;// CONCATENATED MODULE: ./src/js/core/range.js
+function range_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function range_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); } }
+
+function range_createClass(Constructor, protoProps, staticProps) { if (protoProps) range_defineProperties(Constructor.prototype, protoProps); if (staticProps) range_defineProperties(Constructor, staticProps); return Constructor; }
+
+
+
+
+
+
+/**
+ * return boundaryPoint from TextRange, inspired by Andy Na's HuskyRange.js
+ *
+ * @param {TextRange} textRange
+ * @param {Boolean} isStart
+ * @return {BoundaryPoint}
+ *
+ * @see http://msdn.microsoft.com/en-us/library/ie/ms535872(v=vs.85).aspx
+ */
+
+function textRangeToPoint(textRange, isStart) {
+ var container = textRange.parentElement();
+ var offset;
+ var tester = document.body.createTextRange();
+ var prevContainer;
+ var childNodes = lists.from(container.childNodes);
+
+ for (offset = 0; offset < childNodes.length; offset++) {
+ if (dom.isText(childNodes[offset])) {
+ continue;
+ }
+
+ tester.moveToElementText(childNodes[offset]);
+
+ if (tester.compareEndPoints('StartToStart', textRange) >= 0) {
+ break;
+ }
+
+ prevContainer = childNodes[offset];
+ }
+
+ if (offset !== 0 && dom.isText(childNodes[offset - 1])) {
+ var textRangeStart = document.body.createTextRange();
+ var curTextNode = null;
+ textRangeStart.moveToElementText(prevContainer || container);
+ textRangeStart.collapse(!prevContainer);
+ curTextNode = prevContainer ? prevContainer.nextSibling : container.firstChild;
+ var pointTester = textRange.duplicate();
+ pointTester.setEndPoint('StartToStart', textRangeStart);
+ var textCount = pointTester.text.replace(/[\r\n]/g, '').length;
+
+ while (textCount > curTextNode.nodeValue.length && curTextNode.nextSibling) {
+ textCount -= curTextNode.nodeValue.length;
+ curTextNode = curTextNode.nextSibling;
+ } // [workaround] enforce IE to re-reference curTextNode, hack
+
+
+ var dummy = curTextNode.nodeValue; // eslint-disable-line
+
+ if (isStart && curTextNode.nextSibling && dom.isText(curTextNode.nextSibling) && textCount === curTextNode.nodeValue.length) {
+ textCount -= curTextNode.nodeValue.length;
+ curTextNode = curTextNode.nextSibling;
+ }
+
+ container = curTextNode;
+ offset = textCount;
+ }
+
+ return {
+ cont: container,
+ offset: offset
+ };
+}
+/**
+ * return TextRange from boundary point (inspired by google closure-library)
+ * @param {BoundaryPoint} point
+ * @return {TextRange}
+ */
+
+
+function pointToTextRange(point) {
+ var textRangeInfo = function textRangeInfo(container, offset) {
+ var node, isCollapseToStart;
+
+ if (dom.isText(container)) {
+ var prevTextNodes = dom.listPrev(container, func.not(dom.isText));
+ var prevContainer = lists.last(prevTextNodes).previousSibling;
+ node = prevContainer || container.parentNode;
+ offset += lists.sum(lists.tail(prevTextNodes), dom.nodeLength);
+ isCollapseToStart = !prevContainer;
+ } else {
+ node = container.childNodes[offset] || container;
+
+ if (dom.isText(node)) {
+ return textRangeInfo(node, 0);
+ }
+
+ offset = 0;
+ isCollapseToStart = false;
+ }
+
+ return {
+ node: node,
+ collapseToStart: isCollapseToStart,
+ offset: offset
+ };
+ };
+
+ var textRange = document.body.createTextRange();
+ var info = textRangeInfo(point.node, point.offset);
+ textRange.moveToElementText(info.node);
+ textRange.collapse(info.collapseToStart);
+ textRange.moveStart('character', info.offset);
+ return textRange;
+}
+/**
+ * Wrapped Range
+ *
+ * @constructor
+ * @param {Node} sc - start container
+ * @param {Number} so - start offset
+ * @param {Node} ec - end container
+ * @param {Number} eo - end offset
+ */
+
+
+var WrappedRange = /*#__PURE__*/function () {
+ function WrappedRange(sc, so, ec, eo) {
+ range_classCallCheck(this, WrappedRange);
+
+ this.sc = sc;
+ this.so = so;
+ this.ec = ec;
+ this.eo = eo; // isOnEditable: judge whether range is on editable or not
+
+ this.isOnEditable = this.makeIsOn(dom.isEditable); // isOnList: judge whether range is on list node or not
+
+ this.isOnList = this.makeIsOn(dom.isList); // isOnAnchor: judge whether range is on anchor node or not
+
+ this.isOnAnchor = this.makeIsOn(dom.isAnchor); // isOnCell: judge whether range is on cell node or not
+
+ this.isOnCell = this.makeIsOn(dom.isCell); // isOnData: judge whether range is on data node or not
+
+ this.isOnData = this.makeIsOn(dom.isData);
+ } // nativeRange: get nativeRange from sc, so, ec, eo
+
+
+ range_createClass(WrappedRange, [{
+ key: "nativeRange",
+ value: function nativeRange() {
+ if (env.isW3CRangeSupport) {
+ var w3cRange = document.createRange();
+ w3cRange.setStart(this.sc, this.so);
+ w3cRange.setEnd(this.ec, this.eo);
+ return w3cRange;
+ } else {
+ var textRange = pointToTextRange({
+ node: this.sc,
+ offset: this.so
+ });
+ textRange.setEndPoint('EndToEnd', pointToTextRange({
+ node: this.ec,
+ offset: this.eo
+ }));
+ return textRange;
+ }
+ }
+ }, {
+ key: "getPoints",
+ value: function getPoints() {
+ return {
+ sc: this.sc,
+ so: this.so,
+ ec: this.ec,
+ eo: this.eo
+ };
+ }
+ }, {
+ key: "getStartPoint",
+ value: function getStartPoint() {
+ return {
+ node: this.sc,
+ offset: this.so
+ };
+ }
+ }, {
+ key: "getEndPoint",
+ value: function getEndPoint() {
+ return {
+ node: this.ec,
+ offset: this.eo
+ };
+ }
+ /**
+ * select update visible range
+ */
+
+ }, {
+ key: "select",
+ value: function select() {
+ var nativeRng = this.nativeRange();
+
+ if (env.isW3CRangeSupport) {
+ var selection = document.getSelection();
+
+ if (selection.rangeCount > 0) {
+ selection.removeAllRanges();
+ }
+
+ selection.addRange(nativeRng);
+ } else {
+ nativeRng.select();
+ }
+
+ return this;
+ }
+ /**
+ * Moves the scrollbar to start container(sc) of current range
+ *
+ * @return {WrappedRange}
+ */
+
+ }, {
+ key: "scrollIntoView",
+ value: function scrollIntoView(container) {
+ var height = external_jQuery_default()(container).height();
+
+ if (container.scrollTop + height < this.sc.offsetTop) {
+ container.scrollTop += Math.abs(container.scrollTop + height - this.sc.offsetTop);
+ }
+
+ return this;
+ }
+ /**
+ * @return {WrappedRange}
+ */
+
+ }, {
+ key: "normalize",
+ value: function normalize() {
+ /**
+ * @param {BoundaryPoint} point
+ * @param {Boolean} isLeftToRight - true: prefer to choose right node
+ * - false: prefer to choose left node
+ * @return {BoundaryPoint}
+ */
+ var getVisiblePoint = function getVisiblePoint(point, isLeftToRight) {
+ if (!point) {
+ return point;
+ } // Just use the given point [XXX:Adhoc]
+ // - case 01. if the point is on the middle of the node
+ // - case 02. if the point is on the right edge and prefer to choose left node
+ // - case 03. if the point is on the left edge and prefer to choose right node
+ // - case 04. if the point is on the right edge and prefer to choose right node but the node is void
+ // - case 05. if the point is on the left edge and prefer to choose left node but the node is void
+ // - case 06. if the point is on the block node and there is no children
+
+
+ if (dom.isVisiblePoint(point)) {
+ if (!dom.isEdgePoint(point) || dom.isRightEdgePoint(point) && !isLeftToRight || dom.isLeftEdgePoint(point) && isLeftToRight || dom.isRightEdgePoint(point) && isLeftToRight && dom.isVoid(point.node.nextSibling) || dom.isLeftEdgePoint(point) && !isLeftToRight && dom.isVoid(point.node.previousSibling) || dom.isBlock(point.node) && dom.isEmpty(point.node)) {
+ return point;
+ }
+ } // point on block's edge
+
+
+ var block = dom.ancestor(point.node, dom.isBlock);
+ var hasRightNode = false;
+
+ if (!hasRightNode) {
+ var prevPoint = dom.prevPoint(point) || {
+ node: null
+ };
+ hasRightNode = (dom.isLeftEdgePointOf(point, block) || dom.isVoid(prevPoint.node)) && !isLeftToRight;
+ }
+
+ var hasLeftNode = false;
+
+ if (!hasLeftNode) {
+ var _nextPoint = dom.nextPoint(point) || {
+ node: null
+ };
+
+ hasLeftNode = (dom.isRightEdgePointOf(point, block) || dom.isVoid(_nextPoint.node)) && isLeftToRight;
+ }
+
+ if (hasRightNode || hasLeftNode) {
+ // returns point already on visible point
+ if (dom.isVisiblePoint(point)) {
+ return point;
+ } // reverse direction
+
+
+ isLeftToRight = !isLeftToRight;
+ }
+
+ var nextPoint = isLeftToRight ? dom.nextPointUntil(dom.nextPoint(point), dom.isVisiblePoint) : dom.prevPointUntil(dom.prevPoint(point), dom.isVisiblePoint);
+ return nextPoint || point;
+ };
+
+ var endPoint = getVisiblePoint(this.getEndPoint(), false);
+ var startPoint = this.isCollapsed() ? endPoint : getVisiblePoint(this.getStartPoint(), true);
+ return new WrappedRange(startPoint.node, startPoint.offset, endPoint.node, endPoint.offset);
+ }
+ /**
+ * returns matched nodes on range
+ *
+ * @param {Function} [pred] - predicate function
+ * @param {Object} [options]
+ * @param {Boolean} [options.includeAncestor]
+ * @param {Boolean} [options.fullyContains]
+ * @return {Node[]}
+ */
+
+ }, {
+ key: "nodes",
+ value: function nodes(pred, options) {
+ pred = pred || func.ok;
+ var includeAncestor = options && options.includeAncestor;
+ var fullyContains = options && options.fullyContains; // TODO compare points and sort
+
+ var startPoint = this.getStartPoint();
+ var endPoint = this.getEndPoint();
+ var nodes = [];
+ var leftEdgeNodes = [];
+ dom.walkPoint(startPoint, endPoint, function (point) {
+ if (dom.isEditable(point.node)) {
+ return;
+ }
+
+ var node;
+
+ if (fullyContains) {
+ if (dom.isLeftEdgePoint(point)) {
+ leftEdgeNodes.push(point.node);
+ }
+
+ if (dom.isRightEdgePoint(point) && lists.contains(leftEdgeNodes, point.node)) {
+ node = point.node;
+ }
+ } else if (includeAncestor) {
+ node = dom.ancestor(point.node, pred);
+ } else {
+ node = point.node;
+ }
+
+ if (node && pred(node)) {
+ nodes.push(node);
+ }
+ }, true);
+ return lists.unique(nodes);
+ }
+ /**
+ * returns commonAncestor of range
+ * @return {Element} - commonAncestor
+ */
+
+ }, {
+ key: "commonAncestor",
+ value: function commonAncestor() {
+ return dom.commonAncestor(this.sc, this.ec);
+ }
+ /**
+ * returns expanded range by pred
+ *
+ * @param {Function} pred - predicate function
+ * @return {WrappedRange}
+ */
+
+ }, {
+ key: "expand",
+ value: function expand(pred) {
+ var startAncestor = dom.ancestor(this.sc, pred);
+ var endAncestor = dom.ancestor(this.ec, pred);
+
+ if (!startAncestor && !endAncestor) {
+ return new WrappedRange(this.sc, this.so, this.ec, this.eo);
+ }
+
+ var boundaryPoints = this.getPoints();
+
+ if (startAncestor) {
+ boundaryPoints.sc = startAncestor;
+ boundaryPoints.so = 0;
+ }
+
+ if (endAncestor) {
+ boundaryPoints.ec = endAncestor;
+ boundaryPoints.eo = dom.nodeLength(endAncestor);
+ }
+
+ return new WrappedRange(boundaryPoints.sc, boundaryPoints.so, boundaryPoints.ec, boundaryPoints.eo);
+ }
+ /**
+ * @param {Boolean} isCollapseToStart
+ * @return {WrappedRange}
+ */
+
+ }, {
+ key: "collapse",
+ value: function collapse(isCollapseToStart) {
+ if (isCollapseToStart) {
+ return new WrappedRange(this.sc, this.so, this.sc, this.so);
+ } else {
+ return new WrappedRange(this.ec, this.eo, this.ec, this.eo);
+ }
+ }
+ /**
+ * splitText on range
+ */
+
+ }, {
+ key: "splitText",
+ value: function splitText() {
+ var isSameContainer = this.sc === this.ec;
+ var boundaryPoints = this.getPoints();
+
+ if (dom.isText(this.ec) && !dom.isEdgePoint(this.getEndPoint())) {
+ this.ec.splitText(this.eo);
+ }
+
+ if (dom.isText(this.sc) && !dom.isEdgePoint(this.getStartPoint())) {
+ boundaryPoints.sc = this.sc.splitText(this.so);
+ boundaryPoints.so = 0;
+
+ if (isSameContainer) {
+ boundaryPoints.ec = boundaryPoints.sc;
+ boundaryPoints.eo = this.eo - this.so;
+ }
+ }
+
+ return new WrappedRange(boundaryPoints.sc, boundaryPoints.so, boundaryPoints.ec, boundaryPoints.eo);
+ }
+ /**
+ * delete contents on range
+ * @return {WrappedRange}
+ */
+
+ }, {
+ key: "deleteContents",
+ value: function deleteContents() {
+ if (this.isCollapsed()) {
+ return this;
+ }
+
+ var rng = this.splitText();
+ var nodes = rng.nodes(null, {
+ fullyContains: true
+ }); // find new cursor point
+
+ var point = dom.prevPointUntil(rng.getStartPoint(), function (point) {
+ return !lists.contains(nodes, point.node);
+ });
+ var emptyParents = [];
+ external_jQuery_default().each(nodes, function (idx, node) {
+ // find empty parents
+ var parent = node.parentNode;
+
+ if (point.node !== parent && dom.nodeLength(parent) === 1) {
+ emptyParents.push(parent);
+ }
+
+ dom.remove(node, false);
+ }); // remove empty parents
+
+ external_jQuery_default().each(emptyParents, function (idx, node) {
+ dom.remove(node, false);
+ });
+ return new WrappedRange(point.node, point.offset, point.node, point.offset).normalize();
+ }
+ /**
+ * makeIsOn: return isOn(pred) function
+ */
+
+ }, {
+ key: "makeIsOn",
+ value: function makeIsOn(pred) {
+ return function () {
+ var ancestor = dom.ancestor(this.sc, pred);
+ return !!ancestor && ancestor === dom.ancestor(this.ec, pred);
+ };
+ }
+ /**
+ * @param {Function} pred
+ * @return {Boolean}
+ */
+
+ }, {
+ key: "isLeftEdgeOf",
+ value: function isLeftEdgeOf(pred) {
+ if (!dom.isLeftEdgePoint(this.getStartPoint())) {
+ return false;
+ }
+
+ var node = dom.ancestor(this.sc, pred);
+ return node && dom.isLeftEdgeOf(this.sc, node);
+ }
+ /**
+ * returns whether range was collapsed or not
+ */
+
+ }, {
+ key: "isCollapsed",
+ value: function isCollapsed() {
+ return this.sc === this.ec && this.so === this.eo;
+ }
+ /**
+ * wrap inline nodes which children of body with paragraph
+ *
+ * @return {WrappedRange}
+ */
+
+ }, {
+ key: "wrapBodyInlineWithPara",
+ value: function wrapBodyInlineWithPara() {
+ if (dom.isBodyContainer(this.sc) && dom.isEmpty(this.sc)) {
+ this.sc.innerHTML = dom.emptyPara;
+ return new WrappedRange(this.sc.firstChild, 0, this.sc.firstChild, 0);
+ }
+ /**
+ * [workaround] firefox often create range on not visible point. so normalize here.
+ * - firefox: |text
|
+ * - chrome: |text|
+ */
+
+
+ var rng = this.normalize();
+
+ if (dom.isParaInline(this.sc) || dom.isPara(this.sc)) {
+ return rng;
+ } // find inline top ancestor
+
+
+ var topAncestor;
+
+ if (dom.isInline(rng.sc)) {
+ var ancestors = dom.listAncestor(rng.sc, func.not(dom.isInline));
+ topAncestor = lists.last(ancestors);
+
+ if (!dom.isInline(topAncestor)) {
+ topAncestor = ancestors[ancestors.length - 2] || rng.sc.childNodes[rng.so];
+ }
+ } else {
+ topAncestor = rng.sc.childNodes[rng.so > 0 ? rng.so - 1 : 0];
+ }
+
+ if (topAncestor) {
+ // siblings not in paragraph
+ var inlineSiblings = dom.listPrev(topAncestor, dom.isParaInline).reverse();
+ inlineSiblings = inlineSiblings.concat(dom.listNext(topAncestor.nextSibling, dom.isParaInline)); // wrap with paragraph
+
+ if (inlineSiblings.length) {
+ var para = dom.wrap(lists.head(inlineSiblings), 'p');
+ dom.appendChildNodes(para, lists.tail(inlineSiblings));
+ }
+ }
+
+ return this.normalize();
+ }
+ /**
+ * insert node at current cursor
+ *
+ * @param {Node} node
+ * @return {Node}
+ */
+
+ }, {
+ key: "insertNode",
+ value: function insertNode(node) {
+ var rng = this;
+
+ if (dom.isText(node) || dom.isInline(node)) {
+ rng = this.wrapBodyInlineWithPara().deleteContents();
+ }
+
+ var info = dom.splitPoint(rng.getStartPoint(), dom.isInline(node));
+
+ if (info.rightNode) {
+ info.rightNode.parentNode.insertBefore(node, info.rightNode);
+
+ if (dom.isEmpty(info.rightNode) && dom.isPara(node)) {
+ info.rightNode.parentNode.removeChild(info.rightNode);
+ }
+ } else {
+ info.container.appendChild(node);
+ }
+
+ return node;
+ }
+ /**
+ * insert html at current cursor
+ */
+
+ }, {
+ key: "pasteHTML",
+ value: function pasteHTML(markup) {
+ markup = external_jQuery_default().trim(markup);
+ var contentsContainer = external_jQuery_default()('').html(markup)[0];
+ var childNodes = lists.from(contentsContainer.childNodes); // const rng = this.wrapBodyInlineWithPara().deleteContents();
+
+ var rng = this;
+ var reversed = false;
+
+ if (rng.so >= 0) {
+ childNodes = childNodes.reverse();
+ reversed = true;
+ }
+
+ childNodes = childNodes.map(function (childNode) {
+ return rng.insertNode(childNode);
+ });
+
+ if (reversed) {
+ childNodes = childNodes.reverse();
+ }
+
+ return childNodes;
+ }
+ /**
+ * returns text in range
+ *
+ * @return {String}
+ */
+
+ }, {
+ key: "toString",
+ value: function toString() {
+ var nativeRng = this.nativeRange();
+ return env.isW3CRangeSupport ? nativeRng.toString() : nativeRng.text;
+ }
+ /**
+ * returns range for word before cursor
+ *
+ * @param {Boolean} [findAfter] - find after cursor, default: false
+ * @return {WrappedRange}
+ */
+
+ }, {
+ key: "getWordRange",
+ value: function getWordRange(findAfter) {
+ var endPoint = this.getEndPoint();
+
+ if (!dom.isCharPoint(endPoint)) {
+ return this;
+ }
+
+ var startPoint = dom.prevPointUntil(endPoint, function (point) {
+ return !dom.isCharPoint(point);
+ });
+
+ if (findAfter) {
+ endPoint = dom.nextPointUntil(endPoint, function (point) {
+ return !dom.isCharPoint(point);
+ });
+ }
+
+ return new WrappedRange(startPoint.node, startPoint.offset, endPoint.node, endPoint.offset);
+ }
+ /**
+ * returns range for words before cursor
+ *
+ * @param {Boolean} [findAfter] - find after cursor, default: false
+ * @return {WrappedRange}
+ */
+
+ }, {
+ key: "getWordsRange",
+ value: function getWordsRange(findAfter) {
+ var endPoint = this.getEndPoint();
+
+ var isNotTextPoint = function isNotTextPoint(point) {
+ return !dom.isCharPoint(point) && !dom.isSpacePoint(point);
+ };
+
+ if (isNotTextPoint(endPoint)) {
+ return this;
+ }
+
+ var startPoint = dom.prevPointUntil(endPoint, isNotTextPoint);
+
+ if (findAfter) {
+ endPoint = dom.nextPointUntil(endPoint, isNotTextPoint);
+ }
+
+ return new WrappedRange(startPoint.node, startPoint.offset, endPoint.node, endPoint.offset);
+ }
+ /**
+ * returns range for words before cursor that match with a Regex
+ *
+ * example:
+ * range: 'hi @Peter Pan'
+ * regex: '/@[a-z ]+/i'
+ * return range: '@Peter Pan'
+ *
+ * @param {RegExp} [regex]
+ * @return {WrappedRange|null}
+ */
+
+ }, {
+ key: "getWordsMatchRange",
+ value: function getWordsMatchRange(regex) {
+ var endPoint = this.getEndPoint();
+ var startPoint = dom.prevPointUntil(endPoint, function (point) {
+ if (!dom.isCharPoint(point) && !dom.isSpacePoint(point)) {
+ return true;
+ }
+
+ var rng = new WrappedRange(point.node, point.offset, endPoint.node, endPoint.offset);
+ var result = regex.exec(rng.toString());
+ return result && result.index === 0;
+ });
+ var rng = new WrappedRange(startPoint.node, startPoint.offset, endPoint.node, endPoint.offset);
+ var text = rng.toString();
+ var result = regex.exec(text);
+
+ if (result && result[0].length === text.length) {
+ return rng;
+ } else {
+ return null;
+ }
+ }
+ /**
+ * create offsetPath bookmark
+ *
+ * @param {Node} editable
+ */
+
+ }, {
+ key: "bookmark",
+ value: function bookmark(editable) {
+ return {
+ s: {
+ path: dom.makeOffsetPath(editable, this.sc),
+ offset: this.so
+ },
+ e: {
+ path: dom.makeOffsetPath(editable, this.ec),
+ offset: this.eo
+ }
+ };
+ }
+ /**
+ * create offsetPath bookmark base on paragraph
+ *
+ * @param {Node[]} paras
+ */
+
+ }, {
+ key: "paraBookmark",
+ value: function paraBookmark(paras) {
+ return {
+ s: {
+ path: lists.tail(dom.makeOffsetPath(lists.head(paras), this.sc)),
+ offset: this.so
+ },
+ e: {
+ path: lists.tail(dom.makeOffsetPath(lists.last(paras), this.ec)),
+ offset: this.eo
+ }
+ };
+ }
+ /**
+ * getClientRects
+ * @return {Rect[]}
+ */
+
+ }, {
+ key: "getClientRects",
+ value: function getClientRects() {
+ var nativeRng = this.nativeRange();
+ return nativeRng.getClientRects();
+ }
+ }]);
+
+ return WrappedRange;
+}();
+/**
+ * Data structure
+ * * BoundaryPoint: a point of dom tree
+ * * BoundaryPoints: two boundaryPoints corresponding to the start and the end of the Range
+ *
+ * See to http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-Position
+ */
+
+
+/* harmony default export */ const range = ({
+ /**
+ * create Range Object From arguments or Browser Selection
+ *
+ * @param {Node} sc - start container
+ * @param {Number} so - start offset
+ * @param {Node} ec - end container
+ * @param {Number} eo - end offset
+ * @return {WrappedRange}
+ */
+ create: function create(sc, so, ec, eo) {
+ if (arguments.length === 4) {
+ return new WrappedRange(sc, so, ec, eo);
+ } else if (arguments.length === 2) {
+ // collapsed
+ ec = sc;
+ eo = so;
+ return new WrappedRange(sc, so, ec, eo);
+ } else {
+ var wrappedRange = this.createFromSelection();
+
+ if (!wrappedRange && arguments.length === 1) {
+ var bodyElement = arguments[0];
+
+ if (dom.isEditable(bodyElement)) {
+ bodyElement = bodyElement.lastChild;
+ }
+
+ return this.createFromBodyElement(bodyElement, dom.emptyPara === arguments[0].innerHTML);
+ }
+
+ return wrappedRange;
+ }
+ },
+ createFromBodyElement: function createFromBodyElement(bodyElement) {
+ var isCollapseToStart = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
+ var wrappedRange = this.createFromNode(bodyElement);
+ return wrappedRange.collapse(isCollapseToStart);
+ },
+ createFromSelection: function createFromSelection() {
+ var sc, so, ec, eo;
+
+ if (env.isW3CRangeSupport) {
+ var selection = document.getSelection();
+
+ if (!selection || selection.rangeCount === 0) {
+ return null;
+ } else if (dom.isBody(selection.anchorNode)) {
+ // Firefox: returns entire body as range on initialization.
+ // We won't never need it.
+ return null;
+ }
+
+ var nativeRng = selection.getRangeAt(0);
+ sc = nativeRng.startContainer;
+ so = nativeRng.startOffset;
+ ec = nativeRng.endContainer;
+ eo = nativeRng.endOffset;
+ } else {
+ // IE8: TextRange
+ var textRange = document.selection.createRange();
+ var textRangeEnd = textRange.duplicate();
+ textRangeEnd.collapse(false);
+ var textRangeStart = textRange;
+ textRangeStart.collapse(true);
+ var startPoint = textRangeToPoint(textRangeStart, true);
+ var endPoint = textRangeToPoint(textRangeEnd, false); // same visible point case: range was collapsed.
+
+ if (dom.isText(startPoint.node) && dom.isLeftEdgePoint(startPoint) && dom.isTextNode(endPoint.node) && dom.isRightEdgePoint(endPoint) && endPoint.node.nextSibling === startPoint.node) {
+ startPoint = endPoint;
+ }
+
+ sc = startPoint.cont;
+ so = startPoint.offset;
+ ec = endPoint.cont;
+ eo = endPoint.offset;
+ }
+
+ return new WrappedRange(sc, so, ec, eo);
+ },
+
+ /**
+ * @method
+ *
+ * create WrappedRange from node
+ *
+ * @param {Node} node
+ * @return {WrappedRange}
+ */
+ createFromNode: function createFromNode(node) {
+ var sc = node;
+ var so = 0;
+ var ec = node;
+ var eo = dom.nodeLength(ec); // browsers can't target a picture or void node
+
+ if (dom.isVoid(sc)) {
+ so = dom.listPrev(sc).length - 1;
+ sc = sc.parentNode;
+ }
+
+ if (dom.isBR(ec)) {
+ eo = dom.listPrev(ec).length - 1;
+ ec = ec.parentNode;
+ } else if (dom.isVoid(ec)) {
+ eo = dom.listPrev(ec).length;
+ ec = ec.parentNode;
+ }
+
+ return this.create(sc, so, ec, eo);
+ },
+
+ /**
+ * create WrappedRange from node after position
+ *
+ * @param {Node} node
+ * @return {WrappedRange}
+ */
+ createFromNodeBefore: function createFromNodeBefore(node) {
+ return this.createFromNode(node).collapse(true);
+ },
+
+ /**
+ * create WrappedRange from node after position
+ *
+ * @param {Node} node
+ * @return {WrappedRange}
+ */
+ createFromNodeAfter: function createFromNodeAfter(node) {
+ return this.createFromNode(node).collapse();
+ },
+
+ /**
+ * @method
+ *
+ * create WrappedRange from bookmark
+ *
+ * @param {Node} editable
+ * @param {Object} bookmark
+ * @return {WrappedRange}
+ */
+ createFromBookmark: function createFromBookmark(editable, bookmark) {
+ var sc = dom.fromOffsetPath(editable, bookmark.s.path);
+ var so = bookmark.s.offset;
+ var ec = dom.fromOffsetPath(editable, bookmark.e.path);
+ var eo = bookmark.e.offset;
+ return new WrappedRange(sc, so, ec, eo);
+ },
+
+ /**
+ * @method
+ *
+ * create WrappedRange from paraBookmark
+ *
+ * @param {Object} bookmark
+ * @param {Node[]} paras
+ * @return {WrappedRange}
+ */
+ createFromParaBookmark: function createFromParaBookmark(bookmark, paras) {
+ var so = bookmark.s.offset;
+ var eo = bookmark.e.offset;
+ var sc = dom.fromOffsetPath(lists.head(paras), bookmark.s.path);
+ var ec = dom.fromOffsetPath(lists.last(paras), bookmark.e.path);
+ return new WrappedRange(sc, so, ec, eo);
+ }
+});
+;// CONCATENATED MODULE: ./src/js/core/key.js
+
+
+var KEY_MAP = {
+ 'BACKSPACE': 8,
+ 'TAB': 9,
+ 'ENTER': 13,
+ 'ESCAPE': 27,
+ 'SPACE': 32,
+ 'DELETE': 46,
+ // Arrow
+ 'LEFT': 37,
+ 'UP': 38,
+ 'RIGHT': 39,
+ 'DOWN': 40,
+ // Number: 0-9
+ 'NUM0': 48,
+ 'NUM1': 49,
+ 'NUM2': 50,
+ 'NUM3': 51,
+ 'NUM4': 52,
+ 'NUM5': 53,
+ 'NUM6': 54,
+ 'NUM7': 55,
+ 'NUM8': 56,
+ // Alphabet: a-z
+ 'B': 66,
+ 'E': 69,
+ 'I': 73,
+ 'J': 74,
+ 'K': 75,
+ 'L': 76,
+ 'R': 82,
+ 'S': 83,
+ 'U': 85,
+ 'V': 86,
+ 'Y': 89,
+ 'Z': 90,
+ 'SLASH': 191,
+ 'LEFTBRACKET': 219,
+ 'BACKSLASH': 220,
+ 'RIGHTBRACKET': 221,
+ // Navigation
+ 'HOME': 36,
+ 'END': 35,
+ 'PAGEUP': 33,
+ 'PAGEDOWN': 34
+};
+/**
+ * @class core.key
+ *
+ * Object for keycodes.
+ *
+ * @singleton
+ * @alternateClassName key
+ */
+
+/* harmony default export */ const key = ({
+ /**
+ * @method isEdit
+ *
+ * @param {Number} keyCode
+ * @return {Boolean}
+ */
+ isEdit: function isEdit(keyCode) {
+ return lists.contains([KEY_MAP.BACKSPACE, KEY_MAP.TAB, KEY_MAP.ENTER, KEY_MAP.SPACE, KEY_MAP.DELETE], keyCode);
+ },
+
+ /**
+ * @method isMove
+ *
+ * @param {Number} keyCode
+ * @return {Boolean}
+ */
+ isMove: function isMove(keyCode) {
+ return lists.contains([KEY_MAP.LEFT, KEY_MAP.UP, KEY_MAP.RIGHT, KEY_MAP.DOWN], keyCode);
+ },
+
+ /**
+ * @method isNavigation
+ *
+ * @param {Number} keyCode
+ * @return {Boolean}
+ */
+ isNavigation: function isNavigation(keyCode) {
+ return lists.contains([KEY_MAP.HOME, KEY_MAP.END, KEY_MAP.PAGEUP, KEY_MAP.PAGEDOWN], keyCode);
+ },
+
+ /**
+ * @property {Object} nameFromCode
+ * @property {String} nameFromCode.8 "BACKSPACE"
+ */
+ nameFromCode: func.invertObject(KEY_MAP),
+ code: KEY_MAP
+});
+;// CONCATENATED MODULE: ./src/js/core/async.js
+
+/**
+ * @method readFileAsDataURL
+ *
+ * read contents of file as representing URL
+ *
+ * @param {File} file
+ * @return {Promise} - then: dataUrl
+ */
+
+function readFileAsDataURL(file) {
+ return external_jQuery_default().Deferred(function (deferred) {
+ external_jQuery_default().extend(new FileReader(), {
+ onload: function onload(e) {
+ var dataURL = e.target.result;
+ deferred.resolve(dataURL);
+ },
+ onerror: function onerror(err) {
+ deferred.reject(err);
+ }
+ }).readAsDataURL(file);
+ }).promise();
+}
+/**
+ * @method createImage
+ *
+ * create `` from url string
+ *
+ * @param {String} url
+ * @return {Promise} - then: $image
+ */
+
+function createImage(url) {
+ return external_jQuery_default().Deferred(function (deferred) {
+ var $img = external_jQuery_default()('');
+ $img.one('load', function () {
+ $img.off('error abort');
+ deferred.resolve($img);
+ }).one('error abort', function () {
+ $img.off('load').detach();
+ deferred.reject($img);
+ }).css({
+ display: 'none'
+ }).appendTo(document.body).attr('src', url);
+ }).promise();
+}
+;// CONCATENATED MODULE: ./src/js/editing/History.js
+function History_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function History_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); } }
+
+function History_createClass(Constructor, protoProps, staticProps) { if (protoProps) History_defineProperties(Constructor.prototype, protoProps); if (staticProps) History_defineProperties(Constructor, staticProps); return Constructor; }
+
+
+
+var History = /*#__PURE__*/function () {
+ function History(context) {
+ History_classCallCheck(this, History);
+
+ this.stack = [];
+ this.stackOffset = -1;
+ this.context = context;
+ this.$editable = context.layoutInfo.editable;
+ this.editable = this.$editable[0];
+ }
+
+ History_createClass(History, [{
+ key: "makeSnapshot",
+ value: function makeSnapshot() {
+ var rng = range.create(this.editable);
+ var emptyBookmark = {
+ s: {
+ path: [],
+ offset: 0
+ },
+ e: {
+ path: [],
+ offset: 0
+ }
+ };
+ return {
+ contents: this.$editable.html(),
+ bookmark: rng && rng.isOnEditable() ? rng.bookmark(this.editable) : emptyBookmark
+ };
+ }
+ }, {
+ key: "applySnapshot",
+ value: function applySnapshot(snapshot) {
+ if (snapshot.contents !== null) {
+ this.$editable.html(snapshot.contents);
+ }
+
+ if (snapshot.bookmark !== null) {
+ range.createFromBookmark(this.editable, snapshot.bookmark).select();
+ }
+ }
+ /**
+ * @method rewind
+ * Rewinds the history stack back to the first snapshot taken.
+ * Leaves the stack intact, so that "Redo" can still be used.
+ */
+
+ }, {
+ key: "rewind",
+ value: function rewind() {
+ // Create snap shot if not yet recorded
+ if (this.$editable.html() !== this.stack[this.stackOffset].contents) {
+ this.recordUndo();
+ } // Return to the first available snapshot.
+
+
+ this.stackOffset = 0; // Apply that snapshot.
+
+ this.applySnapshot(this.stack[this.stackOffset]);
+ }
+ /**
+ * @method commit
+ * Resets history stack, but keeps current editor's content.
+ */
+
+ }, {
+ key: "commit",
+ value: function commit() {
+ // Clear the stack.
+ this.stack = []; // Restore stackOffset to its original value.
+
+ this.stackOffset = -1; // Record our first snapshot (of nothing).
+
+ this.recordUndo();
+ }
+ /**
+ * @method reset
+ * Resets the history stack completely; reverting to an empty editor.
+ */
+
+ }, {
+ key: "reset",
+ value: function reset() {
+ // Clear the stack.
+ this.stack = []; // Restore stackOffset to its original value.
+
+ this.stackOffset = -1; // Clear the editable area.
+
+ this.$editable.html(''); // Record our first snapshot (of nothing).
+
+ this.recordUndo();
+ }
+ /**
+ * undo
+ */
+
+ }, {
+ key: "undo",
+ value: function undo() {
+ // Create snap shot if not yet recorded
+ if (this.$editable.html() !== this.stack[this.stackOffset].contents) {
+ this.recordUndo();
+ }
+
+ if (this.stackOffset > 0) {
+ this.stackOffset--;
+ this.applySnapshot(this.stack[this.stackOffset]);
+ }
+ }
+ /**
+ * redo
+ */
+
+ }, {
+ key: "redo",
+ value: function redo() {
+ if (this.stack.length - 1 > this.stackOffset) {
+ this.stackOffset++;
+ this.applySnapshot(this.stack[this.stackOffset]);
+ }
+ }
+ /**
+ * recorded undo
+ */
+
+ }, {
+ key: "recordUndo",
+ value: function recordUndo() {
+ this.stackOffset++; // Wash out stack after stackOffset
+
+ if (this.stack.length > this.stackOffset) {
+ this.stack = this.stack.slice(0, this.stackOffset);
+ } // Create new snapshot and push it to the end
+
+
+ this.stack.push(this.makeSnapshot()); // If the stack size reachs to the limit, then slice it
+
+ if (this.stack.length > this.context.options.historyLimit) {
+ this.stack.shift();
+ this.stackOffset -= 1;
+ }
+ }
+ }]);
+
+ return History;
+}();
+
+
+;// CONCATENATED MODULE: ./src/js/editing/Style.js
+function Style_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function Style_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); } }
+
+function Style_createClass(Constructor, protoProps, staticProps) { if (protoProps) Style_defineProperties(Constructor.prototype, protoProps); if (staticProps) Style_defineProperties(Constructor, staticProps); return Constructor; }
+
+
+
+
+
+
+var Style = /*#__PURE__*/function () {
+ function Style() {
+ Style_classCallCheck(this, Style);
+ }
+
+ Style_createClass(Style, [{
+ key: "jQueryCSS",
+ value:
+ /**
+ * @method jQueryCSS
+ *
+ * [workaround] for old jQuery
+ * passing an array of style properties to .css()
+ * will result in an object of property-value pairs.
+ * (compability with version < 1.9)
+ *
+ * @private
+ * @param {jQuery} $obj
+ * @param {Array} propertyNames - An array of one or more CSS properties.
+ * @return {Object}
+ */
+ function jQueryCSS($obj, propertyNames) {
+ var result = {};
+ external_jQuery_default().each(propertyNames, function (idx, propertyName) {
+ result[propertyName] = $obj.css(propertyName);
+ });
+ return result;
+ }
+ /**
+ * returns style object from node
+ *
+ * @param {jQuery} $node
+ * @return {Object}
+ */
+
+ }, {
+ key: "fromNode",
+ value: function fromNode($node) {
+ var properties = ['font-family', 'font-size', 'text-align', 'list-style-type', 'line-height'];
+ var styleInfo = this.jQueryCSS($node, properties) || {};
+ var fontSize = $node[0].style.fontSize || styleInfo['font-size'];
+ styleInfo['font-size'] = parseInt(fontSize, 10);
+ styleInfo['font-size-unit'] = fontSize.match(/[a-z%]+$/);
+ return styleInfo;
+ }
+ /**
+ * paragraph level style
+ *
+ * @param {WrappedRange} rng
+ * @param {Object} styleInfo
+ */
+
+ }, {
+ key: "stylePara",
+ value: function stylePara(rng, styleInfo) {
+ external_jQuery_default().each(rng.nodes(dom.isPara, {
+ includeAncestor: true
+ }), function (idx, para) {
+ external_jQuery_default()(para).css(styleInfo);
+ });
+ }
+ /**
+ * insert and returns styleNodes on range.
+ *
+ * @param {WrappedRange} rng
+ * @param {Object} [options] - options for styleNodes
+ * @param {String} [options.nodeName] - default: `SPAN`
+ * @param {Boolean} [options.expandClosestSibling] - default: `false`
+ * @param {Boolean} [options.onlyPartialContains] - default: `false`
+ * @return {Node[]}
+ */
+
+ }, {
+ key: "styleNodes",
+ value: function styleNodes(rng, options) {
+ rng = rng.splitText();
+ var nodeName = options && options.nodeName || 'SPAN';
+ var expandClosestSibling = !!(options && options.expandClosestSibling);
+ var onlyPartialContains = !!(options && options.onlyPartialContains);
+
+ if (rng.isCollapsed()) {
+ return [rng.insertNode(dom.create(nodeName))];
+ }
+
+ var pred = dom.makePredByNodeName(nodeName);
+ var nodes = rng.nodes(dom.isText, {
+ fullyContains: true
+ }).map(function (text) {
+ return dom.singleChildAncestor(text, pred) || dom.wrap(text, nodeName);
+ });
+
+ if (expandClosestSibling) {
+ if (onlyPartialContains) {
+ var nodesInRange = rng.nodes(); // compose with partial contains predication
+
+ pred = func.and(pred, function (node) {
+ return lists.contains(nodesInRange, node);
+ });
+ }
+
+ return nodes.map(function (node) {
+ var siblings = dom.withClosestSiblings(node, pred);
+ var head = lists.head(siblings);
+ var tails = lists.tail(siblings);
+ external_jQuery_default().each(tails, function (idx, elem) {
+ dom.appendChildNodes(head, elem.childNodes);
+ dom.remove(elem);
+ });
+ return lists.head(siblings);
+ });
+ } else {
+ return nodes;
+ }
+ }
+ /**
+ * get current style on cursor
+ *
+ * @param {WrappedRange} rng
+ * @return {Object} - object contains style properties.
+ */
+
+ }, {
+ key: "current",
+ value: function current(rng) {
+ var $cont = external_jQuery_default()(!dom.isElement(rng.sc) ? rng.sc.parentNode : rng.sc);
+ var styleInfo = this.fromNode($cont); // document.queryCommandState for toggle state
+ // [workaround] prevent Firefox nsresult: "0x80004005 (NS_ERROR_FAILURE)"
+
+ try {
+ styleInfo = external_jQuery_default().extend(styleInfo, {
+ 'font-bold': document.queryCommandState('bold') ? 'bold' : 'normal',
+ 'font-italic': document.queryCommandState('italic') ? 'italic' : 'normal',
+ 'font-underline': document.queryCommandState('underline') ? 'underline' : 'normal',
+ 'font-subscript': document.queryCommandState('subscript') ? 'subscript' : 'normal',
+ 'font-superscript': document.queryCommandState('superscript') ? 'superscript' : 'normal',
+ 'font-strikethrough': document.queryCommandState('strikethrough') ? 'strikethrough' : 'normal',
+ 'font-family': document.queryCommandValue('fontname') || styleInfo['font-family']
+ });
+ } catch (e) {// eslint-disable-next-line
+ } // list-style-type to list-style(unordered, ordered)
+
+
+ if (!rng.isOnList()) {
+ styleInfo['list-style'] = 'none';
+ } else {
+ var orderedTypes = ['circle', 'disc', 'disc-leading-zero', 'square'];
+ var isUnordered = orderedTypes.indexOf(styleInfo['list-style-type']) > -1;
+ styleInfo['list-style'] = isUnordered ? 'unordered' : 'ordered';
+ }
+
+ var para = dom.ancestor(rng.sc, dom.isPara);
+
+ if (para && para.style['line-height']) {
+ styleInfo['line-height'] = para.style.lineHeight;
+ } else {
+ var lineHeight = parseInt(styleInfo['line-height'], 10) / parseInt(styleInfo['font-size'], 10);
+ styleInfo['line-height'] = lineHeight.toFixed(1);
+ }
+
+ styleInfo.anchor = rng.isOnAnchor() && dom.ancestor(rng.sc, dom.isAnchor);
+ styleInfo.ancestors = dom.listAncestor(rng.sc, dom.isEditable);
+ styleInfo.range = rng;
+ return styleInfo;
+ }
+ }]);
+
+ return Style;
+}();
+
+
+;// CONCATENATED MODULE: ./src/js/editing/Bullet.js
+function Bullet_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function Bullet_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); } }
+
+function Bullet_createClass(Constructor, protoProps, staticProps) { if (protoProps) Bullet_defineProperties(Constructor.prototype, protoProps); if (staticProps) Bullet_defineProperties(Constructor, staticProps); return Constructor; }
+
+
+
+
+
+
+
+var Bullet = /*#__PURE__*/function () {
+ function Bullet() {
+ Bullet_classCallCheck(this, Bullet);
+ }
+
+ Bullet_createClass(Bullet, [{
+ key: "insertOrderedList",
+ value:
+ /**
+ * toggle ordered list
+ */
+ function insertOrderedList(editable) {
+ this.toggleList('OL', editable);
+ }
+ /**
+ * toggle unordered list
+ */
+
+ }, {
+ key: "insertUnorderedList",
+ value: function insertUnorderedList(editable) {
+ this.toggleList('UL', editable);
+ }
+ /**
+ * indent
+ */
+
+ }, {
+ key: "indent",
+ value: function indent(editable) {
+ var _this = this;
+
+ var rng = range.create(editable).wrapBodyInlineWithPara();
+ var paras = rng.nodes(dom.isPara, {
+ includeAncestor: true
+ });
+ var clustereds = lists.clusterBy(paras, func.peq2('parentNode'));
+ external_jQuery_default().each(clustereds, function (idx, paras) {
+ var head = lists.head(paras);
+
+ if (dom.isLi(head)) {
+ var previousList = _this.findList(head.previousSibling);
+
+ if (previousList) {
+ paras.map(function (para) {
+ return previousList.appendChild(para);
+ });
+ } else {
+ _this.wrapList(paras, head.parentNode.nodeName);
+
+ paras.map(function (para) {
+ return para.parentNode;
+ }).map(function (para) {
+ return _this.appendToPrevious(para);
+ });
+ }
+ } else {
+ external_jQuery_default().each(paras, function (idx, para) {
+ external_jQuery_default()(para).css('marginLeft', function (idx, val) {
+ return (parseInt(val, 10) || 0) + 25;
+ });
+ });
+ }
+ });
+ rng.select();
+ }
+ /**
+ * outdent
+ */
+
+ }, {
+ key: "outdent",
+ value: function outdent(editable) {
+ var _this2 = this;
+
+ var rng = range.create(editable).wrapBodyInlineWithPara();
+ var paras = rng.nodes(dom.isPara, {
+ includeAncestor: true
+ });
+ var clustereds = lists.clusterBy(paras, func.peq2('parentNode'));
+ external_jQuery_default().each(clustereds, function (idx, paras) {
+ var head = lists.head(paras);
+
+ if (dom.isLi(head)) {
+ _this2.releaseList([paras]);
+ } else {
+ external_jQuery_default().each(paras, function (idx, para) {
+ external_jQuery_default()(para).css('marginLeft', function (idx, val) {
+ val = parseInt(val, 10) || 0;
+ return val > 25 ? val - 25 : '';
+ });
+ });
+ }
+ });
+ rng.select();
+ }
+ /**
+ * toggle list
+ *
+ * @param {String} listName - OL or UL
+ */
+
+ }, {
+ key: "toggleList",
+ value: function toggleList(listName, editable) {
+ var _this3 = this;
+
+ var rng = range.create(editable).wrapBodyInlineWithPara();
+ var paras = rng.nodes(dom.isPara, {
+ includeAncestor: true
+ });
+ var bookmark = rng.paraBookmark(paras);
+ var clustereds = lists.clusterBy(paras, func.peq2('parentNode')); // paragraph to list
+
+ if (lists.find(paras, dom.isPurePara)) {
+ var wrappedParas = [];
+ external_jQuery_default().each(clustereds, function (idx, paras) {
+ wrappedParas = wrappedParas.concat(_this3.wrapList(paras, listName));
+ });
+ paras = wrappedParas; // list to paragraph or change list style
+ } else {
+ var diffLists = rng.nodes(dom.isList, {
+ includeAncestor: true
+ }).filter(function (listNode) {
+ return !external_jQuery_default().nodeName(listNode, listName);
+ });
+
+ if (diffLists.length) {
+ external_jQuery_default().each(diffLists, function (idx, listNode) {
+ dom.replace(listNode, listName);
+ });
+ } else {
+ paras = this.releaseList(clustereds, true);
+ }
+ }
+
+ range.createFromParaBookmark(bookmark, paras).select();
+ }
+ /**
+ * @param {Node[]} paras
+ * @param {String} listName
+ * @return {Node[]}
+ */
+
+ }, {
+ key: "wrapList",
+ value: function wrapList(paras, listName) {
+ var head = lists.head(paras);
+ var last = lists.last(paras);
+ var prevList = dom.isList(head.previousSibling) && head.previousSibling;
+ var nextList = dom.isList(last.nextSibling) && last.nextSibling;
+ var listNode = prevList || dom.insertAfter(dom.create(listName || 'UL'), last); // P to LI
+
+ paras = paras.map(function (para) {
+ return dom.isPurePara(para) ? dom.replace(para, 'LI') : para;
+ }); // append to list(
"),makePredByNodeName:x,isEditable:C,isControlSizing:function(t){return t&&e()(t).hasClass("note-control-sizing")},isText:S,isElement:function(t){return t&&1===t.nodeType},isVoid:T,isPara:E,isPurePara:function(t){return E(t)&&!$(t)},isHeading:function(t){return t&&/^H[1-7]/.test(t.nodeName.toUpperCase())},isInline:R,isBlock:v.not(R),isBodyInline:function(t){return R(t)&&!W(t,E)},isBody:B,isParaInline:function(t){return R(t)&&!!W(t,E)},isPre:I,isList:L,isTable:N,isData:P,isCell:F,isBlockquote:D,isBodyContainer:H,isAnchor:z,isDiv:x("DIV"),isLi:$,isBR:x("BR"),isSpan:x("SPAN"),isB:x("B"),isU:x("U"),isS:x("S"),isI:x("I"),isImg:x("IMG"),isTextarea:ut,deepestChildIsEmpty:function(t){do{if(null===t.firstElementChild||""===t.firstElementChild.innerHTML)break}while(t=t.firstElementChild);return U(t)},isEmpty:U,isEmptyAnchor:v.and(z,U),isClosestSibling:function(t,e){return t.nextSibling===e||t.previousSibling===e},withClosestSiblings:function(t,e){e=e||v.ok;var n=[];return t.previousSibling&&e(t.previousSibling)&&n.push(t.previousSibling),n.push(t),t.nextSibling&&e(t.nextSibling)&&n.push(t.nextSibling),n},nodeLength:O,isLeftEdgePoint:G,isRightEdgePoint:Y,isEdgePoint:Z,isLeftEdgeOf:Q,isRightEdgeOf:X,isLeftEdgePointOf:function(t,e){return G(t)&&Q(t.node,e)},isRightEdgePointOf:function(t,e){return Y(t)&&X(t.node,e)},prevPoint:et,nextPoint:nt,nextPointWithEmptyNode:ot,isSamePoint:rt,isVisiblePoint:function(t){if(S(t.node)||!tt(t.node)||U(t.node))return!0;var e=t.node.childNodes[t.offset-1],n=t.node.childNodes[t.offset];return!((e&&!T(e)||n&&!T(n))&&!N(n))},prevPointUntil:function(t,e){for(;t;){if(e(t))return t;t=et(t)}return null},nextPointUntil:function(t,e){for(;t;){if(e(t))return t;t=nt(t)}return null},isCharPoint:function(t){if(!S(t.node))return!1;var e=t.node.nodeValue.charAt(t.offset-1);return e&&" "!==e&&e!==w},isSpacePoint:function(t){if(!S(t.node))return!1;var e=t.node.nodeValue.charAt(t.offset-1);return" "===e||e===w},walkPoint:function(t,e,n,o){for(var i=t;i&&(n(i),!rt(i,e));){i=ot(i,o&&t.node!==i.node&&e.node!==i.node)}},ancestor:W,singleChildAncestor:function(t,e){for(t=t.parentNode;t&&1===O(t);){if(e(t))return t;if(C(t))break;t=t.parentNode}return null},listAncestor:K,lastAncestor:function(t,e){var n=K(t);return k.last(n.filter(e))},listNext:V,listPrev:function(t,e){e=e||v.fail;for(var n=[];t&&!e(t);)n.push(t),t=t.previousSibling;return n},listDescendant:function(t,e){var n=[];return e=e||v.ok,function o(i){t!==i&&e(i)&&n.push(i);for(var r=0,a=i.childNodes.length;r-1)return o;return null},wrap:function(t,n){var o=t.parentNode,i=e()("<"+n+">")[0];return o.insertBefore(i,t),i.appendChild(t),i},insertAfter:q,appendChildNodes:_,position:J,hasChildren:tt,makeOffsetPath:function(t,e){return K(e,v.eq(t)).map(J).reverse()},fromOffsetPath:function(t,e){for(var n=t,o=0,i=e.length;o\s]*)(.*?)(\s*\/?>)/g,(function(t,e,n){n=n.toUpperCase();var o=/^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(n)&&!!e,i=/^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(n);return t+(o||i?"\n":"")}))).trim()}return n},value:dt,posFromPlaceholder:function(t){var n=e()(t),o=n.offset(),i=n.outerHeight(!0);return{left:o.left,top:o.top+i}},attachEvents:function(t,e){Object.keys(e).forEach((function(n){t.on(n,e[n])}))},detachEvents:function(t,e){Object.keys(e).forEach((function(n){t.off(n,e[n])}))},isCustomStyleTag:function(t){return t&&!S(t)&&k.contains(t.classList,"note-styletag")}};function ft(t,e){for(var n=0;n1,i=o&&k.head(n),r=o?k.last(n):k.head(n),a=this.modules[i||"editor"];return!i&&this[r]?this[r].apply(this,e):a&&a[r]&&a.shouldInitialize()?a[r].apply(a,e):void 0}}],o&&ft(n.prototype,o),i&&ft(n,i),t}();function vt(t,e){for(var n=0;n=0)break;o=a[n]}if(0!==n&&ht.isText(a[n-1])){var s=document.body.createTextRange(),l=null;s.moveToElementText(o||i),s.collapse(!o),l=o?o.nextSibling:i.firstChild;var c=t.duplicate();c.setEndPoint("StartToStart",s);for(var u=c.text.replace(/[\r\n]/g,"").length;u>l.nodeValue.length&&l.nextSibling;)u-=l.nodeValue.length,l=l.nextSibling;l.nodeValue;e&&l.nextSibling&&ht.isText(l.nextSibling)&&u===l.nodeValue.length&&(u-=l.nodeValue.length,l=l.nextSibling),i=l,n=u}return{cont:i,offset:n}}function gt(t){var e=document.body.createTextRange(),n=function t(e,n){var o,i;if(ht.isText(e)){var r=ht.listPrev(e,v.not(ht.isText)),a=k.last(r).previousSibling;o=a||e.parentNode,n+=k.sum(k.tail(r),ht.nodeLength),i=!a}else{if(o=e.childNodes[n]||e,ht.isText(o))return t(o,0);n=0,i=!1}return{node:o,collapseToStart:i,offset:n}}(t.node,t.offset);return e.moveToElementText(n.node),e.collapse(n.collapseToStart),e.moveStart("character",n.offset),e}e().fn.extend({summernote:function(){var t=e().type(k.head(arguments)),n="string"===t,o="object"===t,i=e().extend({},e().summernote.options,o?k.head(arguments):{});i.langInfo=e().extend(!0,{},e().summernote.lang["en-US"],e().summernote.lang[i.lang]),i.icons=e().extend(!0,{},e().summernote.options.icons,i.icons),i.tooltip="auto"===i.tooltip?!f.isSupportTouch:i.tooltip,this.each((function(t,n){var o=e()(n);if(!o.data("summernote")){var r=new pt(o,i);o.data("summernote",r),o.data("summernote").triggerEvent("init",r.layoutInfo)}}));var r=this.first();if(r.length){var a=r.data("summernote");if(n)return a.invoke.apply(a,k.from(arguments));i.focus&&a.invoke("editor.focus")}return this}});var bt=function(){function t(e,n,o,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.sc=e,this.so=n,this.ec=o,this.eo=i,this.isOnEditable=this.makeIsOn(ht.isEditable),this.isOnList=this.makeIsOn(ht.isList),this.isOnAnchor=this.makeIsOn(ht.isAnchor),this.isOnCell=this.makeIsOn(ht.isCell),this.isOnData=this.makeIsOn(ht.isData)}var n,o,i;return n=t,o=[{key:"nativeRange",value:function(){if(f.isW3CRangeSupport){var t=document.createRange();return t.setStart(this.sc,this.so),t.setEnd(this.ec,this.eo),t}var e=gt({node:this.sc,offset:this.so});return e.setEndPoint("EndToEnd",gt({node:this.ec,offset:this.eo})),e}},{key:"getPoints",value:function(){return{sc:this.sc,so:this.so,ec:this.ec,eo:this.eo}}},{key:"getStartPoint",value:function(){return{node:this.sc,offset:this.so}}},{key:"getEndPoint",value:function(){return{node:this.ec,offset:this.eo}}},{key:"select",value:function(){var t=this.nativeRange();if(f.isW3CRangeSupport){var e=document.getSelection();e.rangeCount>0&&e.removeAllRanges(),e.addRange(t)}else t.select();return this}},{key:"scrollIntoView",value:function(t){var n=e()(t).height();return t.scrollTop+n0?n.so-1:0];if(e){var i=ht.listPrev(e,ht.isParaInline).reverse();if((i=i.concat(ht.listNext(e.nextSibling,ht.isParaInline))).length){var r=ht.wrap(k.head(i),"p");ht.appendChildNodes(r,k.tail(i))}}return this.normalize()}},{key:"insertNode",value:function(t){var e=this;(ht.isText(t)||ht.isInline(t))&&(e=this.wrapBodyInlineWithPara().deleteContents());var n=ht.splitPoint(e.getStartPoint(),ht.isInline(t));return n.rightNode?(n.rightNode.parentNode.insertBefore(t,n.rightNode),ht.isEmpty(n.rightNode)&&ht.isPara(t)&&n.rightNode.parentNode.removeChild(n.rightNode)):n.container.appendChild(t),t}},{key:"pasteHTML",value:function(t){t=e().trim(t);var n=e()("").html(t)[0],o=k.from(n.childNodes),i=this,r=!1;return i.so>=0&&(o=o.reverse(),r=!0),o=o.map((function(t){return i.insertNode(t)})),r&&(o=o.reverse()),o}},{key:"toString",value:function(){var t=this.nativeRange();return f.isW3CRangeSupport?t.toString():t.text}},{key:"getWordRange",value:function(e){var n=this.getEndPoint();if(!ht.isCharPoint(n))return this;var o=ht.prevPointUntil(n,(function(t){return!ht.isCharPoint(t)}));return e&&(n=ht.nextPointUntil(n,(function(t){return!ht.isCharPoint(t)}))),new t(o.node,o.offset,n.node,n.offset)}},{key:"getWordsRange",value:function(e){var n=this.getEndPoint(),o=function(t){return!ht.isCharPoint(t)&&!ht.isSpacePoint(t)};if(o(n))return this;var i=ht.prevPointUntil(n,o);return e&&(n=ht.nextPointUntil(n,o)),new t(i.node,i.offset,n.node,n.offset)}},{key:"getWordsMatchRange",value:function(e){var n=this.getEndPoint(),o=ht.prevPointUntil(n,(function(o){if(!ht.isCharPoint(o)&&!ht.isSpacePoint(o))return!0;var i=new t(o.node,o.offset,n.node,n.offset),r=e.exec(i.toString());return r&&0===r.index})),i=new t(o.node,o.offset,n.node,n.offset),r=i.toString(),a=e.exec(r);return a&&a[0].length===r.length?i:null}},{key:"bookmark",value:function(t){return{s:{path:ht.makeOffsetPath(t,this.sc),offset:this.so},e:{path:ht.makeOffsetPath(t,this.ec),offset:this.eo}}}},{key:"paraBookmark",value:function(t){return{s:{path:k.tail(ht.makeOffsetPath(k.head(t),this.sc)),offset:this.so},e:{path:k.tail(ht.makeOffsetPath(k.last(t),this.ec)),offset:this.eo}}}},{key:"getClientRects",value:function(){return this.nativeRange().getClientRects()}}],o&&vt(n.prototype,o),i&&vt(n,i),t}();const yt={create:function(t,e,n,o){if(4===arguments.length)return new bt(t,e,n,o);if(2===arguments.length)return new bt(t,e,n=t,o=e);var i=this.createFromSelection();if(!i&&1===arguments.length){var r=arguments[0];return ht.isEditable(r)&&(r=r.lastChild),this.createFromBodyElement(r,ht.emptyPara===arguments[0].innerHTML)}return i},createFromBodyElement:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.createFromNode(t);return n.collapse(e)},createFromSelection:function(){var t,e,n,o;if(f.isW3CRangeSupport){var i=document.getSelection();if(!i||0===i.rangeCount)return null;if(ht.isBody(i.anchorNode))return null;var r=i.getRangeAt(0);t=r.startContainer,e=r.startOffset,n=r.endContainer,o=r.endOffset}else{var a=document.selection.createRange(),s=a.duplicate();s.collapse(!1);var l=a;l.collapse(!0);var c=mt(l,!0),u=mt(s,!1);ht.isText(c.node)&&ht.isLeftEdgePoint(c)&&ht.isTextNode(u.node)&&ht.isRightEdgePoint(u)&&u.node.nextSibling===c.node&&(c=u),t=c.cont,e=c.offset,n=u.cont,o=u.offset}return new bt(t,e,n,o)},createFromNode:function(t){var e=t,n=0,o=t,i=ht.nodeLength(o);return ht.isVoid(e)&&(n=ht.listPrev(e).length-1,e=e.parentNode),ht.isBR(o)?(i=ht.listPrev(o).length-1,o=o.parentNode):ht.isVoid(o)&&(i=ht.listPrev(o).length,o=o.parentNode),this.create(e,n,o,i)},createFromNodeBefore:function(t){return this.createFromNode(t).collapse(!0)},createFromNodeAfter:function(t){return this.createFromNode(t).collapse()},createFromBookmark:function(t,e){var n=ht.fromOffsetPath(t,e.s.path),o=e.s.offset,i=ht.fromOffsetPath(t,e.e.path),r=e.e.offset;return new bt(n,o,i,r)},createFromParaBookmark:function(t,e){var n=t.s.offset,o=t.e.offset,i=ht.fromOffsetPath(k.head(e),t.s.path),r=ht.fromOffsetPath(k.last(e),t.e.path);return new bt(i,n,r,o)}};var kt={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,DELETE:46,LEFT:37,UP:38,RIGHT:39,DOWN:40,NUM0:48,NUM1:49,NUM2:50,NUM3:51,NUM4:52,NUM5:53,NUM6:54,NUM7:55,NUM8:56,B:66,E:69,I:73,J:74,K:75,L:76,R:82,S:83,U:85,V:86,Y:89,Z:90,SLASH:191,LEFTBRACKET:219,BACKSLASH:220,RIGHTBRACKET:221,HOME:36,END:35,PAGEUP:33,PAGEDOWN:34};const wt={isEdit:function(t){return k.contains([kt.BACKSPACE,kt.TAB,kt.ENTER,kt.SPACE,kt.DELETE],t)},isMove:function(t){return k.contains([kt.LEFT,kt.UP,kt.RIGHT,kt.DOWN],t)},isNavigation:function(t){return k.contains([kt.HOME,kt.END,kt.PAGEUP,kt.PAGEDOWN],t)},nameFromCode:v.invertObject(kt),code:kt};function Ct(t,e){for(var n=0;n0&&(this.stackOffset--,this.applySnapshot(this.stack[this.stackOffset]))}},{key:"redo",value:function(){this.stack.length-1>this.stackOffset&&(this.stackOffset++,this.applySnapshot(this.stack[this.stackOffset]))}},{key:"recordUndo",value:function(){this.stackOffset++,this.stack.length>this.stackOffset&&(this.stack=this.stack.slice(0,this.stackOffset)),this.stack.push(this.makeSnapshot()),this.stack.length>this.context.options.historyLimit&&(this.stack.shift(),this.stackOffset-=1)}}])&&Ct(e.prototype,n),o&&Ct(e,o),t}();function St(t,e){for(var n=0;n-1;o["list-style"]=i?"unordered":"ordered"}else o["list-style"]="none";var r=ht.ancestor(t.sc,ht.isPara);if(r&&r.style["line-height"])o["line-height"]=r.style.lineHeight;else{var a=parseInt(o["line-height"],10)/parseInt(o["font-size"],10);o["line-height"]=a.toFixed(1)}return o.anchor=t.isOnAnchor()&&ht.ancestor(t.sc,ht.isAnchor),o.ancestors=ht.listAncestor(t.sc,ht.isEditable),o.range=t,o}}],o&&St(n.prototype,o),i&&St(n,i),t}();function Et(t,e){for(var n=0;n25?e-25:""}))}))})),o.select()}},{key:"toggleList",value:function(t,n){var o=this,i=yt.create(n).wrapBodyInlineWithPara(),r=i.nodes(ht.isPara,{includeAncestor:!0}),a=i.paraBookmark(r),s=k.clusterBy(r,v.peq2("parentNode"));if(k.find(r,ht.isPurePara)){var l=[];e().each(s,(function(e,n){l=l.concat(o.wrapList(n,t))})),r=l}else{var c=i.nodes(ht.isList,{includeAncestor:!0}).filter((function(n){return!e().nodeName(n,t)}));c.length?e().each(c,(function(e,n){ht.replace(n,t)})):r=this.releaseList(s,!0)}yt.createFromParaBookmark(a,r).select()}},{key:"wrapList",value:function(t,e){var n=k.head(t),o=k.last(t),i=ht.isList(n.previousSibling)&&n.previousSibling,r=ht.isList(o.nextSibling)&&o.nextSibling,a=i||ht.insertAfter(ht.create(e||"UL"),o);return t=t.map((function(t){return ht.isPurePara(t)?ht.replace(t,"LI"):t})),ht.appendChildNodes(a,t),r&&(ht.appendChildNodes(a,k.from(r.childNodes)),ht.remove(r)),t}},{key:"releaseList",value:function(t,n){var o=this,i=[];return e().each(t,(function(t,r){var a=k.head(r),s=k.last(r),l=n?ht.lastAncestor(a,ht.isList):a.parentNode,c=l.parentNode;if("LI"===l.parentNode.nodeName)r.map((function(t){var e=o.findNextSiblings(t);c.nextSibling?c.parentNode.insertBefore(t,c.nextSibling):c.parentNode.appendChild(t),e.length&&(o.wrapList(e,l.nodeName),t.appendChild(e[0].parentNode))})),0===l.children.length&&c.removeChild(l),0===c.childNodes.length&&c.parentNode.removeChild(c);else{var u=l.childNodes.length>1?ht.splitTree(l,{node:s.parentNode,offset:ht.position(s)+1},{isSkipPaddingBlankHTML:!0}):null,d=ht.splitTree(l,{node:a.parentNode,offset:ht.position(a)},{isSkipPaddingBlankHTML:!0});r=n?ht.listDescendant(d,ht.isLi):k.from(d.childNodes).filter(ht.isLi),!n&&ht.isList(l.parentNode)||(r=r.map((function(t){return ht.replace(t,"P")}))),e().each(k.from(r).reverse(),(function(t,e){ht.insertAfter(e,l)}));var h=k.compact([l,d,u]);e().each(h,(function(t,n){var o=[n].concat(ht.listDescendant(n,ht.isList));e().each(o.reverse(),(function(t,e){ht.nodeLength(e)||ht.remove(e,!0)}))}))}i=i.concat(r)})),i}},{key:"appendToPrevious",value:function(t){return t.previousSibling?ht.appendChildNodes(t.previousSibling,[t]):this.wrapList([t],"LI")}},{key:"findList",value:function(t){return t?k.find(t.children,(function(t){return["OL","UL"].indexOf(t.nodeName)>-1})):null}},{key:"findNextSiblings",value:function(t){for(var e=[];t.nextSibling;)e.push(t.nextSibling),t=t.nextSibling;return e}}],o&&Et(n.prototype,o),i&&Et(n,i),t}();function $t(t,e){for(var n=0;n1,i=e.rowSpan>1,a=t.rowIndex===r.rowPos&&e.cellIndex===r.colPos;l(t.rowIndex,n,t,e,i,o,!1);var s=e.attributes.rowSpan?parseInt(e.attributes.rowSpan.value,10):0;if(s>1)for(var c=1;c1)for(var p=1;p=n.cellIndex&&n.cellIndex<=e&&!o&&r.colPos++}function f(e){switch(n){case t.where.Column:if(e.isColSpan)return t.resultAction.SubtractSpanCount;break;case t.where.Row:if(!e.isVirtual&&e.isRowSpan)return t.resultAction.AddCell;if(e.isRowSpan)return t.resultAction.SubtractSpanCount}return t.resultAction.RemoveCell}function p(e){switch(n){case t.where.Column:if(e.isColSpan)return t.resultAction.SumSpanCount;if(e.isRowSpan&&e.isVirtual)return t.resultAction.Ignore;break;case t.where.Row:if(e.isRowSpan)return t.resultAction.SumSpanCount;if(e.isColSpan&&e.isVirtual)return t.resultAction.Ignore}return t.resultAction.AddCell}this.getActionList=function(){for(var e=n===t.where.Row?r.rowPos:-1,i=n===t.where.Column?r.colPos:-1,l=0,u=!0;u;){var d=e>=0?e:l,h=i>=0?i:l,v=a[d];if(!v)return u=!1,s;var m=v[h];if(!m)return u=!1,s;var g=t.resultAction.Ignore;switch(o){case t.requestAction.Add:g=p(m);break;case t.requestAction.Delete:g=f(m)}s.push(c(m,g,d,h)),l++}return s},e&&e.tagName&&("td"===e.tagName.toLowerCase()||"th"===e.tagName.toLowerCase())&&(r.colPos=e.cellIndex,e.parentElement&&e.parentElement.tagName&&"tr"===e.parentElement.tagName.toLowerCase()&&(r.rowPos=e.parentElement.rowIndex)),function(){for(var t=i.rows,e=0;e"),s=new Rt(o,Rt.where.Row,Rt.requestAction.Add,e()(i).closest("table")[0]).getActionList(),l=0;l"+ht.blank+"");break;case Rt.resultAction.SumSpanCount:if("top"===n&&(c.baseCell.parent?c.baseCell.closest("tr").rowIndex:0)<=i[0].rowIndex){var d=e()("").append(e()(""+ht.blank+" | ").removeAttr("rowspan")).html();a.append(d);break}var h=parseInt(c.baseCell.rowSpan,10);h++,c.baseCell.setAttribute("rowSpan",h)}}if("top"===n)i.before(a);else{if(o.rowSpan>1){var f=i[0].rowIndex+(o.rowSpan-2);return void e()(e()(i).parent().find("tr")[f]).after(e()(a))}i.after(a)}}},{key:"addCol",value:function(t,n){var o=ht.ancestor(t.commonAncestor(),ht.isCell),i=e()(o).closest("tr");e()(i).siblings().push(i);for(var r=new Rt(o,Rt.where.Column,Rt.requestAction.Add,e()(i).closest("table")[0]).getActionList(),a=0;a"+ht.blank+""):e()(s.baseCell).before(""+ht.blank+" | ");break;case Rt.resultAction.SumSpanCount:if("right"===n){var c=parseInt(s.baseCell.colSpan,10);c++,s.baseCell.setAttribute("colSpan",c)}else e()(s.baseCell).before(""+ht.blank+" | ")}}}},{key:"recoverAttributes",value:function(t){var e="";if(!t)return e;for(var n=t.attributes||[],o=0;o1,d=u?parseInt(l.rowSpan,10):0;switch(a[s].action){case Rt.resultAction.Ignore:continue;case Rt.resultAction.AddCell:var h=o.next("tr")[0];if(!h)continue;var f=o[0].cells[i];u&&(d>2?(d--,h.insertBefore(f,h.cells[i]),h.cells[i].setAttribute("rowSpan",d),h.cells[i].innerHTML=""):2===d&&(h.insertBefore(f,h.cells[i]),h.cells[i].removeAttribute("rowSpan"),h.cells[i].innerHTML=""));continue;case Rt.resultAction.SubtractSpanCount:u&&(d>2?(d--,l.setAttribute("rowSpan",d),c.rowIndex!==r&&l.cellIndex===i&&(l.innerHTML="")):2===d&&(l.removeAttribute("rowSpan"),c.rowIndex!==r&&l.cellIndex===i&&(l.innerHTML="")));continue;case Rt.resultAction.RemoveCell:continue}}o.remove()}},{key:"deleteCol",value:function(t){for(var n=ht.ancestor(t.commonAncestor(),ht.isCell),o=e()(n).closest("tr"),i=o.children("td, th").index(e()(n)),r=new Rt(n,Rt.where.Column,Rt.requestAction.Delete,e()(o).closest("table")[0]).getActionList(),a=0;a1){var l=s.colSpan?parseInt(s.colSpan,10):0;l>2?(l--,s.setAttribute("colSpan",l),s.cellIndex===i&&(s.innerHTML="")):2===l&&(s.removeAttribute("colSpan"),s.cellIndex===i&&(s.innerHTML=""))}continue;case Rt.resultAction.RemoveCell:ht.remove(r[a].baseCell,!0);continue}}},{key:"createTable",value:function(t,n,o){for(var i,r=[],a=0;a"+ht.blank+"");i=r.join("");for(var s,l=[],c=0;c"+i+"");s=l.join("");var u=e()("");return o&&o.tableClassName&&u.addClass(o.tableClassName),u[0]}},{key:"deleteTable",value:function(t){var n=ht.ancestor(t.commonAncestor(),ht.isCell);e()(n).closest("table").remove()}}],o&&Pt(n.prototype,o),i&&Pt(n,i),t}();function At(t,e){for(var n=0;n0&&o.isLimited(l))){var c=s.toString()!==i;"string"==typeof n&&(n=n.trim()),o.options.onCreateLink?n=o.options.onCreateLink(n):a&&(n=/^([A-Za-z][A-Za-z0-9+-.]*\:|#|\/)/.test(n)?n:o.options.defaultProtocol+n);var u=[];if(c){var d=(s=s.deleteContents()).insertNode(e()(""+i+"")[0]);u.push(d)}else u=o.style.styleNodes(s,{nodeName:"A",expandClosestSibling:!0,onlyPartialContains:!0});e().each(u,(function(t,o){e()(o).attr("href",n),r?e()(o).attr("target","_blank"):e()(o).removeAttr("target")})),o.setLastRange(o.createRangeFromList(u).select())}})),this.color=this.wrapCommand((function(t){var e=t.foreColor,n=t.backColor;e&&document.execCommand("foreColor",!1,e),n&&document.execCommand("backColor",!1,n)})),this.foreColor=this.wrapCommand((function(t){document.execCommand("foreColor",!1,t)})),this.insertTable=this.wrapCommand((function(t){var e=t.split("x");o.getLastRange().deleteContents().insertNode(o.table.createTable(e[0],e[1],o.options))})),this.removeMedia=this.wrapCommand((function(){var t=e()(o.restoreTarget()).parent();t.closest("figure").length?t.closest("figure").remove():t=e()(o.restoreTarget()).detach(),o.context.triggerEvent("media.delete",t,o.$editable)})),this.floatMe=this.wrapCommand((function(t){var n=e()(o.restoreTarget());n.toggleClass("note-float-left","left"===t),n.toggleClass("note-float-right","right"===t),n.css("float","none"===t?"":t)})),this.resize=this.wrapCommand((function(t){var n=e()(o.restoreTarget());0===(t=parseFloat(t))?n.css("width",""):n.css({width:100*t+"%",height:""})}))}var n,o,i;return n=t,o=[{key:"initialize",value:function(){var t=this;this.$editable.on("keydown",(function(e){if(e.keyCode===wt.code.ENTER&&t.context.triggerEvent("enter",e),t.context.triggerEvent("keydown",e),t.snapshot=t.history.makeSnapshot(),t.hasKeyShortCut=!1,e.isDefaultPrevented()||(t.options.shortcuts?t.hasKeyShortCut=t.handleKeyMap(e):t.preventDefaultEditableShortCuts(e)),t.isLimited(1,e)){var n=t.getLastRange();if(n.eo-n.so==0)return!1}t.setLastRange(),t.options.recordEveryKeystroke&&!1===t.hasKeyShortCut&&t.history.recordUndo()})).on("keyup",(function(e){t.setLastRange(),t.context.triggerEvent("keyup",e)})).on("focus",(function(e){t.setLastRange(),t.context.triggerEvent("focus",e)})).on("blur",(function(e){t.context.triggerEvent("blur",e)})).on("mousedown",(function(e){t.context.triggerEvent("mousedown",e)})).on("mouseup",(function(e){t.setLastRange(),t.history.recordUndo(),t.context.triggerEvent("mouseup",e)})).on("scroll",(function(e){t.context.triggerEvent("scroll",e)})).on("paste",(function(e){t.setLastRange(),t.context.triggerEvent("paste",e)})).on("input",(function(){t.isLimited(0)&&t.snapshot&&t.history.applySnapshot(t.snapshot)})),this.$editable.attr("spellcheck",this.options.spellCheck),this.$editable.attr("autocorrect",this.options.spellCheck),this.options.disableGrammar&&this.$editable.attr("data-gramm",!1),this.$editable.html(ht.html(this.$note)||ht.emptyPara),this.$editable.on(f.inputEventName,v.debounce((function(){t.context.triggerEvent("change",t.$editable.html(),t.$editable)}),10)),this.$editable.on("focusin",(function(e){t.context.triggerEvent("focusin",e)})).on("focusout",(function(e){t.context.triggerEvent("focusout",e)})),this.options.airMode?this.options.overrideContextMenu&&this.$editor.on("contextmenu",(function(e){return t.context.triggerEvent("contextmenu",e),!1})):(this.options.width&&this.$editor.outerWidth(this.options.width),this.options.height&&this.$editable.outerHeight(this.options.height),this.options.maxHeight&&this.$editable.css("max-height",this.options.maxHeight),this.options.minHeight&&this.$editable.css("min-height",this.options.minHeight)),this.history.recordUndo(),this.setLastRange()}},{key:"destroy",value:function(){this.$editable.off()}},{key:"handleKeyMap",value:function(t){var e=this.options.keyMap[f.isMac?"mac":"pc"],n=[];t.metaKey&&n.push("CMD"),t.ctrlKey&&!t.altKey&&n.push("CTRL"),t.shiftKey&&n.push("SHIFT");var o=wt.nameFromCode[t.keyCode];o&&n.push(o);var i=e[n.join("+")];if("TAB"!==o||this.options.tabDisable)if(i){if(!1!==this.context.invoke(i))return t.preventDefault(),!0}else wt.isEdit(t.keyCode)&&this.afterCommand();else this.afterCommand();return!1}},{key:"preventDefaultEditableShortCuts",value:function(t){(t.ctrlKey||t.metaKey)&&k.contains([66,73,85],t.keyCode)&&t.preventDefault()}},{key:"isLimited",value:function(t,e){return t=t||0,(void 0===e||!(wt.isMove(e.keyCode)||wt.isNavigation(e.keyCode)||e.ctrlKey||e.metaKey||k.contains([wt.code.BACKSPACE,wt.code.DELETE],e.keyCode)))&&this.options.maxTextLength>0&&this.$editable.text().length+t>this.options.maxTextLength}},{key:"createRange",value:function(){return this.focus(),this.setLastRange(),this.getLastRange()}},{key:"createRangeFromList",value:function(t){var e=yt.createFromNodeBefore(k.head(t)).getStartPoint(),n=yt.createFromNodeAfter(k.last(t)).getEndPoint();return yt.create(e.node,e.offset,n.node,n.offset)}},{key:"setLastRange",value:function(t){t?this.lastRange=t:(this.lastRange=yt.create(this.editable),0===e()(this.lastRange.sc).closest(".note-editable").length&&(this.lastRange=yt.createFromBodyElement(this.editable)))}},{key:"getLastRange",value:function(){return this.lastRange||this.setLastRange(),this.lastRange}},{key:"saveRange",value:function(t){t&&this.getLastRange().collapse().select()}},{key:"restoreRange",value:function(){this.lastRange&&(this.lastRange.select(),this.focus())}},{key:"saveTarget",value:function(t){this.$editable.data("target",t)}},{key:"clearTarget",value:function(){this.$editable.removeData("target")}},{key:"restoreTarget",value:function(){return this.$editable.data("target")}},{key:"currentStyle",value:function(){var t=yt.create();return t&&(t=t.normalize()),t?this.style.current(t):this.style.fromNode(this.$editable)}},{key:"styleFromNode",value:function(t){return this.style.fromNode(t)}},{key:"undo",value:function(){this.context.triggerEvent("before.command",this.$editable.html()),this.history.undo(),this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"commit",value:function(){this.context.triggerEvent("before.command",this.$editable.html()),this.history.commit(),this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"redo",value:function(){this.context.triggerEvent("before.command",this.$editable.html()),this.history.redo(),this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"beforeCommand",value:function(){this.context.triggerEvent("before.command",this.$editable.html()),document.execCommand("styleWithCSS",!1,this.options.styleWithCSS),this.focus()}},{key:"afterCommand",value:function(t){this.normalizeContent(),this.history.recordUndo(),t||this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"tab",value:function(){var t=this.getLastRange();if(t.isCollapsed()&&t.isOnCell())this.table.tab(t);else{if(0===this.options.tabSize)return!1;this.isLimited(this.options.tabSize)||(this.beforeCommand(),this.typing.insertTab(t,this.options.tabSize),this.afterCommand())}}},{key:"untab",value:function(){var t=this.getLastRange();if(t.isCollapsed()&&t.isOnCell())this.table.tab(t,!0);else if(0===this.options.tabSize)return!1}},{key:"wrapCommand",value:function(t){return function(){this.beforeCommand(),t.apply(this,arguments),this.afterCommand()}}},{key:"insertImage",value:function(t,n){var o,i=this;return(o=t,e().Deferred((function(t){var n=e()("");n.one("load",(function(){n.off("error abort"),t.resolve(n)})).one("error abort",(function(){n.off("load").detach(),t.reject(n)})).css({display:"none"}).appendTo(document.body).attr("src",o)})).promise()).then((function(t){i.beforeCommand(),"function"==typeof n?n(t):("string"==typeof n&&t.attr("data-filename",n),t.css("width",Math.min(i.$editable.width(),t.width()))),t.show(),i.getLastRange().insertNode(t[0]),i.setLastRange(yt.createFromNodeAfter(t[0]).select()),i.afterCommand()})).fail((function(t){i.context.triggerEvent("image.upload.error",t)}))}},{key:"insertImagesAsDataURL",value:function(t){var n=this;e().each(t,(function(t,o){var i=o.name;n.options.maximumImageFileSize&&n.options.maximumImageFileSize":t),n&&n.length&&(n[0].tagName.toUpperCase()!==t.toUpperCase()&&(n=n.find(t)),n&&n.length)){var o=this.createRange(),i=e()([o.sc,o.ec]).closest(t);i.removeClass();var r=n[0].className||"";r&&i.addClass(r)}}},{key:"formatPara",value:function(){this.formatBlock("P")}},{key:"fontStyling",value:function(t,n){var o=this.getLastRange();if(""!==o){var i=this.style.styleNodes(o);if(this.$editor.find(".note-status-output").html(""),e()(i).css(t,n),o.isCollapsed()){var r=k.head(i);r&&!ht.nodeLength(r)&&(r.innerHTML=ht.ZERO_WIDTH_NBSP_CHAR,yt.createFromNode(r.firstChild).select(),this.setLastRange(),this.$editable.data("bogus",r))}else this.setLastRange(this.createRangeFromList(i).select())}else{var a=e().now();this.$editor.find(".note-status-output").html(''+this.lang.output.noSelection+"
"),setTimeout((function(){e()("#note-status-output-"+a).remove()}),5e3)}}},{key:"unlink",value:function(){var t=this.getLastRange();if(t.isOnAnchor()){var e=ht.ancestor(t.sc,ht.isAnchor);(t=yt.createFromNode(e)).select(),this.setLastRange(),this.beforeCommand(),document.execCommand("unlink"),this.afterCommand()}}},{key:"getLinkInfo",value:function(){var t=this.getLastRange().expand(ht.isAnchor),n=e()(k.head(t.nodes(ht.isAnchor))),o={range:t,text:t.toString(),url:n.length?n.attr("href"):""};return n.length&&(o.isNewWindow="_blank"===n.attr("target")),o}},{key:"addRow",value:function(t){var e=this.getLastRange(this.$editable);e.isCollapsed()&&e.isOnCell()&&(this.beforeCommand(),this.table.addRow(e,t),this.afterCommand())}},{key:"addCol",value:function(t){var e=this.getLastRange(this.$editable);e.isCollapsed()&&e.isOnCell()&&(this.beforeCommand(),this.table.addCol(e,t),this.afterCommand())}},{key:"deleteRow",value:function(){var t=this.getLastRange(this.$editable);t.isCollapsed()&&t.isOnCell()&&(this.beforeCommand(),this.table.deleteRow(t),this.afterCommand())}},{key:"deleteCol",value:function(){var t=this.getLastRange(this.$editable);t.isCollapsed()&&t.isOnCell()&&(this.beforeCommand(),this.table.deleteCol(t),this.afterCommand())}},{key:"deleteTable",value:function(){var t=this.getLastRange(this.$editable);t.isCollapsed()&&t.isOnCell()&&(this.beforeCommand(),this.table.deleteTable(t),this.afterCommand())}},{key:"resizeTo",value:function(t,e,n){var o;if(n){var i=t.y/t.x,r=e.data("ratio");o={width:r>i?t.x:t.y/r,height:r>i?t.x*r:t.y}}else o={width:t.x,height:t.y};e.css(o)}},{key:"hasFocus",value:function(){return this.$editable.is(":focus")}},{key:"focus",value:function(){this.hasFocus()||this.$editable.focus()}},{key:"isEmpty",value:function(){return ht.isEmpty(this.$editable[0])||ht.emptyPara===this.$editable.html()}},{key:"empty",value:function(){this.context.invoke("code",ht.emptyPara)}},{key:"normalizeContent",value:function(){this.$editable[0].normalize()}}],o&&At(n.prototype,o),i&&At(n,i),t}();function Dt(t,e){for(var n=0;n1?n.items[1]:k.head(n.items);"file"===o.kind&&-1!==o.type.indexOf("image/")?(this.context.invoke("editor.insertImagesOrCallback",[o.getAsFile()]),t.preventDefault()):"string"===o.kind&&this.context.invoke("editor.isLimited",n.getData("Text").length)&&t.preventDefault()}else if(window.clipboardData){var i=window.clipboardData.getData("text");this.context.invoke("editor.isLimited",i.length)&&t.preventDefault()}setTimeout((function(){e.context.invoke("editor.afterCommand")}),10)}}])&&Dt(e.prototype,n),o&&Dt(e,o),t}();function zt(t,e){for(var n=0;n','',""].join("")).prependTo(this.$editor)}var n,o,i;return n=t,o=[{key:"initialize",value:function(){this.options.disableDragAndDrop?(this.documentEventHandlers.onDrop=function(t){t.preventDefault()},this.$eventListener=this.$dropzone,this.$eventListener.on("drop",this.documentEventHandlers.onDrop)):this.attachDragAndDropEvent()}},{key:"attachDragAndDropEvent",value:function(){var t=this,n=e()(),o=this.$dropzone.find(".note-dropzone-message");this.documentEventHandlers.onDragenter=function(e){var i=t.context.invoke("codeview.isActivated"),r=t.$editor.width()>0&&t.$editor.height()>0;i||n.length||!r||(t.$editor.addClass("dragover"),t.$dropzone.width(t.$editor.width()),t.$dropzone.height(t.$editor.height()),o.text(t.lang.image.dragImageHere)),n=n.add(e.target)},this.documentEventHandlers.onDragleave=function(o){(n=n.not(o.target)).length&&"BODY"!==o.target.nodeName||(n=e()(),t.$editor.removeClass("dragover"))},this.documentEventHandlers.onDrop=function(){n=e()(),t.$editor.removeClass("dragover")},this.$eventListener.on("dragenter",this.documentEventHandlers.onDragenter).on("dragleave",this.documentEventHandlers.onDragleave).on("drop",this.documentEventHandlers.onDrop),this.$dropzone.on("dragenter",(function(){t.$dropzone.addClass("hover"),o.text(t.lang.image.dropImage)})).on("dragleave",(function(){t.$dropzone.removeClass("hover"),o.text(t.lang.image.dragImageHere)})),this.$dropzone.on("drop",(function(n){var o=n.originalEvent.dataTransfer;n.preventDefault(),o&&o.files&&o.files.length?(t.$editable.focus(),t.context.invoke("editor.insertImagesOrCallback",o.files)):e().each(o.types,(function(n,i){if(!(i.toLowerCase().indexOf("_moz_")>-1)){var r=o.getData(i);i.toLowerCase().indexOf("text")>-1?t.context.invoke("editor.pasteHTML",r):e()(r).each((function(e,n){t.context.invoke("editor.insertNode",n)}))}}))})).on("dragover",!1)}},{key:"destroy",value:function(){var t=this;Object.keys(this.documentEventHandlers).forEach((function(e){t.$eventListener.off(e.substr(2).toLowerCase(),t.documentEventHandlers[e])})),this.documentEventHandlers={}}}],o&&zt(n.prototype,o),i&&zt(n,i),t}();function Mt(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Ot(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ot(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var o=0,i=function(){};return{s:i,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,r=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw r}}}}function Ot(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n.*?(?:<\/iframe>)?)/gi,(function(t){if(/<.+src(?==?('|"|\s)?)[\s\S]+src(?=('|"|\s)?)[^>]*?>/i.test(t))return"";var n,o=Mt(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(new RegExp('src="(https?:)?//'+i.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+'/(.+)"').test(t))return t}}catch(t){o.e(t)}finally{o.f()}return""}))}return t}},{key:"activate",value:function(){var t=this,e=this.CodeMirrorConstructor;if(this.$codable.val(ht.html(this.$editable,this.options.prettifyHtml)),this.$codable.height(this.$editable.height()),this.context.invoke("toolbar.updateCodeview",!0),this.context.invoke("airPopover.updateCodeview",!0),this.$editor.addClass("codeview"),this.$codable.focus(),e){var n=e.fromTextArea(this.$codable[0],this.options.codemirror);if(this.options.codemirror.tern){var o=new e.TernServer(this.options.codemirror.tern);n.ternServer=o,n.on("cursorActivity",(function(t){o.updateArgHints(t)}))}n.on("blur",(function(e){t.context.triggerEvent("blur.codeview",n.getValue(),e)})),n.on("change",(function(){t.context.triggerEvent("change.codeview",n.getValue(),n)})),n.setSize(null,this.$editable.outerHeight()),this.$codable.data("cmEditor",n)}else this.$codable.on("blur",(function(e){t.context.triggerEvent("blur.codeview",t.$codable.val(),e)})),this.$codable.on("input",(function(){t.context.triggerEvent("change.codeview",t.$codable.val(),t.$codable)}))}},{key:"deactivate",value:function(){if(this.CodeMirrorConstructor){var t=this.$codable.data("cmEditor");this.$codable.val(t.getValue()),t.toTextArea()}var e=this.purify(ht.value(this.$codable,this.options.prettifyHtml)||ht.emptyPara),n=this.$editable.html()!==e;this.$editable.html(e),this.$editable.height(this.options.height?this.$codable.height():"auto"),this.$editor.removeClass("codeview"),n&&this.context.triggerEvent("change",this.$editable.html(),this.$editable),this.$editable.focus(),this.context.invoke("toolbar.updateCodeview",!1),this.context.invoke("airPopover.updateCodeview",!1)}},{key:"destroy",value:function(){this.isActivated()&&this.deactivate()}}],n&&Ut(e.prototype,n),o&&Ut(e,o),t}();function Wt(t,e){for(var n=0;n0?Math.max(i,t.options.minheight):i,i=t.options.maxHeight>0?Math.min(i,t.options.maxHeight):i,r=t.options.minheight>0?Math.max(r,t.options.minheight):r,r=t.options.maxHeight>0?Math.min(r,t.options.maxHeight):r,t.$editable.height(i),t.$codable.height(r)};t.$document.on("mousemove",i).one("mouseup",(function(){t.$document.off("mousemove",i)}))}))}},{key:"destroy",value:function(){this.$statusbar.off(),this.$statusbar.addClass("locked")}}])&&Wt(n.prototype,o),i&&Wt(n,i),t}();function Vt(t,e){for(var n=0;n','','
','
','
','
','
',this.options.disableResizeImage?"":'
',"
",""].join("")).prependTo(this.$editingArea),this.$handle.on("mousedown",(function(e){if(ht.isControlSizing(e.target)){e.preventDefault(),e.stopPropagation();var n=t.$handle.find(".note-control-selection").data("target"),o=n.offset(),i=t.$document.scrollTop(),r=function(e){t.context.invoke("editor.resizeTo",{x:e.clientX-o.left,y:e.clientY-(o.top-i)},n,!e.shiftKey),t.update(n[0],e)};t.$document.on("mousemove",r).one("mouseup",(function(e){e.preventDefault(),t.$document.off("mousemove",r),t.context.invoke("editor.afterCommand")})),n.data("ratio")||n.data("ratio",n.height()/n.width())}})),this.$handle.on("wheel",(function(e){e.preventDefault(),t.update()}))}},{key:"destroy",value:function(){this.$handle.remove()}},{key:"update",value:function(t,n){if(this.context.isDisabled())return!1;var o=ht.isImg(t),i=this.$handle.find(".note-control-selection");if(this.context.invoke("imagePopover.update",t,n),o){var r=e()(t),a=r.position(),s={left:a.left+parseInt(r.css("marginLeft"),10),top:a.top+parseInt(r.css("marginTop"),10)},l={w:r.outerWidth(!1),h:r.outerHeight(!1)};i.css({display:"block",left:s.left,top:s.top,width:l.w,height:l.h}).data("target",r);var c=new Image;c.src=r.attr("src");var u=l.w+"x"+l.h+" ("+this.lang.image.original+": "+c.width+"x"+c.height+")";i.find(".note-control-selection-info").text(u),this.context.invoke("editor.saveTarget",t)}else this.hide();return o}},{key:"hide",value:function(){this.context.invoke("editor.clearTarget"),this.$handle.children().hide()}}],o&&_t(n.prototype,o),i&&_t(n,i),t}();function Yt(t,e){for(var n=0;n").html(i).attr("href",o)[0];this.context.options.linkTargetBlank&&e()(r).attr("target","_blank"),this.lastWordRange.insertNode(r),this.lastWordRange=null,this.context.invoke("editor.focus")}}}},{key:"handleKeydown",value:function(t){if(k.contains([wt.code.ENTER,wt.code.SPACE],t.keyCode)){var e=this.context.invoke("editor.createRange").getWordRange();this.lastWordRange=e}}},{key:"handleKeyup",value:function(t){k.contains([wt.code.ENTER,wt.code.SPACE],t.keyCode)&&this.replace()}}])&&Yt(n.prototype,o),i&&Yt(n,i),t}();function Xt(t,e){for(var n=0;n'),this.$placeholder.on("click",(function(){t.context.invoke("focus")})).html(this.options.placeholder).prependTo(this.$editingArea),this.update()}},{key:"destroy",value:function(){this.$placeholder.remove()}},{key:"update",value:function(){var t=!this.context.invoke("codeview.isActivated")&&this.context.invoke("editor.isEmpty");this.$placeholder.toggle(t)}}])&&ne(n.prototype,o),i&&ne(n,i),t}();function ie(t,e){for(var n=0;n',''+this.lang.color.background+"
","",'","
",'\x3c!-- back colors --\x3e
',"",'",'',"
",'',""].join(""):"")+(i?['','
'+this.lang.color.foreground+"
","
",'","
",'
\x3c!-- fore colors --\x3e
',"
",'",'',"
",'
',"
"].join(""):""),callback:function(t){t.find(".note-holder").each((function(t,n){var o=e()(n);o.append(r.ui.palette({colors:r.options.colors,colorsName:r.options.colorsName,eventName:o.data("event"),container:r.options.container,tooltip:r.options.tooltip}).render())}));var n=[["#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF"]];t.find(".note-holder-custom").each((function(t,o){var i=e()(o);i.append(r.ui.palette({colors:n,colorsName:n,eventName:i.data("event"),container:r.options.container,tooltip:r.options.tooltip}).render())})),t.find("input[type=color]").each((function(n,o){e()(o).change((function(){var n=t.find("#"+e()(this).data("event")).find(".note-color-btn").first(),o=this.value.toUpperCase();n.css("background-color",o).attr("aria-label",o).attr("data-value",o).attr("data-original-title",o),n.click()}))}))},click:function(n){n.stopPropagation();var o=e()("."+t).find(".note-dropdown-menu"),i=e()(n.target),a=i.data("event"),s=i.attr("data-value");if("openPalette"===a){var l=o.find("#"+s),c=e()(o.find("#"+l.data("event")).find(".note-color-row")[0]),u=c.find(".note-color-btn").last().detach(),d=l.val();u.css("background-color",d).attr("aria-label",d).attr("data-value",d).attr("data-original-title",d),c.prepend(u),l.click()}else{if(k.contains(["backColor","foreColor"],a)){var h="backColor"===a?"background-color":"color",f=i.closest(".note-color").find(".note-recent-color"),p=i.closest(".note-color").find(".note-current-color-button");f.css(h,s),p.attr("data-"+a,s)}r.context.invoke("editor."+a,s)}}})]}).render()}},{key:"addToolbarButtons",value:function(){var t=this;this.context.memo("button.style",(function(){return t.ui.buttonGroup([t.button({className:"dropdown-toggle",contents:t.ui.dropdownButtonContents(t.ui.icon(t.options.icons.magic),t.options),tooltip:t.lang.style.style,data:{toggle:"dropdown"}}),t.ui.dropdown({className:"dropdown-style",items:t.options.styleTags,title:t.lang.style.style,template:function(e){"string"==typeof e&&(e={tag:e,title:Object.prototype.hasOwnProperty.call(t.lang.style,e)?t.lang.style[e]:e});var n=e.tag,o=e.title;return"<"+n+(e.style?' style="'+e.style+'" ':"")+(e.className?' class="'+e.className+'"':"")+">"+o+""+n+">"},click:t.context.createInvokeHandler("editor.formatBlock")})]).render()}));for(var n=function(e,n){var o=t.options.styleTags[e];t.context.memo("button.style."+o,(function(){return t.button({className:"note-btn-style-"+o,contents:''+o.toUpperCase()+"
",tooltip:t.lang.style[o],click:t.context.createInvokeHandler("editor.formatBlock")}).render()}))},o=0,i=this.options.styleTags.length;o',t.options),tooltip:t.lang.font.name,data:{toggle:"dropdown"}}),t.ui.dropdownCheck({className:"dropdown-fontname",checkClassName:t.options.icons.menuCheck,items:t.options.fontNames.filter(t.isFontInstalled.bind(t)),title:t.lang.font.name,template:function(t){return''+t+""},click:t.context.createInvokeHandlerAndUpdateState("editor.fontName")})]).render()})),this.context.memo("button.fontsize",(function(){return t.ui.buttonGroup([t.button({className:"dropdown-toggle",contents:t.ui.dropdownButtonContents('',t.options),tooltip:t.lang.font.size,data:{toggle:"dropdown"}}),t.ui.dropdownCheck({className:"dropdown-fontsize",checkClassName:t.options.icons.menuCheck,items:t.options.fontSizes,title:t.lang.font.size,click:t.context.createInvokeHandlerAndUpdateState("editor.fontSize")})]).render()})),this.context.memo("button.fontsizeunit",(function(){return t.ui.buttonGroup([t.button({className:"dropdown-toggle",contents:t.ui.dropdownButtonContents('',t.options),tooltip:t.lang.font.sizeunit,data:{toggle:"dropdown"}}),t.ui.dropdownCheck({className:"dropdown-fontsizeunit",checkClassName:t.options.icons.menuCheck,items:t.options.fontSizeUnits,title:t.lang.font.sizeunit,click:t.context.createInvokeHandlerAndUpdateState("editor.fontSizeUnit")})]).render()})),this.context.memo("button.color",(function(){return t.colorPalette("note-color-all",t.lang.color.recent,!0,!0)})),this.context.memo("button.forecolor",(function(){return t.colorPalette("note-color-fore",t.lang.color.foreground,!1,!0)})),this.context.memo("button.backcolor",(function(){return t.colorPalette("note-color-back",t.lang.color.background,!0,!1)})),this.context.memo("button.ul",(function(){return t.button({contents:t.ui.icon(t.options.icons.unorderedlist),tooltip:t.lang.lists.unordered+t.representShortcut("insertUnorderedList"),click:t.context.createInvokeHandler("editor.insertUnorderedList")}).render()})),this.context.memo("button.ol",(function(){return t.button({contents:t.ui.icon(t.options.icons.orderedlist),tooltip:t.lang.lists.ordered+t.representShortcut("insertOrderedList"),click:t.context.createInvokeHandler("editor.insertOrderedList")}).render()}));var r=this.button({contents:this.ui.icon(this.options.icons.alignLeft),tooltip:this.lang.paragraph.left+this.representShortcut("justifyLeft"),click:this.context.createInvokeHandler("editor.justifyLeft")}),a=this.button({contents:this.ui.icon(this.options.icons.alignCenter),tooltip:this.lang.paragraph.center+this.representShortcut("justifyCenter"),click:this.context.createInvokeHandler("editor.justifyCenter")}),s=this.button({contents:this.ui.icon(this.options.icons.alignRight),tooltip:this.lang.paragraph.right+this.representShortcut("justifyRight"),click:this.context.createInvokeHandler("editor.justifyRight")}),l=this.button({contents:this.ui.icon(this.options.icons.alignJustify),tooltip:this.lang.paragraph.justify+this.representShortcut("justifyFull"),click:this.context.createInvokeHandler("editor.justifyFull")}),c=this.button({contents:this.ui.icon(this.options.icons.outdent),tooltip:this.lang.paragraph.outdent+this.representShortcut("outdent"),click:this.context.createInvokeHandler("editor.outdent")}),u=this.button({contents:this.ui.icon(this.options.icons.indent),tooltip:this.lang.paragraph.indent+this.representShortcut("indent"),click:this.context.createInvokeHandler("editor.indent")});this.context.memo("button.justifyLeft",v.invoke(r,"render")),this.context.memo("button.justifyCenter",v.invoke(a,"render")),this.context.memo("button.justifyRight",v.invoke(s,"render")),this.context.memo("button.justifyFull",v.invoke(l,"render")),this.context.memo("button.outdent",v.invoke(c,"render")),this.context.memo("button.indent",v.invoke(u,"render")),this.context.memo("button.paragraph",(function(){return t.ui.buttonGroup([t.button({className:"dropdown-toggle",contents:t.ui.dropdownButtonContents(t.ui.icon(t.options.icons.alignLeft),t.options),tooltip:t.lang.paragraph.paragraph,data:{toggle:"dropdown"}}),t.ui.dropdown([t.ui.buttonGroup({className:"note-align",children:[r,a,s,l]}),t.ui.buttonGroup({className:"note-list",children:[c,u]})])]).render()})),this.context.memo("button.height",(function(){return t.ui.buttonGroup([t.button({className:"dropdown-toggle",contents:t.ui.dropdownButtonContents(t.ui.icon(t.options.icons.textHeight),t.options),tooltip:t.lang.font.height,data:{toggle:"dropdown"}}),t.ui.dropdownCheck({items:t.options.lineHeights,checkClassName:t.options.icons.menuCheck,className:"dropdown-line-height",title:t.lang.font.height,click:t.context.createInvokeHandler("editor.lineHeight")})]).render()})),this.context.memo("button.table",(function(){return t.ui.buttonGroup([t.button({className:"dropdown-toggle",contents:t.ui.dropdownButtonContents(t.ui.icon(t.options.icons.table),t.options),tooltip:t.lang.table.table,data:{toggle:"dropdown"}}),t.ui.dropdown({title:t.lang.table.table,className:"note-table",items:['",'1 x 1
'].join("")})],{callback:function(e){e.find(".note-dimension-picker-mousecatcher").css({width:t.options.insertTableMaxSize.col+"em",height:t.options.insertTableMaxSize.row+"em"}).mouseup(t.context.createInvokeHandler("editor.insertTable")).on("mousemove",t.tableMoveHandler.bind(t))}}).render()})),this.context.memo("button.link",(function(){return t.button({contents:t.ui.icon(t.options.icons.link),tooltip:t.lang.link.link+t.representShortcut("linkDialog.show"),click:t.context.createInvokeHandler("linkDialog.show")}).render()})),this.context.memo("button.picture",(function(){return t.button({contents:t.ui.icon(t.options.icons.picture),tooltip:t.lang.image.image,click:t.context.createInvokeHandler("imageDialog.show")}).render()})),this.context.memo("button.video",(function(){return t.button({contents:t.ui.icon(t.options.icons.video),tooltip:t.lang.video.video,click:t.context.createInvokeHandler("videoDialog.show")}).render()})),this.context.memo("button.hr",(function(){return t.button({contents:t.ui.icon(t.options.icons.minus),tooltip:t.lang.hr.insert+t.representShortcut("insertHorizontalRule"),click:t.context.createInvokeHandler("editor.insertHorizontalRule")}).render()})),this.context.memo("button.fullscreen",(function(){return t.button({className:"btn-fullscreen note-codeview-keep",contents:t.ui.icon(t.options.icons.arrowsAlt),tooltip:t.lang.options.fullscreen,click:t.context.createInvokeHandler("fullscreen.toggle")}).render()})),this.context.memo("button.codeview",(function(){return t.button({className:"btn-codeview note-codeview-keep",contents:t.ui.icon(t.options.icons.code),tooltip:t.lang.options.codeview,click:t.context.createInvokeHandler("codeview.toggle")}).render()})),this.context.memo("button.redo",(function(){return t.button({contents:t.ui.icon(t.options.icons.redo),tooltip:t.lang.history.redo+t.representShortcut("redo"),click:t.context.createInvokeHandler("editor.redo")}).render()})),this.context.memo("button.undo",(function(){return t.button({contents:t.ui.icon(t.options.icons.undo),tooltip:t.lang.history.undo+t.representShortcut("undo"),click:t.context.createInvokeHandler("editor.undo")}).render()})),this.context.memo("button.help",(function(){return t.button({contents:t.ui.icon(t.options.icons.question),tooltip:t.lang.options.help,click:t.context.createInvokeHandler("helpDialog.show")}).render()}))}},{key:"addImagePopoverButtons",value:function(){var t=this;this.context.memo("button.resizeFull",(function(){return t.button({contents:'100%',tooltip:t.lang.image.resizeFull,click:t.context.createInvokeHandler("editor.resize","1")}).render()})),this.context.memo("button.resizeHalf",(function(){return t.button({contents:'50%',tooltip:t.lang.image.resizeHalf,click:t.context.createInvokeHandler("editor.resize","0.5")}).render()})),this.context.memo("button.resizeQuarter",(function(){return t.button({contents:'25%',tooltip:t.lang.image.resizeQuarter,click:t.context.createInvokeHandler("editor.resize","0.25")}).render()})),this.context.memo("button.resizeNone",(function(){return t.button({contents:t.ui.icon(t.options.icons.rollback),tooltip:t.lang.image.resizeNone,click:t.context.createInvokeHandler("editor.resize","0")}).render()})),this.context.memo("button.floatLeft",(function(){return t.button({contents:t.ui.icon(t.options.icons.floatLeft),tooltip:t.lang.image.floatLeft,click:t.context.createInvokeHandler("editor.floatMe","left")}).render()})),this.context.memo("button.floatRight",(function(){return t.button({contents:t.ui.icon(t.options.icons.floatRight),tooltip:t.lang.image.floatRight,click:t.context.createInvokeHandler("editor.floatMe","right")}).render()})),this.context.memo("button.floatNone",(function(){return t.button({contents:t.ui.icon(t.options.icons.rollback),tooltip:t.lang.image.floatNone,click:t.context.createInvokeHandler("editor.floatMe","none")}).render()})),this.context.memo("button.removeMedia",(function(){return t.button({contents:t.ui.icon(t.options.icons.trash),tooltip:t.lang.image.remove,click:t.context.createInvokeHandler("editor.removeMedia")}).render()}))}},{key:"addLinkPopoverButtons",value:function(){var t=this;this.context.memo("button.linkDialogShow",(function(){return t.button({contents:t.ui.icon(t.options.icons.link),tooltip:t.lang.link.edit,click:t.context.createInvokeHandler("linkDialog.show")}).render()})),this.context.memo("button.unlink",(function(){return t.button({contents:t.ui.icon(t.options.icons.unlink),tooltip:t.lang.link.unlink,click:t.context.createInvokeHandler("editor.unlink")}).render()}))}},{key:"addTablePopoverButtons",value:function(){var t=this;this.context.memo("button.addRowUp",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.rowAbove),tooltip:t.lang.table.addRowAbove,click:t.context.createInvokeHandler("editor.addRow","top")}).render()})),this.context.memo("button.addRowDown",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.rowBelow),tooltip:t.lang.table.addRowBelow,click:t.context.createInvokeHandler("editor.addRow","bottom")}).render()})),this.context.memo("button.addColLeft",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.colBefore),tooltip:t.lang.table.addColLeft,click:t.context.createInvokeHandler("editor.addCol","left")}).render()})),this.context.memo("button.addColRight",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.colAfter),tooltip:t.lang.table.addColRight,click:t.context.createInvokeHandler("editor.addCol","right")}).render()})),this.context.memo("button.deleteRow",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.rowRemove),tooltip:t.lang.table.delRow,click:t.context.createInvokeHandler("editor.deleteRow")}).render()})),this.context.memo("button.deleteCol",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.colRemove),tooltip:t.lang.table.delCol,click:t.context.createInvokeHandler("editor.deleteCol")}).render()})),this.context.memo("button.deleteTable",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.trash),tooltip:t.lang.table.delTable,click:t.context.createInvokeHandler("editor.deleteTable")}).render()}))}},{key:"build",value:function(t,e){for(var n=0,o=e.length;n3&&c3&&ul&&ac)&&(this.isFollowing=!1,this.$toolbar.css({position:"relative",top:0,width:"100%",zIndex:"auto"}),this.$editable.css({marginTop:""}))}},{key:"changeContainer",value:function(t){t?this.$toolbar.prependTo(this.$editor):this.options.toolbarContainer&&this.$toolbar.appendTo(this.options.toolbarContainer),this.options.followingToolbar&&this.followScroll()}},{key:"updateFullscreen",value:function(t){this.ui.toggleBtnActive(this.$toolbar.find(".btn-fullscreen"),t),this.changeContainer(t)}},{key:"updateCodeview",value:function(t){this.ui.toggleBtnActive(this.$toolbar.find(".btn-codeview"),t),t?this.deactivate():this.activate()}},{key:"activate",value:function(t){var e=this.$toolbar.find("button");t||(e=e.not(".note-codeview-keep")),this.ui.toggleBtn(e,!0)}},{key:"deactivate",value:function(t){var e=this.$toolbar.find("button");t||(e=e.not(".note-codeview-keep")),this.ui.toggleBtn(e,!1)}}])&&ae(n.prototype,o),i&&ae(n,i),t}();function le(t,e){for(var n=0;n','"),''),"",'','"),''),"
",this.options.disableLinkTarget?"":e()("").append(this.ui.checkbox({className:"sn-checkbox-open-in-new-window",text:this.lang.link.openInNewWindow,checked:!0}).render()).html(),e()("").append(this.ui.checkbox({className:"sn-checkbox-use-protocol",text:this.lang.link.useProtocol,checked:!0}).render()).html()].join(""),o='');this.$dialog=this.ui.dialog({className:"link-dialog",title:this.lang.link.insert,fade:this.options.dialogsFade,body:n,footer:o}).render().appendTo(t)}},{key:"destroy",value:function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"bindEnterKey",value:function(t,e){t.on("keypress",(function(t){t.keyCode===wt.code.ENTER&&(t.preventDefault(),e.trigger("click"))}))}},{key:"toggleLinkBtn",value:function(t,e,n){this.ui.toggleBtn(t,e.val()&&n.val())}},{key:"showLinkDialog",value:function(t){var n=this;return e().Deferred((function(e){var o=n.$dialog.find(".note-link-text"),i=n.$dialog.find(".note-link-url"),r=n.$dialog.find(".note-link-btn"),a=n.$dialog.find(".sn-checkbox-open-in-new-window input[type=checkbox]"),s=n.$dialog.find(".sn-checkbox-use-protocol input[type=checkbox]");n.ui.onDialogShown(n.$dialog,(function(){n.context.triggerEvent("dialog.shown"),!t.url&&v.isValidUrl(t.text)&&(t.url=t.text),o.on("input paste propertychange",(function(){t.text=o.val(),n.toggleLinkBtn(r,o,i)})).val(t.text),i.on("input paste propertychange",(function(){t.text||o.val(i.val()),n.toggleLinkBtn(r,o,i)})).val(t.url),f.isSupportTouch||i.trigger("focus"),n.toggleLinkBtn(r,o,i),n.bindEnterKey(i,r),n.bindEnterKey(o,r);var l=void 0!==t.isNewWindow?t.isNewWindow:n.context.options.linkTargetBlank;a.prop("checked",l);var c=!t.url&&n.context.options.useProtocol;s.prop("checked",c),r.one("click",(function(r){r.preventDefault(),e.resolve({range:t.range,url:i.val(),text:o.val(),isNewWindow:a.is(":checked"),checkProtocol:s.is(":checked")}),n.ui.hideDialog(n.$dialog)}))})),n.ui.onDialogHidden(n.$dialog,(function(){o.off(),i.off(),r.off(),"pending"===e.state()&&e.reject()})),n.ui.showDialog(n.$dialog)})).promise()}},{key:"show",value:function(){var t=this,e=this.context.invoke("editor.getLinkInfo");this.context.invoke("editor.saveRange"),this.showLinkDialog(e).then((function(e){t.context.invoke("editor.restoreRange"),t.context.invoke("editor.createLink",e)})).fail((function(){t.context.invoke("editor.restoreRange")}))}}])&&le(n.prototype,o),i&&le(n,i),t}();function ue(t,e){for(var n=0;n ')}}).render().appendTo(this.options.container);var t=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",t,this.options.popover.link),this.$popover.on("mousedown",(function(t){t.preventDefault()}))}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"update",value:function(){if(this.context.invoke("editor.hasFocus")){var t=this.context.invoke("editor.getLastRange");if(t.isCollapsed()&&t.isOnAnchor()){var n=ht.ancestor(t.sc,ht.isAnchor),o=e()(n).attr("href");this.$popover.find("a").attr("href",o).text(o);var i=ht.posFromPlaceholder(n),r=e()(this.options.container).offset();i.top-=r.top,i.left-=r.left,this.$popover.css({display:"block",left:i.left,top:i.top})}else this.hide()}else this.hide()}},{key:"hide",value:function(){this.$popover.hide()}}])&&ue(n.prototype,o),i&&ue(n,i),t}();function he(t,e){for(var n=0;n".concat(this.lang.image.maximumFileSize+" : "+n,"")}var o=this.options.dialogsInBody?this.$body:this.options.container,i=['','",'',t,"
",'','",'',"
"].join(""),r='');this.$dialog=this.ui.dialog({title:this.lang.image.insert,fade:this.options.dialogsFade,body:i,footer:r}).render().appendTo(o)}},{key:"destroy",value:function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"bindEnterKey",value:function(t,e){t.on("keypress",(function(t){t.keyCode===wt.code.ENTER&&(t.preventDefault(),e.trigger("click"))}))}},{key:"show",value:function(){var t=this;this.context.invoke("editor.saveRange"),this.showImageDialog().then((function(e){t.ui.hideDialog(t.$dialog),t.context.invoke("editor.restoreRange"),"string"==typeof e?t.options.callbacks.onImageLinkInsert?t.context.triggerEvent("image.link.insert",e):t.context.invoke("editor.insertImage",e):t.context.invoke("editor.insertImagesOrCallback",e)})).fail((function(){t.context.invoke("editor.restoreRange")}))}},{key:"showImageDialog",value:function(){var t=this;return e().Deferred((function(e){var n=t.$dialog.find(".note-image-input"),o=t.$dialog.find(".note-image-url"),i=t.$dialog.find(".note-image-btn");t.ui.onDialogShown(t.$dialog,(function(){t.context.triggerEvent("dialog.shown"),n.replaceWith(n.clone().on("change",(function(t){e.resolve(t.target.files||t.target.value)})).val("")),o.on("input paste propertychange",(function(){t.ui.toggleBtn(i,o.val())})).val(""),f.isSupportTouch||o.trigger("focus"),i.click((function(t){t.preventDefault(),e.resolve(o.val())})),t.bindEnterKey(o,i)})),t.ui.onDialogHidden(t.$dialog,(function(){n.off(),o.off(),i.off(),"pending"===e.state()&&e.reject()})),t.ui.showDialog(t.$dialog)}))}}])&&he(n.prototype,o),i&&he(n,i),t}();function pe(t,e){for(var n=0;n','"),''),""].join(""),n='');this.$dialog=this.ui.dialog({title:this.lang.video.insert,fade:this.options.dialogsFade,body:e,footer:n}).render().appendTo(t)}},{key:"destroy",value:function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"bindEnterKey",value:function(t,e){t.on("keypress",(function(t){t.keyCode===wt.code.ENTER&&(t.preventDefault(),e.trigger("click"))}))}},{key:"createVideoNode",value:function(t){var n,o=t.match(/\/\/(?:(?:www|m)\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?$/),i=t.match(/(?:\.|\/\/)drive\.google\.com\/file\/d\/(.[a-zA-Z0-9_-]*)\/view/),r=t.match(/(?:www\.|\/\/)instagram\.com\/p\/(.[a-zA-Z0-9_-]*)/),a=t.match(/\/\/vine\.co\/v\/([a-zA-Z0-9]+)/),s=t.match(/\/\/(player\.)?vimeo\.com\/([a-z]*\/)*(\d+)[?]?.*/),l=t.match(/.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/),c=t.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),u=t.match(/\/\/(.*)\/videos\/watch\/([^?]*)(?:\?(?:start=(\w*))?(?:&stop=(\w*))?(?:&loop=([10]))?(?:&autoplay=([10]))?(?:&muted=([10]))?)?/),d=t.match(/\/\/v\.qq\.com.*?vid=(.+)/),h=t.match(/\/\/v\.qq\.com\/x?\/?(page|cover).*?\/([^\/]+)\.html\??.*/),f=t.match(/^.+.(mp4|m4v)$/),p=t.match(/^.+.(ogg|ogv)$/),v=t.match(/^.+.(webm)$/),m=t.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/);if(o&&11===o[1].length){var g=o[1],b=0;if(void 0!==o[2]){var y=o[2].match(/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/);if(y)for(var k=[3600,60,1],w=0,C=k.length;w").attr("frameborder",0).attr("src","//www.youtube.com/embed/"+g+(b>0?"?start="+b:"")).attr("width","640").attr("height","360")}else if(i&&i[0].length)n=e()("