text: /*
  * Kendo UI v2014.1.416 (http://www.telerik.com/kendo-ui)
  * Copyright 2014 Telerik AD. All rights reserved.
  *
  * Kendo UI commercial licenses may be obtained at
  * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete
  * If you do not own a commercial license, this file shall be governed by the trial license terms.
  */
  !function(e,define){define(["./kendo.combobox.min","./kendo.dropdownlist.min","./kendo.window.min","./kendo.colorpicker.min","./kendo.imagebrowser.min"],e)}(function(){return function(e,t){var n,i,o,r=window.kendo,a=r.Class,s=r.ui.Widget,l=r.support.mobileOS,d=r.support.browser,c=e.extend,u=e.proxy,p=r.deepExtend,f=".kendoEditor",h=r.keys,g=a.extend({init:function(e){this.options=e},getHtml:function(){var e=this.options;return r.template(e.template,{useWithBlock:!1})(e)}}),m={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" /></td></tr><tr><td class="k-editable-area" /></tr></tbody></table>',buttonTemplate:'<a href="" role="button" class="k-tool"#= data.popup ? " data-popup" : "" # unselectable="on" title="#= data.title #"><span class="k-tool-icon #= data.cssClass #">#= data.title #</span></a>',colorPickerTemplate:'<div class="k-colorpicker #= data.cssClass #" />',comboBoxTemplate:'<select title="#= data.title #" class="#= data.cssClass #" />',dropDownListTemplate:'<span class="k-editor-dropdown"><select title="#= data.title #" class="#= data.cssClass #" /></span>',separatorTemplate:'<span class="k-separator" />',formatByName:function(t,n){for(var i=0;n.length>i;i++)if(e.inArray(t,n[i].tags)>=0)return n[i]},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()),b.defaultTools[e]=t},registerFormat:function(e,t){b.fn.options.formats[e]=t}},v={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",imageWidth:"Width (px)",imageHeight:"Height (px)",linkWebAddress:"Web address",linkText:"Text",linkToolTip:"ToolTip",linkOpenInNewWindow:"Open link in new window",dialogUpdate:"Update",dialogInsert:"Insert",dialogButtonSeparator:"or",dialogCancel:"Cancel",createTable:"Create table",addColumnLeft:"Add column on the left",addColumnRight:"Add column on the right",addRowAbove:"Add row above",addRowBelow:"Add row below",deleteRow:"Delete row",deleteColumn:"Delete column"},_=!l||l.ios&&l.flatVersion>=500||!l.ios&&t!==document.documentElement.contentEditable,k={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"]},b=s.extend({init:function(t,n){var i,o,a,l,d=this,h=r.ui.editor;_&&(s.fn.init.call(d,t,n),d.options=p({},d.options,n),t=d.element,l=h.Dom.name(t[0]),t.closest("form").on("submit"+f,function(){d.update()}),a=c({},d.options),a.editor=d,"textarea"==l?(d._wrapTextarea(),o=d.wrapper.find(".k-editor-toolbar"),t[0].id&&o.attr("aria-controls",t[0].id)):(d.element.attr("contenteditable",!0).addClass("k-widget k-editor k-editor-inline"),a.popup=!0,o=e('<ul class="k-editor-toolbar" role="toolbar" />').insertBefore(t)),d.toolbar=new h.Toolbar(o[0],a),d.toolbar.bindTo(d),d._initializeContentElement(d),d.keyboard=new h.Keyboard([new h.TypingHandler(d),new h.SystemHandler(d)]),d.clipboard=new h.Clipboard(this),d.undoRedoStack=new h.UndoRedoStack,i=n&&n.value?n.value:d.textarea?t.val().replace(/[\r\n\v\f\t ]+/gi," "):t[0].innerHTML,d.value(i),e(document).on("mousedown",u(d._endTyping,d)).on("mouseup",u(d._mouseup,d)),r.notify(d))},_endTyping:function(){var e=this.keyboard;try{e.isTypingInProgress()&&(e.endTyping(!0),this.saveSelection())}catch(t){}},_selectionChange:function(){d.msie||r.ui.editor.Dom.ensureTrailingBreaks(this.body),this._selectionStarted=!1,this.saveSelection(),this.trigger("select",{})},_wrapTextarea:function(){var t=this,n=t.element,i=n[0].style.width,o=n[0].style.height,r=m.editorWrapperTemplate,a=e(r).insertBefore(n).width(i).height(o),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,i,o,a=this,s=a.textarea,l=a.options.domain,d=l||document.domain,c="",u='javascript:""';return(l||d!=location.hostname)&&(c='<script>document.domain="'+d+'"</script>',u="javascript:document.write('"+c+"')"),s.hide(),n=e("<iframe />",{frameBorder:"0"})[0],e(n).css("display","").addClass("k-content").insertBefore(s),n.src=u,i=n.contentWindow||n,o=i.document||n.contentDocument,e(n).one("load",function(){a.toolbar.decorateFrom(o.body)}),o.open(),o.write("<!DOCTYPE html><html><head><meta charset='utf-8' /><style>html,body{padding:0;margin:0;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;"+(r.support.isRtl(s)?"direction:rtl;":"")+"}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}span{-ms-high-contrast-adjust:none;}a{color:#00a}code{font-size:1.23em}telerik\\3Ascript{display: none;}.k-table{table-layout:fixed;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>"+c+"<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>"),o.close(),i},_blur:function(){var e=this.textarea,t=e?e.val():this._oldValue,n=this.options.encoded?this.encodedValue():this.value();this.update(),e&&e.trigger("blur"),n!=t&&this.trigger("change")},_initializeContentElement:function(){var n,i,o=this;o.textarea?(o.window=o._createContentElement(o.options.stylesheets),n=o.document=o.window.contentDocument||o.window.document,o.body=n.body,i=o.window,e(n).on("mouseup"+f,u(o._mouseup,o))):(o.window=window,n=o.document=document,o.body=o.element[0],i=o.body,o.toolbar.decorateFrom(o.body)),e(i).on("blur"+f,u(this._blur,this));try{n.execCommand("enableInlineTableEditing",null,!1)}catch(a){}r.support.touch&&e(n).on("selectionchange"+f,u(this._selectionChange,this)).on("keydown"+f,function(){r._activeElement()!=n.body&&o.window.focus()}),e(o.body).on("keydown"+f,function(e){var n,i,a,s,l,c,p,f,g;return e.keyCode===h.F10?(setTimeout(u(o.toolbar.focus,o.toolbar),100),e.preventDefault(),t):(e.keyCode===h.BACKSPACE?(n=o.getRange(),a=d.msie?"":'<br _moz_dirty="" />',s=r.ui.editor.Dom,n.deleteContents(),i=n.commonAncestorContainer,"p"===s.name(i)&&""===i.innerHTML&&(i.innerHTML=a,n.setStart(i,0),n.collapse(!0),o.selectRange(n))):(e.keyCode==h.LEFT||e.keyCode==h.RIGHT)&&(n=o.getRange(),l=e.keyCode==h.LEFT,c=n[l?"startContainer":"endContainer"],p=n[l?"startOffset":"endOffset"],f=l?-1:1,l&&(p-=1),p+f>0&&3==c.nodeType&&"﻿"==c.nodeValue[p]&&(n.setStart(c,p+f),n.collapse(!0),o.selectRange(n))),(g=o.keyboard.toolFromShortcut(o.toolbar.tools,e))?(e.preventDefault(),/^(undo|redo)$/.test(g)||o.keyboard.endTyping(!0),o.trigger("keydown",e),o.exec(g),!1):(o.keyboard.clearTimeout(),o.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)&&o._selectionChange(),o.keyboard.keyup(t)}).on("mousedown"+f,function(t){o._selectionStarted=!0;var n=e(t.target);!d.gecko&&2==t.which&&n.is("a[href]")&&window.open(n.attr("href"),"_new")}).on("click"+f,function(e){var t,n=r.ui.editor.Dom;"img"===n.name(e.target)&&(t=o.createRange(),t.selectNode(e.target),o.selectRange(t))}).on("cut"+f+" paste"+f,function(e){o.clipboard["on"+e.type](e)}).on("focusin"+f,function(){e(this).addClass("k-state-active"),o.toolbar.show()}).on("focusout"+f,function(){setTimeout(function(){var t=r._activeElement(),n=o.body,i=o.toolbar;t==n||e.contains(n,t)||i.focused()||(e(n).removeClass("k-state-active"),i.hide())},10)})},_mouseup:function(){var e=this;e._selectionStarted&&setTimeout(function(){e._selectionChange()},1)},refresh:function(){var e=this;e.textarea&&(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:v,formats:{},encoded:!0,domain:null,serialization:{entities:!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"],k.basic,k.alignment,k.lists,k.indenting,k.links,["insertImage"],k.tables)},destroy:function(){var t=this;s.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",u(t._endTyping,t)).off("mouseup",u(t._mouseup,t)),t.toolbar.destroy(),r.destroy(t.wrapper)},state:function(e){var t,n,i=b.defaultTools[e],o=i&&(i.options.finder||i.finder),a=r.ui.editor.RangeUtils;return o?(t=this.getRange(),n=a.textNodes(t),!n.length&&t.collapsed&&(n=[t.startContainer]),o.getFormat?o.getFormat(n):o.isFormatted(n)):!1},value:function(e){var n=this.body,i=r.ui.editor,o=i.Serializer.domToXhtml(n,this.options.serialization);return e===t?o:(e!=o&&(i.Serializer.htmlToDom(e,n),this.selectionRestorePoint=null,this.update()),t)},saveSelection:function(t){t=t||this.getRange();var n=t.commonAncestorContainer,i=this.body;(n==i||e.contains(i,n))&&(this.selectionRestorePoint=new r.ui.editor.RestorePoint(t))},_focusBody:function(){var e,t=this.body,n=this.document.documentElement;r._activeElement()!=t&&(e=n.scrollTop,t.focus(),n.scrollTop=e)},restoreSelection:function(){this._focusBody(),this.selectionRestorePoint&&this.selectRange(this.selectionRestorePoint.toRange())},focus:function(){this.restoreSelection()},update:function(e){e=e||this.options.encoded?this.encodedValue():this.value(),this.textarea?this.textarea.val(e):this._oldValue=e},encodedValue:function(){return r.ui.editor.Dom.encode(this.value())},createRange:function(e){return r.ui.editor.RangeUtils.createRange(e||this.document)},getSelection:function(){return r.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 r.ui.editor.Serializer.domToXhtml(this.getRange().cloneContents())},paste:function(e,t){this.clipboard.paste(e,t)},exec:function(e,n){var i,o,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(),o=a.toolbar.toolById(e),!o)for(r in b.defaultTools)if(r.toLowerCase()==e){o=b.defaultTools[r];break}if(o){if(i=a.getRange(),o.command&&(s=o.command(c({range:i},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=u(a._selectionChange,a),t;a._selectionChange()}}});b.defaultTools={undo:{options:{key:"Z",ctrl:!0}},redo:{options:{key:"Y",ctrl:!0}}},r.ui.plugin(b),n=a.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})},i=n.extend({init:function(e){n.fn.init.call(this,e)},command:function(e){var t=this;return new r.ui.editor.FormatCommand(c(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)}}),m.registerTool("separator",new n({template:new g({template:m.separatorTemplate})})),o=d.msie&&9>d.version?"﻿":"",c(r.ui,{editor:{ToolTemplate:g,EditorUtils:m,Tool:n,FormatTool:i,_bomFill:o,emptyElementContent:d.msie?"﻿":'<br _moz_dirty="" />'}})}(window.jQuery),function(e){function t(e){var t,n,i={};for(t=0,n=e.length;n>t;t++)i[e[t]]=!0;return i}var n,i,o,r,a,s,l,d,c,u,p=window.kendo,f=e.map,h=e.extend,g=p.support.browser,m="style",v="float",_="cssFloat",k="styleFloat",b="class",w="k-marker",y=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,map,menu,noframes,noscript,object,pre,script,table,tbody,td,tfoot,th,thead,tr,header,article,nav,footer,section,aside,main,figure,figcaption".split(","),C=x.concat(["ul","ol","li"]),T=t(C),S="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(","),F=t(S),D=t("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected".split(",")),E=function(e){1==e.nodeType&&e.normalize()};g.msie&&g.version>=8&&(E=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}}),n=/^\s+$/,i=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,o=/\ufeff/g,r=/^(\s+|\ufeff)$/,s="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(","),l=/[<>\&]/g,d=/[\u00A0-\u2666<>\&]/g,c={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"},u={block:T,inline:F,findNodeIndex:function(e,t){var n=0;if(!e)return-1;for(;;){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!u.isDataNode(t)&&(e.contains(t,u.isDataNode(n)?n.parentNode:n)||n.parentNode==t)}catch(i){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),i="",o=e;o.nextSibling&&3==o.nextSibling.nodeType&&o.nextSibling.nodeValue;)i+=o.nextSibling.nodeValue,o=o.nextSibling;e.deleteData(t,e.length),n.deleteData(0,t),n.nodeValue+=i,u.insertAfter(n,e)},attrEquals:function(e,t){var n,i;for(n in t)if(i=e[n],n==v&&(i=e[p.support.cssFloat?_:k]),"object"==typeof i){if(!u.attrEquals(i,t[n]))return!1}else if(i!=t[n])return!1;return!0},blockParentOrBody:function(e){return u.parentOfType(e,C)||e.ownerDocument.body},blockParents:function(t){var n,i,o,r=[];for(n=0,i=t.length;i>n;n++)o=u.parentOfType(t[n],u.blockElements),o&&e.inArray(o,r)<0&&r.push(o);return r},windowFromDocument:function(e){return e.defaultView||e.parentWindow},normalize:E,blockElements:C,nonListBlockElements:x,inlineElements:S,empty:y,fillAttrs:D,toHex:function(e){var t=i.exec(e);return t?"#"+f(t.slice(1),function(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}).join(""):e},encode:function(e,t){var n=!t||t.entities?d:l;return e.replace(n,function(e){var t=e.charCodeAt(0),n=c[t];return n?"&"+n+";":e})},stripBom:function(e){return(e||"").replace(o,"")},insignificant:function(e){var t=e.attributes;return"k-marker"==e.className||u.is(e,"br")&&(t._moz_dirty||t._moz_editor_bogus_node)},emptyNode:function(t){var n=e.grep(t.childNodes,function(e){return u.is(e,"br")?!1:u.insignificant(e)?!1:3==e.nodeType&&r.test(e.nodeValue)?!1:u.is(e,"p")&&u.emptyNode(e)?!1:!0});return!n.length},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 n.test(e.nodeValue)},isBlock:function(e){return T[u.name(e)]},isEmpty:function(e){return y[u.name(e)]},isInline:function(e){return F[u.name(e)]},scrollContainer:function(e){var t=u.windowFromDocument(e),n=(t.contentWindow||t).document||t.ownerDocument||t;return n=p.support.browser.webkit||"BackCompat"==n.compatMode?n.body:n.documentElement},scrollTo:function(t){var n,i,o=e(u.isDataNode(t)?t.parentNode:t),r=u.windowFromDocument(t.ownerDocument),a=r.innerHeight,s=u.scrollContainer(t.ownerDocument);"br"==u.name(o[0])&&(o=o.parent()),n=o.offset().top,i=o[0].offsetHeight,i+n>s.scrollTop+a&&(s.scrollTop=i+n-a)},persistScrollTop:function(e){a=u.scrollContainer(e).scrollTop},restoreScrollTop:function(e){u.scrollContainer(e).scrollTop=a},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],u.isDataNode(n)?(u.stripBom(n.nodeValue).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},closest:function(e,t){for(;e&&u.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 u.sibling(e,"nextSibling")},prev:function(e){return u.sibling(e,"previousSibling")},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,i,o,r,a,s=u.create(e.ownerDocument,t),l=e.attributes;for(n=0,i=l.length;i>n;n++)a=l[n],a.specified&&(o=a.nodeName,r=a.nodeValue,o==b?s.className=r:o==m?s.style.cssText=e.style.cssText:s.setAttribute(o,r));for(;e.firstChild;)s.appendChild(e.firstChild);return u.insertBefore(s,e),u.remove(e),s},editableParent:function(e){for(;3==e.nodeType||"true"!==e.contentEditable;)e=e.parentNode;return e},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=h({},t),t&&m in t&&(u.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 h(e,t)},style:function(t,n){e(t).css(n||{})},unstyle:function(e,t){for(var n in t)n==v&&(n=p.support.cssFloat?_:k),e.style[n]="";""===e.style.cssText&&e.removeAttribute(m)},inlineStyle:function(t,n,i){var o,r=e(u.create(t.ownerDocument,n,i));return t.appendChild(r[0]),o=f(s,function(e){return g.msie&&"line-height"==e&&"1px"==r.css(e)?"line-height:1.5":e+":"+r.css(e)}).join(";"),r.remove(),o},getEffectiveBackground:function(e){var t=e.css("background-color");return t.indexOf("rgba(0, 0, 0, 0")<0&&"transparent"!==t?t:"html"===e[0].tagName.toLowerCase()?"Window":u.getEffectiveBackground(e.parent())},removeClass:function(t,n){var i,o,r=" "+t.className+" ",a=n.split(" ");for(i=0,o=a.length;o>i;i++)r=r.replace(" "+a[i]+" "," ");r=e.trim(r),r.length?t.className=r:t.removeAttribute(b)},commonAncestor:function(){var e,t,n,i,o,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(i=a[0][e],o=1;r>o;o++)if(i!=a[o][e])return l;l=i}return l},closestSplittableParent:function(t){var n,i,o;return n=1==t.length?u.parentOfType(t[0],["ul","ol"]):u.commonAncestor.apply(null,t),n||(n=u.parentOfType(t[0],["p","td"])||t[0].ownerDocument.body),u.isInline(n)&&(n=u.blockParentOrBody(n)),i=f(t,u.editableParent),o=u.commonAncestor(i)[0],e.contains(n,o)&&(n=o),n},closestEditable:function(t,n){var i=u.parentOfType(t,n),o=u.editableParent(t);return i&&o&&e.contains(i,o)?i=o:!i&&o&&(i=o),i},closestEditableOfType:function(e,t){var n=u.closestEditable(e,t);return n&&u.ofType(n,t)?n:void 0},filter:function(e,t,n){for(var i,o=0,r=t.length,a=[];r>o;o++)i=u.name(t[o]),(!n&&i==e||n&&i!=e)&&a.push(t[o]);return a},ensureTrailingBreaks:function(t){var n=e(t).find("p,td,th"),i=n.length,o=0;if(i)for(;i>o;o++)u.ensureTrailingBreak(n[o]);else u.ensureTrailingBreak(t)},ensureTrailingBreak:function(e){var t,n=e.lastChild&&u.name(e.lastChild);(!n||"br"!=n&&"img"!=n)&&(t=e.ownerDocument.createElement("br"),t.setAttribute("_moz_dirty",!0),e.appendChild(t))}},p.ui.editor.Dom=u}(window.kendo.jQuery),function(e,t){var n,i,o=window.kendo,r=o.ui.editor,a=r.Dom,s=e.extend,l="xx-small,x-small,small,medium,large,x-large,xx-large".split(","),d=/"/g,c=/<br[^>]*>/i,u=/^\d+(\.\d*)?(px)?$/i,p=/<p><\/p>/i,f=/([\w|\-]+)\s*:\s*([^;]+);?/i,h=/^sizzle-\d+/i,g=/\s*onerror\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/i,m=document.createElement("div");m.innerHTML=" <hr>",n=3===m.firstChild.nodeType,m=null,i={toEditableHtml:function(e){return e=e||"",e.replace(/<!\[CDATA\[(.*)?\]\]>/g,"<!--[CDATA[$1]]-->").replace(/<script([^>]*)>(.*)?<\/script>/gi,"<telerik:script$1>$2</telerik:script>").replace(/<img([^>]*)>/gi,function(e){return e.replace(g,"")}).replace(/(<\/?img[^>]*>)[\r\n\v\f\t ]+/gi,"$1")},_fillEmptyElements:function(t){e(t).find("p").each(function(){var t,n=e(this);if(/^\s*$/g.test(n.text())&&!n.find("img,input").length){for(t=this;t.firstChild&&3!=t.firstChild.nodeType;)t=t.firstChild;1!=t.nodeType||a.empty[a.name(t)]||(t.innerHTML=o.ui.editor.emptyElementContent)}})},_removeSystemElements:function(t){e(".k-paste-container",t).remove()},_resetOrderedLists:function(e){var t,n,i,o=e.getElementsByTagName("ol");for(t=0;o.length>t;t++)n=o[t],i=n.getAttribute("start"),n.setAttribute("start",1),i?n.setAttribute("start",i):n.removeAttribute(i)},htmlToDom:function(t,n){var r,s,l=o.support.browser,d=l.msie,c=d&&9>l.version;return t=i.toEditableHtml(t),c&&(t="<br/>"+t,r="originalsrc",s="originalhref",t=t.replace(/href\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,s+'="$1"'),t=t.replace(/src\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,r+'="$1"')),n.innerHTML=t,c?(a.remove(n.firstChild),e(n).find("telerik\\:script,script,link,img,a").each(function(){var e=this;e[s]&&(e.setAttribute("href",e[s]),e.removeAttribute(s)),e[r]&&(e.setAttribute("src",e[r]),e.removeAttribute(r))})):d&&(a.normalize(n),i._resetOrderedLists(n)),i._fillEmptyElements(n),i._removeSystemElements(n),e("table",n).addClass("k-table"),n},domToXhtml:function(i,o){function r(t){var n,i,o,r,s=e.trim,l=s(t).split(";"),c=l.length;for(n=0,c=l.length;c>n;n++)l[n].length&&(i=f.exec(l[n]),i&&(o=s(i[1].toLowerCase()),r=s(i[2]),"font-size-adjust"!=o&&"font-stretch"!=o&&(o.indexOf("color")>=0?r=a.toHex(r):o.indexOf("font")>=0?r=r.replace(d,"'"):/\burl\(/g.test(r)&&(r=r.replace(d,"")),_.push(o),_.push(":"),_.push(r),_.push(";"))))}function s(n){var i,o,s,l,d,c,p,f,g,m=[],v=n.attributes;for(a.is(n,"img")&&(p=n.style.width,f=n.style.height,g=e(n),p&&u.test(p)&&(g.attr("width",parseInt(p,10)),a.unstyle(n,{width:t})),f&&u.test(f)&&(g.attr("height",parseInt(f,10)),a.unstyle(n,{height:t}))),o=0,s=v.length;s>o;o++)i=v[o],l=i.nodeName,d=i.nodeValue,c=i.specified,"value"==l&&"value"in n&&n.value?c=!0:"type"==l&&"text"==d?c=!0:"class"!=l||d?h.test(l)?c=!1:"complete"==l?c=!1:"altHtml"==l?c=!1:"start"==l&&(a.is(n,"ul")||a.is(n,"ol"))?c=!1:l.indexOf("_moz")>=0&&(c=!1):c=!1,c&&m.push(i);if(m.length)for(m.sort(function(e,t){return e.nodeName>t.nodeName?1:t.nodeName>e.nodeName?-1:0}),o=0,s=m.length;s>o;o++)i=m[o],l=i.nodeName,d=i.nodeValue,("class"!=l||"k-table"!=d)&&(_.push(" "),_.push(l),_.push('="'),"style"==l?r(d||n.style.cssText):"src"==l||"href"==l?_.push(n.getAttribute(l,2)):_.push(a.fillAttrs[l]?l:d),_.push('"'))}function g(e,t,n){for(var i=e.firstChild;i;i=i.nextSibling)v(i,t,n)}function m(e){return e.nodeValue.replace(/\ufeff/g,"")}function v(e,i,r){var l,d,c,u,p,f=e.nodeType;if(1==f){if(l=a.name(e),!l||a.insignificant(e))return;if(a.isInline(e)&&1==e.childNodes.length&&3==e.firstChild.nodeType&&!m(e.firstChild))return;if(d=k[l])return d.start(e),g(e,!1,d.skipEncoding),d.end(e),t;_.push("<"),_.push(l),s(e),a.empty[l]?_.push(" />"):(_.push(">"),g(e,i||a.is(e,"pre")),_.push("</"),_.push(l),_.push(">"))}else 3==f?(u=m(e),!i&&n&&(c=e.parentNode,p=e.previousSibling,p||(p=(a.isInline(c)?c:e).previousSibling),(!p||""===p.innerHTML||a.isBlock(p))&&(u=u.replace(/^[\r\n\v\f\t ]+/,"")),u=u.replace(/ +/," ")),_.push(r?u:a.encode(u,o))):4==f?(_.push("<![CDATA["),_.push(e.data),_.push("]]>")):8==f&&(e.data.indexOf("[CDATA[")<0?(_.push("<!--"),_.push(e.data),_.push("-->")):(_.push("<!"),_.push(e.data),_.push(">")))}var _=[],k={"telerik:script":{start:function(e){_.push("<script"),s(e),_.push(">")},end:function(){_.push("</script>")},skipEncoding:!0},b:{start:function(){_.push("<strong>")},end:function(){_.push("</strong>")}},i:{start:function(){_.push("<em>")},end:function(){_.push("</em>")}},u:{start:function(){_.push('<span style="text-decoration:underline;">')},end:function(){_.push("</span>")}},iframe:{start:function(e){_.push("<iframe"),s(e),_.push(">")},end:function(){_.push("</iframe>")}},font:{start:function(e){var t,n,i;_.push('<span style="'),t=e.getAttribute("color"),n=l[e.getAttribute("size")],i=e.getAttribute("face"),t&&(_.push("color:"),_.push(a.toHex(t)),_.push(";")),i&&(_.push("font-face:"),_.push(i),_.push(";")),n&&(_.push("font-size:"),_.push(n),_.push(";")),_.push('">')},end:function(){_.push("</span>")}}};return 1==i.childNodes.length&&3==i.firstChild.nodeType?a.encode(m(i.firstChild).replace(/[\r\n\v\f\t ]+/," "),o):(g(i),_=_.join(""),""===_.replace(c,"").replace(p,"")?"":_)}},s(r,{Serializer:i})}(window.kendo.jQuery),function(e){function t(e,t,n,i){var o,r,a,s;
  if(e==t)return i-n;for(o=t;o&&o.parentNode!=e;)o=o.parentNode;if(o)return f(o)-n;for(o=e;o&&o.parentNode!=t;)o=o.parentNode;if(o)return i-f(o)-1;for(r=p.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 i(e){try{return t(e.startContainer,e.endContainer,e.startOffset,e.endOffset)<0}catch(n){return!0}}i(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 i(e){e.collapsed=e.startContainer==e.endContainer&&e.startOffset==e.endOffset;for(var t=e.startContainer;t&&t!=e.endContainer&&!p.isAncestorOf(t,e.endContainer);)t=t.parentNode;e.commonAncestorContainer=t}function o(e){var t=e.duplicate(),n=e.duplicate();return t.collapse(!0),n.collapse(!1),p.commonAncestor(e.parentElement(),t.parentElement(),n.parentElement())}function r(e,t,n){var i,o=t[n?"startContainer":"endContainer"],r=t[n?"startOffset":"endOffset"],a=0,s=h(o),l=s?o:o.childNodes[r]||null,d=s?o.parentNode:o,c=t.ownerDocument,u=c.body.createTextRange();(3==o.nodeType||4==o.nodeType)&&(a=r),d||(d=c.body),"img"==d.nodeName.toLowerCase()?(u.moveToElementText(d),u.collapse(!1),e.setEndPoint(n?"StartToStart":"EndToStart",u)):(i=d.insertBefore(p.create(c,"a"),l),u.moveToElementText(i),p.remove(i),u[n?"moveStart":"moveEnd"]("character",a),u.collapse(!1),e.setEndPoint(n?"StartToStart":"EndToStart",u))}function a(e,t,n,i){var o,r,a,s,l,d,c,u=p.create(t.ownerDocument,"a"),g=e.duplicate(),m=i?"StartToStart":"StartToEnd",v=!1;u.innerHTML="﻿",g.collapse(i),r=g.parentElement(),p.isAncestorOrSelf(n,r)||(r=n);do v?r.insertBefore(u,u.previousSibling):(r.appendChild(u),v=!0),g.moveToElementText(u);while((o=g.compareEndPoints(m,e))>0&&u.previousSibling);a=u.nextSibling,-1==o&&h(a)?(g.setEndPoint(i?"EndToStart":"EndToEnd",e),p.remove(u),d=[a,g.text.length]):(s=!i&&u.previousSibling,l=i&&u.nextSibling,h(l)?d=[l,0]:h(s)?d=[s,s.length]:(c=f(u),d=r.nextSibling&&c==r.childNodes.length-1?[r.nextSibling,0]:[r,c]),p.remove(u)),t[i?"setStart":"setEnd"].apply(t,d)}var s=window.kendo,l=s.Class,d=e.extend,c=s.ui.editor,u=s.support.browser,p=c.Dom,f=p.findNodeIndex,h=p.isDataNode,g=p.findClosestAncestor,m=p.getNodeLength,v=p.normalize,_={selectionFromWindow:function(e){return"getSelection"in e?e.getSelection():new w(e.document)},selectionFromRange:function(e){var t=S.documentFromRange(e);return _.selectionFromDocument(t)},selectionFromDocument:function(e){return _.selectionFromWindow(p.windowFromDocument(e))}},k=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,i(this),n(this,!0)},setEnd:function(e,t){this.endContainer=e,this.endOffset=t,i(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(g(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=S.documentFromRange(this);return function t(n){for(var i,o=e.createDocumentFragment();i=n.next();)i=i.cloneNode(!n.hasPartialSubtree()),n.hasPartialSubtree()&&i.appendChild(t(n.getSubtreeIterator())),o.appendChild(i);return o}(new b(this))},extractContents:function(){var e,t=this,n=t.cloneRange();return t.startContainer!=t.commonAncestorContainer&&t.setStartAfter(g(t.commonAncestorContainer,t.startContainer)),t.collapse(!0),e=S.documentFromRange(t),function i(n){for(var o,r=e.createDocumentFragment();o=n.next();)n.hasPartialSubtree()?(o=o.cloneNode(!1),o.appendChild(i(n.getSubtreeIterator()))):n.remove(t.originalRange),r.appendChild(o);return r}(new b(n))},insertNode:function(e){var t=this;h(t.startContainer)?(t.startOffset!=t.startContainer.nodeValue.length&&p.splitDataNode(t.startContainer,t.startOffset),p.insertAfter(e,t.startContainer)):p.insertAt(t.startContainer,e,t.startOffset),t.setStart(t.startContainer,t.startOffset)},cloneRange:function(){return e.extend(new k(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+")"}}),b=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||h(t.startContainer)?g(n,t.startContainer):t.startContainer.childNodes[t.startOffset],this._end=t.endContainer!=n||h(t.endContainer)?g(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,h(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 i._current=i._next,i._next=i._current&&i._current.nextSibling!=i._end?i._current.nextSibling:null,i._current}for(var n,i=this;n=t();)i.hasPartialSubtree()?i.getSubtreeIterator().traverse(e):e(n);return n},remove:function(e){var t,n,i,o,r,a=this,s=a.range.startContainer==a._current,l=a.range.endContainer==a._current;h(a._current)&&(s||l)?(t=s?a.range.startOffset:0,n=l?a.range.endOffset:a._current.length,i=n-t,e&&(s||l)&&(a._current==e.startContainer&&e.startOffset>=t&&(e.startOffset-=i),a._current==e.endContainer&&e.endOffset>=n&&(e.endOffset-=i)),a._current.deleteData(t,i)):(o=a._current.parentNode,!e||a.range.startContainer!=o&&a.range.endContainer!=o||(r=f(a._current),o==e.startContainer&&e.startOffset>=r&&(e.startOffset-=1),o==e.endContainer&&e.endOffset>r&&(e.endOffset-=1)),p.remove(a._current))},hasPartialSubtree:function(){return!h(this._current)&&(p.isAncestorOrSelf(this._current,this.range.startContainer)||p.isAncestorOrSelf(this._current,this.range.endContainer))},getSubtreeIterator:function(){var e=this,t=e.range.cloneRange();return t.selectNodeContents(e._current),p.isAncestorOrSelf(e._current,e.range.startContainer)&&t.setStart(e.range.startContainer,e.range.startOffset),p.isAncestorOrSelf(e._current,e.range.endContainer)&&t.setEnd(e.range.endContainer,e.range.endOffset),new b(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(){var e=this.ownerDocument.selection;"None"!=e.type&&e.empty()},getRangeAt:function(){var e,t,n,i,r,s,l,d,c=new k(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(p){return c}if("Control"==u.type)c.selectNode(e.item(0));else if(n=o(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),i=c.startContainer,r=c.endContainer,s=this.ownerDocument.body,!(c.collapsed||0!==c.startOffset||c.endOffset!=m(c.endContainer)||i==r&&h(i)&&i.parentNode==s)){for(l=!1,d=!1;0===f(i)&&i==i.parentNode.firstChild&&i!=s;)i=i.parentNode,l=!0;for(;f(r)==m(r.parentNode)-1&&r==r.parentNode.lastChild&&r!=s;)r=r.parentNode,d=!0;i==s&&r==s&&l&&d&&(c.setStart(i,0),c.setEnd(r,m(s)))}return c}}),y=l.extend({init:function(e){this.enumerate=function(){function t(e){if(p.is(e,"img")||3==e.nodeType&&(!p.isWhitespace(e)||"﻿"==e.nodeValue))n.push(e);else for(e=e.firstChild;e;)t(e),e=e.nextSibling}var n=[];return new b(e).traverse(t),n}}}),x=l.extend({init:function(e,t){var n=this;n.range=e,n.rootNode=S.documentFromRange(e),n.body=t||n.getEditable(e),"body"!=p.name(n.body)&&(n.rootNode=n.body),n.html=n.body.innerHTML,n.startContainer=n.nodeToPath(e.startContainer),n.endContainer=n.nodeToPath(e.endContainer),n.startOffset=n.offset(e.startContainer,e.startOffset),n.endOffset=n.offset(e.endContainer,e.endOffset)},index:function(e){for(var t,n=0,i=e.nodeType;e=e.previousSibling;)t=e.nodeType,(3!=t||i!=t)&&n++,i=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,i){for(var o=this.rootNode,r=n.length,a=i;r--;)o=o.childNodes[n[r]];for(;3==o.nodeType&&a>o.nodeValue.length;)a-=o.nodeValue.length,o=o.nextSibling;e[t?"setStart":"setEnd"](o,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}}),C=l.extend({init:function(){this.caret=null},addCaret:function(e){var t=this;return t.caret=p.create(S.documentFromRange(e),"span",{className:"k-marker"}),e.insertNode(t.caret),e.selectNode(t.caret),t.caret},removeCaret:function(e){var t,n,i,o,r=this,a=r.caret.previousSibling,s=0;a&&(s=h(a)?a.nodeValue.length:f(a)),t=r.caret.parentNode,n=a?f(a):0,p.remove(r.caret),v(t),i=t.childNodes[n],h(i)?e.setStart(i,s):i?(o=p.lastTextNode(i),o?e.setStart(o,o.nodeValue.length):e[a?"setStartAfter":"setStartBefore"](i)):(u.msie||t.innerHTML||(t.innerHTML='<br _moz_dirty="" />'),e.selectNodeContents(t)),e.collapse(!0)},add:function(e,t){var n,i,o=this,r=e.collapsed&&!S.isExpandable(e),a=S.documentFromRange(e);return t&&e.collapsed&&(o.addCaret(e),e=S.expand(e)),n=e.cloneRange(),n.collapse(!1),o.end=p.create(a,"span",{className:"k-marker"}),n.insertNode(o.end),n=e.cloneRange(),n.collapse(!0),o.start=o.end.cloneNode(!0),n.insertNode(o.start),o._removeDeadMarkers(o.start,o.end),r&&(i=a.createTextNode("﻿"),p.insertAfter(i.cloneNode(),o.start),p.insertBefore(i,o.end)),e.setStartBefore(o.start),e.setEndAfter(o.end),v(e.commonAncestorContainer),e},_removeDeadMarkers:function(e,t){e.previousSibling&&"﻿"==e.previousSibling.nodeValue&&p.remove(e.previousSibling),t.nextSibling&&"﻿"==t.nextSibling.nodeValue&&p.remove(t.nextSibling)},remove:function(e){var t,n,i,o,r,a,s,l,d,c,u,g,m,_=this,k=_.start,b=_.end;for(v(e.commonAncestorContainer);!k.nextSibling&&k.parentNode;)k=k.parentNode;for(;!b.previousSibling&&b.parentNode;)b=b.parentNode;if(t=k.previousSibling&&3==k.previousSibling.nodeType&&k.nextSibling&&3==k.nextSibling.nodeType,n=b.previousSibling&&3==b.previousSibling.nodeType&&b.nextSibling&&3==b.nextSibling.nodeType,i=t&&n,k=k.nextSibling,b=b.previousSibling,o=!1,r=!1,k==_.end&&(r=!!_.start.previousSibling,k=b=_.start.previousSibling||_.end.nextSibling,o=!0),p.remove(_.start),p.remove(_.end),!k||!b)return e.selectNodeContents(e.commonAncestorContainer),e.collapse(!0),void 0;if(a=o?h(k)?k.nodeValue.length:k.childNodes.length:0,s=h(b)?b.nodeValue.length:b.childNodes.length,3==k.nodeType)for(;k.previousSibling&&3==k.previousSibling.nodeType;)k=k.previousSibling,a+=k.nodeValue.length;if(3==b.nodeType)for(;b.previousSibling&&3==b.previousSibling.nodeType;)b=b.previousSibling,s+=b.nodeValue.length;for(l=f(k),d=k.parentNode,c=f(b),u=b.parentNode,g=k;g.previousSibling;g=g.previousSibling)3==g.nodeType&&3==g.previousSibling.nodeType&&l--;for(m=b;m.previousSibling;m=m.previousSibling)3==m.nodeType&&3==m.previousSibling.nodeType&&c--;v(d),3==k.nodeType&&(k=d.childNodes[l]),v(u),3==b.nodeType&&(b=u.childNodes[c]),o?(3==k.nodeType?e.setStart(k,a):e[r?"setStartAfter":"setStartBefore"](k),e.collapse(!0)):(3==k.nodeType?e.setStart(k,a):e.setStartBefore(k),3==b.nodeType?e.setEnd(b,s):e.setEndAfter(b)),_.caret&&_.removeCaret(e)}}),T=/[\u0009-\u000d]|\u0020|\u00a0|\ufeff|\.|,|;|:|!|\(|\)|\?/,S={nodes:function(e){var t=S.textNodes(e);return t.length||(e.selectNodeContents(e.commonAncestorContainer),t=S.textNodes(e),t.length||(t=p.significantChildNodes(e.commonAncestorContainer))),t},textNodes:function(e){return new y(e).enumerate()},documentFromRange:function(e){var t=e.startContainer;return 9==t.nodeType?t:t.ownerDocument},createRange:function(e){return u.msie&&9>u.version?new k(e):e.createRange()},selectRange:function(e){var t,n=S.image(e);n&&(e.setStartAfter(n),e.setEndAfter(n)),t=_.selectionFromRange(e),t.removeAllRanges(),t.addRange(e)},stringify:function(e){return s.format("{0}:{1} - {2}:{3}",p.name(e.startContainer),e.startOffset,p.name(e.endContainer),e.endOffset)},split:function(e,t,n){function i(i){var o,r=e.cloneRange();r.collapse(i),r[i?"setStartBefore":"setEndAfter"](t),o=r.extractContents(),n&&(o=p.trim(o)),p[i?"insertBefore":"insertAfter"](o,t)}i(!0),i(!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){p.is(e,"img")&&t.push(e)}),1==t.length?t[0]:void 0},expand:function(e){var t,n,i,o,r=e.cloneRange(),a=r.startContainer.childNodes[0===r.startOffset?0:r.startOffset-1],s=r.endContainer.childNodes[r.endOffset];return h(a)&&h(s)?(t=a.nodeValue,n=s.nodeValue,t&&n?(i=t.split("").reverse().join("").search(T),o=n.search(T),i&&o?(o=-1==o?n.length:o,i=-1==i?0:t.length-i,r.setStart(a,i),r.setEnd(s,o),r):r):r):r},isExpandable:function(e){var t,n,i,o,r,a,s=e.startContainer,l=S.documentFromRange(e);return s==l||s==l.body?!1:(t=e.cloneRange(),(n=s.nodeValue)?(i=n.substring(0,t.startOffset),o=n.substring(t.startOffset),r=0,a=0,i&&(r=i.split("").reverse().join("").search(T)),o&&(a=o.search(T)),r&&a):!1)}};d(c,{SelectionUtils:_,W3CRange:k,RangeIterator:b,W3CSelection:w,RangeEnumerator:y,RestorePoint:x,Marker:C,RangeUtils:S})}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,i=t.ui.editor,o=i.EditorUtils,r=o.registerTool,a=i.Dom,s=i.Tool,l=i.ToolTemplate,d=i.RestorePoint,c=i.Marker,u=e.extend,p=n.extend({init:function(e){this.options=e,this.restorePoint=new d(e.range),this.marker=new c,this.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,i){var o=this.editor;return e(n).appendTo(document.body).kendoWindow(u({},o.options.dialogOptions,i)).closest(".k-window").toggleClass("k-rtl",t.support.isRtl(o.wrapper)).end()},exec:function(){var e=this.lockRange(!0);this.formatter.editor=this.editor,this.formatter.toggle(e),this.releaseRange(e)}}),f=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())}}),h=p.extend({init:function(e){p.fn.init.call(this,e),this.managesUndoRedo=!0},exec:function(){var e,t=this.editor,n=this.options,i=n.range,o=t.body,r=new d(i,o),a=n.html||n.value||"";t.selectRange(i),t.clipboard.paste(a,n),n.postProcess&&n.postProcess(t,t.getRange()),e=new f(r,new d(t.getRange(),o)),e.editor=t,t.undoRedoStack.push(e),t.focus()}}),g=s.extend({initialize:function(e,t){var n=t.editor,o=this.options,r=o.items?o.items:n.options.insertHtml;new i.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 h(e)},update:function(e){var t=e.data("kendoSelectBox")||e.find("select").data("kendoSelectBox");t.close(),t.value(t.options.title)}}),m=n.extend({init:function(){this.stack=[],this.currentCommandIndex=-1},push:function(e){this.stack=this.stack.slice(0,this.currentCommandIndex+1),this.currentCommandIndex=this.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,i=this,o=i.editor,r=o.keyboard,a=r.isTypingKey(t),s=u(e.Event(),t);return i.editor.trigger("keydown",s),s.isDefaultPrevented()&&t.preventDefault(),s.isDefaultPrevented()||!a||r.isTypingInProgress()?!1:(n=o.getRange(),i.startRestorePoint=new d(n),r.startTyping(function(){o.selectionRestorePoint=i.endRestorePoint=new d(o.getRange());var e=new f(i.startRestorePoint,i.endRestorePoint);e.editor=o,o.undoRedoStack.push(e)}),!0)},keyup:function(e){var t=this.editor.keyboard;return this.editor.trigger("keyup",e),t.isTypingInProgress()?(t.endTyping(),!0):!1}}),_=n.extend({init:function(e){this.editor=e,this.systemCommandIsInProgress=!1},createUndoCommand:function(){var e,t=this;t.endRestorePoint=new d(t.editor.getRange()),e=new f(t.startRestorePoint,t.endRestorePoint),e.editor=t.editor,t.editor.undoRedoStack.push(e),t.startRestorePoint=t.endRestorePoint},changed:function(){return this.startRestorePoint?this.startRestorePoint.html!=this.editor.body.innerHTML:!1},keydown:function(e){var t=this,n=t.editor,i=n.keyboard;return i.isModifierKey(e)?(i.isTypingInProgress()&&i.endTyping(!0),t.startRestorePoint=new d(n.getRange()),!0):i.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}}),k=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||229==e},toolFromShortcut:function(t,n){var i,o,r=String.fromCharCode(n.keyCode);for(i in t)if(o=e.extend({ctrl:!1,alt:!1,shift:!1},t[i].options),(o.key==r||o.key==n.keyCode)&&o.ctrl==n.ctrlKey&&o.alt==n.altKey&&o.shift==n.shiftKey)return i},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,i=this.handlers;for(n=0;i.length>n&&!i[n][t](e);n++);},keydown:function(e){this.notify(e,"keydown")},keyup:function(e){this.notify(e,"keyup")}}),b=n.extend({init:function(e){this.editor=e,this.cleaners=[new y,new x,new C]},htmlToFragment:function(e){var t=this.editor,n=t.document,i=a.create(n,"div"),o=n.createDocumentFragment();for(i.innerHTML=e;i.firstChild;)o.appendChild(i.firstChild);return o},isBlock:function(e){return/<(div|p|ul|ol|table|h[1-6])/i.test(e)},_contentModification:function(e,t){var n,i,o=this,r=o.editor;o._inProgress||(o._inProgress=!0,n=r.getRange(),i=new d(n),a.persistScrollTop(r.document),e.call(o,r,n),setTimeout(function(){var e,a;t.call(o,r,n),e=new d(r.getRange()),a=new f(i,e),a.editor=r,r.undoRedoStack.push(a),r._selectionChange(),o._inProgress=!1}))},oncut:function(){this._contentModification(e.noop,e.noop)},onpaste:function(t){this._contentModification(function(n,i){var o,r,s,l=a.create(n.document,"div",{className:"k-paste-container",innerHTML:"﻿"});n.body.appendChild(l),n.body.createTextRange?(t.preventDefault(),o=n.createRange(),o.selectNodeContents(l),n.selectRange(o),r=n.body.createTextRange(),r.moveToElementText(l),e(n.body).unbind("paste"),r.execCommand("Paste"),e(n.body).bind("paste",e.proxy(this.onpaste,this))):(s=n.createRange(),s.selectNodeContents(l),n.selectRange(s)),i.deleteContents()},function(t,n){var i,o="",r={html:""};t.selectRange(n),i=e(t.body).children(".k-paste-container"),i.each(function(){var e=this.lastChild;e&&a.is(e,"br")&&a.remove(e),o+=this.innerHTML}),i.remove(),o=o.replace(/\ufeff/g,""),r.html=o,t.trigger("paste",r),t.clipboard.paste(r.html,{clean:!0})})},splittableParent:function(e,t){var n,i;if(e)return a.closestEditableOfType(t,["p","ul","ol"])||t.parentNode;if(n=t.parentNode,i=t.ownerDocument.body,a.isInline(n))for(;n.parentNode!=i&&!a.isBlock(n.parentNode);)n=n.parentNode;return n},paste:function(t,n){var o,r,s,l,d,p,f,h,g,m,v,_=this.editor;for(n=u({clean:!1,split:!0},n),o=0,r=this.cleaners.length;r>o;o++)this.cleaners[o].applicable(t)&&(t=this.cleaners[o].clean(t));if(n.clean&&(t=t.replace(/(<br>(\s|&nbsp;)*)+(<\/?(div|p|li|col|t))/gi,"$3"),t=t.replace(/<(a|span)[^>]*><\/\1>/gi,"")),t=t.replace(/^<li/i,"<ul><li").replace(/li>$/g,"li></ul>"),s=this.isBlock(t),_.focus(),l=_.getRange(),l.deleteContents(),l.startContainer==_.document&&l.selectNodeContents(_.body),d=new c,p=d.addCaret(l),f=this.splittableParent(s,p),h=!1,g=f!=_.body&&!a.is(f,"td"),n.split&&g&&(s||a.isInline(f))&&(l.selectNode(p),i.RangeUtils.split(l,f,!0),h=!0),m=this.htmlToFragment(t),m.firstChild&&"k-paste-container"===m.firstChild.className){for(v=[],o=0,r=m.childNodes.length;r>o;o++)v.push(m.childNodes[o].innerHTML);m=this.htmlToFragment(v.join("<br />"))}if(e(m.childNodes).filter("table").addClass("k-table").end().find("table").addClass("k-table"),l.insertNode(m),f=this.splittableParent(s,p),h){for(;p.parentNode!=f;)a.unwrap(p.parentNode);a.unwrap(p.parentNode)}a.normalize(l.commonAncestorContainer),p.style.display="inline",a.restoreScrollTop(_.document),a.scrollTo(p),d.removeCaret(l),_.selectRange(l)}}),w=n.extend({clean:function(e){var t,n,i=this,o=i.replacements;for(t=0,n=o.length;n>t;t+=2)e=e.replace(o[t],o[t+1]);return e}}),y=w.extend({init:function(){this.replacements=[/<(\/?)script([^>]*)>/i,"<$1telerik:script$2>"]},applicable:function(e){return/<script[^>]*>/i.test(e)}}),x=w.extend({init:function(){this.replacements=[/<\?xml[^>]*>/gi,"",/<!--(.|\n)*?-->/g,"",/&quot;/g,"'",/(?:<br>&nbsp;[\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>&nbsp;[\s\r\n]+|<br>)*/g,"$1",/<br><br>/g,"<BR><BR>",/<br>(?!\n)/g," ",/<table([^>]*)>(\s|&nbsp;)+<t/gi,"<table$1><t",/<tr[^>]*>(\s|&nbsp;)*<\/tr>/gi,"",/<tbody[^>]*>(\s|&nbsp;)*<\/tbody>/gi,"",/<table[^>]*>(\s|&nbsp;)*<\/table>/gi,"",/<BR><BR>/g,"<br>",/^\s*(&nbsp;)+/gi,"",/(&nbsp;|<br[^>]*>)+\s*$/gi,"",/mso-[^;"]*;?/gi,"",/<(\/?)b(\s[^>]*)?>/gi,"<$1strong$2>",/<(\/?)i(\s[^>]*)?>/gi,"<$1em$2>",/<o:p>&nbsp;<\/o:p>/gi,"&nbsp;",/<\/?(meta|link|style|o:|v:|x:)[^>]*>((?:.|\n)*?<\/(meta|link|style|o:|v:|x:)[^>]*>)?/gi,"",/<\/o>/g,"",/style=(["|'])\s*\1/g,"",/(<br[^>]*>)?\n/g,function(e,t){return t?e:" "}]},applicable:function(e){return/class="?Mso|style="[^"]*mso-/i.test(e)||/urn:schemas-microsoft-com:office/.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(/&nbsp;/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,i,o,r,s,l,d,c,u,p=e(a.blockElements.join(","),t),f=-1,h={ul:{},ol:{}},g=t;for(o=0;p.length>o;o++)if(r=p[o],s=this.listType(r.innerHTML),i=a.name(r),"td"!=i)if(s&&"p"==i){if(l=parseFloat(r.style.marginLeft||0),d=h[s][l],(l>f||!d)&&(d=a.create(document,s),g==t?a.insertBefore(d,r):g.appendChild(d),h[s][l]=d),n!=s)for(c in h)for(u in h[c])e.contains(d,h[c][u])&&delete h[c][u];a.remove(r.firstChild),g=a.create(document,"li",{innerHTML:r.innerHTML}),d.appendChild(g),a.remove(r),f=l,n=s}else r.innerHTML?(h={ul:{},ol:{}},g=t,f=-1):a.remove(r)},removeAttributes:function(e){for(var t=e.attributes,n=t.length;n--;)"colspan"!=a.name(t[n])&&e.removeAttributeNode(t[n])},createColGroup:function(n){var i=n.cells,o=e(n).closest("table"),r=o.children("colgroup");2>i.length||(r.length&&(i=r.children(),r[0].parentNode.removeChild(r[0])),r=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("")),r.is("colgroup")||(r=e("<colgroup/>").append(r)),r.prependTo(o))},convertHeaders:function(t){var n,i=t.cells,o=e.map(i,function(t){var n=e(t).children("p").children("strong")[0];return n&&"strong"==a.name(n)?n:void 0});if(o.length==i.length){for(n=0;o.length>n;n++)a.unwrap(o[n]);for(e(t).closest("table").find("colgroup").after("<thead></thead>").end().find("thead").append(t),n=0;i.length>n;n++)a.changeTag(i[n],"th")}},removeParagraphs:function(t){var n,i,o,r,s;for(n=0;t.length>n;n++)for(this.removeAttributes(t[n]),r=e(t[n]),s=r.children("p"),i=0,o=s.length;o>i;i++)o-1>i&&a.insertAfter(a.create(document,"br"),s[i]),a.unwrap(s[i])},removeDefaultColors:function(e){for(var t=0;e.length>t;t++)/^\s*color:\s*[^;]*;?$/i.test(e[t].style.cssText)&&a.unwrap(e[t])},tables:function(t){var n,i,o,r,a,s=e(t).find("table"),l=this;for(r=0;s.length>r;r++){for(n=s[r].rows,o=i=n[0],a=1;n.length>a;a++)n[a].cells.length>o.cells.length&&(o=n[a]);l.createColGroup(o),l.convertHeaders(i),l.removeAttributes(s[r]),l.removeParagraphs(s.eq(r).find("td,th")),l.removeDefaultColors(s.eq(r).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,"$1")}}),C=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(i,{Command:p,GenericCommand:f,InsertHtmlCommand:h,InsertHtmlTool:g,UndoRedoStack:m,TypingHandler:v,SystemHandler:_,Keyboard:k,Clipboard:b,Cleaner:w,MSWordFormatCleaner:x,WebkitFormatCleaner:C}),r("insertHtml",new g({template:new l({template:o.dropDownListTemplate,title:"Insert HTML",initialValue:"Insert HTML"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,i=t.ui.editor,o=t.ui.Editor.fn.options.formats,r=i.EditorUtils,a=i.Tool,s=i.ToolTemplate,l=i.FormatTool,d=i.Dom,c=i.RangeUtils,u=e.extend,p=i.EditorUtils.registerTool,f=i.EditorUtils.registerFormat,h="k-marker",g=n.extend({init:function(e){this.format=e},numberOfSiblings:function(e){var t,n=0,i=0,o=0,r=e.parentNode;for(t=r.firstChild;t;t=t.nextSibling)t!=e&&(t.className==h?o++:3==t.nodeType?n++:i++);return o>1&&r.firstChild.className==h&&r.lastChild.className==h?0:i+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,i,o,r,a=this.format,s=d.attrEquals;for(t=0,n=a.length;n>t;t++){if(i=e,o=a[t].tags,r=a[t].attr,i&&d.ofType(i,o)&&s(i,r))return i;for(;i;)if(i=d.parentOfType(i,o),i&&s(i,r))return i}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}}),m=n.extend({init:function(e,t){var n=this;n.finder=new g(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,i,o,r=this,a=[];for(t=0,n=e.length;n>t;t++)i=e[t],o=r.finder.findSuitable(i),o?d.attr(o,r.attributes):o=r.wrap(i),a.push(o);r.consolidate(a)},remove:function(e){var t,n,i,o=this;for(t=0,n=e.length;n>t;t++)i=o.finder.findFormat(e[t]),i&&(o.attributes&&o.attributes.style?(d.unstyle(i,o.attributes.style),i.style.cssText||i.attributes["class"]||d.unwrap(i)):d.unwrap(i))},split:function(e){var t,n,i=c.textNodes(e),o=i.length;if(o>0)for(t=0;o>t;t++)n=this.finder.findFormat(i[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==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);d.remove(t)}}}),v=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,i,o,r,a,s,l,c,u,p,f,h,g=t.attributes,m=e.trim;if(g)for(n=0,i=g.length;i>n;n++)if(o=g[n],r=o.nodeName,a=o.nodeValue,o.specified&&"style"==r)for(s=m(a||t.style.cssText).split(";"),c=0,u=s.length;u>c;c++)if(l=s[c],l.length){if(p=l.split(":"),f=m(p[0].toLowerCase()),h=m(p[1]),f!=this.greedyProperty)continue;return f.indexOf("color")>=0?d.toHex(h):h}},getFormatInner:function(t){var n,i,o,r=e(d.isDataNode(t)?t.parentNode:t),a=r.parentsUntil("[contentEditable]").addBack();for(n=0,i=a.length;i>n;n++)if(o="className"==this.greedyProperty?a[n].className:this.getInlineCssValue(a[n]))return o;return"inherit"},getFormat:function(e){var t,n,i=this.getFormatInner(e[0]);for(t=1,n=e.length;n>t;t++)if(i!=this.getFormatInner(e[t]))return"";return i},isFormatted:function(e){return""!==this.getFormat(e)}}),_=m.extend({init:function(e,n,i){m.fn.init.call(this,e,n),this.values=n,this.finder=new v(e,i),i&&(this.greedyProperty=t.toCamelCase(i))},activate:function(e,t){var n=this.greedyProperty,i="apply";this.split(e),n&&"inherit"==this.values.style[n]&&(i="remove"),this[i](t)}}),k=l.extend({init:function(e){l.fn.init.call(this,u(e,{finder:new g(e.format),formatter:function(){return new m(e.format)}}))}}),b=a.extend({update:function(e,t){var n=e.data(this.type);n.close(),n.value(this.finder.getFormat(t))}}),w=b.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,o={};return new i.FormatCommand(u(e,{formatter:function(){return o[t.domAttr]=e.value,new _(n,{style:o},t.cssAttr)}}))},initialize:function(e,t){var n,i=t.editor,o=this.options,r=o.name,s=[];o.defaultValue&&(s=[{text:i.options.messages[o.defaultValue[0].text],value:o.defaultValue[0].value}]),n=s.concat(o.items?o.items:i.options[r]),e[this.type]({dataTextField:"text",dataValueField:"value",dataSource:n,change:function(){a.exec(i,r,this.value())
  },highlightFirst:!1}),e.closest(".k-widget").removeClass("k-"+r).find("*").addBack().attr("unselectable","on"),e.data(this.type).value("inherit")}}),y=a.extend({init:function(e){a.fn.init.call(this,e),this.format=[{tags:["span"]}],this.finder=new v(this.format,e.cssAttr)},options:{palette:"websafe"},update:function(){this._widget.close()},command:function(e){var t=this.options,n=this.format,o={};return new i.FormatCommand(u(e,{formatter:function(){return o[t.domAttr]=e.value,new _(n,{style:o},t.cssAttr)}}))},initialize:function(n,i){var o=i.editor,r=this.name,s=u({},y.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(o,r,e),o.focus()},activate:function(e){e.preventDefault(),n.trigger("change")}}),n.wrapper.attr({title:i.title,unselectable:"on"}).find("*").attr("unselectable","on")}});u(i,{InlineFormatFinder:g,InlineFormatter:m,DelayedExecutionTool:b,GreedyInlineFormatFinder:v,GreedyInlineFormatter:_,InlineFormatTool:k,FontTool:w,ColorTool:y}),f("bold",[{tags:["strong","b"]},{tags:["span"],attr:{style:{fontWeight:"bold"}}}]),p("bold",new k({key:"B",ctrl:!0,format:o.bold,template:new s({template:r.buttonTemplate,title:"Bold"})})),f("italic",[{tags:["em","i"]},{tags:["span"],attr:{style:{fontStyle:"italic"}}}]),p("italic",new k({key:"I",ctrl:!0,format:o.italic,template:new s({template:r.buttonTemplate,title:"Italic"})})),f("underline",[{tags:["span"],attr:{style:{textDecoration:"underline"}}},{tags:["u"]}]),p("underline",new k({key:"U",ctrl:!0,format:o.underline,template:new s({template:r.buttonTemplate,title:"Underline"})})),f("strikethrough",[{tags:["del","strike"]},{tags:["span"],attr:{style:{textDecoration:"line-through"}}}]),p("strikethrough",new k({format:o.strikethrough,template:new s({template:r.buttonTemplate,title:"Strikethrough"})})),f("superscript",[{tags:["sup"]}]),p("superscript",new k({format:o.superscript,template:new s({template:r.buttonTemplate,title:"Superscript"})})),f("subscript",[{tags:["sub"]}]),p("subscript",new k({format:o.subscript,template:new s({template:r.buttonTemplate,title:"Subscript"})})),p("foreColor",new y({cssAttr:"color",domAttr:"color",name:"foreColor",template:new s({template:r.colorPickerTemplate,title:"Color"})})),p("backColor",new y({cssAttr:"background-color",domAttr:"backgroundColor",name:"backColor",template:new s({template:r.colorPickerTemplate,title:"Background Color"})})),p("fontName",new w({cssAttr:"font-family",domAttr:"fontFamily",name:"fontName",defaultValue:[{text:"fontNameInherit",value:"inherit"}],template:new s({template:r.comboBoxTemplate,title:"Font Name"})})),p("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,i=e.extend,o=t.ui.editor,r=t.ui.Editor.fn.options.formats,a=o.Dom,s=o.Command,l=o.ToolTemplate,d=o.FormatTool,c=o.EditorUtils,u=c.registerTool,p=c.registerFormat,f=o.RangeUtils,h=n.extend({init:function(e){this.format=e},contains:function(e,t){var n,i,o;for(n=0,i=t.length;i>n;n++)if(o=t[n],!o||!a.isAncestorOrSelf(e,o))return!1;return!0},findSuitable:function(t){var n,i,o,r,s=this.format,l=[];for(n=0,i=t.length;i>n;n++){for(r=s.length-1;r>=0&&!(o=a.ofType(t[n],s[r].tags)?t[n]:a.parentOfType(t[n],s[r].tags));r--);if(!o||"true"===o.contentEditable)return[];e.inArray(o,l)<0&&l.push(o)}for(n=0,i=l.length;i>n;n++)if(this.contains(l[n],l))return[l[n]];return l},findFormat:function(e){var t,n,i,o,r,s=this.format;for(t=0,n=s.length;n>t;t++)for(i=e,o=s[t].tags,r=s[t].attr;i;){if(a.ofType(i,o)&&a.attrEquals(i,r))return i;i=i.parentNode}return null},getFormat:function(e){var t,n,i=this,o=function(e){return i.findFormat(a.isDataNode(e)?e.parentNode:e)},r=o(e[0]);if(!r)return"";for(t=1,n=e.length;n>t;t++)if(r!=o(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 i,o,r,s,l,d=1==n.length?a.blockParentOrBody(n[0]):a.commonAncestor.apply(null,n);for(a.isInline(d)&&(d=a.blockParentOrBody(d)),i=a.significantChildNodes(d),o=a.findNodeIndex(i[0]),r=a.create(d.ownerDocument,e,t),s=0;i.length>s;s++)l=i[s],a.isBlock(l)?(a.attr(l,t),r.childNodes.length&&(a.insertBefore(r,l),r=r.cloneNode(!1)),o=a.findNodeIndex(l)+1):r.appendChild(l);r.firstChild&&a.insertAt(d,r,o)},apply:function(t){function n(e){return i({},e&&e.attr,u)}var o,r,s,l,d,u=this.values,p=a.filter("img",t),f=c.formatByName("img",this.format),h=n(f);if(e.each(p,function(){a.attr(this,h)}),p.length!=t.length)if(r=a.filter("img",t,!0),s=this.finder.findSuitable(r),s.length)for(l=0,d=s.length;d>l;l++)o=c.formatByName(a.name(s[l]),this.format),a.attr(s[l],n(o));else o=this.format[0],this.wrap(o.tags[0],n(o),r)},remove:function(e){var t,n,i,o,r;for(t=0,n=e.length;n>t;t++)i=this.finder.findFormat(e[t]),i&&(r=a.name(i),"div"!=r||i.getAttribute("class")?(o=c.formatByName(r,this.format),o.attr.style&&a.unstyle(i,o.attr.style),o.attr.className&&a.removeClass(i,o.attr.className)):a.unwrap(i))},toggle:function(e){var t=this,n=f.nodes(e);t.finder.isFormatted(n)?t.remove(n):t.apply(n)}}),m=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,i,r,s,l,d,c=this.format,u=a.blockParents(e),p=c[0].tags[0];if(u.length)for(t=0,n=u.length;n>t;t++)d=a.name(u[t]),"li"==d?(i=u[t].parentNode,r=new o.ListFormatter(i.nodeName.toLowerCase(),p),s=this.editor.createRange(),s.selectNode(u[t]),r.toggle(s)):p&&("td"==d||u[t].attributes.contentEditable)?new g(c,this.values).apply(u[t].childNodes):(l=a.changeTag(u[t],p),a.attr(l,c[0].attr));else new g(c,this.values).apply(e)},toggle:function(e){var t=f.textNodes(e);t.length||(e.selectNodeContents(e.commonAncestorContainer),t=f.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)}}),_=d.extend({init:function(e){d.fn.init.call(this,i(e,{finder:new h(e.format),formatter:function(){return new g(e.format)}}))}});i(o,{BlockFormatFinder:h,BlockFormatter:g,GreedyBlockFormatter:m,FormatCommand:v,BlockFormatTool:_}),p("justifyLeft",[{tags:a.blockElements,attr:{style:{textAlign:"left",listStylePosition:""}}},{tags:["img"],attr:{style:{"float":"left",display:"",marginLeft:"",marginRight:""}}}]),u("justifyLeft",new _({format:r.justifyLeft,template:new l({template:c.buttonTemplate,title:"Justify Left"})})),p("justifyCenter",[{tags:a.nonListBlockElements,attr:{style:{textAlign:"center"}}},{tags:["img"],attr:{style:{display:"block",marginLeft:"auto",marginRight:"auto","float":""}}},{tags:["ul","ol","li"],attr:{style:{textAlign:"center",listStylePosition:"inside"}}}]),u("justifyCenter",new _({format:r.justifyCenter,template:new l({template:c.buttonTemplate,title:"Justify Center"})})),p("justifyRight",[{tags:a.nonListBlockElements,attr:{style:{textAlign:"right"}}},{tags:["img"],attr:{style:{"float":"right",display:"",marginLeft:"",marginRight:""}}},{tags:["ul","ol","li"],attr:{style:{textAlign:"right",listStylePosition:"inside"}}}]),u("justifyRight",new _({format:r.justifyRight,template:new l({template:c.buttonTemplate,title:"Justify Right"})})),p("justifyFull",[{tags:a.blockElements,attr:{style:{textAlign:"justify",listStylePosition:""}}}]),u("justifyFull",new _({format:r.justifyFull,template:new l({template:c.buttonTemplate,title:"Justify Full"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=e.extend,i=t.ui.editor,o=i.Dom,r=i.Command,a=i.Tool,s=i.BlockFormatter,l=o.normalize,d=i.RangeUtils,c=i.EditorUtils.registerTool,u=r.extend({init:function(e){this.options=e,r.fn.init.call(this,e)},_insertMarker:function(e,t){var n,i=o.create(e,"a");return i.className="k-marker",t.insertNode(i),i.parentNode||(n=t.commonAncestorContainer,n.innerHTML="",n.appendChild(i)),l(i.parentNode),i},_moveFocus:function(e,t){if(o.is(t,"img"))e.setStartBefore(t);else{e.selectNodeContents(t);var n=d.textNodes(e)[0];if(n)e.selectNodeContents(n);else{for(;t.childNodes.length&&!o.is(t.firstChild,"br");)t=t.firstChild;e.selectNodeContents(t)}}},shouldTrim:function(e){var t="p,h1,h2,h3,h4,h5,h6".split(","),n=o.parentOfType(e.startContainer,t),i=o.parentOfType(e.endContainer,t);return n&&!i||!n&&i},_blankAfter:function(e){for(;e&&(o.isMarker(e)||""===o.stripBom(e.nodeValue));)e=e.nextSibling;return!e},exec:function(){var e,t,n,r,a,c,u,p,f=this.getRange(),h=d.documentFromRange(f),g=i.emptyElementContent,m=this.shouldTrim(f);f.deleteContents(),a=this._insertMarker(h,f),c=o.closestEditableOfType(a,["li"]),u=o.closestEditableOfType(a,"h1,h2,h3,h4,h5,h6".split(",")),c?o.emptyNode(c)&&(r=o.create(h,"p"),c.nextSibling&&(p=f.cloneRange(),p.selectNode(c),d.split(p,c.parentNode)),o.insertAfter(r,c.parentNode),o.remove(1==c.parentNode.childNodes.length?c.parentNode:c),r.innerHTML=g,n=r):u&&this._blankAfter(a)&&(r=o.create(h,"p"),o.insertAfter(r,u),r.innerHTML=g,o.remove(a),n=r),n||(c||u||new s([{tags:["p"]}]).apply([a]),f.selectNode(a),e=o.parentOfType(a,[c?"li":u?o.name(u):"p"]),d.split(f,e,m),t=e.previousSibling,o.is(t,"li")&&t.firstChild&&!o.is(t.firstChild,"br")&&(t=t.firstChild),n=e.nextSibling,o.is(n,"li")&&n.firstChild&&!o.is(n.firstChild,"br")&&(n=n.firstChild),o.remove(e),this.clean(t),this.clean(n,{links:!0}),l(t)),l(n),this._moveFocus(f,n),f.collapse(!0),o.scrollTo(n),d.selectRange(f)},clean:function(e,t){var n=e;if(e.firstChild&&o.is(e.firstChild,"br")&&o.remove(e.firstChild),o.isDataNode(e)&&!e.nodeValue&&(e=e.parentNode),e){for(;e.firstChild&&1==e.firstChild.nodeType;)e=e.firstChild;if(!o.isEmpty(e)&&/^\s*$/.test(e.innerHTML)&&(e.innerHTML=i.emptyElementContent),t&&t.links)for(;e!=n;){if(o.is(e,"a")){o.unwrap(e);break}e=e.parentNode}}}}),p=r.extend({init:function(e){this.options=e,r.fn.init.call(this,e)},exec:function(){var e,n=this.getRange(),i=o.create(d.documentFromRange(n),"br");n.deleteContents(),n.insertNode(i),l(i.parentNode),t.support.browser.msie||i.nextSibling&&!o.isWhitespace(i.nextSibling)||(e=i.cloneNode(!0),e.setAttribute("_moz_dirty",""),o.insertAfter(e,i)),n.setStartAfter(i),n.collapse(!0),o.scrollTo(i.nextSibling||i),d.selectRange(n)}});n(i,{ParagraphCommand:u,NewLineCommand:p}),c("insertLineBreak",new a({key:13,shift:!0,command:p})),c("insertParagraph",new a({key:13,command:u}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,i=e.extend,o=t.ui.editor,r=o.Dom,a=o.RangeUtils,s=o.EditorUtils,l=o.Command,d=o.ToolTemplate,c=o.FormatTool,u=o.BlockFormatFinder,p=a.textNodes,f=o.EditorUtils.registerTool,h=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,i=[];for(n=0;e.length>n;n++)(t=this.findFormat(e[n]))&&r.name(t)==this.tag&&i.push(t);if(1>i.length)return!1;if(i.length!=e.length)return!1;for(n=0;i.length>n&&i[n].parentNode==t.parentNode;n++)if(i[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}}),g=n.extend({init:function(e,t){var n=this;n.finder=new h(e),n.tag=e,n.unwrapTag=t},isList:function(e){var t=r.name(e);return"ul"==t||"ol"==t||"dl"==t},wrap:function(e,t){var n,i,o=r.create(e.ownerDocument,"li");for(n=0;t.length>n;n++)if(i=t[n],r.is(i,"li"))e.appendChild(i);else if(this.isList(i))for(;i.firstChild;)e.appendChild(i.firstChild);else if(r.is(i,"td")){for(;i.firstChild;)o.appendChild(i.firstChild);e.appendChild(o),i.appendChild(e),e=e.cloneNode(!1),o=o.cloneNode(!1)}else o.appendChild(i),r.isBlock(i)&&(e.appendChild(o),r.unwrap(i),o=o.cloneNode(!1));o.firstChild&&e.appendChild(o)},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,i,o,s,l,d,c=p(t);if(c.length)for(n=r.parentOfType(c[0],["li"]),i=r.parentOfType(c[c.length-1],["li"]),t.setStartBefore(n),t.setEndAfter(i),o=0,s=c.length;s>o;o++)l=this.finder.findFormat(c[o]),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,i=t.previousSibling;i&&("k-marker"==i.className||3==i.nodeType&&r.isWhitespace(i));)i=i.previousSibling;if(i&&r.name(i)==e){for(;t.firstChild;)i.appendChild(t.firstChild);r.remove(t),t=i}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)}},breakable:function(e){return e!=e.ownerDocument.body&&!/table|tbody|tr|td/.test(r.name(e))&&!e.attributes.contentEditable},applyOnSection:function(t,n){function i(){u.push(this)}var o,a,s,l,d=this.tag,c=r.closestSplittableParent(n),u=[],p=this.finder.findSuitable(n);for(p||(p=new h("ul"==d?"ol":"ul").findSuitable(n)),/table|tbody/.test(r.name(c))?o=e.map(n,function(e){return r.parentOfType(e,["td"])}):(o=r.significantChildNodes(c),e.grep(o,r.isBlock).length&&(o=e.grep(o,e.proxy(function(e){return this.containsAny(e,n)},this))),o.length||(o=n)),a=0;o.length>a;a++)s=o[a],l=(!p||!r.isAncestorOrSelf(p,s))&&this.suitable(s,n),l&&(p&&this.isList(s)?(e.each(s.childNodes,i),r.remove(s)):u.push(s));u.length==o.length&&this.breakable(c)&&(u=[c]),p||(p=r.create(c.ownerDocument,d),r.insertBefore(p,u[0])),this.wrap(p,u),r.is(p,d)||r.changeTag(p,d),this.merge(d,p)},apply:function(e){var t,n,i,o=0,a=[];do i=r.closestEditable(e[o],["td","body"]),t&&i==t?n.push(e[o]):(t&&a.push({section:t,nodes:n}),n=[e[o]],t=i),o++;while(e.length>o);for(a.push({section:t,nodes:n}),o=0;a.length>o;o++)this.applyOnSection(a[o].section,a[o].nodes)},unwrap:function(t){var n,i,o,a,s=t.ownerDocument.createDocumentFragment(),l=this.unwrapTag;for(i=t.firstChild;i;i=i.nextSibling){for(o=r.create(t.ownerDocument,l||"p");i.firstChild;)a=i.firstChild,r.isBlock(a)?(o.firstChild&&(s.appendChild(o),o=r.create(t.ownerDocument,l||"p")),s.appendChild(a)):o.appendChild(a);o.firstChild&&s.appendChild(o)}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,i;for(n=0,i=e.length;i>n;n++)t=this.finder.findFormat(e[n]),t&&this.unwrap(t)},toggle:function(e){var t,n=this,i=p(e),o=e.commonAncestorContainer;i.length||(e.selectNodeContents(o),i=p(e),i.length||(t=o.ownerDocument.createTextNode(""),e.startContainer.appendChild(t),i=[t],e.selectNode(t.parentNode))),n.finder.isFormatted(i)?(n.split(e),n.remove(i)):n.apply(i)}}),m=l.extend({init:function(e){e.formatter=new g(e.tag),l.fn.init.call(this,e)}}),v=c.extend({init:function(e){this.options=e,c.fn.init.call(this,i(e,{finder:new h(e.tag)}))},command:function(e){return new m(i(e,{tag:this.options.tag}))}});i(o,{ListFormatFinder:h,ListFormatter:g,ListCommand:m,ListTool:v}),f("insertUnorderedList",new v({tag:"ul",template:new d({template:s.buttonTemplate,title:"Insert unordered list"})})),f("insertOrderedList",new v({tag:"ol",template:new d({template:s.buttonTemplate,title:"Insert ordered list"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,i=e.extend,o=e.proxy,r=t.ui.editor,a=r.Dom,s=r.RangeUtils,l=r.EditorUtils,d=r.Command,c=r.Tool,u=r.ToolTemplate,p=r.InlineFormatter,f=r.InlineFormatFinder,h=s.textNodes,g=r.EditorUtils.registerTool,m=n.extend({findSuitable:function(e){return a.parentOfType(e,["a"])}}),v=n.extend({init:function(){this.finder=new m},apply:function(e,t){var n,i,o,r,l=h(e);t.innerHTML?(n=s.getMarkers(e),i=s.documentFromRange(e),e.deleteContents(),r=a.create(i,"a",t),e.insertNode(r),"a"==a.name(r.parentNode)&&a.insertAfter(r,r.parentNode),n.length>1&&(a.insertAfter(n[n.length-1],r),a.insertAfter(n[1],r),a[l.length>0?"insertBefore":"insertAfter"](n[0],r))):(o=new p([{tags:["a"]}],t),o.finder=this.finder,o.apply(l))}}),_=d.extend({init:function(e){e.formatter={toggle:function(e){new p([{tags:["a"]}]).remove(h(e))}},this.options=e,d.fn.init.call(this,e)}}),k=d.extend({init:function(e){var t=this;t.options=e,d.fn.init.call(t,e),t.formatter=new v,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 k-editor-link-text-row'><label for='k-editor-link-text'>#: messages.linkText #</label></div><div class='k-edit-field k-editor-link-text-row'><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\">#: messages.dialogCancel #</button></div></div>")({messages:this.editor.options.messages})},exec:function(){var t,n,i,r,s=this.getRange().collapsed,l=this.editor.options.messages;this._initialText="",this._range=this.lockRange(!0),t=h(this._range),n=t.length?this.formatter.finder.findSuitable(t[0]):null,i=t.length&&"img"==a.name(t[0]),r=this.createDialog(this._dialogTemplate(),{title:l.createLink,close:o(this._close,this),visible:!1}),r.find(".k-dialog-insert").click(o(this._apply,this)).end().find(".k-dialog-close").click(o(this._close,this)).end().find(".k-edit-field input").keydown(o(this._keydown,this)).end().find("#k-editor-link-url").val(this.linkUrl(n)).end().find("#k-editor-link-text").val(this.linkText(t)).end().find("#k-editor-link-title").val(n?n.title:"").end().find("#k-editor-link-target").attr("checked",n?"_blank"==n.target:!1).end().find(".k-editor-link-text-row").toggle(!i),t.length>0&&!s&&(this._initialText=e("#k-editor-link-text",r).val()),this._dialog=r.data("kendoWindow").center().open(),e("#k-editor-link-url",r).focus().select()},_keydown:function(e){var n=t.keys;e.keyCode==n.ENTER?this._apply(e):e.keyCode==n.ESC&&this._close(e)},_apply:function(t){var n,i,o,r=this._dialog.element,s=e("#k-editor-link-url",r).val(),l=e("#k-editor-link-text",r);s&&"http://"!=s&&(s.indexOf("@")>0&&!/^(\w+:)|(\/\/)/i.test(s)&&(s="mailto:"+s),this.attributes={href:s},n=e("#k-editor-link-title",r).val(),n&&(this.attributes.title=n),l.is(":visible")&&(i=l.val(),i||this._initialText?i&&i!==this._initialText&&(this.attributes.innerHTML=a.stripBom(i)):this.attributes.innerHTML=s),o=e("#k-editor-link-target",r).is(":checked"),this.attributes.target=o?"_blank":null,this.formatter.apply(this._range,this.attributes)),this._close(t),this.change&&this.change()},_close:function(e){e.preventDefault(),this._dialog.destroy(),a.windowFromDocument(s.documentFromRange(this._range)).focus(),this.releaseRange(this._range)},linkUrl:function(e){return e?e.getAttribute("href",2):"http://"},linkText:function(e){var t="";return 1==e.length?t=e[0].nodeValue:e.length&&(t=e[0].nodeValue+e[1].nodeValue),a.stripBom(t||"")},redo:function(){var e=this.lockRange(!0);this.formatter.apply(e,this.attributes),this.releaseRange(e)}}),b=c.extend({init:function(t){this.options=t,this.finder=new f([{tags:["a"]}]),c.fn.init.call(this,e.extend(t,{command:_}))},initialize:function(e,t){c.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")}});i(t.ui.editor,{LinkFormatFinder:m,LinkFormatter:v,UnlinkCommand:_,LinkCommand:k,UnlinkTool:b}),g("createLink",new c({key:"K",ctrl:!0,command:k,template:new u({template:l.buttonTemplate,title:"Create Link"})})),g("unlink",new b({key:"K",ctrl:!0,shift:!0,template:new u({template:l.buttonTemplate,title:"Remove Link"})}))}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=e.extend,o=n.ui.editor,r=o.EditorUtils,a=o.Dom,s=r.registerTool,l=o.ToolTemplate,d=o.RangeUtils,c=o.Command,u=n.keys,p="#k-editor-image-url",f="#k-editor-image-title",h="#k-editor-image-width",g="#k-editor-image-height",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,i=this.attributes,o=d.documentFromRange(t);if(i.src&&"http://"!=i.src){if(n=function(){setTimeout(function(){i.width||e.removeAttribute("width"),i.height||e.removeAttribute("height"),e.removeAttribute("complete")})},!e)return e=a.create(o,"img",i),e.onload=e.onerror=function(){n()},t.deleteContents(),t.insertNode(e),e.nextSibling||a.insertAfter(o.createTextNode("﻿"),e),n(),t.setStartAfter(e),t.setEndAfter(e),d.selectRange(t),!0;a.attr(e,i),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-label\'><label for="k-editor-image-width">#: messages.imageWidth #</label></div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-image-width"></div><div class=\'k-edit-label\'><label for="k-editor-image-height">#: messages.imageHeight #</label></div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-image-height"></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">#: 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 e(e){var t=s.element,n=parseInt(t.find(h).val(),10),i=parseInt(t.find(g).val(),10);l.attributes={src:t.find(p).val().replace(/ /g,"%20"),alt:t.find(f).val()},l.attributes.width=null,l.attributes.height=null,!isNaN(n)&&n>0&&(l.attributes.width=n),!isNaN(i)&&i>0&&(l.attributes.height=i),m=l.insertImage(v,c),o(e),l.change&&l.change()}function o(e){e.preventDefault(),s.destroy(),a.windowFromDocument(d.documentFromRange(c)).focus(),m||l.releaseRange(c)}function r(t){t.keyCode==u.ENTER?e(t):t.keyCode==u.ESC&&o(t)}var s,l=this,c=l.lockRange(),m=!1,v=d.image(c),_=v&&v.getAttribute("width")||"",k=v&&v.getAttribute("height")||"",b=l.editor.options,w=b.messages,y=b.imageBrowser,x=!!(n.ui.ImageBrowser&&y&&y.transport&&y.transport.read!==t);s=this.createDialog(l._dialogTemplate(x),{title:w.insertImage,close:o,visible:!1,resizable:x}).toggleClass("k-imagebrowser-dialog",x).find(".k-dialog-insert").click(e).end().find(".k-dialog-close").click(o).end().find(".k-edit-field input").keydown(r).end().find(p).val(v?v.getAttribute("src",2):"http://").end().find(f).val(v?v.alt:"").end().find(h).val(_).end().find(g).val(k).end().data("kendoWindow"),x&&new n.ui.ImageBrowser(s.element.find(".k-imagebrowser"),i({},y,{change:function(){s.element.find(p).val(this.value())},apply:e})),s.center().open(),s.element.find(p).focus().select()}});n.ui.editor.ImageCommand=m,s("insertImage",new o.Tool({command:m,template:new l({template:r.buttonTemplate,title:"Insert Image"})}))}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=n.ui.DropDownList,o=n.ui.editor.Dom,r=i.extend({init:function(e,t){var o=this;i.fn.init.call(o,e,t),o.value(o.options.title),n.support.mobileOS.ios&&o._initSelectOverlay(),o.bind("open",function(){if(o.options.autoSize){var e,t=o.list;t.css({whiteSpace:"nowrap",width:"auto"}),e=t.width(),e?e+=20:e=o._listWidth,t.css("width",e+n.support.scrollbar()),o._listWidth=e}})},options:{name:"SelectBox"},_initSelectOverlay:function(){var t=e(this.element),n=e("<select class='k-select-overlay' />"),i=t.closest(".k-widget"),o=this;n.on("change",function(){o.value(this.value),o.trigger("change")}),this.bind("dataBound",function(){var e,t,i=o.value(),r=this.dataSource.view(),a="";for(t=0;r.length>t;t++)e=r[t],a+="<option value='"+e.value+"'",e.value==i&&(a+=" selected"),a+=">"+e.text+"</option>";n.html(a)}),n.insertAfter(i)},value:function(e){var n=this,o=i.fn.value.call(n,e);return e===t?o:(e!==i.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(t){var n,i,r,a,s=this,l=s.dataSource,d=l.data();for(t&&s.list.css("background-color",o.getEffectiveBackground(e(t))),n=0;d.length>n;n++)i=d[n].tag||"span",r=d[n].className,a=o.inlineStyle(t,i,{className:r}),a=a.replace(/"/g,"'"),d[n].style=a+";display:inline-block";l.trigger("change")}});n.ui.plugin(r),n.ui.editor.SelectBox=r}(window.kendo.jQuery),function(e,t){function n(n,i){var o="rtl"==e(n).css("direction"),r=o?"Right":"Left",a="td"!=s.name(n)?"margin"+r:"padding"+r;return i===t?n.style[a]||0:(i>0?n.style[a]=i+"px":(n.style[a]="",n.style.cssText||n.removeAttribute("style")),t)}var i=window.kendo,o=i.Class,r=e.extend,a=i.ui.editor,s=a.Dom,l=a.EditorUtils,d=l.registerTool,c=a.Command,u=a.Tool,p=a.ToolTemplate,f=a.RangeUtils,h=s.blockElements,g=a.BlockFormatFinder,m=a.BlockFormatter,v=o.extend({init:function(){this.finder=new g([{tags:s.blockElements}])},apply:function(t){var i,o,r,a,l,d,c,u,p,f,h=this.finder.findSuitable(t),g=[];if(h.length){for(i=0,o=h.length;o>i;i++)s.is(h[i],"li")?e(h[i]).index()?e.inArray(h[i].parentNode,g)<0&&g.push(h[i]):g.push(h[i].parentNode):g.push(h[i]);for(;g.length;)if(r=g.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=g.shift();else for(u=parseInt(n(r),10)+30,n(r,u),p=0;g.length>p;p++)e.contains(r,g[p])&&g.splice(p,1)}else f=new m([{tags:["p"]}],{style:{marginLeft:30}}),f.apply(t)},remove:function(t){var i,o,r,a,s,l,d,c,u=this.finder.findSuitable(t);for(o=0,r=u.length;r>o;o++){if(d=e(u[o]),d.is("li")){if(a=d.parent(),s=a.parent(),s.is("li,ul,ol")&&!n(a[0])){if(i&&e.contains(i,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(i==a[0])continue;i=a[0]}else i=u[o];c=parseInt(n(i),10)-30,n(i,c)}}}),_=c.extend({init:function(e){e.formatter={toggle:function(e){(new v).apply(f.nodes(e))}},c.fn.init.call(this,e)}}),k=c.extend({init:function(e){e.formatter={toggle:function(e){(new v).remove(f.nodes(e))}},c.fn.init.call(this,e)}}),b=u.extend({init:function(e){u.fn.init.call(this,e),this.finder=new g([{tags:h}])},initialize:function(e,t){u.fn.initialize.call(this,e,t),e.addClass("k-state-disabled")},update:function(i,o){var r,a,l,d,c=this.finder.findSuitable(o);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 i.removeClass("k-state-disabled"),t;i.addClass("k-state-disabled").removeClass("k-state-hover")}});r(a,{IndentFormatter:v,IndentCommand:_,OutdentCommand:k,OutdentTool:b}),d("indent",new u({command:_,template:new p({template:l.buttonTemplate,title:"Indent"})})),d("outdent",new b({command:k,template:new p({template:l.buttonTemplate,title:"Outdent"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=e.extend,i=t.ui.editor,o=i.EditorUtils,r=i.Command,a=i.Tool,s=i.ToolTemplate,l=r.extend({init:function(e){var t=this;t.options=e,r.fn.init.call(t,e),t.attributes=null,t.async=!0},exec:function(){function n(e){r.value(s.find(c).val()),i(e),o.change&&o.change(),r.trigger("change")}function i(e){e.preventDefault(),s.data("kendoWindow").destroy(),r.focus()}var o=this,r=o.editor,a=r.options.messages,s=e(t.template(l.template)(a)).appendTo(document.body),d=l.indent(r.value()),c=".k-editor-textarea";this.createDialog(s,{title:a.viewHtml,close:i,visible:!1}).find(c).val(d).end().find(".k-dialog-update").click(n).end().find(".k-dialog-close").click(i).end().data("kendoWindow").center().open(),s.find(c).focus()}});n(l,{template:"<div class='k-editor-dialog k-popup-edit-form k-edit-form-container k-viewhtml-dialog'><textarea class='k-editor-textarea k-input'></textarea><div class='k-edit-buttons k-state-default'><button class='k-dialog-update k-button'>#: dialogUpdate #</button><button class='k-dialog-close k-button'>#: dialogCancel #</button></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=l,i.EditorUtils.registerTool("viewHtml",new a({command:l,template:new s({template:o.buttonTemplate,title:"View HTML"})}))}(window.kendo.jQuery),function(e){function t(t,n,i){return c.extend({init:function(e){c.fn.init.call(this,e),this.finder=i},command:function(t){var i=t.value;return e.isPlainObject(i)?i[n]=i.value:(t.value={},t.value[n]=i),c.fn.command.call(this,t)},initialize:function(e,t){var i,o=window.console,r=this.options.items;for(i=0;r.length>i;i++)r[i][n]=r[i].value;o&&o.warn("The `"+this.options.name+"` tool has been deprecated in favor of the `formatting` tool. See http://docs.telerik.com/kendo-ui/getting-started/changes-and-backward-compatibility for more information"),c.fn.initialize.call(this,e,t)}})}var n=window.kendo,i=n.ui.editor,o=i.Tool,r=i.ToolTemplate,a=i.DelayedExecutionTool,s=i.Dom,l=i.EditorUtils.dropDownListTemplate,d=i.EditorUtils.registerTool,c=a.extend({init:function(e){var t=this;o.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(t){var n=t.value;return n=this.toFormattingItem(n),new i.FormatCommand({range:t.range,formatter:function(){var t,o=(n.tag||n.context||"span").split(","),r=[{tags:o,attr:{className:n.className||""}}];return t=e.inArray(o[0],s.inlineElements)>=0?new i.GreedyInlineFormatter(r):new i.GreedyBlockFormatter(r)}})},initialize:function(e,t){var i=t.editor,r=this.options,a=r.name,s=this;e.width(r.width),e.kendoSelectBox({dataTextField:"text",dataValueField:"value",dataSource:r.items||i.options[a],title:i.options.messages[a],autoSize:!0,change:function(){o.exec(i,a,this.dataItem().toJSON())},dataBound:function(){var e,t=this.dataSource.data();for(e=0;t.length>e;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 i,o,r,a,s,l,d;for(i=0;t.length>i;i++)if(o=t[i],r=o.tag||o.context||"",a=o.className?"."+o.className:"",s=r+a,l=e(n[0]).closest(s)[0]){if(1==n.length)return o.value;for(d=1;n.length>d&&e(n[d]).closest(s)[0];d++)if(d==n.length-1)return o.value}return""},update:function(t,n){var i,o,r,l,d,c=e(t).data(this.type);if(c){for(i=c.dataSource,o=i.data(),d=s.commonAncestor.apply(null,n),r=0;o.length>r;r++)l=o[r].context,o[r].visible=!l||!!e(d).closest(l).length;i.filter([{field:"visible",operator:"eq",value:!0}]),a.fn.update.call(this,t,n),c.value(this.getFormattingValue(i.view(),n)),c.wrapper.toggleClass("k-state-disabled",!i.view().length)}}}),u=t("style","className",new i.GreedyInlineFormatFinder([{tags:["span"]}],"className")),p=t("formatBlock","tag",new i.BlockFormatFinder([{tags:s.blockElements}]));e.extend(i,{FormattingTool:c,StyleTool:u,FormatBlockTool:p}),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 p({template:new r({template:l})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.ui,i=n.editor,o=n.Widget,r=e.extend,a=e.proxy,s=t.keys,l=".kendoEditor",d="a.k-tool:not(.k-state-disabled),.k-widget.k-colorpicker,.k-selectbox,.k-dropdown,.k-combobox .k-input",c=o.extend({init:function(e,t){var n=this;t=r({},t,{name:"EditorToolbar"}),o.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,i=this.groups;if(this.isCustomTool(t))return"custom";for(n in i)if(e.inArray(t,i[n])>=0)return n},bindTo:function(t){var n=this,i=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"),i=t.keyCode;i==s.RIGHT||i==s.LEFT?n.close():i==s.DOWN&&(n.dropDown.isOpened()||(t.stopImmediatePropagation(),n.open()))}),n._attachEvents(),n.items().each(function(){var i,o=n._toolName(this),r=n.tools[o],a=r&&r.options,s=t.options.messages,l=a&&a.tooltip||s[o],d=e(this);r&&r.initialize&&(("fontSize"==o||"fontName"==o)&&(i=s[o+"Inherit"],d.find("input").val(i).end().find("span.k-input").text(i).end()),r.initialize(d,{title:n._appendShortcutSequence(l,r),editor:n._editor}),d.closest(".k-widget",n.element).addClass("k-editor-widget"),d.closest(".k-colorpicker",n.element).next(".k-colorpicker").addClass("k-editor-widget"))}),t.bind("select",a(n._update,n)),n._updateContext(),i&&i.wrapper.css({top:"",left:"",width:""})},show:function(){var e,t,n=this,i=n.window,o=n.options.editor;i&&(e=i.wrapper,t=o.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)),i._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))),i.open()))},hide:function(){this.window&&this.window.close()},focus:function(){var e="tabIndex",t=this.element,n=this._editor.element.attr(e);t.attr(e,n||0).focus().find(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:{},isCustomTool:function(e){return!(e in t.ui.Editor.defaultTools)},expandTools:function(n){var o,a,s,l,d=this._nativeTools,c=t.deepExtend({},t.ui.Editor.defaultTools),u={};for(a=0;n.length>a;a++)o=n[a],l=o.name,e.isPlainObject(o)?l&&c[l]?(u[l]=r({},c[l]),r(u[l].options,o)):(s=r({cssClass:"k-i-custom",type:"button",title:""},o),s.name||(s.name="custom"),s.cssClass="k-"+("custom"==s.name?"i-custom":s.name),s.template||"button"!=s.type||(s.template=i.EditorUtils.buttonTemplate,s.title=s.title||s.tooltip),u[l]={options:s}):c[o]&&(u[o]=c[o]);for(a=0;d.length>a;a++)u[d[a]]||(u[d[a]]=c[d[a]]);return u},render:function(){function n(n){var i;return n.getHtml?i=n.getHtml():(e.isFunction(n)||(n=t.template(n)),i=n(r)),e.trim(i)}function i(){p.children().length&&p.appendTo(v)}function o(){p=e("<li class='k-tool-group' role='presentation' />")}var r,s,l,d,c,u,p,f,h=this,g=h.tools,m=h._editor.element,v=h.element.empty(),_=h._editor.options.tools,k=t.support.browser;for(v.empty(),o(),f=0;_.length>f;f++)d=_[f].name||_[f],r=g[d]&&g[d].options,!r&&e.isPlainObject(d)&&(r=d),s=r&&r.template,"break"==d&&(i(),e("<li class='k-row-break' />").appendTo(h.element),o()),s&&(u=h.toolGroupFor(d),c!=u&&(i(),o(),c=u),s=n(s),l=e(s).appendTo(p),"custom"==u&&(i(),o()),r.exec&&l.hasClass("k-tool")&&l.click(a(r.exec,m[0])));i(),e(h.element).children(":has(> .k-tool)").addClass("k-button-group"),h.options.popup&&k.msie&&9>k.version&&h.window.wrapper.find("*").attr("unselectable","on"),this.updateGroups()},updateGroups:function(){e(this.element).children().each(function(){e(this).children().filter(function(){return"none"!==this.style.display}).first().addClass("k-group-start").end().last().addClass("k-group-end").end()})},decorateFrom:function(t){this.items().filter(".k-decorated").each(function(){var n=e(this).data("kendoSelectBox");n&&n.decorate(t)})},destroy:function(){o.fn.destroy.call(this);var e,t=this.tools;for(e in t)t[e].destroy&&t[e].destroy();this.window&&this.window.destroy()},_attachEvents:function(){var t=this,n="[role=button].k-tool",i=n+":not(.k-state-disabled)",o=n+".k-state-disabled";t.element.off(l).on("mouseenter"+l,i,function(){e(this).addClass("k-state-hover")}).on("mouseleave"+l,i,function(){e(this).removeClass("k-state-hover")}).on("mousedown"+l,n,function(e){e.preventDefault()}).on("keydown"+l,d,function(n){function i(e,n){var i=t.element.find(d),o=i.index(r)+e;return n&&(o=Math.max(0,Math.min(i.length-1,o))),i[o]}var o,r=this,a=n.keyCode;a==s.RIGHT||a==s.LEFT?e(r).hasClass(".k-dropdown")||(o=i(a==s.RIGHT?1:-1,!0)):a==s.ESC?o=t._editor:a!=s.TAB||n.ctrlKey||n.altKey||(n.shiftKey?o=i(-1):(o=i(1),o||(o=t._editor))),o&&(n.preventDefault(),o.focus())}).on("click"+l,i,function(n){var i=e(this);n.preventDefault(),n.stopPropagation(),i.removeClass("k-state-hover"),i.is("[data-popup]")||t._editor.exec(t._toolName(this))}).on("click"+l,o,function(e){e.preventDefault()})},_toolName:function(t){var n,i;if(t)return n=t.className,/k-tool\b/i.test(n)&&(n=t.firstChild.className),i=e.grep(n.split(" "),function(e){return!/^k-(widget|tool|tool-icon|state-hover|header|combobox|dropdown|selectbox|colorpicker)$/i.test(e)}),i[0]?i[0].substring(i[0].lastIndexOf("-")+1):"custom"},_update:function(){var n=this,i=n._editor,o=i.getRange(),r=t.ui.editor.RangeUtils.textNodes(o);r.length||(r=[o.startContainer]),n.items().each(function(){var t=n.tools[n._toolName(this)];t&&t.update&&t.update(e(this),r)}),this._updateContext()},_updateContext:function(){this.element.children().children().each(function(){var t=e(this);t.css("display",t.hasClass("k-state-disabled")?"none":"")}),this.updateGroups()}});e.extend(i,{Toolbar:c})}(window.jQuery),function(e){var t=window.kendo,n=e.extend,i=e.proxy,o=t.ui.editor,r=o.Dom,a=o.EditorUtils,s=o.Command,l=".kendoEditor",d="k-state-active",c="k-state-selected",u=o.Tool,p=o.ToolTemplate,f=o.InsertHtmlCommand,h=o.BlockFormatFinder,g=o.EditorUtils.registerTool,m="<td>"+o.emptyElementContent+"</td>",v=new h([{tags:["table"]}]),_=f.extend({_tableHtml:function(e,t){return e=e||1,t=t||1,"<table class='k-table' data-last>"+Array(e+1).join("<tr>"+Array(t+1).join(m)+"</tr>")+"</table>"},postProcess:function(t,n){var i=e("table[data-last]",t.document).removeAttr("data-last");n.selectNodeContents(i.find("td")[0]),t.selectRange(n)},exec:function(){var e=this.options;e.html=this._tableHtml(e.rows,e.columns),e.postProcess=this.postProcess,f.fn.exec.call(this)}}),k=u.extend({initialize:function(t,n){u.fn.initialize.call(this,t,n);var o=e(this.options.popupTemplate).appendTo("body").kendoPopup({anchor:t,copyAnchorStyles:!1,open:i(this._open,this),activate:i(this._activate,this),close:i(this._close,this)}).data("kendoPopup");t.click(i(this._toggle,this)).keydown(i(this._keydown,this)),this._editor=n.editor,this._popup=o},popup:function(){return this._popup},_activate:e.noop,_open:function(){this._popup.options.anchor.addClass(d)},_close:function(){this._popup.options.anchor.removeClass(d)},_keydown:function(e){var n=t.keys,i=e.keyCode;i==n.DOWN&&e.altKey?this._popup.open():i==n.ESC&&this._popup.close()},_toggle:function(t){var n=e(t.target).closest(".k-tool");n.hasClass("k-state-disabled")||this.popup().toggle()},update:function(e){this.popup().close(),e.removeClass("k-state-hover")},destroy:function(){this._popup.destroy()}}),b=k.extend({init:function(t){this.cols=8,this.rows=6,k.fn.init.call(this,e.extend(t,{command:_,popupTemplate:"<div class='k-ct-popup'>"+Array(this.cols*this.rows+1).join("<span 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()-u.top)/o)+1,col:Math.floor((t.clientX+n.scrollLeft()-u.left)/i)+1}}var i,o,r=this,a=r._popup.element,s=a.find(".k-ct-cell"),d=s.eq(0),c=s.eq(s.length-1),u=t.getOffset(d),p=t.getOffset(c),f=r.cols,h=r.rows;p.left+=c[0].offsetWidth,p.top+=c[0].offsetHeight,i=(p.left-u.left)/f,o=(p.top-u.top)/h,a.on("mousemove"+l,function(e){r._setTableSize(n(e))}).on("mouseleave"+l,function(){r._setTableSize()}).on("mouseup"+l,function(e){r._exec(n(e))})},_valid:function(e){return e&&e.row>0&&e.col>0&&this.rows>=e.row&&this.cols>=e.col},_exec:function(e){this._valid(e)&&(this._editor.exec("createTable",{rows:e.row,columns:e.col}),this._popup.close())},_setTableSize:function(n){var i=this._popup.element,o=i.find(".k-status"),r=i.find(".k-ct-cell"),a=this.cols;this._valid(n)?(o.text(t.format("Create a {0} x {1} table",n.row,n.col)),r.each(function(t){e(this).toggleClass(c,n.col>t%a&&n.row>t/a)})):(o.text("Cancel"),r.removeClass(c))},_keydown:function(e){var n,i,o,r,a,s,l,d;k.fn._keydown.call(this,e),n=t.keys,i=e.keyCode,o=this._popup.element.find(".k-ct-cell"),r=Math.max(o.filter(".k-state-selected").last().index(),0),a=Math.floor(r/this.cols),s=r%this.cols,l=!1,i!=n.DOWN||e.altKey?i==n.UP?(l=!0,a--):i==n.RIGHT?(l=!0,s++):i==n.LEFT&&(l=!0,s--):(l=!0,a++),d={row:Math.max(1,Math.min(this.rows,a+1)),col:Math.max(1,Math.min(this.cols,s+1))},i==n.ENTER?this._exec(d):this._setTableSize(d),l&&(e.preventDefault(),e.stopImmediatePropagation())},_open:function(){k.fn._open.call(this),this.popup().element.find(".k-ct-cell").removeClass(c)},_close:function(){k.fn._close.call(this),this.popup().element.off(l)},update:function(e,t){var n;k.fn.update.call(this,e),n=v.isFormatted(t),e.toggleClass("k-state-disabled",n)}}),w=s.extend({exec:function(){for(var e,t,n,i,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),i=0;t.cells.length>i;i++)n.cells[i].innerHTML=o.emptyElementContent;"before"==this.options.position?r.insertBefore(n,t):r.insertAfter(n,t),this.releaseRange(a)}}),y=s.extend({exec:function(){var e,t,n,i,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;d.length>t;t++)n=d[t].cells[e],i=n.cloneNode(),i.innerHTML=o.emptyElementContent,"before"==c?r.insertBefore(i,n):r.insertAfter(i,n);this.releaseRange(a)}}),x=s.extend({exec:function(){var e,t=this.lockRange(),n=r.closest(t.endContainer,"tr"),i=r.closest(n,"table"),o=i.rows.length;1==o?(e=r.next(i)||r.prev(i),r.remove(i)):(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))}}),C=s.extend({exec:function(){var e,t,n=this.lockRange(),i=r.closest(n.endContainer,"td"),o=r.closest(i,"table"),a=o.rows,s=r.findNodeIndex(i,!0),l=a[0].cells.length;if(1==l)e=r.next(o)||r.prev(o),r.remove(o);else for(r.removeTextSiblings(i),e=r.next(i)||r.prev(i),t=0;a.length>t;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 x(e):new C(e):"row"==e.type?new w(e):new y(e)},initialize:function(e,t){u.fn.initialize.call(this,e,t),e.addClass("k-state-disabled")},update:function(e,t){var n=!v.isFormatted(t);e.toggleClass("k-state-disabled",n)}});n(t.ui.editor,{PopupTool:k,TableCommand:_,InsertTableTool:b,TableModificationTool:T,InsertRowCommand:w,InsertColumnCommand:y,DeleteRowCommand:x,DeleteColumnCommand:C}),g("createTable",new b({template:new p({template:a.buttonTemplate,popup:!0,title:"Create table"})})),g("addColumnLeft",new T({type:"column",position:"before",template:new p({template:a.buttonTemplate,title:"Add column on the left"})})),g("addColumnRight",new T({type:"column",template:new p({template:a.buttonTemplate,title:"Add column on the right"})})),g("addRowAbove",new T({type:"row",position:"before",template:new p({template:a.buttonTemplate,title:"Add row above"})})),g("addRowBelow",new T({type:"row",template:new p({template:a.buttonTemplate,title:"Add row below"})})),g("deleteRow",new T({type:"row",action:"delete",template:new p({template:a.buttonTemplate,title:"Delete row"})})),g("deleteColumn",new T({type:"column",action:"delete",template:new p({template:a.buttonTemplate,title:"Delete column"})}))}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});