KUJUNTI.ID MINISH3LL
Path : /var/www/html/jewelry-pos/public/admin-asset/js/formplugins/summernote/
(S)h3ll Cr3at0r :
F!le Upl0ad :

B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H

Current File : //var/www/html/jewelry-pos/public/admin-asset/js/formplugins/summernote/summernote.js


!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("jquery"));else if("function"==typeof define&&define.amd)define(["jquery"],e);else{var n="object"==typeof exports?e(require("jquery")):e(t.jQuery);for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(window,function(n){return r={},i.m=o={0:function(t,e){t.exports=n},1:function(t,e,n){"use strict";var o=n(0),r=n.n(o);function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var s=function(){function i(t,e,n,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),this.markup=t,this.children=e,this.options=n,this.callback=o}var t,e,n;return t=i,(e=[{key:"render",value:function(t){var e,n=r()(this.markup);return this.options&&this.options.contents&&n.html(this.options.contents),this.options&&this.options.className&&n.addClass(this.options.className),this.options&&this.options.data&&r.a.each(this.options.data,function(t,e){n.attr("data-"+t,e)}),this.options&&this.options.click&&n.on("click",this.options.click),this.children&&(e=n.find(".note-children-container"),this.children.forEach(function(t){t.render(e.length?e:n)})),this.callback&&this.callback(n,this.options),this.options&&this.options.callback&&this.options.callback(n),t&&t.append(n),n}}])&&a(t.prototype,e),n&&a(t,n),i}();e.a={create:function(n,o){return function(){var t="object"===i(arguments[1])?arguments[1]:arguments[0],e=Array.isArray(arguments[0])?arguments[0]:[];return t&&t.children&&(e=t.children),new s(n,e,t,o)}}}},2:function(e,t){(function(t){e.exports=t}).call(this,{})},3:function(t,e,n){"use strict";var o=n(0),w=n.n(o);w.a.summernote=w.a.summernote||{lang:{}},w.a.extend(w.a.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, Vimeo, Vine, Instagram, DailyMotion or Youku)"},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:{insertParagraph:"Insert Paragraph",undo:"Undoes the last command",redo:"Redoes 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!"}}});var i="function"==typeof define&&n(2),r=["sans-serif","serif","monospace","cursive","fantasy"];function a(t){return-1===w.a.inArray(t.toLowerCase(),r)?"'".concat(t,"'"):t}var s,l,c=navigator.userAgent,u=/MSIE|Trident/i.test(c);u&&((l=/MSIE (\d+[.]\d+)/.exec(c))&&(s=parseFloat(l[1])),(l=/Trident\/.*rv:([0-9]{1,}[.0-9]{0,})/.exec(c))&&(s=parseFloat(l[1])));var d=/Edge\/\d+/.test(c),h=!!window.CodeMirror,f="ontouchstart"in window||0<navigator.MaxTouchPoints||0<navigator.msMaxTouchPoints,p=u?"DOMCharacterDataModified DOMSubtreeModified DOMNodeInserted":"input",m={isMac:-1<navigator.appVersion.indexOf("Mac"),isMSIE:u,isEdge:d,isFF:!d&&/firefox/i.test(c),isPhantom:/PhantomJS/i.test(c),isWebkit:!d&&/webkit/i.test(c),isChrome:!d&&/chrome/i.test(c),isSafari:!d&&/safari/i.test(c)&&!/chrome/i.test(c),browserVersion:s,jqueryVersion:parseFloat(w.a.fn.jquery),isSupportAmd:i,isSupportTouch:f,hasCodeMirror:h,isFontInstalled:function(t){var e="Comic Sans MS"===t?"Courier New":"Comic Sans MS",n="mmmmmmmmmmwwwww",o=document.createElement("canvas").getContext("2d");o.font="200px '"+e+"'";var i=o.measureText(n).width;return o.font="200px "+a(t)+', "'+e+'"',i!==o.measureText(n).width},isW3CRangeSupport:!!document.createRange,inputEventName:p,genericFontFamilies:r,validFontName:a};var v=0;var g={eq:function(e){return function(t){return e===t}},eq2:function(t,e){return t===e},peq2:function(n){return function(t,e){return t[n]===e[n]}},ok:function(){return!0},fail:function(){return!1},self:function(t){return t},not:function(t){return function(){return!t.apply(t,arguments)}},and:function(e,n){return function(t){return e(t)&&n(t)}},invoke:function(t,e){return function(){return t[e].apply(t,arguments)}},resetUniqueId:function(){v=0},uniqueId:function(t){var e=++v+"";return t?t+e:e},rect2bnd:function(t){var e=w()(document);return{top:t.top+e.scrollTop(),left:t.left+e.scrollLeft(),width:t.right-t.left,height:t.bottom-t.top}},invertObject:function(t){var e={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[t[n]]=n);return e},namespaceToCamel:function(t,e){return(e=e||"")+t.split(".").map(function(t){return t.substring(0,1).toUpperCase()+t.substring(1)}).join("")},debounce:function(o,i,r){var a;return function(){var t=this,e=arguments,n=r&&!a;clearTimeout(a),a=setTimeout(function(){a=null,r||o.apply(t,e)},i),n&&o.apply(t,e)}},isValidUrl:function(t){return/[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/gi.test(t)}};function b(t){return t[0]}function y(t){return t[t.length-1]}function k(t){return t.slice(1)}function C(t,e){if(t&&t.length&&e){if(t.indexOf)return-1!==t.indexOf(e);if(t.contains)return t.contains(e)}return!1}var x={head:b,last:y,initial:function(t){return t.slice(0,t.length-1)},tail:k,prev:function(t,e){if(t&&t.length&&e){var n=t.indexOf(e);return-1===n?null:t[n-1]}return null},next:function(t,e){if(t&&t.length&&e){var n=t.indexOf(e);return-1===n?null:t[n+1]}return null},find:function(t,e){for(var n=0,o=t.length;n<o;n++){var i=t[n];if(e(i))return i}},contains:C,all:function(t,e){for(var n=0,o=t.length;n<o;n++)if(!e(t[n]))return!1;return!0},sum:function(t,n){return n=n||g.self,t.reduce(function(t,e){return t+n(e)},0)},from:function(t){for(var e=[],n=t.length,o=-1;++o<n;)e[o]=t[o];return e},isEmpty:function(t){return!t||!t.length},clusterBy:function(t,o){return t.length?k(t).reduce(function(t,e){var n=y(t);return o(y(n),e)?n[n.length]=e:t[t.length]=[e],t},[[b(t)]]):[]},compact:function(t){for(var e=[],n=0,o=t.length;n<o;n++)t[n]&&e.push(t[n]);return e},unique:function(t){for(var e=[],n=0,o=t.length;n<o;n++)C(e,t[n])||e.push(t[n]);return e}},S=String.fromCharCode(160);function T(t){return t&&w()(t).hasClass("note-editable")}function E(e){return e=e.toUpperCase(),function(t){return t&&t.nodeName.toUpperCase()===e}}function I(t){return t&&3===t.nodeType}function $(t){return t&&/^BR|^IMG|^HR|^IFRAME|^BUTTON|^INPUT|^AUDIO|^VIDEO|^EMBED/.test(t.nodeName.toUpperCase())}function N(t){return!T(t)&&(t&&/^DIV|^P|^LI|^H[1-7]/.test(t.nodeName.toUpperCase()))}var P=E("PRE"),R=E("LI");var L=E("TABLE"),A=E("DATA");function F(t){return!(M(t)||D(t)||H(t)||N(t)||L(t)||B(t)||A(t))}function D(t){return t&&/^UL|^OL/.test(t.nodeName.toUpperCase())}var H=E("HR");function z(t){return t&&/^TD|^TH/.test(t.nodeName.toUpperCase())}var B=E("BLOCKQUOTE");function M(t){return z(t)||B(t)||T(t)}var O=E("A");var U=E("BODY");var j=m.isMSIE&&m.browserVersion<11?"&nbsp;":"<br>";function W(t){return I(t)?t.nodeValue.length:t?t.childNodes.length:0}function K(t){var e=W(t);return 0===e||(!I(t)&&1===e&&t.innerHTML===j||!(!x.all(t.childNodes,I)||""!==t.innerHTML))}function q(t){$(t)||W(t)||(t.innerHTML=j)}function V(t,e){for(;t;){if(e(t))return t;if(T(t))break;t=t.parentNode}return null}function _(t,e){e=e||g.fail;var n=[];return V(t,function(t){return T(t)||n.push(t),e(t)}),n}function G(t,e){e=e||g.fail;for(var n=[];t&&!e(t);)n.push(t),t=t.nextSibling;return n}function Y(t,e){var n=e.nextSibling,o=e.parentNode;return n?o.insertBefore(t,n):o.appendChild(t),t}function Z(n,t){return w.a.each(t,function(t,e){n.appendChild(e)}),n}function X(t){return 0===t.offset}function Q(t){return t.offset===W(t.node)}function J(t){return X(t)||Q(t)}function tt(t,e){for(;t&&t!==e;){if(0!==nt(t))return!1;t=t.parentNode}return!0}function et(t,e){if(!e)return!1;for(;t&&t!==e;){if(nt(t)!==W(t.parentNode)-1)return!1;t=t.parentNode}return!0}function nt(t){for(var e=0;t=t.previousSibling;)e+=1;return e}function ot(t){return!!(t&&t.childNodes&&t.childNodes.length)}function it(t,e){var n,o;if(0===t.offset){if(T(t.node))return null;n=t.node.parentNode,o=nt(t.node)}else o=ot(t.node)?W(n=t.node.childNodes[t.offset-1]):(n=t.node,e?0:t.offset-1);return{node:n,offset:o}}function rt(t,e){var n,o;if(K(t.node))return null;if(W(t.node)===t.offset){if(T(t.node))return null;n=t.node.parentNode,o=nt(t.node)+1}else if(ot(t.node)){if(o=0,K(n=t.node.childNodes[t.offset]))return null}else if(n=t.node,o=e?W(t.node):t.offset+1,K(n))return null;return{node:n,offset:o}}function at(t,e){return t.node===e.node&&t.offset===e.offset}function st(t,e){var n=e&&e.isSkipPaddingBlankHTML,o=e&&e.isNotSplitEdgePoint,i=e&&e.isDiscardEmptySplits;if(i&&(n=!0),J(t)&&(I(t.node)||o)){if(X(t))return t.node;if(Q(t))return t.node.nextSibling}if(I(t.node))return t.node.splitText(t.offset);var r=t.node.childNodes[t.offset],a=Y(t.node.cloneNode(!1),t.node);return Z(a,G(r)),n||(q(t.node),q(a)),i&&(K(t.node)&&ut(t.node),K(a))?(ut(a),t.node.nextSibling):a}function lt(t,n,o){var e=_(n.node,g.eq(t));return e.length?1===e.length?st(n,o):e.reduce(function(t,e){return t===n.node&&(t=st(n,o)),st({node:e,offset:t?nt(t):W(e)},o)}):null}function ct(t){return document.createElement(t)}function ut(t,e){if(t&&t.parentNode){if(t.removeNode)return t.removeNode(e);var n=t.parentNode;if(!e){for(var o=[],i=0,r=t.childNodes.length;i<r;i++)o.push(t.childNodes[i]);for(var a=0,s=o.length;a<s;a++)n.insertBefore(o[a],t)}n.removeChild(t)}}var dt=E("TEXTAREA");function ht(t,e){var n=dt(t[0])?t.val():t.html();return e?n.replace(/[\n\r]/g,""):n}var ft={NBSP_CHAR:S,ZERO_WIDTH_NBSP_CHAR:"\ufeff",blank:j,emptyPara:"<p>".concat(j,"</p>"),makePredByNodeName:E,isEditable:T,isControlSizing:function(t){return t&&w()(t).hasClass("note-control-sizing")},isText:I,isElement:function(t){return t&&1===t.nodeType},isVoid:$,isPara:N,isPurePara:function(t){return N(t)&&!R(t)},isHeading:function(t){return t&&/^H[1-7]/.test(t.nodeName.toUpperCase())},isInline:F,isBlock:g.not(F),isBodyInline:function(t){return F(t)&&!V(t,N)},isBody:U,isParaInline:function(t){return F(t)&&!!V(t,N)},isPre:P,isList:D,isTable:L,isData:A,isCell:z,isBlockquote:B,isBodyContainer:M,isAnchor:O,isDiv:E("DIV"),isLi:R,isBR:E("BR"),isSpan:E("SPAN"),isB:E("B"),isU:E("U"),isS:E("S"),isI:E("I"),isImg:E("IMG"),isTextarea:dt,deepestChildIsEmpty:function(t){do{if(null===t.firstElementChild||""===t.firstElementChild.innerHTML)break}while(t=t.firstElementChild);return K(t)},isEmpty:K,isEmptyAnchor:g.and(O,K),isClosestSibling:function(t,e){return t.nextSibling===e||t.previousSibling===e},withClosestSiblings:function(t,e){e=e||g.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:W,isLeftEdgePoint:X,isRightEdgePoint:Q,isEdgePoint:J,isLeftEdgeOf:tt,isRightEdgeOf:et,isLeftEdgePointOf:function(t,e){return X(t)&&tt(t.node,e)},isRightEdgePointOf:function(t,e){return Q(t)&&et(t.node,e)},prevPoint:it,nextPoint:rt,isSamePoint:at,isVisiblePoint:function(t){if(I(t.node)||!ot(t.node)||K(t.node))return!0;var e=t.node.childNodes[t.offset-1],n=t.node.childNodes[t.offset];return!(e&&!$(e)||n&&!$(n))},prevPointUntil:function(t,e){for(;t;){if(e(t))return t;t=it(t)}return null},nextPointUntil:function(t,e){for(;t;){if(e(t))return t;t=rt(t)}return null},isCharPoint:function(t){if(!I(t.node))return!1;var e=t.node.nodeValue.charAt(t.offset-1);return e&&" "!==e&&e!==S},isSpacePoint:function(t){if(!I(t.node))return!1;var e=t.node.nodeValue.charAt(t.offset-1);return" "===e||e===S},walkPoint:function(t,e,n,o){for(var i=t;i&&(n(i),!at(i,e));)i=rt(i,o&&t.node!==i.node&&e.node!==i.node)},ancestor:V,singleChildAncestor:function(t,e){for(t=t.parentNode;t&&1===W(t);){if(e(t))return t;if(T(t))break;t=t.parentNode}return null},listAncestor:_,lastAncestor:function(t,e){var n=_(t);return x.last(n.filter(e))},listNext:G,listPrev:function(t,e){e=e||g.fail;for(var n=[];t&&!e(t);)n.push(t),t=t.previousSibling;return n},listDescendant:function(i,r){var a=[];return r=r||g.ok,function t(e){i!==e&&r(e)&&a.push(e);for(var n=0,o=e.childNodes.length;n<o;n++)t(e.childNodes[n])}(i),a},commonAncestor:function(t,e){for(var n=_(t),o=e;o;o=o.parentNode)if(-1<n.indexOf(o))return o;return null},wrap:function(t,e){var n=t.parentNode,o=w()("<"+e+">")[0];return n.insertBefore(o,t),o.appendChild(t),o},insertAfter:Y,appendChildNodes:Z,position:nt,hasChildren:ot,makeOffsetPath:function(t,e){return _(e,g.eq(t)).map(nt).reverse()},fromOffsetPath:function(t,e){for(var n=t,o=0,i=e.length;o<i;o++)n=n.childNodes.length<=e[o]?n.childNodes[n.childNodes.length-1]:n.childNodes[e[o]];return n},splitTree:lt,splitPoint:function(t,e){var n,o=e?N:M,i=_(t.node,o),r=x.last(i)||t.node,a=o(r)?(n=i[i.length-2],r):(n=r).parentNode,s=n&&lt(n,t,{isSkipPaddingBlankHTML:e,isNotSplitEdgePoint:e});return s||a!==t.node||(s=t.node.childNodes[t.offset]),{rightNode:s,container:a}},create:ct,createText:function(t){return document.createTextNode(t)},remove:ut,removeWhile:function(t,e){for(;t&&!T(t)&&e(t);){var n=t.parentNode;ut(t),t=n}},replace:function(t,e){if(t.nodeName.toUpperCase()===e.toUpperCase())return t;var n=ct(e);return t.style.cssText&&(n.style.cssText=t.style.cssText),Z(n,x.from(t.childNodes)),Y(n,t),ut(t),n},html:function(t,e){var n=ht(t);return e&&(n=(n=n.replace(/<(\/?)(\b(?!!)[^>\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()),n},value:ht,posFromPlaceholder:function(t){var e=w()(t),n=e.offset(),o=e.outerHeight(!0);return{left:n.left,top:n.top+o}},attachEvents:function(e,n){Object.keys(n).forEach(function(t){e.on(t,n[t])})},detachEvents:function(e,n){Object.keys(n).forEach(function(t){e.off(t,n[t])})},isCustomStyleTag:function(t){return t&&!I(t)&&x.contains(t.classList,"note-styletag")}};function pt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var mt=function(){function n(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),this.$note=t,this.memos={},this.modules={},this.layoutInfo={},this.options=w.a.extend(!0,{},e),w.a.summernote.ui=w.a.summernote.ui_template(this.options),this.ui=w.a.summernote.ui,this.initialize()}var t,e,o;return t=n,(e=[{key:"initialize",value:function(){return this.layoutInfo=this.ui.createLayout(this.$note),this._initialize(),this.$note.hide(),this}},{key:"destroy",value:function(){this._destroy(),this.$note.removeData("summernote"),this.ui.removeLayout(this.$note,this.layoutInfo)}},{key:"reset",value:function(){var t=this.isDisabled();this.code(ft.emptyPara),this._destroy(),this._initialize(),t&&this.disable()}},{key:"_initialize",value:function(){var e=this;this.options.id=g.uniqueId(w.a.now()),this.options.container=this.options.container||this.layoutInfo.editor;var n=w.a.extend({},this.options.buttons);Object.keys(n).forEach(function(t){e.memo("button."+t,n[t])});var o=w.a.extend({},this.options.modules,w.a.summernote.plugins||{});Object.keys(o).forEach(function(t){e.module(t,o[t],!0)}),Object.keys(this.modules).forEach(function(t){e.initializeModule(t)})}},{key:"_destroy",value:function(){var e=this;Object.keys(this.modules).reverse().forEach(function(t){e.removeModule(t)}),Object.keys(this.memos).forEach(function(t){e.removeMemo(t)}),this.triggerEvent("destroy",this)}},{key:"code",value:function(t){var e=this.invoke("codeview.isActivated");if(void 0===t)return this.invoke("codeview.sync"),e?this.layoutInfo.codable.val():this.layoutInfo.editable.html();e?this.layoutInfo.codable.val(t):this.layoutInfo.editable.html(t),this.$note.val(t),this.triggerEvent("change",t,this.layoutInfo.editable)}},{key:"isDisabled",value:function(){return"false"===this.layoutInfo.editable.attr("contenteditable")}},{key:"enable",value:function(){this.layoutInfo.editable.attr("contenteditable",!0),this.invoke("toolbar.activate",!0),this.triggerEvent("disable",!1),this.options.editing=!0}},{key:"disable",value:function(){this.invoke("codeview.isActivated")&&this.invoke("codeview.deactivate"),this.layoutInfo.editable.attr("contenteditable",!1),this.options.editing=!1,this.invoke("toolbar.deactivate",!0),this.triggerEvent("disable",!0)}},{key:"triggerEvent",value:function(){var t=x.head(arguments),e=x.tail(x.from(arguments)),n=this.options.callbacks[g.namespaceToCamel(t,"on")];n&&n.apply(this.$note[0],e),this.$note.trigger("summernote."+t,e)}},{key:"initializeModule",value:function(t){var e=this.modules[t];e.shouldInitialize=e.shouldInitialize||g.ok,e.shouldInitialize()&&(e.initialize&&e.initialize(),e.events&&ft.attachEvents(this.$note,e.events))}},{key:"module",value:function(t,e,n){if(1===arguments.length)return this.modules[t];this.modules[t]=new e(this),n||this.initializeModule(t)}},{key:"removeModule",value:function(t){var e=this.modules[t];e.shouldInitialize()&&(e.events&&ft.detachEvents(this.$note,e.events),e.destroy&&e.destroy()),delete this.modules[t]}},{key:"memo",value:function(t,e){if(1===arguments.length)return this.memos[t];this.memos[t]=e}},{key:"removeMemo",value:function(t){this.memos[t]&&this.memos[t].destroy&&this.memos[t].destroy(),delete this.memos[t]}},{key:"createInvokeHandlerAndUpdateState",value:function(e,n){var o=this;return function(t){o.createInvokeHandler(e,n)(t),o.invoke("buttons.updateCurrentStyle")}}},{key:"createInvokeHandler",value:function(n,o){var i=this;return function(t){t.preventDefault();var e=w()(t.target);i.invoke(n,o||e.closest("[data-value]").data("value"),e)}}},{key:"invoke",value:function(){var t=x.head(arguments),e=x.tail(x.from(arguments)),n=t.split("."),o=1<n.length,i=o&&x.head(n),r=o?x.last(n):x.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}}])&&pt(t.prototype,e),o&&pt(t,o),n}();function vt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function gt(t,e){for(var n,o=t.parentElement(),i=document.body.createTextRange(),r=x.from(o.childNodes),a=0;a<r.length;a++)if(!ft.isText(r[a])){if(i.moveToElementText(r[a]),0<=i.compareEndPoints("StartToStart",t))break;n=r[a]}if(0!==a&&ft.isText(r[a-1])){var s=document.body.createTextRange(),l=null;s.moveToElementText(n||o),s.collapse(!n),l=n?n.nextSibling:o.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&&ft.isText(l.nextSibling)&&u===l.nodeValue.length&&(u-=l.nodeValue.length,l=l.nextSibling),o=l,a=u}return{cont:o,offset:a}}function bt(t){var e=document.body.createTextRange(),n=function t(e,n){var o;if(ft.isText(e)){var i=ft.listPrev(e,g.not(ft.isText)),r=x.last(i).previousSibling,a=r||e.parentNode;n+=x.sum(x.tail(i),ft.nodeLength),o=!r}else{if(a=e.childNodes[n]||e,ft.isText(a))return t(a,0);n=0,o=!1}return{node:a,collapseToStart:o,offset:n}}(t.node,t.offset);return e.moveToElementText(n.node),e.collapse(n.collapseToStart),e.moveStart("character",n.offset),e}w.a.fn.extend({summernote:function(){var t=w.a.type(x.head(arguments)),e="string"===t,n="object"===t,i=w.a.extend({},w.a.summernote.options,n?x.head(arguments):{});i.langInfo=w.a.extend(!0,{},w.a.summernote.lang["en-US"],w.a.summernote.lang[i.lang]),i.icons=w.a.extend(!0,{},w.a.summernote.options.icons,i.icons),i.tooltip="auto"===i.tooltip?!m.isSupportTouch:i.tooltip,this.each(function(t,e){var n,o=w()(e);o.data("summernote")||(n=new mt(o,i),o.data("summernote",n),o.data("summernote").triggerEvent("init",n.layoutInfo))});var o=this.first();if(o.length){var r=o.data("summernote");if(e)return r.invoke.apply(r,x.from(arguments));i.focus&&r.invoke("editor.focus")}return this}});var yt=function(){function a(t,e,n,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),this.sc=t,this.so=e,this.ec=n,this.eo=o,this.isOnEditable=this.makeIsOn(ft.isEditable),this.isOnList=this.makeIsOn(ft.isList),this.isOnAnchor=this.makeIsOn(ft.isAnchor),this.isOnCell=this.makeIsOn(ft.isCell),this.isOnData=this.makeIsOn(ft.isData)}var t,e,n;return t=a,(e=[{key:"nativeRange",value:function(){if(m.isW3CRangeSupport){var t=document.createRange();return t.setStart(this.sc,this.sc.data&&this.so>this.sc.data.length?0:this.so),t.setEnd(this.ec,this.sc.data?Math.min(this.eo,this.sc.data.length):this.eo),t}var e=bt({node:this.sc,offset:this.so});return e.setEndPoint("EndToEnd",bt({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,e=this.nativeRange();return m.isW3CRangeSupport?(0<(t=document.getSelection()).rangeCount&&t.removeAllRanges(),t.addRange(e)):e.select(),this}},{key:"scrollIntoView",value:function(t){var e=w()(t).height();return t.scrollTop+e<this.sc.offsetTop&&(t.scrollTop+=Math.abs(t.scrollTop+e-this.sc.offsetTop)),this}},{key:"normalize",value:function(){function t(t,e){if(!t)return t;if(ft.isVisiblePoint(t)&&(!ft.isEdgePoint(t)||ft.isRightEdgePoint(t)&&!e||ft.isLeftEdgePoint(t)&&e||ft.isRightEdgePoint(t)&&e&&ft.isVoid(t.node.nextSibling)||ft.isLeftEdgePoint(t)&&!e&&ft.isVoid(t.node.previousSibling)||ft.isBlock(t.node)&&ft.isEmpty(t.node)))return t;var n,o=ft.ancestor(t.node,ft.isBlock),i=!1;i||(n=ft.prevPoint(t)||{node:null},i=(ft.isLeftEdgePointOf(t,o)||ft.isVoid(n.node))&&!e);var r,a=!1;if(a||(r=ft.nextPoint(t)||{node:null},a=(ft.isRightEdgePointOf(t,o)||ft.isVoid(r.node))&&e),i||a){if(ft.isVisiblePoint(t))return t;e=!e}return(e?ft.nextPointUntil(ft.nextPoint(t),ft.isVisiblePoint):ft.prevPointUntil(ft.prevPoint(t),ft.isVisiblePoint))||t}var e=t(this.getEndPoint(),!1),n=this.isCollapsed()?e:t(this.getStartPoint(),!0);return new a(n.node,n.offset,e.node,e.offset)}},{key:"nodes",value:function(n,t){n=n||g.ok;var o=t&&t.includeAncestor,i=t&&t.fullyContains,e=this.getStartPoint(),r=this.getEndPoint(),a=[],s=[];return ft.walkPoint(e,r,function(t){var e;ft.isEditable(t.node)||(i?(ft.isLeftEdgePoint(t)&&s.push(t.node),ft.isRightEdgePoint(t)&&x.contains(s,t.node)&&(e=t.node)):e=o?ft.ancestor(t.node,n):t.node,e&&n(e)&&a.push(e))},!0),x.unique(a)}},{key:"commonAncestor",value:function(){return ft.commonAncestor(this.sc,this.ec)}},{key:"expand",value:function(t){var e=ft.ancestor(this.sc,t),n=ft.ancestor(this.ec,t);if(!e&&!n)return new a(this.sc,this.so,this.ec,this.eo);var o=this.getPoints();return e&&(o.sc=e,o.so=0),n&&(o.ec=n,o.eo=ft.nodeLength(n)),new a(o.sc,o.so,o.ec,o.eo)}},{key:"collapse",value:function(t){return t?new a(this.sc,this.so,this.sc,this.so):new a(this.ec,this.eo,this.ec,this.eo)}},{key:"splitText",value:function(){var t=this.sc===this.ec,e=this.getPoints();return ft.isText(this.ec)&&!ft.isEdgePoint(this.getEndPoint())&&this.ec.splitText(this.eo),ft.isText(this.sc)&&!ft.isEdgePoint(this.getStartPoint())&&(e.sc=this.sc.splitText(this.so),e.so=0,t&&(e.ec=e.sc,e.eo=this.eo-this.so)),new a(e.sc,e.so,e.ec,e.eo)}},{key:"deleteContents",value:function(){if(this.isCollapsed())return this;var t=this.splitText(),e=t.nodes(null,{fullyContains:!0}),o=ft.prevPointUntil(t.getStartPoint(),function(t){return!x.contains(e,t.node)}),i=[];return w.a.each(e,function(t,e){var n=e.parentNode;o.node!==n&&1===ft.nodeLength(n)&&i.push(n),ft.remove(e,!1)}),w.a.each(i,function(t,e){ft.remove(e,!1)}),new a(o.node,o.offset,o.node,o.offset).normalize()}},{key:"makeIsOn",value:function(e){return function(){var t=ft.ancestor(this.sc,e);return!!t&&t===ft.ancestor(this.ec,e)}}},{key:"isLeftEdgeOf",value:function(t){if(!ft.isLeftEdgePoint(this.getStartPoint()))return!1;var e=ft.ancestor(this.sc,t);return e&&ft.isLeftEdgeOf(this.sc,e)}},{key:"isCollapsed",value:function(){return this.sc===this.ec&&this.so===this.eo}},{key:"wrapBodyInlineWithPara",value:function(){if(ft.isBodyContainer(this.sc)&&ft.isEmpty(this.sc))return this.sc.innerHTML=ft.emptyPara,new a(this.sc.firstChild,0,this.sc.firstChild,0);var t,e,n,o,i=this.normalize();return ft.isParaInline(this.sc)||ft.isPara(this.sc)?i:(ft.isInline(i.sc)?(t=ft.listAncestor(i.sc,g.not(ft.isInline)),e=x.last(t),ft.isInline(e)||(e=t[t.length-2]||i.sc.childNodes[i.so])):e=i.sc.childNodes[0<i.so?i.so-1:0],!e||(o=(o=ft.listPrev(e,ft.isParaInline).reverse()).concat(ft.listNext(e.nextSibling,ft.isParaInline))).length&&(n=ft.wrap(x.head(o),"p"),ft.appendChildNodes(n,x.tail(o))),this.normalize())}},{key:"insertNode",value:function(t){var e=this;(ft.isText(t)||ft.isInline(t))&&(e=this.wrapBodyInlineWithPara().deleteContents());var n=ft.splitPoint(e.getStartPoint(),ft.isInline(t));return n.rightNode?n.rightNode.parentNode.insertBefore(t,n.rightNode):n.container.appendChild(t),t}},{key:"pasteHTML",value:function(t){t=w.a.trim(t);var e=w()("<div></div>").html(t)[0],n=x.from(e.childNodes),o=this;return 0<=o.so&&(n=n.reverse()),n=n.map(function(t){return o.insertNode(t)}),0<o.so&&(n=n.reverse()),n}},{key:"toString",value:function(){var t=this.nativeRange();return m.isW3CRangeSupport?t.toString():t.text}},{key:"getWordRange",value:function(t){var e=this.getEndPoint();if(!ft.isCharPoint(e))return this;var n=ft.prevPointUntil(e,function(t){return!ft.isCharPoint(t)});return t&&(e=ft.nextPointUntil(e,function(t){return!ft.isCharPoint(t)})),new a(n.node,n.offset,e.node,e.offset)}},{key:"getWordsRange",value:function(t){function e(t){return!ft.isCharPoint(t)&&!ft.isSpacePoint(t)}var n=this.getEndPoint();if(e(n))return this;var o=ft.prevPointUntil(n,e);return t&&(n=ft.nextPointUntil(n,e)),new a(o.node,o.offset,n.node,n.offset)}},{key:"getWordsMatchRange",value:function(o){var i=this.getEndPoint(),t=ft.prevPointUntil(i,function(t){if(!ft.isCharPoint(t)&&!ft.isSpacePoint(t))return!0;var e=new a(t.node,t.offset,i.node,i.offset),n=o.exec(e.toString());return n&&0===n.index}),e=new a(t.node,t.offset,i.node,i.offset),n=e.toString(),r=o.exec(n);return r&&r[0].length===n.length?e:null}},{key:"bookmark",value:function(t){return{s:{path:ft.makeOffsetPath(t,this.sc),offset:this.so},e:{path:ft.makeOffsetPath(t,this.ec),offset:this.eo}}}},{key:"paraBookmark",value:function(t){return{s:{path:x.tail(ft.makeOffsetPath(x.head(t),this.sc)),offset:this.so},e:{path:x.tail(ft.makeOffsetPath(x.last(t),this.ec)),offset:this.eo}}}},{key:"getClientRects",value:function(){return this.nativeRange().getClientRects()}}])&&vt(t.prototype,e),n&&vt(t,n),a}(),kt={create:function(t,e,n,o){if(4===arguments.length)return new yt(t,e,n,o);if(2===arguments.length)return new yt(n=t,o=e,n,o);var i=this.createFromSelection();if(i||1!==arguments.length)return i;var r=t;return ft.isEditable(r)&&(r=r.lastChild),this.createFromBodyElement(r,ft.emptyPara===t.innerHTML)},createFromBodyElement:function(t,e){var n=1<arguments.length&&void 0!==e&&e;return this.createFromNode(t).collapse(n)},createFromSelection:function(){if(m.isW3CRangeSupport){var t=document.getSelection();if(!t||0===t.rangeCount)return null;if(ft.isBody(t.anchorNode))return null;var e=t.getRangeAt(0),n=e.startContainer,o=e.startOffset,i=e.endContainer,r=e.endOffset}else{var a=document.selection.createRange(),s=a.duplicate();s.collapse(!1);var l=a;l.collapse(!0);var c=gt(l,!0),u=gt(s,!1);ft.isText(c.node)&&ft.isLeftEdgePoint(c)&&ft.isTextNode(u.node)&&ft.isRightEdgePoint(u)&&u.node.nextSibling===c.node&&(c=u),n=c.cont,o=c.offset,i=u.cont,r=u.offset}return new yt(n,o,i,r)},createFromNode:function(t){var e=t,n=0,o=t,i=ft.nodeLength(o);return ft.isVoid(e)&&(n=ft.listPrev(e).length-1,e=e.parentNode),ft.isBR(o)?(i=ft.listPrev(o).length-1,o=o.parentNode):ft.isVoid(o)&&(i=ft.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=ft.fromOffsetPath(t,e.s.path),o=e.s.offset,i=ft.fromOffsetPath(t,e.e.path),r=e.e.offset;return new yt(n,o,i,r)},createFromParaBookmark:function(t,e){var n=t.s.offset,o=t.e.offset,i=ft.fromOffsetPath(x.head(e),t.s.path),r=ft.fromOffsetPath(x.last(e),t.e.path);return new yt(i,n,r,o)}},wt={BACKSPACE:8,TAB:9,ENTER:13,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},Ct={isEdit:function(t){return x.contains([wt.BACKSPACE,wt.TAB,wt.ENTER,wt.SPACE,wt.DELETE],t)},isMove:function(t){return x.contains([wt.LEFT,wt.UP,wt.RIGHT,wt.DOWN],t)},isNavigation:function(t){return x.contains([wt.HOME,wt.END,wt.PAGEUP,wt.PAGEDOWN],t)},nameFromCode:g.invertObject(wt),code:wt};function xt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var St=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.stack=[],this.stackOffset=-1,this.context=t,this.$editable=t.layoutInfo.editable,this.editable=this.$editable[0]}var t,n,o;return t=e,(n=[{key:"makeSnapshot",value:function(){var t=kt.create(this.editable);return{contents:this.$editable.html(),bookmark:t&&t.isOnEditable()?t.bookmark(this.editable):{s:{path:[],offset:0},e:{path:[],offset:0}}}}},{key:"applySnapshot",value:function(t){null!==t.contents&&this.$editable.html(t.contents),null!==t.bookmark&&kt.createFromBookmark(this.editable,t.bookmark).select()}},{key:"rewind",value:function(){this.$editable.html()!==this.stack[this.stackOffset].contents&&this.recordUndo(),this.stackOffset=0,this.applySnapshot(this.stack[this.stackOffset])}},{key:"commit",value:function(){this.stack=[],this.stackOffset=-1,this.recordUndo()}},{key:"reset",value:function(){this.stack=[],this.stackOffset=-1,this.$editable.html(""),this.recordUndo()}},{key:"undo",value:function(){this.$editable.html()!==this.stack[this.stackOffset].contents&&this.recordUndo(),0<this.stackOffset&&(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)}}])&&xt(t.prototype,n),o&&xt(t,o),e}();function Tt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Et=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,o;return e=t,(n=[{key:"jQueryCSS",value:function(n,t){if(m.jqueryVersion<1.9){var o={};return w.a.each(t,function(t,e){o[e]=n.css(e)}),o}return n.css(t)}},{key:"fromNode",value:function(t){var e=this.jQueryCSS(t,["font-family","font-size","text-align","list-style-type","line-height"])||{},n=t[0].style.fontSize||e["font-size"];return e["font-size"]=parseInt(n,10),e["font-size-unit"]=n.match(/[a-z%]+$/),e}},{key:"stylePara",value:function(t,n){w.a.each(t.nodes(ft.isPara,{includeAncestor:!0}),function(t,e){w()(e).css(n)})}},{key:"styleNodes",value:function(t,e){t=t.splitText();var n=e&&e.nodeName||"SPAN",o=!(!e||!e.expandClosestSibling),i=!(!e||!e.onlyPartialContains);if(t.isCollapsed())return[t.insertNode(ft.create(n))];var r,a=ft.makePredByNodeName(n),s=t.nodes(ft.isText,{fullyContains:!0}).map(function(t){return ft.singleChildAncestor(t,a)||ft.wrap(t,n)});return o?(i&&(r=t.nodes(),a=g.and(a,function(t){return x.contains(r,t)})),s.map(function(t){var e=ft.withClosestSiblings(t,a),n=x.head(e),o=x.tail(e);return w.a.each(o,function(t,e){ft.appendChildNodes(n,e.childNodes),ft.remove(e)}),x.head(e)})):s}},{key:"current",value:function(t){var e,n=w()(ft.isElement(t.sc)?t.sc:t.sc.parentNode),o=this.fromNode(n);try{o=w.a.extend(o,{"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")||o["font-family"]})}catch(t){}t.isOnList()?(e=-1<["circle","disc","disc-leading-zero","square"].indexOf(o["list-style-type"]),o["list-style"]=e?"unordered":"ordered"):o["list-style"]="none";var i,r=ft.ancestor(t.sc,ft.isPara);return r&&r.style["line-height"]?o["line-height"]=r.style.lineHeight:(i=parseInt(o["line-height"],10)/parseInt(o["font-size"],10),o["line-height"]=i.toFixed(1)),o.anchor=t.isOnAnchor()&&ft.ancestor(t.sc,ft.isAnchor),o.ancestors=ft.listAncestor(t.sc,ft.isEditable),o.range=t,o}}])&&Tt(e.prototype,n),o&&Tt(e,o),t}();function It(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var $t=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,o;return e=t,(n=[{key:"insertOrderedList",value:function(t){this.toggleList("OL",t)}},{key:"insertUnorderedList",value:function(t){this.toggleList("UL",t)}},{key:"indent",value:function(t){var i=this,e=kt.create(t).wrapBodyInlineWithPara(),n=e.nodes(ft.isPara,{includeAncestor:!0}),o=x.clusterBy(n,g.peq2("parentNode"));w.a.each(o,function(t,e){var n,o=x.head(e);ft.isLi(o)?(n=i.findList(o.previousSibling))?e.map(function(t){return n.appendChild(t)}):(i.wrapList(e,o.parentNode.nodeName),e.map(function(t){return t.parentNode}).map(function(t){return i.appendToPrevious(t)})):w.a.each(e,function(t,e){w()(e).css("marginLeft",function(t,e){return(parseInt(e,10)||0)+25})})}),e.select()}},{key:"outdent",value:function(t){var o=this,e=kt.create(t).wrapBodyInlineWithPara(),n=e.nodes(ft.isPara,{includeAncestor:!0}),i=x.clusterBy(n,g.peq2("parentNode"));w.a.each(i,function(t,e){var n=x.head(e);ft.isLi(n)?o.releaseList([e]):w.a.each(e,function(t,e){w()(e).css("marginLeft",function(t,e){return 25<(e=parseInt(e,10)||0)?e-25:""})})}),e.select()}},{key:"toggleList",value:function(n,t){var o,e,i=this,r=kt.create(t).wrapBodyInlineWithPara(),a=r.nodes(ft.isPara,{includeAncestor:!0}),s=r.paraBookmark(a),l=x.clusterBy(a,g.peq2("parentNode"));x.find(a,ft.isPurePara)?(o=[],w.a.each(l,function(t,e){o=o.concat(i.wrapList(e,n))}),a=o):(e=r.nodes(ft.isList,{includeAncestor:!0}).filter(function(t){return!w.a.nodeName(t,n)})).length?w.a.each(e,function(t,e){ft.replace(e,n)}):a=this.releaseList(l,!0),kt.createFromParaBookmark(s,a).select()}},{key:"wrapList",value:function(t,e){var n=x.head(t),o=x.last(t),i=ft.isList(n.previousSibling)&&n.previousSibling,r=ft.isList(o.nextSibling)&&o.nextSibling,a=i||ft.insertAfter(ft.create(e||"UL"),o);return t=t.map(function(t){return ft.isPurePara(t)?ft.replace(t,"LI"):t}),ft.appendChildNodes(a,t),r&&(ft.appendChildNodes(a,x.from(r.childNodes)),ft.remove(r)),t}},{key:"releaseList",value:function(t,c){var u=this,d=[];return w.a.each(t,function(t,e){var n,o,i,r=x.head(e),a=x.last(e),s=c?ft.lastAncestor(r,ft.isList):r.parentNode,l=s.parentNode;"LI"===s.parentNode.nodeName?(e.map(function(t){var e=u.findNextSiblings(t);l.nextSibling?l.parentNode.insertBefore(t,l.nextSibling):l.parentNode.appendChild(t),e.length&&(u.wrapList(e,s.nodeName),t.appendChild(e[0].parentNode))}),0===s.children.length&&l.removeChild(s),0===l.childNodes.length&&l.parentNode.removeChild(l)):(n=1<s.childNodes.length?ft.splitTree(s,{node:a.parentNode,offset:ft.position(a)+1},{isSkipPaddingBlankHTML:!0}):null,o=ft.splitTree(s,{node:r.parentNode,offset:ft.position(r)},{isSkipPaddingBlankHTML:!0}),e=c?ft.listDescendant(o,ft.isLi):x.from(o.childNodes).filter(ft.isLi),!c&&ft.isList(s.parentNode)||(e=e.map(function(t){return ft.replace(t,"P")})),w.a.each(x.from(e).reverse(),function(t,e){ft.insertAfter(e,s)}),i=x.compact([s,o,n]),w.a.each(i,function(t,e){var n=[e].concat(ft.listDescendant(e,ft.isList));w.a.each(n.reverse(),function(t,e){ft.nodeLength(e)||ft.remove(e,!0)})})),d=d.concat(e)}),d}},{key:"appendToPrevious",value:function(t){return t.previousSibling?ft.appendChildNodes(t.previousSibling,[t]):this.wrapList([t],"LI")}},{key:"findList",value:function(t){return t?x.find(t.children,function(t){return-1<["OL","UL"].indexOf(t.nodeName)}):null}},{key:"findNextSiblings",value:function(t){for(var e=[];t.nextSibling;)e.push(t.nextSibling),t=t.nextSibling;return e}}])&&It(e.prototype,n),o&&It(e,o),t}();function Nt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Pt=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.bullet=new $t,this.options=t.options}var t,n,o;return t=e,(n=[{key:"insertTab",value:function(t,e){var n=ft.createText(new Array(e+1).join(ft.NBSP_CHAR));(t=t.deleteContents()).insertNode(n,!0),(t=kt.create(n,e)).select()}},{key:"insertParagraph",value:function(t,e){e=(e=(e=e||kt.create(t)).deleteContents()).wrapBodyInlineWithPara();var n=ft.ancestor(e.sc,ft.isPara);if(n){if(ft.isLi(n)&&(ft.isEmpty(n)||ft.deepestChildIsEmpty(n)))return void this.bullet.toggleList(n.parentNode.nodeName);var o,i,r=null;1===this.options.blockquoteBreakingLevel?r=ft.ancestor(n,ft.isBlockquote):2===this.options.blockquoteBreakingLevel&&(r=ft.lastAncestor(n,ft.isBlockquote)),r?(s=w()(ft.emptyPara)[0],ft.isRightEdgePoint(e.getStartPoint())&&ft.isBR(e.sc.nextSibling)&&w()(e.sc.nextSibling).remove(),(o=ft.splitTree(r,e.getStartPoint(),{isDiscardEmptySplits:!0}))?o.parentNode.insertBefore(s,o):ft.insertAfter(s,r)):(s=ft.splitTree(n,e.getStartPoint()),i=(i=ft.listDescendant(n,ft.isEmptyAnchor)).concat(ft.listDescendant(s,ft.isEmptyAnchor)),w.a.each(i,function(t,e){ft.remove(e)}),(ft.isHeading(s)||ft.isPre(s)||ft.isCustomStyleTag(s))&&ft.isEmpty(s)&&(s=ft.replace(s,"p")))}else{var a=e.sc.childNodes[e.so],s=w()(ft.emptyPara)[0];a?e.sc.insertBefore(s,a):e.sc.appendChild(s)}kt.create(s,0).normalize().select().scrollIntoView(t)}}])&&Nt(t.prototype,n),o&&Nt(t,o),e}();function Rt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function Lt(t,h,f,i){var p={colPos:0,rowPos:0},m=[],v=[];function g(t,e,n,o,i,r,a){var s={baseRow:n,baseCell:o,isRowSpan:i,isColSpan:r,isVirtual:a};m[t]||(m[t]=[]),m[t][e]=s}function b(t,e){if(!m[t])return e;if(!m[t][e])return e;for(var n=e;m[t][n];)if(n++,!m[t][n])return n}function r(t,e){var n=b(t.rowIndex,e.cellIndex),o=1<e.colSpan,i=1<e.rowSpan,r=t.rowIndex===p.rowPos&&e.cellIndex===p.colPos;g(t.rowIndex,n,t,e,i,o,!1);var a=e.attributes.rowSpan?parseInt(e.attributes.rowSpan.value,10):0;if(1<a)for(var s=1;s<a;s++){var l=t.rowIndex+s;y(l,n,e,r),g(l,n,t,e,!0,o,!0)}var c=e.attributes.colSpan?parseInt(e.attributes.colSpan.value,10):0;if(1<c)for(var u=1;u<c;u++){var d=b(t.rowIndex,n+u);y(t.rowIndex,d,e,r),g(t.rowIndex,d,t,e,i,!0,!0)}}function y(t,e,n,o){t===p.rowPos&&p.colPos>=n.cellIndex&&n.cellIndex<=e&&!o&&p.colPos++}function k(t){switch(h){case Lt.where.Column:if(t.isColSpan)return Lt.resultAction.SubtractSpanCount;break;case Lt.where.Row:if(!t.isVirtual&&t.isRowSpan)return Lt.resultAction.AddCell;if(t.isRowSpan)return Lt.resultAction.SubtractSpanCount}return Lt.resultAction.RemoveCell}function w(t){switch(h){case Lt.where.Column:if(t.isColSpan)return Lt.resultAction.SumSpanCount;if(t.isRowSpan&&t.isVirtual)return Lt.resultAction.Ignore;break;case Lt.where.Row:if(t.isRowSpan)return Lt.resultAction.SumSpanCount;if(t.isColSpan&&t.isVirtual)return Lt.resultAction.Ignore}return Lt.resultAction.AddCell}this.getActionList=function(){for(var t,e,n,o=h===Lt.where.Row?p.rowPos:-1,i=h===Lt.where.Column?p.colPos:-1,r=0,a=!0;a;){var s=0<=o?o:r,l=0<=i?i:r,c=m[s];if(!c)return a=!1,v;var u=c[l];if(!u)return a=!1,v;var d=Lt.resultAction.Ignore;switch(f){case Lt.requestAction.Add:d=w(u);break;case Lt.requestAction.Delete:d=k(u)}v.push((t=d,e=s,n=l,{baseCell:u.baseCell,action:t,virtualTable:{rowIndex:e,cellIndex:n}})),r++}return v},t&&t.tagName&&("td"===t.tagName.toLowerCase()||"th"===t.tagName.toLowerCase())&&(p.colPos=t.cellIndex,t.parentElement&&t.parentElement.tagName&&"tr"===t.parentElement.tagName.toLowerCase()&&(p.rowPos=t.parentElement.rowIndex)),function(){for(var t=i.rows,e=0;e<t.length;e++)for(var n=t[e].cells,o=0;o<n.length;o++)r(t[e],n[o])}()}Lt.where={Row:0,Column:1},Lt.requestAction={Add:0,Delete:1},Lt.resultAction={Ignore:0,SubtractSpanCount:1,RemoveCell:2,AddCell:3,SumSpanCount:4};var At=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,o;return e=t,(n=[{key:"tab",value:function(t,e){var n=ft.ancestor(t.commonAncestor(),ft.isCell),o=ft.ancestor(n,ft.isTable),i=ft.listDescendant(o,ft.isCell),r=x[e?"prev":"next"](i,n);r&&kt.create(r,0).select()}},{key:"addRow",value:function(t,e){for(var n=ft.ancestor(t.commonAncestor(),ft.isCell),o=w()(n).closest("tr"),i=this.recoverAttributes(o),r=w()("<tr"+i+"></tr>"),a=new Lt(n,Lt.where.Row,Lt.requestAction.Add,w()(o).closest("table")[0]).getActionList(),s=0;s<a.length;s++){var l=a[s],c=this.recoverAttributes(l.baseCell);switch(l.action){case Lt.resultAction.AddCell:r.append("<td"+c+">"+ft.blank+"</td>");break;case Lt.resultAction.SumSpanCount:if("top"===e)if((l.baseCell.parent?l.baseCell.closest("tr").rowIndex:0)<=o[0].rowIndex){var u=w()("<div></div>").append(w()("<td"+c+">"+ft.blank+"</td>").removeAttr("rowspan")).html();r.append(u);break}var d=parseInt(l.baseCell.rowSpan,10);d++,l.baseCell.setAttribute("rowSpan",d)}}if("top"===e)o.before(r);else{if(1<n.rowSpan){var h=o[0].rowIndex+(n.rowSpan-2);return void w()(w()(o).parent().find("tr")[h]).after(w()(r))}o.after(r)}}},{key:"addCol",value:function(t,e){var n=ft.ancestor(t.commonAncestor(),ft.isCell),o=w()(n).closest("tr");w()(o).siblings().push(o);for(var i=new Lt(n,Lt.where.Column,Lt.requestAction.Add,w()(o).closest("table")[0]).getActionList(),r=0;r<i.length;r++){var a,s=i[r],l=this.recoverAttributes(s.baseCell);switch(s.action){case Lt.resultAction.AddCell:"right"===e?w()(s.baseCell).after("<td"+l+">"+ft.blank+"</td>"):w()(s.baseCell).before("<td"+l+">"+ft.blank+"</td>");break;case Lt.resultAction.SumSpanCount:"right"===e?(a=parseInt(s.baseCell.colSpan,10),a++,s.baseCell.setAttribute("colSpan",a)):w()(s.baseCell).before("<td"+l+">"+ft.blank+"</td>")}}}},{key:"recoverAttributes",value:function(t){var e="";if(!t)return e;for(var n=t.attributes||[],o=0;o<n.length;o++)"id"!==n[o].name.toLowerCase()&&n[o].specified&&(e+=" "+n[o].name+"='"+n[o].value+"'");return e}},{key:"deleteRow",value:function(t){for(var e=ft.ancestor(t.commonAncestor(),ft.isCell),n=w()(e).closest("tr"),o=n.children("td, th").index(w()(e)),i=n[0].rowIndex,r=new Lt(e,Lt.where.Row,Lt.requestAction.Delete,w()(n).closest("table")[0]).getActionList(),a=0;a<r.length;a++)if(r[a]){var s=r[a].baseCell,l=r[a].virtualTable,c=s.rowSpan&&1<s.rowSpan,u=c?parseInt(s.rowSpan,10):0;switch(r[a].action){case Lt.resultAction.Ignore:continue;case Lt.resultAction.AddCell:var d=n.next("tr")[0];if(!d)continue;var h=n[0].cells[o];c&&(2<u?(u--,d.insertBefore(h,d.cells[o]),d.cells[o].setAttribute("rowSpan",u),d.cells[o].innerHTML=""):2===u&&(d.insertBefore(h,d.cells[o]),d.cells[o].removeAttribute("rowSpan"),d.cells[o].innerHTML=""));continue;case Lt.resultAction.SubtractSpanCount:c&&(2<u?(u--,s.setAttribute("rowSpan",u),l.rowIndex!==i&&s.cellIndex===o&&(s.innerHTML="")):2===u&&(s.removeAttribute("rowSpan"),l.rowIndex!==i&&s.cellIndex===o&&(s.innerHTML="")));continue;case Lt.resultAction.RemoveCell:continue}}n.remove()}},{key:"deleteCol",value:function(t){for(var e=ft.ancestor(t.commonAncestor(),ft.isCell),n=w()(e).closest("tr"),o=n.children("td, th").index(w()(e)),i=new Lt(e,Lt.where.Column,Lt.requestAction.Delete,w()(n).closest("table")[0]).getActionList(),r=0;r<i.length;r++)if(i[r])switch(i[r].action){case Lt.resultAction.Ignore:continue;case Lt.resultAction.SubtractSpanCount:var a,s=i[r].baseCell;s.colSpan&&1<s.colSpan&&(2<(a=s.colSpan?parseInt(s.colSpan,10):0)?(a--,s.setAttribute("colSpan",a),s.cellIndex===o&&(s.innerHTML="")):2===a&&(s.removeAttribute("colSpan"),s.cellIndex===o&&(s.innerHTML="")));continue;case Lt.resultAction.RemoveCell:ft.remove(i[r].baseCell,!0);continue}}},{key:"createTable",value:function(t,e,n){for(var o,i=[],r=0;r<t;r++)i.push("<td>"+ft.blank+"</td>");o=i.join("");for(var a,s=[],l=0;l<e;l++)s.push("<tr>"+o+"</tr>");a=s.join("");var c=w()("<table>"+a+"</table>");return n&&n.tableClassName&&c.addClass(n.tableClassName),c[0]}},{key:"deleteTable",value:function(t){var e=ft.ancestor(t.commonAncestor(),ft.isCell);w()(e).closest("table").remove()}}])&&Rt(e.prototype,n),o&&Rt(e,o),t}();function Ft(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Dt=function(){function r(t){var h=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),this.context=t,this.$note=t.layoutInfo.note,this.$editor=t.layoutInfo.editor,this.$editable=t.layoutInfo.editable,this.options=t.options,this.lang=this.options.langInfo,this.editable=this.$editable[0],this.lastRange=null,this.snapshot=null,this.style=new Et,this.table=new At,this.typing=new Pt(t),this.bullet=new $t,this.history=new St(t),this.context.memo("help.undo",this.lang.help.undo),this.context.memo("help.redo",this.lang.help.redo),this.context.memo("help.tab",this.lang.help.tab),this.context.memo("help.untab",this.lang.help.untab),this.context.memo("help.insertParagraph",this.lang.help.insertParagraph),this.context.memo("help.insertOrderedList",this.lang.help.insertOrderedList),this.context.memo("help.insertUnorderedList",this.lang.help.insertUnorderedList),this.context.memo("help.indent",this.lang.help.indent),this.context.memo("help.outdent",this.lang.help.outdent),this.context.memo("help.formatPara",this.lang.help.formatPara),this.context.memo("help.insertHorizontalRule",this.lang.help.insertHorizontalRule),this.context.memo("help.fontName",this.lang.help.fontName);for(var e=["bold","italic","underline","strikethrough","superscript","subscript","justifyLeft","justifyCenter","justifyRight","justifyFull","formatBlock","removeFormat","backColor"],n=0,o=e.length;n<o;n++)this[e[n]]=function(e){return function(t){h.beforeCommand(),document.execCommand(e,!1,t),h.afterCommand(!0)}}(e[n]),this.context.memo("help."+e[n],this.lang.help[e[n]]);this.fontName=this.wrapCommand(function(t){return h.fontStyling("font-family",m.validFontName(t))}),this.fontSize=this.wrapCommand(function(t){var e=h.currentStyle()["font-size-unit"];return h.fontStyling("font-size",t+e)}),this.fontSizeUnit=this.wrapCommand(function(t){var e=h.currentStyle()["font-size"];return h.fontStyling("font-size",e+t)});for(var i=1;i<=6;i++)this["formatH"+i]=function(t){return function(){h.formatBlock("H"+t)}}(i),this.context.memo("help.formatH"+i,this.lang.help["formatH"+i]);this.insertParagraph=this.wrapCommand(function(){h.typing.insertParagraph(h.editable)}),this.insertOrderedList=this.wrapCommand(function(){h.bullet.insertOrderedList(h.editable)}),this.insertUnorderedList=this.wrapCommand(function(){h.bullet.insertUnorderedList(h.editable)}),this.indent=this.wrapCommand(function(){h.bullet.indent(h.editable)}),this.outdent=this.wrapCommand(function(){h.bullet.outdent(h.editable)}),this.insertNode=this.wrapCommand(function(t){h.isLimited(w()(t).text().length)||(h.getLastRange().insertNode(t),h.setLastRange(kt.createFromNodeAfter(t).select()))}),this.insertText=this.wrapCommand(function(t){var e;h.isLimited(t.length)||(e=h.getLastRange().insertNode(ft.createText(t)),h.setLastRange(kt.create(e,ft.nodeLength(e)).select()))}),this.pasteHTML=this.wrapCommand(function(t){var e;h.isLimited(t.length)||(t=h.context.invoke("codeview.purify",t),e=h.getLastRange().pasteHTML(t),h.setLastRange(kt.createFromNodeAfter(x.last(e)).select()))}),this.formatBlock=this.wrapCommand(function(t,e){var n=h.options.callbacks.onApplyCustomStyle;n?n.call(h,e,h.context,h.onFormatBlock):h.onFormatBlock(t,e)}),this.insertHorizontalRule=this.wrapCommand(function(){var t=h.getLastRange().insertNode(ft.create("HR"));t.nextSibling&&h.setLastRange(kt.create(t.nextSibling,0).normalize().select())}),this.lineHeight=this.wrapCommand(function(t){h.style.stylePara(h.getLastRange(),{lineHeight:t})}),this.createLink=this.wrapCommand(function(t){var e,n,o,i,r,a=t.url,s=t.text,l=t.isNewWindow,c=t.checkProtocol,u=t.range||h.getLastRange(),d=s.length-u.toString().length;0<d&&h.isLimited(d)||(e=u.toString()!==s,"string"==typeof a&&(a=a.trim()),h.options.onCreateLink?a=h.options.onCreateLink(a):c&&(a=/^([A-Za-z][A-Za-z0-9+-.]*\:|#|\/)/.test(a)?a:h.options.defaultProtocol+a),n=[],e?(o=(u=u.deleteContents()).insertNode(w()("<A>"+s+"</A>")[0]),n.push(o)):n=h.style.styleNodes(u,{nodeName:"A",expandClosestSibling:!0,onlyPartialContains:!0}),w.a.each(n,function(t,e){w()(e).attr("href",a),l?w()(e).attr("target","_blank"):w()(e).removeAttr("target")}),i=kt.createFromNodeBefore(x.head(n)).getStartPoint(),r=kt.createFromNodeAfter(x.last(n)).getEndPoint(),h.setLastRange(kt.create(i.node,i.offset,r.node,r.offset).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");h.getLastRange().deleteContents().insertNode(h.table.createTable(e[0],e[1],h.options))}),this.removeMedia=this.wrapCommand(function(){var t=w()(h.restoreTarget()).parent();t.closest("figure").length?t.closest("figure").remove():t=w()(h.restoreTarget()).detach(),h.context.triggerEvent("media.delete",t,h.$editable)}),this.floatMe=this.wrapCommand(function(t){var e=w()(h.restoreTarget());e.toggleClass("note-float-left","left"===t),e.toggleClass("note-float-right","right"===t),e.css("float","none"===t?"":t)}),this.resize=this.wrapCommand(function(t){var e=w()(h.restoreTarget());0===(t=parseFloat(t))?e.css("width",""):e.css({width:100*t+"%",height:""})})}var t,e,n;return t=r,(e=[{key:"initialize",value:function(){var n=this;this.$editable.on("keydown",function(t){if(t.keyCode===Ct.code.ENTER&&n.context.triggerEvent("enter",t),n.context.triggerEvent("keydown",t),n.snapshot=n.history.makeSnapshot(),n.hasKeyShortCut=!1,t.isDefaultPrevented()||(n.options.shortcuts?n.hasKeyShortCut=n.handleKeyMap(t):n.preventDefaultEditableShortCuts(t)),n.isLimited(1,t)){var e=n.getLastRange();if(e.eo-e.so==0)return!1}n.setLastRange(),n.options.recordEveryKeystroke&&!1===n.hasKeyShortCut&&n.history.recordUndo()}).on("keyup",function(t){n.setLastRange(),n.context.triggerEvent("keyup",t)}).on("focus",function(t){n.setLastRange(),n.context.triggerEvent("focus",t)}).on("blur",function(t){n.context.triggerEvent("blur",t)}).on("mousedown",function(t){n.context.triggerEvent("mousedown",t)}).on("mouseup",function(t){n.setLastRange(),n.history.recordUndo(),n.context.triggerEvent("mouseup",t)}).on("scroll",function(t){n.context.triggerEvent("scroll",t)}).on("paste",function(t){n.setLastRange(),n.context.triggerEvent("paste",t)}).on("input",function(){n.isLimited(0)&&n.snapshot&&n.history.applySnapshot(n.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(ft.html(this.$note)||ft.emptyPara),this.$editable.on(m.inputEventName,g.debounce(function(){n.context.triggerEvent("change",n.$editable.html(),n.$editable)},10)),this.$editable.on("focusin",function(t){n.context.triggerEvent("focusin",t)}).on("focusout",function(t){n.context.triggerEvent("focusout",t)}),this.options.airMode?this.options.overrideContextMenu&&this.$editor.on("contextmenu",function(t){return n.context.triggerEvent("contextmenu",t),!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[m.isMac?"mac":"pc"],n=[];t.metaKey&&n.push("CMD"),t.ctrlKey&&!t.altKey&&n.push("CTRL"),t.shiftKey&&n.push("SHIFT");var o=Ct.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 Ct.isEdit(t.keyCode)&&this.afterCommand();else this.afterCommand();return!1}},{key:"preventDefaultEditableShortCuts",value:function(t){(t.ctrlKey||t.metaKey)&&x.contains([66,73,85],t.keyCode)&&t.preventDefault()}},{key:"isLimited",value:function(t,e){return t=t||0,(void 0===e||!(Ct.isMove(e.keyCode)||Ct.isNavigation(e.keyCode)||e.ctrlKey||e.metaKey||x.contains([Ct.code.BACKSPACE,Ct.code.DELETE],e.keyCode)))&&(0<this.options.maxTextLength&&this.$editable.text().length+t>this.options.maxTextLength)}},{key:"createRange",value:function(){return this.focus(),this.setLastRange(),this.getLastRange()}},{key:"setLastRange",value:function(t){t?this.lastRange=t:(this.lastRange=kt.create(this.editable),0===w()(this.lastRange.sc).closest(".note-editable").length&&(this.lastRange=kt.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=kt.create();return(t=t&&t.normalize())?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,e){var n,o=this;return n=t,w.a.Deferred(function(t){var e=w()("<img>");e.one("load",function(){e.off("error abort"),t.resolve(e)}).one("error abort",function(){e.off("load").detach(),t.reject(e)}).css({display:"none"}).appendTo(document.body).attr("src",n)}).promise().then(function(t){o.beforeCommand(),"function"==typeof e?e(t):("string"==typeof e&&t.attr("data-filename",e),t.css("width",Math.min(o.$editable.width(),t.width()))),t.show(),o.getLastRange().insertNode(t[0]),o.setLastRange(kt.createFromNodeAfter(t[0]).select()),o.afterCommand()}).fail(function(t){o.context.triggerEvent("image.upload.error",t)})}},{key:"insertImagesAsDataURL",value:function(t){var i=this;w.a.each(t,function(t,e){var o,n=e.name;i.options.maximumImageFileSize&&i.options.maximumImageFileSize<e.size?i.context.triggerEvent("image.upload.error",i.lang.image.maximumFileSizeError):(o=e,w.a.Deferred(function(n){w.a.extend(new FileReader,{onload:function(t){var e=t.target.result;n.resolve(e)},onerror:function(t){n.reject(t)}}).readAsDataURL(o)}).promise().then(function(t){return i.insertImage(t,n)}).fail(function(){i.context.triggerEvent("image.upload.error")}))})}},{key:"insertImagesOrCallback",value:function(t){this.options.callbacks.onImageUpload?this.context.triggerEvent("image.upload",t):this.insertImagesAsDataURL(t)}},{key:"getSelectedText",value:function(){var t=this.getLastRange();return t.isOnAnchor()&&(t=kt.createFromNode(ft.ancestor(t.sc,ft.isAnchor))),t.toString()}},{key:"onFormatBlock",value:function(t,e){var n,o;document.execCommand("FormatBlock",!1,m.isMSIE?"<"+t+">":t),e&&e.length&&(e[0].tagName.toUpperCase()!==t.toUpperCase()&&(e=e.find(t)),e&&e.length&&((n=e[0].className||"")&&(o=this.createRange(),w()([o.sc,o.ec]).closest(t).addClass(n))))}},{key:"formatPara",value:function(){this.formatBlock("P")}},{key:"fontStyling",value:function(t,e){var n,o,i,r=this.getLastRange();""!==r?(n=this.style.styleNodes(r),this.$editor.find(".note-status-output").html(""),w()(n).css(t,e),!r.isCollapsed()||(o=x.head(n))&&!ft.nodeLength(o)&&(o.innerHTML=ft.ZERO_WIDTH_NBSP_CHAR,kt.createFromNodeAfter(o.firstChild).select(),this.setLastRange(),this.$editable.data("bogus",o))):(i=w.a.now(),this.$editor.find(".note-status-output").html('<div id="note-status-output-'+i+'" class="alert alert-info">'+this.lang.output.noSelection+"</div>"),setTimeout(function(){w()("#note-status-output-"+i).remove()},5e3))}},{key:"unlink",value:function(){var t,e=this.getLastRange();e.isOnAnchor()&&(t=ft.ancestor(e.sc,ft.isAnchor),(e=kt.createFromNode(t)).select(),this.setLastRange(),this.beforeCommand(),document.execCommand("unlink"),this.afterCommand())}},{key:"getLinkInfo",value:function(){var t=this.getLastRange().expand(ft.isAnchor),e=w()(x.head(t.nodes(ft.isAnchor))),n={range:t,text:t.toString(),url:e.length?e.attr("href"):""};return e.length&&(n.isNewWindow="_blank"===e.attr("target")),n}},{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,i,r;r=n?{width:(o=t.y/t.x)<(i=e.data("ratio"))?t.x:t.y/i,height:o<i?t.x*i:t.y}:{width:t.x,height:t.y},e.css(r)}},{key:"hasFocus",value:function(){return this.$editable.is(":focus")}},{key:"focus",value:function(){this.hasFocus()||this.$editable.focus()}},{key:"isEmpty",value:function(){return ft.isEmpty(this.$editable[0])||ft.emptyPara===this.$editable.html()}},{key:"empty",value:function(){this.context.invoke("code",ft.emptyPara)}},{key:"normalizeContent",value:function(){this.$editable[0].normalize()}}])&&Ft(t.prototype,e),n&&Ft(t,n),r}();function Ht(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var zt=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.$editable=t.layoutInfo.editable}var t,n,o;return t=e,(n=[{key:"initialize",value:function(){this.$editable.on("paste",this.pasteByEvent.bind(this))}},{key:"pasteByEvent",value:function(t){var e,n,o=this,i=t.originalEvent.clipboardData;i&&i.items&&i.items.length?"file"===(e=1<i.items.length?i.items[1]:x.head(i.items)).kind&&-1!==e.type.indexOf("image/")?(this.context.invoke("editor.insertImagesOrCallback",[e.getAsFile()]),t.preventDefault()):"string"===e.kind&&this.context.invoke("editor.isLimited",i.getData("Text").length)&&t.preventDefault():window.clipboardData&&(n=window.clipboardData.getData("text"),this.context.invoke("editor.isLimited",n.length)&&t.preventDefault()),setTimeout(function(){o.context.invoke("editor.afterCommand")},10)}}])&&Ht(t.prototype,n),o&&Ht(t,o),e}();function Bt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Mt,Ot=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.$eventListener=w()(document),this.$editor=t.layoutInfo.editor,this.$editable=t.layoutInfo.editable,this.options=t.options,this.lang=this.options.langInfo,this.documentEventHandlers={},this.$dropzone=w()(['<div class="note-dropzone">','<div class="note-dropzone-message"/>',"</div>"].join("")).prependTo(this.$editor)}var t,n,o;return t=e,(n=[{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 i=this,o=w()(),r=this.$dropzone.find(".note-dropzone-message");this.documentEventHandlers.onDragenter=function(t){var e=i.context.invoke("codeview.isActivated"),n=0<i.$editor.width()&&0<i.$editor.height();e||o.length||!n||(i.$editor.addClass("dragover"),i.$dropzone.width(i.$editor.width()),i.$dropzone.height(i.$editor.height()),r.text(i.lang.image.dragImageHere)),o=o.add(t.target)},this.documentEventHandlers.onDragleave=function(t){(o=o.not(t.target)).length&&"BODY"!==t.target.nodeName||(o=w()(),i.$editor.removeClass("dragover"))},this.documentEventHandlers.onDrop=function(){o=w()(),i.$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(){i.$dropzone.addClass("hover"),r.text(i.lang.image.dropImage)}).on("dragleave",function(){i.$dropzone.removeClass("hover"),r.text(i.lang.image.dragImageHere)}),this.$dropzone.on("drop",function(t){var o=t.originalEvent.dataTransfer;t.preventDefault(),o&&o.files&&o.files.length?(i.$editable.focus(),i.context.invoke("editor.insertImagesOrCallback",o.files)):w.a.each(o.types,function(t,e){var n;-1<e.toLowerCase().indexOf("_moz_")||(n=o.getData(e),-1<e.toLowerCase().indexOf("text")?i.context.invoke("editor.pasteHTML",n):w()(n).each(function(t,e){i.context.invoke("editor.insertNode",e)}))})}).on("dragover",!1)}},{key:"destroy",value:function(){var e=this;Object.keys(this.documentEventHandlers).forEach(function(t){e.$eventListener.off(t.substr(2).toLowerCase(),e.documentEventHandlers[t])}),this.documentEventHandlers={}}}])&&Bt(t.prototype,n),o&&Bt(t,o),e}();function Ut(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}m.hasCodeMirror&&(Mt=window.CodeMirror);var jt=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.$editor=t.layoutInfo.editor,this.$editable=t.layoutInfo.editable,this.$codable=t.layoutInfo.codable,this.options=t.options}var t,n,o;return t=e,(n=[{key:"sync",value:function(){this.isActivated()&&m.hasCodeMirror&&this.$codable.data("cmEditor").save()}},{key:"isActivated",value:function(){return this.$editor.hasClass("codeview")}},{key:"toggle",value:function(){this.isActivated()?this.deactivate():this.activate(),this.context.triggerEvent("codeview.toggled")}},{key:"purify",value:function(t){var s;return this.options.codeviewFilter&&(t=t.replace(this.options.codeviewFilterRegex,""),this.options.codeviewIframeFilter&&(s=this.options.codeviewIframeWhitelistSrc.concat(this.options.codeviewIframeWhitelistSrcBase),t=t.replace(/(<iframe.*?>.*?(?:<\/iframe>)?)/gi,function(t){if(/<.+src(?==?('|"|\s)?)[\s\S]+src(?=('|"|\s)?)[^>]*?>/i.test(t))return"";var e=!0,n=!1,o=void 0;try{for(var i,r=s[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){var a=i.value;if(new RegExp('src="(https?:)?//'+a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+'/(.+)"').test(t))return t}}catch(t){n=!0,o=t}finally{try{e||null==r.return||r.return()}finally{if(n)throw o}}return""}))),t}},{key:"activate",value:function(){var e,n,o=this;this.$codable.val(ft.html(this.$editable,this.options.prettifyHtml)),this.$codable.height(this.$editable.height()),this.context.invoke("toolbar.updateCodeview",!0),this.$editor.addClass("codeview"),this.$codable.focus(),m.hasCodeMirror?(e=Mt.fromTextArea(this.$codable[0],this.options.codemirror),this.options.codemirror.tern&&(n=new Mt.TernServer(this.options.codemirror.tern),e.ternServer=n,e.on("cursorActivity",function(t){n.updateArgHints(t)})),e.on("blur",function(t){o.context.triggerEvent("blur.codeview",e.getValue(),t)}),e.on("change",function(){o.context.triggerEvent("change.codeview",e.getValue(),e)}),e.setSize(null,this.$editable.outerHeight()),this.$codable.data("cmEditor",e)):(this.$codable.on("blur",function(t){o.context.triggerEvent("blur.codeview",o.$codable.val(),t)}),this.$codable.on("input",function(){o.context.triggerEvent("change.codeview",o.$codable.val(),o.$codable)}))}},{key:"deactivate",value:function(){var t;m.hasCodeMirror&&(t=this.$codable.data("cmEditor"),this.$codable.val(t.getValue()),t.toTextArea());var e=this.purify(ft.value(this.$codable,this.options.prettifyHtml)||ft.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)}},{key:"destroy",value:function(){this.isActivated()&&this.deactivate()}}])&&Ut(t.prototype,n),o&&Ut(t,o),e}();function Wt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Kt=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.$document=w()(document),this.$statusbar=t.layoutInfo.statusbar,this.$editable=t.layoutInfo.editable,this.options=t.options}var t,n,o;return t=e,(n=[{key:"initialize",value:function(){var o=this;this.options.airMode||this.options.disableResizeEditor?this.destroy():this.$statusbar.on("mousedown",function(t){t.preventDefault(),t.stopPropagation();function e(t){var e=t.clientY-(24+n),e=0<o.options.minheight?Math.max(e,o.options.minheight):e;e=0<o.options.maxHeight?Math.min(e,o.options.maxHeight):e,o.$editable.height(e)}var n=o.$editable.offset().top-o.$document.scrollTop();o.$document.on("mousemove",e).one("mouseup",function(){o.$document.off("mousemove",e)})})}},{key:"destroy",value:function(){this.$statusbar.off(),this.$statusbar.addClass("locked")}}])&&Wt(t.prototype,n),o&&Wt(t,o),e}();function qt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Vt=function(){function n(t){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),this.context=t,this.$editor=t.layoutInfo.editor,this.$toolbar=t.layoutInfo.toolbar,this.$editable=t.layoutInfo.editable,this.$codable=t.layoutInfo.codable,this.$window=w()(window),this.$scrollbar=w()("html, body"),this.onResize=function(){e.resizeTo({h:e.$window.height()-e.$toolbar.outerHeight()})}}var t,e,o;return t=n,(e=[{key:"resizeTo",value:function(t){this.$editable.css("height",t.h),this.$codable.css("height",t.h),this.$codable.data("cmeditor")&&this.$codable.data("cmeditor").setsize(null,t.h)}},{key:"toggle",value:function(){this.$editor.toggleClass("fullscreen"),this.isFullscreen()?(this.$editable.data("orgHeight",this.$editable.css("height")),this.$editable.data("orgMaxHeight",this.$editable.css("maxHeight")),this.$editable.css("maxHeight",""),this.$window.on("resize",this.onResize).trigger("resize"),this.$scrollbar.css("overflow","hidden")):(this.$window.off("resize",this.onResize),this.resizeTo({h:this.$editable.data("orgHeight")}),this.$editable.css("maxHeight",this.$editable.css("orgMaxHeight")),this.$scrollbar.css("overflow","visible")),this.context.invoke("toolbar.updateFullscreen",this.isFullscreen())}},{key:"isFullscreen",value:function(){return this.$editor.hasClass("fullscreen")}}])&&qt(t.prototype,e),o&&qt(t,o),n}();function _t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Gt=function(){function e(t){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.$document=w()(document),this.$editingArea=t.layoutInfo.editingArea,this.options=t.options,this.lang=this.options.langInfo,this.events={"summernote.mousedown":function(t,e){n.update(e.target,e)&&e.preventDefault()},"summernote.keyup summernote.scroll summernote.change summernote.dialog.shown":function(){n.update()},"summernote.disable summernote.blur":function(){n.hide()},"summernote.codeview.toggled":function(){n.update()}}}var t,n,o;return t=e,(n=[{key:"initialize",value:function(){var r=this;this.$handle=w()(['<div class="note-handle">','<div class="note-control-selection">','<div class="note-control-selection-bg"></div>','<div class="note-control-holder note-control-nw"></div>','<div class="note-control-holder note-control-ne"></div>','<div class="note-control-holder note-control-sw"></div>','<div class="',this.options.disableResizeImage?"note-control-holder":"note-control-sizing",' note-control-se"></div>',this.options.disableResizeImage?"":'<div class="note-control-selection-info"></div>',"</div>","</div>"].join("")).prependTo(this.$editingArea),this.$handle.on("mousedown",function(t){var e,n,o,i;ft.isControlSizing(t.target)&&(t.preventDefault(),t.stopPropagation(),e=r.$handle.find(".note-control-selection").data("target"),n=e.offset(),o=r.$document.scrollTop(),i=function(t){r.context.invoke("editor.resizeTo",{x:t.clientX-n.left,y:t.clientY-(n.top-o)},e,!t.shiftKey),r.update(e[0],t)},r.$document.on("mousemove",i).one("mouseup",function(t){t.preventDefault(),r.$document.off("mousemove",i),r.context.invoke("editor.afterCommand")}),e.data("ratio")||e.data("ratio",e.height()/e.width()))}),this.$handle.on("wheel",function(t){t.preventDefault(),r.update()})}},{key:"destroy",value:function(){this.$handle.remove()}},{key:"update",value:function(t,e){if(this.context.isDisabled())return!1;var n,o,i,r,a,s,l=ft.isImg(t),c=this.$handle.find(".note-control-selection");return this.context.invoke("imagePopover.update",t,e),l?(i={left:(o=(n=w()(t)).position()).left+parseInt(n.css("marginLeft"),10),top:o.top+parseInt(n.css("marginTop"),10)},r={w:n.outerWidth(!1),h:n.outerHeight(!1)},c.css({display:"block",left:i.left,top:i.top,width:r.w,height:r.h}).data("target",n),(a=new Image).src=n.attr("src"),s=r.w+"x"+r.h+" ("+this.lang.image.original+": "+a.width+"x"+a.height+")",c.find(".note-control-selection-info").text(s),this.context.invoke("editor.saveTarget",t)):this.hide(),l}},{key:"hide",value:function(){this.context.invoke("editor.clearTarget"),this.$handle.children().hide()}}])&&_t(t.prototype,n),o&&_t(t,o),e}();function Yt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Zt=/^([A-Za-z][A-Za-z0-9+-.]*\:[\/]{2}|tel:|mailto:[A-Z0-9._%+-]+@)?(www\.)?(.+)$/i,Xt=function(){function e(t){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.events={"summernote.keyup":function(t,e){e.isDefaultPrevented()||n.handleKeyup(e)},"summernote.keydown":function(t,e){n.handleKeydown(e)}}}var t,n,o;return t=e,(n=[{key:"initialize",value:function(){this.lastWordRange=null}},{key:"destroy",value:function(){this.lastWordRange=null}},{key:"replace",value:function(){var t,e,n,o,i;!this.lastWordRange||(e=(t=this.lastWordRange.toString()).match(Zt))&&(e[1]||e[2])&&(n=e[1]?t:"http://"+t,o=t.replace(/^(?:https?:\/\/)?(?:tel?:?)?(?:mailto?:?)?(?:www\.)?/i,"").split("/")[0],i=w()("<a />").html(o).attr("href",n)[0],this.context.options.linkTargetBlank&&w()(i).attr("target","_blank"),this.lastWordRange.insertNode(i),this.lastWordRange=null,this.context.invoke("editor.focus"))}},{key:"handleKeydown",value:function(t){var e;x.contains([Ct.code.ENTER,Ct.code.SPACE],t.keyCode)&&(e=this.context.invoke("editor.createRange").getWordRange(),this.lastWordRange=e)}},{key:"handleKeyup",value:function(t){x.contains([Ct.code.ENTER,Ct.code.SPACE],t.keyCode)&&this.replace()}}])&&Yt(t.prototype,n),o&&Yt(t,o),e}();function Qt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Jt=function(){function n(t){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),this.$note=t.layoutInfo.note,this.events={"summernote.change":function(){e.$note.val(t.invoke("code"))}}}var t,e,o;return t=n,(e=[{key:"shouldInitialize",value:function(){return ft.isTextarea(this.$note[0])}}])&&Qt(t.prototype,e),o&&Qt(t,o),n}();function te(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var ee=function(){function e(t){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.options=t.options.replace||{},this.keys=[Ct.code.ENTER,Ct.code.SPACE,Ct.code.PERIOD,Ct.code.COMMA,Ct.code.SEMICOLON,Ct.code.SLASH],this.previousKeydownCode=null,this.events={"summernote.keyup":function(t,e){e.isDefaultPrevented()||n.handleKeyup(e)},"summernote.keydown":function(t,e){n.handleKeydown(e)}}}var t,n,o;return t=e,(n=[{key:"shouldInitialize",value:function(){return!!this.options.match}},{key:"initialize",value:function(){this.lastWord=null}},{key:"destroy",value:function(){this.lastWord=null}},{key:"replace",value:function(){var n,t;this.lastWord&&(t=(n=this).lastWord.toString(),this.options.match(t,function(t){if(t){var e="";if("string"==typeof t?e=ft.createText(t):t instanceof jQuery?e=t[0]:t instanceof Node&&(e=t),!e)return;n.lastWord.insertNode(e),n.lastWord=null,n.context.invoke("editor.focus")}}))}},{key:"handleKeydown",value:function(t){var e;this.previousKeydownCode&&x.contains(this.keys,this.previousKeydownCode)||x.contains(this.keys,t.keyCode)&&(e=this.context.invoke("editor.createRange").getWordRange(),this.lastWord=e),this.previousKeydownCode=t.keyCode}},{key:"handleKeyup",value:function(t){x.contains(this.keys,t.keyCode)&&this.replace()}}])&&te(t.prototype,n),o&&te(t,o),e}();function ne(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var oe=function(){function n(t){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),this.context=t,this.$editingArea=t.layoutInfo.editingArea,this.options=t.options,!0===this.options.inheritPlaceholder&&(this.options.placeholder=this.context.$note.attr("placeholder")||this.options.placeholder),this.events={"summernote.init summernote.change":function(){e.update()},"summernote.codeview.toggled":function(){e.update()}}}var t,e,o;return t=n,(e=[{key:"shouldInitialize",value:function(){return!!this.options.placeholder}},{key:"initialize",value:function(){var t=this;this.$placeholder=w()('<div class="note-placeholder">'),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(t.prototype,e),o&&ne(t,o),n}();function ie(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var re=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.ui=w.a.summernote.ui,this.context=t,this.$toolbar=t.layoutInfo.toolbar,this.options=t.options,this.lang=this.options.langInfo,this.invertedKeyMap=g.invertObject(this.options.keyMap[m.isMac?"mac":"pc"])}var t,n,o;return t=e,(n=[{key:"representShortcut",value:function(t){var e=this.invertedKeyMap[t];return this.options.shortcuts&&e?(m.isMac&&(e=e.replace("CMD","⌘").replace("SHIFT","⇧"))," ("+(e=e.replace("BACKSLASH","\\").replace("SLASH","/").replace("LEFTBRACKET","[").replace("RIGHTBRACKET","]"))+")"):""}},{key:"button",value:function(t){return!this.options.tooltip&&t.tooltip&&delete t.tooltip,t.container=this.options.container,this.ui.button(t)}},{key:"initialize",value:function(){this.addToolbarButtons(),this.addImagePopoverButtons(),this.addLinkPopoverButtons(),this.addTablePopoverButtons(),this.fontInstalledMap={}}},{key:"destroy",value:function(){delete this.fontInstalledMap}},{key:"isFontInstalled",value:function(t){return Object.prototype.hasOwnProperty.call(this.fontInstalledMap,t)||(this.fontInstalledMap[t]=m.isFontInstalled(t)||x.contains(this.options.fontNamesIgnoreCheck,t)),this.fontInstalledMap[t]}},{key:"isFontDeservedToAdd",value:function(t){return""!==(t=t.toLowerCase())&&this.isFontInstalled(t)&&-1===m.genericFontFamilies.indexOf(t)}},{key:"colorPalette",value:function(h,t,n,o){var f=this;return this.ui.buttonGroup({className:"note-color "+h,children:[this.button({className:"note-current-color-button",contents:this.ui.icon(this.options.icons.font+" note-recent-color"),tooltip:t,click:function(t){var e=w()(t.currentTarget);n&&o?f.context.invoke("editor.color",{backColor:e.attr("data-backColor"),foreColor:e.attr("data-foreColor")}):n?f.context.invoke("editor.color",{backColor:e.attr("data-backColor")}):o&&f.context.invoke("editor.color",{foreColor:e.attr("data-foreColor")})},callback:function(t){var e=t.find(".note-recent-color");n&&(e.css("background-color",f.options.colorButton.backColor),t.attr("data-backColor",f.options.colorButton.backColor)),o?(e.css("color",f.options.colorButton.foreColor),t.attr("data-foreColor",f.options.colorButton.foreColor)):e.css("color","transparent")}}),this.button({className:"dropdown-toggle",contents:this.ui.dropdownButtonContents("",this.options),tooltip:this.lang.color.more,data:{toggle:"dropdown"}}),this.ui.dropdown({items:(n?['<div class="note-palette">','<div class="note-palette-title">'+this.lang.color.background+"</div>","<div>",'<button type="button" class="note-color-reset btn btn-light" data-event="backColor" data-value="inherit">',this.lang.color.transparent,"</button>","</div>",'<div class="note-holder" data-event="backColor"/>',"<div>",'<button type="button" class="note-color-select btn btn-light" data-event="openPalette" data-value="backColorPicker">',this.lang.color.cpSelect,"</button>",'<input type="color" id="backColorPicker" class="note-btn note-color-select-btn" value="'+this.options.colorButton.backColor+'" data-event="backColorPalette">',"</div>",'<div class="note-holder-custom" id="backColorPalette" data-event="backColor"/>',"</div>"].join(""):"")+(o?['<div class="note-palette">','<div class="note-palette-title">'+this.lang.color.foreground+"</div>","<div>",'<button type="button" class="note-color-reset btn btn-light" data-event="removeFormat" data-value="foreColor">',this.lang.color.resetToDefault,"</button>","</div>",'<div class="note-holder" data-event="foreColor"/>',"<div>",'<button type="button" class="note-color-select btn btn-light" data-event="openPalette" data-value="foreColorPicker">',this.lang.color.cpSelect,"</button>",'<input type="color" id="foreColorPicker" class="note-btn note-color-select-btn" value="'+this.options.colorButton.foreColor+'" data-event="foreColorPalette">',"</div>",'<div class="note-holder-custom" id="foreColorPalette" data-event="foreColor"/>',"</div>"].join(""):""),callback:function(n){n.find(".note-holder").each(function(t,e){var n=w()(e);n.append(f.ui.palette({colors:f.options.colors,colorsName:f.options.colorsName,eventName:n.data("event"),container:f.options.container,tooltip:f.options.tooltip}).render())});var o=[["#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF"]];n.find(".note-holder-custom").each(function(t,e){var n=w()(e);n.append(f.ui.palette({colors:o,colorsName:o,eventName:n.data("event"),container:f.options.container,tooltip:f.options.tooltip}).render())}),n.find("input[type=color]").each(function(t,e){w()(e).change(function(){var t=n.find("#"+w()(this).data("event")).find(".note-color-btn").first(),e=this.value.toUpperCase();t.css("background-color",e).attr("aria-label",e).attr("data-value",e).attr("data-original-title",e),t.click()})})},click:function(t){t.stopPropagation();var e,n,o,i,r,a,s,l=w()("."+h).find(".note-dropdown-menu"),c=w()(t.target),u=c.data("event"),d=c.attr("data-value");"openPalette"===u?(e=l.find("#"+d),o=(n=w()(l.find("#"+e.data("event")).find(".note-color-row")[0])).find(".note-color-btn").last().detach(),i=e.val(),o.css("background-color",i).attr("aria-label",i).attr("data-value",i).attr("data-original-title",i),n.prepend(o),e.click()):(x.contains(["backColor","foreColor"],u)&&(r="backColor"===u?"background-color":"color",a=c.closest(".note-color").find(".note-recent-color"),s=c.closest(".note-color").find(".note-current-color-button"),a.css(r,d),s.attr("data-"+u,d)),f.context.invoke("editor."+u,d))}})]}).render()}},{key:"addToolbarButtons",value:function(){var o=this;this.context.memo("button.style",function(){return o.ui.buttonGroup([o.button({className:"dropdown-toggle",contents:o.ui.dropdownButtonContents(o.ui.icon(o.options.icons.magic),o.options),tooltip:o.lang.style.style,data:{toggle:"dropdown"}}),o.ui.dropdown({className:"dropdown-style",items:o.options.styleTags,title:o.lang.style.style,template:function(t){"string"==typeof t&&(t={tag:t,title:Object.prototype.hasOwnProperty.call(o.lang.style,t)?o.lang.style[t]:t});var e=t.tag,n=t.title;return"<"+e+(t.style?' style="'+t.style+'" ':"")+(t.className?' class="'+t.className+'"':"")+">"+n+"</"+e+">"},click:o.context.createInvokeHandler("editor.formatBlock")})]).render()});for(var t=function(t){var e=o.options.styleTags[t];o.context.memo("button.style."+e,function(){return o.button({className:"note-btn-style-"+e,contents:'<div data-value="'+e+'">'+e.toUpperCase()+"</div>",tooltip:o.lang.style[e],click:o.context.createInvokeHandler("editor.formatBlock")}).render()})},e=0,n=this.options.styleTags.length;e<n;e++)t(e);this.context.memo("button.bold",function(){return o.button({className:"note-btn-bold",contents:o.ui.icon(o.options.icons.bold),tooltip:o.lang.font.bold+o.representShortcut("bold"),click:o.context.createInvokeHandlerAndUpdateState("editor.bold")}).render()}),this.context.memo("button.italic",function(){return o.button({className:"note-btn-italic",contents:o.ui.icon(o.options.icons.italic),tooltip:o.lang.font.italic+o.representShortcut("italic"),click:o.context.createInvokeHandlerAndUpdateState("editor.italic")}).render()}),this.context.memo("button.underline",function(){return o.button({className:"note-btn-underline",contents:o.ui.icon(o.options.icons.underline),tooltip:o.lang.font.underline+o.representShortcut("underline"),click:o.context.createInvokeHandlerAndUpdateState("editor.underline")}).render()}),this.context.memo("button.clear",function(){return o.button({contents:o.ui.icon(o.options.icons.eraser),tooltip:o.lang.font.clear+o.representShortcut("removeFormat"),click:o.context.createInvokeHandler("editor.removeFormat")}).render()}),this.context.memo("button.strikethrough",function(){return o.button({className:"note-btn-strikethrough",contents:o.ui.icon(o.options.icons.strikethrough),tooltip:o.lang.font.strikethrough+o.representShortcut("strikethrough"),click:o.context.createInvokeHandlerAndUpdateState("editor.strikethrough")}).render()}),this.context.memo("button.superscript",function(){return o.button({className:"note-btn-superscript",contents:o.ui.icon(o.options.icons.superscript),tooltip:o.lang.font.superscript,click:o.context.createInvokeHandlerAndUpdateState("editor.superscript")}).render()}),this.context.memo("button.subscript",function(){return o.button({className:"note-btn-subscript",contents:o.ui.icon(o.options.icons.subscript),tooltip:o.lang.font.subscript,click:o.context.createInvokeHandlerAndUpdateState("editor.subscript")}).render()}),this.context.memo("button.fontname",function(){var t=o.context.invoke("editor.currentStyle");return o.options.addDefaultFonts&&w.a.each(t["font-family"].split(","),function(t,e){e=e.trim().replace(/['"]+/g,""),o.isFontDeservedToAdd(e)&&-1===o.options.fontNames.indexOf(e)&&o.options.fontNames.push(e)}),o.ui.buttonGroup([o.button({className:"dropdown-toggle",contents:o.ui.dropdownButtonContents('<span class="note-current-fontname"/>',o.options),tooltip:o.lang.font.name,data:{toggle:"dropdown"}}),o.ui.dropdownCheck({className:"dropdown-fontname",checkClassName:o.options.icons.menuCheck,items:o.options.fontNames.filter(o.isFontInstalled.bind(o)),title:o.lang.font.name,template:function(t){return'<span style="font-family: '+m.validFontName(t)+'">'+t+"</span>"},click:o.context.createInvokeHandlerAndUpdateState("editor.fontName")})]).render()}),this.context.memo("button.fontsize",function(){return o.ui.buttonGroup([o.button({className:"dropdown-toggle",contents:o.ui.dropdownButtonContents('<span class="note-current-fontsize"/>',o.options),tooltip:o.lang.font.size,data:{toggle:"dropdown"}}),o.ui.dropdownCheck({className:"dropdown-fontsize",checkClassName:o.options.icons.menuCheck,items:o.options.fontSizes,title:o.lang.font.size,click:o.context.createInvokeHandlerAndUpdateState("editor.fontSize")})]).render()}),this.context.memo("button.fontsizeunit",function(){return o.ui.buttonGroup([o.button({className:"dropdown-toggle",contents:o.ui.dropdownButtonContents('<span class="note-current-fontsizeunit"/>',o.options),tooltip:o.lang.font.sizeunit,data:{toggle:"dropdown"}}),o.ui.dropdownCheck({className:"dropdown-fontsizeunit",checkClassName:o.options.icons.menuCheck,items:o.options.fontSizeUnits,title:o.lang.font.sizeunit,click:o.context.createInvokeHandlerAndUpdateState("editor.fontSizeUnit")})]).render()}),this.context.memo("button.color",function(){return o.colorPalette("note-color-all",o.lang.color.recent,!0,!0)}),this.context.memo("button.forecolor",function(){return o.colorPalette("note-color-fore",o.lang.color.foreground,!1,!0)}),this.context.memo("button.backcolor",function(){return o.colorPalette("note-color-back",o.lang.color.background,!0,!1)}),this.context.memo("button.ul",function(){return o.button({contents:o.ui.icon(o.options.icons.unorderedlist),tooltip:o.lang.lists.unordered+o.representShortcut("insertUnorderedList"),click:o.context.createInvokeHandler("editor.insertUnorderedList")}).render()}),this.context.memo("button.ol",function(){return o.button({contents:o.ui.icon(o.options.icons.orderedlist),tooltip:o.lang.lists.ordered+o.representShortcut("insertOrderedList"),click:o.context.createInvokeHandler("editor.insertOrderedList")}).render()});var i=this.button({contents:this.ui.icon(this.options.icons.alignLeft),tooltip:this.lang.paragraph.left+this.representShortcut("justifyLeft"),click:this.context.createInvokeHandler("editor.justifyLeft")}),r=this.button({contents:this.ui.icon(this.options.icons.alignCenter),tooltip:this.lang.paragraph.center+this.representShortcut("justifyCenter"),click:this.context.createInvokeHandler("editor.justifyCenter")}),a=this.button({contents:this.ui.icon(this.options.icons.alignRight),tooltip:this.lang.paragraph.right+this.representShortcut("justifyRight"),click:this.context.createInvokeHandler("editor.justifyRight")}),s=this.button({contents:this.ui.icon(this.options.icons.alignJustify),tooltip:this.lang.paragraph.justify+this.representShortcut("justifyFull"),click:this.context.createInvokeHandler("editor.justifyFull")}),l=this.button({contents:this.ui.icon(this.options.icons.outdent),tooltip:this.lang.paragraph.outdent+this.representShortcut("outdent"),click:this.context.createInvokeHandler("editor.outdent")}),c=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",g.invoke(i,"render")),this.context.memo("button.justifyCenter",g.invoke(r,"render")),this.context.memo("button.justifyRight",g.invoke(a,"render")),this.context.memo("button.justifyFull",g.invoke(s,"render")),this.context.memo("button.outdent",g.invoke(l,"render")),this.context.memo("button.indent",g.invoke(c,"render")),this.context.memo("button.paragraph",function(){return o.ui.buttonGroup([o.button({className:"dropdown-toggle",contents:o.ui.dropdownButtonContents(o.ui.icon(o.options.icons.alignLeft),o.options),tooltip:o.lang.paragraph.paragraph,data:{toggle:"dropdown"}}),o.ui.dropdown([o.ui.buttonGroup({className:"note-align",children:[i,r,a,s]}),o.ui.buttonGroup({className:"note-list",children:[l,c]})])]).render()}),this.context.memo("button.height",function(){return o.ui.buttonGroup([o.button({className:"dropdown-toggle",contents:o.ui.dropdownButtonContents(o.ui.icon(o.options.icons.textHeight),o.options),tooltip:o.lang.font.height,data:{toggle:"dropdown"}}),o.ui.dropdownCheck({items:o.options.lineHeights,checkClassName:o.options.icons.menuCheck,className:"dropdown-line-height",title:o.lang.font.height,click:o.context.createInvokeHandler("editor.lineHeight")})]).render()}),this.context.memo("button.table",function(){return o.ui.buttonGroup([o.button({className:"dropdown-toggle",contents:o.ui.dropdownButtonContents(o.ui.icon(o.options.icons.table),o.options),tooltip:o.lang.table.table,data:{toggle:"dropdown"}}),o.ui.dropdown({title:o.lang.table.table,className:"note-table",items:['<div class="note-dimension-picker">','<div class="note-dimension-picker-mousecatcher" data-event="insertTable" data-value="1x1"/>','<div class="note-dimension-picker-highlighted"/>','<div class="note-dimension-picker-unhighlighted"/>',"</div>",'<div class="note-dimension-display">1 x 1</div>'].join("")})],{callback:function(t){t.find(".note-dimension-picker-mousecatcher").css({width:o.options.insertTableMaxSize.col+"em",height:o.options.insertTableMaxSize.row+"em"}).mousedown(o.context.createInvokeHandler("editor.insertTable")).on("mousemove",o.tableMoveHandler.bind(o))}}).render()}),this.context.memo("button.link",function(){return o.button({contents:o.ui.icon(o.options.icons.link),tooltip:o.lang.link.link+o.representShortcut("linkDialog.show"),click:o.context.createInvokeHandler("linkDialog.show")}).render()}),this.context.memo("button.picture",function(){return o.button({contents:o.ui.icon(o.options.icons.picture),tooltip:o.lang.image.image,click:o.context.createInvokeHandler("imageDialog.show")}).render()}),this.context.memo("button.video",function(){return o.button({contents:o.ui.icon(o.options.icons.video),tooltip:o.lang.video.video,click:o.context.createInvokeHandler("videoDialog.show")}).render()}),this.context.memo("button.hr",function(){return o.button({contents:o.ui.icon(o.options.icons.minus),tooltip:o.lang.hr.insert+o.representShortcut("insertHorizontalRule"),click:o.context.createInvokeHandler("editor.insertHorizontalRule")}).render()}),this.context.memo("button.fullscreen",function(){return o.button({className:"btn-fullscreen",contents:o.ui.icon(o.options.icons.arrowsAlt),tooltip:o.lang.options.fullscreen,click:o.context.createInvokeHandler("fullscreen.toggle")}).render()}),this.context.memo("button.codeview",function(){return o.button({className:"btn-codeview",contents:o.ui.icon(o.options.icons.code),tooltip:o.lang.options.codeview,click:o.context.createInvokeHandler("codeview.toggle")}).render()}),this.context.memo("button.redo",function(){return o.button({contents:o.ui.icon(o.options.icons.redo),tooltip:o.lang.history.redo+o.representShortcut("redo"),click:o.context.createInvokeHandler("editor.redo")}).render()}),this.context.memo("button.undo",function(){return o.button({contents:o.ui.icon(o.options.icons.undo),tooltip:o.lang.history.undo+o.representShortcut("undo"),click:o.context.createInvokeHandler("editor.undo")}).render()}),this.context.memo("button.help",function(){return o.button({contents:o.ui.icon(o.options.icons.question),tooltip:o.lang.options.help,click:o.context.createInvokeHandler("helpDialog.show")}).render()})}},{key:"addImagePopoverButtons",value:function(){var t=this;this.context.memo("button.resizeFull",function(){return t.button({contents:'<span class="note-fontsize-10">100%</span>',tooltip:t.lang.image.resizeFull,click:t.context.createInvokeHandler("editor.resize","1")}).render()}),this.context.memo("button.resizeHalf",function(){return t.button({contents:'<span class="note-fontsize-10">50%</span>',tooltip:t.lang.image.resizeHalf,click:t.context.createInvokeHandler("editor.resize","0.5")}).render()}),this.context.memo("button.resizeQuarter",function(){return t.button({contents:'<span class="note-fontsize-10">25%</span>',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;n<o;n++){for(var i=e[n],r=Array.isArray(i)?i[0]:i,a=Array.isArray(i)?1===i.length?[i[0]]:i[1]:[i],s=this.ui.buttonGroup({className:"note-"+r}).render(),l=0,c=a.length;l<c;l++){var u=this.context.memo("button."+a[l]);u&&s.append("function"==typeof u?u(this.context):u)}s.appendTo(t)}}},{key:"updateCurrentStyle",value:function(t){var e,i,r,a,o,s=this,n=t||this.$toolbar,l=this.context.invoke("editor.currentStyle");this.updateBtnStates(n,{".note-btn-bold":function(){return"bold"===l["font-bold"]},".note-btn-italic":function(){return"italic"===l["font-italic"]},".note-btn-underline":function(){return"underline"===l["font-underline"]},".note-btn-subscript":function(){return"subscript"===l["font-subscript"]},".note-btn-superscript":function(){return"superscript"===l["font-superscript"]},".note-btn-strikethrough":function(){return"strikethrough"===l["font-strikethrough"]}}),l["font-family"]&&(e=l["font-family"].split(",").map(function(t){return t.replace(/[\'\"]/g,"").replace(/\s+$/,"").replace(/^\s+/,"")}),i=x.find(e,this.isFontInstalled.bind(this)),n.find(".dropdown-fontname a").each(function(t,e){var n=w()(e),o=n.data("value")+""==i+"";n.toggleClass("checked",o)}),n.find(".note-current-fontname").text(i).css("font-family",i)),l["font-size"]&&(r=l["font-size"],n.find(".dropdown-fontsize a").each(function(t,e){var n=w()(e),o=n.data("value")+""==r+"";n.toggleClass("checked",o)}),n.find(".note-current-fontsize").text(r),a=l["font-size-unit"],n.find(".dropdown-fontsizeunit a").each(function(t,e){var n=w()(e),o=n.data("value")+""==a+"";n.toggleClass("checked",o)}),n.find(".note-current-fontsizeunit").text(a)),l["line-height"]&&(o=l["line-height"],n.find(".dropdown-line-height li a").each(function(t,e){var n=w()(e).data("value")+""==o+"";s.className=n?"checked":""}))}},{key:"updateBtnStates",value:function(n,t){var o=this;w.a.each(t,function(t,e){o.ui.toggleBtnActive(n.find(t),e())})}},{key:"tableMoveHandler",value:function(t){var e,n,o=w()(t.target.parentNode),i=o.next(),r=o.find(".note-dimension-picker-mousecatcher"),a=o.find(".note-dimension-picker-highlighted"),s=o.find(".note-dimension-picker-unhighlighted");n=void 0===t.offsetX?(e=w()(t.target).offset(),{x:t.pageX-e.left,y:t.pageY-e.top}):{x:t.offsetX,y:t.offsetY};var l=Math.ceil(n.x/18)||1,c=Math.ceil(n.y/18)||1;a.css({width:l+"em",height:c+"em"}),r.data("value",l+"x"+c),3<l&&l<this.options.insertTableMaxSize.col&&s.css({width:l+1+"em"}),3<c&&c<this.options.insertTableMaxSize.row&&s.css({height:c+1+"em"}),i.html(l+" x "+c)}}])&&ie(t.prototype,n),o&&ie(t,o),e}();function ae(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var se=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.$window=w()(window),this.$document=w()(document),this.ui=w.a.summernote.ui,this.$note=t.layoutInfo.note,this.$editor=t.layoutInfo.editor,this.$toolbar=t.layoutInfo.toolbar,this.$editable=t.layoutInfo.editable,this.$statusbar=t.layoutInfo.statusbar,this.options=t.options,this.isFollowing=!1,this.followScroll=this.followScroll.bind(this)}var t,n,o;return t=e,(n=[{key:"shouldInitialize",value:function(){return!this.options.airMode}},{key:"initialize",value:function(){var t=this;this.options.toolbar=this.options.toolbar||[],this.options.toolbar.length?this.context.invoke("buttons.build",this.$toolbar,this.options.toolbar):this.$toolbar.hide(),this.options.toolbarContainer&&this.$toolbar.appendTo(this.options.toolbarContainer),this.changeContainer(!1),this.$note.on("summernote.keyup summernote.mouseup summernote.change",function(){t.context.invoke("buttons.updateCurrentStyle")}),this.context.invoke("buttons.updateCurrentStyle"),this.options.followingToolbar&&this.$window.on("scroll resize",this.followScroll)}},{key:"destroy",value:function(){this.$toolbar.children().remove(),this.options.followingToolbar&&this.$window.off("scroll resize",this.followScroll)}},{key:"followScroll",value:function(){if(this.$editor.hasClass("fullscreen"))return!1;var t=this.$editor.outerHeight(),e=this.$editor.width(),n=this.$toolbar.height(),o=this.$statusbar.height(),i=0;this.options.otherStaticBar&&(i=w()(this.options.otherStaticBar).outerHeight());var r=this.$document.scrollTop(),a=this.$editor.offset().top,s=a-i,l=a+t-i-n-o;!this.isFollowing&&s<r&&r<l-n?(this.isFollowing=!0,this.$editable.css({marginTop:this.$toolbar.outerHeight()}),this.$toolbar.css({position:"fixed",top:i,width:e,zIndex:1e3})):this.isFollowing&&(r<s||l<r)&&(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(".btn-codeview").not(".btn-fullscreen")),this.ui.toggleBtn(e,!0)}},{key:"deactivate",value:function(t){var e=this.$toolbar.find("button");t||(e=e.not(".btn-codeview").not(".btn-fullscreen")),this.ui.toggleBtn(e,!1)}}])&&ae(t.prototype,n),o&&ae(t,o),e}();function le(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var ce=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.ui=w.a.summernote.ui,this.$body=w()(document.body),this.$editor=t.layoutInfo.editor,this.options=t.options,this.lang=this.options.langInfo,t.memo("help.linkDialog.show",this.options.langInfo.help["linkDialog.show"])}var t,n,o;return t=e,(n=[{key:"initialize",value:function(){var t=this.options.dialogsInBody?this.$body:this.options.container,e=['<div class="form-group note-form-group">','<label for="note-dialog-link-txt-'.concat(this.options.id,'" class="note-form-label">').concat(this.lang.link.textToDisplay,"</label>"),'<input id="note-dialog-link-txt-'.concat(this.options.id,'" class="note-link-text form-control note-form-control note-input" type="text"/>'),"</div>",'<div class="form-group note-form-group">','<label for="note-dialog-link-url-'.concat(this.options.id,'" class="note-form-label">').concat(this.lang.link.url,"</label>"),'<input id="note-dialog-link-url-'.concat(this.options.id,'" class="note-link-url form-control note-form-control note-input" type="text" value="http://"/>'),"</div>",this.options.disableLinkTarget?"":w()("<div/>").append(this.ui.checkbox({className:"sn-checkbox-open-in-new-window",text:this.lang.link.openInNewWindow,checked:!0}).render()).html(),w()("<div/>").append(this.ui.checkbox({className:"sn-checkbox-use-protocol",text:this.lang.link.useProtocol,checked:!0}).render()).html()].join(""),n='<input type="button" href="#" class="'.concat("btn btn-primary note-btn note-btn-primary note-link-btn",'" value="').concat(this.lang.link.insert,'" disabled>');this.$dialog=this.ui.dialog({className:"link-dialog",title:this.lang.link.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===Ct.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(l){var c=this;return w.a.Deferred(function(n){var o=c.$dialog.find(".note-link-text"),i=c.$dialog.find(".note-link-url"),r=c.$dialog.find(".note-link-btn"),a=c.$dialog.find(".sn-checkbox-open-in-new-window input[type=checkbox]"),s=c.$dialog.find(".sn-checkbox-use-protocol input[type=checkbox]");c.ui.onDialogShown(c.$dialog,function(){c.context.triggerEvent("dialog.shown"),!l.url&&g.isValidUrl(l.text)&&(l.url=l.text),o.on("input paste propertychange",function(){l.text=o.val(),c.toggleLinkBtn(r,o,i)}).val(l.text),i.on("input paste propertychange",function(){l.text||o.val(i.val()),c.toggleLinkBtn(r,o,i)}).val(l.url),m.isSupportTouch||i.trigger("focus"),c.toggleLinkBtn(r,o,i),c.bindEnterKey(i,r),c.bindEnterKey(o,r);var t=void 0!==l.isNewWindow?l.isNewWindow:c.context.options.linkTargetBlank;a.prop("checked",t);var e=!l.url&&c.context.options.useProtocol;s.prop("checked",e),r.one("click",function(t){t.preventDefault(),n.resolve({range:l.range,url:i.val(),text:o.val(),isNewWindow:a.is(":checked"),checkProtocol:s.is(":checked")}),c.ui.hideDialog(c.$dialog)})}),c.ui.onDialogHidden(c.$dialog,function(){o.off(),i.off(),r.off(),"pending"===n.state()&&n.reject()}),c.ui.showDialog(c.$dialog)}).promise()}},{key:"show",value:function(){var e=this,t=this.context.invoke("editor.getLinkInfo");this.context.invoke("editor.saveRange"),this.showLinkDialog(t).then(function(t){e.context.invoke("editor.restoreRange"),e.context.invoke("editor.createLink",t)}).fail(function(){e.context.invoke("editor.restoreRange")})}}])&&le(t.prototype,n),o&&le(t,o),e}();function ue(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var de=function(){function n(t){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),this.context=t,this.ui=w.a.summernote.ui,this.options=t.options,this.events={"summernote.keyup summernote.mouseup summernote.change summernote.scroll":function(){e.update()},"summernote.disable summernote.dialog.shown summernote.blur":function(){e.hide()}}}var t,e,o;return t=n,(e=[{key:"shouldInitialize",value:function(){return!x.isEmpty(this.options.popover.link)}},{key:"initialize",value:function(){this.$popover=this.ui.popover({className:"note-link-popover",callback:function(t){t.find(".popover-content,.note-popover-content").prepend('<span><a target="_blank"></a>&nbsp;</span>')}}).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(){var t,e,n,o,i;this.context.invoke("editor.hasFocus")&&(t=this.context.invoke("editor.getLastRange")).isCollapsed()&&t.isOnAnchor()?(e=ft.ancestor(t.sc,ft.isAnchor),n=w()(e).attr("href"),this.$popover.find("a").attr("href",n).text(n),o=ft.posFromPlaceholder(e),i=w()(this.options.container).offset(),o.top-=i.top,o.left-=i.left,this.$popover.css({display:"block",left:o.left,top:o.top})):this.hide()}},{key:"hide",value:function(){this.$popover.hide()}}])&&ue(t.prototype,e),o&&ue(t,o),n}();function he(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var fe=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.ui=w.a.summernote.ui,this.$body=w()(document.body),this.$editor=t.layoutInfo.editor,this.options=t.options,this.lang=this.options.langInfo}var t,n,o;return t=e,(n=[{key:"initialize",value:function(){var t,e,n="";this.options.maximumImageFileSize&&(t=Math.floor(Math.log(this.options.maximumImageFileSize)/Math.log(1024)),e=+(this.options.maximumImageFileSize/Math.pow(1024,t)).toFixed(2)+" "+" KMGTP"[t]+"B",n="<small>".concat(this.lang.image.maximumFileSize+" : "+e,"</small>"));var o=this.options.dialogsInBody?this.$body:this.options.container,i=['<div class="form-group note-form-group note-group-select-from-files">','<label for="note-dialog-image-file-'+this.options.id+'" class="note-form-label">'+this.lang.image.selectFromFiles+"</label>",'<input id="note-dialog-image-file-'+this.options.id+'" class="note-image-input form-control-file note-form-control note-input" ',' type="file" name="files" accept="image/*" multiple="multiple"/>',n,"</div>",'<div class="form-group note-group-image-url">','<label for="note-dialog-image-url-'+this.options.id+'" class="note-form-label">'+this.lang.image.url+"</label>",'<input id="note-dialog-image-url-'+this.options.id+'" class="note-image-url form-control note-form-control note-input" type="text"/>',"</div>"].join(""),r='<input type="button" href="#" class="'.concat("btn btn-primary note-btn note-btn-primary note-image-btn",'" value="').concat(this.lang.image.insert,'" disabled>');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===Ct.code.ENTER&&(t.preventDefault(),e.trigger("click"))})}},{key:"show",value:function(){var e=this;this.context.invoke("editor.saveRange"),this.showImageDialog().then(function(t){e.ui.hideDialog(e.$dialog),e.context.invoke("editor.restoreRange"),"string"==typeof t?e.options.callbacks.onImageLinkInsert?e.context.triggerEvent("image.link.insert",t):e.context.invoke("editor.insertImage",t):e.context.invoke("editor.insertImagesOrCallback",t)}).fail(function(){e.context.invoke("editor.restoreRange")})}},{key:"showImageDialog",value:function(){var i=this;return w.a.Deferred(function(e){var t=i.$dialog.find(".note-image-input"),n=i.$dialog.find(".note-image-url"),o=i.$dialog.find(".note-image-btn");i.ui.onDialogShown(i.$dialog,function(){i.context.triggerEvent("dialog.shown"),t.replaceWith(t.clone().on("change",function(t){e.resolve(t.target.files||t.target.value)}).val("")),n.on("input paste propertychange",function(){i.ui.toggleBtn(o,n.val())}).val(""),m.isSupportTouch||n.trigger("focus"),o.click(function(t){t.preventDefault(),e.resolve(n.val())}),i.bindEnterKey(n,o)}),i.ui.onDialogHidden(i.$dialog,function(){t.off(),n.off(),o.off(),"pending"===e.state()&&e.reject()}),i.ui.showDialog(i.$dialog)})}}])&&he(t.prototype,n),o&&he(t,o),e}();function pe(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var me=function(){function n(t){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),this.context=t,this.ui=w.a.summernote.ui,this.editable=t.layoutInfo.editable[0],this.options=t.options,this.events={"summernote.disable summernote.blur":function(){e.hide()}}}var t,e,o;return t=n,(e=[{key:"shouldInitialize",value:function(){return!x.isEmpty(this.options.popover.image)}},{key:"initialize",value:function(){this.$popover=this.ui.popover({className:"note-image-popover"}).render().appendTo(this.options.container);var t=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",t,this.options.popover.image),this.$popover.on("mousedown",function(t){t.preventDefault()})}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"update",value:function(t,e){var n,o,i;ft.isImg(t)?(n=w()(t).offset(),o=w()(this.options.container).offset(),i={},this.options.popatmouse?(i.left=e.pageX-20,i.top=e.pageY):i=n,i.top-=o.top,i.left-=o.left,this.$popover.css({display:"block",left:i.left,top:i.top})):this.hide()}},{key:"hide",value:function(){this.$popover.hide()}}])&&pe(t.prototype,e),o&&pe(t,o),n}();function ve(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var ge=function(){function e(t){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.ui=w.a.summernote.ui,this.options=t.options,this.events={"summernote.mousedown":function(t,e){n.update(e.target)},"summernote.keyup summernote.scroll summernote.change":function(){n.update()},"summernote.disable summernote.blur":function(){n.hide()}}}var t,n,o;return t=e,(n=[{key:"shouldInitialize",value:function(){return!x.isEmpty(this.options.popover.table)}},{key:"initialize",value:function(){this.$popover=this.ui.popover({className:"note-table-popover"}).render().appendTo(this.options.container);var t=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",t,this.options.popover.table),m.isFF&&document.execCommand("enableInlineTableEditing",!1,!1),this.$popover.on("mousedown",function(t){t.preventDefault()})}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"update",value:function(t){if(this.context.isDisabled())return!1;var e,n,o=ft.isCell(t);return o?(e=ft.posFromPlaceholder(t),n=w()(this.options.container).offset(),e.top-=n.top,e.left-=n.left,this.$popover.css({display:"block",left:e.left,top:e.top})):this.hide(),o}},{key:"hide",value:function(){this.$popover.hide()}}])&&ve(t.prototype,n),o&&ve(t,o),e}();function be(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var ye=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.ui=w.a.summernote.ui,this.$body=w()(document.body),this.$editor=t.layoutInfo.editor,this.options=t.options,this.lang=this.options.langInfo}var t,n,o;return t=e,(n=[{key:"initialize",value:function(){var t=this.options.dialogsInBody?this.$body:this.options.container,e=['<div class="form-group note-form-group row-fluid">','<label for="note-dialog-video-url-'.concat(this.options.id,'" class="note-form-label">').concat(this.lang.video.url,' <small class="text-muted">').concat(this.lang.video.providers,"</small></label>"),'<input id="note-dialog-video-url-'.concat(this.options.id,'" class="note-video-url form-control note-form-control note-input" type="text"/>'),"</div>"].join(""),n='<input type="button" href="#" class="'.concat("btn btn-primary note-btn note-btn-primary note-video-btn",'" value="').concat(this.lang.video.insert,'" disabled>');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===Ct.code.ENTER&&(t.preventDefault(),e.trigger("click"))})}},{key:"createVideoNode",value:function(t){var e=t.match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?$/),n=t.match(/(?:www\.|\/\/)instagram\.com\/p\/(.[a-zA-Z0-9_-]*)/),o=t.match(/\/\/vine\.co\/v\/([a-zA-Z0-9]+)/),i=t.match(/\/\/(player\.)?vimeo\.com\/([a-z]*\/)*(\d+)[?]?.*/),r=t.match(/.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/),a=t.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),s=t.match(/\/\/v\.qq\.com.*?vid=(.+)/),l=t.match(/\/\/v\.qq\.com\/x?\/?(page|cover).*?\/([^\/]+)\.html\??.*/),c=t.match(/^.+.(mp4|m4v)$/),u=t.match(/^.+.(ogg|ogv)$/),d=t.match(/^.+.(webm)$/),h=t.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/);if(e&&11===e[1].length){var f=e[1],p=0;if(void 0!==e[2]){var m=e[2].match(/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/);if(m)for(var v=[3600,60,1],g=0,b=v.length;g<b;g++)p+=void 0!==m[g+1]?v[g]*parseInt(m[g+1],10):0}k=w()("<iframe>").attr("frameborder",0).attr("src","//www.youtube.com/embed/"+f+(0<p?"?start="+p:"")).attr("width","640").attr("height","360")}else if(n&&n[0].length)k=w()("<iframe>").attr("frameborder",0).attr("src","https://instagram.com/p/"+n[1]+"/embed/").attr("width","612").attr("height","710").attr("scrolling","no").attr("allowtransparency","true");else if(o&&o[0].length)k=w()("<iframe>").attr("frameborder",0).attr("src",o[0]+"/embed/simple").attr("width","600").attr("height","600").attr("class","vine-embed");else if(i&&i[3].length)k=w()("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("frameborder",0).attr("src","//player.vimeo.com/video/"+i[3]).attr("width","640").attr("height","360");else if(r&&r[2].length)k=w()("<iframe>").attr("frameborder",0).attr("src","//www.dailymotion.com/embed/video/"+r[2]).attr("width","640").attr("height","360");else if(a&&a[1].length)k=w()("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("frameborder",0).attr("height","498").attr("width","510").attr("src","//player.youku.com/embed/"+a[1]);else if(s&&s[1].length||l&&l[2].length)var y=s&&s[1].length?s[1]:l[2],k=w()("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("frameborder",0).attr("height","310").attr("width","500").attr("src","https://v.qq.com/iframe/player.html?vid="+y+"&amp;auto=0");else if(c||u||d)k=w()("<video controls>").attr("src",t).attr("width","640").attr("height","360");else{if(!h||!h[0].length)return!1;k=w()("<iframe>").attr("frameborder",0).attr("src","https://www.facebook.com/plugins/video.php?href="+encodeURIComponent(h[0])+"&show_text=0&width=560").attr("width","560").attr("height","301").attr("scrolling","no").attr("allowtransparency","true")}return k.addClass("note-video-clip"),k[0]}},{key:"show",value:function(){var n=this,t=this.context.invoke("editor.getSelectedText");this.context.invoke("editor.saveRange"),this.showVideoDialog(t).then(function(t){n.ui.hideDialog(n.$dialog),n.context.invoke("editor.restoreRange");var e=n.createVideoNode(t);e&&n.context.invoke("editor.insertNode",e)}).fail(function(){n.context.invoke("editor.restoreRange")})}},{key:"showVideoDialog",value:function(){var o=this;return w.a.Deferred(function(e){var n=o.$dialog.find(".note-video-url"),t=o.$dialog.find(".note-video-btn");o.ui.onDialogShown(o.$dialog,function(){o.context.triggerEvent("dialog.shown"),n.on("input paste propertychange",function(){o.ui.toggleBtn(t,n.val())}),m.isSupportTouch||n.trigger("focus"),t.click(function(t){t.preventDefault(),e.resolve(n.val())}),o.bindEnterKey(n,t)}),o.ui.onDialogHidden(o.$dialog,function(){n.off(),t.off(),"pending"===e.state()&&e.reject()}),o.ui.showDialog(o.$dialog)})}}])&&be(t.prototype,n),o&&be(t,o),e}();function ke(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var we=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.ui=w.a.summernote.ui,this.$body=w()(document.body),this.$editor=t.layoutInfo.editor,this.options=t.options,this.lang=this.options.langInfo}var t,n,o;return t=e,(n=[{key:"initialize",value:function(){var t=this.options.dialogsInBody?this.$body:this.options.container,e=['<p class="text-center">','<a href="http://summernote.org/" target="_blank">Summernote 0.8.16</a> · ','<a href="https://github.com/summernote/summernote" target="_blank">Project</a> · ','<a href="https://github.com/summernote/summernote/issues" target="_blank">Issues</a>',"</p>"].join("");this.$dialog=this.ui.dialog({title:this.lang.options.help,fade:this.options.dialogsFade,body:this.createShortcutList(),footer:e,callback:function(t){t.find(".modal-body,.note-modal-body").css({"max-height":300,overflow:"scroll"})}}).render().appendTo(t)}},{key:"destroy",value:function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"createShortcutList",value:function(){var o=this,i=this.options.keyMap[m.isMac?"mac":"pc"];return Object.keys(i).map(function(t){var e=i[t],n=w()('<div><div class="help-list-item"/></div>');return n.append(w()("<label><kbd>"+t+"</kdb></label>").css({width:180,"margin-right":10})).append(w()("<span/>").html(o.context.memo("help."+e)||e)),n.html()}).join("")}},{key:"showHelpDialog",value:function(){var e=this;return w.a.Deferred(function(t){e.ui.onDialogShown(e.$dialog,function(){e.context.triggerEvent("dialog.shown"),t.resolve()}),e.ui.showDialog(e.$dialog)}).promise()}},{key:"show",value:function(){var t=this;this.context.invoke("editor.saveRange"),this.showHelpDialog().then(function(){t.context.invoke("editor.restoreRange")})}}])&&ke(t.prototype,n),o&&ke(t,o),e}();function Ce(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var xe=function(){function e(t){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.ui=w.a.summernote.ui,this.options=t.options,this.hidable=!0,this.onContextmenu=!1,this.pageX=null,this.pageY=null,this.events={"summernote.contextmenu":function(t){n.options.editing&&(t.preventDefault(),t.stopPropagation(),n.onContextmenu=!0,n.update(!0))},"summernote.mousedown":function(t,e){n.pageX=e.pageX,n.pageY=e.pageY},"summernote.keyup summernote.mouseup summernote.scroll":function(t,e){n.options.editing&&!n.onContextmenu&&(n.pageX=e.pageX,n.pageY=e.pageY,n.update()),n.onContextmenu=!1},"summernote.disable summernote.change summernote.dialog.shown summernote.blur":function(){n.hide()},"summernote.focusout":function(){n.$popover.is(":active,:focus")||n.hide()}}}var t,n,o;return t=e,(n=[{key:"shouldInitialize",value:function(){return this.options.airMode&&!x.isEmpty(this.options.popover.air)}},{key:"initialize",value:function(){var t=this;this.$popover=this.ui.popover({className:"note-air-popover"}).render().appendTo(this.options.container);var e=this.$popover.find(".popover-content");this.context.invoke("buttons.build",e,this.options.popover.air),this.$popover.on("mousedown",function(){t.hidable=!1}),this.$popover.on("mouseup",function(){t.hidable=!0})}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"update",value:function(t){var e,n,o=this.context.invoke("editor.currentStyle");!o.range||o.range.isCollapsed()&&!t?this.hide():(e={left:this.pageX,top:this.pageY},n=w()(this.options.container).offset(),e.top-=n.top,e.left-=n.left,this.$popover.css({display:"block",left:Math.max(e.left,0)+-5,top:e.top+5}),this.context.invoke("buttons.updateCurrentStyle",this.$popover))}},{key:"hide",value:function(){this.hidable&&this.$popover.hide()}}])&&Ce(t.prototype,n),o&&Ce(t,o),e}();function Se(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Te=function(){function e(t){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.ui=w.a.summernote.ui,this.$editable=t.layoutInfo.editable,this.options=t.options,this.hint=this.options.hint||[],this.direction=this.options.hintDirection||"bottom",this.hints=Array.isArray(this.hint)?this.hint:[this.hint],this.events={"summernote.keyup":function(t,e){e.isDefaultPrevented()||n.handleKeyup(e)},"summernote.keydown":function(t,e){n.handleKeydown(e)},"summernote.disable summernote.dialog.shown summernote.blur":function(){n.hide()}}}var t,n,o;return t=e,(n=[{key:"shouldInitialize",value:function(){return 0<this.hints.length}},{key:"initialize",value:function(){var e=this;this.lastWordRange=null,this.matchingWord=null,this.$popover=this.ui.popover({className:"note-hint-popover",hideArrow:!0,direction:""}).render().appendTo(this.options.container),this.$popover.hide(),this.$content=this.$popover.find(".popover-content,.note-popover-content"),this.$content.on("click",".note-hint-item",function(t){e.$content.find(".active").removeClass("active"),w()(t.currentTarget).addClass("active"),e.replace()}),this.$popover.on("mousedown",function(t){t.preventDefault()})}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"selectItem",value:function(t){this.$content.find(".active").removeClass("active"),t.addClass("active"),this.$content[0].scrollTop=t[0].offsetTop-this.$content.innerHeight()/2}},{key:"moveDown",value:function(){var t,e=this.$content.find(".note-hint-item.active"),n=e.next();n.length?this.selectItem(n):((t=e.parent().next()).length||(t=this.$content.find(".note-hint-group").first()),this.selectItem(t.find(".note-hint-item").first()))}},{key:"moveUp",value:function(){var t,e=this.$content.find(".note-hint-item.active"),n=e.prev();n.length?this.selectItem(n):((t=e.parent().prev()).length||(t=this.$content.find(".note-hint-group").last()),this.selectItem(t.find(".note-hint-item").last()))}},{key:"replace",value:function(){var t,e,n,o=this.$content.find(".note-hint-item.active");o.length&&(t=this.nodeFromItem(o),null!==this.matchingWord&&0===this.matchingWord.length?this.lastWordRange.so=this.lastWordRange.eo:null!==this.matchingWord&&0<this.matchingWord.length&&!this.lastWordRange.isCollapsed()&&(0<(e=this.lastWordRange.eo-this.lastWordRange.so-this.matchingWord.length)&&(this.lastWordRange.so+=e)),this.lastWordRange.insertNode(t),"next"===this.options.hintSelect?(n=document.createTextNode(""),w()(t).after(n),kt.createFromNodeBefore(n).select()):kt.createFromNodeAfter(t).select(),this.lastWordRange=null,this.hide(),this.context.invoke("editor.focus"))}},{key:"nodeFromItem",value:function(t){var e=this.hints[t.data("index")],n=t.data("item"),o=e.content?e.content(n):n;return"string"==typeof o&&(o=ft.createText(o)),o}},{key:"createItemTemplates",value:function(n,t){var o=this.hints[n];return t.map(function(t){var e=w()('<div class="note-hint-item"/>');return e.append(o.template?o.template(t):t+""),e.data({index:n,item:t}),e})}},{key:"handleKeydown",value:function(t){this.$popover.is(":visible")&&(t.keyCode===Ct.code.ENTER?(t.preventDefault(),this.replace()):t.keyCode===Ct.code.UP?(t.preventDefault(),this.moveUp()):t.keyCode===Ct.code.DOWN&&(t.preventDefault(),this.moveDown()))}},{key:"searchKeyword",value:function(t,e,n){var o,i=this.hints[t];i&&i.match.test(e)&&i.search?(o=i.match.exec(e),this.matchingWord=o[0],i.search(o[1],n)):n()}},{key:"createGroup",value:function(e,t){var n=this,o=w()('<div class="note-hint-group note-hint-group-'+e+'"/>');return this.searchKeyword(e,t,function(t){(t=t||[]).length&&(o.html(n.createItemTemplates(e,t)),n.show())}),o}},{key:"handleKeyup",value:function(t){var n=this;if(!x.contains([Ct.code.ENTER,Ct.code.UP,Ct.code.DOWN],t.keyCode)){var e,o,i,r,a=this.context.invoke("editor.getLastRange");if("words"===this.options.hintMode){if(e=a.getWordsRange(a),o=e.toString(),this.hints.forEach(function(t){if(t.match.test(o))return e=a.getWordsMatchRange(t.match),!1}),!e)return void this.hide();o=e.toString()}else e=a.getWordRange(),o=e.toString();this.hints.length&&o?(this.$content.empty(),i=g.rect2bnd(x.last(e.getClientRects())),r=w()(this.options.container).offset(),i&&(i.top-=r.top,i.left-=r.left,this.$popover.hide(),this.lastWordRange=e,this.hints.forEach(function(t,e){t.match.test(o)&&n.createGroup(e,o).appendTo(n.$content)}),this.$content.find(".note-hint-item:first").addClass("active"),"top"===this.direction?this.$popover.css({left:i.left,top:i.top-this.$popover.outerHeight()-5}):this.$popover.css({left:i.left,top:i.top+i.height+5}))):this.hide()}}},{key:"show",value:function(){this.$popover.show()}},{key:"hide",value:function(){this.$popover.hide()}}])&&Se(t.prototype,n),o&&Se(t,o),e}();w.a.summernote=w.a.extend(w.a.summernote,{version:"0.8.16",plugins:{},dom:ft,range:kt,lists:x,options:{langInfo:w.a.summernote.lang["en-US"],editing:!0,modules:{editor:Dt,clipboard:zt,dropzone:Ot,codeview:jt,statusbar:Kt,fullscreen:Vt,handle:Gt,hintPopover:Te,autoLink:Xt,autoSync:Jt,autoReplace:ee,placeholder:oe,buttons:re,toolbar:se,linkDialog:ce,linkPopover:de,imageDialog:fe,imagePopover:me,tablePopover:ge,videoDialog:ye,helpDialog:we,airPopover:xe},buttons:{},lang:"en-US",followingToolbar:!1,toolbarPosition:"top",otherStaticBar:"",toolbar:[["style",["style"]],["font",["bold","underline","clear"]],["fontname",["fontname"]],["color",["color"]],["para",["ul","ol","paragraph"]],["table",["table"]],["insert",["link","picture","video"]],["view",["fullscreen","codeview","help"]]],popatmouse:!0,popover:{image:[["resize",["resizeFull","resizeHalf","resizeQuarter","resizeNone"]],["float",["floatLeft","floatRight","floatNone"]],["remove",["removeMedia"]]],link:[["link",["linkDialogShow","unlink"]]],table:[["add",["addRowDown","addRowUp","addColLeft","addColRight"]],["delete",["deleteRow","deleteCol","deleteTable"]]],air:[["color",["color"]],["font",["bold","underline","clear"]],["para",["ul","paragraph"]],["table",["table"]],["insert",["link","picture"]],["view",["fullscreen","codeview"]]]},airMode:!1,overrideContextMenu:!1,width:null,height:null,linkTargetBlank:!0,useProtocol:!0,defaultProtocol:"http://",focus:!1,tabDisabled:!1,tabSize:4,styleWithCSS:!1,shortcuts:!0,textareaAutoSync:!0,tooltip:"auto",container:null,maxTextLength:0,blockquoteBreakingLevel:2,spellCheck:!0,disableGrammar:!1,placeholder:null,inheritPlaceholder:!1,recordEveryKeystroke:!1,historyLimit:200,hintMode:"word",hintSelect:"after",hintDirection:"bottom",styleTags:["p","blockquote","pre","h1","h2","h3","h4","h5","h6"],fontNames:["Arial","Arial Black","Comic Sans MS","Courier New","Helvetica Neue","Helvetica","Impact","Lucida Grande","Tahoma","Times New Roman","Verdana"],fontNamesIgnoreCheck:[],addDefaultFonts:!0,fontSizes:["8","9","10","11","12","14","18","24","36"],fontSizeUnits:["px","pt"],colors:[["#000000","#424242","#636363","#9C9C94","#CEC6CE","#EFEFEF","#F7F7F7","#FFFFFF"],["#FF0000","#FF9C00","#FFFF00","#00FF00","#00FFFF","#0000FF","#9C00FF","#FF00FF"],["#F7C6CE","#FFE7CE","#FFEFC6","#D6EFD6","#CEDEE7","#CEE7F7","#D6D6E7","#E7D6DE"],["#E79C9C","#FFC69C","#FFE79C","#B5D6A5","#A5C6CE","#9CC6EF","#B5A5D6","#D6A5BD"],["#E76363","#F7AD6B","#FFD663","#94BD7B","#73A5AD","#6BADDE","#8C7BC6","#C67BA5"],["#CE0000","#E79439","#EFC631","#6BA54A","#4A7B8C","#3984C6","#634AA5","#A54A7B"],["#9C0000","#B56308","#BD9400","#397B21","#104A5A","#085294","#311873","#731842"],["#630000","#7B3900","#846300","#295218","#083139","#003163","#21104A","#4A1031"]],colorsName:[["Black","Tundora","Dove Gray","Star Dust","Pale Slate","Gallery","Alabaster","White"],["Red","Orange Peel","Yellow","Green","Cyan","Blue","Electric Violet","Magenta"],["Azalea","Karry","Egg White","Zanah","Botticelli","Tropical Blue","Mischka","Twilight"],["Tonys Pink","Peach Orange","Cream Brulee","Sprout","Casper","Perano","Cold Purple","Careys Pink"],["Mandy","Rajah","Dandelion","Olivine","Gulf Stream","Viking","Blue Marguerite","Puce"],["Guardsman Red","Fire Bush","Golden Dream","Chelsea Cucumber","Smalt Blue","Boston Blue","Butterfly Bush","Cadillac"],["Sangria","Mai Tai","Buddha Gold","Forest Green","Eden","Venice Blue","Meteorite","Claret"],["Rosewood","Cinnamon","Olive","Parsley","Tiber","Midnight Blue","Valentino","Loulou"]],colorButton:{foreColor:"#000000",backColor:"#FFFF00"},lineHeights:["1.0","1.2","1.4","1.5","1.6","1.8","2.0","3.0"],tableClassName:"table table-bordered",insertTableMaxSize:{col:10,row:10},dialogsInBody:!1,dialogsFade:!1,maximumImageFileSize:null,callbacks:{onBeforeCommand:null,onBlur:null,onBlurCodeview:null,onChange:null,onChangeCodeview:null,onDialogShown:null,onEnter:null,onFocus:null,onImageLinkInsert:null,onImageUpload:null,onImageUploadError:null,onInit:null,onKeydown:null,onKeyup:null,onMousedown:null,onMouseup:null,onPaste:null,onScroll:null},codemirror:{mode:"text/html",htmlMode:!0,lineNumbers:!0},codeviewFilter:!1,codeviewFilterRegex:/<\/*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|ilayer|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|t(?:itle|extarea)|xml)[^>]*?>/gi,codeviewIframeFilter:!0,codeviewIframeWhitelistSrc:[],codeviewIframeWhitelistSrcBase:["www.youtube.com","www.youtube-nocookie.com","www.facebook.com","vine.co","instagram.com","player.vimeo.com","www.dailymotion.com","player.youku.com","v.qq.com"],keyMap:{pc:{ENTER:"insertParagraph","CTRL+Z":"undo","CTRL+Y":"redo",TAB:"tab","SHIFT+TAB":"untab","CTRL+B":"bold","CTRL+I":"italic","CTRL+U":"underline","CTRL+SHIFT+S":"strikethrough","CTRL+BACKSLASH":"removeFormat","CTRL+SHIFT+L":"justifyLeft","CTRL+SHIFT+E":"justifyCenter","CTRL+SHIFT+R":"justifyRight","CTRL+SHIFT+J":"justifyFull","CTRL+SHIFT+NUM7":"insertUnorderedList","CTRL+SHIFT+NUM8":"insertOrderedList","CTRL+LEFTBRACKET":"outdent","CTRL+RIGHTBRACKET":"indent","CTRL+NUM0":"formatPara","CTRL+NUM1":"formatH1","CTRL+NUM2":"formatH2","CTRL+NUM3":"formatH3","CTRL+NUM4":"formatH4","CTRL+NUM5":"formatH5","CTRL+NUM6":"formatH6","CTRL+ENTER":"insertHorizontalRule","CTRL+K":"linkDialog.show"},mac:{ENTER:"insertParagraph","CMD+Z":"undo","CMD+SHIFT+Z":"redo",TAB:"tab","SHIFT+TAB":"untab","CMD+B":"bold","CMD+I":"italic","CMD+U":"underline","CMD+SHIFT+S":"strikethrough","CMD+BACKSLASH":"removeFormat","CMD+SHIFT+L":"justifyLeft","CMD+SHIFT+E":"justifyCenter","CMD+SHIFT+R":"justifyRight","CMD+SHIFT+J":"justifyFull","CMD+SHIFT+NUM7":"insertUnorderedList","CMD+SHIFT+NUM8":"insertOrderedList","CMD+LEFTBRACKET":"outdent","CMD+RIGHTBRACKET":"indent","CMD+NUM0":"formatPara","CMD+NUM1":"formatH1","CMD+NUM2":"formatH2","CMD+NUM3":"formatH3","CMD+NUM4":"formatH4","CMD+NUM5":"formatH5","CMD+NUM6":"formatH6","CMD+ENTER":"insertHorizontalRule","CMD+K":"linkDialog.show"}},icons:{align:"note-icon-align",alignCenter:"note-icon-align-center",alignJustify:"note-icon-align-justify",alignLeft:"note-icon-align-left",alignRight:"note-icon-align-right",rowBelow:"note-icon-row-below",colBefore:"note-icon-col-before",colAfter:"note-icon-col-after",rowAbove:"note-icon-row-above",rowRemove:"note-icon-row-remove",colRemove:"note-icon-col-remove",indent:"note-icon-align-indent",outdent:"note-icon-align-outdent",arrowsAlt:"note-icon-arrows-alt",bold:"note-icon-bold",caret:"note-icon-caret",circle:"note-icon-circle",close:"note-icon-close",code:"note-icon-code",eraser:"note-icon-eraser",floatLeft:"note-icon-float-left",floatRight:"note-icon-float-right",font:"note-icon-font",frame:"note-icon-frame",italic:"note-icon-italic",link:"note-icon-link",unlink:"note-icon-chain-broken",magic:"note-icon-magic",menuCheck:"note-icon-menu-check",minus:"note-icon-minus",orderedlist:"note-icon-orderedlist",pencil:"note-icon-pencil",picture:"note-icon-picture",question:"note-icon-question",redo:"note-icon-redo",rollback:"note-icon-rollback",square:"note-icon-square",strikethrough:"note-icon-strikethrough",subscript:"note-icon-subscript",superscript:"note-icon-superscript",table:"note-icon-table",textHeight:"note-icon-text-height",trash:"note-icon-trash",underline:"note-icon-underline",undo:"note-icon-undo",unorderedlist:"note-icon-unorderedlist",video:"note-icon-video"}}})},5:function(t,e,n){},53:function(t,e,n){"use strict";n.r(e);var o=n(0),i=n.n(o),r=n(1);function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t){return t}function l(f){return{editor:c,toolbar:u,editingArea:d,codable:h,editable:p,statusbar:m,airEditor:v,airEditable:g,buttonGroup:b,dropdown:y,dropdownButtonContents:s,dropdownCheck:k,dialog:w,popover:C,icon:S,checkbox:x,options:f,palette:function(t,e){return r.a.create('<div class="note-color-palette"/>',function(t,e){for(var n=[],o=0,i=e.colors.length;o<i;o++){for(var r=e.eventName,a=e.colors[o],s=e.colorsName[o],l=[],c=0,u=a.length;c<u;c++){var d=a[c],h=s[c];l.push(['<button type="button" class="note-color-btn"','style="background-color:',d,'" ','data-event="',r,'" ','data-value="',d,'" ','title="',h,'" ','aria-label="',h,'" ','data-toggle="button" tabindex="-1"></button>'].join(""))}n.push('<div class="note-color-row">'+l.join("")+"</div>")}t.html(n.join("")),e.tooltip&&t.find(".note-color-btn").tooltip({container:e.container||f.container,trigger:"hover",placement:"bottom"})})(t,e)},button:function(t,e){return r.a.create('<button type="button" class="note-btn btn btn-light btn-sm" tabindex="-1">',function(t,e){e&&e.tooltip&&t.attr({title:e.tooltip,"aria-label":e.tooltip}).tooltip({container:e.container||f.container,trigger:"hover",placement:"bottom"}).on("click",function(t){i()(t.currentTarget).tooltip("hide")})})(t,e)},toggleBtn:function(t,e){t.toggleClass("disabled",!e),t.attr("disabled",!e)},toggleBtnActive:function(t,e){t.toggleClass("active",e)},onDialogShown:function(t,e){t.one("shown.bs.modal",e)},onDialogHidden:function(t,e){t.one("hidden.bs.modal",e)},showDialog:function(t){t.modal("show")},hideDialog:function(t){t.modal("hide")},createLayout:function(t){var e=(f.airMode?v([d([h(),g()])]):"bottom"===f.toolbarPosition?c([d([h(),p()]),u(),m()]):c([u(),d([h(),p()]),m()])).render();return e.insertAfter(t),{note:t,editor:e,toolbar:e.find(".note-toolbar"),editingArea:e.find(".note-editing-area"),editable:e.find(".note-editable"),codable:e.find(".note-codable"),statusbar:e.find(".note-statusbar")}},removeLayout:function(t,e){t.html(e.editable.html()),e.editor.remove(),t.show()}}}var c=r.a.create('<div class="note-editor note-frame card"/>'),u=r.a.create('<div class="note-toolbar card-header" role="toolbar"></div>'),d=r.a.create('<div class="note-editing-area"/>'),h=r.a.create('<textarea class="note-codable" aria-multiline="true"/>'),p=r.a.create('<div class="note-editable card-block" contentEditable="true" role="textbox" aria-multiline="true"/>'),m=r.a.create(['<output class="note-status-output" role="status" aria-live="polite"/>','<div class="note-statusbar" role="status">','<output class="note-status-output" aria-live="polite"></output>','<div class="note-resizebar" aria-label="Resize">','<div class="note-icon-bar"/>','<div class="note-icon-bar"/>','<div class="note-icon-bar"/>',"</div>","</div>"].join("")),v=r.a.create('<div class="note-editor note-airframe"/>'),g=r.a.create(['<div class="note-editable" contentEditable="true" role="textbox" aria-multiline="true"/>','<output class="note-status-output" role="status" aria-live="polite"/>'].join("")),b=r.a.create('<div class="note-btn-group btn-group">'),y=r.a.create('<div class="note-dropdown-menu dropdown-menu" role="list">',function(t,i){var e=Array.isArray(i.items)?i.items.map(function(t){var e="string"==typeof t?t:t.value||"",n=i.template?i.template(t):t,o="object"===a(t)?t.option:void 0;return'<a class="dropdown-item" href="#" '+('data-value="'+e+'"')+(void 0!==o?' data-option="'+o+'"':"")+' role="listitem" aria-label="'+e+'">'+n+"</a>"}).join(""):i.items;t.html(e).attr({"aria-label":i.title})}),k=r.a.create('<div class="note-dropdown-menu dropdown-menu note-check" role="list">',function(t,o){var e=Array.isArray(o.items)?o.items.map(function(t){var e="string"==typeof t?t:t.value||"",n=o.template?o.template(t):t;return'<a class="dropdown-item" href="#" data-value="'+e+'" role="listitem" aria-label="'+t+'">'+S(o.checkClassName)+" "+n+"</a>"}).join(""):o.items;t.html(e).attr({"aria-label":o.title})}),w=r.a.create('<div class="modal note-modal" aria-hidden="false" tabindex="-1" role="dialog"/>',function(t,e){e.fade&&t.addClass("fade"),t.attr({"aria-label":e.title}),t.html(['<div class="modal-dialog">','<div class="modal-content">',e.title?'<div class="modal-header"><h4 class="modal-title">'+e.title+'</h4><button type="button" class="close" data-dismiss="modal" aria-label="Close" aria-hidden="true">&times;</button></div>':"",'<div class="modal-body">'+e.body+"</div>",e.footer?'<div class="modal-footer">'+e.footer+"</div>":"","</div>","</div>"].join(""))}),C=r.a.create(['<div class="note-popover popover in">','<div class="arrow"/>','<div class="popover-content note-children-container"/>',"</div>"].join(""),function(t,e){var n=void 0!==e.direction?e.direction:"bottom";t.addClass(n),e.hideArrow&&t.find(".arrow").hide()}),x=r.a.create('<div class="form-check"></div>',function(t,e){t.html(['<label class="form-check-label"'+(e.id?' for="note-'+e.id+'"':"")+">",'<input type="checkbox" class="form-check-input"'+(e.id?' id="note-'+e.id+'"':""),e.checked?" checked":"",' aria-label="'+(e.text?e.text:"")+'"',' aria-checked="'+(e.checked?"true":"false")+'"/>'," "+(e.text?e.text:"")+"</label>"].join(""))}),S=function(t,e){return"<"+(e=e||"i")+' class="'+t+'"/>'};n(3),n(5);i.a.summernote=i.a.extend(i.a.summernote,{ui_template:l,interface:"bs4"}),i.a.summernote.options.styleTags=["p",{title:"Blockquote",tag:"blockquote",className:"blockquote",value:"blockquote"},"pre","h1","h2","h3","h4","h5","h6"]}},i.c=r,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)i.d(n,o,function(t){return e[t]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=53);function i(t){if(r[t])return r[t].exports;var e=r[t]={i:t,l:!1,exports:{}};return o[t].call(e.exports,e,e.exports,i),e.l=!0,e.exports}var o,r});

© KUJUNTI.ID