vendor/assets/javascripts/kendo/kendo.editor.min.js in kendoui-rails-0.1.0 vs vendor/assets/javascripts/kendo/kendo.editor.min.js in kendoui-rails-0.1.1
- old
+ new
@@ -1,13 +1,12 @@
/*
-* Kendo UI Web v2013.1.319 (http://kendoui.com)
+* Kendo UI Beta v2013.2.716 (http://kendoui.com)
* Copyright 2013 Telerik AD. All rights reserved.
*
-* Kendo UI Web commercial licenses may be obtained at
-* https://www.kendoui.com/purchase/license-agreement/kendo-ui-web-commercial.aspx
-* If you do not own a commercial license, this file shall be governed by the
-* GNU General Public License (GPL) version 3.
-* For GPL requirements, please review: http://www.gnu.org/copyleft/gpl.html
+* Kendo UI Beta license terms available at
+* http://www.kendoui.com/purchase/license-agreement/kendo-ui-beta.aspx
*/
-("function"==typeof define&&define.amd?define:function(e,t){return t()})(["./kendo.combobox.min","./kendo.dropdownlist.min","./kendo.window.min","./kendo.colorpicker.min"],function(){(function(e,t){var n,o,i=window.kendo,r=i.Class,a=i.ui.Widget,s=i.support.mobileOS,l=i.support.browser,d=e.extend,c=i.deepExtend,u=".kendoEditor",f=i.keys,p=r.extend({init:function(e){this.options=e},getHtml:function(){var e=this.options;return i.template(e.template)({cssClass:e.cssClass,tooltip:e.title,initialValue:e.initialValue})}}),m={select:function(e){e.trigger("select",{})},editorWrapperTemplate:'<table cellspacing="4" cellpadding="0" class="k-widget k-editor k-header" role="presentation"><tbody><tr role="presentation"><td class="k-editor-toolbar-wrap" role="presentation"><ul class="k-editor-toolbar" role="toolbar"></ul></td></tr><tr><td class="k-editable-area"></td></tr></tbody></table>',buttonTemplate:'<li class="k-editor-button" role="presentation"><a href="" role="button" class="k-tool-icon #= cssClass #" unselectable="on" title="#= tooltip #">#= tooltip #</a></li>',colorPickerTemplate:'<li class="k-editor-colorpicker" role="presentation"><div class="k-colorpicker #= cssClass #"></div></li>',comboBoxTemplate:'<li class="k-editor-combobox"><select title="#= tooltip #" class="#= cssClass #"></select></li>',dropDownListTemplate:'<li class="k-editor-selectbox"><select title="#= tooltip #" class="#= cssClass #"></select></li>',separatorTemplate:'<li class="k-separator"></li>',focusable:".k-colorpicker,a.k-tool-icon:not(.k-state-disabled),.k-selectbox, .k-combobox .k-input",wrapTextarea:function(t){var n=t[0].style.width,o=t[0].style.height,i=m.editorWrapperTemplate,r=e(i).insertBefore(t).width(n).height(o),a=r.find(".k-editable-area");return t.appendTo(a).addClass("k-content k-raw-content").hide(),t.closest(".k-editor")},renderTools:function(t,n){var o,r,a,s,l,c={},u=t._nativeTools,f=e(t.element).closest(".k-editor").find(".k-editor-toolbar");if(n)for(a=0;n.length>a;a++)o=n[a],l=null,e.isPlainObject(o)?o.name&&t.tools[o.name]?(e.extend(t.tools[o.name].options,o),c[o.name]=t.tools[o.name],l=c[o.name].options):(l=d({cssClass:"k-i-custom",type:"button",tooltip:""},o),l.name&&(l.cssClass="k-"+("custom"==l.name?"i-custom":l.name)),l.template||"button"==l.type&&(l.template=m.buttonTemplate)):t.tools[o]&&(c[o]=t.tools[o],l=c[o].options),l&&(s=l.template,s&&(s.getHtml?s=s.getHtml():(e.isFunction(s)||(s=i.template(s)),s=s(l)),0!==s.indexOf("<li")&&(s="<li class='k-editor-template'>"+s+"</li>"),r=e(s).appendTo(f),"button"==l.type&&l.exec&&r.find(".k-tool-icon").click(e.proxy(l.exec,t.element[0]))));for(a=0;u.length>a;a++)c[u[a]]||(c[u[a]]=t.tools[u[a]]);t.options.tools=c},decorateStyleToolItems:function(t){var n,o=t.data.closest(".k-editor").find(".k-style").data("kendoSelectBox");o&&(n=o.dataSource.view(),o.list.find(".k-item").each(function(o,r){var a=e(r),s=a.text(),l=i.ui.editor.Dom.inlineStyle(t.data.data("kendoEditor").document,"span",{className:n[o].value});a.html('<span unselectable="on" style="display:block;'+l+'">'+s+"</span>")}))},createContentElement:function(t,n){var o,r,a,s=i.support.isRtl(t)?"direction:rtl;":"";return t.hide(),o=e("<iframe />",{src:'javascript:""',frameBorder:"0"}).css("display","").addClass("k-content").insertBefore(t)[0],r=o.contentWindow||o,n.length>0&&e(o).one("load",t,m.decorateStyleToolItems),a=r.document||o.contentDocument,a.open(),a.write("<!DOCTYPE html><html><head><meta charset='utf-8' /><style>html,body{padding:0;margin:0;background:#fff;height:100%;min-height:100%;}body{font: 12px/1.5 Verdana,Geneva,sans-serif;padding-top:1px;margin-top:-1px;word-wrap: break-word;-webkit-nbsp-mode: space;-webkit-line-break: after-white-space;"+s+"}"+"h1{font-size:2em;margin:.67em 0}h2{font-size:1.5em}h3{font-size:1.16em}h4{font-size:1em}h5{font-size:.83em}h6{font-size:.7em}"+"p{margin:0 0 1em;padding:0 .2em}.k-marker{display:none;}.k-paste-container,.Apple-style-span{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}"+"ul,ol{padding-left:2.5em}"+"a{color:#00a}"+"code{font-size:1.23em}"+"</style>"+e.map(n,function(e){return"<link rel='stylesheet' href='"+e+"'>"}).join("")+"</head><body contenteditable='true'></body></html>"),a.close(),r},initializeContentElement:function(n){var o=!0;n.window=m.createContentElement(e(n.textarea),n.options.stylesheets),n.document=n.window.contentDocument||n.window.document,n.body=n.document.body,e(n.document).on("keydown"+u,function(e){var r,a,s,l,d;return e.keyCode===f.F10?(setTimeout(function(){var e="tabIndex",t=n.wrapper,o=t.attr(e);t.attr(e,o||0).focus().find("li:has("+g+")").first().focus(),o||0===o||t.removeAttr(e)},100),e.preventDefault(),t):(e.keyCode===f.BACKSPACE&&(r=n.getRange(),s=i.support.browser.msie?"":'<br _moz_dirty="" />',l=i.ui.editor.Dom,r.deleteContents(),a=r.commonAncestorContainer,"p"===l.name(a)&&""===a.innerHTML&&(a.innerHTML=s,r.setStart(a,0),r.collapse(!0),n.selectRange(r))),(d=n.keyboard.toolFromShortcut(n.options.tools,e))?(e.preventDefault(),/undo|redo/.test(d)||n.keyboard.endTyping(!0),n.exec(d),!1):(n.keyboard.isTypingKey(e)&&n.pendingFormats.hasPending()&&(o?o=!1:(r=n.getRange(),n.pendingFormats.apply(r),n.selectRange(r))),n.keyboard.clearTimeout(),n.keyboard.keydown(e),t))}).on("keyup"+u,function(t){var i,r=[8,9,33,34,35,36,37,38,39,40,40,45,46];(e.inArray(t.keyCode,r)>-1||65==t.keyCode&&t.ctrlKey&&!t.altKey&&!t.shiftKey)&&(n.pendingFormats.clear(),h(n)),n.keyboard.isTypingKey(t)?n.pendingFormats.hasPending()&&(i=n.getRange(),n.pendingFormats.apply(i),n.selectRange(i)):o=!0,n.keyboard.keyup(t)}).on("mousedown"+u,function(t){n.pendingFormats.clear();var o=e(t.target);!l.gecko&&2==t.which&&o.is("a[href]")&&window.open(o.attr("href"),"_new")}).on("mouseup"+u,function(){h(n)}).on("click"+u,function(e){var t,o=i.ui.editor.Dom;"img"===o.name(e.target)&&(t=n.createRange(),t.selectNode(e.target),n.selectRange(t))}),e(n.window).on("blur"+u,function(){var e=n.textarea.value,t=n.encodedValue();n.update(),t!=e&&n.trigger("change")}),e(n.body).on("cut"+u+" paste"+u,function(e){n.clipboard["on"+e.type](e)})},formatByName:function(t,n){for(var o=0;n.length>o;o++)if(e.inArray(t,n[o].tags)>=0)return n[o]},registerTool:function(e,t){t.options&&t.options.template&&(t.options.template.options.cssClass="k-"+e),C.fn._tools[e]=t},registerFormat:function(e,t){C.fn.options.formats[e]=t},createDialog:function(t,n,o){var r=i.support.isRtl(n.wrapper),a=e(t).appendTo(document.body).kendoWindow(o);return r&&a.closest(".k-window").addClass("k-rtl"),a}},h=m.select,g=m.focusable,v=m.wrapTextarea,y=m.renderTools,b=m.initializeContentElement,k={bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",superscript:"Superscript",subscript:"Subscript",justifyCenter:"Center text",justifyLeft:"Align text left",justifyRight:"Align text right",justifyFull:"Justify",insertUnorderedList:"Insert unordered list",insertOrderedList:"Insert ordered list",indent:"Indent",outdent:"Outdent",createLink:"Insert hyperlink",unlink:"Remove hyperlink",insertImage:"Insert image",insertHtml:"Insert HTML",viewHtml:"View HTML",fontName:"Select font family",fontNameInherit:"(inherited font)",fontSize:"Select font size",fontSizeInherit:"(inherited size)",formatBlock:"Format",foreColor:"Color",backColor:"Background color",style:"Styles",emptyFolder:"Empty Folder",uploadFile:"Upload",orderBy:"Arrange by:",orderBySize:"Size",orderByName:"Name",invalidFileType:'The selected file "{0}" is not valid. Supported file types are {1}.',deleteFile:'Are you sure you want to delete "{0}"?',overwriteFile:'A file with name "{0}" already exists in the current directory. Do you want to overwrite it?',directoryNotFound:"A directory with this name was not found.",imageWebAddress:"Web address",imageAltText:"Alternate text",linkWebAddress:"Web address",linkText:"Text",linkToolTip:"ToolTip",linkOpenInNewWindow:"Open link in new window",dialogInsert:"Insert",dialogButtonSeparator:"or",dialogCancel:"Cancel"},w=!s||s.ios&&s.flatVersion>=500||!s.ios&&document.documentElement.contentEditable!==t,C=a.extend({init:function(t,n){function o(t){var n=e.grep(t.className.split(" "),function(e){return!/^k-(widget|tool-icon|state-hover|header|combobox|dropdown|selectbox|colorpicker)$/i.test(e)});return n[0]?n[0].substring(n[0].lastIndexOf("-")+1):"custom"}function r(e,t){if(!t.key)return e;var n=e+" (";return t.ctrl&&(n+="Ctrl + "),t.shift&&(n+="Shift + "),t.alt&&(n+="Alt + "),n+=t.key+")"}var s,l,d,p,m,h,C,x,T;if(w){d=this,p=i.ui.editor,a.fn.init.call(d,t,n),d.tools=c({},i.ui.Editor.fn._tools),d.options=c({},d.options,n),t=e(t),t.closest("form").on("submit"+u,function(){d.update()});for(m in d.tools)d.tools[m].name=m.toLowerCase();d.textarea=t.attr("autocomplete","off")[0],s=d.wrapper=v(t),d.textarea.id&&s.find(".k-editor-toolbar").attr("aria-controls",d.textarea.id),y(d,d.options.tools),b(d),d.keyboard=new p.Keyboard([new p.TypingHandler(d),new p.SystemHandler(d)]),d.clipboard=new p.Clipboard(this),d.pendingFormats=new p.PendingFormats(this),d.undoRedoStack=new p.UndoRedoStack,l=n&&n.value?n.value:t.val().replace(/[\r\n\v\f\t ]+/gi," "),d.value(l),h=".k-editor-toolbar > li > *, .k-editor-toolbar > li select",C=".k-editor-button .k-tool-icon",x=C+":not(.k-state-disabled)",T=C+".k-state-disabled",s.find(".k-combobox .k-input").keydown(function(t){var n=e(this).closest(".k-combobox").data("kendoComboBox"),o=t.keyCode;o==f.RIGHT||o==f.LEFT?n.close():o==f.DOWN&&(n.dropDown.isOpened()||(t.stopImmediatePropagation(),n.open()))}),s.on("mouseenter"+u,x,function(){e(this).addClass("k-state-hover")}).on("mouseleave"+u,x,function(){e(this).removeClass("k-state-hover")}).on("mousedown"+u,C,!1).on("keydown"+u,g,function(t){var n,o=e(this).closest("li"),i="li:has("+g+")",r=t.keyCode;if(r==f.RIGHT)n=o.nextAll(i).first().find(g);else if(r==f.LEFT)n=o.prevAll(i).first().find(g);else if(r==f.ESC)n=d;else if(r==f.TAB&&!t.ctrlKey&&!t.altKey)if(t.shiftKey){if(n=o.prevAll(i).first().find(g),!n.length)return;t.preventDefault()}else t.preventDefault(),n=o.nextAll(i).first().find(g),n.length||(n=d);n&&n.focus()}).on("click"+u,x,function(e){e.preventDefault(),e.stopPropagation(),d.exec(o(this))}).on("click"+u,T,function(e){e.preventDefault()}).find(h).each(function(){var t,n=o(this),i=d.options,a=i.tools[n],s=i.messages[n],l=e(this);a&&(("fontSize"==n||"fontName"==n)&&(t=i.messages[n+"Inherit"]||k[n+"Inherit"],l.find("input").val(t).end().find("span.k-input").text(t).end()),a.initialize(l,{title:r(s,a),editor:d}))}),d.bind("select",function(){var t=d.getRange(),n=p.RangeUtils.textNodes(t);n.length||(n=[t.startContainer]),s.find(h).each(function(){var t=d.options.tools[o(this)];t&&t.update(e(this),n,d.pendingFormats)})}),d._DOMNodeInsertedHandler=function(e){d._DOMNodeInserted(e)},d._endTypingHandler=function(){d._endTyping()},e(document).on("DOMNodeInserted",d._DOMNodeInsertedHandler).on("mousedown",d._endTypingHandler),i.notify(d)}},_endTyping:function(){var e=this;try{e.keyboard.isTypingInProgress()&&e.keyboard.endTyping(!0),e.selectionRestorePoint||(e.selectionRestorePoint=new i.ui.editor.RestorePoint(e.getRange()))}catch(t){}},_DOMNodeInserted:function(t){var n=this,o=n.wrapper;(e.contains(t.target,o[0])||o[0]==t.target)&&(n.textarea.value=n.value(),o.find("iframe").remove(),b(n),n.value(n.textarea.value))},events:["select","change","execute","error","paste","keydown","keyup"],options:{name:"Editor",messages:k,formats:{},encoded:!0,stylesheets:[],dialogOptions:{modal:!0,resizable:!1,draggable:!0,animation:!1},fontName:[{text:"Arial",value:"Arial,Helvetica,sans-serif"},{text:"Courier New",value:"'Courier New',Courier,monospace"},{text:"Georgia",value:"Georgia,serif"},{text:"Impact",value:"Impact,Charcoal,sans-serif"},{text:"Lucida Console",value:"'Lucida Console',Monaco,monospace"},{text:"Tahoma",value:"Tahoma,Geneva,sans-serif"},{text:"Times New Roman",value:"'Times New Roman',Times,serif"},{text:"Trebuchet MS",value:"'Trebuchet MS',Helvetica,sans-serif"},{text:"Verdana",value:"Verdana,Geneva,sans-serif"}],fontSize:[{text:"1 (8pt)",value:"xx-small"},{text:"2 (10pt)",value:"x-small"},{text:"3 (12pt)",value:"small"},{text:"4 (14pt)",value:"medium"},{text:"5 (18pt)",value:"large"},{text:"6 (24pt)",value:"x-large"},{text:"7 (36pt)",value:"xx-large"}],formatBlock:[{text:"Paragraph",value:"p"},{text:"Quotation",value:"blockquote"},{text:"Heading 1",value:"h1"},{text:"Heading 2",value:"h2"},{text:"Heading 3",value:"h3"},{text:"Heading 4",value:"h4"},{text:"Heading 5",value:"h5"},{text:"Heading 6",value:"h6"}],tools:["bold","italic","underline","strikethrough","fontName","fontSize","foreColor","backColor","justifyLeft","justifyCenter","justifyRight","justifyFull","insertUnorderedList","insertOrderedList","indent","outdent","formatBlock","createLink","unlink","insertImage"]},destroy:function(){var t=this;a.fn.destroy.call(t),e(t.window).add(t.document).add(t.wrapper).add(t.element.closest("form")).off(u),e(document).off("DOMNodeInserted",t._DOMNodeInsertedHandler).off("mousedown",t._endTypingHandler),i.destroy(t.wrapper)},_nativeTools:["insertLineBreak","insertParagraph","redo","undo","insertHtml"],_tools:{undo:{options:{key:"Z",ctrl:!0}},redo:{options:{key:"Y",ctrl:!0}}},tools:{},value:function(n){var o,r,a,s=this.body,d=i.ui.editor.Dom,c=i.ui.editor.Serializer.domToXhtml(s);return n===t?c:(n!=c&&(this.pendingFormats.clear(),o=/onerror\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/i,n=(n||"").replace(/<!\[CDATA\[(.*)?\]\]>/g,"<!--[CDATA[$1]]-->").replace(/<script([^>]*)>(.*)?<\/script>/gi,"<telerik:script $1>$2</telerik:script>").replace(/<img([^>]*)>/gi,function(e){return e.replace(o,"")}).replace(/(<\/?img[^>]*>)[\r\n\v\f\t ]+/gi,"$1"),l.msie||(n=n.replace(/<p([^>]*)>(\s*)?<\/p>/gi,'<p $1><br _moz_dirty="" /></p>')),l.msie&&9>l.version?(n="<br/>"+n,r="originalsrc",a="originalhref",n=n.replace(/href\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,a+'="$1"'),n=n.replace(/src\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,r+'="$1"'),s.innerHTML=n,d.remove(s.firstChild),e(s).find("telerik\\:script,script,link,img,a").each(function(){var e=this;e[a]&&(e.setAttribute("href",e[a]),e.removeAttribute(a)),e[r]&&(e.setAttribute("src",e[r]),e.removeAttribute(r))})):(s.innerHTML=n,l.msie&&(d.normalize(s),setTimeout(function(){var e,t,n,o=s.getElementsByTagName("ol");for(e=0;o.length>e;e++)t=o[e],n=t.getAttribute("start"),t.setAttribute("start",1),n?t.setAttribute("start",n):t.removeAttribute(n)},1))),this.selectionRestorePoint=null,this.update()),t)},focus:function(){this.window.focus()},update:function(e){this.textarea.value=e||this.options.encoded?this.encodedValue():this.value()},encodedValue:function(){return i.ui.editor.Dom.encode(this.value())},createRange:function(e){return i.ui.editor.RangeUtils.createRange(e||this.document)},getSelection:function(){return i.ui.editor.SelectionUtils.selectionFromDocument(this.document)},selectRange:function(e){this.focus();var t=this.getSelection();t.removeAllRanges(),t.addRange(e)},getRange:function(){var e=this.getSelection(),t=e.rangeCount>0?e.getRangeAt(0):this.createRange(),n=this.document;return t.startContainer!=n||t.endContainer!=n||t.startOffset||t.endOffset||(t.setStart(this.body,0),t.collapse(!0)),t},selectedHtml:function(){return i.ui.editor.Serializer.domToXhtml(this.getRange().cloneContents())},paste:function(e){this.clipboard.paste(e)},exec:function(n,o){var i,r,a,s,l,c=this,u="";n=n.toLowerCase(),c.keyboard.isTypingInProgress()||(c.focus(),i=c.getRange(),r=c.document.body);for(a in c.options.tools)if(a.toLowerCase()==n){u=c.options.tools[a];break}if(u){if(i=c.getRange(),!/undo|redo/i.test(n)&&u.willDelayExecution(i))return s=e.extend({},u),e.extend(s.options,{params:o}),c.pendingFormats.toggle(s),h(c),t;if(l=u.command?u.command(d({range:i},o)):null,c.trigger("execute",{name:n,command:l}),/undo|redo/i.test(n))c.undoRedoStack[n]();else if(l&&(l.managesUndoRedo||c.undoRedoStack.push(l),l.editor=c,l.exec(),l.async))return l.change=e.proxy(function(){h(c)},c),t;h(c)}}});i.ui.plugin(C),n=r.extend({init:function(e){this.options=e},initialize:function(e,t){e.attr({unselectable:"on",title:t.title})},command:function(e){return new this.options.command(e)},update:function(){},willDelayExecution:function(){return!1}}),n.exec=function(e,t,n){e.exec(t,{value:n})},o=n.extend({init:function(e){n.fn.init.call(this,e)},command:function(e){var t=this;return new i.ui.editor.FormatCommand(d(e,{formatter:t.options.formatter}))},update:function(e,t,n){var o=n.isPending(this.name),i=this.options.finder.isFormatted(t),r=o?!i:i;e.toggleClass("k-state-active",r),e.attr("aria-pressed",r)}}),m.registerTool("separator",new n({template:new p({template:m.separatorTemplate})})),d(i.ui,{editor:{ToolTemplate:p,EditorUtils:m,Tool:n,FormatTool:o}})})(window.jQuery),function(e){function t(e){var t,n,o={};for(t=0,n=e.length;n>t;t++)o[e[t]]=!0;return o}var n,o,i,r,a,s,l,d,c,u,f=window.kendo,p=e.map,m=e.extend,h=f.support.browser,g="style",v="float",y="cssFloat",b="styleFloat",k="class",w="k-marker",C=t("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed".split(",")),x="div,p,h1,h2,h3,h4,h5,h6,address,applet,blockquote,button,center,dd,dir,dl,dt,fieldset,form,frameset,hr,iframe,isindex,li,map,menu,noframes,noscript,object,ol,pre,script,table,tbody,td,tfoot,th,thead,tr,ul".split(","),T=t(x),N="span,em,a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,strike,strong,sub,sup,textarea,tt,u,var".split(","),S=t(N),R=t("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected".split(",")),A=function(e){1==e.nodeType&&e.normalize()};h.msie&&h.version>=8&&(A=function(e){if(1==e.nodeType&&e.firstChild)for(var t=e.firstChild,n=t;;){if(n=n.nextSibling,!n)break;3==n.nodeType&&3==t.nodeType&&(n.nodeValue=t.nodeValue+n.nodeValue,u.remove(t)),t=n}}),o=/^\s+$/,i=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,r=/&/g,a=/</g,s=/>/g,l=/\u00a0/g,d=/\ufeff/g,c="color,padding-left,padding-right,padding-top,padding-bottom,background-color,background-attachment,background-image,background-position,background-repeat,border-top-style,border-top-width,border-top-color,border-bottom-style,border-bottom-width,border-bottom-color,border-left-style,border-left-width,border-left-color,border-right-style,border-right-width,border-right-color,font-family,font-size,font-style,font-variant,font-weight,line-height".split(","),u={findNodeIndex:function(e){for(var t=0;;){if(e=e.previousSibling,!e)break;t++}return t},isDataNode:function(e){return e&&null!==e.nodeValue&&null!==e.data},isAncestorOf:function(t,n){try{return!u.isDataNode(t)&&(e.contains(t,u.isDataNode(n)?n.parentNode:n)||n.parentNode==t)}catch(o){return!1}},isAncestorOrSelf:function(e,t){return u.isAncestorOf(e,t)||e==t},findClosestAncestor:function(e,t){if(u.isAncestorOf(e,t))for(;t&&t.parentNode!=e;)t=t.parentNode;return t},getNodeLength:function(e){return u.isDataNode(e)?e.length:e.childNodes.length},splitDataNode:function(e,t){for(var n=e.cloneNode(!1),o="",i=e;i.nextSibling&&3==i.nextSibling.nodeType&&i.nextSibling.nodeValue;)o+=i.nextSibling.nodeValue,i=i.nextSibling;e.deleteData(t,e.length),n.deleteData(0,t),n.nodeValue+=o,u.insertAfter(n,e)},attrEquals:function(t,n){var o,i;for(o in n)if(i=t[o],o==v&&(i=t[e.support.cssFloat?y:b]),"object"==typeof i){if(!u.attrEquals(i,n[o]))return!1}else if(i!=n[o])return!1;return!0},blockParentOrBody:function(e){return u.parentOfType(e,x)||e.ownerDocument.body},blockParents:function(t){var n,o,i,r=[];for(n=0,o=t.length;o>n;n++)i=u.parentOfType(t[n],u.blockElements),i&&0>e.inArray(i,r)&&r.push(i);return r},windowFromDocument:function(e){return e.defaultView||e.parentWindow},normalize:A,blockElements:x,inlineElements:N,empty:C,fillAttrs:R,toHex:function(e){var t=i.exec(e);return t?"#"+p(t.slice(1),function(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}).join(""):e},encode:function(e){return e.replace(r,"&").replace(a,"<").replace(s,">").replace(l," ")},name:function(e){return e.nodeName.toLowerCase()},significantChildNodes:function(t){return e.grep(t.childNodes,function(e){return 3!=e.nodeType||!u.isWhitespace(e)})},lastTextNode:function(e){var t,n=null;if(3==e.nodeType)return e;for(t=e.lastChild;t;t=t.previousSibling)if(n=u.lastTextNode(t))return n;return n},is:function(e,t){return u.name(e)==t},isMarker:function(e){return e.className==w},isWhitespace:function(e){return o.test(e.nodeValue)},isBlock:function(e){return T[u.name(e)]},isEmpty:function(e){return C[u.name(e)]},isInline:function(e){return S[u.name(e)]},scrollContainer:function(e){var t=u.windowFromDocument(e),n=(t.contentWindow||t).document||t.ownerDocument||t;return n=f.support.browser.webkit||"BackCompat"==n.compatMode?n.body:n.documentElement},scrollTo:function(t){var n,o,i=e(u.isDataNode(t)?t.parentNode:t),r=u.windowFromDocument(t.ownerDocument),a=r.innerHeight,s=u.scrollContainer(t.ownerDocument);"br"==u.name(i[0])&&(i=i.parent()),n=i.offset().top,o=i[0].offsetHeight,o+n>s.scrollTop+a&&(s.scrollTop=o+n-a)},persistScrollTop:function(e){n=u.scrollContainer(e).scrollTop},restoreScrollTop:function(e){u.scrollContainer(e).scrollTop=n},insertAt:function(e,t,n){e.insertBefore(t,e.childNodes[n]||null)},insertBefore:function(e,t){return t.parentNode?t.parentNode.insertBefore(e,t):t},insertAfter:function(e,t){return t.parentNode.insertBefore(e,t.nextSibling)},remove:function(e){e.parentNode.removeChild(e)},trim:function(e){var t,n;for(t=e.childNodes.length-1;t>=0;t--)n=e.childNodes[t],u.isDataNode(n)?(n.nodeValue.replace(d,"").length||u.remove(n),u.isWhitespace(n)&&u.insertBefore(n,e)):n.className!=w&&(u.trim(n),n.childNodes.length||u.isEmpty(n)||u.remove(n));return e},parentOfType:function(e,t){do e=e.parentNode;while(e&&!u.ofType(e,t));return e},ofType:function(t,n){return e.inArray(u.name(t),n)>=0},changeTag:function(e,t){var n,o,i,r,a,s=u.create(e.ownerDocument,t),l=e.attributes;for(n=0,o=l.length;o>n;n++)a=l[n],a.specified&&(i=a.nodeName,r=a.nodeValue,i==k?s.className=r:i==g?s.style.cssText=e.style.cssText:s.setAttribute(i,r));for(;e.firstChild;)s.appendChild(e.firstChild);return u.insertBefore(s,e),u.remove(e),s},wrap:function(e,t){return u.insertBefore(t,e),t.appendChild(e),t},unwrap:function(e){for(var t=e.parentNode;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)},create:function(e,t,n){return u.attr(e.createElement(t),n)},attr:function(e,t){t=m({},t),t&&g in t&&(u.style(e,t.style),delete t.style);for(var n in t)null===t[n]&&(e.removeAttribute(n),delete t[n]);return m(e,t)},style:function(t,n){e(t).css(n||{})},unstyle:function(t,n){for(var o in n)o==v&&(o=e.support.cssFloat?y:b),t.style[o]="";""===t.style.cssText&&t.removeAttribute(g)},inlineStyle:function(t,n,o){var i,r=e(u.create(t,n,o));return t.body.appendChild(r[0]),i=p(c,function(e){return h.msie&&"line-height"==e&&"1px"==r.css(e)?"line-height:1.5":e+":"+r.css(e)}).join(";"),r.remove(),i},removeClass:function(t,n){var o,i,r=" "+t.className+" ",a=n.split(" ");for(o=0,i=a.length;i>o;o++)r=r.replace(" "+a[o]+" "," ");r=e.trim(r),r.length?t.className=r:t.removeAttribute(k)},commonAncestor:function(){var e,t,n,o,i,r=arguments.length,a=[],s=1/0,l=null;if(!r)return null;if(1==r)return arguments[0];for(e=0;r>e;e++){for(t=[],n=arguments[e];n;)t.push(n),n=n.parentNode;a.push(t.reverse()),s=Math.min(s,t.length)}if(1==r)return a[0][0];for(e=0;s>e;e++){for(o=a[0][e],i=1;r>i;i++)if(o!=a[i][e])return l;l=o}return l}},f.ui.editor.Dom=u}(window.kendo.jQuery),function(e,t){var n=window.kendo,o=n.ui.editor,i=o.Dom,r=e.extend,a="xx-small,x-small,small,medium,large,x-large,xx-large".split(","),s=/"/g,l=/<br[^>]*>/i,d=/<p><\/p>/i,c=/([\w|\-]+)\s*:\s*([^;]+);?/i,u={domToXhtml:function(n){function o(n){var o,r,a,l,d,u,p,m,h,g,v,y,b,k,w,C,x=[],T=n.attributes,N=e.trim;for(i.is(n,"img")&&(l=n.style.width,d=n.style.height,u=e(n),l&&(u.attr("width",parseInt(l,10)),i.unstyle(n,{width:t})),d&&(u.attr("height",parseInt(d,10)),i.unstyle(n,{height:t}))),r=0,a=T.length;a>r;r++)o=T[r],p=o.nodeName,(o.specified||"value"==p&&!n.value||"type"==p&&"text"==o.nodeValue)&&0>p.indexOf("_moz")&&"complete"!=p&&"altHtml"!=p&&x.push(o);if(x.length)for(x.sort(function(e,t){return e.nodeName>t.nodeName?1:e.nodeName<t.nodeName?-1:0}),r=0,a=x.length;a>r;r++){if(o=x[r],m=o.nodeName,h=o.nodeValue,f.push(" "),f.push(m),f.push('="'),"style"==m){for(g=N(h||n.style.cssText).split(";"),v=0,y=g.length;y>v;v++)if(b=g[v],b.length){if(k=c.exec(b),w=N(k[1].toLowerCase()),C=N(k[2]),"font-size-adjust"==w||"font-stretch"==w)continue;w.indexOf("color")>=0&&(C=i.toHex(C)),w.indexOf("font")>=0&&(C=C.replace(s,"'")),f.push(w),f.push(":"),f.push(C),f.push(";")}}else"src"==m||"href"==m?f.push(n.getAttribute(m,2)):f.push(i.fillAttrs[m]?m:h);f.push('"')}}function r(e,t){for(var n=e.firstChild;n;n=n.nextSibling)u(n,t)}function u(n,a){var s,l,d,c,u,m=n.nodeType;if(1==m){if(s=i.name(n),!s||(n.attributes._moz_dirty||n.attributes._moz_editor_bogus_node)&&i.is(n,"br")||"k-marker"==n.className)return;if(l=p[s])return l.start(n),r(n),l.end(n),t;f.push("<"),f.push(s),o(n),i.empty[s]?f.push(" />"):(f.push(">"),r(n,a||i.is(n,"pre")),f.push("</"),f.push(s),f.push(">"))}else 3==m?(c=n.nodeValue,!a&&e.support.leadingWhitespace&&(d=n.parentNode,u=n.previousSibling,u||(u=(i.isInline(d)?d:n).previousSibling),(!u||""===u.innerHTML||i.isBlock(u))&&(c=c.replace(/^[\r\n\v\f\t ]+/,"")),c=c.replace(/ +/," ")),f.push(i.encode(c))):4==m?(f.push("<![CDATA["),f.push(n.data),f.push("]]>")):8==m&&(0>n.data.indexOf("[CDATA[")?(f.push("<!--"),f.push(n.data),f.push("-->")):(f.push("<!"),f.push(n.data),f.push(">")))}var f=[],p={"telerik:script":{start:function(e){f.push("<script"),o(e),f.push(">")},end:function(){f.push("</script>")}},b:{start:function(){f.push("<strong>")},end:function(){f.push("</strong>")}},i:{start:function(){f.push("<em>")},end:function(){f.push("</em>")}},u:{start:function(){f.push('<span style="text-decoration:underline;">')},end:function(){f.push("</span>")}},iframe:{start:function(e){f.push("<iframe"),o(e),f.push(">")},end:function(){f.push("</iframe>")}},font:{start:function(e){var t,n,o;f.push('<span style="'),t=e.getAttribute("color"),n=a[e.getAttribute("size")],o=e.getAttribute("face"),t&&(f.push("color:"),f.push(i.toHex(t)),f.push(";")),o&&(f.push("font-face:"),f.push(o),f.push(";")),n&&(f.push("font-size:"),f.push(n),f.push(";")),f.push('">')},end:function(){f.push("</span>")}}};return r(n),f=f.join(""),""===f.replace(l,"").replace(d,"")?"":f}};r(o,{Serializer:u})}(window.kendo.jQuery),function(e){function t(e,t,n,o){var i,r,a,s;if(e==t)return o-n;for(i=t;i&&i.parentNode!=e;)i=i.parentNode;if(i)return f(i)-n;for(i=e;i&&i.parentNode!=t;)i=i.parentNode;if(i)return o-f(i)-1;for(r=u.commonAncestor(e,t),a=e;a&&a.parentNode!=r;)a=a.parentNode;for(a||(a=r),s=t;s&&s.parentNode!=r;)s=s.parentNode;return s||(s=r),a==s?0:f(s)-f(a)}function n(e,n){function o(e){try{return 0>t(e.startContainer,e.endContainer,e.startOffset,e.endOffset)}catch(n){return!0}}o(e)&&(n?(e.commonAncestorContainer=e.endContainer=e.startContainer,e.endOffset=e.startOffset):(e.commonAncestorContainer=e.startContainer=e.endContainer,e.startOffset=e.endOffset),e.collapsed=!0)}function o(e){e.collapsed=e.startContainer==e.endContainer&&e.startOffset==e.endOffset;for(var t=e.startContainer;t&&t!=e.endContainer&&!u.isAncestorOf(t,e.endContainer);)t=t.parentNode;e.commonAncestorContainer=t}function i(e,t,n){var o,i,r=t[n?"startContainer":"endContainer"],a=t[n?"startOffset":"endOffset"],s=0,l=p(r)?r:r.childNodes[a]||null,d=p(r)?r.parentNode:r;(3==r.nodeType||4==r.nodeType)&&(s=a),o=d.insertBefore(u.create(t.ownerDocument,"a"),l),i=t.ownerDocument.body.createTextRange(),i.moveToElementText(o),u.remove(o),i[n?"moveStart":"moveEnd"]("character",s),i.collapse(!1),e.setEndPoint(n?"StartToStart":"EndToStart",i)}function r(e,t,n){var o,i,r=u.create(t.ownerDocument,"a"),a=e.duplicate();a.collapse(n),o=a.parentElement();do o.insertBefore(r,r.previousSibling),a.moveToElementText(r);while(a.compareEndPoints(n?"StartToStart":"StartToEnd",e)>0&&r.previousSibling);return a.setEndPoint(n?"EndToStart":"EndToEnd",e),(i=r.nextSibling)?(u.remove(r),p(i)?t[n?"setStart":"setEnd"](i,a.text.length):t[n?"setStartBefore":"setEndBefore"](i),void 0):(i=r.previousSibling,i&&p(i)?(t.setEnd(i,i.nodeValue.length),u.remove(r)):(t.selectNodeContents(o),u.remove(r),t.endOffset-=1),void 0)}var a=window.kendo,s=a.Class,l=e.extend,d=a.ui.editor,c=a.support.browser,u=d.Dom,f=u.findNodeIndex,p=u.isDataNode,m=u.findClosestAncestor,h=u.getNodeLength,g=u.normalize,v={selectionFromWindow:function(e){return"getSelection"in e?e.getSelection():new k(e.document)},selectionFromRange:function(e){var t=N.documentFromRange(e);return v.selectionFromDocument(t)},selectionFromDocument:function(e){return v.selectionFromWindow(u.windowFromDocument(e))}},y=s.extend({init:function(t){e.extend(this,{ownerDocument:t,startContainer:t,endContainer:t,commonAncestorContainer:t,startOffset:0,endOffset:0,collapsed:!0})},setStart:function(e,t){this.startContainer=e,this.startOffset=t,o(this),n(this,!0)},setEnd:function(e,t){this.endContainer=e,this.endOffset=t,o(this),n(this,!1)},setStartBefore:function(e){this.setStart(e.parentNode,f(e))},setStartAfter:function(e){this.setStart(e.parentNode,f(e)+1)},setEndBefore:function(e){this.setEnd(e.parentNode,f(e))},setEndAfter:function(e){this.setEnd(e.parentNode,f(e)+1)},selectNode:function(e){this.setStartBefore(e),this.setEndAfter(e)},selectNodeContents:function(e){this.setStart(e,0),this.setEnd(e,e[1===e.nodeType?"childNodes":"nodeValue"].length)},collapse:function(e){var t=this;e?t.setEnd(t.startContainer,t.startOffset):t.setStart(t.endContainer,t.endOffset)},deleteContents:function(){var e=this,t=e.cloneRange();e.startContainer!=e.commonAncestorContainer&&e.setStartAfter(m(e.commonAncestorContainer,e.startContainer)),e.collapse(!0),function n(e){for(;e.next();)e.hasPartialSubtree()?n(e.getSubtreeIterator()):e.remove()}(new b(t))},cloneContents:function(){var e=N.documentFromRange(this);return function t(n){for(var o,i=e.createDocumentFragment();o=n.next();)o=o.cloneNode(!n.hasPartialSubtree()),n.hasPartialSubtree()&&o.appendChild(t(n.getSubtreeIterator())),i.appendChild(o);return i}(new b(this))},extractContents:function(){var e,t=this,n=t.cloneRange();return t.startContainer!=t.commonAncestorContainer&&t.setStartAfter(m(t.commonAncestorContainer,t.startContainer)),t.collapse(!0),e=N.documentFromRange(t),function o(n){for(var i,r=e.createDocumentFragment();i=n.next();)n.hasPartialSubtree()?(i=i.cloneNode(!1),i.appendChild(o(n.getSubtreeIterator()))):n.remove(t.originalRange),r.appendChild(i);return r}(new b(n))},insertNode:function(e){var t=this;p(t.startContainer)?(t.startOffset!=t.startContainer.nodeValue.length&&u.splitDataNode(t.startContainer,t.startOffset),u.insertAfter(e,t.startContainer)):u.insertAt(t.startContainer,e,t.startOffset),t.setStart(t.startContainer,t.startOffset)},cloneRange:function(){return e.extend(new y(this.ownerDocument),{startContainer:this.startContainer,endContainer:this.endContainer,commonAncestorContainer:this.commonAncestorContainer,startOffset:this.startOffset,endOffset:this.endOffset,collapsed:this.collapsed,originalRange:this})},toString:function(){var e=this.startContainer.nodeName,t=this.endContainer.nodeName;return["#text"==e?this.startContainer.nodeValue:e,"(",this.startOffset,") : ","#text"==t?this.endContainer.nodeValue:t,"(",this.endOffset,")"].join("")}}),b=s.extend({init:function(t){if(e.extend(this,{range:t,_current:null,_next:null,_end:null}),!t.collapsed){var n=t.commonAncestorContainer;this._next=t.startContainer!=n||p(t.startContainer)?m(n,t.startContainer):t.startContainer.childNodes[t.startOffset],this._end=t.endContainer!=n||p(t.endContainer)?m(n,t.endContainer).nextSibling:t.endContainer.childNodes[t.endOffset]}},hasNext:function(){return!!this._next},next:function(){var e=this,t=e._current=e._next;return e._next=e._current&&e._current.nextSibling!=e._end?e._current.nextSibling:null,p(e._current)&&(e.range.endContainer==e._current&&(t=t.cloneNode(!0),t.deleteData(e.range.endOffset,t.length-e.range.endOffset)),e.range.startContainer==e._current&&(t=t.cloneNode(!0),t.deleteData(0,e.range.startOffset))),t
-},traverse:function(e){function t(){return o._current=o._next,o._next=o._current&&o._current.nextSibling!=o._end?o._current.nextSibling:null,o._current}for(var n,o=this;n=t();)o.hasPartialSubtree()?o.getSubtreeIterator().traverse(e):e(n);return n},remove:function(e){var t,n,o,i,r,a=this,s=a.range.startContainer==a._current,l=a.range.endContainer==a._current;p(a._current)&&(s||l)?(t=s?a.range.startOffset:0,n=l?a.range.endOffset:a._current.length,o=n-t,e&&(s||l)&&(a._current==e.startContainer&&e.startOffset>=t&&(e.startOffset-=o),a._current==e.endContainer&&e.endOffset>=n&&(e.endOffset-=o)),a._current.deleteData(t,o)):(i=a._current.parentNode,!e||a.range.startContainer!=i&&a.range.endContainer!=i||(r=f(a._current),i==e.startContainer&&e.startOffset>=r&&(e.startOffset-=1),i==e.endContainer&&e.endOffset>r&&(e.endOffset-=1)),u.remove(a._current))},hasPartialSubtree:function(){return!p(this._current)&&(u.isAncestorOrSelf(this._current,this.range.startContainer)||u.isAncestorOrSelf(this._current,this.range.endContainer))},getSubtreeIterator:function(){var e=this,t=e.range.cloneRange();return t.selectNodeContents(e._current),u.isAncestorOrSelf(e._current,e.range.startContainer)&&t.setStart(e.range.startContainer,e.range.startOffset),u.isAncestorOrSelf(e._current,e.range.endContainer)&&t.setEnd(e.range.endContainer,e.range.endOffset),new b(t)}}),k=s.extend({init:function(e){this.ownerDocument=e,this.rangeCount=1},addRange:function(e){var t=this.ownerDocument.body.createTextRange();i(t,e,!1),i(t,e,!0),t.select()},removeAllRanges:function(){this.ownerDocument.selection.empty()},getRangeAt:function(){var e,t,n,o,i,a,s,l=new y(this.ownerDocument),d=this.ownerDocument.selection;try{if(e=d.createRange(),t=e.item?e.item(0):e.parentElement(),t.ownerDocument!=this.ownerDocument)return l}catch(c){return l}if("Control"==d.type)l.selectNode(e.item(0));else if(r(e,l,!0),r(e,l,!1),9==l.startContainer.nodeType&&l.setStart(l.endContainer,l.startOffset),9==l.endContainer.nodeType&&l.setEnd(l.startContainer,l.endOffset),0===e.compareEndPoints("StartToEnd",e)&&l.collapse(!1),n=l.startContainer,o=l.endContainer,i=this.ownerDocument.body,!(l.collapsed||0!==l.startOffset||l.endOffset!=h(l.endContainer)||n==o&&p(n)&&n.parentNode==i)){for(a=!1,s=!1;0===f(n)&&n==n.parentNode.firstChild&&n!=i;)n=n.parentNode,a=!0;for(;f(o)==h(o.parentNode)-1&&o==o.parentNode.lastChild&&o!=i;)o=o.parentNode,s=!0;n==i&&o==i&&a&&s&&(l.setStart(n,0),l.setEnd(o,h(i)))}return l}}),w=s.extend({init:function(e){this.enumerate=function(){function t(e){if(u.is(e,"img")||3==e.nodeType&&!u.isWhitespace(e))n.push(e);else for(e=e.firstChild;e;)t(e),e=e.nextSibling}var n=[];return new b(e).traverse(t),n}}}),C=s.extend({init:function(e){var t=this;t.range=e,t.rootNode=N.documentFromRange(e),t.body=t.rootNode.body,t.html=t.body.innerHTML,t.startContainer=t.nodeToPath(e.startContainer),t.endContainer=t.nodeToPath(e.endContainer),t.startOffset=t.offset(e.startContainer,e.startOffset),t.endOffset=t.offset(e.endContainer,e.endOffset)},index:function(e){for(var t,n=0,o=e.nodeType;e=e.previousSibling;)t=e.nodeType,(3!=t||o!=t)&&n++,o=t;return n},offset:function(e,t){if(3==e.nodeType)for(;(e=e.previousSibling)&&3==e.nodeType;)t+=e.nodeValue.length;return t},nodeToPath:function(e){for(var t=[];e!=this.rootNode;)t.push(this.index(e)),e=e.parentNode;return t},toRangePoint:function(e,t,n,o){for(var i=this.rootNode,r=n.length,a=o;r--;)i=i.childNodes[n[r]];for(;3==i.nodeType&&a>i.nodeValue.length;)a-=i.nodeValue.length,i=i.nextSibling;e[t?"setStart":"setEnd"](i,a)},toRange:function(){var e=this,t=e.range.cloneRange();return e.toRangePoint(t,!0,e.startContainer,e.startOffset),e.toRangePoint(t,!1,e.endContainer,e.endOffset),t}}),x=s.extend({init:function(){this.caret=null},addCaret:function(e){var t=this;return t.caret=u.create(N.documentFromRange(e),"span",{className:"k-marker"}),e.insertNode(t.caret),e.selectNode(t.caret),t.caret},removeCaret:function(e){var t,n,o,i,r=this,a=r.caret.previousSibling,s=0;a&&(s=p(a)?a.nodeValue.length:f(a)),t=r.caret.parentNode,n=a?f(a):0,u.remove(r.caret),g(t),o=t.childNodes[n],p(o)?e.setStart(o,s):o?(i=u.lastTextNode(o),i?e.setStart(i,i.nodeValue.length):e[a?"setStartAfter":"setStartBefore"](o)):(c.msie||t.innerHTML||(t.innerHTML='<br _moz_dirty="" />'),e.selectNodeContents(t)),e.collapse(!0)},add:function(e,t){var n,o=this;return t&&e.collapsed&&(o.addCaret(e),e=N.expand(e)),n=e.cloneRange(),n.collapse(!1),o.end=u.create(N.documentFromRange(e),"span",{className:"k-marker"}),n.insertNode(o.end),n=e.cloneRange(),n.collapse(!0),o.start=o.end.cloneNode(!0),n.insertNode(o.start),e.setStartBefore(o.start),e.setEndAfter(o.end),g(e.commonAncestorContainer),e},remove:function(e){var t,n,o,i,r,a,s,l,d,c,m,h,v,y=this,b=y.start,k=y.end;for(g(e.commonAncestorContainer);!b.nextSibling&&b.parentNode;)b=b.parentNode;for(;!k.previousSibling&&k.parentNode;)k=k.parentNode;if(t=b.previousSibling&&3==b.previousSibling.nodeType&&b.nextSibling&&3==b.nextSibling.nodeType,n=k.previousSibling&&3==k.previousSibling.nodeType&&k.nextSibling&&3==k.nextSibling.nodeType,o=t&&n,b=b.nextSibling,k=k.previousSibling,i=!1,r=!1,b==y.end&&(r=!!y.start.previousSibling,b=k=y.start.previousSibling||y.end.nextSibling,i=!0),u.remove(y.start),u.remove(y.end),!b||!k)return e.selectNodeContents(e.commonAncestorContainer),e.collapse(!0),void 0;if(a=i?p(b)?b.nodeValue.length:b.childNodes.length:0,s=p(k)?k.nodeValue.length:k.childNodes.length,3==b.nodeType)for(;b.previousSibling&&3==b.previousSibling.nodeType;)b=b.previousSibling,a+=b.nodeValue.length;if(3==k.nodeType)for(;k.previousSibling&&3==k.previousSibling.nodeType;)k=k.previousSibling,s+=k.nodeValue.length;for(l=f(b),d=b.parentNode,c=f(k),m=k.parentNode,h=b;h.previousSibling;h=h.previousSibling)3==h.nodeType&&3==h.previousSibling.nodeType&&l--;for(v=k;v.previousSibling;v=v.previousSibling)3==v.nodeType&&3==v.previousSibling.nodeType&&c--;g(d),3==b.nodeType&&(b=d.childNodes[l]),g(m),3==k.nodeType&&(k=m.childNodes[c]),i?(3==b.nodeType?e.setStart(b,a):e[r?"setStartAfter":"setStartBefore"](b),e.collapse(!0)):(3==b.nodeType?e.setStart(b,a):e.setStartBefore(b),3==k.nodeType?e.setEnd(k,s):e.setEndAfter(k)),y.caret&&y.removeCaret(e)}}),T=/[\u0009-\u000d]|\u0020|\u00a0|\ufeff|\.|,|;|:|!|\(|\)|\?/,N={nodes:function(e){var t=N.textNodes(e);return t.length||(e.selectNodeContents(e.commonAncestorContainer),t=N.textNodes(e),t.length||(t=u.significantChildNodes(e.commonAncestorContainer))),t},textNodes:function(e){return new w(e).enumerate()},documentFromRange:function(e){var t=e.startContainer;return 9==t.nodeType?t:t.ownerDocument},createRange:function(e){return c.msie&&9>c.version?new y(e):e.createRange()},selectRange:function(e){var t,n=N.image(e);n&&(e.setStartAfter(n),e.setEndAfter(n)),t=v.selectionFromRange(e),t.removeAllRanges(),t.addRange(e)},split:function(e,t,n){function o(o){var i,r=e.cloneRange();r.collapse(o),r[o?"setStartBefore":"setEndAfter"](t),i=r.extractContents(),n&&(i=u.trim(i)),u[o?"insertBefore":"insertAfter"](i,t)}o(!0),o(!1)},getMarkers:function(e){var t=[];return new b(e).traverse(function(e){"k-marker"==e.className&&t.push(e)}),t},image:function(e){var t=[];return new b(e).traverse(function(e){u.is(e,"img")&&t.push(e)}),1==t.length?t[0]:void 0},expand:function(e){var t,n,o,i,r=e.cloneRange(),a=r.startContainer.childNodes[0===r.startOffset?0:r.startOffset-1],s=r.endContainer.childNodes[r.endOffset];return p(a)&&p(s)?(t=a.nodeValue,n=s.nodeValue,t&&n?(o=t.split("").reverse().join("").search(T),i=n.search(T),o&&i?(i=-1==i?n.length:i,o=-1==o?0:t.length-o,r.setStart(a,o),r.setEnd(s,i),r):r):r):r},isExpandable:function(e){var t,n,o,i,r,a,s=e.startContainer,l=N.documentFromRange(e);return s==l||s==l.body?!1:(t=e.cloneRange(),(n=s.nodeValue)?(o=n.substring(0,t.startOffset),i=n.substring(t.startOffset),r=0,a=0,o&&(r=o.split("").reverse().join("").search(T)),i&&(a=i.search(T)),r&&a):!1)}};l(d,{SelectionUtils:v,W3CRange:y,RangeIterator:b,W3CSelection:k,RangeEnumerator:w,RestorePoint:C,Marker:x,RangeUtils:N})}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,o=t.ui.editor,i=o.EditorUtils,r=i.registerTool,a=o.Dom,s=o.RangeUtils,l=s.selectRange,d=o.Tool,c=o.ToolTemplate,u=o.RestorePoint,f=o.Marker,p=e.extend,m=n.extend({init:function(e){var t=this;t.options=e,t.restorePoint=new u(e.range),t.marker=new f,t.formatter=e.formatter},getRange:function(){return this.restorePoint.toRange()},lockRange:function(e){return this.marker.add(this.getRange(),e)},releaseRange:function(e){this.marker.remove(e),l(e)},undo:function(){var e=this.restorePoint;e.body.innerHTML=e.html,l(e.toRange())},redo:function(){this.exec()},exec:function(){var e=this,t=e.lockRange(!0);e.formatter.editor=e.editor,e.formatter.toggle(t),e.releaseRange(t)}}),h=n.extend({init:function(e,t){this.body=e.body,this.startRestorePoint=e,this.endRestorePoint=t},redo:function(){this.body.innerHTML=this.endRestorePoint.html,l(this.endRestorePoint.toRange())},undo:function(){this.body.innerHTML=this.startRestorePoint.html,l(this.startRestorePoint.toRange())}}),g=m.extend({init:function(e){m.fn.init.call(this,e),this.managesUndoRedo=!0},exec:function(){var e=this.editor,t=e.getRange(),n=new u(t);e.clipboard.paste(this.options.value||""),e.undoRedoStack.push(new h(n,new u(e.getRange()))),e.focus()}}),v=d.extend({initialize:function(e,t){var n=t.editor,i=this.options,r=i.items?i.items:n.options.insertHtml;new o.SelectBox(e,{dataSource:r,dataTextField:"text",dataValueField:"value",change:function(){d.exec(n,"insertHtml",this.value())},title:n.options.messages.insertHtml,highlightFirst:!1})},command:function(e){return new g(e)},update:function(e){var t=e.data("kendoSelectBox")||e.find("select").data("kendoSelectBox");t.close(),t.value(t.options.title)}}),y=n.extend({init:function(){this.stack=[],this.currentCommandIndex=-1},push:function(e){var t=this;t.stack=t.stack.slice(0,t.currentCommandIndex+1),t.currentCommandIndex=t.stack.push(e)-1},undo:function(){this.canUndo()&&this.stack[this.currentCommandIndex--].undo()},redo:function(){this.canRedo()&&this.stack[++this.currentCommandIndex].redo()},canUndo:function(){return this.currentCommandIndex>=0},canRedo:function(){return this.currentCommandIndex!=this.stack.length-1}}),b=n.extend({init:function(e){this.editor=e},keydown:function(t){var n,o=this,i=o.editor,r=i.keyboard,a=r.isTypingKey(t),s=p(e.Event(),t);return o.editor.trigger("keydown",s),s.isDefaultPrevented()&&t.preventDefault(),s.isDefaultPrevented()||!a||r.isTypingInProgress()?!1:(n=i.getRange(),o.startRestorePoint=new u(n),r.startTyping(function(){i.selectionRestorePoint=o.endRestorePoint=new u(i.getRange()),i.undoRedoStack.push(new h(o.startRestorePoint,o.endRestorePoint))}),!0)},keyup:function(e){var t=this.editor.keyboard;return this.editor.trigger("keyup",e),t.isTypingInProgress()?(t.endTyping(),!0):!1}}),k=n.extend({init:function(e){this.editor=e,this.systemCommandIsInProgress=!1},createUndoCommand:function(){var e=this;e.endRestorePoint=new u(e.editor.getRange()),e.editor.undoRedoStack.push(new h(e.startRestorePoint,e.endRestorePoint)),e.startRestorePoint=e.endRestorePoint},changed:function(){return this.startRestorePoint?this.startRestorePoint.html!=this.editor.body.innerHTML:!1},keydown:function(e){var t=this,n=t.editor,o=n.keyboard;return o.isModifierKey(e)?(o.isTypingInProgress()&&o.endTyping(!0),t.startRestorePoint=new u(n.getRange()),!0):o.isSystem(e)?(t.systemCommandIsInProgress=!0,t.changed()&&(t.systemCommandIsInProgress=!1,t.createUndoCommand()),!0):!1},keyup:function(e){var t=this;return t.systemCommandIsInProgress&&t.changed()?(t.systemCommandIsInProgress=!1,t.createUndoCommand(e),!0):!1}}),w=n.extend({init:function(e){this.handlers=e,this.typingInProgress=!1},isCharacter:function(e){return e>=48&&90>=e||e>=96&&111>=e||e>=186&&192>=e||e>=219&&222>=e},toolFromShortcut:function(t,n){var o,i,r=String.fromCharCode(n.keyCode);for(o in t)if(i=e.extend({ctrl:!1,alt:!1,shift:!1},t[o].options),(i.key==r||i.key==n.keyCode)&&i.ctrl==n.ctrlKey&&i.alt==n.altKey&&i.shift==n.shiftKey)return o},isTypingKey:function(e){var t=e.keyCode;return this.isCharacter(t)&&!e.ctrlKey&&!e.altKey||32==t||13==t||8==t||46==t&&!e.shiftKey&&!e.ctrlKey&&!e.altKey},isModifierKey:function(e){var t=e.keyCode;return 17==t&&!e.shiftKey&&!e.altKey||16==t&&!e.ctrlKey&&!e.altKey||18==t&&!e.ctrlKey&&!e.shiftKey},isSystem:function(e){return 46==e.keyCode&&e.ctrlKey&&!e.altKey&&!e.shiftKey},startTyping:function(e){this.onEndTyping=e,this.typingInProgress=!0},stopTyping:function(){this.typingInProgress=!1,this.onEndTyping&&this.onEndTyping()},endTyping:function(t){var n=this;n.clearTimeout(),t?n.stopTyping():n.timeout=window.setTimeout(e.proxy(n.stopTyping,n),1e3)},isTypingInProgress:function(){return this.typingInProgress},clearTimeout:function(){window.clearTimeout(this.timeout)},notify:function(e,t){var n,o=this.handlers;for(n=0;o.length>n&&!o[n][t](e);n++);},keydown:function(e){this.notify(e,"keydown")},keyup:function(e){this.notify(e,"keyup")}}),C=n.extend({init:function(e){this.editor=e,this.cleaners=[new x,new T]},htmlToFragment:function(e){var t=this.editor,n=t.document,o=a.create(n,"div"),i=n.createDocumentFragment();for(o.innerHTML=e;o.firstChild;)i.appendChild(o.firstChild);return i},isBlock:function(e){return/<(div|p|ul|ol|table|h[1-6])/i.test(e)},oncut:function(){var e=this.editor,t=new u(e.getRange());setTimeout(function(){e.undoRedoStack.push(new h(t,new u(e.getRange())))})},onpaste:function(t){var n,i,r,s=this.editor,d=s.getRange(),c="",f=new u(d),p=a.create(s.document,"div",{className:"k-paste-container",innerHTML:c});a.persistScrollTop(s.document),s.body.appendChild(p),s.body.createTextRange?(t.preventDefault(),n=s.createRange(),n.selectNodeContents(p),s.selectRange(n),i=s.body.createTextRange(),i.moveToElementText(p),e(s.body).unbind("paste"),i.execCommand("Paste"),e(s.body).bind("paste",e.proxy(arguments.callee,this))):(r=s.createRange(),r.selectNodeContents(p),l(r)),d.deleteContents(),setTimeout(function(){var e,t={html:""};l(d),p.parentNode||(p=s.body.lastChild),a.remove(p),p.lastChild&&a.is(p.lastChild,"br")&&a.remove(p.lastChild),e=p.innerHTML,e!=c&&(t.html=e),s.trigger("paste",t),s.clipboard.paste(t.html,!0),s.undoRedoStack.push(new h(f,new u(s.getRange()))),o.EditorUtils.select(s)})},splittableParent:function(e,t){var n,o;if(e)return a.parentOfType(t,["p","ul","ol"])||t.parentNode;if(n=t.parentNode,o=t.ownerDocument.body,a.isInline(n))for(;n.parentNode!=o&&!a.isBlock(n.parentNode);)n=n.parentNode;return n},paste:function(e,t){var n,o,i,r,d,c,u,p,m,h,g=this.editor;for(n=0,o=this.cleaners.length;o>n;n++)this.cleaners[n].applicable(e)&&(e=this.cleaners[n].clean(e));if(t&&(e=e.replace(/(<br>(\s| )*)+(<\/?(div|p|li|col|t))/gi,"$3"),e=e.replace(/<(a|span)[^>]*><\/\1>/gi,"")),e=e.replace(/^<li/i,"<ul><li").replace(/li>$/g,"li></ul>"),i=this.isBlock(e),r=g.getRange(),r.deleteContents(),r.startContainer==g.document&&r.selectNodeContents(g.body),d=new f,c=d.addCaret(r),u=this.splittableParent(i,c),p=!1,/body|td/.test(a.name(u))||!i&&!a.isInline(u)||(r.selectNode(c),s.split(r,u,!0),p=!0),m=this.htmlToFragment(e),m.firstChild&&"k-paste-container"===m.firstChild.className){for(h=[],n=0,o=m.childNodes.length;o>n;n++)h.push(m.childNodes[n].innerHTML);m=this.htmlToFragment(h.join("<br />"))}if(r.insertNode(m),u=this.splittableParent(i,c),p){for(;c.parentNode!=u;)a.unwrap(c.parentNode);a.unwrap(c.parentNode)}a.normalize(r.commonAncestorContainer),c.style.display="inline",a.restoreScrollTop(g.document),a.scrollTo(c),d.removeCaret(r),l(r)}}),x=n.extend({init:function(){this.replacements=[/<\?xml[^>]*>/gi,"",/<!--(.|\n)*?-->/g,"",/"/g,"'",/(?:<br> [\s\r\n]+|<br>)*(<\/?(h[1-6]|hr|p|div|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|address|pre|form|blockquote|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br> [\s\r\n]+|<br>)*/g,"$1",/<br><br>/g,"<BR><BR>",/<br>/g," ",/<table([^>]*)>(\s| )+<t/gi,"<table$1><t",/<tr[^>]*>(\s| )*<\/tr>/gi,"",/<tbody[^>]*>(\s| )*<\/tbody>/gi,"",/<table[^>]*>(\s| )*<\/table>/gi,"",/<BR><BR>/g,"<br>",/^\s*( )+/gi,"",/( |<br[^>]*>)+\s*$/gi,"",/mso-[^;"]*;?/gi,"",/<(\/?)b(\s[^>]*)?>/gi,"<$1strong$2>",/<(\/?)i(\s[^>]*)?>/gi,"<$1em$2>",/<\/?(meta|link|style|o:|v:|x:)[^>]*>((?:.|\n)*?<\/(meta|link|style|o:|v:|x:)[^>]*>)?/gi,"",/style=(["|'])\s*\1/g,""]},applicable:function(e){return/class="?Mso|style="[^"]*mso-/i.test(e)},listType:function(e){return/^[\u2022\u00b7\u00a7\u00d8o]\u00a0+/.test(e)?"ul":/^\s*\w+[\.\)]\u00a0{2,}/.test(e)?"ol":void 0},lists:function(t){var n,o,i,r,s,l,d,c,u=a.create(document,"div",{innerHTML:t}),f=e(a.blockElements.join(","),u),p=-1,m={ul:{},ol:{}},h=u;for(o=0;f.length>o;o++)if(i=f[o],t=i.innerHTML.replace(/<\/?\w+[^>]*>/g,"").replace(/ /g," "),r=this.listType(t),r&&"p"==a.name(i)){if(s=parseFloat(i.style.marginLeft||0),l=m[r][s],(s>p||!l)&&(l=a.create(document,r),h==u?a.insertBefore(l,i):h.appendChild(l),m[r][s]=l),n!=r)for(d in m)for(c in m[d])e.contains(l,m[d][c])&&delete m[d][c];a.remove(i.firstChild),h=a.create(document,"li",{innerHTML:i.innerHTML}),l.appendChild(h),a.remove(i),p=s,n=r}else i.innerHTML?(m={ul:{},ol:{}},h=u,p=-1):a.remove(i);return u.innerHTML},stripEmptyAnchors:function(e){return e.replace(/<a([^>]*)>\s*<\/a>/gi,function(e,t){return!t||0>t.indexOf("href")?"":e})},clean:function(e){var t,n,o=this,i=o.replacements;for(t=0,n=i.length;n>t;t+=2)e=e.replace(i[t],i[t+1]);return e=o.stripEmptyAnchors(e),e=o.lists(e),e=e.replace(/\s+class="?[^"\s>]*"?/gi,"")}}),T=n.extend({init:function(){this.replacements=[/\s+class="Apple-style-span[^"]*"/gi,"",/<(div|p|h[1-6])\s+style="[^"]*"/gi,"<$1",/^<div>(.*)<\/div>$/,"$1"]},applicable:function(e){return/class="?Apple-style-span|style="[^"]*-webkit-nbsp-mode/i.test(e)},clean:function(e){var t,n,o=this,i=o.replacements;for(t=0,n=i.length;n>t;t+=2)e=e.replace(i[t],i[t+1]);return e}});p(o,{Command:m,GenericCommand:h,InsertHtmlCommand:g,InsertHtmlTool:v,UndoRedoStack:y,TypingHandler:b,SystemHandler:k,Keyboard:w,Clipboard:C,MSWordFormatCleaner:x,WebkitFormatCleaner:T}),r("insertHtml",new v({template:new c({template:i.dropDownListTemplate,title:"Insert HTML",initialValue:"Insert HTML"})}))}(window.kendo.jQuery),function(e){function t(e){return e.collapsed&&!u.isExpandable(e)}var n=window.kendo,o=n.Class,i=n.ui.editor,r=n.ui.Editor.fn.options.formats,a=i.EditorUtils,s=i.Tool,l=i.ToolTemplate,d=i.FormatTool,c=i.Dom,u=i.RangeUtils,f=e.extend,p=i.EditorUtils.registerTool,m=i.EditorUtils.registerFormat,h="k-marker",g=o.extend({init:function(e){this.format=e},numberOfSiblings:function(e){var t,n=0,o=0,i=0,r=e.parentNode;for(t=r.firstChild;t;t=t.nextSibling)t!=e&&(t.className==h?i++:3==t.nodeType?n++:o++);return i>1&&r.firstChild.className==h&&r.lastChild.className==h?0:o+n},findSuitable:function(e,t){return!t&&this.numberOfSiblings(e)>0?null:c.parentOfType(e,this.format[0].tags)},findFormat:function(e){var t,n,o,i,r,a=this.format,s=c.attrEquals;for(t=0,n=a.length;n>t;t++){if(o=e,i=a[t].tags,r=a[t].attr,o&&c.ofType(o,i)&&s(o,r))return o;for(;o;)if(o=c.parentOfType(o,i),o&&s(o,r))return o}return null},isFormatted:function(e){var t,n;for(t=0,n=e.length;n>t;t++)if(this.findFormat(e[t]))return!0;return!1}}),v=o.extend({init:function(e,t){var n=this;n.finder=new g(e),n.attributes=f({},e[0].attr,t),n.tag=e[0].tags[0]},wrap:function(e){return c.wrap(e,c.create(e.ownerDocument,this.tag,this.attributes))},activate:function(e,t){var n=this;n.finder.isFormatted(t)?(n.split(e),n.remove(t)):n.apply(t)},toggle:function(e){var t=u.textNodes(e);t.length>0&&this.activate(e,t)},apply:function(e){var t,n,o,i,r=this,a=[];for(t=0,n=e.length;n>t;t++)o=e[t],i=r.finder.findSuitable(o),i?c.attr(i,r.attributes):i=r.wrap(o),a.push(i);r.consolidate(a)},remove:function(e){var t,n,o,i=this;for(t=0,n=e.length;n>t;t++)o=i.finder.findFormat(e[t]),o&&(i.attributes&&i.attributes.style?(c.unstyle(o,i.attributes.style),o.style.cssText||c.unwrap(o)):c.unwrap(o))},split:function(e){var t,n,o=u.textNodes(e),i=o.length;if(i>0)for(t=0;i>t;t++)n=this.finder.findFormat(o[t]),n&&u.split(e,n,!0)},consolidate:function(e){for(var t,n;e.length>1;)if(t=e.pop(),n=e[e.length-1],t.previousSibling&&t.previousSibling.className==h&&n.appendChild(t.previousSibling),t.tagName==n.tagName&&t.previousSibling==n&&t.style.cssText==n.style.cssText){for(;t.firstChild;)n.appendChild(t.firstChild);c.remove(t)}}}),y=g.extend({init:function(e,t){var n=this;n.format=e,n.greedyProperty=t,g.fn.init.call(n,e)},getInlineCssValue:function(t){var n,o,i,r,a,s,l,d,u,f,p,m,h=t.attributes,g=e.trim;if(h)for(n=0,o=h.length;o>n;n++)if(i=h[n],r=i.nodeName,a=i.nodeValue,i.specified&&"style"==r)for(s=g(a||t.style.cssText).split(";"),d=0,u=s.length;u>d;d++)if(l=s[d],l.length){if(f=l.split(":"),p=g(f[0].toLowerCase()),m=g(f[1]),p!=this.greedyProperty)continue;return p.indexOf("color")>=0?c.toHex(m):m}},getFormatInner:function(t){var n,o,i,r=e(c.isDataNode(t)?t.parentNode:t),a=r.parents().andSelf();for(n=0,o=a.length;o>n;n++)if(i="className"==this.greedyProperty?a[n].className:this.getInlineCssValue(a[n]))return i;return"inherit"},getFormat:function(e){var t,n,o=this.getFormatInner(e[0]);for(t=1,n=e.length;n>t;t++)if(o!=this.getFormatInner(e[t]))return"";return o},isFormatted:function(e){return""!==this.getFormat(e)}}),b=v.extend({init:function(e,t,n){var o=this;v.fn.init.call(o,e,t),o.greedyProperty=n,o.values=t,o.finder=new y(e,n)},activate:function(e,t){var n,o=this,i=o.greedyProperty,r="apply";o.split(e),i&&(n=i.replace(/-([a-z])/,function(e,t){return t.toUpperCase()}),"inherit"==o.values.style[n]&&(r="remove")),o[r](t)}}),k=d.extend({init:function(e){d.fn.init.call(this,f(e,{finder:new g(e.format),formatter:function(){return new v(e.format)}})),this.willDelayExecution=t}}),w=s.extend({willDelayExecution:t,update:function(e,t,n){var o,i=e.data(this.type),r=n.getPending(this.name);o=r&&r.options.params?r.options.params.value:this.finder.getFormat(t),i.close(),i.value(o)}}),C=w.extend({init:function(e){var t=this;s.fn.init.call(t,e),t.type=n.support.browser.msie||n.support.touch?"kendoDropDownList":"kendoComboBox",t.format=[{tags:["span"]}],t.finder=new y(t.format,e.cssAttr)},command:function(e){var t=this.options,n=this.format,o={};return new i.FormatCommand(f(e,{formatter:function(){return o[t.domAttr]=e.value,new b(n,{style:o},t.cssAttr)}}))},initialize:function(e,t){var n,o=t.editor,i=this.options,r=i.name,a=[];i.defaultValue&&(a=[{text:o.options.messages[i.defaultValue[0].text],value:i.defaultValue[0].value}]),n=a.concat(i.items?i.items:o.options[r]),e[this.type]({dataTextField:"text",dataValueField:"value",dataSource:n,change:function(){s.exec(o,r,this.value())},highlightFirst:!1}),e.closest(".k-widget").removeClass("k-"+r).find("*").andSelf().attr("unselectable","on"),e.data(this.type).value("inherit")}}),x=s.extend({init:function(e){s.fn.init.call(this,e),this.options=e,this.format=[{tags:["span"]}]},update:function(){this._widget.close()},command:function(e){var t=this.options,n=this.format,o={};return new i.FormatCommand(f(e,{formatter:function(){return o[t.domAttr]=e.value,new b(n,{style:o},t.cssAttr)}}))},willDelayExecution:t,initialize:function(e,t){var o=t.editor,i=this.name;e=this._widget=new n.ui.ColorPicker(e,{value:"#000",toolIcon:"k-"+this.options.name,palette:"websafe",change:function(){var t=e.value();t&&s.exec(o,i,t)}}),e.bind("activate",function(t){t.preventDefault(),e.trigger("change"),o.focus()}),e.element.attr("title",t.title)}}),T=w.extend({init:function(e){var t=this;s.fn.init.call(t,e),t.type="kendoSelectBox",t.format=[{tags:["span"]}],t.finder=new y(t.format,"className")},command:function(e){var t=this.format;return new i.FormatCommand(f(e,{formatter:function(){return new b(t,{className:e.value})}}))},initialize:function(e,t){var n=t.editor,o=this.options;new i.SelectBox(e,{dataTextField:"text",dataValueField:"value",dataSource:o.items||n.options.style,title:n.options.messages.style,change:function(){s.exec(n,"style",this.value())},highlightFirst:!1}),e.closest(".k-widget").removeClass("k-"+this.name).find("*").andSelf().attr("unselectable","on")}});f(i,{InlineFormatFinder:g,InlineFormatter:v,GreedyInlineFormatFinder:y,GreedyInlineFormatter:b,InlineFormatTool:k,FontTool:C,ColorTool:x,StyleTool:T}),p("style",new i.StyleTool({template:new l({template:a.dropDownListTemplate,title:"Styles"})})),m("bold",[{tags:["strong"]},{tags:["span"],attr:{style:{fontWeight:"bold"}}}]),p("bold",new k({key:"B",ctrl:!0,format:r.bold,template:new l({template:a.buttonTemplate,title:"Bold"})})),m("italic",[{tags:["em"]},{tags:["span"],attr:{style:{fontStyle:"italic"}}}]),p("italic",new k({key:"I",ctrl:!0,format:r.italic,template:new l({template:a.buttonTemplate,title:"Italic"})})),m("underline",[{tags:["span"],attr:{style:{textDecoration:"underline"}}}]),p("underline",new k({key:"U",ctrl:!0,format:r.underline,template:new l({template:a.buttonTemplate,title:"Underline"})})),m("strikethrough",[{tags:["del"]},{tags:["span"],attr:{style:{textDecoration:"line-through"}}}]),p("strikethrough",new k({format:r.strikethrough,template:new l({template:a.buttonTemplate,title:"Strikethrough"})})),m("superscript",[{tags:["sup"]}]),p("superscript",new k({format:r.superscript,template:new l({template:a.buttonTemplate,title:"Superscript"})})),m("subscript",[{tags:["sub"]}]),p("subscript",new k({format:r.subscript,template:new l({template:a.buttonTemplate,title:"Subscript"})})),p("foreColor",new x({cssAttr:"color",domAttr:"color",name:"foreColor",template:new l({template:a.colorPickerTemplate,title:"Color"})})),p("backColor",new x({cssAttr:"background-color",domAttr:"backgroundColor",name:"backColor",template:new l({template:a.colorPickerTemplate,title:"Background Color"})})),p("fontName",new C({cssAttr:"font-family",domAttr:"fontFamily",name:"fontName",defaultValue:[{text:"fontNameInherit",value:"inherit"}],template:new l({template:a.comboBoxTemplate,title:"Font Name"})})),p("fontSize",new C({cssAttr:"font-size",domAttr:"fontSize",name:"fontSize",defaultValue:[{text:"fontSizeInherit",value:"inherit"}],template:new l({template:a.comboBoxTemplate,title:"Font Size"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,o=e.extend,i=t.ui.editor,r=t.ui.Editor.fn.options.formats,a=i.Dom,s=i.Command,l=i.Tool,d=i.ToolTemplate,c=i.FormatTool,u=i.EditorUtils,f=u.registerTool,p=u.registerFormat,m=i.RangeUtils,h=n.extend({init:function(e){this.format=e},contains:function(e,t){var n,o,i;for(n=0,o=t.length;o>n;n++)if(i=t[n],!i||!a.isAncestorOrSelf(e,i))return!1;return!0},findSuitable:function(t){var n,o,i,r=this.format,s=[];for(n=0,o=t.length;o>n;n++){if(i=a.ofType(t[n],r[0].tags)?t[n]:a.parentOfType(t[n],r[0].tags),!i)return[];0>e.inArray(i,s)&&s.push(i)}for(n=0,o=s.length;o>n;n++)if(this.contains(s[n],s))return[s[n]];return s},findFormat:function(e){var t,n,o,i,r,s=this.format;for(t=0,n=s.length;n>t;t++)for(o=e,i=s[t].tags,r=s[t].attr;o;){if(a.ofType(o,i)&&a.attrEquals(o,r))return o;o=o.parentNode}return null},getFormat:function(e){var t,n,o=this,i=function(e){return o.findFormat(a.isDataNode(e)?e.parentNode:e)},r=i(e[0]);if(!r)return"";for(t=1,n=e.length;n>t;t++)if(r!=i(e[t]))return"";return r.nodeName.toLowerCase()},isFormatted:function(e){for(var t=0,n=e.length;n>t;t++)if(!this.findFormat(e[t]))return!1;return!0}}),g=n.extend({init:function(e,t){this.format=e,this.values=t,this.finder=new h(e)},wrap:function(e,t,n){var o,i,r,s,l,d=1==n.length?a.blockParentOrBody(n[0]):a.commonAncestor.apply(null,n);for(a.isInline(d)&&(d=a.blockParentOrBody(d)),r=a.significantChildNodes(d),s=a.findNodeIndex(r[0]),l=a.create(d.ownerDocument,e,t),o=0;r.length>o;o++)i=r[o],a.isBlock(i)?(a.attr(i,t),l.childNodes.length&&(a.insertBefore(l,i),l=l.cloneNode(!1)),s=a.findNodeIndex(i)+1):l.appendChild(i);l.firstChild&&a.insertAt(d,l,s)},apply:function(e){var t,n,i=this,r=a.is(e[0],"img")?[e[0]]:i.finder.findSuitable(e),s=r.length?u.formatByName(a.name(r[0]),i.format):i.format[0],l=s.tags[0],d=o({},s.attr,i.values);if(r.length)for(t=0,n=r.length;n>t;t++)a.attr(r[t],d);else i.wrap(l,d,e)},remove:function(e){var t,n,o,i;for(t=0,n=e.length;n>t;t++)o=this.finder.findFormat(e[t]),o&&(a.ofType(o,["p","img","li"])?(i=u.formatByName(a.name(o),this.format),i.attr.style&&a.unstyle(o,i.attr.style),i.attr.className&&a.removeClass(o,i.attr.className)):a.unwrap(o))},toggle:function(e){var t=this,n=m.nodes(e);t.finder.isFormatted(n)?t.remove(n):t.apply(n)}}),v=n.extend({init:function(e,t){var n=this;n.format=e,n.values=t,n.finder=new h(e)},apply:function(e){var t,n,o,r,s,l=this.format,d=a.blockParents(e),c=l[0].tags[0];if(d.length)for(t=0,n=d.length;n>t;t++)a.is(d[t],"li")?(o=d[t].parentNode,r=new i.ListFormatter(o.nodeName.toLowerCase(),c),s=this.editor.createRange(),s.selectNode(d[t]),r.toggle(s)):a.changeTag(d[t],c);else new g(l,this.values).apply(e)},toggle:function(e){var t=m.textNodes(e);t.length||(e.selectNodeContents(e.commonAncestorContainer),t=m.textNodes(e),t.length||(t=a.significantChildNodes(e.commonAncestorContainer))),this.apply(t)}}),y=s.extend({init:function(e){e.formatter=e.formatter(),s.fn.init.call(this,e)}}),b=c.extend({init:function(e){c.fn.init.call(this,o(e,{finder:new h(e.format),formatter:function(){return new g(e.format)}}))}}),k=l.extend({init:function(e){l.fn.init.call(this,e),this.finder=new h([{tags:a.blockElements}])},command:function(e){return new y(o(e,{formatter:function(){return new v([{tags:[e.value]}],{})}}))},update:function(e,t){var n;n=e.is("select")?e.data("kendoSelectBox"):e.find("select").data("kendoSelectBox"),n.close(),n.value(this.finder.getFormat(t))},initialize:function(e,t){var n=t.editor,o="formatBlock";new i.SelectBox(e,{dataTextField:"text",dataValueField:"value",dataSource:this.options.items?this.options.items:n.options.formatBlock,title:n.options.messages.formatBlock,change:function(){l.exec(n,o,this.value())},highlightFirst:!1}),e.closest(".k-widget").removeClass("k-"+o).find("*").andSelf().attr("unselectable","on")}});o(i,{BlockFormatFinder:h,BlockFormatter:g,GreedyBlockFormatter:v,FormatCommand:y,BlockFormatTool:b,FormatBlockTool:k}),f("formatBlock",new k({template:new d({template:u.dropDownListTemplate})})),p("justifyLeft",[{tags:a.blockElements,attr:{style:{textAlign:"left"}}},{tags:["img"],attr:{style:{"float":"left"}}}]),f("justifyLeft",new b({format:r.justifyLeft,template:new d({template:u.buttonTemplate,title:"Justify Left"})})),p("justifyCenter",[{tags:a.blockElements,attr:{style:{textAlign:"center"}}},{tags:["img"],attr:{style:{display:"block",marginLeft:"auto",marginRight:"auto"}}}]),f("justifyCenter",new b({format:r.justifyCenter,template:new d({template:u.buttonTemplate,title:"Justify Center"})})),p("justifyRight",[{tags:a.blockElements,attr:{style:{textAlign:"right"}}},{tags:["img"],attr:{style:{"float":"right"}}}]),f("justifyRight",new b({format:r.justifyRight,template:new d({template:u.buttonTemplate,title:"Justify Right"})})),p("justifyFull",[{tags:a.blockElements,attr:{style:{textAlign:"justify"}}}]),f("justifyFull",new b({format:r.justifyFull,template:new d({template:u.buttonTemplate,title:"Justify Full"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=e.extend,o=t.ui.editor,i=o.Dom,r=o.Command,a=o.Tool,s=o.BlockFormatter,l=i.normalize,d=o.RangeUtils,c=o.EditorUtils.registerTool,u=r.extend({init:function(e){this.options=e,r.fn.init.call(this,e)},exec:function(){function e(e){if(e.firstChild&&i.is(e.firstChild,"br")&&i.remove(e.firstChild),i.isDataNode(e)&&!e.nodeValue&&(e=e.parentNode),e&&!i.is(e,"img")){for(;e.firstChild&&1==e.firstChild.nodeType;)e=e.firstChild;""===e.innerHTML&&(e.innerHTML=y)}}var n,o,r,a,c,u,f,p,m,h,g=this.getRange(),v=d.documentFromRange(g),y=t.support.browser.msie?"":'<br _moz_dirty="" />',b="p,h1,h2,h3,h4,h5,h6".split(","),k=i.parentOfType(g.startContainer,b),w=i.parentOfType(g.endContainer,b),C=k&&!w||!k&&w;g.deleteContents(),u=i.create(v,"a"),g.insertNode(u),u.parentNode||(a=g.commonAncestorContainer,a.innerHTML="",a.appendChild(u)),l(u.parentNode),f=i.parentOfType(u,["li"]),p=i.parentOfType(u,"h1,h2,h3,h4,h5,h6".split(",")),f?(m=g.cloneRange(),m.selectNode(f),d.textNodes(m).length||(c=i.create(v,"p"),f.nextSibling&&d.split(m,f.parentNode),i.insertAfter(c,f.parentNode),i.remove(1==f.parentNode.childNodes.length?f.parentNode:f),c.innerHTML=y,r=c)):p&&!u.nextSibling&&(c=i.create(v,"p"),i.insertAfter(c,p),c.innerHTML=y,i.remove(u),r=c),r||(f||p||new s([{tags:["p"]}]).apply([u]),g.selectNode(u),n=i.parentOfType(u,[f?"li":p?i.name(p):"p"]),d.split(g,n,C),o=n.previousSibling,i.is(o,"li")&&o.firstChild&&!i.is(o.firstChild,"br")&&(o=o.firstChild),r=n.nextSibling,i.is(r,"li")&&r.firstChild&&!i.is(r.firstChild,"br")&&(r=r.firstChild),i.remove(n),e(o),e(r),l(o)),l(r),i.is(r,"img")?g.setStartBefore(r):(g.selectNodeContents(r),h=d.textNodes(g)[0],h&&g.selectNodeContents(h)),g.collapse(!0),i.scrollTo(r),d.selectRange(g)
-}}),f=r.extend({init:function(e){this.options=e,r.fn.init.call(this,e)},exec:function(){var e,n,o=this.getRange();o.deleteContents(),e=i.create(d.documentFromRange(o),"br"),o.insertNode(e),l(e.parentNode),t.support.browser.msie||e.nextSibling&&!i.isWhitespace(e.nextSibling)||(n=e.cloneNode(!0),n.setAttribute("_moz_dirty",""),i.insertAfter(n,e)),o.setStartAfter(e),o.collapse(!0),i.scrollTo(e.nextSibling),d.selectRange(o)}});n(o,{ParagraphCommand:u,NewLineCommand:f}),c("insertLineBreak",new a({key:13,shift:!0,command:f})),c("insertParagraph",new a({key:13,command:u}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,o=e.extend,i=t.ui.editor,r=i.Dom,a=i.RangeUtils,s=i.EditorUtils,l=i.Command,d=i.ToolTemplate,c=i.FormatTool,u=i.BlockFormatFinder,f=a.textNodes,p=i.EditorUtils.registerTool,m=u.extend({init:function(e){this.tag=e;var t=this.tags=["ul"==e?"ol":"ul",e];u.fn.init.call(this,[{tags:t}])},isFormatted:function(e){var t,n,o=[];for(n=0;e.length>n;n++)(t=this.findFormat(e[n]))&&r.name(t)==this.tag&&o.push(t);if(1>o.length)return!1;if(o.length!=e.length)return!1;for(n=0;o.length>n&&o[n].parentNode==t.parentNode;n++)if(o[n]!=t)return!1;return!0},findSuitable:function(e){var t=r.parentOfType(e[0],this.tags);return t&&r.name(t)==this.tag?t:null}}),h=n.extend({init:function(e,t){var n=this;n.finder=new m(e),n.tag=e,n.unwrapTag=t},wrap:function(e,t){var n,o,i=r.create(e.ownerDocument,"li");for(n=0;t.length>n;n++)if(o=t[n],r.is(o,"li"))e.appendChild(o);else if(r.is(o,"ul")||r.is(o,"ol"))for(;o.firstChild;)e.appendChild(o.firstChild);else if(r.is(o,"td")){for(;o.firstChild;)i.appendChild(o.firstChild);e.appendChild(i),o.appendChild(e),e=e.cloneNode(!1),i=i.cloneNode(!1)}else i.appendChild(o),r.isBlock(o)&&(e.appendChild(i),r.unwrap(o),i=i.cloneNode(!1));i.firstChild&&e.appendChild(i)},containsAny:function(e,t){for(var n=0;t.length>n;n++)if(r.isAncestorOrSelf(e,t[n]))return!0;return!1},suitable:function(e,t){if("k-marker"==e.className){var n=e.nextSibling;if(n&&r.isBlock(n))return!1;if(n=e.previousSibling,n&&r.isBlock(n))return!1}return this.containsAny(e,t)||r.isInline(e)||3==e.nodeType},split:function(t){var n,o,i,s,l,d,c=f(t);if(c.length)for(n=r.parentOfType(c[0],["li"]),o=r.parentOfType(c[c.length-1],["li"]),t.setStartBefore(n),t.setEndAfter(o),i=0,s=c.length;s>i;i++)l=this.finder.findFormat(c[i]),l&&(d=e(l).parents("ul,ol"),d[0]?a.split(t,d.last()[0],!0):a.split(t,l,!0))},merge:function(e,t){for(var n,o=t.previousSibling;o&&("k-marker"==o.className||3==o.nodeType&&r.isWhitespace(o));)o=o.previousSibling;if(o&&r.name(o)==e){for(;t.firstChild;)o.appendChild(t.firstChild);r.remove(t),t=o}for(n=t.nextSibling;n&&("k-marker"==n.className||3==n.nodeType&&r.isWhitespace(n));)n=n.nextSibling;if(n&&r.name(n)==e){for(;t.lastChild;)n.insertBefore(t.lastChild,n.firstChild);r.remove(t)}},applyOnSection:function(t,n){function o(){a.push(this)}var i,a,s,l,d,c,u,f=this.tag;for(i=1==n.length?r.parentOfType(n[0],["ul","ol"]):r.commonAncestor.apply(null,n),i||(i=r.parentOfType(n[0],["p","td"])||n[0].ownerDocument.body),r.isInline(i)&&(i=r.blockParentOrBody(i)),a=[],s=this.finder.findSuitable(n),s||(s=new m("ul"==f?"ol":"ul").findSuitable(n)),l=r.significantChildNodes(i),l.length||(l=n),/table|tbody/.test(r.name(i))&&(l=e.map(n,function(e){return r.parentOfType(e,["td"])})),d=0;l.length>d;d++)c=l[d],u=r.name(c),!this.suitable(c,n)||s&&r.isAncestorOrSelf(s,c)||(!s||"ul"!=u&&"ol"!=u?a.push(c):(e.each(c.childNodes,o),r.remove(c)));a.length!=l.length||i==n[0].ownerDocument.body||/table|tbody|tr|td/.test(r.name(i))||(a=[i]),s||(s=r.create(i.ownerDocument,f),r.insertBefore(s,a[0])),this.wrap(s,a),r.is(s,f)||r.changeTag(s,f),this.merge(f,s)},apply:function(e){var t,n,o,i=0,a=[];do o=r.parentOfType(e[i],["td","body"]),t&&o==t?n.push(e[i]):(t&&a.push({section:t,nodes:n}),n=[e[i]],t=o),i++;while(e.length>i);for(a.push({section:t,nodes:n}),i=0;a.length>i;i++)this.applyOnSection(a[i].section,a[i].nodes)},unwrap:function(t){var n,o,i,a,s=t.ownerDocument.createDocumentFragment(),l=this.unwrapTag;for(o=t.firstChild;o;o=o.nextSibling){for(i=r.create(t.ownerDocument,l||"p");o.firstChild;)a=o.firstChild,r.isBlock(a)?(i.firstChild&&(s.appendChild(i),i=r.create(t.ownerDocument,l||"p")),s.appendChild(a)):i.appendChild(a);i.firstChild&&s.appendChild(i)}n=e(t).parents("ul,ol"),n[0]?(r.insertAfter(s,n.last()[0]),n.last().remove()):r.insertAfter(s,t),r.remove(t)},remove:function(e){var t,n,o;for(n=0,o=e.length;o>n;n++)t=this.finder.findFormat(e[n]),t&&this.unwrap(t)},toggle:function(e){var t,n=this,o=f(e),i=e.commonAncestorContainer;o.length||(e.selectNodeContents(i),o=f(e),o.length||(t=i.ownerDocument.createTextNode(""),e.startContainer.appendChild(t),o=[t],e.selectNode(t.parentNode))),n.finder.isFormatted(o)?(n.split(e),n.remove(o)):n.apply(o)}}),g=l.extend({init:function(e){e.formatter=new h(e.tag),l.fn.init.call(this,e)}}),v=c.extend({init:function(e){this.options=e,c.fn.init.call(this,o(e,{finder:new m(e.tag)}))},command:function(e){return new g(o(e,{tag:this.options.tag}))}});o(i,{ListFormatFinder:m,ListFormatter:h,ListCommand:g,ListTool:v}),p("insertUnorderedList",new v({tag:"ul",template:new d({template:s.buttonTemplate,title:"Remove Link"})})),p("insertOrderedList",new v({tag:"ol",template:new d({template:s.buttonTemplate,title:"Remove Link"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,o=e.extend,i=t.ui.editor,r=i.Dom,a=i.RangeUtils,s=i.EditorUtils,l=i.Command,d=i.Tool,c=i.ToolTemplate,u=i.InlineFormatter,f=i.InlineFormatFinder,p=a.textNodes,m=i.EditorUtils.registerTool,h=n.extend({findSuitable:function(e){return r.parentOfType(e,["a"])}}),g=n.extend({init:function(){this.finder=new h},apply:function(e,t){var n,o,i,s,l=p(e);t.innerHTML?(n=a.getMarkers(e),o=a.documentFromRange(e),e.deleteContents(),s=r.create(o,"a",t),e.insertNode(s),"a"==r.name(s.parentNode)&&r.insertAfter(s,s.parentNode),n.length>1&&(r.insertAfter(n[n.length-1],s),r.insertAfter(n[1],s),r[l.length>0?"insertBefore":"insertAfter"](n[0],s))):(i=new u([{tags:["a"]}],t),i.finder=this.finder,i.apply(l))}}),v=l.extend({init:function(e){e.formatter={toggle:function(e){new u([{tags:["a"]}]).remove(p(e))}},this.options=e,l.fn.init.call(this,e)}}),y=l.extend({init:function(e){var t=this;t.options=e,l.fn.init.call(t,e),t.formatter=new g,e.url?this.exec=function(){this.formatter.apply(e.range,{href:e.url,innerHTML:e.text||e.url,target:e.target})}:(t.attributes=null,t.async=!0)},_dialogTemplate:function(e){return t.template("<div class=\"k-editor-dialog\"><ol><li class='k-form-text-row'><label for='k-editor-link-url'>#: messages.linkWebAddress #</label><input type='text' class='k-input' id='k-editor-link-url'></li># if (showText) { #<li class='k-form-text-row'><label for='k-editor-link-text'>#: messages.linkText #</label><input type='text' class='k-input' id='k-editor-link-text'></li># } #<li class='k-form-text-row'><label for='k-editor-link-title'>#: messages.linkToolTip #</label><input type='text' class='k-input' id='k-editor-link-title'></li><li class='k-form-checkbox-row'><input type='checkbox' id='k-editor-link-target'><label for='k-editor-link-target'>#: messages.linkOpenInNewWindow #</label></li></ol><div class='k-button-wrapper'><button class=\"k-dialog-insert k-button\">#: messages.dialogInsert #</button> #: messages.dialogButtonSeparator # <a href=\"\\#\" class=\"k-dialog-close k-link\">#: messages.dialogCancel #</a></div></div>")({messages:this.editor.options.messages,showText:e})},exec:function(){function n(t){var n,o,r,a=u.element,s=e("#k-editor-link-url",a).val();s&&"http://"!=s&&(f.attributes={href:s},n=e("#k-editor-link-title",a).val(),n&&(f.attributes.title=n),o=e("#k-editor-link-text",a).val(),o!==g&&(f.attributes.innerHTML=o||s),r=e("#k-editor-link-target",a).is(":checked"),f.attributes.target=r?"_blank":null,f.formatter.apply(m,f.attributes)),i(t),f.change&&f.change()}function i(e){e.preventDefault(),u.destroy(),r.windowFromDocument(a.documentFromRange(m)).focus(),f.releaseRange(m)}var l,d,c,u,f=this,m=f.getRange(),h=m.collapsed,g=null,v=f.editor.options.messages;m=f.lockRange(!0),l=p(m),d=l.length?f.formatter.finder.findSuitable(l[0]):null,c=1>=l.length||2==l.length&&h,u=s.createDialog(f._dialogTemplate(c),f.editor,o({},f.editor.options.dialogOptions,{title:v.createLink,close:i,visible:!1})).find(".k-dialog-insert").click(n).end().find(".k-dialog-close").click(i).end().find(".k-form-text-row input").keydown(function(e){var o=t.keys;e.keyCode==o.ENTER?n(e):e.keyCode==o.ESC&&i(e)}).end().find("#k-editor-link-url").val(d?d.getAttribute("href",2):"http://").end().find("#k-editor-link-text").val(l.length>0?1==l.length?l[0].nodeValue:l[0].nodeValue+l[1].nodeValue:"").end().find("#k-editor-link-title").val(d?d.title:"").end().find("#k-editor-link-target").attr("checked",d?"_blank"==d.target:!1).end().data("kendoWindow").center().open(),c&&l.length>0&&(g=e("#k-editor-link-text",u.element).val()),e("#k-editor-link-url",u.element).focus().select()},redo:function(){var e=this,t=e.lockRange(!0);e.formatter.apply(t,e.attributes),e.releaseRange(t)}}),b=d.extend({init:function(t){this.options=t,this.finder=new f([{tags:["a"]}]),d.fn.init.call(this,e.extend(t,{command:v}))},initialize:function(e,t){d.fn.initialize.call(this,e,t),e.addClass("k-state-disabled")},update:function(e,t){e.toggleClass("k-state-disabled",!this.finder.isFormatted(t)).removeClass("k-state-hover")}});o(t.ui.editor,{LinkFormatFinder:h,LinkFormatter:g,UnlinkCommand:v,LinkCommand:y,UnlinkTool:b}),m("createLink",new d({key:"K",ctrl:!0,command:y,template:new c({template:s.buttonTemplate,title:"Create Link"})})),m("unlink",new b({key:"K",ctrl:!0,shift:!0,template:new c({template:s.buttonTemplate,title:"Remove Link"})}))}(window.kendo.jQuery),function(e,t){var n=window.kendo,o=e.extend,i=n.ui.editor,r=i.EditorUtils,a=i.Dom,s=r.registerTool,l=i.ToolTemplate,d=i.RangeUtils,c=i.Command,u=n.keys,f="#k-editor-image-url",p="#k-editor-image-title",m=c.extend({init:function(e){var t=this;c.fn.init.call(t,e),t.async=!0,t.attributes={}},insertImage:function(e,t){var n=this.attributes;if(n.src&&"http://"!=n.src){if(!e)return e=a.create(d.documentFromRange(t),"img",n),e.onload=e.onerror=function(){e.removeAttribute("complete"),e.removeAttribute("width"),e.removeAttribute("height")},t.deleteContents(),t.insertNode(e),t.setStartAfter(e),t.setEndAfter(e),d.selectRange(t),!0;a.attr(e,n)}return!1},_dialogTemplate:function(e){return n.template('<div class="k-editor-dialog"># if (showBrowser) { #<div class="k-imagebrowser"></div># } #<ol><li class="k-form-text-row"><label for="k-editor-image-url">#: messages.imageWebAddress #</label><input type="text" class="k-input" id="k-editor-image-url"></li><li class="k-form-text-row"><label for="k-editor-image-title">#: messages.imageAltText #</label><input type="text" class="k-input" id="k-editor-image-title"></li></ol><div class="k-button-wrapper"><button class="k-dialog-insert k-button">#: messages.dialogInsert #</button> #: messages.dialogButtonSeparator # <a href="\\#" class="k-dialog-close k-link">#: messages.dialogCancel #</a></div></div>')({messages:this.editor.options.messages,showBrowser:e})},redo:function(){var e=this,t=e.lockRange();e.insertImage(d.image(t),t)||e.releaseRange(t)},exec:function(){function i(e){var t=c.element;h.attributes={src:t.find(f).val().replace(/ /g,"%20"),alt:t.find(p).val()},v=h.insertImage(y,g),s(e),h.change&&h.change()}function s(e){e.preventDefault(),c.destroy(),a.windowFromDocument(d.documentFromRange(g)).focus(),v||h.releaseRange(g)}function l(e){e.keyCode==u.ENTER?i(e):e.keyCode==u.ESC&&s(e)}var c,m,h=this,g=h.lockRange(),v=!1,y=d.image(g),b=h.editor.options,k=b.messages,w=b.imageBrowser,C=!!(n.ui.ImageBrowser&&w&&w.transport&&w.transport.read!==t);m=C?{width:"960px",height:"650px"}:{},c=r.createDialog(h._dialogTemplate(C),h.editor,o(m,b.dialogOptions,{title:k.insertImage,close:s,visible:!1,resizable:C,activate:function(){if(C){var e=this;new n.ui.ImageBrowser(e.element.find(".k-imagebrowser"),o({},w,{change:function(){e.element.find(f).val(this.value())},apply:i}))}}})).find(".k-dialog-insert").click(i).end().find(".k-dialog-close").click(s).end().find(".k-form-text-row input").keydown(l).end().find(f).val(y?y.getAttribute("src",2):"http://").end().find(p).val(y?y.alt:"").end().data("kendoWindow").center().open(),e(f,c.element).focus().select()}});n.ui.editor.ImageCommand=m,s("insertImage",new i.Tool({command:m,template:new l({template:r.buttonTemplate,title:"Insert Image"})}))}(window.kendo.jQuery),function(e,t){var n=window.kendo,o=n.ui.DropDownList,i=o.extend({init:function(e,t){var n=this;o.fn.init.call(n,e,t),n.value(n.options.title)},options:{name:"SelectBox"},value:function(e){var n=this,i=o.fn.value.call(n,e);return e===t?i:(e!==o.fn.value.call(n)&&(n.text(n.options.title),n._current.removeClass("k-state-selected"),n.current(null),n._oldIndex=n.selectedIndex=-1),t)}});n.ui.plugin(i),n.ui.editor.SelectBox=i}(window.kendo.jQuery),function(e,t){function n(n,o){var i="rtl"==e(n).css("direction"),r=i?"Right":"Left",a="td"!=s.name(n)?"margin"+r:"padding"+r;return o===t?n.style[a]||0:(o>0?n.style[a]=o+"px":(n.style[a]="",n.style.cssText||n.removeAttribute("style")),t)}var o=window.kendo,i=o.Class,r=e.extend,a=o.ui.editor,s=a.Dom,l=a.EditorUtils,d=l.registerTool,c=a.Command,u=a.Tool,f=a.ToolTemplate,p=a.RangeUtils,m=s.blockElements,h=a.BlockFormatFinder,g=a.BlockFormatter,v=i.extend({init:function(){this.finder=new h([{tags:s.blockElements}])},apply:function(t){var o,i,r,a,l,d,c,u,f,p,m=this.finder.findSuitable(t),h=[];if(m.length){for(o=0,i=m.length;i>o;o++)s.is(m[o],"li")?e(m[o]).index()?0>e.inArray(m[o].parentNode,h)&&h.push(m[o]):h.push(m[o].parentNode):h.push(m[o]);for(;h.length;)if(r=h.shift(),s.is(r,"li"))if(a=r.parentNode,l=e(r).prev("li"),d=l.find("ul,ol").last(),c=e(r).children("ul,ol")[0],c&&l[0])d[0]?(d.append(r),d.append(e(c).children()),s.remove(c)):(l.append(c),c.insertBefore(r,c.firstChild));else for(c=l.children("ul,ol")[0],c||(c=s.create(r.ownerDocument,s.name(a)),l.append(c));r&&r.parentNode==a;)c.appendChild(r),r=h.shift();else for(u=parseInt(n(r),10)+30,n(r,u),f=0;h.length>f;f++)e.contains(r,h[f])&&h.splice(f,1)}else p=new g([{tags:"p"}],{style:{marginLeft:30}}),p.apply(t)},remove:function(t){var o,i,r,a,s,l,d,c,u=this.finder.findSuitable(t);for(i=0,r=u.length;r>i;i++){if(d=e(u[i]),d.is("li")){if(a=d.parent(),s=a.parent(),s.is("li,ul,ol")&&!n(a[0])){if(o&&e.contains(o,s[0]))continue;l=d.nextAll("li"),l.length&&e(a[0].cloneNode(!1)).appendTo(d).append(l),s.is("li")?d.insertAfter(s):d.appendTo(s),a.children("li").length||a.remove();continue}if(o==a[0])continue;o=a[0]}else o=u[i];c=parseInt(n(o),10)-30,n(o,c)}}}),y=c.extend({init:function(e){e.formatter={toggle:function(e){(new v).apply(p.nodes(e))}},c.fn.init.call(this,e)}}),b=c.extend({init:function(e){e.formatter={toggle:function(e){(new v).remove(p.nodes(e))}},c.fn.init.call(this,e)}}),k=u.extend({init:function(e){u.fn.init.call(this,e),this.finder=new h([{tags:m}])},update:function(o,i){var r,a,l,d,c=this.finder.findSuitable(i);for(l=0,d=c.length;d>l;l++)if(r=n(c[l]),r||(a=e(c[l]).parents("ul,ol").length,r=s.is(c[l],"li")&&(a>1||n(c[l].parentNode))||s.ofType(c[l],["ul","ol"])&&a>0),r)return o.removeClass("k-state-disabled"),t;o.addClass("k-state-disabled").removeClass("k-state-hover")}});r(a,{IndentFormatter:v,IndentCommand:y,OutdentCommand:b,OutdentTool:k}),d("indent",new u({command:y,template:new f({template:l.buttonTemplate,title:"Indent"})})),d("outdent",new k({command:b,template:new f({template:l.buttonTemplate,title:"Outdent"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=e.extend,o=t.ui.editor,i=o.Dom,r=o.RangeUtils,a=o.EditorUtils,s=o.Command,l=o.Tool,d=o.ToolTemplate,c=s.extend({init:function(e){var t=this;t.options=e,s.fn.init.call(t,e),t.attributes=null,t.async=!0},exec:function(){function t(e){s.value(d.find(f).val()),o(e),a.change&&a.change(),s.trigger("change")}function o(e){e.preventDefault(),d.data("kendoWindow").destroy(),i.windowFromDocument(r.documentFromRange(l)).focus()}var a=this,s=a.editor,l=s.getRange(),d=e(c.template).appendTo(document.body),u=c.indent(s.value()),f=".k-editor-textarea",p=s.options.messages;d.kendoWindow(n({},s.options.dialogOptions,{title:p.viewHtml,close:o})).hide().find(f).val(u).end().find(".k-dialog-update").click(t).end().find(".k-dialog-close").click(o).end().show().data("kendoWindow").center(),d.find(f).focus()}});n(c,{template:"<div class='k-editor-dialog'><textarea class='k-editor-textarea k-input'></textarea><div class='k-button-wrapper'><button class='k-dialog-update k-button'>Update</button> or <a href='#' class='k-dialog-close k-link'>Close</a></div></div>",indent:function(e){return e.replace(/<\/(p|li|ul|ol|h[1-6]|table|tr|td|th)>/gi,"</$1>\n").replace(/<(ul|ol)([^>]*)><li/gi,"<$1$2>\n<li").replace(/<br \/>/gi,"<br />\n").replace(/\n$/,"")}}),t.ui.editor.ViewHtmlCommand=c,o.EditorUtils.registerTool("viewHtml",new l({command:c,template:new d({template:a.buttonTemplate,title:"View HTML"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,o=e.extend,i=t.ui.editor,r=i.RangeUtils,a=i.Marker,s=n.extend({init:function(e){this.editor=e,this.formats=[]},apply:function(e){var t,n,i,s,l,d,c,u;if(this.hasPending()){if(t=new a,t.addCaret(e),n=e.startContainer.childNodes[e.startOffset],i=n.previousSibling,i?(i.nodeValue||(i=i.previousSibling),e.setStart(i,i.nodeValue.length-1)):e.setStart(e.startContainer,e.startOffset),t.add(e),!r.textNodes(e).length)return t.remove(e),e.collapse(!0),this.editor.selectRange(e),void 0;for(s=t.end.previousSibling.previousSibling,d=this.formats,c=0;d.length>c;c++)l=d[c],u=l.command(o({range:e},l.options.params)),u.editor=this.editor,u.exec(),e.selectNode(s);t.remove(e),s.parentNode&&(e.setStart(s,1),e.collapse(!0)),this.clear(),this.editor.selectRange(e)}},hasPending:function(){return this.formats.length>0},isPending:function(e){return!!this.getPending(e)},getPending:function(e){var t,n=this.formats;for(t=0;n.length>t;t++)if(n[t].name==e)return n[t]},toggle:function(e){var t,n=this.formats;for(t=0;n.length>t;t++)if(n[t].name==e.name)return n[t].params&&n[t].params.value!=e.params.value?n[t].params.value=e.params.value:n.splice(t,1),void 0;n.push(e)},clear:function(){this.formats=[]}});o(i,{PendingFormats:s})}(window.kendo.jQuery)});{return this.formats.length>0},isPending:function(e){return!!this.getPending(e)},getPending:function(e){for(var t=this.formats,n=0;t.length>n;n++)if(t[n].name==e)return t[n]},toggle:function(e){for(var t=this.formats,n=0;t.length>n;n++)if(t[n].name==e.name)return t[n].params&&t[n].params.value!=e.params.value?t[n].params.value=e.params.value:t.splice(n,1),void 0;t.push(e)},clear:function(){this.formats=[]}});i(o,{PendingFormats:s})}(window.kendo.jQuery);
+
+("function"==typeof define&&define.amd?define:function(e,t){return t()})(["./kendo.combobox.min","./kendo.dropdownlist.min","./kendo.window.min","./kendo.colorpicker.min","./kendo.imagebrowser.min"],function(){!function(e,t){var n,o,i=window.kendo,r=i.Class,a=i.ui.Widget,s=i.support.mobileOS,l=i.support.browser,d=e.extend,c=e.proxy,u=i.deepExtend,f=".kendoEditor",p=i.keys,m=r.extend({init:function(e){this.options=e},getHtml:function(){var e=this.options;return i.template(e.template,{useWithBlock:!1})(e)}}),h={editorWrapperTemplate:'<table cellspacing="4" cellpadding="0" class="k-widget k-editor k-header" role="presentation"><tbody><tr role="presentation"><td class="k-editor-toolbar-wrap k-secondary" role="presentation"><ul class="k-editor-toolbar" role="toolbar" /></td></tr><tr><td class="k-editable-area" /></tr></tbody></table>',buttonTemplate:'<li class="k-editor-button" role="presentation"><a href="" role="button" class="k-tool-icon #= data.cssClass #"#= data.popup ? " data-popup" : "" # unselectable="on" title="#= data.title #">#= data.title #</a></li>',colorPickerTemplate:'<li class="k-editor-colorpicker" role="presentation"><div class="k-colorpicker #= data.cssClass #" /></li>',comboBoxTemplate:'<li class="k-editor-combobox"><select title="#= data.title #" class="#= data.cssClass #" /></li>',dropDownListTemplate:'<li class="k-editor-selectbox"><select title="#= data.title #" class="#= data.cssClass #" /></li>',separatorTemplate:'<li class="k-separator" />',formatByName:function(t,n){for(var o=0;o<n.length;o++)if(e.inArray(t,n[o].tags)>=0)return n[o]},registerTool:function(e,t){var n=t.options;n&&n.template&&(n.template.options.cssClass="k-"+e),t.name||(t.options.name=e,t.name=e.toLowerCase()),k.defaultTools[e]=t},registerFormat:function(e,t){k.fn.options.formats[e]=t}},g={bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",superscript:"Superscript",subscript:"Subscript",justifyCenter:"Center text",justifyLeft:"Align text left",justifyRight:"Align text right",justifyFull:"Justify",insertUnorderedList:"Insert unordered list",insertOrderedList:"Insert ordered list",indent:"Indent",outdent:"Outdent",createLink:"Insert hyperlink",unlink:"Remove hyperlink",insertImage:"Insert image",insertHtml:"Insert HTML",viewHtml:"View HTML",fontName:"Select font family",fontNameInherit:"(inherited font)",fontSize:"Select font size",fontSizeInherit:"(inherited size)",formatBlock:"Format",formatting:"Format",foreColor:"Color",backColor:"Background color",style:"Styles",emptyFolder:"Empty Folder",uploadFile:"Upload",orderBy:"Arrange by:",orderBySize:"Size",orderByName:"Name",invalidFileType:'The selected file "{0}" is not valid. Supported file types are {1}.',deleteFile:'Are you sure you want to delete "{0}"?',overwriteFile:'A file with name "{0}" already exists in the current directory. Do you want to overwrite it?',directoryNotFound:"A directory with this name was not found.",imageWebAddress:"Web address",imageAltText:"Alternate text",linkWebAddress:"Web address",linkText:"Text",linkToolTip:"ToolTip",linkOpenInNewWindow:"Open link in new window",dialogUpdate:"Update",dialogInsert:"Insert",dialogButtonSeparator:"or",dialogCancel:"Cancel"},v=!s||s.ios&&s.flatVersion>=500||!s.ios&&t!==document.documentElement.contentEditable,b={basic:["bold","italic","underline"],alignment:["justifyLeft","justifyCenter","justifyRight"],lists:["insertUnorderedList","insertOrderedList"],indenting:["indent","outdent"],links:["createLink","unlink"],tables:["createTable","addColumnLeft","addColumnRight","addRowAbove","addRowBelow","deleteRow","deleteColumn"]},y="textarea,main,article,section,aside,nav,header,footer,div".split(","),k=a.extend({init:function(t,n){var o,r,s,l=this,p=i.ui.editor,m=p.Dom.name(t);v&&-1!=e.inArray(m,y)&&(a.fn.init.call(l,t,n),l.options=u({},l.options,n),t=l.element,t.closest("form").on("submit"+f,function(){l.update()}),s=d({},l.options),s.editor=l,"textarea"==m?(l._wrapTextarea(),r=l.wrapper.find(".k-editor-toolbar"),t[0].id&&r.attr("aria-controls",t[0].id)):(l.element.addClass("k-widget k-editor k-editor-inline"),s.popup=!0,r=e('<ul class="k-editor-toolbar k-secondary" role="toolbar" />').insertBefore(t)),l.toolbar=new p.Toolbar(r[0],s),l.toolbar.bindTo(l),l._initializeContentElement(l),l.keyboard=new p.Keyboard([new p.TypingHandler(l),new p.SystemHandler(l)]),l.clipboard=new p.Clipboard(this),l.undoRedoStack=new p.UndoRedoStack,o=n&&n.value?n.value:l.textarea?t.val().replace(/[\r\n\v\f\t ]+/gi," "):t[0].innerHTML,l.value(o),e(document).on("mousedown",c(l._endTyping,l)).on("mouseup",c(l._mouseup,l)),i.notify(l))},_endTyping:function(){var e=this.keyboard;try{e.isTypingInProgress()&&(e.endTyping(!0),this.saveSelection())}catch(t){}},_selectionChange:function(){this._selectionStarted=!1,this.saveSelection(),this.trigger("select",{})},_wrapTextarea:function(){var t=this,n=t.element,o=n[0].style.width,i=n[0].style.height,r=h.editorWrapperTemplate,a=e(r).insertBefore(n).width(o).height(i),s=a.find(".k-editable-area");n.attr("autocomplete","off").appendTo(s).addClass("k-content k-raw-content").css("display","none"),t.textarea=n,t.wrapper=a},_createContentElement:function(t){var n,o,r,a=this,s=a.textarea,l=i.support.isRtl(s)?"direction:rtl;":"";return s.hide(),n=e("<iframe />",{src:'javascript:""',frameBorder:"0"}).css("display","").addClass("k-content").insertBefore(s)[0],o=n.contentWindow||n,r=o.document||n.contentDocument,e(n).one("load",function(){var e=a.toolbar.items().filter(".k-decorated");e.kendoSelectBox("decorate",r)}),r.open(),r.write("<!DOCTYPE html><html><head><meta charset='utf-8' /><style>html,body{padding:0;margin:0;background:#fff;height:100%;min-height:100%;}body{font-size:12px;font-family:Verdana,Geneva,sans-serif;padding-top:1px;margin-top:-1px;word-wrap: break-word;-webkit-nbsp-mode: space;-webkit-line-break: after-white-space;"+l+"}"+"h1{font-size:2em;margin:.67em 0}h2{font-size:1.5em}h3{font-size:1.16em}h4{font-size:1em}h5{font-size:.83em}h6{font-size:.7em}"+"p{margin:0 0 1em;padding:0 .2em}.k-marker{display:none;}.k-paste-container,.Apple-style-span{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}"+"ul,ol{padding-left:2.5em}"+"a{color:#00a}"+"code{font-size:1.23em}"+".k-table{width:100%;border-spacing:0;margin: 0 0 1em;}"+".k-table td{min-width:1px;padding:.2em .3em;}"+".k-table,.k-table td{outline:0;border: 1px dotted #ccc;}"+".k-table p{margin:0;padding:0;}"+"</style>"+"<script>(function(d,c){d[c]('header'),d[c]('article'),d[c]('nav'),d[c]('section'),d[c]('footer');})(document, 'createElement');</script>"+e.map(t,function(e){return"<link rel='stylesheet' href='"+e+"'>"}).join("")+"</head><body autocorrect='off' contenteditable='true'></body></html>"),r.close(),o},_initializeContentElement:function(){var n,o,r=this;r.textarea?(r.window=r._createContentElement(r.options.stylesheets),n=r.document=r.window.contentDocument||r.window.document,r.body=n.body,e(r.window).on("blur"+f,function(){var e=r.textarea.val(),t=r.encodedValue();r.update(),t!=e&&r.trigger("change")}),e(n).on("mouseup"+f,c(r._mouseup,r))):(r.window=window,n=r.document=document,r.body=r.element[0],o=r.toolbar.items().filter(".k-decorated"),o.kendoSelectBox("decorate",n));try{n.execCommand("enableObjectResizing",!1,"false"),n.execCommand("enableInlineTableEditing",null,!1)}catch(a){}i.support.touch&&e(n).on("selectionchange"+f,function(){r._selectionChange()}),e(r.body).on("keydown"+f,function(e){var n,o,a,s,d,u,f,m,h;return e.keyCode===p.F10?(setTimeout(c(r.toolbar.focus,r.toolbar),100),e.preventDefault(),t):(e.keyCode===p.BACKSPACE?(n=r.getRange(),a=l.msie?"":'<br _moz_dirty="" />',s=i.ui.editor.Dom,n.deleteContents(),o=n.commonAncestorContainer,"p"===s.name(o)&&""===o.innerHTML&&(o.innerHTML=a,n.setStart(o,0),n.collapse(!0),r.selectRange(n))):(e.keyCode==p.LEFT||e.keyCode==p.RIGHT)&&(n=r.getRange(),d=e.keyCode==p.LEFT,u=n[d?"startContainer":"endContainer"],f=n[d?"startOffset":"endOffset"],m=d?-1:1,d&&(f-=1),f+m>0&&3==u.nodeType&&""==u.nodeValue[f]&&(n.setStart(u,f+m),n.collapse(!0),r.selectRange(n))),(h=r.keyboard.toolFromShortcut(r.toolbar.tools,e))?(e.preventDefault(),/undo|redo/.test(h)||r.keyboard.endTyping(!0),r.trigger("keydown",e),r.exec(h),!1):(r.keyboard.clearTimeout(),r.keyboard.keydown(e),t))}).on("keyup"+f,function(t){var n=[8,9,33,34,35,36,37,38,39,40,40,45,46];(e.inArray(t.keyCode,n)>-1||65==t.keyCode&&t.ctrlKey&&!t.altKey&&!t.shiftKey)&&r._selectionChange(),r.keyboard.keyup(t)}).on("mousedown"+f,function(t){r._selectionStarted=!0;var n=e(t.target);!l.gecko&&2==t.which&&n.is("a[href]")&&window.open(n.attr("href"),"_new")}).on("click"+f,function(e){var t,n=i.ui.editor.Dom;"img"===n.name(e.target)&&(t=r.createRange(),t.selectNode(e.target),r.selectRange(t))}).on("cut"+f+" paste"+f,function(e){r.clipboard["on"+e.type](e)}).on("focusin"+f,function(){e(this).addClass("k-state-active"),r.toolbar.show()}).on("focusout"+f,function(){setTimeout(function(){var t=i._activeElement(),n=r.body,o=r.toolbar;t==n||e.contains(n,t)||o.focused()||(e(n).removeClass("k-state-active"),o.hide())},10)})},_mouseup:function(){var e=this;e._selectionStarted&&setTimeout(function(){e._selectionChange()},1)},refresh:function(){var e=this;e.textarea.val(e.value()),e.wrapper.find("iframe").remove(),e._initializeContentElement(e),e.value(e.textarea.val())},events:["select","change","execute","error","paste","keydown","keyup"],options:{name:"Editor",messages:g,formats:{},encoded:!0,stylesheets:[],dialogOptions:{modal:!0,resizable:!1,draggable:!0,animation:!1},fontName:[{text:"Arial",value:"Arial,Helvetica,sans-serif"},{text:"Courier New",value:"'Courier New',Courier,monospace"},{text:"Georgia",value:"Georgia,serif"},{text:"Impact",value:"Impact,Charcoal,sans-serif"},{text:"Lucida Console",value:"'Lucida Console',Monaco,monospace"},{text:"Tahoma",value:"Tahoma,Geneva,sans-serif"},{text:"Times New Roman",value:"'Times New Roman',Times,serif"},{text:"Trebuchet MS",value:"'Trebuchet MS',Helvetica,sans-serif"},{text:"Verdana",value:"Verdana,Geneva,sans-serif"}],fontSize:[{text:"1 (8pt)",value:"xx-small"},{text:"2 (10pt)",value:"x-small"},{text:"3 (12pt)",value:"small"},{text:"4 (14pt)",value:"medium"},{text:"5 (18pt)",value:"large"},{text:"6 (24pt)",value:"x-large"},{text:"7 (36pt)",value:"xx-large"}],formatBlock:[{text:"Paragraph",value:"p"},{text:"Quotation",value:"blockquote"},{text:"Heading 1",value:"h1"},{text:"Heading 2",value:"h2"},{text:"Heading 3",value:"h3"},{text:"Heading 4",value:"h4"},{text:"Heading 5",value:"h5"},{text:"Heading 6",value:"h6"}],tools:[].concat.call(["formatting"],b.basic,b.alignment,b.lists,b.indenting,b.links,["insertImage"],b.tables)},destroy:function(){var t=this;a.fn.destroy.call(t),e(t.window).add(t.document).add(t.body).add(t.wrapper).add(t.element.closest("form")).off(f),e(document).off("mousedown",c(t._endTyping,t)).off("mouseup",c(t._mouseup,t)),i.destroy(t.wrapper)},value:function(n){var o,r,a,s=this.body,d=i.ui.editor,c=d.Dom,u=d.Serializer.domToXhtml(s);return n===t?u:(n!=u&&(o=/onerror\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/i,n=(n||"").replace(/<!\[CDATA\[(.*)?\]\]>/g,"<!--[CDATA[$1]]-->").replace(/<script([^>]*)>(.*)?<\/script>/gi,"<telerik:script $1>$2</telerik:script>").replace(/<img([^>]*)>/gi,function(e){return e.replace(o,"")}).replace(/(<\/?img[^>]*>)[\r\n\v\f\t ]+/gi,"$1").replace(/<p([^>]*)>(\s*)?<\/p>/gi,"<p$1>"+d.emptyElementContent+"</p>"),l.msie&&l.version<9?(n="<br/>"+n,r="originalsrc",a="originalhref",n=n.replace(/href\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,a+'="$1"'),n=n.replace(/src\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,r+'="$1"'),s.innerHTML=n,c.remove(s.firstChild),e(s).find("telerik\\:script,script,link,img,a").each(function(){var e=this;e[a]&&(e.setAttribute("href",e[a]),e.removeAttribute(a)),e[r]&&(e.setAttribute("src",e[r]),e.removeAttribute(r))})):(s.innerHTML=n,l.msie&&(c.normalize(s),setTimeout(function(){var e,t,n,o=s.getElementsByTagName("ol");for(e=0;e<o.length;e++)t=o[e],n=t.getAttribute("start"),t.setAttribute("start",1),n?t.setAttribute("start",n):t.removeAttribute(n)},1))),e("table",this.body).addClass("k-table"),this.selectionRestorePoint=null,this.update()),t)},saveSelection:function(t){t=t||this.getRange();var n=t.commonAncestorContainer,o=this.body;(n==o||e.contains(o,n))&&(this.selectionRestorePoint=new i.ui.editor.RestorePoint(t))},_focusBody:function(){var e=this.body;i._activeElement()!=e&&e.focus()},restoreSelection:function(){this._focusBody(),this.selectionRestorePoint&&this.selectRange(this.selectionRestorePoint.toRange())},focus:function(){this.restoreSelection()},update:function(e){this.textarea&&this.textarea.val(e||this.options.encoded?this.encodedValue():this.value())},encodedValue:function(){return i.ui.editor.Dom.encode(this.value())},createRange:function(e){return i.ui.editor.RangeUtils.createRange(e||this.document)},getSelection:function(){return i.ui.editor.SelectionUtils.selectionFromDocument(this.document)},selectRange:function(e){this._focusBody();var t=this.getSelection();t.removeAllRanges(),t.addRange(e),this.saveSelection(e)},getRange:function(){var e=this.getSelection(),t=e.rangeCount>0?e.getRangeAt(0):this.createRange(),n=this.document;return t.startContainer!=n||t.endContainer!=n||t.startOffset||t.endOffset||(t.setStart(this.body,0),t.collapse(!0)),t},selectedHtml:function(){return i.ui.editor.Serializer.domToXhtml(this.getRange().cloneContents())},paste:function(e){this.clipboard.paste(e)},exec:function(e,n){var o,i,r,a=this,s=null;if(!e)throw Error("kendoEditor.exec(): `name` parameter cannot be empty");if(e=e.toLowerCase(),a.keyboard.isTypingInProgress()||a.restoreSelection(),i=a.toolbar.toolById(e),!i)for(r in k.defaultTools)if(r.toLowerCase()==e){i=k.defaultTools[r];break}if(i){if(o=a.getRange(),i.command&&(s=i.command(d({range:o},n))),a.trigger("execute",{name:e,command:s}),/undo|redo/i.test(e))a.undoRedoStack[e]();else if(s&&(s.managesUndoRedo||a.undoRedoStack.push(s),s.editor=a,s.exec(),s.async))return s.change=c(a._selectionChange,a),t;a._selectionChange()}}});k.defaultTools={undo:{options:{key:"Z",ctrl:!0}},redo:{options:{key:"Y",ctrl:!0}}},i.ui.plugin(k),n=r.extend({init:function(e){this.options=e},initialize:function(e,t){e.attr({unselectable:"on",title:t.title})},command:function(e){return new this.options.command(e)},update:e.noop}),n.exec=function(e,t,n){e.exec(t,{value:n})},o=n.extend({init:function(e){n.fn.init.call(this,e)},command:function(e){var t=this;return new i.ui.editor.FormatCommand(d(e,{formatter:t.options.formatter}))},update:function(e,t){var n=this.options.finder.isFormatted(t);e.toggleClass("k-state-selected",n),e.attr("aria-pressed",n)}}),h.registerTool("separator",new n({template:new m({template:h.separatorTemplate})})),d(i.ui,{editor:{ToolTemplate:m,EditorUtils:h,Tool:n,FormatTool:o,_bomFill:l.msie&&l.version<9?"":"",emptyElementContent:l.msie?l.version<9?"":"":'<br _moz_dirty="" />'}})}(window.jQuery),function(e){function t(e){var t,n,o={};for(t=0,n=e.length;n>t;t++)o[e[t]]=!0;return o}var n,o,i,r,a,s,l,d,c=window.kendo,u=e.map,f=e.extend,p=c.support.browser,m="style",h="float",g="cssFloat",v="styleFloat",b="class",y="k-marker",k=t("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed".split(",")),w="div,p,h1,h2,h3,h4,h5,h6,address,applet,blockquote,button,center,dd,dir,dl,dt,fieldset,form,frameset,hr,iframe,isindex,li,map,menu,noframes,noscript,object,ol,pre,script,table,tbody,td,tfoot,th,thead,tr,ul,header,article,nav,footer,section,aside,main,figure,figcaption".split(","),C=t(w),x="span,em,a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,strike,strong,sub,sup,textarea,tt,u,var,data,time,mark,ruby".split(","),T=t(x),S=t("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected".split(",")),N=function(e){1==e.nodeType&&e.normalize()};p.msie&&p.version>=8&&(N=function(e){if(1==e.nodeType&&e.firstChild)for(var t=e.firstChild,n=t;;){if(n=n.nextSibling,!n)break;3==n.nodeType&&3==t.nodeType&&(n.nodeValue=t.nodeValue+n.nodeValue,d.remove(t)),t=n}}),o=/^\s+$/,i=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,r=/\ufeff/g,a="color,padding-left,padding-right,padding-top,padding-bottom,background-color,background-attachment,background-image,background-position,background-repeat,border-top-style,border-top-width,border-top-color,border-bottom-style,border-bottom-width,border-bottom-color,border-left-style,border-left-width,border-left-color,border-right-style,border-right-width,border-right-color,font-family,font-size,font-style,font-variant,font-weight,line-height".split(","),s=/[\u00A0-\u2666<>\&]/g,l={34:"quot",38:"amp",39:"apos",60:"lt",62:"gt",160:"nbsp",161:"iexcl",162:"cent",163:"pound",164:"curren",165:"yen",166:"brvbar",167:"sect",168:"uml",169:"copy",170:"ordf",171:"laquo",172:"not",173:"shy",174:"reg",175:"macr",176:"deg",177:"plusmn",178:"sup2",179:"sup3",180:"acute",181:"micro",182:"para",183:"middot",184:"cedil",185:"sup1",186:"ordm",187:"raquo",188:"frac14",189:"frac12",190:"frac34",191:"iquest",192:"Agrave",193:"Aacute",194:"Acirc",195:"Atilde",196:"Auml",197:"Aring",198:"AElig",199:"Ccedil",200:"Egrave",201:"Eacute",202:"Ecirc",203:"Euml",204:"Igrave",205:"Iacute",206:"Icirc",207:"Iuml",208:"ETH",209:"Ntilde",210:"Ograve",211:"Oacute",212:"Ocirc",213:"Otilde",214:"Ouml",215:"times",216:"Oslash",217:"Ugrave",218:"Uacute",219:"Ucirc",220:"Uuml",221:"Yacute",222:"THORN",223:"szlig",224:"agrave",225:"aacute",226:"acirc",227:"atilde",228:"auml",229:"aring",230:"aelig",231:"ccedil",232:"egrave",233:"eacute",234:"ecirc",235:"euml",236:"igrave",237:"iacute",238:"icirc",239:"iuml",240:"eth",241:"ntilde",242:"ograve",243:"oacute",244:"ocirc",245:"otilde",246:"ouml",247:"divide",248:"oslash",249:"ugrave",250:"uacute",251:"ucirc",252:"uuml",253:"yacute",254:"thorn",255:"yuml",402:"fnof",913:"Alpha",914:"Beta",915:"Gamma",916:"Delta",917:"Epsilon",918:"Zeta",919:"Eta",920:"Theta",921:"Iota",922:"Kappa",923:"Lambda",924:"Mu",925:"Nu",926:"Xi",927:"Omicron",928:"Pi",929:"Rho",931:"Sigma",932:"Tau",933:"Upsilon",934:"Phi",935:"Chi",936:"Psi",937:"Omega",945:"alpha",946:"beta",947:"gamma",948:"delta",949:"epsilon",950:"zeta",951:"eta",952:"theta",953:"iota",954:"kappa",955:"lambda",956:"mu",957:"nu",958:"xi",959:"omicron",960:"pi",961:"rho",962:"sigmaf",963:"sigma",964:"tau",965:"upsilon",966:"phi",967:"chi",968:"psi",969:"omega",977:"thetasym",978:"upsih",982:"piv",8226:"bull",8230:"hellip",8242:"prime",8243:"Prime",8254:"oline",8260:"frasl",8472:"weierp",8465:"image",8476:"real",8482:"trade",8501:"alefsym",8592:"larr",8593:"uarr",8594:"rarr",8595:"darr",8596:"harr",8629:"crarr",8656:"lArr",8657:"uArr",8658:"rArr",8659:"dArr",8660:"hArr",8704:"forall",8706:"part",8707:"exist",8709:"empty",8711:"nabla",8712:"isin",8713:"notin",8715:"ni",8719:"prod",8721:"sum",8722:"minus",8727:"lowast",8730:"radic",8733:"prop",8734:"infin",8736:"ang",8743:"and",8744:"or",8745:"cap",8746:"cup",8747:"int",8756:"there4",8764:"sim",8773:"cong",8776:"asymp",8800:"ne",8801:"equiv",8804:"le",8805:"ge",8834:"sub",8835:"sup",8836:"nsub",8838:"sube",8839:"supe",8853:"oplus",8855:"otimes",8869:"perp",8901:"sdot",8968:"lceil",8969:"rceil",8970:"lfloor",8971:"rfloor",9001:"lang",9002:"rang",9674:"loz",9824:"spades",9827:"clubs",9829:"hearts",9830:"diams",338:"OElig",339:"oelig",352:"Scaron",353:"scaron",376:"Yuml",710:"circ",732:"tilde",8194:"ensp",8195:"emsp",8201:"thinsp",8204:"zwnj",8205:"zwj",8206:"lrm",8207:"rlm",8211:"ndash",8212:"mdash",8216:"lsquo",8217:"rsquo",8218:"sbquo",8220:"ldquo",8221:"rdquo",8222:"bdquo",8224:"dagger",8225:"Dagger",8240:"permil",8249:"lsaquo",8250:"rsaquo",8364:"euro"},d={findNodeIndex:function(e,t){for(var n=0;;){if(e=e.previousSibling,!e)break;t&&3==e.nodeType||n++}return n},isDataNode:function(e){return e&&null!==e.nodeValue&&null!==e.data},isAncestorOf:function(t,n){try{return!d.isDataNode(t)&&(e.contains(t,d.isDataNode(n)?n.parentNode:n)||n.parentNode==t)}catch(o){return!1}},isAncestorOrSelf:function(e,t){return d.isAncestorOf(e,t)||e==t},findClosestAncestor:function(e,t){if(d.isAncestorOf(e,t))for(;t&&t.parentNode!=e;)t=t.parentNode;return t},getNodeLength:function(e){return d.isDataNode(e)?e.length:e.childNodes.length},splitDataNode:function(e,t){for(var n=e.cloneNode(!1),o="",i=e;i.nextSibling&&3==i.nextSibling.nodeType&&i.nextSibling.nodeValue;)o+=i.nextSibling.nodeValue,i=i.nextSibling;e.deleteData(t,e.length),n.deleteData(0,t),n.nodeValue+=o,d.insertAfter(n,e)},attrEquals:function(t,n){var o,i;for(o in n)if(i=t[o],o==h&&(i=t[e.support.cssFloat?g:v]),"object"==typeof i){if(!d.attrEquals(i,n[o]))return!1}else if(i!=n[o])return!1;return!0},blockParentOrBody:function(e){return d.parentOfType(e,w)||e.ownerDocument.body},blockParents:function(t){var n,o,i,r=[];for(n=0,o=t.length;o>n;n++)i=d.parentOfType(t[n],d.blockElements),i&&e.inArray(i,r)<0&&r.push(i);return r},windowFromDocument:function(e){return e.defaultView||e.parentWindow},normalize:N,blockElements:w,inlineElements:x,empty:k,fillAttrs:S,toHex:function(e){var t=i.exec(e);return t?"#"+u(t.slice(1),function(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}).join(""):e},encode:function(e){return e.replace(s,function(e){var t=e.charCodeAt(0),n=l[t];return n?"&"+n+";":e})},stripBom:function(e){return e.replace(r,"")},name:function(e){return e.nodeName.toLowerCase()},significantChildNodes:function(t){return e.grep(t.childNodes,function(e){return 3!=e.nodeType||!d.isWhitespace(e)})},lastTextNode:function(e){var t,n=null;if(3==e.nodeType)return e;for(t=e.lastChild;t;t=t.previousSibling)if(n=d.lastTextNode(t))return n;return n},is:function(e,t){return d.name(e)==t},isMarker:function(e){return e.className==y},isWhitespace:function(e){return o.test(e.nodeValue)},isBlock:function(e){return C[d.name(e)]},isEmpty:function(e){return k[d.name(e)]},isInline:function(e){return T[d.name(e)]},scrollContainer:function(e){var t=d.windowFromDocument(e),n=(t.contentWindow||t).document||t.ownerDocument||t;return n=c.support.browser.webkit||"BackCompat"==n.compatMode?n.body:n.documentElement},scrollTo:function(t){var n,o,i=e(d.isDataNode(t)?t.parentNode:t),r=d.windowFromDocument(t.ownerDocument),a=r.innerHeight,s=d.scrollContainer(t.ownerDocument);"br"==d.name(i[0])&&(i=i.parent()),n=i.offset().top,o=i[0].offsetHeight,o+n>s.scrollTop+a&&(s.scrollTop=o+n-a)},persistScrollTop:function(e){n=d.scrollContainer(e).scrollTop},restoreScrollTop:function(e){d.scrollContainer(e).scrollTop=n},insertAt:function(e,t,n){e.insertBefore(t,e.childNodes[n]||null)},insertBefore:function(e,t){return t.parentNode?t.parentNode.insertBefore(e,t):t},insertAfter:function(e,t){return t.parentNode.insertBefore(e,t.nextSibling)},remove:function(e){e.parentNode.removeChild(e)},removeTextSiblings:function(e){for(var t=e.parentNode;e.nextSibling&&3==e.nextSibling.nodeType;)t.removeChild(e.nextSibling);for(;e.previousSibling&&3==e.previousSibling.nodeType;)t.removeChild(e.previousSibling)},trim:function(e){var t,n;for(t=e.childNodes.length-1;t>=0;t--)n=e.childNodes[t],d.isDataNode(n)?(d.stripBom(n.nodeValue).length||d.remove(n),d.isWhitespace(n)&&d.insertBefore(n,e)):n.className!=y&&(d.trim(n),n.childNodes.length||d.isEmpty(n)||d.remove(n));return e},closest:function(e,t){for(;e&&d.name(e)!=t;)e=e.parentNode;return e},sibling:function(e,t){do e=e[t];while(e&&1!=e.nodeType);return e},next:function(e){return d.sibling(e,"nextSibling")},prev:function(e){return d.sibling(e,"previousSibling")},parentOfType:function(e,t){do e=e.parentNode;while(e&&!d.ofType(e,t));return e},ofType:function(t,n){return e.inArray(d.name(t),n)>=0},changeTag:function(e,t){var n,o,i,r,a,s=d.create(e.ownerDocument,t),l=e.attributes;for(n=0,o=l.length;o>n;n++)a=l[n],a.specified&&(i=a.nodeName,r=a.nodeValue,i==b?s.className=r:i==m?s.style.cssText=e.style.cssText:s.setAttribute(i,r));for(;e.firstChild;)s.appendChild(e.firstChild);return d.insertBefore(s,e),d.remove(e),s},wrap:function(e,t){return d.insertBefore(t,e),t.appendChild(e),t},unwrap:function(e){for(var t=e.parentNode;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)},create:function(e,t,n){return d.attr(e.createElement(t),n)},attr:function(e,t){t=f({},t),t&&m in t&&(d.style(e,t.style),delete t.style);for(var n in t)null===t[n]?(e.removeAttribute(n),delete t[n]):"className"==n&&(e[n]=t[n]);return f(e,t)},style:function(t,n){e(t).css(n||{})},unstyle:function(t,n){for(var o in n)o==h&&(o=e.support.cssFloat?g:v),t.style[o]="";""===t.style.cssText&&t.removeAttribute(m)},inlineStyle:function(t,n,o){var i,r=e(d.create(t,n,o));return t.body.appendChild(r[0]),i=u(a,function(e){return p.msie&&"line-height"==e&&"1px"==r.css(e)?"line-height:1.5":e+":"+r.css(e)}).join(";"),r.remove(),i},removeClass:function(t,n){var o,i,r=" "+t.className+" ",a=n.split(" ");for(o=0,i=a.length;i>o;o++)r=r.replace(" "+a[o]+" "," ");r=e.trim(r),r.length?t.className=r:t.removeAttribute(b)},commonAncestor:function(){var e,t,n,o,i,r=arguments.length,a=[],s=1/0,l=null;if(!r)return null;if(1==r)return arguments[0];for(e=0;r>e;e++){for(t=[],n=arguments[e];n;)t.push(n),n=n.parentNode;a.push(t.reverse()),s=Math.min(s,t.length)}if(1==r)return a[0][0];for(e=0;s>e;e++){for(o=a[0][e],i=1;r>i;i++)if(o!=a[i][e])return l;l=o}return l},closestSplittableParent:function(e){var t;return t=1==e.length?d.parentOfType(e[0],["ul","ol"]):d.commonAncestor.apply(null,e),t||(t=d.parentOfType(e[0],["p","td"])||e[0].ownerDocument.body),d.isInline(t)&&(t=d.blockParentOrBody(t)),t}},c.ui.editor.Dom=d}(window.kendo.jQuery),function(e,t){var n=window.kendo,o=n.ui.editor,i=o.Dom,r=e.extend,a="xx-small,x-small,small,medium,large,x-large,xx-large".split(","),s=/"/g,l=/<br[^>]*>/i,d=/<p><\/p>/i,c=/([\w|\-]+)\s*:\s*([^;]+);?/i,u={domToXhtml:function(n){function o(n){var o,r,a,l,d,u,f,m,h,g,v,b,y,k,w,C,x=[],T=n.attributes,S=e.trim;for(i.is(n,"img")&&(l=n.style.width,d=n.style.height,u=e(n),l&&(u.attr("width",parseInt(l,10)),i.unstyle(n,{width:t})),d&&(u.attr("height",parseInt(d,10)),i.unstyle(n,{height:t}))),r=0,a=T.length;a>r;r++)o=T[r],f=o.nodeName,("class"!=f||o.nodeValue)&&(o.specified||"value"==f&&!n.value||"type"==f&&"text"==o.nodeValue)&&f.indexOf("_moz")<0&&"complete"!=f&&"altHtml"!=f&&x.push(o);if(x.length)for(x.sort(function(e,t){return e.nodeName>t.nodeName?1:e.nodeName<t.nodeName?-1:0}),r=0,a=x.length;a>r;r++)if(o=x[r],m=o.nodeName,h=o.nodeValue,!("contenteditable"==m.toLowerCase()&&(i.is(n,"table")||i.is(n,"td"))||"class"==m&&"k-table"==h)){if(p.push(" "),p.push(m),p.push('="'),"style"==m){for(g=S(h||n.style.cssText).split(";"),v=0,b=g.length;b>v;v++)if(y=g[v],y.length){if(k=c.exec(y),!k)continue;if(w=S(k[1].toLowerCase()),C=S(k[2]),"font-size-adjust"==w||"font-stretch"==w)continue;w.indexOf("color")>=0?C=i.toHex(C):w.indexOf("font")>=0?C=C.replace(s,"'"):/\burl\(/g.test(C)&&(C=C.replace(s,"")),p.push(w),p.push(":"),p.push(C),p.push(";")}}else"src"==m||"href"==m?p.push(n.getAttribute(m,2)):p.push(i.fillAttrs[m]?m:h);p.push('"')}}function r(e,t){for(var n=e.firstChild;n;n=n.nextSibling)f(n,t)}function u(e){return e.nodeValue.replace(/\ufeff/g,"")}function f(n,a){var s,l,d,c,f,h=n.nodeType;if(1==h){if(s=i.name(n),!s||(n.attributes._moz_dirty||n.attributes._moz_editor_bogus_node)&&i.is(n,"br")||"k-marker"==n.className)return;if(i.isInline(n)&&1==n.childNodes.length&&3==n.firstChild.nodeType&&!u(n.firstChild))return;if(l=m[s])return l.start(n),r(n),l.end(n),t;p.push("<"),p.push(s),o(n),i.empty[s]?p.push(" />"):(p.push(">"),r(n,a||i.is(n,"pre")),p.push("</"),p.push(s),p.push(">"))}else 3==h?(c=u(n),!a&&e.support.leadingWhitespace&&(d=n.parentNode,f=n.previousSibling,f||(f=(i.isInline(d)?d:n).previousSibling),(!f||""===f.innerHTML||i.isBlock(f))&&(c=c.replace(/^[\r\n\v\f\t ]+/,"")),c=c.replace(/ +/," ")),p.push(i.encode(c))):4==h?(p.push("<![CDATA["),p.push(n.data),p.push("]]>")):8==h&&(n.data.indexOf("[CDATA[")<0?(p.push("<!--"),p.push(n.data),p.push("-->")):(p.push("<!"),p.push(n.data),p.push(">")))}var p=[],m={"telerik:script":{start:function(e){p.push("<script"),o(e),p.push(">")},end:function(){p.push("</script>")}},b:{start:function(){p.push("<strong>")},end:function(){p.push("</strong>")}},i:{start:function(){p.push("<em>")},end:function(){p.push("</em>")}},u:{start:function(){p.push('<span style="text-decoration:underline;">')},end:function(){p.push("</span>")}},iframe:{start:function(e){p.push("<iframe"),o(e),p.push(">")},end:function(){p.push("</iframe>")}},font:{start:function(e){var t,n,o;p.push('<span style="'),t=e.getAttribute("color"),n=a[e.getAttribute("size")],o=e.getAttribute("face"),t&&(p.push("color:"),p.push(i.toHex(t)),p.push(";")),o&&(p.push("font-face:"),p.push(o),p.push(";")),n&&(p.push("font-size:"),p.push(n),p.push(";")),p.push('">')},end:function(){p.push("</span>")}}};return 1==n.childNodes.length&&3==n.firstChild.nodeType?i.encode(u(n.firstChild).replace(/[\r\n\v\f\t ]+/," ")):(r(n),p=p.join(""),""===p.replace(l,"").replace(d,"")?"":p)}};r(o,{Serializer:u})}(window.kendo.jQuery),function(e){function t(e,t,n,o){var i,r,a,s;if(e==t)return o-n;for(i=t;i&&i.parentNode!=e;)i=i.parentNode;if(i)return p(i)-n;for(i=e;i&&i.parentNode!=t;)i=i.parentNode;if(i)return o-p(i)-1;for(r=f.commonAncestor(e,t),a=e;a&&a.parentNode!=r;)a=a.parentNode;for(a||(a=r),s=t;s&&s.parentNode!=r;)s=s.parentNode;return s||(s=r),a==s?0:p(s)-p(a)}function n(e,n){function o(e){try{return t(e.startContainer,e.endContainer,e.startOffset,e.endOffset)<0}catch(n){return!0}}o(e)&&(n?(e.commonAncestorContainer=e.endContainer=e.startContainer,e.endOffset=e.startOffset):(e.commonAncestorContainer=e.startContainer=e.endContainer,e.startOffset=e.endOffset),e.collapsed=!0)}function o(e){e.collapsed=e.startContainer==e.endContainer&&e.startOffset==e.endOffset;for(var t=e.startContainer;t&&t!=e.endContainer&&!f.isAncestorOf(t,e.endContainer);)t=t.parentNode;e.commonAncestorContainer=t}function i(e){var t=e.duplicate(),n=e.duplicate();return t.collapse(!0),n.collapse(!1),f.commonAncestor(e.parentElement(),t.parentElement(),n.parentElement())}function r(e,t,n){var o,i=t[n?"startContainer":"endContainer"],r=t[n?"startOffset":"endOffset"],a=0,s=m(i),l=s?i:i.childNodes[r]||null,d=s?i.parentNode:i,c=t.ownerDocument,u=c.body.createTextRange();(3==i.nodeType||4==i.nodeType)&&(a=r),d||(d=c.body),"img"==d.nodeName.toLowerCase()?(u.moveToElementText(d),u.collapse(!1),e.setEndPoint(n?"StartToStart":"EndToStart",u)):(o=d.insertBefore(f.create(c,"a"),l),u.moveToElementText(o),f.remove(o),u[n?"moveStart":"moveEnd"]("character",a),u.collapse(!1),e.setEndPoint(n?"StartToStart":"EndToStart",u))}function a(e,t,n,o){var i,r,a,s,l,d,c,u=f.create(t.ownerDocument,"a"),h=e.duplicate(),g=o?"StartToStart":"StartToEnd";u.innerHTML="",h.collapse(o),r=h.parentElement(),f.isAncestorOrSelf(n,r)||(r=n);do r.insertBefore(u,u.previousSibling),h.moveToElementText(u);while((i=h.compareEndPoints(g,e))>0&&u.previousSibling);a=u.nextSibling,-1==i&&m(a)?(h.setEndPoint(o?"EndToStart":"EndToEnd",e),f.remove(u),d=[a,h.text.length]):(s=!o&&u.previousSibling,l=o&&u.nextSibling,m(l)?d=[l,0]:m(s)?d=[s,s.length]:(c=p(u),d=r.nextSibling&&c==r.childNodes.length-1?[r.nextSibling,0]:[r,c]),f.remove(u)),t[o?"setStart":"setEnd"].apply(t,d)}var s=window.kendo,l=s.Class,d=e.extend,c=s.ui.editor,u=s.support.browser,f=c.Dom,p=f.findNodeIndex,m=f.isDataNode,h=f.findClosestAncestor,g=f.getNodeLength,v=f.normalize,b={selectionFromWindow:function(e){return"getSelection"in e?e.getSelection():new w(e.document)},selectionFromRange:function(e){var t=N.documentFromRange(e);return b.selectionFromDocument(t)},selectionFromDocument:function(e){return b.selectionFromWindow(f.windowFromDocument(e))}},y=l.extend({init:function(t){e.extend(this,{ownerDocument:t,startContainer:t,endContainer:t,commonAncestorContainer:t,startOffset:0,endOffset:0,collapsed:!0})},setStart:function(e,t){this.startContainer=e,this.startOffset=t,o(this),n(this,!0)},setEnd:function(e,t){this.endContainer=e,this.endOffset=t,o(this),n(this,!1)
+},setStartBefore:function(e){this.setStart(e.parentNode,p(e))},setStartAfter:function(e){this.setStart(e.parentNode,p(e)+1)},setEndBefore:function(e){this.setEnd(e.parentNode,p(e))},setEndAfter:function(e){this.setEnd(e.parentNode,p(e)+1)},selectNode:function(e){this.setStartBefore(e),this.setEndAfter(e)},selectNodeContents:function(e){this.setStart(e,0),this.setEnd(e,e[1===e.nodeType?"childNodes":"nodeValue"].length)},collapse:function(e){var t=this;e?t.setEnd(t.startContainer,t.startOffset):t.setStart(t.endContainer,t.endOffset)},deleteContents:function(){var e=this,t=e.cloneRange();e.startContainer!=e.commonAncestorContainer&&e.setStartAfter(h(e.commonAncestorContainer,e.startContainer)),e.collapse(!0),function n(e){for(;e.next();)e.hasPartialSubtree()?n(e.getSubtreeIterator()):e.remove()}(new k(t))},cloneContents:function(){var e=N.documentFromRange(this);return function t(n){for(var o,i=e.createDocumentFragment();o=n.next();)o=o.cloneNode(!n.hasPartialSubtree()),n.hasPartialSubtree()&&o.appendChild(t(n.getSubtreeIterator())),i.appendChild(o);return i}(new k(this))},extractContents:function(){var e,t=this,n=t.cloneRange();return t.startContainer!=t.commonAncestorContainer&&t.setStartAfter(h(t.commonAncestorContainer,t.startContainer)),t.collapse(!0),e=N.documentFromRange(t),function o(n){for(var i,r=e.createDocumentFragment();i=n.next();)n.hasPartialSubtree()?(i=i.cloneNode(!1),i.appendChild(o(n.getSubtreeIterator()))):n.remove(t.originalRange),r.appendChild(i);return r}(new k(n))},insertNode:function(e){var t=this;m(t.startContainer)?(t.startOffset!=t.startContainer.nodeValue.length&&f.splitDataNode(t.startContainer,t.startOffset),f.insertAfter(e,t.startContainer)):f.insertAt(t.startContainer,e,t.startOffset),t.setStart(t.startContainer,t.startOffset)},cloneRange:function(){return e.extend(new y(this.ownerDocument),{startContainer:this.startContainer,endContainer:this.endContainer,commonAncestorContainer:this.commonAncestorContainer,startOffset:this.startOffset,endOffset:this.endOffset,collapsed:this.collapsed,originalRange:this})},toString:function(){var e=this.startContainer.nodeName,t=this.endContainer.nodeName;return["#text"==e?this.startContainer.nodeValue:e,"(",this.startOffset,") : ","#text"==t?this.endContainer.nodeValue:t,"(",this.endOffset,")"].join("")}}),k=l.extend({init:function(t){if(e.extend(this,{range:t,_current:null,_next:null,_end:null}),!t.collapsed){var n=t.commonAncestorContainer;this._next=t.startContainer!=n||m(t.startContainer)?h(n,t.startContainer):t.startContainer.childNodes[t.startOffset],this._end=t.endContainer!=n||m(t.endContainer)?h(n,t.endContainer).nextSibling:t.endContainer.childNodes[t.endOffset]}},hasNext:function(){return!!this._next},next:function(){var e=this,t=e._current=e._next;return e._next=e._current&&e._current.nextSibling!=e._end?e._current.nextSibling:null,m(e._current)&&(e.range.endContainer==e._current&&(t=t.cloneNode(!0),t.deleteData(e.range.endOffset,t.length-e.range.endOffset)),e.range.startContainer==e._current&&(t=t.cloneNode(!0),t.deleteData(0,e.range.startOffset))),t},traverse:function(e){function t(){return o._current=o._next,o._next=o._current&&o._current.nextSibling!=o._end?o._current.nextSibling:null,o._current}for(var n,o=this;n=t();)o.hasPartialSubtree()?o.getSubtreeIterator().traverse(e):e(n);return n},remove:function(e){var t,n,o,i,r,a=this,s=a.range.startContainer==a._current,l=a.range.endContainer==a._current;m(a._current)&&(s||l)?(t=s?a.range.startOffset:0,n=l?a.range.endOffset:a._current.length,o=n-t,e&&(s||l)&&(a._current==e.startContainer&&t<=e.startOffset&&(e.startOffset-=o),a._current==e.endContainer&&n<=e.endOffset&&(e.endOffset-=o)),a._current.deleteData(t,o)):(i=a._current.parentNode,!e||a.range.startContainer!=i&&a.range.endContainer!=i||(r=p(a._current),i==e.startContainer&&r<=e.startOffset&&(e.startOffset-=1),i==e.endContainer&&r<e.endOffset&&(e.endOffset-=1)),f.remove(a._current))},hasPartialSubtree:function(){return!m(this._current)&&(f.isAncestorOrSelf(this._current,this.range.startContainer)||f.isAncestorOrSelf(this._current,this.range.endContainer))},getSubtreeIterator:function(){var e=this,t=e.range.cloneRange();return t.selectNodeContents(e._current),f.isAncestorOrSelf(e._current,e.range.startContainer)&&t.setStart(e.range.startContainer,e.range.startOffset),f.isAncestorOrSelf(e._current,e.range.endContainer)&&t.setEnd(e.range.endContainer,e.range.endOffset),new k(t)}}),w=l.extend({init:function(e){this.ownerDocument=e,this.rangeCount=1},addRange:function(e){var t=this.ownerDocument.body.createTextRange();r(t,e,!1),r(t,e,!0),t.select()},removeAllRanges:function(){this.ownerDocument.selection.empty()},getRangeAt:function(){var e,t,n,o,r,s,l,d,c=new y(this.ownerDocument),u=this.ownerDocument.selection;try{if(e=u.createRange(),t=e.item?e.item(0):e.parentElement(),t.ownerDocument!=this.ownerDocument)return c}catch(f){return c}if("Control"==u.type)c.selectNode(e.item(0));else if(n=i(e),a(e,c,n,!0),a(e,c,n,!1),9==c.startContainer.nodeType&&c.setStart(c.endContainer,c.startOffset),9==c.endContainer.nodeType&&c.setEnd(c.startContainer,c.endOffset),0===e.compareEndPoints("StartToEnd",e)&&c.collapse(!1),o=c.startContainer,r=c.endContainer,s=this.ownerDocument.body,!(c.collapsed||0!==c.startOffset||c.endOffset!=g(c.endContainer)||o==r&&m(o)&&o.parentNode==s)){for(l=!1,d=!1;0===p(o)&&o==o.parentNode.firstChild&&o!=s;)o=o.parentNode,l=!0;for(;p(r)==g(r.parentNode)-1&&r==r.parentNode.lastChild&&r!=s;)r=r.parentNode,d=!0;o==s&&r==s&&l&&d&&(c.setStart(o,0),c.setEnd(r,g(s)))}return c}}),C=l.extend({init:function(e){this.enumerate=function(){function t(e){if(f.is(e,"img")||3==e.nodeType&&(!f.isWhitespace(e)||""==e.nodeValue))n.push(e);else for(e=e.firstChild;e;)t(e),e=e.nextSibling}var n=[];return new k(e).traverse(t),n}}}),x=l.extend({init:function(e){var t=this;t.range=e,t.rootNode=N.documentFromRange(e),t.body=t.getEditable(e),"body"!=f.name(t.body)&&(t.rootNode=t.body),t.html=t.body.innerHTML,t.startContainer=t.nodeToPath(e.startContainer),t.endContainer=t.nodeToPath(e.endContainer),t.startOffset=t.offset(e.startContainer,e.startOffset),t.endOffset=t.offset(e.endContainer,e.endOffset)},index:function(e){for(var t,n=0,o=e.nodeType;e=e.previousSibling;)t=e.nodeType,(3!=t||o!=t)&&n++,o=t;return n},getEditable:function(e){for(var t=e.commonAncestorContainer;t&&(3==t.nodeType||t.attributes&&!t.attributes.contentEditable);)t=t.parentNode;return t},restoreHtml:function(){this.body.innerHTML=this.html},offset:function(e,t){if(3==e.nodeType)for(;(e=e.previousSibling)&&3==e.nodeType;)t+=e.nodeValue.length;return t},nodeToPath:function(e){for(var t=[];e!=this.rootNode;)t.push(this.index(e)),e=e.parentNode;return t},toRangePoint:function(e,t,n,o){for(var i=this.rootNode,r=n.length,a=o;r--;)i=i.childNodes[n[r]];for(;3==i.nodeType&&i.nodeValue.length<a;)a-=i.nodeValue.length,i=i.nextSibling;e[t?"setStart":"setEnd"](i,a)},toRange:function(){var e=this,t=e.range.cloneRange();return e.toRangePoint(t,!0,e.startContainer,e.startOffset),e.toRangePoint(t,!1,e.endContainer,e.endOffset),t}}),T=l.extend({init:function(){this.caret=null},addCaret:function(e){var t=this;return t.caret=f.create(N.documentFromRange(e),"span",{className:"k-marker"}),e.insertNode(t.caret),e.selectNode(t.caret),t.caret},removeCaret:function(e){var t,n,o,i,r=this,a=r.caret.previousSibling,s=0;a&&(s=m(a)?a.nodeValue.length:p(a)),t=r.caret.parentNode,n=a?p(a):0,f.remove(r.caret),v(t),o=t.childNodes[n],m(o)?e.setStart(o,s):o?(i=f.lastTextNode(o),i?e.setStart(i,i.nodeValue.length):e[a?"setStartAfter":"setStartBefore"](o)):(u.msie||t.innerHTML||(t.innerHTML='<br _moz_dirty="" />'),e.selectNodeContents(t)),e.collapse(!0)},add:function(e,t){var n,o,i=this,r=e.collapsed&&!N.isExpandable(e),a=N.documentFromRange(e);return t&&e.collapsed&&(i.addCaret(e),e=N.expand(e)),n=e.cloneRange(),n.collapse(!1),i.end=f.create(a,"span",{className:"k-marker"}),n.insertNode(i.end),n=e.cloneRange(),n.collapse(!0),i.start=i.end.cloneNode(!0),n.insertNode(i.start),r&&(o=a.createTextNode(""),f.insertAfter(o.cloneNode(),i.start),f.insertBefore(o,i.end)),e.setStartBefore(i.start),e.setEndAfter(i.end),v(e.commonAncestorContainer),e},remove:function(e){var t,n,o,i,r,a,s,l,d,c,u,h,g,b=this,y=b.start,k=b.end;for(v(e.commonAncestorContainer);!y.nextSibling&&y.parentNode;)y=y.parentNode;for(;!k.previousSibling&&k.parentNode;)k=k.parentNode;if(t=y.previousSibling&&3==y.previousSibling.nodeType&&y.nextSibling&&3==y.nextSibling.nodeType,n=k.previousSibling&&3==k.previousSibling.nodeType&&k.nextSibling&&3==k.nextSibling.nodeType,o=t&&n,y=y.nextSibling,k=k.previousSibling,i=!1,r=!1,y==b.end&&(r=!!b.start.previousSibling,y=k=b.start.previousSibling||b.end.nextSibling,i=!0),f.remove(b.start),f.remove(b.end),!y||!k)return e.selectNodeContents(e.commonAncestorContainer),e.collapse(!0),void 0;if(a=i?m(y)?y.nodeValue.length:y.childNodes.length:0,s=m(k)?k.nodeValue.length:k.childNodes.length,3==y.nodeType)for(;y.previousSibling&&3==y.previousSibling.nodeType;)y=y.previousSibling,a+=y.nodeValue.length;if(3==k.nodeType)for(;k.previousSibling&&3==k.previousSibling.nodeType;)k=k.previousSibling,s+=k.nodeValue.length;for(l=p(y),d=y.parentNode,c=p(k),u=k.parentNode,h=y;h.previousSibling;h=h.previousSibling)3==h.nodeType&&3==h.previousSibling.nodeType&&l--;for(g=k;g.previousSibling;g=g.previousSibling)3==g.nodeType&&3==g.previousSibling.nodeType&&c--;v(d),3==y.nodeType&&(y=d.childNodes[l]),v(u),3==k.nodeType&&(k=u.childNodes[c]),i?(3==y.nodeType?e.setStart(y,a):e[r?"setStartAfter":"setStartBefore"](y),e.collapse(!0)):(3==y.nodeType?e.setStart(y,a):e.setStartBefore(y),3==k.nodeType?e.setEnd(k,s):e.setEndAfter(k)),b.caret&&b.removeCaret(e)}}),S=/[\u0009-\u000d]|\u0020|\u00a0|\ufeff|\.|,|;|:|!|\(|\)|\?/,N={nodes:function(e){var t=N.textNodes(e);return t.length||(e.selectNodeContents(e.commonAncestorContainer),t=N.textNodes(e),t.length||(t=f.significantChildNodes(e.commonAncestorContainer))),t},textNodes:function(e){return new C(e).enumerate()},documentFromRange:function(e){var t=e.startContainer;return 9==t.nodeType?t:t.ownerDocument},createRange:function(e){return u.msie&&u.version<9?new y(e):e.createRange()},selectRange:function(e){var t,n=N.image(e);n&&(e.setStartAfter(n),e.setEndAfter(n)),t=b.selectionFromRange(e),t.removeAllRanges(),t.addRange(e)},stringify:function(e){return s.format("{0}:{1} - {2}:{3}",f.name(e.startContainer),e.startOffset,f.name(e.endContainer),e.endOffset)},split:function(e,t,n){function o(o){var i,r=e.cloneRange();r.collapse(o),r[o?"setStartBefore":"setEndAfter"](t),i=r.extractContents(),n&&(i=f.trim(i)),f[o?"insertBefore":"insertAfter"](i,t)}o(!0),o(!1)},getMarkers:function(e){var t=[];return new k(e).traverse(function(e){"k-marker"==e.className&&t.push(e)}),t},image:function(e){var t=[];return new k(e).traverse(function(e){f.is(e,"img")&&t.push(e)}),1==t.length?t[0]:void 0},expand:function(e){var t,n,o,i,r=e.cloneRange(),a=r.startContainer.childNodes[0===r.startOffset?0:r.startOffset-1],s=r.endContainer.childNodes[r.endOffset];return m(a)&&m(s)?(t=a.nodeValue,n=s.nodeValue,t&&n?(o=t.split("").reverse().join("").search(S),i=n.search(S),o&&i?(i=-1==i?n.length:i,o=-1==o?0:t.length-o,r.setStart(a,o),r.setEnd(s,i),r):r):r):r},isExpandable:function(e){var t,n,o,i,r,a,s=e.startContainer,l=N.documentFromRange(e);return s==l||s==l.body?!1:(t=e.cloneRange(),(n=s.nodeValue)?(o=n.substring(0,t.startOffset),i=n.substring(t.startOffset),r=0,a=0,o&&(r=o.split("").reverse().join("").search(S)),i&&(a=i.search(S)),r&&a):!1)}};d(c,{SelectionUtils:b,W3CRange:y,RangeIterator:k,W3CSelection:w,RangeEnumerator:C,RestorePoint:x,Marker:T,RangeUtils:N})}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,o=t.ui.editor,i=o.EditorUtils,r=i.registerTool,a=o.Dom,s=o.Tool,l=o.ToolTemplate,d=o.RestorePoint,c=o.Marker,u=e.extend,f=n.extend({init:function(e){var t=this;t.options=e,t.restorePoint=new d(e.range),t.marker=new c,t.formatter=e.formatter},getRange:function(){return this.restorePoint.toRange()},lockRange:function(e){return this.marker.add(this.getRange(),e)},releaseRange:function(e){this.marker.remove(e),this.editor.selectRange(e)},undo:function(){var e=this.restorePoint;e.restoreHtml(),this.editor.selectRange(e.toRange())},redo:function(){this.exec()},createDialog:function(n,o){var i=this.editor;return e(n).appendTo(document.body).kendoWindow(u({},i.options.dialogOptions,o)).closest(".k-window").toggleClass("k-rtl",t.support.isRtl(i.wrapper)).end()},exec:function(){var e=this,t=e.lockRange(!0);e.formatter.editor=e.editor,e.formatter.toggle(t),e.releaseRange(t)}}),p=n.extend({init:function(e,t){this.body=e.body,this.startRestorePoint=e,this.endRestorePoint=t},redo:function(){this.body.innerHTML=this.endRestorePoint.html,this.editor.selectRange(this.endRestorePoint.toRange())},undo:function(){this.body.innerHTML=this.startRestorePoint.html,this.editor.selectRange(this.startRestorePoint.toRange())}}),m=f.extend({init:function(e){f.fn.init.call(this,e),this.managesUndoRedo=!0},exec:function(){var e=this.editor,t=this.options.range,n=new d(t);e.selectRange(t),e.clipboard.paste(this.options.value||""),e.undoRedoStack.push(new p(n,new d(e.getRange()))),e.focus()}}),h=s.extend({initialize:function(e,t){var n=t.editor,i=this.options,r=i.items?i.items:n.options.insertHtml;new o.SelectBox(e,{dataSource:r,dataTextField:"text",dataValueField:"value",change:function(){s.exec(n,"insertHtml",this.value())},title:n.options.messages.insertHtml,highlightFirst:!1})},command:function(e){return new m(e)},update:function(e){var t=e.data("kendoSelectBox")||e.find("select").data("kendoSelectBox");t.close(),t.value(t.options.title)}}),g=n.extend({init:function(){this.stack=[],this.currentCommandIndex=-1},push:function(e){var t=this;t.stack=t.stack.slice(0,t.currentCommandIndex+1),t.currentCommandIndex=t.stack.push(e)-1},undo:function(){this.canUndo()&&this.stack[this.currentCommandIndex--].undo()},redo:function(){this.canRedo()&&this.stack[++this.currentCommandIndex].redo()},canUndo:function(){return this.currentCommandIndex>=0},canRedo:function(){return this.currentCommandIndex!=this.stack.length-1}}),v=n.extend({init:function(e){this.editor=e},keydown:function(t){var n,o=this,i=o.editor,r=i.keyboard,a=r.isTypingKey(t),s=u(e.Event(),t);return o.editor.trigger("keydown",s),s.isDefaultPrevented()&&t.preventDefault(),s.isDefaultPrevented()||!a||r.isTypingInProgress()?!1:(n=i.getRange(),o.startRestorePoint=new d(n),r.startTyping(function(){i.selectionRestorePoint=o.endRestorePoint=new d(i.getRange()),i.undoRedoStack.push(new p(o.startRestorePoint,o.endRestorePoint))}),!0)},keyup:function(e){var t=this.editor.keyboard;return this.editor.trigger("keyup",e),t.isTypingInProgress()?(t.endTyping(),!0):!1}}),b=n.extend({init:function(e){this.editor=e,this.systemCommandIsInProgress=!1},createUndoCommand:function(){var e=this;e.endRestorePoint=new d(e.editor.getRange()),e.editor.undoRedoStack.push(new p(e.startRestorePoint,e.endRestorePoint)),e.startRestorePoint=e.endRestorePoint},changed:function(){return this.startRestorePoint?this.startRestorePoint.html!=this.editor.body.innerHTML:!1},keydown:function(e){var t=this,n=t.editor,o=n.keyboard;return o.isModifierKey(e)?(o.isTypingInProgress()&&o.endTyping(!0),t.startRestorePoint=new d(n.getRange()),!0):o.isSystem(e)?(t.systemCommandIsInProgress=!0,t.changed()&&(t.systemCommandIsInProgress=!1,t.createUndoCommand()),!0):!1},keyup:function(e){var t=this;return t.systemCommandIsInProgress&&t.changed()?(t.systemCommandIsInProgress=!1,t.createUndoCommand(e),!0):!1}}),y=n.extend({init:function(e){this.handlers=e,this.typingInProgress=!1},isCharacter:function(e){return e>=48&&90>=e||e>=96&&111>=e||e>=186&&192>=e||e>=219&&222>=e},toolFromShortcut:function(t,n){var o,i,r=String.fromCharCode(n.keyCode);for(o in t)if(i=e.extend({ctrl:!1,alt:!1,shift:!1},t[o].options),(i.key==r||i.key==n.keyCode)&&i.ctrl==n.ctrlKey&&i.alt==n.altKey&&i.shift==n.shiftKey)return o},isTypingKey:function(e){var t=e.keyCode;return this.isCharacter(t)&&!e.ctrlKey&&!e.altKey||32==t||13==t||8==t||46==t&&!e.shiftKey&&!e.ctrlKey&&!e.altKey},isModifierKey:function(e){var t=e.keyCode;return 17==t&&!e.shiftKey&&!e.altKey||16==t&&!e.ctrlKey&&!e.altKey||18==t&&!e.ctrlKey&&!e.shiftKey},isSystem:function(e){return 46==e.keyCode&&e.ctrlKey&&!e.altKey&&!e.shiftKey},startTyping:function(e){this.onEndTyping=e,this.typingInProgress=!0},stopTyping:function(){this.typingInProgress=!1,this.onEndTyping&&this.onEndTyping()},endTyping:function(t){var n=this;n.clearTimeout(),t?n.stopTyping():n.timeout=window.setTimeout(e.proxy(n.stopTyping,n),1e3)},isTypingInProgress:function(){return this.typingInProgress},clearTimeout:function(){window.clearTimeout(this.timeout)},notify:function(e,t){var n,o=this.handlers;for(n=0;n<o.length&&!o[n][t](e);n++);},keydown:function(e){this.notify(e,"keydown")},keyup:function(e){this.notify(e,"keyup")}}),k=n.extend({init:function(e){this.editor=e,this.cleaners=[new C,new x]},htmlToFragment:function(e){var t=this.editor,n=t.document,o=a.create(n,"div"),i=n.createDocumentFragment();for(o.innerHTML=e;o.firstChild;)i.appendChild(o.firstChild);return i},isBlock:function(e){return/<(div|p|ul|ol|table|h[1-6])/i.test(e)},oncut:function(){var e=this.editor,t=new d(e.getRange());setTimeout(function(){e.undoRedoStack.push(new p(t,new d(e.getRange())))})},onpaste:function(t){var n,o,i,r=this.editor,s=r.getRange(),l="",c=new d(s),u=a.create(r.document,"div",{className:"k-paste-container",innerHTML:l});a.persistScrollTop(r.document),r.body.appendChild(u),r.body.createTextRange?(t.preventDefault(),n=r.createRange(),n.selectNodeContents(u),r.selectRange(n),o=r.body.createTextRange(),o.moveToElementText(u),e(r.body).unbind("paste"),o.execCommand("Paste"),e(r.body).bind("paste",e.proxy(arguments.callee,this))):(i=r.createRange(),i.selectNodeContents(u),r.selectRange(i)),s.deleteContents(),setTimeout(function(){var t,n="",o={html:""};r.selectRange(s),t=e(r.body).children(".k-paste-container"),t.each(function(){this.lastChild&&a.is(this.lastChild,"br")&&a.remove(this.lastChild),n+=this.innerHTML}),t.remove(),n=n.replace(/\ufeff/g,""),o.html=n,r.trigger("paste",o),r.clipboard.paste(o.html,!0),r.undoRedoStack.push(new p(c,new d(r.getRange()))),r._selectionChange()})},splittableParent:function(e,t){var n,o;if(e)return a.parentOfType(t,["p","ul","ol"])||t.parentNode;if(n=t.parentNode,o=t.ownerDocument.body,a.isInline(n))for(;n.parentNode!=o&&!a.isBlock(n.parentNode);)n=n.parentNode;return n},paste:function(e,t){var n,i,r,s,l,d,u,f,p,m,h,g=this.editor;for(n=0,i=this.cleaners.length;i>n;n++)this.cleaners[n].applicable(e)&&(e=this.cleaners[n].clean(e));if(t&&(e=e.replace(/(<br>(\s| )*)+(<\/?(div|p|li|col|t))/gi,"$3"),e=e.replace(/<(a|span)[^>]*><\/\1>/gi,"")),e=e.replace(/^<li/i,"<ul><li").replace(/li>$/g,"li></ul>"),r=this.isBlock(e),g.focus(),s=g.getRange(),s.deleteContents(),s.startContainer==g.document&&s.selectNodeContents(g.body),l=new c,d=l.addCaret(s),u=this.splittableParent(r,d),f=!1,p=u!=g.body&&!a.is(u,"td"),p&&(r||a.isInline(u))&&(s.selectNode(d),o.RangeUtils.split(s,u,!0),f=!0),m=this.htmlToFragment(e),m.firstChild&&"k-paste-container"===m.firstChild.className){for(h=[],n=0,i=m.childNodes.length;i>n;n++)h.push(m.childNodes[n].innerHTML);m=this.htmlToFragment(h.join("<br />"))}if(s.insertNode(m),u=this.splittableParent(r,d),f){for(;d.parentNode!=u;)a.unwrap(d.parentNode);a.unwrap(d.parentNode)}a.normalize(s.commonAncestorContainer),d.style.display="inline",a.restoreScrollTop(g.document),a.scrollTo(d),l.removeCaret(s),g.selectRange(s)}}),w=n.extend({clean:function(e){var t,n,o=this,i=o.replacements;for(t=0,n=i.length;n>t;t+=2)e=e.replace(i[t],i[t+1]);return e}}),C=w.extend({init:function(){this.replacements=[/<\?xml[^>]*>/gi,"",/<!--(.|\n)*?-->/g,"",/"/g,"'",/(?:<br> [\s\r\n]+|<br>)*(<\/?(h[1-6]|hr|p|div|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|address|pre|form|blockquote|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br> [\s\r\n]+|<br>)*/g,"$1",/<br><br>/g,"<BR><BR>",/<br>(?!\n)/g," ",/<table([^>]*)>(\s| )+<t/gi,"<table$1><t",/<tr[^>]*>(\s| )*<\/tr>/gi,"",/<tbody[^>]*>(\s| )*<\/tbody>/gi,"",/<table[^>]*>(\s| )*<\/table>/gi,"",/<BR><BR>/g,"<br>",/^\s*( )+/gi,"",/( |<br[^>]*>)+\s*$/gi,"",/mso-[^;"]*;?/gi,"",/<(\/?)b(\s[^>]*)?>/gi,"<$1strong$2>",/<(\/?)i(\s[^>]*)?>/gi,"<$1em$2>",/<\/?(meta|link|style|o:|v:|x:)[^>]*>((?:.|\n)*?<\/(meta|link|style|o:|v:|x:)[^>]*>)?/gi,"",/style=(["|'])\s*\1/g,""]},applicable:function(e){return/class="?Mso|style="[^"]*mso-/i.test(e)},stripEmptyAnchors:function(e){return e.replace(/<a([^>]*)>\s*<\/a>/gi,function(e,t){return!t||t.indexOf("href")<0?"":e})},listType:function(e){var t;return/^(<span [^>]*texhtml[^>]*>)?<span [^>]*(Symbol|Wingdings)[^>]*>/i.test(e)&&(t=!0),e=e.replace(/<\/?\w+[^>]*>/g,"").replace(/ /g," "),!t&&/^[\u2022\u00b7\u00a7\u00d8o]\u00a0+/.test(e)||t&&/^.\u00a0+/.test(e)?"ul":/^\s*\w+[\.\)]\u00a0{2,}/.test(e)?"ol":void 0},lists:function(t){var n,o,i,r,s,l,d,c,u=e(a.blockElements.join(","),t),f=-1,p={ul:{},ol:{}},m=t;for(o=0;o<u.length;o++)if(i=u[o],r=this.listType(i.innerHTML),r&&"p"==a.name(i)){if(s=parseFloat(i.style.marginLeft||0),l=p[r][s],(s>f||!l)&&(l=a.create(document,r),m==t?a.insertBefore(l,i):m.appendChild(l),p[r][s]=l),n!=r)for(d in p)for(c in p[d])e.contains(l,p[d][c])&&delete p[d][c];a.remove(i.firstChild),m=a.create(document,"li",{innerHTML:i.innerHTML}),l.appendChild(m),a.remove(i),f=s,n=r}else i.innerHTML?(p={ul:{},ol:{}},m=t,f=-1):a.remove(i)},removeAttributes:function(e){for(var t=e.attributes,n=t.length;n--;)e.removeAttributeNode(t[n])},createColGroup:function(n){var o,i=n.cells;i.length<2||(o=e(e.map(i,function(e){var n=e.width;return n&&0!==parseInt(n,10)?t.format('<col style="width:{0}px;"/>',n):"<col />"}).join("")),o.is("colgroup")||(o=e("<colgroup/>").append(o)),o.prependTo(e(n).closest("table")))},convertHeaders:function(t){var n,o=t.cells,i=e.map(o,function(t){var n=e(t).children("p").children("strong")[0];return n&&"strong"==a.name(n)?n:void 0});if(i.length==o.length){for(n=0;n<i.length;n++)a.unwrap(i[n]);e(t).closest("table").find("colgroup").after("<thead><tr>"+e.map(o,function(t){return"<th>"+e(t).html()+"</th>"}).join("")+"</tr></thead>").end().end().remove()}},removeParagraphs:function(t){var n,o,i,r,s;for(n=0;n<t.length;n++)for(this.removeAttributes(t[n]),r=e(t[n]),s=r.children("p"),o=0,i=s.length;i>o;o++)i-1>o&&a.insertAfter(a.create(document,"br"),s[o]),a.unwrap(s[o])},removeDefaultColors:function(e){for(var t=0;t<e.length;t++)/^\s*color:\s*[^;]*;?$/i.test(e[t].style.cssText)&&a.unwrap(e[t])},tables:function(t){var n,o,i=e(t).find("table"),r=this;for(o=0;o<i.length;o++)n=i[o].rows[0],r.createColGroup(n),r.convertHeaders(n),r.removeAttributes(i[o]),r.removeParagraphs(i.eq(o).find("td,th")),r.removeDefaultColors(i.eq(o).find("span"))},clean:function(e){var t,n=this;return e=w.fn.clean.call(n,e),e=n.stripEmptyAnchors(e),t=a.create(document,"div",{innerHTML:e}),n.lists(t),n.tables(t),e=t.innerHTML.replace(/\s+class="?[^"\s>]*"?/gi,"")}}),x=w.extend({init:function(){this.replacements=[/\s+class="Apple-style-span[^"]*"/gi,"",/<(div|p|h[1-6])\s+style="[^"]*"/gi,"<$1",/^<div>(.*)<\/div>$/,"$1"]},applicable:function(e){return/class="?Apple-style-span|style="[^"]*-webkit-nbsp-mode/i.test(e)}});u(o,{Command:f,GenericCommand:p,InsertHtmlCommand:m,InsertHtmlTool:h,UndoRedoStack:g,TypingHandler:v,SystemHandler:b,Keyboard:y,Clipboard:k,Cleaner:w,MSWordFormatCleaner:C,WebkitFormatCleaner:x}),r("insertHtml",new h({template:new l({template:i.dropDownListTemplate,title:"Insert HTML",initialValue:"Insert HTML"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,o=t.ui.editor,i=t.ui.Editor.fn.options.formats,r=o.EditorUtils,a=o.Tool,s=o.ToolTemplate,l=o.FormatTool,d=o.Dom,c=o.RangeUtils,u=e.extend,f=o.EditorUtils.registerTool,p=o.EditorUtils.registerFormat,m="k-marker",h=n.extend({init:function(e){this.format=e},numberOfSiblings:function(e){var t,n=0,o=0,i=0,r=e.parentNode;for(t=r.firstChild;t;t=t.nextSibling)t!=e&&(t.className==m?i++:3==t.nodeType?n++:o++);return i>1&&r.firstChild.className==m&&r.lastChild.className==m?0:o+n},findSuitable:function(e,t){return!t&&this.numberOfSiblings(e)>0?null:d.parentOfType(e,this.format[0].tags)},findFormat:function(e){var t,n,o,i,r,a=this.format,s=d.attrEquals;for(t=0,n=a.length;n>t;t++){if(o=e,i=a[t].tags,r=a[t].attr,o&&d.ofType(o,i)&&s(o,r))return o;for(;o;)if(o=d.parentOfType(o,i),o&&s(o,r))return o}return null},isFormatted:function(e){var t,n;for(t=0,n=e.length;n>t;t++)if(this.findFormat(e[t]))return!0;return!1}}),g=n.extend({init:function(e,t){var n=this;n.finder=new h(e),n.attributes=u({},e[0].attr,t),n.tag=e[0].tags[0]},wrap:function(e){return d.wrap(e,d.create(e.ownerDocument,this.tag,this.attributes))},activate:function(e,t){var n=this;n.finder.isFormatted(t)?(n.split(e),n.remove(t)):n.apply(t)},toggle:function(e){var t=c.textNodes(e);t.length>0&&this.activate(e,t)},apply:function(e){var t,n,o,i,r=this,a=[];for(t=0,n=e.length;n>t;t++)o=e[t],i=r.finder.findSuitable(o),i?d.attr(i,r.attributes):i=r.wrap(o),a.push(i);r.consolidate(a)},remove:function(e){var t,n,o,i=this;for(t=0,n=e.length;n>t;t++)o=i.finder.findFormat(e[t]),o&&(i.attributes&&i.attributes.style?(d.unstyle(o,i.attributes.style),o.style.cssText||o.attributes["class"]||d.unwrap(o)):d.unwrap(o))},split:function(e){var t,n,o=c.textNodes(e),i=o.length;if(i>0)for(t=0;i>t;t++)n=this.finder.findFormat(o[t]),n&&c.split(e,n,!0)},consolidate:function(e){for(var t,n;e.length>1;)if(t=e.pop(),n=e[e.length-1],t.previousSibling&&t.previousSibling.className==m&&n.appendChild(t.previousSibling),t.tagName==n.tagName&&t.previousSibling==n&&t.style.cssText==n.style.cssText){for(;t.firstChild;)n.appendChild(t.firstChild);d.remove(t)}}}),v=h.extend({init:function(e,t){var n=this;n.format=e,n.greedyProperty=t,h.fn.init.call(n,e)},getInlineCssValue:function(t){var n,o,i,r,a,s,l,c,u,f,p,m,h=t.attributes,g=e.trim;if(h)for(n=0,o=h.length;o>n;n++)if(i=h[n],r=i.nodeName,a=i.nodeValue,i.specified&&"style"==r)for(s=g(a||t.style.cssText).split(";"),c=0,u=s.length;u>c;c++)if(l=s[c],l.length){if(f=l.split(":"),p=g(f[0].toLowerCase()),m=g(f[1]),p!=this.greedyProperty)continue;return p.indexOf("color")>=0?d.toHex(m):m}},getFormatInner:function(t){var n,o,i,r=e(d.isDataNode(t)?t.parentNode:t),a=r.parentsUntil("[contentEditable]").addBack();for(n=0,o=a.length;o>n;n++)if(i="className"==this.greedyProperty?a[n].className:this.getInlineCssValue(a[n]))return i;return"inherit"},getFormat:function(e){var t,n,o=this.getFormatInner(e[0]);for(t=1,n=e.length;n>t;t++)if(o!=this.getFormatInner(e[t]))return"";return o},isFormatted:function(e){return""!==this.getFormat(e)}}),b=g.extend({init:function(e,t,n){var o=this;g.fn.init.call(o,e,t),o.greedyProperty=n,o.values=t,o.finder=new v(e,n)},activate:function(e,t){var n,o=this,i=o.greedyProperty,r="apply";o.split(e),i&&(n=i.replace(/-([a-z])/,function(e,t){return t.toUpperCase()}),"inherit"==o.values.style[n]&&(r="remove")),o[r](t)}}),y=l.extend({init:function(e){l.fn.init.call(this,u(e,{finder:new h(e.format),formatter:function(){return new g(e.format)}}))}}),k=a.extend({update:function(e,t){var n=e.data(this.type);n.close(),n.value(this.finder.getFormat(t))}}),w=k.extend({init:function(e){var n=this;a.fn.init.call(n,e),n.type=t.support.browser.msie||t.support.touch?"kendoDropDownList":"kendoComboBox",n.format=[{tags:["span"]}],n.finder=new v(n.format,e.cssAttr)},command:function(e){var t=this.options,n=this.format,i={};return new o.FormatCommand(u(e,{formatter:function(){return i[t.domAttr]=e.value,new b(n,{style:i},t.cssAttr)}}))},initialize:function(e,t){var n,o=t.editor,i=this.options,r=i.name,s=[];i.defaultValue&&(s=[{text:o.options.messages[i.defaultValue[0].text],value:i.defaultValue[0].value}]),n=s.concat(i.items?i.items:o.options[r]),e[this.type]({dataTextField:"text",dataValueField:"value",dataSource:n,change:function(){a.exec(o,r,this.value())},highlightFirst:!1}),e.closest(".k-widget").removeClass("k-"+r).find("*").addBack().attr("unselectable","on"),e.data(this.type).value("inherit")}}),C=a.extend({init:function(e){a.fn.init.call(this,e),this.format=[{tags:["span"]}]},options:{palette:"websafe"},update:function(){this._widget.close()},command:function(e){var t=this.options,n=this.format,i={};return new o.FormatCommand(u(e,{formatter:function(){return i[t.domAttr]=e.value,new b(n,{style:i},t.cssAttr)}}))},initialize:function(n,o){var i=o.editor,r=this.name,s=u({},C.fn.options,this.options),l=s.palette;n=this._widget=new t.ui.ColorPicker(n,{value:e.isArray(l)?l[0]:"#000",toolIcon:"k-"+s.name,palette:l,change:function(){var e=n.value();e&&a.exec(i,r,e),i.focus()},activate:function(e){e.preventDefault(),n.trigger("change")}}),n.wrapper.attr({title:o.title,unselectable:"on"}).find("*").attr("unselectable","on")}});u(o,{InlineFormatFinder:h,InlineFormatter:g,DelayedExecutionTool:k,GreedyInlineFormatFinder:v,GreedyInlineFormatter:b,InlineFormatTool:y,FontTool:w,ColorTool:C}),p("bold",[{tags:["strong","b"]},{tags:["span"],attr:{style:{fontWeight:"bold"}}}]),f("bold",new y({key:"B",ctrl:!0,format:i.bold,template:new s({template:r.buttonTemplate,title:"Bold"})})),p("italic",[{tags:["em","i"]},{tags:["span"],attr:{style:{fontStyle:"italic"}}}]),f("italic",new y({key:"I",ctrl:!0,format:i.italic,template:new s({template:r.buttonTemplate,title:"Italic"})})),p("underline",[{tags:["span"],attr:{style:{textDecoration:"underline"}}},{tags:["u"]}]),f("underline",new y({key:"U",ctrl:!0,format:i.underline,template:new s({template:r.buttonTemplate,title:"Underline"})})),p("strikethrough",[{tags:["del"]},{tags:["span"],attr:{style:{textDecoration:"line-through"}}}]),f("strikethrough",new y({format:i.strikethrough,template:new s({template:r.buttonTemplate,title:"Strikethrough"})})),p("superscript",[{tags:["sup"]}]),f("superscript",new y({format:i.superscript,template:new s({template:r.buttonTemplate,title:"Superscript"})})),p("subscript",[{tags:["sub"]}]),f("subscript",new y({format:i.subscript,template:new s({template:r.buttonTemplate,title:"Subscript"})})),f("foreColor",new C({cssAttr:"color",domAttr:"color",name:"foreColor",template:new s({template:r.colorPickerTemplate,title:"Color"})})),f("backColor",new C({cssAttr:"background-color",domAttr:"backgroundColor",name:"backColor",template:new s({template:r.colorPickerTemplate,title:"Background Color"})})),f("fontName",new w({cssAttr:"font-family",domAttr:"fontFamily",name:"fontName",defaultValue:[{text:"fontNameInherit",value:"inherit"}],template:new s({template:r.comboBoxTemplate,title:"Font Name"})})),f("fontSize",new w({cssAttr:"font-size",domAttr:"fontSize",name:"fontSize",defaultValue:[{text:"fontSizeInherit",value:"inherit"}],template:new s({template:r.comboBoxTemplate,title:"Font Size"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,o=e.extend,i=t.ui.editor,r=t.ui.Editor.fn.options.formats,a=i.Dom,s=i.Command,l=i.ToolTemplate,d=i.FormatTool,c=i.EditorUtils,u=c.registerTool,f=c.registerFormat,p=i.RangeUtils,m=n.extend({init:function(e){this.format=e},contains:function(e,t){var n,o,i;for(n=0,o=t.length;o>n;n++)if(i=t[n],!i||!a.isAncestorOrSelf(e,i))return!1;return!0},findSuitable:function(t){var n,o,i,r=this.format,s=[];for(n=0,o=t.length;o>n;n++){if(i=a.ofType(t[n],r[0].tags)?t[n]:a.parentOfType(t[n],r[0].tags),!i)return[];e.inArray(i,s)<0&&s.push(i)}for(n=0,o=s.length;o>n;n++)if(this.contains(s[n],s))return[s[n]];return s},findFormat:function(e){var t,n,o,i,r,s=this.format;for(t=0,n=s.length;n>t;t++)for(o=e,i=s[t].tags,r=s[t].attr;o;){if(a.ofType(o,i)&&a.attrEquals(o,r))return o;o=o.parentNode}return null},getFormat:function(e){var t,n,o=this,i=function(e){return o.findFormat(a.isDataNode(e)?e.parentNode:e)},r=i(e[0]);if(!r)return"";for(t=1,n=e.length;n>t;t++)if(r!=i(e[t]))return"";return r.nodeName.toLowerCase()},isFormatted:function(e){for(var t=0,n=e.length;n>t;t++)if(!this.findFormat(e[t]))return!1;return!0}}),h=n.extend({init:function(e,t){this.format=e,this.values=t,this.finder=new m(e)
+},wrap:function(e,t,n){var o,i,r,s,l,d=1==n.length?a.blockParentOrBody(n[0]):a.commonAncestor.apply(null,n);for(a.isInline(d)&&(d=a.blockParentOrBody(d)),r=a.significantChildNodes(d),s=a.findNodeIndex(r[0]),l=a.create(d.ownerDocument,e,t),o=0;o<r.length;o++)i=r[o],a.isBlock(i)?(a.attr(i,t),l.childNodes.length&&(a.insertBefore(l,i),l=l.cloneNode(!1)),s=a.findNodeIndex(i)+1):l.appendChild(i);l.firstChild&&a.insertAt(d,l,s)},apply:function(e){var t,n,i,r,s=this,l=a.is(e[0],"img")?[e[0]]:s.finder.findSuitable(e),d=l.length?c.formatByName(a.name(l[0]),s.format):s.format[0];if(d)if(t=d.tags[0],n=o({},d.attr,s.values),l.length)for(i=0,r=l.length;r>i;i++)a.attr(l[i],n);else s.wrap(t,n,e)},remove:function(e){var t,n,o,i,r;for(t=0,n=e.length;n>t;t++)o=this.finder.findFormat(e[t]),o&&(r=a.name(o),"div"!=r||o.getAttribute("class")?(i=c.formatByName(r,this.format),i.attr.style&&a.unstyle(o,i.attr.style),i.attr.className&&a.removeClass(o,i.attr.className)):a.unwrap(o))},toggle:function(e){var t=this,n=p.nodes(e);t.finder.isFormatted(n)?t.remove(n):t.apply(n)}}),g=n.extend({init:function(e,t){var n=this;n.format=e,n.values=t,n.finder=new m(e)},apply:function(e){var t,n,o,r,s,l,d=this.format,c=a.blockParents(e),u=d[0].tags[0];if(c.length&&c[0].attributes.contentEditable&&(c=[]),c.length)for(t=0,n=c.length;n>t;t++)a.is(c[t],"li")?(o=c[t].parentNode,r=new i.ListFormatter(o.nodeName.toLowerCase(),u),s=this.editor.createRange(),s.selectNode(c[t]),r.toggle(s)):(l=a.changeTag(c[t],u),a.attr(l,d[0].attr));else new h(d,this.values).apply(e)},toggle:function(e){var t=p.textNodes(e);t.length||(e.selectNodeContents(e.commonAncestorContainer),t=p.textNodes(e),t.length||(t=a.significantChildNodes(e.commonAncestorContainer))),this.apply(t)}}),v=s.extend({init:function(e){e.formatter=e.formatter(),s.fn.init.call(this,e)}}),b=d.extend({init:function(e){d.fn.init.call(this,o(e,{finder:new m(e.format),formatter:function(){return new h(e.format)}}))}});o(i,{BlockFormatFinder:m,BlockFormatter:h,GreedyBlockFormatter:g,FormatCommand:v,BlockFormatTool:b}),f("justifyLeft",[{tags:a.blockElements,attr:{style:{textAlign:"left"}}},{tags:["img"],attr:{style:{"float":"left"}}}]),u("justifyLeft",new b({format:r.justifyLeft,template:new l({template:c.buttonTemplate,title:"Justify Left"})})),f("justifyCenter",[{tags:a.blockElements,attr:{style:{textAlign:"center"}}},{tags:["img"],attr:{style:{display:"block",marginLeft:"auto",marginRight:"auto"}}}]),u("justifyCenter",new b({format:r.justifyCenter,template:new l({template:c.buttonTemplate,title:"Justify Center"})})),f("justifyRight",[{tags:a.blockElements,attr:{style:{textAlign:"right"}}},{tags:["img"],attr:{style:{"float":"right"}}}]),u("justifyRight",new b({format:r.justifyRight,template:new l({template:c.buttonTemplate,title:"Justify Right"})})),f("justifyFull",[{tags:a.blockElements,attr:{style:{textAlign:"justify"}}}]),u("justifyFull",new b({format:r.justifyFull,template:new l({template:c.buttonTemplate,title:"Justify Full"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=e.extend,o=t.ui.editor,i=o.Dom,r=o.Command,a=o.Tool,s=o.BlockFormatter,l=i.normalize,d=o.RangeUtils,c=o.EditorUtils.registerTool,u=r.extend({init:function(e){this.options=e,r.fn.init.call(this,e)},_insertMarker:function(e,t){var n,o=i.create(e,"a");return t.insertNode(o),o.parentNode||(n=t.commonAncestorContainer,n.innerHTML="",n.appendChild(o)),l(o.parentNode),o},shouldTrim:function(e){var t="p,h1,h2,h3,h4,h5,h6".split(","),n=i.parentOfType(e.startContainer,t),o=i.parentOfType(e.endContainer,t);return n&&!o||!n&&o},exec:function(){var e,t,n,r,a,c,u,f,p,m=this.getRange(),h=d.documentFromRange(m),g=o.emptyElementContent,v=this.shouldTrim(m);m.deleteContents(),a=this._insertMarker(h,m),c=i.parentOfType(a,["li"]),u=i.parentOfType(a,"h1,h2,h3,h4,h5,h6".split(",")),c?(f=m.cloneRange(),f.selectNode(c),d.textNodes(f).length||(r=i.create(h,"p"),c.nextSibling&&d.split(f,c.parentNode),i.insertAfter(r,c.parentNode),i.remove(1==c.parentNode.childNodes.length?c.parentNode:c),r.innerHTML=g,n=r)):u&&!a.nextSibling&&(r=i.create(h,"p"),i.insertAfter(r,u),r.innerHTML=g,i.remove(a),n=r),n||(c||u||new s([{tags:["p"]}]).apply([a]),m.selectNode(a),e=i.parentOfType(a,[c?"li":u?i.name(u):"p"]),d.split(m,e,v),t=e.previousSibling,i.is(t,"li")&&t.firstChild&&!i.is(t.firstChild,"br")&&(t=t.firstChild),n=e.nextSibling,i.is(n,"li")&&n.firstChild&&!i.is(n.firstChild,"br")&&(n=n.firstChild),i.remove(e),this.clean(t),this.clean(n),l(t)),l(n),i.is(n,"img")?m.setStartBefore(n):(m.selectNodeContents(n),p=d.textNodes(m)[0],p&&m.selectNodeContents(p)),m.collapse(!0),i.scrollTo(n),d.selectRange(m)},clean:function(e){if(e.firstChild&&i.is(e.firstChild,"br")&&i.remove(e.firstChild),i.isDataNode(e)&&!e.nodeValue&&(e=e.parentNode),e){for(;e.firstChild&&1==e.firstChild.nodeType;)e=e.firstChild;!i.is(e,"img")&&/^\s*$/.test(e.innerHTML)&&(e.innerHTML=o.emptyElementContent)}}}),f=r.extend({init:function(e){this.options=e,r.fn.init.call(this,e)},exec:function(){var e,n=this.getRange(),o=i.create(d.documentFromRange(n),"br");n.deleteContents(),n.insertNode(o),l(o.parentNode),t.support.browser.msie||o.nextSibling&&!i.isWhitespace(o.nextSibling)||(e=o.cloneNode(!0),e.setAttribute("_moz_dirty",""),i.insertAfter(e,o)),n.setStartAfter(o),n.collapse(!0),i.scrollTo(o.nextSibling||o),d.selectRange(n)}});n(o,{ParagraphCommand:u,NewLineCommand:f}),c("insertLineBreak",new a({key:13,shift:!0,command:f})),c("insertParagraph",new a({key:13,command:u}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,o=e.extend,i=t.ui.editor,r=i.Dom,a=i.RangeUtils,s=i.EditorUtils,l=i.Command,d=i.ToolTemplate,c=i.FormatTool,u=i.BlockFormatFinder,f=a.textNodes,p=i.EditorUtils.registerTool,m=u.extend({init:function(e){this.tag=e;var t=this.tags=["ul"==e?"ol":"ul",e];u.fn.init.call(this,[{tags:t}])},isFormatted:function(e){var t,n,o=[];for(n=0;n<e.length;n++)(t=this.findFormat(e[n]))&&r.name(t)==this.tag&&o.push(t);if(o.length<1)return!1;if(o.length!=e.length)return!1;for(n=0;n<o.length&&o[n].parentNode==t.parentNode;n++)if(o[n]!=t)return!1;return!0},findSuitable:function(e){var t=r.parentOfType(e[0],this.tags);return t&&r.name(t)==this.tag?t:null}}),h=n.extend({init:function(e,t){var n=this;n.finder=new m(e),n.tag=e,n.unwrapTag=t},wrap:function(e,t){var n,o,i=r.create(e.ownerDocument,"li");for(n=0;n<t.length;n++)if(o=t[n],r.is(o,"li"))e.appendChild(o);else if(r.is(o,"ul")||r.is(o,"ol"))for(;o.firstChild;)e.appendChild(o.firstChild);else if(r.is(o,"td")){for(;o.firstChild;)i.appendChild(o.firstChild);e.appendChild(i),o.appendChild(e),e=e.cloneNode(!1),i=i.cloneNode(!1)}else i.appendChild(o),r.isBlock(o)&&(e.appendChild(i),r.unwrap(o),i=i.cloneNode(!1));i.firstChild&&e.appendChild(i)},containsAny:function(e,t){for(var n=0;n<t.length;n++)if(r.isAncestorOrSelf(e,t[n]))return!0;return!1},suitable:function(e,t){if("k-marker"==e.className){var n=e.nextSibling;if(n&&r.isBlock(n))return!1;if(n=e.previousSibling,n&&r.isBlock(n))return!1}return this.containsAny(e,t)||r.isInline(e)||3==e.nodeType},split:function(t){var n,o,i,s,l,d,c=f(t);if(c.length)for(n=r.parentOfType(c[0],["li"]),o=r.parentOfType(c[c.length-1],["li"]),t.setStartBefore(n),t.setEndAfter(o),i=0,s=c.length;s>i;i++)l=this.finder.findFormat(c[i]),l&&(d=e(l).parents("ul,ol"),d[0]?a.split(t,d.last()[0],!0):a.split(t,l,!0))},merge:function(e,t){for(var n,o=t.previousSibling;o&&("k-marker"==o.className||3==o.nodeType&&r.isWhitespace(o));)o=o.previousSibling;if(o&&r.name(o)==e){for(;t.firstChild;)o.appendChild(t.firstChild);r.remove(t),t=o}for(n=t.nextSibling;n&&("k-marker"==n.className||3==n.nodeType&&r.isWhitespace(n));)n=n.nextSibling;if(n&&r.name(n)==e){for(;t.lastChild;)n.insertBefore(t.lastChild,n.firstChild);r.remove(t)}},applyOnSection:function(t,n){function o(){u.push(this)}var i,a,s,l,d=this.tag,c=r.closestSplittableParent(n),u=[],f=this.finder.findSuitable(n);for(f||(f=new m("ul"==d?"ol":"ul").findSuitable(n)),i=r.significantChildNodes(c),i.length||(i=n),/table|tbody/.test(r.name(c))&&(i=e.map(n,function(e){return r.parentOfType(e,["td"])})),a=0;a<i.length;a++)s=i[a],l=r.name(s),!this.suitable(s,n)||f&&r.isAncestorOrSelf(f,s)||(!f||"ul"!=l&&"ol"!=l?u.push(s):(e.each(s.childNodes,o),r.remove(s)));u.length!=i.length||c==n[0].ownerDocument.body||/table|tbody|tr|td/.test(r.name(c))||(u=[c]),f||(f=r.create(c.ownerDocument,d),r.insertBefore(f,u[0])),this.wrap(f,u),r.is(f,d)||r.changeTag(f,d),this.merge(d,f)},apply:function(e){var t,n,o,i=0,a=[];do o=r.parentOfType(e[i],["td","body"]),t&&o==t?n.push(e[i]):(t&&a.push({section:t,nodes:n}),n=[e[i]],t=o),i++;while(i<e.length);for(a.push({section:t,nodes:n}),i=0;i<a.length;i++)this.applyOnSection(a[i].section,a[i].nodes)},unwrap:function(t){var n,o,i,a,s=t.ownerDocument.createDocumentFragment(),l=this.unwrapTag;for(o=t.firstChild;o;o=o.nextSibling){for(i=r.create(t.ownerDocument,l||"p");o.firstChild;)a=o.firstChild,r.isBlock(a)?(i.firstChild&&(s.appendChild(i),i=r.create(t.ownerDocument,l||"p")),s.appendChild(a)):i.appendChild(a);i.firstChild&&s.appendChild(i)}n=e(t).parents("ul,ol"),n[0]?(r.insertAfter(s,n.last()[0]),n.last().remove()):r.insertAfter(s,t),r.remove(t)},remove:function(e){var t,n,o;for(n=0,o=e.length;o>n;n++)t=this.finder.findFormat(e[n]),t&&this.unwrap(t)},toggle:function(e){var t,n=this,o=f(e),i=e.commonAncestorContainer;o.length||(e.selectNodeContents(i),o=f(e),o.length||(t=i.ownerDocument.createTextNode(""),e.startContainer.appendChild(t),o=[t],e.selectNode(t.parentNode))),n.finder.isFormatted(o)?(n.split(e),n.remove(o)):n.apply(o)}}),g=l.extend({init:function(e){e.formatter=new h(e.tag),l.fn.init.call(this,e)}}),v=c.extend({init:function(e){this.options=e,c.fn.init.call(this,o(e,{finder:new m(e.tag)}))},command:function(e){return new g(o(e,{tag:this.options.tag}))}});o(i,{ListFormatFinder:m,ListFormatter:h,ListCommand:g,ListTool:v}),p("insertUnorderedList",new v({tag:"ul",template:new d({template:s.buttonTemplate,title:"Remove Link"})})),p("insertOrderedList",new v({tag:"ol",template:new d({template:s.buttonTemplate,title:"Remove Link"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,o=e.extend,i=t.ui.editor,r=i.Dom,a=i.RangeUtils,s=i.EditorUtils,l=i.Command,d=i.Tool,c=i.ToolTemplate,u=i.InlineFormatter,f=i.InlineFormatFinder,p=a.textNodes,m=i.EditorUtils.registerTool,h=n.extend({findSuitable:function(e){return r.parentOfType(e,["a"])}}),g=n.extend({init:function(){this.finder=new h},apply:function(e,t){var n,o,i,s,l=p(e);t.innerHTML?(n=a.getMarkers(e),o=a.documentFromRange(e),e.deleteContents(),s=r.create(o,"a",t),e.insertNode(s),"a"==r.name(s.parentNode)&&r.insertAfter(s,s.parentNode),n.length>1&&(r.insertAfter(n[n.length-1],s),r.insertAfter(n[1],s),r[l.length>0?"insertBefore":"insertAfter"](n[0],s))):(i=new u([{tags:["a"]}],t),i.finder=this.finder,i.apply(l))}}),v=l.extend({init:function(e){e.formatter={toggle:function(e){new u([{tags:["a"]}]).remove(p(e))}},this.options=e,l.fn.init.call(this,e)}}),b=l.extend({init:function(e){var t=this;t.options=e,l.fn.init.call(t,e),t.formatter=new g,e.url?this.exec=function(){this.formatter.apply(e.range,{href:e.url,innerHTML:e.text||e.url,target:e.target})}:(t.attributes=null,t.async=!0)},_dialogTemplate:function(){return t.template("<div class=\"k-editor-dialog k-popup-edit-form k-edit-form-container\"><div class='k-edit-label'><label for='k-editor-link-url'>#: messages.linkWebAddress #</label></div><div class='k-edit-field'><input type='text' class='k-input k-textbox' id='k-editor-link-url'></div><div class='k-edit-label'><label for='k-editor-link-text'>#: messages.linkText #</label></div><div class='k-edit-field'><input type='text' class='k-input k-textbox' id='k-editor-link-text'></div><div class='k-edit-label'><label for='k-editor-link-title'>#: messages.linkToolTip #</label></div><div class='k-edit-field'><input type='text' class='k-input k-textbox' id='k-editor-link-title'></div><div class='k-edit-label'></div><div class='k-edit-field'><input type='checkbox' class='k-checkbox' id='k-editor-link-target'><label for='k-editor-link-target'>#: messages.linkOpenInNewWindow #</label></div><div class='k-edit-buttons k-state-default'><button class=\"k-dialog-insert k-button\">#: messages.dialogInsert #</button><button class=\"k-dialog-close k-button k-secondary\">#: messages.dialogCancel #</button></div></div>")({messages:this.editor.options.messages})},exec:function(){function n(t){var n,a,s,u=l.element,p=e("#k-editor-link-url",u).val();p&&"http://"!=p&&(p.indexOf("@")>0&&!/^(\w+:)|(\/\/)/i.test(p)&&(p="mailto:"+p),d.attributes={href:p},n=e("#k-editor-link-title",u).val(),n&&(d.attributes.title=n),a=e("#k-editor-link-text",u).val(),a===f||!a&&0!==i.length||(d.attributes.innerHTML=r.stripBom(a)||p),s=e("#k-editor-link-target",u).is(":checked"),d.attributes.target=s?"_blank":null,d.formatter.apply(c,d.attributes)),o(t),d.change&&d.change()}function o(e){e.preventDefault(),l.destroy(),r.windowFromDocument(a.documentFromRange(c)).focus(),d.releaseRange(c)}var i,s,l,d=this,c=d.getRange(),u=c.collapsed,f=null,m=d.editor.options.messages;c=d.lockRange(!0),i=p(c),s=i.length?d.formatter.finder.findSuitable(i[0]):null,l=this.createDialog(d._dialogTemplate(),{title:m.createLink,close:o,visible:!1}).find(".k-dialog-insert").click(n).end().find(".k-dialog-close").click(o).end().find(".k-edit-field input").keydown(function(e){var i=t.keys;e.keyCode==i.ENTER?n(e):e.keyCode==i.ESC&&o(e)}).end().find("#k-editor-link-url").val(s?s.getAttribute("href",2):"http://").end().find("#k-editor-link-text").val(i.length>0?1==i.length?i[0].nodeValue:i[0].nodeValue+i[1].nodeValue:"").end().find("#k-editor-link-title").val(s?s.title:"").end().find("#k-editor-link-target").attr("checked",s?"_blank"==s.target:!1).end().data("kendoWindow").center().open(),i.length>0&&!u&&(f=e("#k-editor-link-text",l.element).val()),e("#k-editor-link-url",l.element).focus().select()},redo:function(){var e=this,t=e.lockRange(!0);e.formatter.apply(t,e.attributes),e.releaseRange(t)}}),y=d.extend({init:function(t){this.options=t,this.finder=new f([{tags:["a"]}]),d.fn.init.call(this,e.extend(t,{command:v}))},initialize:function(e,t){d.fn.initialize.call(this,e,t),e.addClass("k-state-disabled")},update:function(e,t){e.toggleClass("k-state-disabled",!this.finder.isFormatted(t)).removeClass("k-state-hover")}});o(t.ui.editor,{LinkFormatFinder:h,LinkFormatter:g,UnlinkCommand:v,LinkCommand:b,UnlinkTool:y}),m("createLink",new d({key:"K",ctrl:!0,command:b,template:new c({template:s.buttonTemplate,title:"Create Link"})})),m("unlink",new y({key:"K",ctrl:!0,shift:!0,template:new c({template:s.buttonTemplate,title:"Remove Link"})}))}(window.kendo.jQuery),function(e,t){var n=window.kendo,o=e.extend,i=n.ui.editor,r=i.EditorUtils,a=i.Dom,s=r.registerTool,l=i.ToolTemplate,d=i.RangeUtils,c=i.Command,u=n.keys,f="#k-editor-image-url",p="#k-editor-image-title",m=c.extend({init:function(e){var t=this;c.fn.init.call(t,e),t.async=!0,t.attributes={}},insertImage:function(e,t){var n=this.attributes,o=d.documentFromRange(t);if(n.src&&"http://"!=n.src){if(!e)return e=a.create(o,"img",n),e.onload=e.onerror=function(){e.removeAttribute("complete"),e.removeAttribute("width"),e.removeAttribute("height")},t.deleteContents(),t.insertNode(e),e.nextSibling||a.insertAfter(o.createTextNode(""),e),t.setStartAfter(e),t.setEndAfter(e),d.selectRange(t),!0;a.attr(e,n)}return!1},_dialogTemplate:function(e){return n.template('<div class="k-editor-dialog k-popup-edit-form k-edit-form-container"># if (showBrowser) { #<div class="k-imagebrowser"></div># } #<div class=\'k-edit-label\'><label for="k-editor-image-url">#: messages.imageWebAddress #</label></div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-image-url"></div><div class=\'k-edit-label\'><label for="k-editor-image-title">#: messages.imageAltText #</label></div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-image-title"></div><div class="k-edit-buttons k-state-default"><button class="k-dialog-insert k-button">#: messages.dialogInsert #</button><button class="k-dialog-close k-button k-secondary">#: messages.dialogCancel #</button></div></div>')({messages:this.editor.options.messages,showBrowser:e})},redo:function(){var e=this,t=e.lockRange();e.insertImage(d.image(t),t)||e.releaseRange(t)},exec:function(){function i(e){var t=l.element;c.attributes={src:t.find(f).val().replace(/ /g,"%20"),alt:t.find(p).val()},h=c.insertImage(g,m),r(e),c.change&&c.change()}function r(e){e.preventDefault(),l.destroy(),a.windowFromDocument(d.documentFromRange(m)).focus(),h||c.releaseRange(m)}function s(e){e.keyCode==u.ENTER?i(e):e.keyCode==u.ESC&&r(e)}var l,c=this,m=c.lockRange(),h=!1,g=d.image(m),v=c.editor.options,b=v.messages,y=v.imageBrowser,k=!!(n.ui.ImageBrowser&&y&&y.transport&&y.transport.read!==t);l=this.createDialog(c._dialogTemplate(k),{title:b.insertImage,close:r,visible:!1,resizable:k,activate:function(){if(k){var e=this;new n.ui.ImageBrowser(e.element.find(".k-imagebrowser"),o({},y,{change:function(){e.element.find(f).val(this.value())},apply:i}))}}}).toggleClass("k-imagebrowser-dialog",k).find(".k-dialog-insert").click(i).end().find(".k-dialog-close").click(r).end().find(".k-edit-field input").keydown(s).end().find(f).val(g?g.getAttribute("src",2):"http://").end().find(p).val(g?g.alt:"").end().data("kendoWindow").center().open(),e(f,l.element).focus().select()}});n.ui.editor.ImageCommand=m,s("insertImage",new i.Tool({command:m,template:new l({template:r.buttonTemplate,title:"Insert Image"})}))}(window.kendo.jQuery),function(e,t){var n=window.kendo,o=n.ui.DropDownList,i=n.ui.editor.Dom,r=o.extend({init:function(e,t){var i=this;o.fn.init.call(i,e,t),i.value(i.options.title),n.support.mobileOS.ios&&i._initSelectOverlay(e),i.bind("open",function(){if(i.options.autoSize){var e,t=i.list;t.css({whiteSpace:"nowrap",width:"auto"}),e=t.width(),e?e+=20:e=i._listWidth,t.css("width",e+n.support.scrollbar()),i._listWidth=e}})},options:{name:"SelectBox"},_initSelectOverlay:function(t){var n,o,i;t=e(t),n=e("<select class='k-select-overlay' />"),o=t.closest(".k-widget"),i=t.data(this.type).kendoSelectBox,n.on("change",function(){i.value(this.value),i.trigger("change")}),this.bind("dataBound",function(){var e,t,o=i.value(),r=this.dataSource.view(),a="";for(t=0;t<r.length;t++)e=r[t],a+="<option value='"+e.value+"'",e.value==o&&(a+=" selected"),a+=">"+e.text+"</option>";n.html(a)}),n.insertAfter(o)},value:function(e){var n=this,i=o.fn.value.call(n,e);return e===t?i:(e!==o.fn.value.call(n)&&(n.text(n.options.title),n._current&&n._current.removeClass("k-state-selected"),n.current(null),n._oldIndex=n.selectedIndex=-1),t)},decorate:function(e){var t,n,o,r=this.dataSource.data();for(t=0;t<r.length;t++)n=r[t].tag||"span",o=r[t].className,r[t].style=i.inlineStyle(e,n,{className:o})+";display:inline-block";this.dataSource.trigger("change")}});n.ui.plugin(r),n.ui.editor.SelectBox=r}(window.kendo.jQuery),function(e,t){function n(n,o){var i="rtl"==e(n).css("direction"),r=i?"Right":"Left",a="td"!=s.name(n)?"margin"+r:"padding"+r;return o===t?n.style[a]||0:(o>0?n.style[a]=o+"px":(n.style[a]="",n.style.cssText||n.removeAttribute("style")),t)}var o=window.kendo,i=o.Class,r=e.extend,a=o.ui.editor,s=a.Dom,l=a.EditorUtils,d=l.registerTool,c=a.Command,u=a.Tool,f=a.ToolTemplate,p=a.RangeUtils,m=s.blockElements,h=a.BlockFormatFinder,g=a.BlockFormatter,v=i.extend({init:function(){this.finder=new h([{tags:s.blockElements}])},apply:function(t){var o,i,r,a,l,d,c,u,f,p,m=this.finder.findSuitable(t),h=[];if(m.length){for(o=0,i=m.length;i>o;o++)s.is(m[o],"li")?e(m[o]).index()?e.inArray(m[o].parentNode,h)<0&&h.push(m[o]):h.push(m[o].parentNode):h.push(m[o]);for(;h.length;)if(r=h.shift(),s.is(r,"li"))if(a=r.parentNode,l=e(r).prev("li"),d=l.find("ul,ol").last(),c=e(r).children("ul,ol")[0],c&&l[0])d[0]?(d.append(r),d.append(e(c).children()),s.remove(c)):(l.append(c),c.insertBefore(r,c.firstChild));else for(c=l.children("ul,ol")[0],c||(c=s.create(r.ownerDocument,s.name(a)),l.append(c));r&&r.parentNode==a;)c.appendChild(r),r=h.shift();else for(u=parseInt(n(r),10)+30,n(r,u),f=0;f<h.length;f++)e.contains(r,h[f])&&h.splice(f,1)}else p=new g([{tags:["p"]}],{style:{marginLeft:30}}),p.apply(t)},remove:function(t){var o,i,r,a,s,l,d,c,u=this.finder.findSuitable(t);for(i=0,r=u.length;r>i;i++){if(d=e(u[i]),d.is("li")){if(a=d.parent(),s=a.parent(),s.is("li,ul,ol")&&!n(a[0])){if(o&&e.contains(o,s[0]))continue;l=d.nextAll("li"),l.length&&e(a[0].cloneNode(!1)).appendTo(d).append(l),s.is("li")?d.insertAfter(s):d.appendTo(s),a.children("li").length||a.remove();continue}if(o==a[0])continue;o=a[0]}else o=u[i];c=parseInt(n(o),10)-30,n(o,c)}}}),b=c.extend({init:function(e){e.formatter={toggle:function(e){(new v).apply(p.nodes(e))}},c.fn.init.call(this,e)}}),y=c.extend({init:function(e){e.formatter={toggle:function(e){(new v).remove(p.nodes(e))}},c.fn.init.call(this,e)}}),k=u.extend({init:function(e){u.fn.init.call(this,e),this.finder=new h([{tags:m}])},initialize:function(e,t){u.fn.initialize.call(this,e,t),e.addClass("k-state-disabled")},update:function(o,i){var r,a,l,d,c=this.finder.findSuitable(i);for(l=0,d=c.length;d>l;l++)if(r=n(c[l]),r||(a=e(c[l]).parents("ul,ol").length,r=s.is(c[l],"li")&&(a>1||n(c[l].parentNode))||s.ofType(c[l],["ul","ol"])&&a>0),r)return o.removeClass("k-state-disabled"),t;o.addClass("k-state-disabled").removeClass("k-state-hover")}});r(a,{IndentFormatter:v,IndentCommand:b,OutdentCommand:y,OutdentTool:k}),d("indent",new u({command:b,template:new f({template:l.buttonTemplate,title:"Indent"})})),d("outdent",new k({command:y,template:new f({template:l.buttonTemplate,title:"Outdent"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=e.extend,o=t.ui.editor,i=o.Dom,r=o.RangeUtils,a=o.EditorUtils,s=o.Command,l=o.Tool,d=o.ToolTemplate,c=s.extend({init:function(e){var t=this;t.options=e,s.fn.init.call(t,e),t.attributes=null,t.async=!0},exec:function(){function n(e){s.value(u.find(p).val()),o(e),a.change&&a.change(),s.trigger("change")}function o(e){e.preventDefault(),u.data("kendoWindow").destroy();try{i.windowFromDocument(r.documentFromRange(l)).focus()}catch(t){}}var a=this,s=a.editor,l=s.getRange(),d=s.options.messages,u=e(t.template(c.template)(d)).appendTo(document.body),f=c.indent(s.value()),p=".k-editor-textarea";this.createDialog(u,{title:d.viewHtml,close:o,visible:!1}).find(p).val(f).end().find(".k-dialog-update").click(n).end().find(".k-dialog-close").click(o).end().data("kendoWindow").center().open(),u.find(p).focus()}});n(c,{template:"<div class='k-editor-dialog'><textarea class='k-editor-textarea k-input'></textarea><div class='k-button-wrapper'><button class='k-dialog-update k-button'>#: dialogUpdate #</button> #: dialogButtonSeparator # <a href='\\#' class='k-dialog-close k-link'>#: dialogCancel #</a></div></div>",indent:function(e){return e.replace(/<\/(p|li|ul|ol|h[1-6]|table|tr|td|th)>/gi,"</$1>\n").replace(/<(ul|ol)([^>]*)><li/gi,"<$1$2>\n<li").replace(/<br \/>/gi,"<br />\n").replace(/\n$/,"")}}),t.ui.editor.ViewHtmlCommand=c,o.EditorUtils.registerTool("viewHtml",new l({command:c,template:new d({template:a.buttonTemplate,title:"View HTML"})}))}(window.kendo.jQuery),function(e){function t(t,n,o){return c.extend({init:function(e){c.fn.init.call(this,e),this.finder=o},command:function(t){var o=t.value;return e.isPlainObject(o)?o[n]=o.value:(t.value={},t.value[n]=o),c.fn.command.call(this,t)},initialize:function(e,t){var o,i=window.console,r=this.options.items;for(o=0;o<r.length;o++)r[o][n]=r[o].value;i&&i.warn("The `"+this.options.name+"` tool has been deprecated in favor of the `formatting` tool. See http://docs.kendoui.com/getting-started/changes-and-backward-compatibility for more information"),c.fn.initialize.call(this,e,t)}})}var n=window.kendo,o=n.ui.editor,i=o.Tool,r=o.ToolTemplate,a=o.DelayedExecutionTool,s=o.Dom,l=o.EditorUtils.dropDownListTemplate,d=o.EditorUtils.registerTool,c=a.extend({init:function(e){var t=this;i.fn.init.call(t,n.deepExtend({},t.options,e)),t.type="kendoSelectBox",t.finder={getFormat:function(){return""}}},options:{items:[{text:"Paragraph",value:"p"},{text:"Quotation",value:"blockquote"},{text:"Heading 1",value:"h1"},{text:"Heading 2",value:"h2"},{text:"Heading 3",value:"h3"},{text:"Heading 4",value:"h4"},{text:"Heading 5",value:"h5"},{text:"Heading 6",value:"h6"}],width:90},toFormattingItem:function(e){var t,n=e.value;return n?e.tag||e.className?e:(t=n.indexOf("."),0===t?e.className=n.substring(1):-1==t?e.tag=n:(e.tag=n.substring(0,t),e.className=n.substring(t+1)),e):e},command:function(e){var t=e.value;return t=this.toFormattingItem(t),new o.FormatCommand({range:e.range,formatter:function(){var e,n=(t.tag||t.context||"span").split(","),i=[{tags:n,attr:{className:t.className||""}}];return e=s.inlineElements.indexOf(n[0])>=0?new o.GreedyInlineFormatter(i):new o.GreedyBlockFormatter(i)}})},initialize:function(e,t){var o=t.editor,r=this.options,a=r.name,s=this;e.width(r.width),e.kendoSelectBox({dataTextField:"text",dataValueField:"value",dataSource:r.items||o.options[a],title:o.options.messages[a],autoSize:!0,change:function(){i.exec(o,a,this.dataItem().toJSON())},dataBound:function(){var e,t=this.dataSource.data();for(e=0;e<t.length;e++)t[e]=s.toFormattingItem(t[e])},highlightFirst:!1,template:n.template('<span unselectable="on" style="display:block;#=data.style#">#:data.text#</span>')}),e.addClass("k-decorated").closest(".k-widget").removeClass("k-"+a).find("*").addBack().attr("unselectable","on")},getFormattingValue:function(t,n){var o,i,r,a,s,l,d;for(o=0;o<t.length;o++)if(i=t[o],r=i.tag||i.context||"",a=i.className?"."+i.className:"",s=r+a,l=e(n[0]).closest(s)[0]){if(1==n.length)return i.value;for(d=1;d<n.length&&e(n[d]).closest(s)[0]==l;d++)if(d==n.length-1)return i.value}return""},update:function(t,n){var o,i,r,l,d,c=e(t).data(this.type);if(c){for(r=c.dataSource,l=r.data(),d=s.commonAncestor.apply(null,n),o=0;o<l.length;o++)i=l[o].context,l[o].visible=!i||!!e(d).closest(i).length;r.filter([{field:"visible",operator:"eq",value:!0}]),a.fn.update.call(this,t,n),c.value(this.getFormattingValue(r.view(),n)),c.wrapper.toggleClass("k-state-disabled",!r.view().length)}}}),u=t("style","className",new o.GreedyInlineFormatFinder([{tags:["span"]}],"className")),f=t("formatBlock","tag",new o.BlockFormatFinder([{tags:s.blockElements}]));e.extend(o,{FormattingTool:c,StyleTool:u,FormatBlockTool:f}),d("formatting",new c({template:new r({template:l,title:"Format"})})),d("style",new u({template:new r({template:l,title:"Styles"})})),d("formatBlock",new f({template:new r({template:l})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.ui,o=n.editor,i=n.Widget,r=e.extend,a=e.proxy,s=t.keys,l=".kendoEditor",d=".k-colorpicker,a.k-tool-icon:not(.k-state-disabled),.k-selectbox, .k-combobox .k-input",c=i.extend({init:function(e,t){var n=this;t=r({},t,{name:"EditorToolbar"}),i.fn.init.call(n,e,t),t.popup&&n._initPopup()},events:["execute"],groups:{basic:["bold","italic","underline","strikethrough"],scripts:["subscript","superscript"],alignment:["justifyLeft","justifyCenter","justifyRight","justifyFull"],links:["insertImage","createLink","unlink"],lists:["insertUnorderedList","insertOrderedList","indent","outdent"],tables:["createTable","addColumnLeft","addColumnRight","addRowAbove","addRowBelow","deleteRow","deleteColumn"],advanced:["viewHtml"]},_initPopup:function(){this.window=e(this.element).wrap("<div class='editorToolbarWindow k-header' />").parent().prepend("<button class='k-button k-button-bare k-editortoolbar-dragHandle'><span class='k-icon k-i-move' /></button>").kendoWindow({title:!1,resizable:!1,draggable:{dragHandle:".k-editortoolbar-dragHandle"},animation:{open:{effects:"fade:in"},close:{effects:"fade:out"}},minHeight:42,visible:!1,autoFocus:!1,actions:[],dragend:function(){this._moved=!0}}).on("mousedown",function(t){e(t.target).is(".k-icon")||t.preventDefault()}).data("kendoWindow")},items:function(){return this.element.children().find("> *, select")},focused:function(){return this.element.find(".k-state-focused").length>0},toolById:function(e){var t,n=this.tools;for(t in n)if(t.toLowerCase()==e)return n[t]},toolGroupFor:function(t){var n,o=this.groups;for(n in o)if(e.inArray(t,o[n])>=0)return n},bindTo:function(t){var n=this,o=n.window;n._editor&&n._editor.unbind("select",a(n._update,n)),n._editor=t,n.tools=n.expandTools(t.options.tools),n.render(),n.element.find(".k-combobox .k-input").keydown(function(t){var n=e(this).closest(".k-combobox").data("kendoComboBox"),o=t.keyCode;o==s.RIGHT||o==s.LEFT?n.close():o==s.DOWN&&(n.dropDown.isOpened()||(t.stopImmediatePropagation(),n.open()))}),n._attachEvents(),n.items().each(function(){var o,i=n._toolFromClassName(this),r=n.tools[i],a=t.options.messages,s=a[i],l=e(this);r&&r.initialize&&(("fontSize"==i||"fontName"==i)&&(o=a[i+"Inherit"],l.find("input").val(o).end().find("span.k-input").text(o).end()),r.initialize(l,{title:n._appendShortcutSequence(s,r),editor:n._editor}))}),t.bind("select",a(n._update,n)),n._updateContext(),n.updateGroups(),o&&o.wrapper.css({top:"",left:"",width:""})},show:function(){var e,t,n=this,o=n.window,i=n.options.editor;o&&(e=o.wrapper,t=i.element,e.is(":visible")&&n.window.options.visible||(e[0].style.width||e.width(t.outerWidth()-parseInt(e.css("border-left-width"),10)-parseInt(e.css("border-right-width"),10)),o._moved||(e.css("top",parseInt(t.offset().top,10)-e.outerHeight()-parseInt(n.window.element.css("padding-bottom"),10)),e.css("left",parseInt(t.offset().left,10))),o.open()))},hide:function(){this.window&&this.window.close()},focus:function(){var e="tabIndex",t=this._editor.element,n=t.attr(e);t.attr(e,n||0).focus().find("li:has("+d+")").first().focus(),n||0===n||t.removeAttr(e)},_appendShortcutSequence:function(e,t){if(!t.key)return e;var n=e+" (";return t.ctrl&&(n+="Ctrl + "),t.shift&&(n+="Shift + "),t.alt&&(n+="Alt + "),n+=t.key+")"},_nativeTools:["insertLineBreak","insertParagraph","redo","undo"],tools:{},expandTools:function(n){var i,a,s,l,d=this._nativeTools,c=t.deepExtend({},t.ui.Editor.defaultTools),u={};for(a=0;a<n.length;a++)i=n[a],l=i.name,e.isPlainObject(i)?l&&c[l]?(u[l]=r({},c[l]),r(u[l].options,i)):(s=r({cssClass:"k-i-custom",type:"button",title:""},i),s.name||(s.name="custom"),s.cssClass="k-"+("custom"==s.name?"i-custom":s.name),s.template||"button"!=s.type||(s.template=o.EditorUtils.buttonTemplate),u[l]={options:s}):c[i]&&(u[i]=c[i]);for(a=0;a<d.length;a++)u[d[a]]||(u[d[a]]=c[d[a]]);return u},render:function(){var n,o,i,r,s=this.tools,l=this._editor.element,d=this.element.empty();d.empty();for(r in s)n=s[r]&&s[r].options,o=n&&n.template,o&&(o.getHtml?o=o.getHtml():(e.isFunction(o)||(o=t.template(o)),o=o(n)),0!==o.indexOf("<li")&&(o="<li class='k-editor-template'>"+o+"</li>"),i=e(o).appendTo(d),"button"==n.type&&n.exec&&i.find(".k-tool-icon").click(a(n.exec,l[0])))},updateGroups:function(){var t,n,o,i,r=this,a=r.element,s=/k-group-end/,l=!1;a.children().filter(".k-group-break").remove(),i=a.children().filter(function(){return!e(this).children(".k-state-disabled").length}),i.each(function(a,s){var d,c,u;s=e(s),d=r._toolFromClassName(s.children()[0]),c=r.toolGroupFor(d),u=a==i.length-1,o=n!=c,n=c,t&&o&&t.addClass("k-group-end"),l=l||o,s.toggleClass("k-group-start",o||!l&&u).toggleClass("k-group-end",u),t=s}),r.element.children(".k-group-start").each(function(){for(var t,n=this;!s.test(n.className);)n=n.nextSibling,t=n.offsetLeft+n.offsetWidth;t>this.parentNode.offsetWidth&&e(this).before("<li class='k-group-break' />")})},_attachEvents:function(){var t=this,n=".k-editor-button .k-tool-icon",o=n+":not(.k-state-disabled)",i=n+".k-state-disabled";t.element.off(l).on("mouseenter"+l,o,function(){e(this).addClass("k-state-hover")}).on("mouseleave"+l,o,function(){e(this).removeClass("k-state-hover")}).on("mousedown"+l,n,!1).on("keydown"+l,d,function(n){var o,i=e(this).closest("li"),r="li:has("+d+")",a=n.keyCode;if(a==s.RIGHT)o=i.nextAll(r).first().find(d);else if(a==s.LEFT)o=i.prevAll(r).first().find(d);
+else if(a==s.ESC)o=t;else if(a==s.TAB&&!n.ctrlKey&&!n.altKey)if(n.shiftKey){if(o=i.prevAll(r).first().find(d),!o.length)return;n.preventDefault()}else n.preventDefault(),o=i.nextAll(r).first().find(d),o.length||(o=t);o&&o.focus()}).on("click"+l,o,function(n){var o=e(this);n.preventDefault(),n.stopPropagation(),o.removeClass("k-state-hover"),o.is("[data-popup]")||t._editor.exec(t._toolFromClassName(this))}).on("click"+l,i,function(e){e.preventDefault()})},_toolFromClassName:function(t){if(t){var n=e.grep(t.className.split(" "),function(e){return!/^k-(widget|tool-icon|state-hover|header|combobox|dropdown|selectbox|colorpicker)$/i.test(e)});return n[0]?n[0].substring(n[0].lastIndexOf("-")+1):"custom"}},_update:function(){var n=this,o=n._editor,i=o.getRange(),r=t.ui.editor.RangeUtils.textNodes(i);r.length||(r=[i.startContainer]),n.items().each(function(){var t=n.tools[n._toolFromClassName(this)];t&&t.update&&t.update(e(this),r)}),this._updateContext(),n.updateGroups()},_updateContext:function(){this.element.children().show().filter(":has(.k-state-disabled)").hide()}});e.extend(o,{Toolbar:c})}(window.jQuery),function(e){var t=window.kendo,n=e.extend,o=e.proxy,i=t.ui.editor,r=i.Dom,a=i.EditorUtils,s=i.Command,l=".kendoEditor",d="k-state-active",c="k-state-selected",u=i.Tool,f=i.ToolTemplate,p=i.BlockFormatFinder,m=i.EditorUtils.registerTool,h="<td contentEditable='true'>"+i.emptyElementContent+"</td>",g=new p([{tags:["table"]}]),v=s.extend({_tableHtml:function(e,t){return e=e||1,t=t||1,"<table class='k-table' contentEditable='false' data-last>"+Array(e+1).join("<tr>"+Array(t+1).join(h)+"</tr>")+"</table>"},exec:function(){var t,n,o=this.options,i=this.editor,r=this._tableHtml(o.rows,o.columns);i.selectRange(o.range),i.clipboard.paste(r),t=i.getRange(),n=e("table[data-last]",i.document).removeAttr("data-last"),t.selectNodeContents(n.find("td")[0]),i.selectRange(t)}}),b=u.extend({initialize:function(t,n){u.fn.initialize.call(this,t,n);var i=e(this.options.popupTemplate).appendTo("body").kendoPopup({anchor:t,copyAnchorStyles:!1,open:o(this._open,this),activate:o(this._activate,this),close:o(this._close,this)}).data("kendoPopup");t.click(o(this._toggle,this)),this._editor=n.editor,this._popup=i},popup:function(){return this._popup},_activate:e.noop,_open:function(){this._popup.options.anchor.addClass(d)},_close:function(){this._popup.options.anchor.removeClass(d)},_toggle:function(t){var n=e(t.target).closest(".k-tool-icon");n.hasClass("k-state-disabled")||this.popup().toggle()},update:function(e){this.popup().close(),e.removeClass("k-state-hover")}}),y=b.extend({init:function(t){this.cols=8,this.rows=6,b.fn.init.call(this,e.extend(t,{command:v,popupTemplate:"<div class='k-ct-popup'>"+Array(this.cols*this.rows+1).join("<div class='k-ct-cell k-state-disabled' />")+"<div class='k-status'>Cancel</div>"+"</div>"}))},_activate:function(){function n(t){var n=e(window);return{row:Math.floor((t.clientY+n.scrollTop()-m.top)/r)+1,col:Math.floor((t.clientX+n.scrollLeft()-m.left)/i)+1}}function o(e){return e.row>0&&e.col>0&&e.row<=v&&e.col<=g}var i,r,a=this,s=a._popup.element,d=s.find(".k-status"),u=s.find(".k-ct-cell"),f=u.eq(0),p=u.eq(u.length-1),m=t.getOffset(f),h=t.getOffset(p),g=a.cols,v=a.rows;h.left+=p[0].offsetWidth,h.top+=p[0].offsetHeight,i=(h.left-m.left)/g,r=(h.top-m.top)/v,s.on("mousemove"+l,function(i){var r=n(i);o(r)?(d.text(t.format("Create a {0} x {1} table",r.row,r.col)),u.each(function(t){e(this).toggleClass(c,t%g<r.col&&t/g<r.row)})):(d.text("Cancel"),u.removeClass(c))}).on("mouseleave"+l,function(){u.removeClass(c),d.text("Cancel")}).on("mousedown"+l,!1).on("mouseup"+l,function(e){var t=n(e);o(t)&&(a._editor.exec("createTable",{rows:t.row,columns:t.col}),a._popup.close())})},_open:function(){b.fn._open.call(this),this.popup().element.find(".k-ct-cell").removeClass(c)},_close:function(){b.fn._close.call(this),this.popup().element.off(l)},update:function(e,t){var n;b.fn.update.call(this,e),n=g.isFormatted(t),e.toggleClass("k-state-disabled",n)}}),k=s.extend({exec:function(){for(var e,t,n,o,a=this.lockRange(!0),s=a.endContainer;"td"!=r.name(s);)s=s.parentNode;for(t=s.parentNode,e=t.children.length,n=t.cloneNode(!0),o=0;o<t.cells.length;o++)n.cells[o].innerHTML=i.emptyElementContent;"before"==this.options.position?r.insertBefore(n,t):r.insertAfter(n,t),this.releaseRange(a)}}),w=s.extend({exec:function(){var e,t,n,o,a=this.lockRange(!0),s=r.closest(a.endContainer,"td"),l=r.closest(s,"table"),d=l.rows,c=this.options.position;for(e=r.findNodeIndex(s),t=0;t<d.length;t++)n=d[t].cells[e],o=n.cloneNode(),o.innerHTML=i.emptyElementContent,"before"==c?r.insertBefore(o,n):r.insertAfter(o,n);this.releaseRange(a)}}),C=s.extend({exec:function(){var e,t=this.lockRange(),n=r.closest(t.endContainer,"tr"),o=r.closest(n,"table"),i=o.rows.length;1==i?(e=r.next(o)||r.prev(o),r.remove(o)):(r.removeTextSiblings(n),e=r.next(n)||r.prev(n),e=e.cells[0],r.remove(n)),e&&(t.setStart(e,0),t.collapse(!0),this.editor.selectRange(t))}}),x=s.extend({exec:function(){var e,t,n=this.lockRange(),o=r.closest(n.endContainer,"td"),i=r.closest(o,"table"),a=i.rows,s=r.findNodeIndex(o,!0),l=a[0].cells.length;if(1==l)e=r.next(i)||r.prev(i),r.remove(i);else for(r.removeTextSiblings(o),e=r.next(o)||r.prev(o),t=0;t<a.length;t++)r.remove(a[t].cells[s]);e&&(n.setStart(e,0),n.collapse(!0),this.editor.selectRange(n))}}),T=u.extend({command:function(e){return e=n(e,this.options),"delete"==e.action?"row"==e.type?new C(e):new x(e):"row"==e.type?new k(e):new w(e)},initialize:function(e,t){u.fn.initialize.call(this,e,t),e.addClass("k-state-disabled")},update:function(e,t){var n=!g.isFormatted(t);e.toggleClass("k-state-disabled",n)}});n(t.ui.editor,{PopupTool:b,TableCommand:v,InsertTableTool:y,TableModificationTool:T,InsertRowCommand:k,InsertColumnCommand:w,DeleteRowCommand:C,DeleteColumnCommand:x}),m("createTable",new y({template:new f({template:a.buttonTemplate,popup:!0,title:"Create table"})})),m("addColumnLeft",new T({type:"column",position:"before",template:new f({template:a.buttonTemplate,title:"Add column on the left"})})),m("addColumnRight",new T({type:"column",template:new f({template:a.buttonTemplate,title:"Add column on the right"})})),m("addRowAbove",new T({type:"row",position:"before",template:new f({template:a.buttonTemplate,title:"Add row above"})})),m("addRowBelow",new T({type:"row",template:new f({template:a.buttonTemplate,title:"Add row below"})})),m("deleteRow",new T({type:"row",action:"delete",template:new f({template:a.buttonTemplate,title:"Delete row"})})),m("deleteColumn",new T({type:"column",action:"delete",template:new f({template:a.buttonTemplate,title:"Delete column"})}))}(window.kendo.jQuery)});
\ No newline at end of file